X-Git-Url: http://git.pld-linux.org/?a=blobdiff_plain;f=xfsprogs.spec;h=d38e9dbd1bfbcbeb22528f3719824ee488e0e701;hb=a084b09941cf0f74b35b1d843daf5fcef31a6805;hp=6172529a460aca602cfbe6e0f10855b21abffa1a;hpb=ddc220a9d337a5fa08e232af41f15cba0683bb69;p=packages%2Fxfsprogs.git diff --git a/xfsprogs.spec b/xfsprogs.spec index 6172529..d38e9db 100644 --- a/xfsprogs.spec +++ b/xfsprogs.spec @@ -1,41 +1,59 @@ # # Conditional build: -%bcond_with static # link statically with \-luuid -%bcond_with dynamic_exe # link executables dynamically with xfs libs +%bcond_without initrd # don't build initrd version +%bcond_without dietlibc # link initrd version with static glibc instead of dietlibc # Summary: Tools for the XFS filesystem -Summary(pl.UTF-8): Narzędzia do systemu plików XFS +Summary(pl.UTF-8): Narzędzia do systemu plików XFS Name: xfsprogs -Version: 2.8.18 -Release: 2 +Version: 3.1.1 +Release: 1 License: LGPL v2.1 (libhandle), GPL v2 (the rest) Group: Applications/System -Source0: ftp://linux-xfs.sgi.com/projects/xfs/download/cmd_tars/%{name}_%{version}-1.tar.gz -# Source0-md5: 6ce9e198cc79ebec6f6fb1f34ffa7709 +Source0: ftp://linux-xfs.sgi.com/projects/xfs/cmd_tars/%{name}-%{version}.tar.gz +# Source0-md5: c2308b46ee707597ac50aae418d321b8 Patch0: %{name}-miscfix-v2.patch Patch1: %{name}-install-sh.patch Patch2: %{name}-sharedlibs.patch Patch3: %{name}-pl.po-update.patch Patch4: %{name}-dynamic_exe.patch Patch5: %{name}-LDFLAGS.patch -Patch6: %{name}-libtool.patch -Patch7: %{name}-gettext.patch -URL: http://oss.sgi.com/projects/xfs/ +Patch6: %{name}-diet.patch +Patch7: %{name}-static-librt.patch +URL: http://www.xfs.org/ BuildRequires: autoconf BuildRequires: automake BuildRequires: bash +%if %{with initrd} + %if %{with dietlibc} +BuildRequires: dietlibc-static >= 2:0.31-6 +BuildRequires: libuuid-dietlibc + %else +BuildRequires: glibc-static +BuildRequires: libuuid-static + %endif +%endif BuildRequires: gettext-devel +BuildRequires: libblkid-devel BuildRequires: libtool BuildRequires: libuuid-devel -%{?with_static:BuildRequires: libuuid-static} -%{?with_static:BuildRequires: sed >= 4.0} -Obsoletes: libxfs1 +BuildRequires: readline-devel +BuildRequires: rpm >= 4.4.9-56 +BuildRequires: rpmbuild(macros) >= 1.402 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) +%if "%{pld_release}" == "ac" +# libtool in ac doesn't do the reordering of args properly +%define filterout_ld -Wl,--as-needed +%endif + %define _sbindir /sbin %define _bindir /usr/sbin %define _libdir /%{_lib} %define _libexecdir /usr/%{_lib} +# 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 A set of commands to use the XFS filesystem, including mkfs.xfs. @@ -61,11 +79,10 @@ B-drzewa by uzyskać wysoką wydajność oraz skalowalność. %package devel Summary: Header files and libraries to develop XFS software -Summary(pl.UTF-8): Pliki nagłówkowe i biblioteki +Summary(pl.UTF-8): Pliki nagłówkowe i biblioteki Group: Development/Libraries Requires: %{name} = %{version}-%{release} Requires: libuuid-devel -Obsoletes: libxfs1-devel %description devel Header files and libraries to develop software which operates on XFS @@ -77,7 +94,7 @@ operującego na systemie plików XFS. %package static Summary: Static XFS software libraries -Summary(pl.UTF-8): Biblioteki statyczne do XFS +Summary(pl.UTF-8): Biblioteki statyczne do XFS Group: Development/Libraries Requires: %{name}-devel = %{version}-%{release} @@ -87,72 +104,138 @@ Static XFS software libraries. %description static -l pl.UTF-8 Biblioteki statyczne do XFS. +%package initrd +Summary: Tools for the XFS filesystem - initrd version +Summary(pl.UTF-8): Narzędzia do systemu plików XFS - wersja dla initrd +Group: Base + +%description initrd +A set of commands to use the XFS filesystem, including mkfs.xfs + - initrd version. + +%description initrd -l pl.UTF-8 +Zbiór komend do użytku z systemem plików XFS, włączając w to mkfs.xfs + - wersja dla initrd. + %prep %setup -q %patch0 -p1 %patch1 -p1 %patch2 -p1 -%patch3 -p1 -%{?with_dynamic_exe:%patch4 -p1} +# currently obsolete until needed again +# %patch3 -p1 +%patch4 -p1 %patch5 -p1 %patch6 -p1 %patch7 -p1 +rm -f include/{builddefs,platform_defs}.h + %build -DEBUG="%{?debug:-DDEBUG}%{!?debug:-DNDEBUG}" -OPTIMIZER="%{rpmcflags} -DENABLE_GETTEXT" -export DEBUG OPTIMIZER -rm -f aclocal.m4 %{__aclocal} -I m4 + +%if %{with initrd} +%if %{with dietlibc} +# dietlibc doesn't have aio.h (and xfsprogs does not need it really) +# dietlibc has needed librt stuff in libc/libpthread +sed -i -e 's|^AC_PACKAGE_NEED_AIO_H|dnl AC_PACKAGE_NEED_AIO_H|' \ + -e 's|^AC_PACKAGE_NEED_LIO_LISTIO|dnl AC_PACKAGE_NEED_LIO_LISTIO|' \ + configure.in +sed -i -e 's|\(^LIBRT.*=.*\)|# \1|' include/builddefs.in +sed -i -e 's|\(^LLDLIBS.*=.*\)|\1 -lcompat|' db/Makefile mkfs/Makefile +%endif + %{__autoconf} %configure \ - %{!?with_static:--enable-shared-uuid=yes} \ - %{?with_static:--disable-shared --disable-shared-uuid} + %{?with_dietlibc:CC="diet %{__cc} -static"} \ + --sbindir=%{_bindir} \ + --disable-gettext \ + --disable-readline \ + DEBUG="%{?debug:-DDEBUG}%{!?debug:-DNDEBUG}" \ + OPTIMIZER="%{rpmcflags} -Wno-deprecated-declarations -Os -D_BSD_SOURCE -D__USE_XOPEN_EXTENDED" + +%{__make} -j1 include libxfs libxlog libxcmd libhandle libdisk \ + LIBUUID="%{dietlibdir}/libuuid.a" +%{__make} -j1 db growfs logprint mkfs mdrestore repair \ + LDFLAGS="%{rpmldflags} -all-static" \ + LIBUUID="%{dietlibdir}/libuuid.a" + +mkdir -p initrd +mv -f db/xfs_db initrd/xfs_db +mv -f growfs/xfs_growfs initrd/xfs_growfs +mv -f logprint/xfs_logprint initrd/xfs_logprint +mv -f mkfs/mkfs.xfs initrd/mkfs.xfs +mv -f mdrestore/xfs_mdrestore initrd/xfs_mdrestore +mv -f repair/xfs_repair initrd/xfs_repair -%{__make} \ - %{?with_static:LTLINK='$(LIBTOOL) --mode=link %{__cc} -all-static' LDFLAGS=-static} +%if %{with dietlibc} +sed -i -e 's|^dnl AC_PACKAGE_NEED_AIO_H|AC_PACKAGE_NEED_AIO_H|' \ + -e 's|^dnl AC_PACKAGE_NEED_LIO_LISTIO|AC_PACKAGE_NEED_LIO_LISTIO|' \ + configure.in +sed -i -e 's|^# \(LIBRT.*=.*\)|\1|' include/builddefs.in +sed -i -e 's|\(^LLDLIBS.*=.*\) -lcompat|\1|' db/Makefile mkfs/Makefile +%endif + +%{__make} clean +%endif + +%{__autoconf} +%configure \ + --sbindir=%{_bindir}\ + --enable-gettext \ + --enable-readline \ + DEBUG="%{?debug:-DDEBUG}%{!?debug:-DNDEBUG}" \ + OPTIMIZER="%{rpmcflags}" + +%{__make} -j1 %install rm -rf $RPM_BUILD_ROOT -DIST_ROOT="$RPM_BUILD_ROOT" -DIST_INSTALL=`pwd`/install.manifest -DIST_INSTALL_DEV=`pwd`/install-dev.manifest +install -d $RPM_BUILD_ROOT%{_libexecdir} + +DIST_ROOT=$RPM_BUILD_ROOT +DIST_INSTALL=$(pwd)/install.manifest +DIST_INSTALL_DEV=$(pwd)/install-dev.manifest export DIST_ROOT DIST_INSTALL DIST_INSTALL_DEV -%{?with_static:sed -i -e 's/\.lai/.la/' include/buildmacros} %{__make} install \ DIST_MANIFEST="$DIST_INSTALL" %{__make} install-dev \ DIST_MANIFEST="$DIST_INSTALL_DEV" -for man in attr_list_by_handle.3 attr_multi_by_handle.3 \ - fd_to_handle.3 free_handle.3 fssetdm_by_handle.3 \ - getparentpaths_by_handle.3 getparents_by_handle.3 \ - handle_to_fshandle.3 open_by_handle.3 path_to_fshandle.3 \ - readlink_by_handle.3; do - rm -f $RPM_BUILD_ROOT%{_mandir}/man3/$man - echo ".so path_to_handle.3" \ - > $RPM_BUILD_ROOT%{_mandir}/man3/$man -done - -rm -f $RPM_BUILD_ROOT%{_mandir}/man8/xfs_info.8 -echo ".so xfs_growfs.8" > $RPM_BUILD_ROOT%{_mandir}/man8/xfs_info.8 - -ln -sf %{_libdir}/$(cd $RPM_BUILD_ROOT%{_libdir}; echo libhandle.so.*.*.*) \ +ln -sf %{_libdir}/$(basename $RPM_BUILD_ROOT%{_libdir}/libhandle.so.*.*.*) \ $RPM_BUILD_ROOT%{_libexecdir}/libhandle.so -ln -sf %{_libdir}/$(cd $RPM_BUILD_ROOT%{_libdir}; echo libdisk.so.*.*.*) \ - $RPM_BUILD_ROOT%{_libexecdir}/libdisk.so -ln -sf %{_libdir}/$(cd $RPM_BUILD_ROOT%{_libdir}; echo libxfs.so.*.*.*) \ +ln -sf %{_libdir}/$(basename $RPM_BUILD_ROOT%{_libdir}/libxcmd.so.*.*.*) \ + $RPM_BUILD_ROOT%{_libexecdir}/libxcmd.so +ln -sf %{_libdir}/$(basename $RPM_BUILD_ROOT%{_libdir}/libxfs.so.*.*.*) \ $RPM_BUILD_ROOT%{_libexecdir}/libxfs.so -ln -sf %{_libdir}/$(cd $RPM_BUILD_ROOT%{_libdir}; echo libxlog.so.*.*.*) \ +ln -sf %{_libdir}/$(basename $RPM_BUILD_ROOT%{_libdir}/libxlog.so.*.*.*) \ $RPM_BUILD_ROOT%{_libexecdir}/libxlog.so -%{__sed} -e "s|libdir='%{_libdir}'|libdir='%{_libexecdir}'|" \ - $RPM_BUILD_ROOT%{_libexecdir}/lib{disk,handle,xfs,xlog}.la +mv $RPM_BUILD_ROOT%{_libdir}/lib*.la $RPM_BUILD_ROOT%{_libexecdir} +mv $RPM_BUILD_ROOT%{_libdir}/lib*.a $RPM_BUILD_ROOT%{_libexecdir} + +%{__sed} -i -e "s|libdir='%{_libdir}'|libdir='%{_libexecdir}'|" \ + $RPM_BUILD_ROOT%{_libexecdir}/lib{handle,xcmd,xfs,xlog}.la +%{__sed} -i -e "s| %{_libdir}/libxfs.la | %{_libexecdir}/libxfs.la |" \ + $RPM_BUILD_ROOT%{_libexecdir}/libxlog.la + +%if %{with initrd} +install -d $RPM_BUILD_ROOT%{_libexecdir}/initrd +install initrd/* $RPM_BUILD_ROOT%{_libexecdir}/initrd/ +%endif %find_lang %{name} +rm -rf $RPM_BUILD_ROOT%{_docdir}/%{name} + +# already in /usr +rm -f $RPM_BUILD_ROOT%{_libdir}/libhandle.{a,la,so} +rm -f $RPM_BUILD_ROOT%{_libdir}/libxcmd.{a,la,so} +rm -f $RPM_BUILD_ROOT%{_libdir}/libxfs.{a,la,so} +rm -f $RPM_BUILD_ROOT%{_libdir}/libxlog.{a,la,so} + %clean rm -rf $RPM_BUILD_ROOT @@ -162,21 +245,53 @@ rm -rf $RPM_BUILD_ROOT %files -f %{name}.lang %defattr(644,root,root,755) %doc README doc/{CHANGES,CREDITS} -%attr(755,root,root) %{_sbindir}/* -%attr(755,root,root) %{_bindir}/* -%{!?with_static:%attr(755,root,root) /%{_lib}/lib*.so.*.*} -%{_mandir}/man[185]/* +%attr(755,root,root) %{_sbindir}/fsck.xfs +%attr(755,root,root) %{_sbindir}/mkfs.xfs +%attr(755,root,root) %{_sbindir}/xfs_repair +%attr(755,root,root) %{_bindir}/xfs_* +%attr(755,root,root) %{_libdir}/libhandle.so.*.* +%attr(755,root,root) %{_libdir}/libxcmd.so.*.* +%attr(755,root,root) %{_libdir}/libxfs.so.*.* +%attr(755,root,root) %{_libdir}/libxlog.so.*.* +%attr(755,root,root) %ghost %{_libdir}/libhandle.so.1 +%attr(755,root,root) %ghost %{_libdir}/libxcmd.so.0 +%attr(755,root,root) %ghost %{_libdir}/libxfs.so.0 +%attr(755,root,root) %ghost %{_libdir}/libxlog.so.0 +%{_mandir}/man5/projects.5* +%{_mandir}/man5/projid.5* +%{_mandir}/man5/xfs.5* +%{_mandir}/man8/fsck.xfs.8* +%{_mandir}/man8/mkfs.xfs.8* +%{_mandir}/man8/xfs_*.8* %files devel %defattr(644,root,root,755) -%if !%{with static} -%attr(755,root,root) %{_libexecdir}/lib*.so -%{_libexecdir}/lib*.la -%endif -%{_includedir}/disk +%attr(755,root,root) %{_libexecdir}/libhandle.so +%attr(755,root,root) %{_libexecdir}/libxcmd.so +%attr(755,root,root) %{_libexecdir}/libxfs.so +%attr(755,root,root) %{_libexecdir}/libxlog.so +%{_libexecdir}/libhandle.la +%{_libexecdir}/libxcmd.la +%{_libexecdir}/libxfs.la +%{_libexecdir}/libxlog.la %{_includedir}/xfs -%{_mandir}/man3/* +%{_mandir}/man3/*handle.3* +%{_mandir}/man3/xfsctl.3* %files static %defattr(644,root,root,755) -%{_libexecdir}/lib*.a +%{_libexecdir}/libhandle.a +%{_libexecdir}/libxcmd.a +%{_libexecdir}/libxfs.a +%{_libexecdir}/libxlog.a + +%if %{with initrd} +%files initrd +%defattr(644,root,root,755) +%attr(755,root,root) %{_libexecdir}/initrd/mkfs.xfs +%attr(755,root,root) %{_libexecdir}/initrd/xfs_db +%attr(755,root,root) %{_libexecdir}/initrd/xfs_growfs +%attr(755,root,root) %{_libexecdir}/initrd/xfs_logprint +%attr(755,root,root) %{_libexecdir}/initrd/xfs_mdrestore +%attr(755,root,root) %{_libexecdir}/initrd/xfs_repair +%endif