Advance to version 2012 of cppad

This commit is contained in:
Brad Bell 2012-01-18 19:46:44 -08:00
commit 3555f001ba

View file

@ -1,29 +1,16 @@
# Known rpmlint warnings:
# rpmlint command and output
#
# cppad.spec: spelling-error Sumary(en_US) devel:
# Although not in the en_US dictionary, 'devel' is understood by Fedora users.
# rpmlint --version
# rpmlint version 1.4 Copyright (C) 1999-2007 Frederic Lepied, Mandriva
#
# 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:
# 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
# (use wget and diff -b to see that this is true).
# rpmlint cppad-devel-20120101.1-1.fc15.noarch.rpm
# 1 packages and 0 specfiles checked; 0 errors, 0 warnings.
#
# ----------------------------------------------------------------------------
Name: cppad
Version: 20110101.5
Release: 2%{?dist}
Version: 20120101.1
Release: 1%{?dist}
Summary: C++ Algorithmic Differentiation (AD), %{name}-devel and %{name}-doc
Group: Development/Libraries
@ -70,29 +57,55 @@ as a single web page, in both HTML and XML, can be found at that web site.
%prep
%setup -q
# Patches 2 and 3 should not be necessary when %%{version} >= 20120101
# 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}
# This patch should no longer be necessary when %%{version} >= 20120101.2
sed \
-e 's|namespace *CppAD *{|# include <cppad/base_require.hpp>\n&|' \
-i cppad/speed/sparse_evaluate.hpp
# This patch should no longer be necessary when %%{version} >= 20120101.2
# 1.Fix missing inclusion of pthread library in linker command.
# Fix running make in source directory (current cppad testing runs configure
# and make in a separate directory).
sed \
-e '/^AM_LDFLAGS *=/s|$| $(PTHREAD_LIB)|' \
-e '/^dist_noinst_SCRIPTS *= *test.sh/d' \
-e '/^test.sh:/d' \
-e '/cp $(srcdir)\/test.sh/d' \
-e 's|^test:.*|test: check|' \
-i multi_thread/makefile.in
# This patch should no longer be necessary when %%{version} >= 20120101.2
# 1. Since building in source directory, there is no reason to copy the created
# cppad/configure.hpp to the source directory (avoids warning).
# 2. make sure we do not delete multi_thread/test.sh which is
# not created by 'make test' (becasue of patch to multi_thread/makefile.in).
# 3. Use make test instead of make test.sh because we do note make test.sh
# for multi_thread directory.
sed \
-e '/^$(top_srcdir)\/cppad\/configure.hpp:/d' \
-e '/^\tcp cppad\/configure.hpp/d' \
-e '/^\t\trm -f $$dir\/test.sh/d' \
-e 's|make test.sh|make test|' \
-e '/echo ".\/test.sh"/d' \
-i makefile.in
# CppAD tests the distribution before installing it. The rpm system can test
# after 'make install'. We test the installed instead of distributed copy
# of the include files. We skip speed/src/makefile.in
# because they build programs a library before 'make install' completes.
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$includedir\1|" \
-e 's|^pkgconfigdir *=.*|pkgconfigdir = $(datadir)/pkgconfig|' \
-e '/^[\t ]*cat test.log *$/d'
sed -e "s|-I\$(top_srcdir)\([^/]\)|-I$includedir\1|" -i "$file"
fi
done
# Remove setting of permissions in documentation destination directory.
sed -e '/^.CppAD_DOCUMENTATION_TRUE.\tchmod -R [^ ]* $(doc_package)/d' \
-i.stamp makefile.in
-i.stamp makefile.in
#
# change example/example.cpp to print out machine epsilon
@ -108,7 +121,7 @@ EOF
sed -i.stamp example/example.cpp -f example.sed
%build
%configure --with-Documentation
%configure --with-Documentation OPENMP_FLAGS=-fopenmp
make %{?_smp_mflags}
%install
@ -136,8 +149,11 @@ rm -rf %{buildroot}
# ----------------------------------------------------------------------------
%changelog
* Thu Jan 12 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 20110101.5-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
* Wed Jan 18 2012 Brad Bell <bradbell at seanet dot com> - 20120101.1-1
- Advance to version 2012 of cppad.
- Remove old patches that are no longer necessary.
- Add new patches (using sed in setup section) that are now necessary.
- Change comments about rpmlint output (using more recent version).
* Mon Oct 17 2011 Brad Bell <bradbell at seanet dot com> - 20110101.5-1
- Advance to next 2011 release to fix warnings generated by g++ 4.6.1.