[packages/libplist] - added link patch (fixes python module build with libplist already installed) - added -static - rem

qboosh qboosh at pld-linux.org
Wed Jan 20 22:12:41 CET 2016


commit a4a4e4b04caef3f9875b598d64ffb1fb388e699e
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Wed Jan 20 22:15:09 2016 +0100

    - added link patch (fixes python module build with libplist already installed)
    - added -static
    - removed obsolete glib2 dependencies, adjusted the other

 libplist-link.patch | 11 +++++++++++
 libplist.spec       | 57 ++++++++++++++++++++++++++++++++++++++++-------------
 2 files changed, 54 insertions(+), 14 deletions(-)
---
diff --git a/libplist.spec b/libplist.spec
index cc42761..41e41e1 100644
--- a/libplist.spec
+++ b/libplist.spec
@@ -1,10 +1,10 @@
 # TODO
 # - python3 package
 # - split C++ lib?
-# - fix python binding linking against system pkg vs currently built
 #
 # Conditional build:
-%bcond_without	cython	# build with Cython
+%bcond_without	cython		# build with Cython
+%bcond_without	static_libs	# static libraries
 
 Summary:	Library for manipulating Apple Property Lists
 Summary(pl.UTF-8):	Biblioteka do manipulowania Apple Property Lists
@@ -16,19 +16,22 @@ Group:		Libraries
 # Source0Download: http://www.libimobiledevice.org/
 Source0:	http://www.libimobiledevice.org/downloads/%{name}-%{version}.tar.bz2
 # Source0-md5:	82de65f38cb2f0a9fd0839679b46072b
+Patch0:		%{name}-link.patch
 URL:		http://www.libimobiledevice.org/
-BuildRequires:	glib2-devel >= 1:2.14.1
+BuildRequires:	autoconf >= 2.61
+BuildRequires:	automake
 BuildRequires:	libstdc++-devel
-BuildRequires:	libxml2-devel >= 1:2.6.30
+BuildRequires:	libtool
+BuildRequires:	libxml2-devel >= 1:2.7.8
 BuildRequires:	pkgconfig
+BuildRequires:	rpmbuild(macros) >= 1.600
 %if %{with cython}
-BuildRequires:	python-Cython
-BuildRequires:	python-devel
-BuildRequires:	python-modules
+BuildRequires:	python-Cython >= 0.17.0
+BuildRequires:	python-devel >= 1:2.3
+BuildRequires:	python-modules >= 1:2.3
 BuildRequires:	rpm-pythonprov
-BuildConflicts:	libplist-devel
 %endif
-BuildRequires:	rpmbuild(macros) >= 1.600
+Requires:	libxml2 >= 1:2.7.8
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %description
@@ -44,8 +47,7 @@ Summary:	Header files for libplist library
 Summary(pl.UTF-8):	Pliki nagłówkowe biblioteki libplist
 Group:		Development/Libraries
 Requires:	%{name} = %{version}-%{release}
-Requires:	glib2-devel >= 1:2.14.1
-Requires:	libxml2-devel >= 1:2.6.30
+Requires:	libxml2-devel >= 1:2.7.8
 
 %description devel
 Header files for libplist library.
@@ -53,6 +55,18 @@ Header files for libplist library.
 %description devel -l pl.UTF-8
 Pliki nagłówkowe biblioteki libplist.
 
+%package static
+Summary:	Static libplist library
+Summary(pl.UTF-8):	Statyczna biblioteka libplist
+Group:		Development/Libraries
+Requires:	%{name}-devel = %{version}-%{release}
+
+%description static
+Static libplist library.
+
+%description static -l pl.UTF-8
+Statyczna biblioteka libplist.
+
 %package -n python-plist
 Summary:	libplist Python bindings
 Summary(pl.UTF-8):	Wiązania libplist dla Pythona
@@ -67,14 +81,21 @@ Wiązania libplist dla Pythona.
 
 %prep
 %setup -q
+%patch0 -p1
 
 touch cython/*.py[xh]
 
 %build
+%{__libtoolize}
+%{__aclocal} -I m4
+%{__autoconf}
+%{__autoheader}
+%{__automake}
 %configure \
-	--disable-static \
 	--disable-silent-rules \
+	%{!?with_static_libs:--disable-static} \
 	%{!?with_cython:--without-cython}
+
 # make -j1 due:
 # make[2]: *** No rule to make target '../src/libplist.la', needed by 'libplist++.la'.  Stop.
 %{__make} -j1
@@ -87,14 +108,15 @@ rm -rf $RPM_BUILD_ROOT
 # obsoleted by .pc
 %{__rm} $RPM_BUILD_ROOT%{_libdir}/lib*.la
 
+%if %{with cython}
 %py_comp $RPM_BUILD_ROOT%{py_sitedir}
 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
 %py_postclean
 
-%if %{with cython}
 install -d $RPM_BUILD_ROOT%{_includedir}/plist/cython
 cp -p cython/plist.pxd $RPM_BUILD_ROOT%{_includedir}/plist/cython/plist.pxd
-%{__rm} $RPM_BUILD_ROOT%{py_sitedir}/plist.la
+%{__rm} $RPM_BUILD_ROOT%{py_sitedir}/plist.la \
+	%{?with_static_libs:$RPM_BUILD_ROOT%{py_sitedir}/plist.a}
 %endif
 
 %clean
@@ -120,6 +142,13 @@ rm -rf $RPM_BUILD_ROOT
 %{_pkgconfigdir}/libplist++.pc
 %{_pkgconfigdir}/libplist.pc
 
+%if %{with static_libs}
+%files static
+%defattr(644,root,root,755)
+%{_libdir}/libplist++.a
+%{_libdir}/libplist.a
+%endif
+
 %if %{with cython}
 %files -n python-plist
 %defattr(644,root,root,755)
diff --git a/libplist-link.patch b/libplist-link.patch
new file mode 100644
index 0000000..6f5c15d
--- /dev/null
+++ b/libplist-link.patch
@@ -0,0 +1,11 @@
+--- libplist-1.11/cython/Makefile.am.orig	2013-12-13 00:46:18.000000000 +0100
++++ libplist-1.11/cython/Makefile.am	2016-01-20 21:54:30.895444952 +0100
+@@ -20,7 +20,7 @@
+ plist_LTLIBRARIES = plist.la
+ plist_la_SOURCES = plist_util.c plist_util.h plist.pyx
+ plist_la_CFLAGS = -I../include -I../src $(PYTHON_CPPFLAGS) $(AM_CFLAGS) -Wno-shadow -Wno-redundant-decls -Wno-switch-default -Wno-strict-aliasing -Wno-implicit-function-declaration
+-plist_la_LDFLAGS = -module -avoid-version -L$(libdir) $(PYTHON_LDFLAGS) $(AM_LDFLAGS)
++plist_la_LDFLAGS = -module -avoid-version $(PYTHON_LDFLAGS) $(AM_LDFLAGS)
+ plist_la_LIBADD = ../src/libplist.la
+ 
+ plist.c: plist.pyx $(PXDINCLUDES) $(PXIINCLUDES)
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/libplist.git/commitdiff/a4a4e4b04caef3f9875b598d64ffb1fb388e699e



More information about the pld-cvs-commit mailing list