diff --git a/initscripts.spec b/initscripts.spec index d5b244f0de924ed4b236ee1a62c49abc96db4571..14a25ee548426bba4b02d62f997b40f8f9de9cae 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 %3 + +%define systemdpreun(pkgname, svcname) \ +%preun -n %1 \ +%systemd_preun %2 %3 + +%define systemdpostun(pkgname, svcname) \ +%postun -n %1 \ +%systemd_postun %2 %3 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 @@ -98,23 +77,22 @@ Requires(postun): %{_sbindir}/update-alternatives Obsoletes: %{name} < 9.82-2 -# Mark this as deprecated to ensure not be depended. 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 +100,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,124 +153,109 @@ 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 - %post -n network-scripts chkconfig --add network > /dev/null 2>&1 || : -[ -L %{_sbindir}/ifup ] || rm -f %{_sbindir}/ifup -[ -L %{_sbindir}/ifdown ] || rm -f %{_sbindir}/ifdown +for ifname in ifup ifdown; do + [ -L %{_sbindir}/$ifname ] || rm -f %{_sbindir}/$ifname +done %{_sbindir}/update-alternatives --install %{_sbindir}/ifup ifup %{_sysconfdir}/sysconfig/network-scripts/ifup 90 \ --slave %{_sbindir}/ifdown ifdown %{_sysconfdir}/sysconfig/network-scripts/ifdown \ --initscript network +%systemdpostun readonly-root readonly-root.service +%systemdpreun readonly-root readonly-root.service +%systemdpost readonly-root readonly-root.service + +%systemdpostun netconsole-service netconsole.service +%systemdpreun netconsole-service netconsole.service +%systemdpost netconsole-service netconsole.service + +%systemdpostun %{name} import-state.service loadmodules.service +%systemdpreun %{name} import-state.service loadmodules.service +%systemdpost %{name} import-state.service loadmodules.service + %preun -n network-scripts if [ $1 -eq 0 ]; then chkconfig --del network > /dev/null 2>&1 || : %{_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 - -%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 - %files -f %{name}.lang %dir %{abidir} +%{_mandir}/man1/* +%{_prefix}/lib/systemd/system/loadmodules.service +%{_prefix}/lib/systemd/system/import-state.service +%{_libexecdir}/loadmodules +%{_libexecdir}/import-state +%{_sbindir}/genhostid +%{_sbindir}/consoletype +%{abidir}/*-option.list +%{_bindir}/* +%{_sysconfdir}/init.d +%{_sysconfdir}/rc[0-6].d +%{_sysconfdir}/rc.d/init.d/functions +%dir %{_libexecdir}/%{name}/legacy-actions +%dir %{_libexecdir}/%{name} +%dir %{_sysconfdir}/sysconfig/modules +%dir %{_sysconfdir}/sysconfig/console +%dir %{_sysconfdir}/rc.d/rc[0-6].d +%dir %{_sysconfdir}/rc.d/init.d +%dir %{_sysconfdir}/rc.d %license COPYING %doc doc/sysconfig.txt -# NOTE: /etc/profile.d/ is owned by setup package. -# /etc/sysconfig/ is owned by filesystem package. -%dir %{_sysconfdir}/rc.d -%dir %{_sysconfdir}/rc.d/init.d -%dir %{_sysconfdir}/rc.d/rc[0-6].d -%dir %{_sysconfdir}/sysconfig/console -%dir %{_sysconfdir}/sysconfig/modules -%dir %{_libexecdir}/%{name} -%dir %{_libexecdir}/%{name}/legacy-actions -%{_sysconfdir}/rc.d/init.d/functions -%{_sysconfdir}/rc[0-6].d -%{_sysconfdir}/init.d -%{_bindir}/* -%{abidir}/*-option.list -%{_sbindir}/consoletype -%{_sbindir}/genhostid -%{_libexecdir}/import-state -%{_libexecdir}/loadmodules -%{_prefix}/lib/systemd/system/import-state.service -%{_prefix}/lib/systemd/system/loadmodules.service -%{_mandir}/man1/* - %files -n initscripts-rename-device -%{_prefix}/lib/udev/rename_device %{_udevrulesdir}/* +%{_prefix}/lib/udev/rename_device %files -n initscripts-service -%dir %{_libexecdir}/%{name} -%dir %{_libexecdir}/%{name}/legacy-actions -%{_sbindir}/service %{_mandir}/man8/service.* +%{_sbindir}/service +%dir %{_libexecdir}/%{name}/legacy-actions +%dir %{_libexecdir}/%{name} %files -n network-scripts -%doc doc/examples/ -%dir %{_sysconfdir}/sysconfig/network-scripts -%{_sysconfdir}/rc.d/init.d/network +%{_docdir}/network-scripts/* +%{_mandir}/man8/usernetctl.* +%{_mandir}/man8/ifdown.* +%{_mandir}/man8/ifup.* +%attr(4755,root,root) %{_sbindir}/usernetctl +%ghost %{_sbindir}/ifdown +%ghost %{_sbindir}/ifup %{_sysconfdir}/sysconfig/network-scripts/* %config(noreplace) %{_sysconfdir}/sysconfig/network-scripts/ifcfg-lo -%ghost %{_sbindir}/ifup -%ghost %{_sbindir}/ifdown -%attr(4755,root,root) %{_sbindir}/usernetctl -%{_mandir}/man8/ifup.* -%{_mandir}/man8/ifdown.* -%{_mandir}/man8/usernetctl.* -%{_docdir}/network-scripts/* +%{_sysconfdir}/rc.d/init.d/network +%dir %{_sysconfdir}/sysconfig/network-scripts +%doc doc/examples/ %files -n netconsole-service -%config(noreplace) %{_sysconfdir}/sysconfig/netconsole -%{_libexecdir}/netconsole %{_prefix}/lib/systemd/system/netconsole.service +%{_libexecdir}/netconsole +%config(noreplace) %{_sysconfdir}/sysconfig/netconsole %files -n readonly-root -%dir %{_sharedstatedir}/stateless -%dir %{_sharedstatedir}/stateless/state -%dir %{_sharedstatedir}/stateless/writable -%config(noreplace) %{_sysconfdir}/rwtab -%config(noreplace) %{_sysconfdir}/statetab -%config(noreplace) %{_sysconfdir}/sysconfig/readonly-root -%{_libexecdir}/readonly-root %{_prefix}/lib/systemd/system/readonly-root.service +%{_libexecdir}/readonly-root +%config(noreplace) %{_sysconfdir}/sysconfig/readonly-root +%config(noreplace) %{_sysconfdir}/statetab +%config(noreplace) %{_sysconfdir}/rwtab +%dir %{_sharedstatedir}/stateless/writable +%dir %{_sharedstatedir}/stateless/state +%dir %{_sharedstatedir}/stateless %files doc %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