From ba378411f143614e103d039afb58218886494fec Mon Sep 17 00:00:00 2001 From: yuanhui Date: Thu, 13 Apr 2023 15:57:45 +0800 Subject: [PATCH] Optimize the spec file Signed-off-by: yuanhui --- quota.spec | 149 +++++++++++++++++++++-------------------------------- 1 file changed, 58 insertions(+), 91 deletions(-) diff --git a/quota.spec b/quota.spec index 80488f3..b49529c 100644 --- a/quota.spec +++ b/quota.spec @@ -1,4 +1,5 @@ -%define anolis_release 1 +%define anolis_release 2 + # Scan ext file systems directly to increase the performace of a quota # initialization and check %bcond_without quota_enables_extdirect @@ -15,7 +16,7 @@ Name: quota Epoch: 1 Version: 4.09 Release: %{anolis_release}%{?dist} -Summary: System administration tools for monitoring users' disk usage +Summary: System administration tools for monitoring users disk usage License: GPLv2 and GPLv2+ URL: http://sourceforge.net/projects/linuxquota/ @@ -24,69 +25,62 @@ Source1: quota_nld.service Source2: quota_nld.sysconfig Source3: rpc-rquotad.service Source4: rpc-rquotad.sysconfig -# Not accepted changes (378a64006bb1e818e84a1c77808563b802b028fa), bug #680919 -# Fix parsing a TCP port number -BuildRequires: autoconf -BuildRequires: automake -BuildRequires: bash -BuildRequires: coreutils -BuildRequires: e2fsprogs-devel -BuildRequires: gcc -BuildRequires: gettext-devel -BuildRequires: make -BuildRequires: openldap-devel + +BuildRequires: autoconf automake bash coreutils gcc make +BuildRequires: pkgconfig(ext2fs) pkgconfig(ldap) gettext-devel + %if %{with quota_enables_extdirect} -BuildRequires: pkgconfig(com_err) -BuildRequires: pkgconfig(ext2fs) +BuildRequires: pkgconfig(com_err) pkgconfig(ext2fs) %endif %if %{with quota_enables_netlink} -BuildRequires: pkgconfig(dbus-1) -BuildRequires: pkgconfig(libnl-3.0) >= 3.1 -BuildRequires: pkgconfig(libnl-genl-3.0) -BuildRequires: systemd-rpm-macros +BuildRequires: pkgconfig(dbus-1) systemd-rpm-macros +BuildRequires: pkgconfig(libnl-3.0) >= 3.1 pkgconfig(libnl-genl-3.0) %endif %if %{with quota_enables_rpc} -BuildRequires: rpcgen -BuildRequires: pkgconfig(libtirpc) -BuildRequires: systemd-rpm-macros +BuildRequires: rpcgen pkgconfig(libtirpc) systemd-rpm-macros %if %{with quota_enables_tcpwrappers} BuildRequires: tcp_wrappers-devel %endif %endif -Requires: quota-nls = %{epoch}:%{version}-%{release} +Requires: quota-nls = %{EVR} Conflicts: kernel < 2.4 %description -The quota package contains system administration tools for monitoring -and limiting user and or group disk usage per file system. +The quota subsystem allows a system administrator to set soft and hard +limits on used space and the number of inodes used for users and +groups. The kernel must be compiled with disk quota support enabled. + +%if %{with quota_enables_rpc} +%package devel +Summary: Development files for quota RPC +License: GPLv2 +Requires: pkgconfig(libtirpc) +%description devel +This package contains development header files for implementing disk quotas +on remote machines. +%endif %if %{with quota_enables_netlink} %package nld Summary: quota_nld daemon License: GPLv2 and GPLv2+ -Requires: quota-nls = %{epoch}:%{version}-%{release} -# For %%{_unitdir} directory +Requires: quota-nls = %{EVR} Requires: systemd %description nld -Daemon that listens on netlink socket and processes received quota warnings. -Note, that you have to enable the kernel support for sending quota messages -over netlink (in Filesystems->Quota menu). The daemon supports forwarding -warning messages to the system D-Bus (so that desktop manager can display -a dialog) and writing them to the terminal user has last accessed. +quota_nld is a daemon that listens on netlink socket and processes received quota warnings. +It forwards warning messages to both the system’s DBUS (so that the desktop manager can +display a dialog) and the last-accessed terminal of the user to whom each warning is directed %endif - %if %{with quota_enables_rpc} %package rpc Summary: RPC quota daemon License: LGPLv2+ and GPLv2 and GPLv2+ -Requires: quota-nls = %{epoch}:%{version}-%{release} -Requires: rpcbind -# For %%{_unitdir} directory -Requires: systemd +Requires: quota-nls = %{EVR} +Requires: rpcbind systemd %if %{with quota_enables_tcpwrappers} Requires: tcp_wrappers %endif @@ -98,55 +92,34 @@ the daemon on NFS server, you could use quota tools to manage the quotas from NFS client. %endif - %package warnquota Summary: Send e-mail to users over quota License: GPLv2 and GPLv2+ -Requires: quota-nls = %{epoch}:%{version}-%{release} +Requires: quota-nls = %{EVR} %description warnquota Utility that checks disk quota for each local file system and mails a warning message to those users who have reached their soft limit. It is typically run via cron(8). - %package nls Summary: Gettext catalogs for disk quota tools License: LGPLv2+ and GPLv2 and GPLv2+ BuildArch: noarch %description nls -Disk quota tools messages translated into different natural languages. - - -%if %{with quota_enables_rpc} -%package devel -Summary: Development files for quota RPC -License: GPLv2 -# libtirpc-devel for an included -Requires: libtirpc-devel -# Do not run-require main package, the header files define RPC API to be -# implemented by the developer, not an API for an existing quota library. - -%description devel -This package contains development header files for implementing disk quotas -on remote machines. -%endif - +This packages is disk quota tools messages translated into different natural languages. %package doc -Summary: Additional documentation for disk quotas -Requires: quota = %{epoch}:%{version}-%{release} -BuildArch: noarch -AutoReq: 0 - -%description doc -This package contains additional documentation for disk quotas concept in -Linux/UNIX environment. +Summary: Documentation files for %{name} +Requires: %{name} = %{EVR} +BuildArch: noarch +%description doc +The %{name}-doc package contains documentation files for %{name}. %prep -%setup -q +%autosetup -p1 # Regenerate build scripts autoreconf -f -i @@ -190,17 +163,15 @@ autoreconf -f -i %install %{make_install} -rm -rf $RPM_BUILD_ROOT%{_docdir}/%{name} +rm -rf %{buildroot}%{_docdir}/%{name} %if %{with quota_enables_netlink} -install -p -m644 -D %{SOURCE1} $RPM_BUILD_ROOT%{_unitdir}/quota_nld.service -install -p -m644 -D %{SOURCE2} \ - $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/quota_nld +install -p -m644 -D %{SOURCE1} %{buildroot}%{_unitdir}/quota_nld.service +install -p -m644 -D %{SOURCE2} %{buildroot}%{_sysconfdir}/sysconfig/quota_nld %endif %if %{with quota_enables_rpc} -install -p -m644 -D %{SOURCE3} $RPM_BUILD_ROOT%{_unitdir}/rpc-rquotad.service -install -p -m644 -D %{SOURCE4} \ - $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/rpc-rquotad +install -p -m644 -D %{SOURCE3} %{buildroot}%{_unitdir}/rpc-rquotad.service +install -p -m644 -D %{SOURCE4} %{buildroot}%{_sysconfdir}/sysconfig/rpc-rquotad %endif %find_lang %{name} @@ -210,7 +181,6 @@ install -p -m644 -D %{SOURCE4} \ %check make check - %if %{with quota_enables_netlink} %post nld %systemd_post quota_nld.service @@ -222,7 +192,6 @@ make check %systemd_postun_with_restart quota_nld.service %endif - %if %{with quota_enables_rpc} %post rpc %systemd_post rpc-rquotad.service @@ -235,9 +204,9 @@ make check %endif %files -%dir %{abidir} %{_bindir}/* %{_sbindir}/* +%dir %{abidir} %{abidir}/*-option.list %exclude %{_sbindir}/quota_nld %if %{with quota_enables_rpc} @@ -251,7 +220,15 @@ make check %exclude %{_mandir}/man8/rpc.rquotad.8* %endif %exclude %{_mandir}/man8/warnquota.8* -%doc Changelog + +%if %{with quota_enables_rpc} +%files devel +%license COPYING +%dir %{_includedir}/rpcsvc +%{_includedir}/rpcsvc/* +%{_mandir}/man3/* +%endif + %if %{with quota_enables_netlink} %files nld @@ -259,7 +236,6 @@ make check %{_unitdir}/quota_nld.service %{_sbindir}/quota_nld %{_mandir}/man8/quota_nld.8* -%doc Changelog %endif %if %{with quota_enables_rpc} @@ -268,7 +244,6 @@ make check %{_unitdir}/rpc-rquotad.service %{_sbindir}/rpc.rquotad %{_mandir}/man8/rpc.rquotad.8* -%doc Changelog %endif %files warnquota @@ -278,26 +253,18 @@ make check %{_sbindir}/warnquota %{_mandir}/man5/* %{_mandir}/man8/warnquota.8* -%doc Changelog README.ldap-support README.mailserver %files nls -f %{name}.lang -# All the other packages require quota-nls, COPYING here is enough. %license COPYING -%doc Changelog - -%if %{with quota_enables_rpc} -%files devel -%license COPYING -%dir %{_includedir}/rpcsvc -%{_includedir}/rpcsvc/* -%{_mandir}/man3/* -%endif %files doc %doc doc/* ldap-scripts - +%doc Changelog README.ldap-support README.mailserver %changelog +* Thu Apr 13 2023 yuanhui - 4.09-2 +- Optimize the spec file + * Wed Mar 01 2023 Ziyang Zhang - 4.09-1 - Update to 4.09 -- Gitee