diff --git a/initscripts.spec b/initscripts.spec index d5b244f0de924ed4b236ee1a62c49abc96db4571..80ab5678714b7359e9820b02225ca62e498008a8 100644 --- a/initscripts.spec +++ b/initscripts.spec @@ -1,13 +1,19 @@ -%define anolis_release 3 +%define anolis_release 4 -%global shared_requirements \ -Requires: bash \ -Requires: filesystem >= 3 \ -Requires: coreutils \ -Requires: gawk \ +%define systemdpost(pkgname, svcname) \ +%post -n %1 \ +%systemd_post %2 + +%define systemdpreun(pkgname, svcname) \ +%preun -n %1 \ +%systemd_preun %2 + +%define systemdpostun(pkgname, svcname) \ +%postun -n %1 \ +%systemd_postun %2 Name: initscripts -Summary: Basic support for legacy System V init scripts +Summary: basic legacy sysv init scripts used during a boot of the system Version: 10.17 Release: %{anolis_release}%{?dist} @@ -16,30 +22,15 @@ License: GPLv2 URL: https://github.com/fedora-sysv/initscripts Source: https://github.com/fedora-sysv/initscripts/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz -%shared_requirements - -Requires: findutils -Requires: grep -Requires: procps-ng -Requires: setup -Requires: systemd -Requires: util-linux -Requires: chkconfig -Requires: initscripts-service -Requires: initscripts-rename-device +Requires: bash filesystem >= 3 coreutils gawk +Requires: findutils grep procps-ng setup systemd util-linux +Requires: chkconfig initscripts-service initscripts-rename-device Requires(pre): shadow-utils Requires(post): coreutils -BuildRequires: filesystem >= 3 -BuildRequires: gcc -BuildRequires: git -BuildRequires: gettext -BuildRequires: glib2-devel -BuildRequires: pkgconfig -BuildRequires: popt-devel -BuildRequires: setup -BuildRequires: make +BuildRequires: filesystem >= 3 git gcc make setup pkgconfig +BuildRequires: gettext glib2-devel popt-devel systemd %{?systemd_requires} BuildRequires: systemd @@ -47,48 +38,36 @@ BuildRequires: systemd Obsoletes: %{name} < 10.16-1 %description -This package provides basic support for legacy System V init scripts, and some +This package provides basic support for legacy sysv init scripts, and some other legacy tools & utilities. %package -n initscripts-rename-device -Summary: Udev helper utility that provides network interface naming +Summary: A ultility helper program for Udev that provides network interface naming -%shared_requirements +Requires: bash filesystem >= 3 coreutils gawk %description -n initscripts-rename-device -Udev helper utility that provides network interface naming +This package provides a ultility helper program for Udev that provides network interface naming. %package -n initscripts-service Summary: Support for service command BuildArch: noarch -%shared_requirements - +Requires: bash filesystem >= 3 coreutils gawk Requires: systemd Provides: /sbin/service %description -n initscripts-service -This package provides service command. +'service' command is provided by this package. %package -n network-scripts Summary: Legacy scripts for manipulating of network devices Requires: %{name} = %{version}-%{release} -%shared_requirements - -Requires: bc -Requires: dbus -Requires: dbus-tools -Requires: gawk -Requires: grep -Requires: hostname -Requires: iproute -Requires: ipcalc -Requires: kmod -Requires: procps-ng -Requires: sed -Requires: systemd +Requires: bash filesystem >= 3 coreutils gawk +Requires: bc dbus dbus-tools gawk grep hostname iproute ipcalc +Requires: kmod procps-ng sed systemd Requires(post): chkconfig Requires(preun): chkconfig @@ -102,19 +81,19 @@ Obsoletes: %{name} < 9.82-2 Provides: deprecated() %description -n network-scripts -This package contains the legacy scripts for activating & deactivating of most -network interfaces. It also provides a legacy version of 'network' service. - -The 'network' service is enabled by default after installation of this package, -and if the network-scripts are installed alongside NetworkManager, then the -ifup/ifdown commands from network-scripts take precedence over the ones provided -by NetworkManager. - -If user has both network-scripts & NetworkManager installed, and wishes to -use ifup/ifdown from NetworkManager primarily, then they has to run command: +The network-scripts package contains legacy scripts for manipulating network +devices. It provides a legacy version of 'network' service. This package +contains the legacy scripts for activating and deactivating most network +interfaces. +The 'network' service is enabled by default after installation of +this package. If the network-scripts are installed alongside NetworkManager, +then the ifup/ifdown commands from network-scripts will be ignored. + +If both network-scripts and NetworkManager are both installed and the user wants to +use ifup/ifdown from NetworkManager primarily, they must execute the command $ update-alternatives --config ifup -Please note that running the command above will also disable the 'network' +Please be aware that running the above command will also deactivate the 'network' service. %package -n netconsole-service @@ -122,44 +101,32 @@ Summary: Service for initializing of network console logging Requires: %{name} = %{version}-%{release} BuildArch: noarch -%shared_requirements - -Requires: glibc-common -Requires: iproute -Requires: iputils -Requires: kmod -Requires: sed -Requires: util-linux +Requires: bash filesystem >= 3 coreutils gawk +Requires: glibc-common iproute iputils kmod sed util-linux Obsoletes: %{name} < 9.82-2 %description -n netconsole-service -This packages provides a 'netconsole' service for loading of netconsole kernel -module with the configured parameters. The netconsole kernel module itself then -allows logging of kernel messages over the network. +This package provides a service called 'netconsole' which allows loading of the +netconsole kernel module with the configured parameters. The netconsole kernel +module itself then enables logging of kernel messages over the network. %package -n readonly-root Summary: Service for configuring read-only root support Requires: %{name} = %{version}-%{release} BuildArch: noarch -%shared_requirements - -Requires: cpio -Requires: findutils -Requires: hostname -Requires: iproute -Requires: ipcalc -Requires: util-linux +Requires: bash filesystem >= 3 coreutils gawk +Requires: cpio findutils hostname iproute ipcalc util-linux Obsoletes: %{name} < 9.82-2 %description -n readonly-root -This package provides script & configuration file for setting up read-only root -support. Additional configuration is required after installation. +This package provides a script and configuration file for configuring read-only +root support. After installation, additional configuration is required. -Please note that readonly-root package is considered deprecated with limited support. -Please use systemd-volatile-root functionality instead, if possible. +Please note that the readonly-root package is considered deprecated with limited +support. Instead, you can use systemd-volatile-root functionality. %package doc Summary: Documentation files for %{name} @@ -187,19 +154,13 @@ install -m 0755 -d %{buildroot}%{_docdir}/network-scripts ln -s %{_docdir}/%{name}/sysconfig.txt %{buildroot}%{_docdir}/network-scripts/ ln -sr %{_mandir}/man8/ifup.8 %{buildroot}%{_mandir}/man8/ifdown.8 -touch %{buildroot}%{_sbindir}/ifup -touch %{buildroot}%{_sbindir}/ifdown +touch %{buildroot}%{_sbindir}/ifup %{buildroot}%{_sbindir}/ifdown %generate_compatibility_deps -%post -%systemd_post import-state.service loadmodules.service - -%preun -%systemd_preun import-state.service loadmodules.service - -%postun -%systemd_postun import-state.service loadmodules.service +%systemdpost %{name} "import-state.service loadmodules.service" +%systemdpreun %{name} "import-state.service loadmodules.service" +%systemdpostun %{name} "import-state.service loadmodules.service" %post -n network-scripts chkconfig --add network > /dev/null 2>&1 || : @@ -217,23 +178,13 @@ if [ $1 -eq 0 ]; then %{_sbindir}/update-alternatives --remove ifup %{_sysconfdir}/sysconfig/network-scripts/ifup fi -%post -n netconsole-service -%systemd_post netconsole.service - -%preun -n netconsole-service -%systemd_preun netconsole.service +%systemdpost netconsole-service netconsole.service +%systemdpreun netconsole-service netconsole.service +%systemdpostun netconsole-service netconsole.service -%postun -n netconsole-service -%systemd_postun netconsole.service - -%post -n readonly-root -%systemd_post readonly-root.service - -%preun -n readonly-root -%systemd_preun readonly-root.service - -%postun -n readonly-root -%systemd_postun readonly-root.service +%systemdpost readonly-root readonly-root.service +%systemdpreun readonly-root readonly-root.service +%systemdpostun readonly-root readonly-root.service %files -f %{name}.lang %dir %{abidir} @@ -305,6 +256,9 @@ fi %doc README.md %changelog +* Mon Apr 10 2023 zhonglingh - 10.17-4 +- refactor rpm spec file + * Wed Jan 04 2023 happy_orange - 10.17-3 - add doc package