diff --git a/cppad.spec b/cppad.spec index 7873ef3..83318ac 100644 --- a/cppad.spec +++ b/cppad.spec @@ -3,13 +3,17 @@ # cppad.spec: spelling-error Sumary(en_US) devel: # Although not in the en_US dictionary, 'devel' is understood by Fedora users. # -# cppad.spec: rpm-buildroot-usage: -# RPM_BUILD_ROOT is used to test includes from installed directory. +# cppad.spec: rpm-buildroot-usage +# The %%prep section of this spec file contains a reference to %%buildroot. +# This is used to read (not write) information in %%buildroot%%includdir +# (using g++ -I %%buildroot%%includedir ). Thus it is not a violation of +# http://fedoraproject.org/wiki/Packaging:Guidelines# +# Scriplets_are_only_allowed_to_write_in_certain_directories # # cppad-20110101.2.gpl.tgz: strange-permission 0444L # The premissions are for readonly, which seems fine in this case. # -# %{_docdir}/%{name}-%{version}/pmathmlcss.xsl: file-not-utf8: +# %%{_docdir}/%%{name}-%%{version}/pmathmlcss.xsl: file-not-utf8: # The file pmathmlcss.xsl is the standard presentation MathML style sheet. # Except for white space and a comment at the top, it is identical to # http://www.w3.org/Math/XSL/pmathmlcss.xsl @@ -19,8 +23,8 @@ Name: cppad Version: 20110101.2 -Release: 2%{?dist} -Summary: C++ Algorithmic Differentiation (AD), %{name}-devel and %{name}-doc. +Release: 3%{?dist} +Summary: C++ Algorithmic Differentiation (AD), %{name}-devel and %{name}-doc Group: Development/Libraries License: GPLv2 @@ -45,7 +49,7 @@ Algorithmic Differentiation (often referred to as Automatic Differentiation.) Given a C++ algorithm that computes function values, %{name} generates an algorithm that computes its derivative values. A brief introduction to Algorithmic Differentiation (AD) can be found at - http://en.wikipedia.org/wiki/Automatic_differentiation + http://en.wikipedia.org/wiki/Automatic_differentiation See the package %{name}-doc for documentation of this version of %{name}. # ---------------------------------------------------------------------------- @@ -55,10 +59,10 @@ Group: XML documentation for %{name}-devel %description doc The %{name}-doc package installs the XML documentation for %{name}-devel in - %{_docdir}/%{name}-%{version} + %{_docdir}/%{name}-%{version} Links to an HTML version of the %{name} documentation, for the most recent version of %{name}, can be found at the web site - http://www.coin-or.org/CppAD/ + http://www.coin-or.org/CppAD/ In addition, printable versions of the documentation, as a single web page, in both HTML and XML, can be found at that web site. @@ -66,18 +70,23 @@ as a single web page, in both HTML and XML, can be found at that web site. %prep %setup -q -# CppAD tests the distribution before installing it. The rpm system can -# test after a mock installation. Thus, we should remove the distribution copy -# of the include file directory from the search path. We must skip -# speed/src/makefile.in because we build its library before the install. +# Patches 2 and 3 should not be necessary when %%{version} > 20110101.2. +# 1. CppAD tests the distribution before installing it. The rpm system can +# test after a mock installation. Thus, we should test the installed copy +# instead of the distribution copy of the include files. We must skip +# speed/src/makefile.in because it builds a library (that is not installed). +# 2. Change the location where pkgconfig/cppad.pc is installed. +# 3. Remove the duplicate copy of the test results from the rpm output. +includedir=%{buildroot}%{_includedir} for file in `find . -name 'makefile.in'` do - if ! (echo $file | grep 'speed/src/makefile.in' > /dev/null) - then - sed -i "$file" \ - -e "s|-I\$(top_srcdir)\([^/]\)|-I$RPM_BUILD_ROOT/usr/include\1|" \ - -e 's|^pkgconfigdir *=.*|pkgconfigdir = $(datadir)/pkgconfig|' - fi + if ! (echo $file | grep 'speed/src/makefile.in' > /dev/null) + then + sed -i "$file" \ + -e "s|-I\$(top_srcdir)\([^/]\)|-I$includedir\1|" \ + -e 's|^pkgconfigdir *=.*|pkgconfigdir = $(datadir)/pkgconfig|' \ + -e '/^[\t ]*cat test.log *$/d' + fi done @@ -102,8 +111,8 @@ sed -i.stamp example/example.cpp -f example.sed make %{?_smp_mflags} %install -rm -rf $RPM_BUILD_ROOT -make install DESTDIR=$RPM_BUILD_ROOT +rm -rf %{buildroot} +make install DESTDIR=%{buildroot} %check # make test uses a shell script to run make test is a list of subdirectories @@ -112,7 +121,7 @@ make test %clean # cleanup -rm -rf $RPM_BUILD_ROOT +rm -rf %{buildroot} %files devel %defattr(-,root,root,-) @@ -126,6 +135,15 @@ rm -rf $RPM_BUILD_ROOT # ---------------------------------------------------------------------------- %changelog +* Tue Jan 19 2011 Brad Bell - 20110101.2-3 +- Remove duplicate test results from build.log +- Improve comments before patching top level makefile.in. +- Fix rpmlint warnings about %%{_docdir}, %%{name}, and %%{version} in comments. +- Fix rpmlint warning by changing tabs to spaces. +- Fix rpmlint wrning by removing dot at end of Summary. +- Change RPM_BUILD_ROOT to _builddir. +- Improve comments (at top) about know rpmlint warnings. + * Tue Jan 18 2011 Brad Bell - 20110101.2-2 - Fix rpmlint error, libdir-macro-in-noarch-package by moving the pkg-config - file cppad.pc from %%_libdir to %%_datadir. @@ -268,7 +286,7 @@ rm -rf $RPM_BUILD_ROOT - Use %%{?dist} in Release entry. - Use %%(%%{__id_u} -n) in BuildRoot entry. - Use noarch in BuildArch entry. -- Move -rf $RPM_BUILD_ROOT from prep entry to install entry. +- Move -rf RPM_BUILD_ROOT from prep entry to install entry. - Use macros where possible. * Sat Dec 08 2007 Brad Bell 20071208-1