1. Use new upstream source: cppad-20130000.0

2. Use cmake instread of auto-tools to build tests.
3. Include move testing, but do before instead of after install.
4. Fix day of the week in some commit log messages.

On branch master
This commit is contained in:
Brad Bell 2013-01-04 16:45:09 -07:00
commit b98f8a6ed7
3 changed files with 30 additions and 63 deletions

View file

@ -9,8 +9,8 @@
# ----------------------------------------------------------------------------
Name: cppad
Version: 20120101.1
Release: 3%{?dist}
Version: 20130000.0
Release: 1%{?dist}
Summary: C++ Algorithmic Differentiation (AD), %{name}-devel and %{name}-doc
# Only noarch.rpms provided.
@ -18,10 +18,11 @@ Summary: C++ Algorithmic Differentiation (AD), %{name}-devel and %{name}-doc
%global debug_package %{nil}
Group: Development/Libraries
License: GPLv2
License: GPLv3
URL: http://www.coin-or.org/CppAD/
Source: http://www.coin-or.org/download/source/CppAD/%{name}-%{version}.gpl.tgz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: cmake >= 2.6
%description
C++ Algorithmic Differentiation (AD), see %{name}-devel, %{name}-doc.
@ -64,54 +65,8 @@ as a single web page, in both HTML and XML, can be found at that web site.
%setup -q
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 -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
#
# This patch should not longer be necessary when %%{version} >= 20130000.2
sed -e '/TARGET_LINK_LIBRARIES/d' -i.stamp speed/example/CMakeLists.txt
# change example/example.cpp to print out machine epsilon
cat << EOF > example.sed
@ -125,19 +80,21 @@ int main(void)\\
EOF
sed -i.stamp example/example.cpp -f example.sed
# See https://fedoraproject.org/wiki/Packaging:Cmake?rd=Packaging/cmake
# for suggestions on using cmake.
%build
%configure --with-Documentation OPENMP_FLAGS=-fopenmp
%cmake \
-D CMAKE_VERBOSE_MAKEFILE=0 \
-D cppad_documentation=YES \
-D cppad_cxx_flags='-Wall -ansi -pedantic-errors -std=c++98 -Wshadow' \
.
make %{?_smp_mflags}
%install
rm -rf %{buildroot}
make check
make install DESTDIR=%{buildroot}
%check
# make test uses a shell script to run test is a list of subdirectories
# and it it is unclear how to do: make %{?_smp_mflags} test
make test
%clean
# cleanup
rm -rf %{buildroot}
@ -154,6 +111,15 @@ rm -rf %{buildroot}
# ----------------------------------------------------------------------------
%changelog
* Fri Jan 04 2013 Brad Bell <bradbell at seanet dot com> - 20130000.0-1
- Advance to version 2013 of cppad.
- Remove old patches that are no longer necessary.
- Convert from auto-tools to cmake build system.
- Add new patches (using sed in setup section) that are now necessary.
- Fix some bogus dates in change log by changing day of the week.
- Getting folloing incorrect warning from g++ during rpmbuild:
- .../cppad/thread_alloc.hpp:203:44: ... subsrcipt is above array bounds ...
* Sun Oct 21 2012 Ralf Corsépius <corsepiu@fedoraproject.org> - 20120101.1-3
- Switch to arch'ed BuildArch.
@ -174,7 +140,7 @@ rm -rf %{buildroot}
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 20110101.2-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
* Tue Jan 19 2011 Brad Bell <bradbell at seanet dot com> - 20110101.2-3
* Wed Jan 19 2011 Brad Bell <bradbell at seanet dot com> - 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.
@ -196,7 +162,7 @@ rm -rf %{buildroot}
- Change makefile.in so tests include from install (not distribute) directory
- (see comments above `find . -name 'makefile.in` above).
* Sat Jan 09 2011 Brad Bell <bradbell at seanet dot com> - 20110101.0-2
* Sun Jan 09 2011 Brad Bell <bradbell at seanet dot com> - 20110101.0-2
- Remove include/cppad_ipopt_nlp.hpp from distribution.
- Remove lib/libspeed.a from distribution.
- Add lib/pkgconfig/cppad.pc to files section (because it is installed).
@ -222,7 +188,7 @@ rm -rf %{buildroot}
- Patch sources for bug fix between 20100101.0 and 20100101.1.
- This should no longer be necessary once a new upstream source is loaded.
* Sat Jan 01 2010 Brad Bell <bradbell at seanet dot com> - 20100101.0-1
* Fri Jan 01 2010 Brad Bell <bradbell at seanet dot com> - 20100101.0-1
- Use new upstream source.
- Remove out of date comment about where this spec file is maintained.
- Remove patches that are no longer necessary in prep section.
@ -236,7 +202,7 @@ rm -rf %{buildroot}
- Patch cppad/local/fun_construct.hpp to give a more useful error message
- (so we can figure out why the Fedora 11 build is failing).
* Mon Jun 06 2009 Brad Bell <bradbell at seanet dot com> 20090303-3
* Sat Jun 06 2009 Brad Bell <bradbell at seanet dot com> 20090303-3
- Patch file test_more/jacobian.cpp (required for versions below 20090606).
- Patch file cppad/local/default.hpp (required for versions below 20090606).
- Fix version (change 20080303 to 20090303) in previous two log entries.
@ -253,7 +219,7 @@ rm -rf %{buildroot}
* Tue Feb 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 20080826.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
* Tue Oct 08 2008 Brad Bell <bradbell at seanet dot com> 20080826-1
* Wed Oct 08 2008 Brad Bell <bradbell at seanet dot com> 20080826-1
- Change to newer version of cppad.
- Change download directory to standard coin-or location.
- Remove editing of speed/main.cpp (no longer necessary).