X-Git-Url: http://git.pld-linux.org/?a=blobdiff_plain;f=libpst.spec;h=c9e98b0f2832cd6764ba0ef04a97cc9f53aaef38;hb=4cea07d2e7a4d647966d3dce15284b5759be7380;hp=e7cdc471d7c16589af9fe7f42d60cf5b605248a0;hpb=321a9f8d79517b503a076be862c3fea395f7c7f5;p=packages%2Flibpst.git diff --git a/libpst.spec b/libpst.spec index e7cdc47..c9e98b0 100644 --- a/libpst.spec +++ b/libpst.spec @@ -1,28 +1,40 @@ # # Conditional build: +%bcond_without python2 # CPython 2.x module +%bcond_without python3 # CPython 3.x module %bcond_without static_libs # don't build static libraries # Summary: Library for reading .pst files Summary(pl.UTF-8): Biblioteka do czytania plików .pst Name: libpst -Version: 0.6.60 +Version: 0.6.72 Release: 2 License: GPL v2+ Group: Libraries -Source0: http://www.five-ten-sg.com/libpst/packages/%{name}-%{version}.tar.gz -# Source0-md5: d080ce7488d8b91294bd246c511622d6 -URL: http://www.five-ten-sg.com/libpst/ +Source0: https://www.five-ten-sg.com/libpst/packages/%{name}-%{version}.tar.gz +# Source0-md5: 0085c9769a163e7ac59dba6518e0cc1e +Patch0: %{name}-link.patch +URL: https://www.five-ten-sg.com/libpst/ BuildRequires: ImageMagick -BuildRequires: autoconf >= 2.59 +BuildRequires: autoconf >= 2.60 BuildRequires: automake -BuildRequires: boost-python-devel BuildRequires: gd-devel BuildRequires: libgsf-devel BuildRequires: libstdc++-devel -BuildRequires: libtool -BuildRequires: python-devel -BuildRequires: python-modules +BuildRequires: libtool >= 2:1.5 +BuildRequires: pkgconfig +%if %{with python2} +BuildRequires: boost-python-devel +BuildRequires: python-devel >= 2 +BuildRequires: python-modules >= 2 +%endif +%if %{with python3} +BuildRequires: boost-python3-devel +BuildRequires: python3-devel >= 1:3.2 +BuildRequires: python3-modules >= 1:3.2 +%endif BuildRequires: rpm-pythonprov +BuildRequires: zlib-devel BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) %description @@ -70,18 +82,30 @@ Utilities for converting Microsoft Outlook .pst files. Narzędzia do konwertowania plików .pst Microsoft Outlooka. %package -n python-libpst -Summary: libpst Python bindings -Summary(pl.UTF-8): Wiązania libpst dla Pythona +Summary: libpst Python 2 bindings +Summary(pl.UTF-8): Wiązania libpst dla Pythona 2 Group: Development/Languages/Python %description -n python-libpst -libpst Python bindings. +libpst Python 2 bindings. %description -n python-libpst -l pl.UTF-8 -Wiązania libpst dla Pythona. +Wiązania libpst dla Pythona 2. + +%package -n python3-libpst +Summary: libpst Python 3 bindings +Summary(pl.UTF-8): Wiązania libpst dla Pythona 3 +Group: Development/Languages/Python + +%description -n python3-libpst +libpst Python 3 bindings. + +%description -n python3-libpst -l pl.UTF-8 +Wiązania libpst dla Pythona 3. %prep %setup -q +%patch0 -p1 %build %{__libtoolize} @@ -92,18 +116,34 @@ Wiązania libpst dla Pythona. %configure \ %{!?with_static_libs:--disable-static} \ --enable-dii \ - --enable-libpst-shared + --enable-libpst-shared \ + %{!?with_python3:--disable-python} %{__make} +%if %{with python2} +install -d build-py2 +./libtool --mode=compile %{__cxx} %{rpmcxxflags} %{rpmcppflags} -I. -Isrc -I%{py_incdir} -o build-py2/python-libpst.lo -c python/python-libpst.cpp +./libtool --mode=link %{__cxx} -shared -module -avoid-version -rpath %{py_sitedir} %{rpmldflags} %{rpmcxxflags} -o build-py2/_libpst.la build-py2/python-libpst.lo src/libpst.la -lboost_python%(echo %{py_ver} | tr -d .) +%endif + %install rm -rf $RPM_BUILD_ROOT -install -d $RPM_BUILD_ROOT%{py_sitedir} %{__make} install \ DESTDIR=$RPM_BUILD_ROOT -%{__rm} $RPM_BUILD_ROOT%{py_sitedir}/_libpst.{a,la} +%{__rm} $RPM_BUILD_ROOT%{py3_sitedir}/_libpst.la +%if %{with static_libs} +%{__rm} $RPM_BUILD_ROOT%{py3_sitedir}/_libpst.a +%endif + +%if %{with python2} +install -d $RPM_BUILD_ROOT%{py_sitedir} +./libtool --mode=install install build-py2/_libpst.la $RPM_BUILD_ROOT%{py_sitedir} +%{__rm} $RPM_BUILD_ROOT%{py_sitedir}/_libpst.la +%endif + # packaged as %doc (split into base and -devel) %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version} @@ -146,6 +186,14 @@ rm -rf $RPM_BUILD_ROOT %{_mandir}/man1/readpst.1* %{_mandir}/man5/outlook.pst.5* +%if %{with python2} %files -n python-libpst %defattr(644,root,root,755) %attr(755,root,root) %{py_sitedir}/_libpst.so +%endif + +%if %{with python3} +%files -n python3-libpst +%defattr(644,root,root,755) +%attr(755,root,root) %{py3_sitedir}/_libpst.so +%endif