From 7e4a62f674e59c61b7b88e61c07861188bd3cd20 Mon Sep 17 00:00:00 2001 From: Heng Qi Date: Tue, 11 Apr 2023 17:28:37 +0800 Subject: [PATCH] Refactor the spec file Signed-off-by: Heng Qi --- btrfs-progs.spec | 114 +++++++++++++++++++++-------------------------- 1 file changed, 50 insertions(+), 64 deletions(-) diff --git a/btrfs-progs.spec b/btrfs-progs.spec index 74c965e..6b8d982 100644 --- a/btrfs-progs.spec +++ b/btrfs-progs.spec @@ -1,53 +1,38 @@ -%define anolis_release 1 -# Local definition of version_no_tilde when it doesn't exist -%{!?version_no_tilde: %define version_no_tilde %{shrink:%(echo '%{version}' | tr '~' '-')}} +%define anolis_release 2 Name: btrfs-progs +Summary: An userspace programs named btrfs Version: 6.1.2 Release: %{anolis_release}%{?dist} -Summary: Userspace programs for btrfs License: GPLv2 URL: https://btrfs.wiki.kernel.org/index.php/Main_Page -Source0: https://www.kernel.org/pub/linux/kernel/people/kdave/%{name}/%{name}-v%{version_no_tilde}.tar.xz -Source1: https://www.kernel.org/pub/linux/kernel/people/kdave/%{name}/%{name}-v%{version_no_tilde}.tar.sign +Source0: https://mirrors.edge.kernel.org/pub/linux/kernel/people/kdave/%{name}/%{name}-v%{version}.tar.xz +Source1: https://mirrors.edge.kernel.org/pub/linux/kernel/people/kdave/%{name}/%{name}-v%{version}.tar.sign Source2: gpgkey-F2B41200C54EFB30380C1756C565D5F9D76D583B.gpg -BuildRequires: gnupg2 +BuildRequires: gnupg2 e2fsprogs-devel libacl-devel, lzo-devel systemd BuildRequires: gcc, autoconf, automake, make -BuildRequires: e2fsprogs-devel -BuildRequires: libacl-devel, lzo-devel -BuildRequires: pkgconfig(blkid) -BuildRequires: pkgconfig(uuid) -BuildRequires: pkgconfig(zlib) -BuildRequires: pkgconfig(libgcrypt) >= 1.8.0 -BuildRequires: pkgconfig(libudev) -BuildRequires: pkgconfig(libzstd) >= 1.0.0 -BuildRequires: python3-sphinx -BuildRequires: systemd -BuildRequires: python3-devel >= 3.4 -BuildRequires: python3-setuptools +BuildRequires: pkgconfig(blkid) pkgconfig(uuid) pkgconfig(zlib) pkgconfig(libgcrypt) >= 1.8.0 pkgconfig(libudev) pkgconfig(libzstd) >= 1.0.0 +BuildRequires: python3-devel >= 3.4 python3-sphinx python3-setuptools %description -The btrfs-progs package provides all the userspace programs needed to create, -check, modify and correct any inconsistencies in the btrfs filesystem. +Btrfs is a modern copy on write (COW) filesystem for Linux +aimed at implementing advanced features while also focusing +on fault tolerance, repair and easy administration. %package -n libbtrfs Summary: btrfs filesystem-specific runtime libraries License: GPLv2 -# Upstream deprecated this library Provides: deprecated() -# This was not properly split out before Conflicts: %{name} < 4.20.2 %description -n libbtrfs -libbtrfs contains the main library used by btrfs -filesystem-specific programs. +libbtrfs includes the main library which is used by btrfs filesystem-specific programs. %package -n libbtrfsutil Summary: btrfs filesystem-specific runtime utility libraries License: LGPLv2+ -# This was not properly split out before Conflicts: %{name}-devel < 4.20.2 %description -n libbtrfsutil @@ -56,43 +41,38 @@ filesystem-specific programs. %package devel Summary: btrfs filesystem-specific libraries and headers -# libbtrfsutil is LGPLv2+ License: GPLv2 and LGPLv2+ -Requires: %{name} = %{version}-%{release} -Requires: libbtrfs = %{version}-%{release} -Requires: libbtrfsutil = %{version}-%{release} +Requires: %{name} = %{EVR} +Requires: libbtrfsutil = %{EVR} +Requires: libbtrfs = %{EVR} %description devel -btrfs-progs-devel contains the libraries and header files needed to -develop btrfs filesystem-specific programs. - -It includes development files for two libraries: -- libbtrfs (GPLv2) -- libbtrfsutil (LGPLv2+) - -You should install btrfs-progs-devel if you want to develop -btrfs filesystem-specific programs. +This devel package provides the libraries and header files which is used to +develop btrfs filesystem-specific programs. It includes development files +for two libraries: libbtrfs (GPLv2) and libbtrfsutil (LGPLv2+). Please install +btrfs-progs-devel if you want to develop the btrfs filesystem-specific programs. %package -n python3-btrfsutil Summary: Python 3 bindings for libbtrfsutil License: LGPLv2+ -Requires: libbtrfsutil = %{version}-%{release} +Requires: libbtrfsutil = %{EVR} %{?python_provide:%python_provide python3-btrfsutil} %description -n python3-btrfsutil -python3-btrfsutil contains Python 3 bindings to the libbtrfsutil library, -which can be used for btrfs filesystem-specific programs in Python. - -You should install python3-btrfsutil if you want to use or develop -btrfs filesystem-specific programs in Python. +python3-btrfsutil provides Python3 bindings to the libbtrfsutil library used +for btrfs filesystem-specific programs in Python. Please install python3-btrfsutil +if you want to use or develop btrfs filesystem-specific programs in Python. %prep -xzcat '%{SOURCE0}' | %{gpgverify} --keyring='%{SOURCE2}' --signature='%{SOURCE1}' --data=- -%autosetup -n %{name}-v%{version_no_tilde} -p1 +xzcat '%{SOURCE0}' | %{gpgverify} --keyring='%{SOURCE2}' \ + --signature='%{SOURCE1}' --data=- +%autosetup -p1 -n %{name}-v%{version} %build ./autogen.sh -%configure CFLAGS="%{optflags} -fno-strict-aliasing" --with-crypto=libgcrypt --disable-python +%configure CFLAGS="%{optflags} -fno-strict-aliasing" \ + --disable-python \ + --with-crypto=libgcrypt %make_build pushd libbtrfsutil/python @@ -100,10 +80,13 @@ pushd libbtrfsutil/python popd %install -%make_install mandir=%{_mandir} bindir=%{_sbindir} libdir=%{_libdir} incdir=%{_includedir} -install -Dpm0644 btrfs-completion %{buildroot}%{_datadir}/bash-completion/completions/btrfs -# Nuke the static lib -rm -v %{buildroot}%{_libdir}/*.a +%make_install mandir=%{_mandir} \ + bindir=%{_sbindir} \ + libdir=%{_libdir} \ + incdir=%{_includedir} + +%{__install} -D -p -m 0644 btrfs-completion %{buildroot}%{_datadir}/bash-completion/completions/btrfs +%{__rm} -v %{buildroot}%{_libdir}/*.a pushd libbtrfsutil/python %py3_install @@ -114,29 +97,29 @@ popd %files %dir %{abidir} %license COPYING +%{_sbindir}/btrfs-convert +%{_sbindir}/btrfs-map-logical +%{_sbindir}/btrfs-find-root %{_sbindir}/btrfsck %{_sbindir}/fsck.btrfs -%{_sbindir}/mkfs.btrfs -%{_sbindir}/btrfs-image -%{_sbindir}/btrfs-convert %{_sbindir}/btrfs-select-super %{_sbindir}/btrfstune %{_sbindir}/btrfs -%{_sbindir}/btrfs-map-logical -%{_sbindir}/btrfs-find-root +%{_sbindir}/mkfs.btrfs +%{_sbindir}/btrfs-image %{abidir}/btrfs-convert-option.list %{abidir}/btrfs-find-root-option.list %{abidir}/btrfs-image-option.list %{abidir}/btrfs-option.list +%{_udevrulesdir}/64-btrfs-dm.rules +%{_udevrulesdir}/64-btrfs-zoned.rules +%{_datadir}/bash-completion/completions/btrfs %{abidir}/btrfstune-option.list %{abidir}/btrfsutil.cpython-310-%{_arch}-linux-gnu.dump %{abidir}/fsck.btrfs-option.list %{abidir}/mkfs.btrfs-option.list %{_mandir}/man5/* %{_mandir}/man8/* -%{_udevrulesdir}/64-btrfs-dm.rules -%{_udevrulesdir}/64-btrfs-zoned.rules -%{_datadir}/bash-completion/completions/btrfs %files -n libbtrfs %license COPYING @@ -149,17 +132,20 @@ popd %{abidir}/libbtrfsutil.dump %files devel -%{_includedir}/* -%{_libdir}/libbtrfs.so %{_libdir}/libbtrfsutil.so %{_libdir}/pkgconfig/libbtrfsutil.pc +%{_libdir}/libbtrfs.so +%{_includedir}/* %files -n python3-btrfsutil %license libbtrfsutil/COPYING -%{python3_sitearch}/btrfsutil.*.so %{python3_sitearch}/btrfsutil-*.egg-info/ +%{python3_sitearch}/btrfsutil.*.so + +%changelog +* Tue Apr 11 2023 Heng Qi - 6.1.2.-2 +- Refactor the spec file -%changelog * Fri Jan 13 2023 Ziyang Zhang - 6.1.2-1 - remove ascii and xmlto dependency since they are unnecessary now - add sphinx dependency for building docs -- Gitee