# Conditional build:
%bcond_with static # don't use shared libraries
%bcond_without imode # don't build interactive mode
+%bcond_without python # don't build python bindings
#
# required versions (forced to avoid SEGV with mixed db used by rpm and poldek)
%define ver_db 4.3.27-1
Summary(pl): Pomocnicze narzêdzie do zarz±dzania pakietami RPM
Name: poldek
Version: 0.20
-Release: 6
+Release: 9.3
License: GPL v2
Group: Applications/System
Source0: http://poldek.pld-linux.org/download/%{name}-%{version}.tar.bz2
BuildRequires: pcre-devel
BuildRequires: perl-tools-pod
BuildRequires: popt-devel
+%{?with_python:BuildRequires: python-devel}
BuildRequires: readline-devel >= 5.0
BuildRequires: rpm-devel >= %{ver_rpm}
BuildRequires: zlib-devel
%description static -l pl
Biblioteki statyczne poldka.
+%package -n python-poldek
+Summary: Python modules for poldek
+Summary(pl): Modu³y jêzyka Python dla poldka
+Group: Libraries/Python
+Requires: %{name}-libs = %{version}-%{release}
+%pyrequires_eq python-libs
+
+%description -n python-poldek
+Python modules for poldek.
+
+%description -n python-poldek -l pl
+Modu³y jêzyka Python dla poldka.
+
%prep
%setup -q
%patch0 -p2
%configure \
%{?with_static:--enable-static --disable-shared} \
%{!?with_imode:--disable-imode} \
- --enable-nls
+ --enable-nls \
+ %{?with_python:--with-python}
%{__make}
%install
%{__make} install \
DESTDIR=$RPM_BUILD_ROOT
+%if %{with python}
+%{__make} -C python install \
+ DESTDIR=$RPM_BUILD_ROOT \
+ libdir=%{py_sitedir}
+%endif
+
%{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
%ifarch i486 i686 ppc sparc alpha athlon
cp -a conf configs
rm -f configs/Makefile*
+%py_postclean
+rm -f $RPM_BUILD_ROOT%{py_sitedir}/_poldekmod.la
+
%find_lang %{name}
%clean
%files static
%defattr(644,root,root,755)
%{_libdir}/lib*.a
+
+%if %{with python}
+%files -n python-poldek
+%defattr(644,root,root,755)
+%attr(755,root,root) %{py_sitedir}/_poldekmod.so
+%{py_sitescriptdir}/poldek.py[co]
+%{py_sitescriptdir}/poldekmod.py[co]
+%endif