SPECS: popt.spec - rel 2 - removed static_libs bcond - added dietlibc package

baggins baggins at pld-linux.org
Wed Mar 18 17:19:19 CET 2009


Author: baggins                      Date: Wed Mar 18 16:19:19 2009 GMT
Module: SPECS                         Tag: HEAD
---- Log message:
- rel 2
- removed static_libs bcond
- added dietlibc package

---- Files affected:
SPECS:
   popt.spec (1.97 -> 1.98) 

---- Diffs:

================================================================
Index: SPECS/popt.spec
diff -u SPECS/popt.spec:1.97 SPECS/popt.spec:1.98
--- SPECS/popt.spec:1.97	Sat May 31 01:06:48 2008
+++ SPECS/popt.spec	Wed Mar 18 17:19:14 2009
@@ -1,7 +1,7 @@
 # $Revision$, $Date$
 #
 # Conditional build:
-%bcond_without	static_libs	# don't build static libraries
+%bcond_without	dietlibc	# don't build static dietlibc library
 #
 Summary:	C library for parsing command line parameters
 Summary(de.UTF-8):	C-Library zum Parsen von Befehlszeilenparametern
@@ -12,14 +12,16 @@
 Summary(uk.UTF-8):	Бібліотека C для розбору параметрів командної стрічки
 Name:		popt
 Version:	1.14
-Release:	1
+Release:	2
 License:	X Consortium (MIT-like)
 Group:		Libraries
 Source0:	http://rpm5.org/files/popt/%{name}-%{version}.tar.gz
 # Source0-md5:	4f90a07316eb825604dd10ae4f9f3f04
+Patch1:		%{name}-diet.patch
 URL:		http://rpm5.org/
 BuildRequires:	autoconf >= 2.57
 BuildRequires:	automake >= 1.4
+%{?with_dietlibc:BuildRequires:	dietlibc-static >= 2:0.31-5}
 BuildRequires:	gettext-devel >= 0.11.5
 BuildRequires:	libtool
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
@@ -27,6 +29,10 @@
 # don't require very fresh rpm.macros to build
 %define		__gettextize	gettextize --copy --force ; cp -f po/Makevars{.template,}
 
+# for some reason known only to rpm there must be "\\|" not "\|" here
+%define		dietarch	%(echo %{_target_cpu} | sed -e 's/i.86\\|pentium.\\|athlon/i386/;s/amd64/x86_64/;s/armv.*/arm/')
+%define		dietlibdir	%{_prefix}/lib/dietlibc/lib-%{dietarch}
+
 %description
 Popt is a C library for passing command line parameters. It was heavily
 influenced by the getopt() and getopt_long() functions, but it allows
@@ -136,8 +142,21 @@
 Це окремий пакет зі статичними бібліотеками, що більше не входять в
 склад popt-devel.
 
+%package dietlibc
+Summary:	Static dietlibc library for popt development
+Summary(pl.UTF-8):	Biblioteka statyczna dietlibc popt
+Group:		Development/Libraries
+Requires:	%{name}-devel = %{version}-%{release}
+
+%description dietlibc
+Static dietlibc library for popt development.
+
+%description dietlibc -l pl.UTF-8
+Biblioteka statyczna dietlibc popt.
+
 %prep
 %setup -q
+%patch1 -p1
 
 sed -i -e 's#po/Makefile.in intl/Makefile##g' configure.ac
 
@@ -148,14 +167,27 @@
 %{__aclocal} -I m4
 %{__autoconf}
 %{__automake} -i
+
+%if %{with dietlibc}
 %configure \
-	%{!?with_static_libs:--disable-static}
+	CC="diet %{__cc} -Os -static" \
+	ac_cv_func_stpcpy=yes \
+	--enable-static \
+	--disable-shared
+
+%{__make} libpopt.la
+mv -f .libs/libpopt.a diet-libpopt.a
+%{__make} clean
+%endif
+
+%configure
 
 %{__make}
 
 %install
 rm -rf $RPM_BUILD_ROOT
 install -d $RPM_BUILD_ROOT/%{_lib}
+%{?with_dietlibc:install -d $RPM_BUILD_ROOT%{dietlibdir}}
 
 %{__make} install \
 	DESTDIR=$RPM_BUILD_ROOT
@@ -164,6 +196,8 @@
 ln -sf /%{_lib}/$(basename $RPM_BUILD_ROOT/%{_lib}/libpopt.so.*.*.*) \
 	$RPM_BUILD_ROOT%{_libdir}/libpopt.so
 
+%{?with_dietlibc:install diet-libpopt.a $RPM_BUILD_ROOT%{dietlibdir}/libpopt.a}
+
 %find_lang %{name}
 
 %clean
@@ -185,10 +219,14 @@
 %{_includedir}/popt.h
 %{_mandir}/man3/popt.3*
 
-%if %{with static_libs}
 %files static
 %defattr(644,root,root,755)
 %{_libdir}/libpopt.a
+
+%if %{with dietlibc}
+%files dietlibc
+%defattr(644,root,root,755)
+%{dietlibdir}/libpopt.a
 %endif
 
 %define date	%(echo `LC_ALL="C" date +"%a %b %d %Y"`)
@@ -197,6 +235,11 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.98  2009/03/18 16:19:14  baggins
+- rel 2
+- removed static_libs bcond
+- added dietlibc package
+
 Revision 1.97  2008/05/30 23:06:48  qboosh
 - updated to 1.14
 
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SPECS/popt.spec?r1=1.97&r2=1.98&f=u



More information about the pld-cvs-commit mailing list