[packages/hfsplusutils] - shared_libs bcond (default off as it makes little sense - no public API, little binaries size diff

qboosh qboosh at pld-linux.org
Sat Mar 16 20:37:04 CET 2013


commit bc11f2491c0227a88bccd9921f41defae34886e1
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Sat Mar 16 20:36:59 2013 +0100

    - shared_libs bcond (default off as it makes little sense - no public API, little binaries size difference)
    - release 1

 hfsplusutils.spec | 31 +++++++++++++++++++++++++------
 1 file changed, 25 insertions(+), 6 deletions(-)
---
diff --git a/hfsplusutils.spec b/hfsplusutils.spec
index 1a76e17..d6d3d68 100644
--- a/hfsplusutils.spec
+++ b/hfsplusutils.spec
@@ -1,10 +1,12 @@
-# TODO
-# - why disable shared?
+#
+# Conditional build:
+%bcond_with	shared_libs	# with shared library (API not installed though, binaries size doesn't differ much)
+#
 Summary:	HFS+ volume utils
 Summary(pl.UTF-8):	Narzędzia do woluminów HFS+
 Name:		hfsplusutils
 Version:	1.0.4
-Release:	0.2
+Release:	1
 License:	GPL v2+
 Group:		Applications/System
 Source0:	ftp://ftp.penguinppc.org/users/hasi/hfsplus_%{version}.src.tar.bz2
@@ -42,9 +44,15 @@ Narzędzia do woluminów HFS+.
 %{__autoconf}
 %{__autoheader}
 %{__automake}
-
+# if building shared library, install it to /lib (for /sbin/fsck.hfsplus)
 %configure \
+%if %{with shared_libs}
+	--libdir=/%{_lib} \
+	--disable-static \
+%else
 	--disable-shared
+%endif
+
 %{__make}
 
 %install
@@ -54,8 +62,12 @@ install -d $RPM_BUILD_ROOT{/sbin,%{_mandir}/man{1,8}}
 %{__make} install \
 	DESTDIR=$RPM_BUILD_ROOT
 
-%{__rm} $RPM_BUILD_ROOT%{_libdir}/libhfsp.la
-%{__rm} $RPM_BUILD_ROOT%{_libdir}/libhfsp.a
+# API not exported, so don't package other devel stuff
+%if %{with shared_libs}
+%{__rm} $RPM_BUILD_ROOT%{_libdir}/libhfsp.{la,so}
+%else
+%{__rm} $RPM_BUILD_ROOT%{_libdir}/libhfsp.{la,a}
+%endif
 
 # move to /sbin to allow separate %{_prefix}
 mv $RPM_BUILD_ROOT%{_bindir}/hpfsck $RPM_BUILD_ROOT/sbin/fsck.hfsplus
@@ -70,9 +82,16 @@ echo '.so man1/hfsp.1' > $RPM_BUILD_ROOT%{_mandir}/man8/fsck.hfsplus.8
 %clean
 rm -rf $RPM_BUILD_ROOT
 
+%post	-p /sbin/ldconfig
+%postun	-p /sbin/ldconfig
+
 %files
 %defattr(644,root,root,755)
 %doc AUTHORS ChangeLog NEWS README
+%if %{with shared_libs}
+%attr(755,root,root) /%{_lib}/libhfsp.so.*.*.*
+%attr(755,root,root) %ghost /%{_lib}/libhfsp.so.0
+%endif
 %attr(755,root,root) /sbin/fsck.hfsplus
 %attr(755,root,root) %{_bindir}/hpcd
 %attr(755,root,root) %{_bindir}/hpcopy
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/hfsplusutils.git/commitdiff/bc11f2491c0227a88bccd9921f41defae34886e1



More information about the pld-cvs-commit mailing list