diff --git a/arprec.spec b/arprec.spec index 1c611f7..cdc5093 100644 --- a/arprec.spec +++ b/arprec.spec @@ -1,20 +1,33 @@ -Name: arprec -Version: 2.2.17 -Release: 6%{?dist} -Summary: Software package for performing arbitrary precision arithmetic -%{?el5:Group: System Environment/Libraries} - -License: BSD -URL: http://crd.lbl.gov/~dhbailey/mpdist -Source0: %{url}/%{name}-%{version}.tar.gz -Source1: %{url}/BSD-LBNL-License.doc +# Do we generate the data-files? +%bcond_without mathinit + +# Are licenses packaged using %%license? +%if 0%{?fedora} >= 21 || 0%{?rhel} >= 8 +%bcond_without license_dir +%else # 0%%{?fedora} >= 21 || 0%%{?rhel} >= 8 +%bcond_with license_dir +%endif # 0%%{?fedora} >= 21 || 0%%{?rhel} >= 8 + +# Setup _pkgdocdir if not defined already. +%{!?_pkgdocdir:%global _pkgdocdir %{_docdir}/%{name}-%{version}} + +Name: arprec +Version: 2.2.18 +Release: 1%{?dist} +Summary: Software package for performing arbitrary precision arithmetic +%{?el5:Group: System Environment/Libraries} + +License: BSD +URL: http://crd.lbl.gov/~dhbailey/mpdist +Source0: %{url}/%{name}-%{version}.tar.gz +Source1: %{url}/BSD-LBNL-License.doc %{?el5:BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)} -BuildRequires: catdoc -BuildRequires: chrpath -BuildRequires: gcc-gfortran -BuildRequires: libtool -BuildRequires: qd-devel +BuildRequires: catdoc +BuildRequires: chrpath +BuildRequires: gcc-gfortran +BuildRequires: libtool +BuildRequires: qd-devel %description ARPREC is a software package for performing arbitrary precision @@ -56,8 +69,8 @@ techniques. Features include: %package data -Summary: Data files for %{name}-tools -%{?el5:Group: Applications/Engineering} +Summary: Data files for %{name}-tools +%{?el5:Group: Applications/Engineering} %{?!el5:BuildArch: noarch} @@ -66,10 +79,10 @@ This package contains data-files used with %{name}-tools. %package devel -Summary: Development files for %{name} -%{?el5:Group: Development/Libraries} +Summary: Development files for %{name} +%{?el5:Group: Development/Libraries} -Requires: %{name}%{?_isa} = %{version}-%{release} +Requires: %{name}%{?_isa} = %{version}-%{release} %{?el5:Requires: pkgconfig} %description devel @@ -77,8 +90,8 @@ This package contains the development files and headers for %{name}. %package doc -Summary: Documentation files for %{name} -%{?el5:Group: Documentation} +Summary: Documentation files for %{name} +%{?el5:Group: Documentation} %{?!el5:BuildArch: noarch} @@ -87,11 +100,11 @@ This package contains the documentation and some brief examples. %package tools -Summary: Interactive high-precision arithmetic computing environment -%{?el5:Group: Applications/Engineering} +Summary: Interactive high-precision arithmetic computing environment +%{?el5:Group: Applications/Engineering} -Requires: %{name}%{?_isa} = %{version}-%{release} -Requires: %{name}-data = %{version}-%{release} +Requires: %{name}%{?_isa} = %{version}-%{release} +Requires: %{name}-data = %{version}-%{release} %description tools This is a complete interactive high-precision arithmetic computing @@ -110,40 +123,40 @@ series. %setup -q # Pull-in upstream's .doc-license. -cp -a %{SOURCE1} . +%{__cp} -a %{SOURCE1} . # Create an user-friendly ascii-text from original .doc-license. -catdoc -d utf-8 %{SOURCE1} | sed -e 's!\f!!g' > BSD-LBNL-License.txt && \ -touch -r %{SOURCE1} BSD-LBNL-License.txt +%{_bindir}/catdoc -d utf-8 %{SOURCE1} | \ + %{__sed} -e 's!\f!!g' > BSD-LBNL-License.txt && \ + /bin/touch -r %{SOURCE1} BSD-LBNL-License.txt # Remove some unneeded and obsoleted files. -find . -depth -name '._*' -print0 | xargs -0 rm -rf -find . -depth -name '.[dD][sS]_[sS]tore' -print0 | xargs -0 rm -rf +%{_bindir}/find . -depth -name '._*' -print0 | %{_bindir}/xargs -0 %{__rm} -rf +%{_bindir}/find . -depth -name '.[dD][sS]_[sS]tore' -print0 | \ + %{_bindir}/xargs -0 %{__rm} -rf # The testsuite is a good example for using this lib. So let's store it's -# files in antoher location before they get cluttered with intermediate stuff. -cp -a tests examples -rm -rf examples/Makefile* +# files in another location before they get cluttered with intermediate stuff. +%{__cp} -a tests examples +%{__rm} -rf examples/Makefile* # Get all pre-build quads-data from mathinit. -sed -i -e 's!nquadopt = 1!nquadopt = 3!g' \ - toolkit/mathinit.f +%{__sed} -i -e 's!nquadopt = 1!nquadopt = 3!g' toolkit/mathinit.f # Use the pre-build data-files in mathtool. -sed -i -e 's!const\.dat!%{_datadir}/%{name}/&!g' \ - -e 's!quad.*\.dat!%{_datadir}/%{name}/&!g' \ - toolkit/mathtool.f +%{__sed} -i -e 's!const\.dat!%{_datadir}/%{name}/&!g' \ + -e 's!quad.*\.dat!%{_datadir}/%{name}/&!g' toolkit/mathtool.f # Make arprec-config multilib-friendly. Substitute original script # with a wrapper-script for pkg-config. -cat << EOS > arprec-config.rpmbuild +%{__cat} << EOS > arprec-config.rpmbuild #!/bin/sh # arprec-config. Generated during rpmbuild. pc=\`which pkg-config\` usage() { - cat < %{name}.pc +%{__cat} << EOF > %{name}.pc ############################ # Pkg-Config file for @name@ ############################ @@ -254,79 +267,94 @@ EOF # During the el5-build we need to correct some timestamps, because they are # broken in upstream's pristine tarballs. This is not needed for el6+, # because this will be taken care of by `autoupdate` and `autoreconf -fiv`. -%{?el5:touch -r aclocal.m4 configure configure.ac} -%{?!el5:autoupdate} -%{?!el5:autoreconf -fiv} +%{?el5:/bin/touch -r aclocal.m4 configure configure.ac} +%{?!el5:%{_bindir}/autoupdate} +%{?!el5:%{_bindir}/autoreconf -fiv} # Invoke the `regular` build-procedure. -%configure \ - --disable-static \ -%{?!el5:--enable-qd} \ +%configure \ + --disable-static \ +%{?!el5:--enable-qd} \ --enable-shared -make %{?_smp_mflags} -make %{?_smp_mflags} toolkit +%{__make} %{?_smp_mflags} +%{__make} %{?_smp_mflags} toolkit # Substitute @var@ in .pc-template from %%prep -chmod +x %{name}-config -sed -i -e 's!@prefix@!%{_prefix}!g' \ - -e 's!@bindir@!%{_bindir}!g' \ - -e 's!@datadir@!%{_datadir}!g' \ - -e 's!@name@!%{name}!g' \ - -e 's!@includedir@!%{_includedir}!g' \ - -e 's!@libdir@!%{_libdir}!g' \ - -e 's!@mandir@!%{_mandir}!g' \ - -e 's!@sharedstatedir@!%{_sharedstatedir}!g' \ - -e 's!@sysconfdir@!%{_sysconfdir}!g' \ - -e 's!@version@!%{version}!g' \ - -e 's!@summary@!Software package for performing arbitrary precision arithmetic!g' \ - -e "s~@libs@~$(./%{name}-config --libs)~g" \ - -e "s~@configure_args@~$(./%{name}-config --configure-args)~g" \ - -e "s~@cxx@~$(./%{name}-config --cxx)~g" \ - -e "s~@cxxflags@~$(./%{name}-config --cxxflags)~g" \ - -e "s~@fc@~$(./%{name}-config --fc)~g" \ - -e "s~@fcflags@~$(./%{name}-config --fcflags)~g" \ - -e "s~@fclibs@~$(./%{name}-config --fclibs)~g" \ - -e "s~@fmainlib@~$(./%{name}-config --fmainlib)~g" \ +%{__chmod} +x %{name}-config +%{__sed} -i -e 's!@prefix@!%{_prefix}!g' \ + -e 's!@bindir@!%{_bindir}!g' \ + -e 's!@datadir@!%{_datadir}!g' \ + -e 's!@name@!%{name}!g' \ + -e 's!@includedir@!%{_includedir}!g' \ + -e 's!@libdir@!%{_libdir}!g' \ + -e 's!@mandir@!%{_mandir}!g' \ + -e 's!@sharedstatedir@!%{_sharedstatedir}!g' \ + -e 's!@sysconfdir@!%{_sysconfdir}!g' \ + -e 's!@version@!%{version}!g' \ + -e 's!@summary@!Software package for performing arbitrary precision arithmetic!g' \ + -e "s~@libs@~$(./%{name}-config --libs)~g" \ + -e "s~@configure_args@~$(./%{name}-config --configure-args)~g" \ + -e "s~@cxx@~$(./%{name}-config --cxx)~g" \ + -e "s~@cxxflags@~$(./%{name}-config --cxxflags)~g" \ + -e "s~@fc@~$(./%{name}-config --fc)~g" \ + -e "s~@fcflags@~$(./%{name}-config --fcflags)~g" \ + -e "s~@fclibs@~$(./%{name}-config --fclibs)~g" \ + -e "s~@fmainlib@~$(./%{name}-config --fmainlib)~g" \ %{name}.pc -chmod -x %{name}-config +%{__chmod} -x %{name}-config # Pre-build the data-files for `mathtool`. pushd toolkit +%if %{with mathinit} ./mathinit +%else # %%{with mathinit} +/bin/touch const.dat quadgs.dat quaderf.dat quadts.dat +%endif # %%{with mathinit} popd %install -%{?el5:rm -rf %{buildroot}} -make install DESTDIR=%{buildroot} +%{?el5:%{__rm} -rf %{buildroot}} +%{__make} install DESTDIR=%{buildroot} # Remove unneeded and obsolete stuff. %%{name}-config will be replaced by the # new wrapper later. The pre-installed docs will be picked as %%doc within # %%files. The .la-dumpings from libtool are obsolete and not useful. -rm -rf %{buildroot}%{_bindir}/%{name}-config \ - %{buildroot}%{_datadir}/* \ - %{buildroot}%{_libdir}/*.la +%{__rm} -rf %{buildroot}%{_bindir}/%{name}-config \ + %{buildroot}%{_datadir}/* \ + %{buildroot}%{_libdir}/*.la # Create needed dirs. -mkdir -p %{buildroot}%{_datadir}/%{name} \ - %{buildroot}%{_libdir}/pkgconfig +%{__mkdir} -p %{buildroot}%{_datadir}/%{name} \ + %{buildroot}%{_libdir}/pkgconfig # There's no install-target for `mathtool`, so it must be install `by hand`. for tool in toolkit/.libs/math* do - install -pm 0755 ${tool} \ - %{buildroot}%{_bindir}/%{name}-`echo ${tool} | sed -e's!.*/!!g'` + %{__install} -pm 0755 ${tool} \ + %{buildroot}%{_bindir}/%{name}-`basename ${tool}` done # Install the custom arprec-config wrapper-script and the needed .pc-file. -install -pm 0755 %{name}-config.rpmbuild %{buildroot}%{_bindir}/%{name}-config -install -pm 0644 %{name}.pc %{buildroot}%{_libdir}/pkgconfig +%{__install} -pm 0755 %{name}-config.rpmbuild %{buildroot}%{_bindir}/%{name}-config +%{__install} -pm 0644 %{name}.pc %{buildroot}%{_libdir}/pkgconfig # Install the pre-build data-files for `mathtool`. -install -pm 0644 toolkit/*.dat %{buildroot}%{_datadir}/%{name} +%{__install} -pm 0644 toolkit/*.dat %{buildroot}%{_datadir}/%{name} # Kill rpath on all binaries within %%{_bindir}. -chrpath -d %{buildroot}%{_bindir}/%{name}-math* +%{_bindir}/chrpath -d %{buildroot}%{_bindir}/%{name}-math* + +# Install documentation and license. +%{__mkdir} -p %{buildroot}%{_pkgdocdir}/{examples,toolkit} +%{__install} -pm 0644 AUTHORS* BSD-LBNL-License* ChangeLog* \ + COPYING* NEWS* README* TODO* doc/* \ + %{buildroot}%{_pkgdocdir} +%{__install} -pm 0644 examples/* %{buildroot}%{_pkgdocdir}/examples +%{__install} -pm 0644 toolkit/README* %{buildroot}%{_pkgdocdir}/toolkit +%if %{with license} +%{__rm} -rf BSD-LBNL-License* COPYING* +%endif # %%{with license} %check @@ -337,24 +365,35 @@ chrpath -d %{buildroot}%{_bindir}/%{name}-math* # that one test. Let me know if you have any problems in running your codes # -- I don't think you will. # DHB -make check ||: +%{__make} check ||: %{?el5:%clean} -%{?el5:rm -rf %{buildroot}} +%{?el5:%{__rm} -rf %{buildroot}} %post -p /sbin/ldconfig - %postun -p /sbin/ldconfig %files -%doc BSD-LBNL-License* COPYING +%if %{with license} +%license BSD-LBNL-License* COPYING* +%else # %%{with license} +%doc %dir %{_pkgdocdir} +%doc %{_pkgdocdir}/BSD-LBNL-License* +%doc %{_pkgdocdir}/COPYING* +%endif # %%{with license} %{_libdir}/lib%{name}*.so.* %files data -%doc BSD-LBNL-License* COPYING +%if %{with license} +%license %{_datadir}/licenses/%{name} +%else # %%{with license} +%doc %dir %{_pkgdocdir} +%doc %{_pkgdocdir}/BSD-LBNL-License* +%doc %{_pkgdocdir}/COPYING* +%endif # %%{with license} %{_datadir}/%{name} %files devel @@ -364,15 +403,24 @@ make check ||: %{_libdir}/pkgconfig/%{name}.pc %files doc -%doc AUTHORS* BSD-LBNL-License* ChangeLog* COPYING* -%doc NEWS* README* TODO* doc/* examples +%if %{with license} +%license %{_datadir}/licenses/%{name} +%endif # %%{with license} +%doc %{_pkgdocdir} %files tools -%doc toolkit/README* +%doc %dir %{_pkgdocdir} +%doc %{_pkgdocdir}/toolkit %{_bindir}/%{name}-math* %changelog +* Sat Dec 12 2015 Björn Esser - 2.2.18-1 +- new upstream release (#1290979) +- use %%license if applicable +- use unified %%_pkgdocdir +- general improvements to specfile + * Wed Jun 17 2015 Fedora Release Engineering - 2.2.17-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild diff --git a/sources b/sources index b9406f9..c247f03 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -48a9cb989ad42c6ba07e0d260fbede0f arprec-2.2.17.tar.gz +d589a2c04768d2821fb1ad56c1b796f3 arprec-2.2.18.tar.gz 8f2ac823c57a908d278356f439f91e80 BSD-LBNL-License.doc