1. Remove cppad_ipopt_nlp.hpp and lib/libspeed.a from the distribution.

2. Add lib/pkgconfig/cppad.pc to the %files section of spec file.
3. Remove _smp_mflags from the "make test" command.
This commit is contained in:
Brad Bell 2011-01-09 15:36:12 -08:00
commit 5c3d5b39c6

View file

@ -12,7 +12,7 @@
Name: cppad
Version: 20110101.0
Release: 1%{?dist}
Release: 2%{?dist}
Summary: No base package is installed, see %{name}-devel
Group: Development/Libraries
@ -58,9 +58,25 @@ as a single web page, in both html and xml, can be found at that web site.
%prep
%setup -q
# abs_top_builddir is misisng from definitions in makefile.in
# (should be fixed in future versions of cppad)
sed -i makefile.in -e 's/abs_top_builddir/ABS_TOP_SRCDIR/'
# Items 1,2,3 below should be fixed in future versions of cppad.
cat << EOF > makefile.in.sed
# 1. Do not distribute cppad_ipopt_nlp.hpp.
s/^myinclude_HEADERS *=.*/myinclude_HEADERS =/
/cppad_ipopt_nlp.hpp/d
# 2. abs_top_builddir is missing from definitions in makefile.in
s/abs_top_builddir/ABS_TOP_SRCDIR/
# 3. Remove libspeed.a from the distribution (mistake).
s/^install-libLIBRARIES:/do_not_install:/
s/^uninstall-libLIBRARIES:/do_not_uninstall:/
s/uninstall-libLIBRARIES//
s/install-libLIBRARIES//
# 4. Remove setting of permissions in documentation destination directory.
/chmod -R .* \$(doc_package)/d
EOF
# Items 1,2, and 4
sed -i.stamp makefile.in -f makefile.in.sed
# Item 3
sed -i.stamp speed/src/makefile.in -f makefile.in.sed
# change example/example.cpp to print out machine epsilon
cat << EOF > example.sed
@ -74,14 +90,6 @@ int main(void)\\
EOF
sed -i.stamp example/example.cpp -f example.sed
# Remove setting of permissions in documentation destination directory.
# Create the doc_prefix directory (if it does not already exist).
# (Note we are not using a postfix directory, so can overwrite its case.)
sed -i.stamp makefile.am \
-e '/chmod -R .* $(doc_package)/d'
sed -i.stamp makefile.in \
-e '/chmod -R .* $(doc_package)/d'
%build
%configure --with-Documentation
make %{?_smp_mflags}
@ -91,7 +99,9 @@ rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT
%check
make %{?_smp_mflags} test
# make test uses a shell script to run make test is a list of subdirectories
# and it it is unclear how to do: make %{?_smp_mflags} test
make test
%clean
# cleanup
@ -101,6 +111,7 @@ rm -rf $RPM_BUILD_ROOT
%defattr(-,root,root,-)
%doc COPYING ChangeLog AUTHORS uw_copy_040507.html
%{_includedir}/%{name}
%{_libdir}/pkgconfig/%{name}.pc
%files doc
%defattr(-,root,root,-)
@ -108,6 +119,13 @@ rm -rf $RPM_BUILD_ROOT
# ----------------------------------------------------------------------------
%changelog
* Sat 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).
- Use a single sed script file with comments to do all the makefile.in edits.
- Remove edits of makefile.am (not used so not reason to patch it).
* Sat Jan 08 2011 Brad Bell <bradbell at seanet dot com> - 20110101.0-1
- Use new major version for 2011.
- abs_top_builddir is missing from definitions in makefile.in