File xfsprogs.spec of Package xfsprogs.17980

#
# spec file for package xfsprogs
#
# Copyright (c) 2021 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/

%define _dracutmodulesdir %{_libexecdir}/dracut/modules.d

Name:           xfsprogs
Version:        4.15.0
Release:        0
Summary:        Utilities for managing the XFS file system
License:        GPL-2.0+
Group:          System/Filesystems
Url:            https://xfs.wiki.kernel.org/
Source0:        https://www.kernel.org/pub/linux/utils/fs/xfs/xfsprogs/xfsprogs-%{version}.tar.xz
Source1:        https://www.kernel.org/pub/linux/utils/fs/xfs/xfsprogs/xfsprogs-%{version}.tar.sign
Source2:        %{name}.keyring
Source3:        module-setup.sh.in
Source4:        dracut-fsck-help.txt
Patch0:         xfsprogs-docdir.diff
Patch1:         make_xfs_scrub_interp_explicit.patch
Patch2:		xfsprogs-mkfs-avoid-divide-by-zero-when-hardware-reports-opti.patch
Patch3:		0001-repair-shift-inode-back-into-place-if-corrupted-by-b.patch
Patch4:         xfsprogs-repair-Fix-root-inode-s-parent-when-it-s-bogus-f.patch
Patch5:		xfsprogs-xfs_repair-Add-missing-braces-to-allow-zeroing-of-co.patch
Patch6:		xfsprogs-xfs_repair-allow-in-attribute-names.patch
Patch7:		xfsprogs-xfs-hoist-xfs_fs_geometry-to-libxfs.patch
Patch8:		xfsprogs-xfs-refactor-the-geometry-structure-filling-function.patch
Patch9:		xfsprogs-xfs_spaceman-add-a-superblock-info-command.patch
Patch10:	xfsprogs-xfs_info-move-to-xfs_spaceman.patch
Patch11:	xfsprogs-xfs_db-add-a-superblock-info-command.patch
Patch12:	xfsprogs-libfrog-refactor-fs-geometry-printing-function.patch
Patch13:	xfsprogs-mkfs-use-geometry-generation-helper-functions.patch
Patch14:	xfsprogs-xfs_info-call-xfs_db-for-offline-filesystems.patch
Patch15:	xfsprogs-xfs_info-use-findmnt-to-handle-mounted-block-devices.patch
Patch16:	xfsprogs-xfs_quota-fix-false-error-reporting-of-project-inher.patch
Patch17:	xfsprogs-xfs-create-structure-verifier-function-for-shortform.patch
Patch18:	xfsprogs-xfs-create-structure-verifier-function-for-short-for.patch
Patch19:	xfsprogs-xfs-refactor-short-form-directory-structure-verifier.patch
Patch20:	xfsprogs-xfs-provide-a-centralized-method-for-verifying-inlin.patch
Patch21:	xfsprogs-xfs_repair-don-t-fail-directory-repairs-when-grabbin.patch
Patch22:	xfsprogs-xfs_repair-implement-custom-ifork-verifiers.patch
Patch23:	xfsprogs-xfs_repair-use-custom-ifork-verifier-in-mv_orphanage.patch
Patch24:	xfsprogs-xfs-move-inode-extent-size-hint-validation-to-libxfs.patch
Patch25:	xfsprogs-xfs_repair-use-libxfs-extsize-cowextsize-validation-.patch
Patch26:	xfsprogs-mkfs-validate-extent-size-hint-parameters.patch
Patch27:	xfsprogs-xfs_io-Make-copy_range-arguments-understand-iB-values.patch
Patch28:	xfsprogs-man-document-some-missing-xfs_db-commands.patch
Patch29:	xfsprogs-man-reformat-xfs_quota-commands-in-the-manpage-for-t.patch
Patch30:	xfsprogs-xfs_repair-rebuild-directory-when-non-root-leafn-blo.patch
Patch31:	xfsprogs-libfrog-fs_table_lookup_mount-should-realpath-the-ar.patch
Patch32:	xfsprogs-xfs_fsr-refactor-mountpoint-finding-to-use-libfrog-p.patch
Patch33:	xfsprogs-xfs_growfs-allow-mounted-device-node-as-argument.patch
Patch34:	xfsprogs-xfs_growfs-refactor-geometry-reporting.patch
Patch35:	xfsprogs-mkfs.xfs-if-either-sunit-or-swidth-is-nonzero-the-ot.patch
Patch36:	xfsprogs-mkfs.xfs-fix-ASSERT-on-too-small-device-with-stripe-.patch
Patch37:	xfsprogs-xfs_repair-refactor-fixed-inode-location-checks.patch
Patch38:	xfsprogs-xfs_repair-check-plausibility-of-root-dir-pointer-be.patch
Patch39:	xfsprogs-xfs_bmap-don-t-reject-e.patch
Patch40:	xfsprogs-xfs_bmap-remove-c-from-manpage.patch

BuildRequires:  autoconf
BuildRequires:  automake
BuildRequires:  libblkid-devel
BuildRequires:  libuuid-devel
BuildRequires:  readline-devel
BuildRequires:  xz
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Requires(post): coreutils
%if 0%{?suse_version} >= 1010
# hint for ZYPP
Supplements:    filesystem(xfs)
%endif
%if 0%{?suse_version} >= 1310
BuildRequires:  suse-module-tools
%endif

%description
A set of commands to use the XFS file system, including mkfs.xfs.

XFS is a high performance journaling file system which originated on
the SGI IRIX platform.	It is completely multithreaded. It can support
large files and large file systems, extended attributes, and variable
block sizes.It is extent based and makes extensive use of Btrees
(directories, extents, and free space) to aid both performance and
scalability.

Refer to the documentation at https://xfs.wiki.kernel.org/ for complete
details.  This implementation is on-disk compatible with the IRIX
version of XFS.

%package	devel
Summary:	XFS Filesystem-specific Static Libraries and Headers
Group:		Development/Libraries/C and C++
Requires:	xfsprogs = %{version}
Requires:	pkgconfig(uuid)

%description devel
xfsprogs-devel contains the libraries and header files needed to
develop XFS file system-specific programs.

You should install xfsprogs-devel if you want to develop XFS file
system-specific programs.  If you install xfsprogs-devel, you will also
want to install xfsprogs.

%package -n	libhandle1
Summary:	XFS filesystem-specific shared library
Group:		Development/Libraries/C and C++

%description -n libhandle1
libhandle1 contains the shared libraries needed by xfsprogs to run
xfsprogs programs.

%prep
%setup -q
%if 0%{?suse_version}
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
%patch9 -p1
%patch10 -p1
%patch11 -p1
%patch12 -p1
%patch13 -p1
%patch14 -p1
%patch15 -p1
%patch16 -p1
%patch17 -p1
%patch18 -p1
%patch19 -p1
%patch20 -p1
%patch21 -p1
%patch22 -p1
%patch23 -p1
%patch24 -p1
%patch25 -p1
%patch26 -p1
%patch27 -p1
%patch28 -p1
%patch29 -p1
%patch30 -p1
%patch31 -p1
%patch32 -p1
%patch33 -p1
%patch34 -p1
%patch35 -p1
%patch36 -p1
%patch37 -p1
%patch38 -p1
%patch39 -p1
%patch40 -p1
%endif

%build
aclocal -I m4
autoconf

export OPTIMIZER="-fPIC"
export DEBUG=-DNDEBUG
export LIBUUID=%{_libdir}/libuuid.a
%configure --enable-readline=yes --without-systemd-unit-dir
make %{?_smp_mflags} V=1

PATH_TO_HELP="%{_dracutmodulesdir}/95suse-xfs/dracut-fsck-help.txt"
sed -e "s|@@PATH_TO_HELP@@|$PATH_TO_HELP|" %{SOURCE3} > module-setup.sh

%install
export DIST_ROOT=%{buildroot}
%make_install
make install-dev
# remove the static libs and libtool archive
rm -rf %{buildroot}/%{_lib}/*.{la,a}
rm -rf %{buildroot}/%{_libdir}/*.{la,a}
mv %{buildroot}/%{_lib}/* %{buildroot}%{_libdir}
%find_lang %{name}
install -m 0755 -d %{buildroot}/%{_dracutmodulesdir}/95suse-xfs/
install -m 0755 module-setup.sh %{buildroot}/%{_dracutmodulesdir}/95suse-xfs/
install -m 0644 %{SOURCE4} %{buildroot}/%{_dracutmodulesdir}/95suse-xfs/
rm %{buildroot}/sbin/xfs_scrub_all

%if 0%{?suse_version} >= 1310
%post
%{?regenerate_initrd_post}
/sbin/ldconfig

%postun
%{?regenerate_initrd_post}
/sbin/ldconfig

%posttrans
%{?regenerate_initrd_posttrans}
%else
%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig
%endif

%post -n libhandle1
/sbin/ldconfig

%postun -n libhandle1
/sbin/ldconfig

%files -f %{name}.lang
%defattr(-,root,root,755)
#UsrMerge
/sbin/*
#EndUsrMerge
%{_sbindir}/*
%dir %{_libdir}/xfsprogs/
%{_libdir}/xfsprogs/xfs_scrub_all.cron
%doc %{_mandir}/man[258]/*
%doc %{_defaultdocdir}/%{name}
%dir %{_libexecdir}/dracut
%dir %{_libexecdir}/dracut/modules.d
%dir %{_dracutmodulesdir}/95suse-xfs/
%{_dracutmodulesdir}/95suse-xfs/dracut-fsck-help.txt
%{_dracutmodulesdir}/95suse-xfs/module-setup.sh

%files devel
%defattr(-,root,root,755)
%{_includedir}/xfs
%{_libdir}/*.so
%{_mandir}/man3/*

%files -n libhandle1
%defattr(-,root,root,755)
%{_libdir}/libhandle.so.*

%changelog
openSUSE Build Service is sponsored by