Sophie

Sophie

distrib > Fedora > 18 > i386 > by-pkgid > fc8cc1423cc1e50fd81b52c8f35db4ef > files > 4

polybori-0.8.3-1.fc18.src.rpm

# NOTE: %%{_includedir}/polybori/cacheopts.h is empty on some platforms, but
# it must be present anyway.  DO NOT REMOVE IT.

Name:           polybori
Version:        0.8.3
Release:        1%{?dist}
Summary:        Framework for Boolean Rings
Group:          Development/Libraries
License:        GPLv2+
URL:            http://polybori.sourceforge.net/
Source0:        http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz
# These logos were created with gimp from the official polybori logo
Source1:        %{name}-logos.tar.xz
# This patch is specific to Fedora, although upstream helped create it.  Use
# system CUDD libraries instead of building the included CUDD sources.
Patch0:         %{name}-system-cudd.patch

BuildRequires:  boost-devel
BuildRequires:  cudd-devel
BuildRequires:  desktop-file-utils
BuildRequires:  doxygen
BuildRequires:  ImageMagick
BuildRequires:  libpng-devel
BuildRequires:  m4ri-devel
BuildRequires:  ntl-devel
BuildRequires:  pyparsing
BuildRequires:  PyQt4-devel
BuildRequires:  python2-devel
BuildRequires:  python-imaging-devel
BuildRequires:  scons
BuildRequires:  tex(latex)
BuildRequires:  tex(boxedminipage.sty)
BuildRequires:  tex(fullpage.sty)
BuildRequires:  tex(tex4ht.sty)
BuildRequires:  tex-courier

%global __provides_exclude_from ^%{python_sitearch}/.*\\.so$
%global icondir %{_datadir}/icons/hicolor

# The Provides and Obsoletes below can be removed once F16 reaches EOL.

%description
PolyBoRi is a special purpose computer algebra system for computations
in Boolean Rings.  The core is a C++ library, which provides high-level
data types for Boolean polynomials and related structures.  As a unique
approach, binary decision diagrams are used as internal storage type for
polynomial structures.  On top of this, we provide a Python interface
for parsing of complex polynomial systems, as well as for sophisticated
and extendable strategies for Gröbner base computation.

%package        devel
Summary:        Development files for %{name}
Group:          Development/Libraries
Requires:       %{name}%{?_isa} = %{version}-%{release}
Requires:       boost-devel%{?_isa}
Requires:       cudd-devel%{?_isa}
Provides:       python-%{name}-devel = %{version}-%{release}
Obsoletes:      python-%{name}-devel < 0.8.0-1

%description    devel
Development headers and libraries for %{name}.

%package        static
Summary:        Static libraries for %{name}
Group:          Development/Libraries
Requires:       %{name}-devel%{?_isa} = %{version}-%{release}
Provides:       python-%{name}-static = %{version}-%{release}
Obsoletes:      python-%{name}-static < 0.8.0-1

%description    static
Static libraries for %{name}.

%package        docs
Summary:        Documentation for %{name}
Group:          Documentation
Requires:       %{name} = %{version}-%{release}
Provides:       python-%{name}-docs = %{version}-%{release}
Obsoletes:      python-%{name}-docs < 0.8.0-1
BuildArch:      noarch

%description    docs
Documentation for %{name}.

%package -n python-%{name}
Summary:        Python interface to %{name}
Group:          Development/Libraries
Requires:       %{name}%{?_isa} = %{version}-%{release}
Requires:       python-imaging%{?_isa}
Requires:       pyparsing

%description -n python-%{name}
Python interface to %{name}.

%package        ipbori
Summary:        Command-line interface to %{name}
Group:          Applications/Engineering
Requires:       python-%{name}%{?_isa} = %{version}-%{release}
Requires:       python-ipython-console

%description    ipbori
Command-line interface to %{name}.

%package        gui
Summary:        Qt GUI for %{name}
Group:          Applications/Engineering
Requires:       python-%{name}%{?_isa} = %{version}-%{release}
Requires:       PyQt4, hicolor-icon-theme
Provides:       python-%{name}-gui = %{version}-%{release}
Obsoletes:      python-%{name}-gui < 0.8.0-1

%description    gui
Qt GUI for %{name}.

%prep
%setup -q
%patch0

# Remove private copy of system libs (Cudd and pyparsing)
rm -rf Cudd PyPolyBoRi/pyparsing.py

# 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 = "%{_prefix}"
INSTALLDIR = "%{_datadir}/%{name}"
DOCDIR = "%{_docdir}/%{name}"
MANDIR = "%{_mandir}"
PYINSTALLPREFIX = "%{python_sitearch}"
DEVEL_PREFIX = "%{_prefix}"
DEVEL_LIB_PREFIX = "%{_libdir}"
CONFFILE = "%{_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 -lstdc++"
DESKTOPPATH = "%{_datadir}/applications"
PKGCONFIGPATH = "%{_libdir}/pkgconfig"
EOF

%build
scons %{?_smp_mflags} prepare-install

%install
majmin=`python -V 2>&1 | sed -r 's/.* ([[:digit:]]+\.[[:digit:]]+).*/\1/'`
major=`echo $majmin | cut -d. -f1`

sed -i "s|%{_prefix}|%{buildroot}&|" custom.py
scons %{?_smp_mflags} install devel-install

# The install step doesn't set shared object permissions correctly
chmod 0755 %{buildroot}%{_libdir}/*.so.*.0.0
chmod 0755 %{buildroot}%{python_sitearch}/%{name}/dynamic/PyPolyBoRi.so

# We only want one desktop file, and it needs fixing and validating
rm -f %{buildroot}%{_datadir}/applications/PolyGUI${major}.desktop
rm -f %{buildroot}%{_datadir}/applications/PolyGUI${majmin}.desktop
sed -ri 's/Math/&;/;/(Path|MimeType)=/d' \
   %{buildroot}%{_datadir}/applications/PolyGUI.desktop
desktop-file-validate %{buildroot}%{_datadir}/applications/PolyGUI.desktop

# Replace the single XPM icon with multiple sizes of PNG icons
rm -fr %{buildroot}%{_datadir}/pixmaps
mkdir -p %{buildroot}%{icondir}
tar xJf %{SOURCE1} -C %{buildroot}%{icondir}

# 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

# Fixup the pkgconfig files
sed -re "s,%{buildroot}|-L%{_libdir} | -lgd| gd,,g" \
    -e "s|-Ilibpolybori/include|-DPBORI_USE_ORIGINAL_CUDD|" \
    -e "s|-Igroebner/include|-DPBORI_HAVE_NTL|" \
    -e "s|build%{_libdir}[^[:blank:]]+|-lpolybori|" \
    -i %{buildroot}%{_libdir}/pkgconfig/*.pc

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%post gui
update-desktop-database -q >& /dev/null || :
touch --no-create %{icondir} >&/dev/null ||:
gtk-update-icon-cache %{icondir} >&/dev/null ||:

%postun gui
update-desktop-database -q >& /dev/null || :
touch --no-create %{icondir} >&/dev/null ||:
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
%{_libdir}/lib*.so
%{_libdir}/pkgconfig/%{name}*
%{_includedir}/%{name}/
%{_includedir}/%{name}.h

%files static
%{_libdir}/lib*.a

%files docs
%{_docdir}/%{name}/

%files -n python-%{name}
%{python_sitearch}/%{name}/

%files ipbori
%{_bindir}/ipbori*
%{_mandir}/man1/ipbori*
%{_datadir}/%{name}/ipbori/

%files gui
%{_bindir}/PolyGUI*
%{_datadir}/applications/PolyGUI.desktop
%{_datadir}/%{name}/gui/
%{icondir}/*/apps/PolyGUI.png
%{_mandir}/man1/PolyGUI*

%changelog
* Thu Feb  7 2013 Jerry James <loganjerry@gmail.com> - 0.8.3-1
- New upstream release
- Drop upstreamed -pillow and -upstream patches
- Drop desktop file; it is now provided by upstream

* Mon Jan 21 2013 Jerry James <loganjerry@gmail.com> - 0.8.2-6
- Add -pillow patch from Toshio Kuratomi (bz 896296)

* Mon Dec 31 2012 Jerry James <loganjerry@gmail.com> - 0.8.2-5
- Rebuild for m4ri 20121224

* Mon Dec 10 2012 Jerry James <loganjerry@gmail.com> - 0.8.2-4
- Rebuild for new m4ri
- Adapt BRs for texlive 2012

* Wed Oct 17 2012 Jerry James <loganjerry@gmail.com> - 0.8.2-3
- Apply -upstream patch with fixes from upstream.

* Mon Aug 13 2012 Jerry James <loganjerry@gmail.com> - 0.8.2-2
- R python-ipython-console instead of python-ipython for the ipbori subpackage,
  since the API we require is provided by the former.

* Mon Aug  6 2012 Jerry James <loganjerry@gmail.com> - 0.8.2-1
- New upstream release
- Drop gd-devel BR; pngs now generated with m4ri
- Drop upstreamed patches
- Fix ipython Requires

* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.8.1-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

* Mon Apr 30 2012 Jerry James <loganjerry@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@gmail.com> - 0.8.1-2
- Rebuild for new m4ri

* Thu Mar 22 2012 Jerry James <loganjerry@gmail.com> - 0.8.1-1
- New upstream release
- Fix desktop file

* Tue Feb 28 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.8.0-7
- Rebuilt for c++ ABI breakage

* Mon Feb 20 2012 Jerry James <loganjerry@gmail.com> - 0.8.0-6
- Rebuild for new cudd

* Mon Jan 30 2012 Jerry James <loganjerry@gmail.com> - 0.8.0-5
- Rebuild for new m4ri

* Tue Jan 10 2012 Jerry James <loganjerry@gmail.com> - 0.8.0-4
- Mass rebuild for Fedora 17

* Thu Dec 29 2011 Jerry James <loganjerry@gmail.com> - 0.8.0-3
- Rearrange subpackages to fix issues found on review

* Thu Dec 22 2011 Jerry James <loganjerry@gmail.com> - 0.8.0-2
- Put ipbori script in %%{_bindir} instead of a symlink
- Preserve timestamps on files with fixed include directives

* Fri Oct 14 2011 Jerry James <loganjerry@gmail.com> - 0.8.0-1
- New spec file based on old python-polybori spec.