File xfsprogs.spec of Package xfsprogs
%define realname xfsprogs
%define realver 6.5.0
%define srcext tar.xz
%define handle_so_ver 1
# turn off the generation of debuginfo rpm (RH9) ??
%global debug_package %{nil}
# Common info
Name: %{realname}
Version: %{realver}
Release: %{?extraver:0.}1%{?dist}
License: LGPL-2.1
Group: System/Filesystems
URL: http://xfs.org/
Summary: XFS User Tools
# Install-time parameters
Provides: libhandle%{?handle_so_ver} = %{version}-%{release}
Requires: systemd
# Build-time parameters
BuildRequires: pkgconfig
BuildRequires: gettext
BuildRequires: libuuid-devel
BuildRequires: liburcu-devel
BuildRequires: libattr-devel
BuildRequires: libicu-devel
BuildRequires: libblkid-devel
BuildRequires: readline-devel
BuildRequires: libinih-devel
BuildRequires: systemd-devel
BuildRoot: %{_tmppath}/%{name}-root
Source: https://www.kernel.org/pub/linux/utils/fs/xfs/xfsprogs/%{realname}-%{realver}%{?extraver}.%{srcext}
%description
XFS is a high-performance 64-bit journaling file system created
by Silicon Graphics, Inc (SGI) in 1993.[1] It was the default file system
in the SGI's IRIX operating system starting with its version 5.3; the file
system was ported to the Linux kernel in 2001.
XFS excels in the execution of parallel input/output (I/O) operations due to its
design, which is based on allocation groups (a type of subdivision of
the physical volumes in which XFS is used- also shortened to AGs). Because
of this, XFS enables extreme scalability of I/O threads, file system bandwidth,
and size of files and of the file system itself when spanning multiple physical
storage devices.
XFS ensures the consistency of data by employing metadata journaling and
supporting write barriers. Space allocation is performed via extents with data
structures stored in B+ trees, improving the overall performance of the file
system, especially when handling large files. Delayed allocation assists in
the prevention of file system fragmentation; online defragmentation is also
supported.
%package devel
Group: Development/Languages/C and C++
Summary: Development files for %{name}
Requires: %{name} = %{version}
Requires: libuuid-devel
Provides: xfslibs-devel
Provides: libxcmd-devel libxcmd%{?xfs_so_ver}-devel
Provides: libxfs-devel libxfs%{?xfs_so_ver}-devel
Provides: libxlog-devel libxlog%{?xfs_so_ver}-devel
Provides: libhandle-devel libhandle%{?handle_so_ver}-devel
%description devel
Development files for %{name}
%package scrub-all
Group: System/Filesystems
Summary: Systemd service and python script to scrub all XFS filesystems
Requires: %{name} = %{version}-%{release}
Requires: python3
%description scrub-all
Systemd service and python script to scrub all XFS filesystems
# Preparation step (unpackung and patching if necessary)
%prep
%setup -q -n %{realname}-%{realver}%{?extraver}
%build
%configure \
--enable-lto=%{?gcc_lto:yes}%{~?gcc_lto:no} \
--with-systemd-unit-dir=%{_unitdir} \
--with-udev-rule-dir=%{_udevrulesdir} \
--with-crond-dir=%{_sysconfdir}/cron.d \
\
CFLAGS="%{optflags}" \
CXXFLAGS="%{optflags}" \
LDFLAGS="-Wl,--as-needed -Wl,--strip-all -Wl,--no-undefined -Wl,-z,now -Wl,-z,relro $(pkg-config --libs blkid)"
%{__make} V=1 %{?_smp_mflags}
%install
%{__make} install install-dev DESTDIR=%{buildroot}
# Some cleanup
if [ "%{buildroot}" != "/" ]; then
%{__rm} -f %{buildroot}%{_datadir}/doc/xfsprogs/*
%{__rm} -f %{buildroot}/{%{_lib},%{_libdir}}/libhandle.{a,la}
fi
%find_lang %{name}
%clean
[ "%{buildroot}" != "/" ] && %{__rm} -rf %{buildroot}
%files -f %{name}.lang
%defattr(-,root,root)
%doc README doc/CHANGES doc/CREDITS LICENSES/*
/sbin/*
%{_sbindir}/*
/%{_lib}/libhandle.so.%{?handle_so_ver}*
%dir %{_libdir}/%{name}/
%{_unitdir}/*
%{_libdir}/%{name}/xfs_scrub_fail
%{_udevrulesdir}/64-xfs.rules
%{_datadir}/xfsprogs/
%doc %{_mandir}/man2/*
%doc %{_mandir}/man5/*
%doc %{_mandir}/man8/*
# Moved to separate package due to dependency on python3
%exclude %{_sbindir}/xfs_scrub_all
%exclude %{_mandir}/man8/xfs_scrub_all.8*
%exclude %{_unitdir}/xfs_scrub_all.*
# Development stuff
%files devel
%defattr(-,root,root)
%dir %{_includedir}/xfs/
%{_includedir}/xfs/*.h
/%{_lib}/libhandle.so
%if 0%{?suse_version}
%{_libdir}/libhandle.so
%endif
%doc %{_mandir}/man3/*
%files scrub-all
%defattr(-,root,root)
%{_sbindir}/xfs_scrub_all
%dir %{_libdir}/%{name}/
%{_libdir}/%{name}/xfs_scrub_all.cron
%exclude %{_unitdir}/xfs_scrub_all.*
%doc %{_mandir}/man8/xfs_scrub_all.8*
%if 0%{?suse_version}
%pre
%{service_add_pre xfs_scrub@.service}
%{service_add_pre xfs_scrub_all.service}
%{service_add_pre xfs_scrub_fail@.service}
%post
/sbin/ldconfig
%{service_add_post xfs_scrub@.service}
%{service_add_post xfs_scrub_all.service}
%{service_add_post xfs_scrub_fail@.service}
%preun
%{service_del_preun xfs_scrub@.service}
%{service_del_preun xfs_scrub_all.service}
%{service_del_preun xfs_scrub_fail@.service}
%postun
/sbin/ldconfig
%{service_del_postun xfs_scrub@.service}
%{service_del_postun xfs_scrub_all.service}
%{service_del_postun xfs_scrub_fail@.service}
%else
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%endif
%changelog