]> git.pld-linux.org Git - packages/xfsprogs.git/blobdiff - xfsprogs.spec
- rel 4
[packages/xfsprogs.git] / xfsprogs.spec
index 5a15d3ac53f89e981aef9e365db951b659f2c73d..1937c3bcfbbe4d5ffaeed308120e1b4a2c636e04 100644 (file)
@@ -1,30 +1,42 @@
+#
+# Conditional build:
+%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
 Name:          xfsprogs
-Version:       2.9.7
-Release:       2
+Version:       3.0.0
+Release:       4
 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: 2bba6d3e4183defacf99e5e8ce805460
+Source0:       ftp://linux-xfs.sgi.com/projects/xfs/cmd_tars/%{name}-%{version}.tar.gz
+# Source0-md5: ec734f935ec87ebb8be890d29380a3e6
 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
-Patch8:                %{name}-quota-exitstatus.patch
+Patch6:                %{name}-diet.patch
+Patch7:                %{name}-static-librt.patch
 URL:           http://oss.sgi.com/projects/xfs/
 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: libtool
 BuildRequires: libuuid-devel
 BuildRequires: rpmbuild(macros) >= 1.402
-Obsoletes:     libxfs1
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %define                _sbindir        /sbin
@@ -60,7 +72,6 @@ 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
@@ -82,27 +93,85 @@ 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
+# currently obsolete until needed again
+# %patch3 -p1
 %patch4 -p1
 %patch5 -p1
 %patch6 -p1
 %patch7 -p1
-%patch8 -p1
+
+rm -f include/{builddefs,platform_defs}.h
 
 %build
 %{__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_dietlibc:CC="diet %{__cc} -static"} \
+       --disable-gettext \
+       --disable-readline \
+       DEBUG="%{?debug:-DDEBUG}%{!?debug:-DNDEBUG}" \
+       OPTIMIZER="-Wno-deprecated-declarations -Os -D_BSD_SOURCE -D__USE_XOPEN_EXTENDED"
+
+%{__make} -j1 include libxfs libxlog libxcmd libhandle libdisk
+%{__make} -j1 db growfs logprint mkfs mdrestore repair \
+       LDFLAGS="%{rpmldflags} -all-static"
+
+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
+
+%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}
-# (default) --enable-gettext sets ENABLE_GETTEXT make variable, but not C define
-# CFLAGS are dropped, OPTIMIZER is propagated
 %configure \
+       --enable-gettext \
+       --enable-readline \
        DEBUG="%{?debug:-DDEBUG}%{!?debug:-DNDEBUG}" \
-       OPTIMIZER="%{rpmcflags} -DENABLE_GETTEXT"
-%{__make}
+       OPTIMIZER="%{rpmcflags}"
+
+%{__make} -j1
 
 %install
 rm -rf $RPM_BUILD_ROOT
@@ -128,8 +197,19 @@ ln -sf %{_libdir}/$(basename $RPM_BUILD_ROOT%{_libdir}/libxfs.so.*.*.*) \
 ln -sf %{_libdir}/$(basename $RPM_BUILD_ROOT%{_libdir}/libxlog.so.*.*.*) \
        $RPM_BUILD_ROOT%{_libexecdir}/libxlog.so
 
-%{__sed} -e "s|libdir='%{_libdir}'|libdir='%{_libexecdir}'|" \
+%{__sed} -i -e "s|libdir='%{_libdir}'|libdir='%{_libexecdir}'|" \
        $RPM_BUILD_ROOT%{_libexecdir}/lib{disk,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 initrd-xfs_db $RPM_BUILD_ROOT%{_sbindir}
+install initrd-xfs_growfs $RPM_BUILD_ROOT%{_sbindir}
+install initrd-xfs_logprint $RPM_BUILD_ROOT%{_sbindir}
+install initrd-mkfs.xfs $RPM_BUILD_ROOT%{_sbindir}
+install initrd-xfs_mdrestore $RPM_BUILD_ROOT%{_sbindir}
+install initrd-xfs_repair $RPM_BUILD_ROOT%{_sbindir}
+%endif
 
 %find_lang %{name}
 
@@ -182,7 +262,6 @@ rm -rf $RPM_BUILD_ROOT
 %{_libexecdir}/libxcmd.la
 %{_libexecdir}/libxfs.la
 %{_libexecdir}/libxlog.la
-%{_includedir}/disk
 %{_includedir}/xfs
 %{_mandir}/man3/*handle.3*
 %{_mandir}/man3/xfsctl.3*
@@ -194,3 +273,9 @@ rm -rf $RPM_BUILD_ROOT
 %{_libexecdir}/libxcmd.a
 %{_libexecdir}/libxfs.a
 %{_libexecdir}/libxlog.a
+
+%if %{with initrd}
+%files initrd
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_sbindir}/initrd-*
+%endif
This page took 0.154698 seconds and 4 git commands to generate.