+#
+# Conditional build:
+%bcond_with static # link statically with \-luuid
+#
Summary: Tools for the XFS filesystem
Summary(pl): Narzêdzia do systemu plików XFS
Name: xfsprogs
-Version: 1.3.17
+Version: 2.6.25
Release: 1
License: GPL
Group: Applications/System
Source0: ftp://linux-xfs.sgi.com/projects/xfs/download/cmd_tars/%{name}-%{version}.src.tar.gz
+# Source0-md5: 65fbf692f348b57f21edd4813733d9ae
Patch0: %{name}-miscfix-v2.patch
Patch1: %{name}-install-sh.patch
-BuildRequires: e2fsprogs-devel
-BuildRequires: lvm-devel
+Patch2: %{name}-sharedlibs.patch
+Patch3: %{name}-cflags.patch
+URL: http://oss.sgi.com/projects/xfs/
BuildRequires: autoconf
+BuildRequires: automake
BuildRequires: bash
-%if %{?BOOT:1}%{!?BOOT:0}
-BuildRequires: lvm-static
-BuildRequires: glibc-static
-BuildRequires: e2fsprogs-static
-%endif
-URL: http://oss.sgi.com/projects/xfs/
+BuildRequires: libtool
+BuildRequires: libuuid-devel
+%{?with_static:BuildRequires: libuuid-static}
+%{?with_static:BuildRequires: sed >= 4.0}
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+Obsoletes: libxfs1
+
+%define _sbindir /sbin
+%define _bindir /usr/sbin
+%define _libdir /%{_lib}
+%define _libexecdir /usr/%{_lib}
%description
A set of commands to use the XFS filesystem, including mkfs.xfs.
Summary: Header files and libraries to develop XFS software
Summary(pl): Pliki nag³ówkowe i biblioteki
Group: Development/Libraries
+Requires: %{name} = %{version}-%{release}
+Obsoletes: libxfs1-devel
%description devel
Header files and libraries to develop software which operates on XFS
filesystems.
-%description -l pl devel
+%description devel -l pl
Pliki nag³ówkowe i biblioteki potrzebne do rozwoju oprogramowania
operuj±cego na systemie plików XFS.
-%package BOOT
-Summary: xfs for bootdisk
-Summary(pl): xfs dla bootkietki
-Group: Applications/System
+%package static
+Summary: Static XFS software libraries
+Summary(pl): Biblioteki statyczne do XFS
+Group: Development/Libraries
+Requires: %{name}-devel = %{version}-%{release}
-%description BOOT
-xfs for bootdisk.
+%description static
+Static XFS software libraries.
-%description BOOT -l pl
-xfs dla bootkietki.
+%description static -l pl
+Biblioteki statyczne do XFS.
%prep
-%setup -q
+%setup -q
%patch0 -p1
%patch1 -p1
+%patch2 -p1
+%patch3 -p1
%build
-DEBUG="%{?debug:-DDEBUG}%{!?debug:-DNDEBUG}"; export DEBUG
-autoconf
-
-%if %{?BOOT:1}%{!?BOOT:0}
-%configure2_13 \
- --disable-shared \
- --disable-shared-uuid
-%{__make} -C libxfs
-%{__make} -C libdisk
-%{__make} -C mkfs LLDFLAGS=-all-static
-mv -f mkfs/mkfs.xfs mkfs.xfs-BOOT
-%{__make} clean
-%endif
-
-%configure2_13 \
- --enable-shared-uuid=yes
-
-%{__make}
+DEBUG="%{?debug:-DDEBUG}%{!?debug:-DNDEBUG}"
+OPTIMIZER="%{rpmcflags}"
+export DEBUG OPTIMIZER
+rm -f aclocal.m4
+%{__aclocal} -I m4
+%{__autoconf}
+%configure \
+ %{!?with_static:--enable-shared-uuid=yes} \
+ %{?with_static:--disable-shared --disable-shared-uuid}
+
+%{__make} \
+ %{?with_static:LTLINK='$(LIBTOOL) --mode=link %{__cc} -all-static' LDFLAGS=-static}
%install
rm -rf $RPM_BUILD_ROOT
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
-%{__make} install DIST_MANIFEST="$DIST_INSTALL"
-%{__make} install-dev DIST_MANIFEST="$DIST_INSTALL_DEV"
+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 \
- 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 man3/path_to_handle.3" \
+ fd_to_handle.3 free_handle.3 fssetdm_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
-%if %{?BOOT:1}%{!?BOOT:0}
-install -d $RPM_BUILD_ROOT%{_libdir}/bootdisk/sbin
-install mkfs.xfs-BOOT $RPM_BUILD_ROOT%{_libdir}/bootdisk/sbin/mkfs.xfs
-%endif
-
rm -f $RPM_BUILD_ROOT%{_mandir}/man8/xfs_info.8
-echo ".so man8/xfs_growfs.8" > $RPM_BUILD_ROOT%{_mandir}/man8/xfs_info.8
+echo ".so xfs_growfs.8" > $RPM_BUILD_ROOT%{_mandir}/man8/xfs_info.8
-gzip -9nf doc/{CHANGES,CREDITS,README.*}
+ln -sf %{_libdir}/$(cd $RPM_BUILD_ROOT%{_libdir}; echo 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.*.*.*) \
+ $RPM_BUILD_ROOT%{_libexecdir}/libxfs.so
+ln -sf %{_libdir}/$(cd $RPM_BUILD_ROOT%{_libdir}; echo libxlog.so.*.*.*) \
+ $RPM_BUILD_ROOT%{_libexecdir}/libxlog.so
%clean
rm -rf $RPM_BUILD_ROOT
-%post -p /sbin/ldconfig
+%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%files
%defattr(644,root,root,755)
-%doc doc/*.gz
-%attr(755,root,root) /sbin/*
+%doc doc/{CHANGES,CREDITS,README.*}
%attr(755,root,root) %{_sbindir}/*
-%attr(755,root,root) /lib/lib*.so.*
+%attr(755,root,root) %{_bindir}/*
+%{!?with_static:%attr(755,root,root) /%{_lib}/lib*.so.*.*}
%{_mandir}/man[185]/*
%files devel
%defattr(644,root,root,755)
%{_mandir}/man3/*
+%{_includedir}/disk
%{_includedir}/xfs
-%{_libdir}/*.a
+%if %{without static}
+%{_libexecdir}/*.la
+%attr(755,root,root) %{_libexecdir}/*.so
+%endif
-%if %{?BOOT:1}%{!?BOOT:0}
-%files BOOT
+%files static
%defattr(644,root,root,755)
-%attr(755,root,root) %{_libdir}/bootdisk/sbin/*
-%endif
+%{_libexecdir}/*.a