]> git.pld-linux.org Git - packages/xfsprogs.git/blobdiff - xfsprogs.spec
- fix packaging when built without scrub
[packages/xfsprogs.git] / xfsprogs.spec
index f8dc52e4906a101aa7c4b2a65b8547e202865c3a..e648dfdff3e4e21c6d5dfcfcd254584ed56c141b 100644 (file)
@@ -1,41 +1,54 @@
 #
 # Conditional build:
-%bcond_with    static          # link statically with \-luuid
-%bcond_with    dynamic_exe     # link executables dynamically with xfs libs
+%bcond_without debug_asserts
+%bcond_without scrub
+%bcond_without static_libs     # static library
 #
 Summary:       Tools for the XFS filesystem
-Summary(pl):   Narzêdzia do systemu plików XFS
+Summary(pl.UTF-8):     Narzędzia do systemu plików XFS
 Name:          xfsprogs
-Version:       2.8.16
+Version:       6.7.0
 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: 632c7745f884dc5e6fd707a18971aca3
+Source0:       https://www.kernel.org/pub/linux/utils/fs/xfs/xfsprogs/%{name}-%{version}.tar.xz
+# Source0-md5: 0bde7bc8b3d8cbbd01064f756f67911f
+Source1:       xfs_lsprojid
 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/
-BuildRequires: autoconf
+Patch1:                %{name}-pl.po-update.patch
+URL:           https://xfs.wiki.kernel.org/
+# for <attr/attributes.h>
+BuildRequires: attr-devel
+BuildRequires: autoconf >= 2.69
 BuildRequires: automake
 BuildRequires: bash
-BuildRequires: gettext-devel
+BuildRequires: device-mapper-devel
+BuildRequires: gettext-tools
+BuildRequires: glibc-static
+BuildRequires: inih-devel
+BuildRequires: libblkid-devel
+# without .la file so that -static-libtool-libs won't take libedit.a
+BuildRequires: libedit-devel >= 3.1-1.20191231.1
+BuildRequires: libicu-devel
 BuildRequires: libtool
 BuildRequires: libuuid-devel
-%{?with_static:BuildRequires:  libuuid-static}
-%{?with_static:BuildRequires:  sed >= 4.0}
-Obsoletes:     libxfs1
+BuildRequires: libuuid-static
+BuildRequires: pkgconfig
+BuildRequires: rpm >= 4.4.9-56
+BuildRequires: rpmbuild(macros) >= 1.527
+%{?with_scrub:BuildRequires:   systemd-devel}
+BuildRequires: userspace-rcu-devel
+BuildRequires: userspace-rcu-static
+BuildRequires: sed >= 4.0
+BuildRequires: tar >= 1:1.22
+BuildRequires: xz
+Obsoletes:     xfsprogs-initrd < 3.1.11-2
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
-%define                _sbindir        /sbin
-%define                _bindir         /usr/sbin
-%define                _libdir         /%{_lib}
-%define                _libexecdir     /usr/%{_lib}
+%if "%{pld_release}" == "ac"
+# libtool in ac doesn't do the reordering of args properly
+%define                filterout_ld -Wl,--as-needed
+%endif
 
 %description
 A set of commands to use the XFS filesystem, including mkfs.xfs.
@@ -50,105 +63,129 @@ scalability.
 This implementation is on-disk compatible with the IRIX version of
 XFS.
 
-%description -l pl
-Zbiór komend do u¿ytku z systemem plików XFS, w³±czaj±c w to mkfs.xfs.
+%description -l pl.UTF-8
+Zbiór komend do użytku z systemem plików XFS, włączając w to mkfs.xfs.
+
+XFS jest wysoko wydajnym systemem plików z kroniką, który oryginalnie
+był używany na platformie SGI IRIX. Jest to w pełni wielowątkowy,
+obsługujący wielkie pliki oraz wielkie systemy, o rozszerzonych
+atrybutach, zmiennych wielkościach bloków, mocno wykorzystujący
+B-drzewa by uzyskać wysoką wydajność oraz skalowalność.
+
+%package scrub
+Summary:       xfs_scrub - XFS online check and repair feature (EXPERIMENTAL!)
+Summary(pl.UTF-8):     xfs_scrub - sprawdzanie i naprawianie zamontowanego systemu plików XFS (EKSPERYMENTALNE!)
+Group:         Applications/System
+Requires:      %{name} = %{version}-%{release}
+Requires:      systemd-units >= 38
+
+%description scrub
+xfs_scrub is an XFS online check and repair feature.
 
-XFS jest wysoko wydajnym systemem plików z kronik±, który oryginalnie
-by³ u¿ywany na platformie SGI IRIX. Jest to w pe³ni wielow±tkowy,
-obs³uguj±cy wielkie pliki oraz wielkie systemy, o rozszerzonych
-atrybutach, zmiennych wielko¶ciach bloków, mocno wykorzystuj±cy
-B-drzewa by uzyskaæ wysok± wydajno¶æ oraz skalowalno¶æ.
+WARNING: EXPERIMENTAL, use at your own risk!
+
+%description scrub -l pl.UTF-8
+xfs_scrub służy do sprawdzania i naprawiania zamontowanego systmeu
+plików XFS w locie.
+
+UWAGA: EXPERIMENTALNE, użycie na własne ryzyko!
 
 %package devel
 Summary:       Header files and libraries to develop XFS software
-Summary(pl):   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
+Requires:      linux-libc-headers
 
 %description devel
 Header files and libraries to develop software which operates on XFS
 filesystems.
 
-%description devel -l pl
-Pliki nag³ówkowe i biblioteki potrzebne do rozwoju oprogramowania
-operuj±cego na systemie plików XFS.
+%description devel -l pl.UTF-8
+Pliki nagłówkowe i biblioteki potrzebne do rozwoju oprogramowania
+operującego na systemie plików XFS.
 
 %package static
 Summary:       Static XFS software libraries
-Summary(pl):   Biblioteki statyczne do XFS
+Summary(pl.UTF-8):     Biblioteki statyczne do XFS
 Group:         Development/Libraries
 Requires:      %{name}-devel = %{version}-%{release}
 
 %description static
 Static XFS software libraries.
 
-%description static -l pl
+%description static -l pl.UTF-8
 Biblioteki statyczne do XFS.
 
 %prep
 %setup -q
 %patch0 -p1
-%patch1 -p1
-%patch2 -p1
-%patch3 -p1
-%{?with_dynamic_exe:%patch4 -p1}
-%patch5 -p1
-%patch6 -p1
-%patch7 -p1
+
+# files order in pot changes in every version, making diff huge - sort entries first
+%{__mv} po/xfsprogs.pot po/xfsprogs.pot.upstream
+msgcat -F po/xfsprogs.pot.upstream -o po/xfsprogs.pot
+# update line numbers etc.
+%{__mv} po/pl.po po/pl.po.upstream
+msgmerge po/pl.po.upstream po/xfsprogs.pot -o po/pl.po
+%patch1 -p1 -b .orig
+
+%{__sed} -i -e '1s,/usr/bin/env python3,%{__python3},' scrub/xfs_scrub_all.in tools/xfsbuflock.py
 
 %build
-DEBUG="%{?debug:-DDEBUG}%{!?debug:-DNDEBUG}"
-OPTIMIZER="%{rpmcflags} -DENABLE_GETTEXT"
-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}
+       DEBUG="%{?with_debug_asserts:-DDEBUG}%{!?with_debug_asserts:-DNDEBUG}" \
+       OPTIMIZER="%{rpmcflags}" \
+       --enable-editline \
+       --enable-gettext \
+       --enable-libicu \
+       --disable-lto \
+       %{?with_scrub:--enable-scrub=yes} \
+       %{__enable_disable static_libs static} \
+       --with-udev-rule-dir=/lib/udev/rules.d
 
 %{__make} \
-       %{?with_static:LTLINK='$(LIBTOOL) --mode=link %{__cc} -all-static' LDFLAGS=-static}
+       V=1
 
 %install
 rm -rf $RPM_BUILD_ROOT
+install -d $RPM_BUILD_ROOT/etc/cron.d
 
-DIST_ROOT="$RPM_BUILD_ROOT"
-DIST_INSTALL=`pwd`/install.manifest
-DIST_INSTALL_DEV=`pwd`/install-dev.manifest
+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 \
-       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.*.*.*) \
-        $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
-
-%{__sed} -e "s|libdir='%{_libdir}'|libdir='%{_libexecdir}'|" \
-       $RPM_BUILD_ROOT%{_libexecdir}/lib{disk,handle,xfs,xlog}.la
+install -p %{SOURCE1} $RPM_BUILD_ROOT%{_sbindir}/xfs_lsprojid
+
+# adjust symlink to point to actual library, not libhandle.so symlink, which we remove afterwards
+ln -sf /%{_lib}/$(basename $RPM_BUILD_ROOT/%{_lib}/libhandle.so.*.*.*) \
+        $RPM_BUILD_ROOT%{_libdir}/libhandle.so
+# adjust library path used at link time
+%{__sed} -i -e "s|libdir='/%{_lib}'|libdir='%{_libdir}'|" \
+       $RPM_BUILD_ROOT%{_libdir}/libhandle.la
+# already in /usr
+%{__rm} $RPM_BUILD_ROOT/%{_lib}/libhandle.{so,la,a}
+
+# install cron file
+%if %{with scrub}
+%{__mv} $RPM_BUILD_ROOT{%{_datadir}/%{name}/xfs_scrub_all.cron,/etc/cron.d/xfs_scrub_all}
+%else
+%{__rm} $RPM_BUILD_ROOT/%{_datadir}/%{name}/xfs_scrub_all.cron
+%endif
+
+# (config file paths are specified in libfrog/projects.c)
+echo "#10:/mnt/ftp/roman"  >> $RPM_BUILD_ROOT/etc/projects
+echo "#ftproman:10" >> $RPM_BUILD_ROOT/etc/projid
+
+%{__rm} -r $RPM_BUILD_ROOT%{_docdir}/%{name}
 
 %find_lang %{name}
 
@@ -158,24 +195,80 @@ rm -rf $RPM_BUILD_ROOT
 %post  -p /sbin/ldconfig
 %postun -p /sbin/ldconfig
 
+%post scrub
+%systemd_reload
+
 %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]/*
+%config(noreplace) %verify(not md5 mtime size) /etc/projects
+%config(noreplace) %verify(not md5 mtime size) /etc/projid
+%attr(755,root,root) /sbin/fsck.xfs
+%attr(755,root,root) /sbin/mkfs.xfs
+%attr(755,root,root) /sbin/xfs_repair
+%attr(755,root,root) %{_sbindir}/xfs_*
+%if %{with scrub}
+%exclude %{_sbindir}/xfs_scrub*
+%endif
+%attr(755,root,root) /%{_lib}/libhandle.so.*.*
+%attr(755,root,root) %ghost /%{_lib}/libhandle.so.1
+%{_datadir}/%{name}
+%if %{with scrub}
+%dir %{_libexecdir}/%{name}
+%attr(755,root,root) %{_libexecdir}/%{name}/xfs_scrub_fail
+%endif
+%{_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*
+%if %{with scrub}
+%exclude %{_mandir}/man8/xfs_scrub*.8*
+%endif
 
-%files devel
+%if %{with scrub}
+%files scrub
 %defattr(644,root,root,755)
-%if !%{with static}
-%attr(755,root,root) %{_libexecdir}/lib*.so
-%{_libexecdir}/lib*.la
+%attr(755,root,root) %{_sbindir}/xfs_scrub
+%attr(755,root,root) %{_sbindir}/xfs_scrub_all
+/lib/udev/rules.d/64-xfs.rules
+%{systemdunitdir}/xfs_scrub@.service
+%{systemdunitdir}/xfs_scrub_all.service
+%{systemdunitdir}/xfs_scrub_all.timer
+%{systemdunitdir}/xfs_scrub_fail@.service
+%config(noreplace) %verify(not md5 mtime size) /etc/cron.d/xfs_scrub_all
+%{_mandir}/man8/xfs_scrub.8*
+%{_mandir}/man8/xfs_scrub_all.8*
 %endif
-%{_includedir}/disk
+
+%files devel
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_libdir}/libhandle.so
+%{_libdir}/libhandle.la
 %{_includedir}/xfs
-%{_mandir}/man3/*
+%{_mandir}/man2/ioctl_xfs_ag_geometry.2*
+%{_mandir}/man2/ioctl_xfs_bulkstat.2*
+%{_mandir}/man2/ioctl_xfs_fsbulkstat.2*
+%{_mandir}/man2/ioctl_xfs_fscounts.2*
+%{_mandir}/man2/ioctl_xfs_fsgeometry.2*
+%{_mandir}/man2/ioctl_xfs_fsgetxattr.2*
+%{_mandir}/man2/ioctl_xfs_fsgetxattra.2*
+%{_mandir}/man2/ioctl_xfs_fsinumbers.2*
+%{_mandir}/man2/ioctl_xfs_fssetxattr.2*
+%{_mandir}/man2/ioctl_xfs_getbmap.2*
+%{_mandir}/man2/ioctl_xfs_getbmapa.2*
+%{_mandir}/man2/ioctl_xfs_getbmapx.2*
+%{_mandir}/man2/ioctl_xfs_getresblks.2*
+%{_mandir}/man2/ioctl_xfs_goingdown.2*
+%{_mandir}/man2/ioctl_xfs_inumbers.2*
+%{_mandir}/man2/ioctl_xfs_scrub_metadata.2*
+%{_mandir}/man2/ioctl_xfs_setresblks.2*
+%{_mandir}/man3/*handle.3*
+%{_mandir}/man3/xfsctl.3*
 
+%if %{with static_libs}
 %files static
 %defattr(644,root,root,755)
-%{_libexecdir}/lib*.a
+%{_libdir}/libhandle.a
+%endif
This page took 0.670569 seconds and 4 git commands to generate.