LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File udunits2.spec of Package udunits2 (Project home:manfred999)

#
# spec file for package udunits2
#
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


Name:           udunits2
Version:        2.2.26
Release:        0
Summary:        A library for manipulating units of physical quantities
License:        MIT
Group:          Productivity/Scientific/Math
URL:            https://www.unidata.ucar.edu/software/udunits/
Source0:        ftp://ftp.unidata.ucar.edu/pub/udunits/udunits-%{version}.tar.gz
BuildRequires:  bison
#---cunit-devel not available on OpenSuse <=13.1 and Redhat dists, needed for unit tests:
%if 0%{?suse_version} > 1310 && 0%{?is_opensuse}
BuildRequires:  cunit-devel
%endif
%if 0%{?fedora_version}
BuildRequires:  expat-devel
%else
BuildRequires:  libexpat-devel
%endif

%description
The Unidata units utility, udunits, supports conversion of unit specifications
between formatted and binary forms, arithmetic manipulation of unit
specifications, and conversion of values between compatible scales of
measurement. A unit is the amount by which a physical quantity is measured. For
example:

                  Physical Quantity   Possible Unit
                  _________________   _____________
                        time              weeks
                      distance         centimeters
                        power             watts

This utility works interactively and has two modes. In one mode, both an input
and output unit specification are given, causing the utility to print the
conversion between them. In the other mode, only an input unit specification is
given. This causes the utility to print the definition -- in standard units --
of the input unit.

%package devel
Summary:        Headers and libraries for udunits
Group:          Development/Libraries/C and C++
Requires:       %{name} = %{version}-%{release}
Conflicts:      udunits < %{version}

%package -n udunits-compat
Summary:        Udunits2 compatibility layer for udunits v1
Group:          Development/Libraries/C and C++
Requires:       %{name} = %{version}-%{release}
Obsoletes:      udunits < %{version}
Provides:       udunits = %{version}

%package -n udunits-compat-devel
Summary:        Udunits2 compatibility layer for udunits v1
Group:          Development/Libraries/C and C++
Requires:       udunits-compat = %{version}-%{release}
Requires:       %{name}-devel = %{version}-%{release}
Obsoletes:      udunits-devel < %{version}
Provides:       udunits-devel = %{version}

%description devel
This package contains the files needed for compiling programs using
the udunits library.

%description -n udunits-compat
A compatibility layer allowing applications written for libudunits to
work with libudunits2.

%description -n udunits-compat-devel
This package contains the files needed for compiling programs using
the udunits2 compatibility library.

%prep
%setup -q -n udunits-%{version}

%build
%configure
make %{?_smp_mflags}

%install
make DESTDIR=%{buildroot} install install-html install-pdf

# Install info and doc
mkdir -p %{buildroot}%{_infodir}/
install -p -m0644 %{name}.info %{buildroot}%{_infodir}

#---We provide compat symlinks to provide udunits v1 API:
pushd %{buildroot}%{_libdir}
ln -s libudunits2.a libudunits.a
for f in libudunits2.so*; do
  ln -s "$f" "libudunits.so${f#*.so}"
done
popd
#---cleanup
find %{buildroot} -type f -name "*.la" -delete -print
rm -rf %{buildroot}%{_infodir}/dir

%check
make check

%post
%{run_ldconfig}
/sbin/install-info %{_infodir}/%{name}.info %{_infodir}/dir || :

%post -n udunits-compat
%{run_ldconfig}

%postun
%{run_ldconfig}

%postun -n udunits-compat
%{run_ldconfig}

%preun
if [ $1 = 0 ] ; then
  /sbin/install-info --delete %{_infodir}/%{name}.info %{_infodir}/dir || :
fi

%files
%license COPYRIGHT
%{_bindir}/%{name}
%{_datadir}/udunits/
%{_infodir}/%{name}*.info*
%{_libdir}/libudunits2.so.*
%doc ANNOUNCEMENT
%doc %{_datadir}/doc/udunits

%files devel
%{_includedir}/converter.h
%{_includedir}/udunits2.h
%{_libdir}/libudunits2.so
%{_libdir}/libudunits2.a

%files -n udunits-compat
%{_libdir}/libudunits.so.*

%files -n udunits-compat-devel
%{_includedir}/udunits.h
%{_libdir}/libudunits.so
%{_libdir}/libudunits.a

%changelog