diff --git a/cppad.spec b/cppad.spec index 32e5603..5492a87 100644 --- a/cppad.spec +++ b/cppad.spec @@ -65,8 +65,15 @@ as a single web page, in both HTML and XML, can be found at that web site. %setup -q includedir=%{buildroot}%{_includedir} +# Replace cppad_SOURCE_DIR by the system include directory so that +# installed files, instead of local files, are used for testing. +sed \ +-e "s|\(INCLUDE_DIRECTORIES(\).*{cppad_SOURCE_DIR}|\1 SYSTEM $includedir|" \ + -i.stamp CMakeLists.txt + # This patch should not longer be necessary when %%{version} >= 20130000.2 -sed -e '/TARGET_LINK_LIBRARIES/d' -i.stamp speed/example/CMakeLists.txt +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 @@ -92,9 +99,12 @@ make %{?_smp_mflags} %install rm -rf %{buildroot} -make check make install DESTDIR=%{buildroot} +# use the installed include files to compile and run the tests +%check +make check + %clean # cleanup rm -rf %{buildroot}