[polybori] Build with NTL support, needed for sagemath. Create flags.conf and install it in main package.

Jerry James jjames at fedoraproject.org
Mon Apr 30 22:23:49 UTC 2012


commit b58b05020a8e82630955e35c5cbcb6cae6304a18
Author: Jerry James <loganjerry at gmail.com>
Date:   Mon Apr 30 16:23:26 2012 -0600

    Build with NTL support, needed for sagemath.
    Create flags.conf and install it in main package.

 polybori.spec |   64 +++++++++++++++++++++++++++++++++++---------------------
 1 files changed, 40 insertions(+), 24 deletions(-)
---
diff --git a/polybori.spec b/polybori.spec
index 8e73738..6fae7ee 100644
--- a/polybori.spec
+++ b/polybori.spec
@@ -3,7 +3,7 @@
 
 Name:           polybori
 Version:        0.8.1
-Release:        2%{?dist}
+Release:        3%{?dist}
 Summary:        Framework for Boolean Rings
 Group:          Development/Libraries
 License:        GPLv2+
@@ -28,6 +28,7 @@ BuildRequires:  desktop-file-utils
 BuildRequires:  doxygen
 BuildRequires:  gd-devel
 BuildRequires:  m4ri-devel
+BuildRequires:  ntl-devel
 BuildRequires:  pyparsing
 BuildRequires:  PyQt4-devel
 BuildRequires:  python2-devel
@@ -134,30 +135,32 @@ for fil in gui/PolyGUI ipbori/ipbori; do
   mv ${fil}.new ${fil}
 done
 
-# Eliminate rpaths
-sed -i "s/'\${_relative_rpath.*/''])/" SConstruct
+# Eliminate rpaths and enable NTL support
+sed -e "s/'\${_relative_rpath.*/''])/" \
+    -e "s/main_wrapper\.cc/& ntl_wrapper.cc/" \
+    -i SConstruct
+
+# Set up the build flags
+cat > custom.py <<EOF
+PREFIX = "%{buildroot}%{_prefix}"
+INSTALLDIR = "%{buildroot}%{_datadir}/%{name}"
+DOCDIR = "%{buildroot}%{_docdir}/%{name}"
+MANDIR = "%{buildroot}%{_mandir}"
+PYINSTALLPREFIX = "%{buildroot}%{python_sitearch}"
+DEVEL_PREFIX = "%{buildroot}%{_prefix}"
+CONFFILE = "%{buildroot}%{_datadir}/%{name}/flags.conf"
+CCFLAGS = "%{optflags} -DPBORI_USE_ORIGINAL_CUDD -DPBORI_HAVE_NTL"
+CPPPATH = "-I%{_includedir}/m4ri"
+SHLINKFLAGS = "$RPM_LD_FLAGS -Wl,--as-needed"
+MR4I_RPM = "True"
+LIBS = "-lntl -lcudd"
+EOF
 
 %build
-scons %{?_smp_mflags} prepare-install \
-  PREFIX=%{buildroot}%{_prefix} \
-  CCFLAGS="%{optflags} -DPBORI_USE_ORIGINAL_CUDD" \
-  CPPPATH="-I%{_includedir}/m4ri" \
-  M4RI_RPM="True" \
-  LIBS="-lcudd"
+scons %{?_smp_mflags} prepare-install
 
 %install
-scons %{?_smp_mflags} install devel-install \
-  PREFIX=%{buildroot}%{_prefix} \
-  INSTALLDIR=%{buildroot}%{_datadir}/%{name} \
-  DOCDIR=%{buildroot}%{_docdir}/%{name} \
-  MANDIR=%{buildroot}%{_mandir} \
-  PYINSTALLPREFIX=%{buildroot}%{python_sitearch} \
-  DEVEL_PREFIX=%{buildroot}%{_prefix} \
-  CCFLAGS="%{optflags} -DPBORI_USE_ORIGINAL_CUDD" \
-  CPPPATH="-I%{_includedir}/m4ri" \
-  SHLINKFLAGS="$RPM_LD_FLAGS -Wl,--as-needed" \
-  M4RI_RPM="True" \
-  LIBS="-lcudd"
+scons %{?_smp_mflags} install devel-install
 
 # The install step doesn't set shared object permissions correctly
 chmod 0755 %{buildroot}%{_libdir}/*.so.0.0.0
@@ -180,6 +183,15 @@ touch -r %{buildroot}%{_datadir}/%{name}/ipbori/ipbori \
 chmod a+x %{buildroot}%{_bindir}/ipbori
 rm -f %{buildroot}%{_datadir}/%{name}/ipbori/ipbori
 
+# Fixup flags.conf
+sed -e "s|%{buildroot}||" \
+    -e "/^CPPPATH/s/-I//" \
+    -e "/^CPPDEFINES/s/]/, 'PBORI_USE_ORIGINAL_CUDD', 'PBORI_HAVE_NTL']/" \
+    -e "/^CCFLAGS/s/'-DPBORI[_[:alpha:]]*', //g" \
+    -e "/^LIBS/s/-l//g" \
+    -e "/^LIBS/s/'m4ri', //" \
+    -i %{buildroot}%{_datadir}/%{name}/flags.conf
+
 %post -p /sbin/ldconfig
 
 %postun -p /sbin/ldconfig
@@ -197,6 +209,8 @@ gtk-update-icon-cache %{icondir} >&/dev/null ||:
 %files
 %doc LICENSE README
 %{_libdir}/lib*.so.*
+%dir %{_datadir}/%{name}/
+%{_datadir}/%{name}/flags.conf
 
 %files devel
 %doc ChangeLog
@@ -216,18 +230,20 @@ gtk-update-icon-cache %{icondir} >&/dev/null ||:
 %files ipbori
 %{_bindir}/ipbori
 %{_mandir}/man1/ipbori.1*
-%{_datadir}/%{name}/
-%exclude %{_datadir}/%{name}/gui/
+%{_datadir}/%{name}/ipbori/
 
 %files gui
 %{_bindir}/PolyGUI
 %{_datadir}/applications/%{name}.desktop
-%dir %{_datadir}/%{name}/
 %{_datadir}/%{name}/gui/
 %{icondir}/*/apps/%{name}.png
 %{_mandir}/man1/PolyGUI.1*
 
 %changelog
+* Mon Apr 30 2012 Jerry James <loganjerry at gmail.com> - 0.8.1-3
+- Build with NTL support, needed for sagemath
+- Create flags.conf and install it in main package
+
 * Mon Apr 16 2012 Jerry James <loganjerry at gmail.com> - 0.8.1-2
 - Rebuild for new m4ri
 


More information about the scm-commits mailing list