--- ../initscripts/initscripts.spec	2021-09-21 02:44:21.051749841 +0200
+++ openstack-network-scripts.spec	2021-09-21 13:47:34.556589624 +0200
@@ -16,29 +16,15 @@
 
 # =============================================================================
 
-Name:             initscripts
-Summary:          Basic support for legacy System V init scripts
+%global upstream_name initscripts
+
 Version:          10.11.1
 Release:          1%{?dist}
 
 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(pre):    shadow-utils
-Requires(post):   coreutils
+Source:           https://github.com/fedora-sysv/initscripts/archive/%{version}.tar.gz#/%{upstream_name}-%{version}.tar.gz
 
 BuildRequires:    filesystem          >= 3
 BuildRequires:    gcc
@@ -53,8 +39,6 @@
 %{?systemd_requires}
 BuildRequires:    systemd
 
-Obsoletes:        %{name}            < 10.10-1
-
 # === PATCHES =================================================================
 
 # NOTE: 'autosetup' macro (below) uses 'git' for applying the patches:
@@ -83,32 +67,14 @@
 # ---------------------    some point in the future:
 
 
-%description
-This package provides basic support for legacy System V init scripts, and some
-other legacy tools & utilities.
-
 # === SUBPACKAGES =============================================================
 
-%package -n initscripts-service
-Summary:          Support for service command
-BuildArch:        noarch
-
-%shared_requirements
-
-Requires:         systemd
-
-Provides:         /sbin/service
-
-Obsoletes:        %{name}            < 10.10-1
-
-%description -n initscripts-service
-This package provides service command.
 
 # ---------------
 
-%package -n network-scripts
+Name:             openstack-network-scripts
 Summary:          Legacy scripts for manipulating of network devices
-Requires:         %{name}%{?_isa} = %{version}-%{release}
+Requires:         %{upstream_name}%{?_isa} = %{version}-%{release}
 
 %shared_requirements
 
@@ -130,15 +96,9 @@
 Requires(post):   %{_sbindir}/update-alternatives
 Requires(postun): %{_sbindir}/update-alternatives
 
-Obsoletes:        %{name}            < 9.82-2
+Provides:         network-scripts = %{version}-%{release}
 
-# This is legacy and deprecated, so nobody should depend on this!
-# If ifcfg-style configuration is still desired, NetworkManager can do this.
-# Thus, mark this as deprecated to ensure people know to not depend on it.
-# Cf. https://docs.fedoraproject.org/en-US/packaging-guidelines/deprecating-packages/
-Provides:         deprecated()
-
-%description -n network-scripts
+%description -n openstack-network-scripts
 This package contains the legacy scripts for activating & deactivating of most
 network interfaces. It also provides a legacy version of 'network' service.
 
@@ -156,56 +116,14 @@
 
 # ---------------
 
-%package -n netconsole-service
-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
-
-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.
 
 # ---------------
 
-%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
-
-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.
-
-Please note that readonly-root package is considered deprecated with limited support.
-Please use systemd-volatile-root functionality instead, if possible.
 
 # === BUILD INSTRUCTIONS ======================================================
 
 %prep
-%autosetup -S git
+%autosetup -S git -n %{upstream_name}-%{version}
 
 # ---------------
 
@@ -215,20 +133,30 @@
 # ---------------
 
 %install
-%make_install
-
-# This installs the NLS language files:
-%find_lang %{name}
-
-%ifnarch s390 s390x
-  rm -f %{buildroot}%{_sysconfdir}/sysconfig/network-scripts/ifup-ctc
-%endif
-
-# Additional ways to access documentation:
-install -m 0755 -d %{buildroot}%{_docdir}/network-scripts
+rm -rf %{buildroot}%{_sysconfdir}/network-scripts
+install -m 0755 -d %{buildroot}%{_sysconfdir}/rc.d/init.d/
+install -m 0755 -d %{buildroot}%{_prefix}
+install -m 0755 -d %{buildroot}%{_sysconfdir}/sysconfig/network-scripts
+install -m 0755 -d %{buildroot}%{_sbindir}
+
+install -m 0755 %{_builddir}/initscripts-%{version}/etc/rc.d/init.d/network %{buildroot}%{_sysconfdir}/rc.d/init.d/
+cp -a network-scripts/* %{buildroot}%{_sysconfdir}/sysconfig/network-scripts/
+
+# Not supported interfaces
+# s390
+rm -f %{buildroot}%{_sysconfdir}/sysconfig/network-scripts/ifup-ctc
+# serial
+rm -f %{buildroot}%{_sysconfdir}/sysconfig/network-scripts/if{down,up}-sit
+# wireless
+rm -f %{buildroot}%{_sysconfdir}/sysconfig/network-scripts/ifup-wireless
+# plip
+rm -f %{buildroot}%{_sysconfdir}/sysconfig/network-scripts/ifup-pl{ip,usb}
+# bluetooth
+rm -f %{buildroot}%{_sysconfdir}/sysconfig/network-scripts/if{down,up}-bnep
+# ippp
+rm -f %{buildroot}%{_sysconfdir}/sysconfig/network-scripts/if{down,up}-ippp
 
-ln -s  %{_docdir}/%{name}/sysconfig.txt %{buildroot}%{_docdir}/network-scripts/
-ln -sr %{_mandir}/man8/ifup.8           %{buildroot}%{_mandir}/man8/ifdown.8
+install -m 0755 %{_builddir}/initscripts-%{version}/src/build/usernetctl %{buildroot}%{_sbindir}/
 
 # We are now using alternatives approach to better co-exist with NetworkManager:
 touch %{buildroot}%{_sbindir}/ifup
@@ -236,18 +164,10 @@
 
 # =============================================================================
 
-%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
+%post -n openstack-network-scripts
 chkconfig --add network > /dev/null 2>&1 || :
 
 [ -L %{_sbindir}/ifup ]   || rm -f %{_sbindir}/ifup
@@ -257,91 +177,13 @@
                                 --slave   %{_sbindir}/ifdown ifdown %{_sysconfdir}/sysconfig/network-scripts/ifdown \
                                 --initscript network
 
-%preun -n network-scripts
+%preun -n openstack-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
-
-# === PACKAGING INSTRUCTIONS ==================================================
-
-%files -f %{name}.lang
-%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
-
-# RC symlinks:
-%{_sysconfdir}/rc[0-6].d
-
-%{_sysconfdir}/init.d
-
-# ---------------
-
-%{_bindir}/*
-%{_sbindir}/consoletype
-%{_sbindir}/genhostid
-
-%{_libexecdir}/import-state
-%{_libexecdir}/loadmodules
-
-%{_prefix}/lib/systemd/system/import-state.service
-%{_prefix}/lib/systemd/system/loadmodules.service
-%{_prefix}/lib/udev/rename_device
-
-%{_udevrulesdir}/*
-
-%{_mandir}/man1/*
-
-# =============================================================================
-
-%files -n initscripts-service
-
-%dir %{_libexecdir}/%{name}
-%dir %{_libexecdir}/%{name}/legacy-actions
-
-%{_sbindir}/service
-
-%{_mandir}/man8/service.*
-
-# ---------------
-
-%files -n network-scripts
-%doc doc/examples/
+%files -n openstack-network-scripts
 %dir %{_sysconfdir}/sysconfig/network-scripts
 
 %{_sysconfdir}/rc.d/init.d/network
@@ -353,32 +195,12 @@
 %ghost                %{_sbindir}/ifdown
 %attr(4755,root,root) %{_sbindir}/usernetctl
 
-%{_mandir}/man8/ifup.*
-%{_mandir}/man8/ifdown.*
-%{_mandir}/man8/usernetctl.*
-%{_docdir}/network-scripts/*
 
 # ---------------
 
-%files -n netconsole-service
-%config(noreplace) %{_sysconfdir}/sysconfig/netconsole
-
-%{_libexecdir}/netconsole
-%{_prefix}/lib/systemd/system/netconsole.service
 
 # ---------------
 
-%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
 
 # =============================================================================
 
