From 3d2bd5bdc9caa1954850266d45fee00066f6b41a Mon Sep 17 00:00:00 2001 From: Zhongling He Date: Mon, 10 Apr 2023 17:31:00 +0800 Subject: [PATCH] refactor rpm spec --- chkconfig.spec | 70 ++++++++++++++++++++++++++------------------------ 1 file changed, 36 insertions(+), 34 deletions(-) diff --git a/chkconfig.spec b/chkconfig.spec index 9692a36..701d60f 100644 --- a/chkconfig.spec +++ b/chkconfig.spec @@ -1,4 +1,4 @@ -%define anolis_release 1 +%define anolis_release 2 Name: chkconfig Version: 1.21 Release: %{anolis_release}%{?dist} @@ -11,67 +11,66 @@ Source0: https://github.com/fedora-sysv/chkconfig/archive/refs/tags/%{ver BuildRequires: newt-devel gettext popt-devel libselinux-devel beakerlib gcc systemd-devel make %description -Chkconfig is a basic system utility. It updates and queries runlevel -information for system services. Chkconfig manipulates the numerous -symbolic links in /etc/rc.d, to relieve system administrators of some -of the drudgery of manually editing the symbolic links. + +Chkconfig is a command-line utility in Linux that allows you to update and +query runlevel information for system services. It manipulates the numerous +symbolic links in /etc/rc.d, which relieves system administrators of some of +the drudgery of manually editing the symbolic links. %package -n ntsysv -Summary: A tool to set the stop/start of system services in a runlevel +Summary: A ultility to manipulate state of system services in a runlevel Requires: chkconfig = %{version}-%{release} %description -n ntsysv -Ntsysv provides a simple interface for setting which system services -are started or stopped in various runlevels (instead of directly -manipulating the numerous symbolic links in /etc/rc.d). Unless you -specify a runlevel or runlevels on the command line (see the man -page), ntsysv configures the current runlevel (5 if you're using X). +Ntsysv is a command-line utility in Linux that provides a simple interface +for configuring runlevel services which are also configurable through +chkconfig. It configures which system services are started or stopped +in various runlevels instead of directly manipulating the numerous symbolic +links in /etc/rc.d. By default, it configures the current runlevel (5 if +you’re using X) %package -n alternatives -Summary: A tool to maintain symbolic links determining default commands +Summary: A ultility to manage symbolic links determining default commands %description -n alternatives -alternatives creates, removes, maintains and displays information about the -symbolic links comprising the alternatives system. It is possible for several -programs fulfilling the same or similar functions to be installed on a single -system at the same time. +The alternatives package in Linux creates, removes, maintains and displays +information about the symbolic links comprising the alternatives system. +It is possible for several programs fulfilling the same or similar functions +to be installed on a single system at the same time. %prep %autosetup - %build %make_build - %install rm -rf $RPM_BUILD_ROOT %make_install MANDIR=%{_mandir} SBINDIR=%{_sbindir} -mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d +mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d ln -s rc.d/init.d $RPM_BUILD_ROOT/etc/init.d -for n in 0 1 2 3 4 5 6; do - mkdir -p $RPM_BUILD_ROOT/etc/rc.d/rc${n}.d +for n in $(seq 0 6); do + mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/rc${n}.d ln -s rc.d/rc${n}.d $RPM_BUILD_ROOT/etc/rc${n}.d done -mkdir -p $RPM_BUILD_ROOT/etc/chkconfig.d +mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/chkconfig.d %find_lang %{name} - %generate_compatibility_deps %files -f %{name}.lang %defattr(-,root,root) +%{_sbindir}/chkconfig +%{_sysconfdir}/rc.d %{!?_licensedir:%global license %%doc} +%{_mandir}/*/chkconfig* +%{_sysconfdir}/rc.d/init.d +%{_sysconfdir}/rc.d/rc[0-6].d %license COPYING -%{_sbindir}/chkconfig %{_sysconfdir}/chkconfig.d %{_sysconfdir}/init.d -%{_sysconfdir}/rc.d -%{_sysconfdir}/rc.d/init.d %{_sysconfdir}/rc[0-6].d -%{_sysconfdir}/rc.d/rc[0-6].d -%{_mandir}/*/chkconfig* %{_prefix}/lib/systemd/systemd-sysv-install %files -n ntsysv @@ -80,17 +79,20 @@ mkdir -p $RPM_BUILD_ROOT/etc/chkconfig.d %{_mandir}/*/ntsysv.8* %files -n alternatives -%dir %{abidir} -%license COPYING -%dir /etc/alternatives -%{_sbindir}/update-alternatives -%{_sbindir}/alternatives %{abidir}/alternatives-option.list +%dir %{_sysconfdir}/alternatives %{_mandir}/*/update-alternatives* +%{_sbindir}/alternatives +%{_sbindir}/update-alternatives +%dir %{_sharedstatedir}/alternatives +%license COPYING %{_mandir}/*/alternatives* -%dir /var/lib/alternatives +%dir %{abidir} %changelog +* Mon Apr 10 2023 Zhongling - 1.21-2 +- Refactor rpm spec + * Wed Dec 28 2022 Heng Qi - 1.21-1 - update to 1.21 -- Gitee