diff options
Diffstat (limited to 'initscripts.spec')
-rw-r--r-- | initscripts.spec | 580 |
1 files changed, 450 insertions, 130 deletions
diff --git a/initscripts.spec b/initscripts.spec index dcc4fea8..2809d55c 100644 --- a/initscripts.spec +++ b/initscripts.spec @@ -1,164 +1,484 @@ -Summary: Scripts to bring up network interfaces and legacy utilities -Name: initscripts -Version: 9.78 -License: GPLv2 -Group: System Environment/Base -Release: 1%{?dist} -URL: https://github.com/fedora-sysv/initscripts -Source: https://github.com/fedora-sysv/initscripts/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz -Requires: /bin/awk, sed, coreutils -Requires: grep -Requires: module-init-tools -Requires: util-linux >= 2.16 -Requires: bash >= 3.0 -Requires: procps-ng >= 3.3.8-16 -Requires: ipcalc -Conflicts: systemd < 216-3 -Conflicts: lvm2 < 2.02.98-3 -Conflicts: dmraid < 1.0.0.rc16-18 -Conflicts: policycoreutils < 2.5-6 -Requires: systemd -Requires: iproute, /sbin/arping, findutils -Requires: cpio -Requires: hostname -Conflicts: ipsec-tools < 0.8.0-2 -Conflicts: NetworkManager < 0.9.9.0-37.git20140131.el7 -Conflicts: ppp < 2.4.6-4 -Requires(pre): /usr/sbin/groupadd -Requires(post): /sbin/chkconfig, coreutils -Requires(preun): /sbin/chkconfig +# === GLOBAL MACROS =========================================================== + +# According to Fedora Package Guidelines, it is advised that packages that can +# process untrusted input are build with position-idenpendent code (PIC). +# +# Koji should override the compilation flags and add the -fPIC or -fPIE flags by +# default. This is here just in case this wouldn't happen for some reason. +# For more info: https://fedoraproject.org/wiki/Packaging:Guidelines#PIE +%global _hardened_build 1 + +%global shared_requirements \ +Requires: bash \ +Requires: filesystem >= 3 \ +Requires: coreutils \ +Requires: gawk \ + +# ============================================================================= + +Name: initscripts +Summary: Basic support for legacy System V init scripts +Version: 10.04 +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(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 + %{?systemd_requires} -BuildRequires: glib2-devel popt-devel gettext pkgconfig systemd -Provides: /sbin/service +BuildRequires: systemd + +Provides: /sbin/service + +Obsoletes: %{name} < 9.82-2 + +# === PATCHES ================================================================= + +# NOTE: 'autosetup' macro (below) uses 'git' for applying the patches: +# ->> All the patches should be provided in 'git format-patch' format. +# ->> Auxiliary repository will be created during 'fedpkg prep', you +# can see all the applied patches there via 'git log'. + +# Upstream patches -- official upstream patches released by upstream since the +# ---------------- last rebase that are necessary for any reason: +#Patch000: example000.patch + + +# Downstream patches -- these should be always included when doing rebase: +# ------------------ +#Patch100: example100.patch + + +# Downstream patches for RHEL -- patches that we keep only in RHEL for various +# --------------------------- reasons, but are not enabled in Fedora: +%if %{defined rhel} || %{defined centos} +#Patch200: example200.patch +%endif + + +# Patches to be removed -- deprecated functionality which shall be removed at +# --------------------- some point in the future: + %description -This package contains the script that activates and deactivates most -network interfaces, some utilities, and other legacy files. +This package provides basic support for legacy System V init scripts, and some +other legacy tools & utilities. + +# === SUBPACKAGES ============================================================= + +%package -n network-scripts +Summary: Legacy scripts for manipulating of network devices +Requires: %{name}%{?_isa} = %{version}-%{release} + +%shared_requirements + +Requires: bc +Requires: dbus +Requires: gawk +Requires: grep +Requires: hostname +Requires: iproute +Requires: ipcalc +Requires: kmod +Requires: procps-ng +Requires: sed +Requires: systemd + +Requires(post): chkconfig +Requires(preun): chkconfig + +Requires(post): %{_sbindir}/update-alternatives +Requires(postun): %{_sbindir}/update-alternatives + +Obsoletes: %{name} < 9.82-2 + +%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: + $ update-alternatives --config ifup + +Please note that running the command above will also disable the 'network' +service. + +# --------------- + +%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. + +# === BUILD INSTRUCTIONS ====================================================== %prep -%setup -q +%autosetup -S git + +# --------------- %build -make +%make_build PYTHON=%{__python3} + +# --------------- %install -make ROOT=%{buildroot} SUPERUSER=`id -un` SUPERGROUP=`id -gn` mandir=%{_mandir} install +%make_install +# This installs the NLS language files: %find_lang %{name} %ifnarch s390 s390x -rm -f \ - %{buildroot}%{_sysconfdir}/sysconfig/network-scripts/ifup-ctc \ + rm -f %{buildroot}%{_sysconfdir}/sysconfig/network-scripts/ifup-ctc %endif -rm -f %{buildroot}%{_sysconfdir}/rc.d/rc.local %{buildroot}%{_sysconfdir}/rc.local -touch %{buildroot}%{_sysconfdir}/rc.d/rc.local -chmod 755 %{buildroot}%{_sysconfdir}/rc.d/rc.local +# Additional ways to access documentation: +install -m 0755 -d %{buildroot}%{_docdir}/network-scripts -%post -%systemd_post fedora-import-state.service fedora-loadmodules.service fedora-readonly.service +ln -s %{_docdir}/%{name}/sysconfig.txt %{buildroot}%{_docdir}/network-scripts/ +ln -sr %{_mandir}/man8/ifup.8 %{buildroot}%{_mandir}/man8/ifdown.8 -/usr/sbin/chkconfig --add network > /dev/null 2>&1 || : -/usr/sbin/chkconfig --add netconsole > /dev/null 2>&1 || : +# We are now using alternatives approach to better co-exist with NetworkManager: +touch %{buildroot}%{_sbindir}/ifup +touch %{buildroot}%{_sbindir}/ifdown -%preun -%systemd_preun fedora-import-state.service fedora-loadmodules.service fedora-readonly.service +# ============================================================================= -if [ $1 = 0 ]; then - /usr/sbin/chkconfig --del network > /dev/null 2>&1 || : - /usr/sbin/chkconfig --del netconsole > /dev/null 2>&1 || : -fi +%post +%systemd_post import-state.service loadmodules.service + +%preun +%systemd_preun import-state.service loadmodules.service %postun -%systemd_postun fedora-import-state.service fedora-loadmodules.service fedora-readonly.service +%systemd_postun import-state.service loadmodules.service + +# --------------- + +%post -n network-scripts +chkconfig --add network > /dev/null 2>&1 || : -# This should be removed in Rawhide for Fedora 29: -%triggerun -- initscripts < 9.78 -if [ $1 -gt 1 ]; then - systemctl enable fedora-import-state.service fedora-readonly.service &> /dev/null || : - echo -e "\nUPGRADE: Automatically re-enabling default systemd units: fedora-import-state.service fedora-readonly.service\n" || : +[ -L %{_sbindir}/ifup ] || rm -f %{_sbindir}/ifup +[ -L %{_sbindir}/ifdown ] || rm -f %{_sbindir}/ifdown + +%{_sbindir}/update-alternatives --install %{_sbindir}/ifup ifup %{_sysconfdir}/sysconfig/network-scripts/ifup 90 \ + --slave %{_sbindir}/ifdown ifdown %{_sysconfdir}/sysconfig/network-scripts/ifdown \ + --initscript network + +%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 + +# === PACKAGING INSTRUCTIONS ================================================== + %files -f %{name}.lang -%defattr(-,root,root) -%dir %{_sysconfdir}/sysconfig/network-scripts -%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/adjtime -%config(noreplace) %{_sysconfdir}/sysconfig/netconsole -%config(noreplace) %{_sysconfdir}/sysconfig/readonly-root -%{_sysconfdir}/sysconfig/network-scripts/ifdown -%{_sbindir}/ifdown -%{_sysconfdir}/sysconfig/network-scripts/ifdown-post -%{_sysconfdir}/sysconfig/network-scripts/ifup -%{_sbindir}/ifup -%dir %{_sysconfdir}/sysconfig/console -%dir %{_sysconfdir}/sysconfig/modules -%{_sysconfdir}/sysconfig/network-scripts/network-functions -%{_sysconfdir}/sysconfig/network-scripts/network-functions-ipv6 -%{_sysconfdir}/sysconfig/network-scripts/init.ipv6-global -%config(noreplace) %{_sysconfdir}/sysconfig/network-scripts/ifcfg-lo -%{_sysconfdir}/sysconfig/network-scripts/ifup-post -%{_sysconfdir}/sysconfig/network-scripts/ifup-routes -%{_sysconfdir}/sysconfig/network-scripts/ifdown-routes -%{_sysconfdir}/sysconfig/network-scripts/ifup-plip -%{_sysconfdir}/sysconfig/network-scripts/ifup-plusb -%{_sysconfdir}/sysconfig/network-scripts/ifup-bnep -%{_sysconfdir}/sysconfig/network-scripts/ifdown-bnep -%{_sysconfdir}/sysconfig/network-scripts/ifup-eth -%{_sysconfdir}/sysconfig/network-scripts/ifdown-eth -%{_sysconfdir}/sysconfig/network-scripts/ifup-ipv6 -%{_sysconfdir}/sysconfig/network-scripts/ifdown-ipv6 -%{_sysconfdir}/sysconfig/network-scripts/ifup-sit -%{_sysconfdir}/sysconfig/network-scripts/ifdown-sit -%{_sysconfdir}/sysconfig/network-scripts/ifup-tunnel -%{_sysconfdir}/sysconfig/network-scripts/ifdown-tunnel -%{_sysconfdir}/sysconfig/network-scripts/ifup-aliases -%{_sysconfdir}/sysconfig/network-scripts/ifup-ippp -%{_sysconfdir}/sysconfig/network-scripts/ifdown-ippp -%{_sysconfdir}/sysconfig/network-scripts/ifup-wireless -%{_sysconfdir}/sysconfig/network-scripts/ifup-isdn -%{_sysconfdir}/sysconfig/network-scripts/ifdown-isdn -%ifarch s390 s390x -%{_sysconfdir}/sysconfig/network-scripts/ifup-ctc -%endif -%config(noreplace) %{_sysconfdir}/networks -%config(noreplace) %{_sysconfdir}/rwtab -%config(noreplace) %{_sysconfdir}/statetab -%dir %{_sysconfdir}/rwtab.d -%dir %{_sysconfdir}/statetab.d -%{_prefix}/lib/systemd/fedora-* -%{_prefix}/lib/systemd/system/* +%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/rc[0-9].d -%{_sysconfdir}/rc[0-9].d %dir %{_sysconfdir}/rc.d/init.d -%{_sysconfdir}/rc.d/init.d/* -%ghost %verify(not md5 size mtime) %config(noreplace,missingok) %{_sysconfdir}/rc.d/rc.local -%{_sysconfdir}/profile.d/* -%{_sbindir}/sys-unconfig -%{_bindir}/usleep -%attr(4755,root,root) %{_sbindir}/usernetctl +%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 -%{_sbindir}/sushell -%attr(2755,root,root) %{_sbindir}/netreport -%{_udevrulesdir}/* -%{_prefix}/lib/udev/rename_device %{_sbindir}/service -%{_mandir}/man*/* -%dir %attr(775,root,root) /run/netreport -%dir %{_sysconfdir}/NetworkManager -%dir %{_sysconfdir}/NetworkManager/dispatcher.d -%{_sysconfdir}/NetworkManager/dispatcher.d/00-netreport -%doc sysconfig.txt sysvinitfiles static-routes-ipv6 ipv6-tunnel.howto ipv6-6to4.howto changes.ipv6 -%doc examples -%{!?_licensedir:%global license %%doc} -%license COPYING -%{_sharedstatedir}/stateless -%{_tmpfilesdir}/initscripts.conf -%dir %{_libexecdir}/initscripts -%dir %{_libexecdir}/initscripts/legacy-actions + +%{_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/* +%{_mandir}/man8/service.* + +# ============================================================================= + +%files -n network-scripts +%doc doc/examples/ +%dir %{_sysconfdir}/sysconfig/network-scripts + +%{_sysconfdir}/rc.d/init.d/network +%{_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/* + +# --------------- + +%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 + +# ============================================================================= %changelog +* Tue Jul 14 2020 Jan Macku <jamacku@redhat.com> - 10.04-1 +- Maintain permisision to set umask +- rwtab: Add support for chrony +- Correct spelling, IP, … +- Fix spelling, for more info +- Fix spelling of SELinux +- Translations update from Weblate + +* Tue Mar 24 2020 Jan Macku <jamacku@redhat.com> - 10.03-1 +- Replace grep -EL with subshell since -L changed behaviour +- Wait for scope link addresses as well as for scope global addresses +- Remove deprecated option -m of pidof +- Use function is_true for testing true conditions +- Adding new travis job for testing shell-scripts +- Remove zanata conf +- pull latest translations +- Update of translations and remove files with no translations +- Fix service network stop cmd +- Change spacing of service file to folow spacing of project +- network-function: bridges are created by ifup-eth +- Initscripts no longer care about rc.local +- Repalace hardcoded tests for yes and no with testing functions +- ifup-eth: Fix bridge setting stp option +- Fix bug in service(8) +- ifup-eth: Check that device name is set +- Fix missing python3 during build phase +- rc.d/functions: fix escape sequence being output under systemd service units +- Add ip6gre tunnel option +- ifup/ifdown: print DEPRECATION_WARNING_ISSUED waring info after source_config + +* Fri Jun 28 2019 Jan Macku <jamacku@redhat.com> - 10.02-1 +- network: don't fail with IFDOWN_ON_SHUTDOWN +- rc.d/functions: remove support cgroups +- Create symlink (/etc/init.d) to /etc/rc.d/init.d +- Add option to wait until target is reachable +- ifup-eth: apply PERSISTENT_DHCLIENT to IPv6 dhclient daemon +- ifup-post: fix incorrect condition for RESOLV_MODS +- make tag: updated message +- make release-commit: do not create tag automatically + +* Mon Aug 06 2018 David Kaspar [Dee'Kej] <dkaspar@redhat.com> - 10.01-1 +- network/ifup/ifdown: deprecations warnings redirected to stderr +- ifup-eth: use 'bc' instead of 'expr' when computing $forward_delay +- network/ifup/ifdown: deprecation warnings for 'network-scripts' added +- network: parsing of /proc/mounts returned + +* Thu Jun 21 2018 David Kaspar [Dee'Kej] <dkaspar@redhat.com> - 10.00-1 +- Move the /etc/rwtab.d & /etc/statetab.d folders to 'filesystem' +- specfile: fix failing build because of incorrect use of %{_isa} + +* Thu Jun 14 2018 David Kaspar [Dee'Kej] <dkaspar@redhat.com> - 9.83-1 +- network-scripts: Add previously dropped error checking +- network-scripts: Replace brctl with ip-link +- Makefile: new release-commit rule added +- src/rename_device.c: GCC warnings about unused return value suppressed +- src/usernetctl.c: GCC warnings about unused return value suppressed +- Makefile: allow sub-makefiles to run in parallel +- specfile: netconsole service moved to /usr/libexec +- specfile: services from /usr/lib/systemd moved to /usr/libexec +- specfile: summary & description updated +- specfile: no longer needed conflicts dropped +- specfile: requirements cleanup +- specfile: obsoletes on previous version of initscripts package added +- specfile: network-scripts subpackage created +- specfile: readonly-root subpackage created +- specfile: netconsole-service subpackage created +- README.md: Travis CI build icon added +- .travis.yml: check the 'make install' proceeds as well +- .travis.yml: initial commit +- README.md: bug reporting described +- README.dm: future of initscripts described +- README.md: description added +- README.md: references to old git branches added +- README.md: initial commit +- network-scripts: setting of firewall ZONE fixed +- ifdown-post: artifact whitespace removed from the DBus call +- l10n: drop .tx directory +- l10n: add zanata.xml + +* Mon Jun 04 2018 David Kaspar [Dee'Kej] <dkaspar@redhat.com> - 9.82-1 +- Makefile: make the creation of symlinks relative to path again +- specfile: trailing file of netreport removed + +* Thu May 31 2018 David Kaspar [Dee'Kej] <dkaspar@redhat.com> - 9.81-1 +- src/consoletype.c: deprecation warning added +- src/genhostid.c: deprecation warning added +- src/genhostid.c: fixed to not override /etc/hostid if it already exists +- src/usleep.c: GCC warnings fixed +- nis-domainname.service removed +- fedora-* services renamed to more general names +- specfile: missing fedora-domainname.service returned in systemd macros +- COPYING updated to latest GNU version (GPLv2+) +- network-scripts: control 'network' service with alternatives as well +- netreport functionality dropped +- networks moved into 'setup' package +- lang.{sh,csh} moved into setup package +- lang.{sh,csh} cleanup before moving to 'setup' package +- src/sushell moved into 'policycoreutils' package +- src/shvar.* removed +- po/xgettext_sh removed +- sys-unconfig removed +- Outdated files from doc/ folder removed +- make archive: ChangeLog generating removed +- network-scripts: ifup & ifdown -- use alternatives system +- adjtime moved into 'util-linux' package +- specfile: simplified & updated to new repository layout +- .gitignore files updated to new repository layout +- Makefile simplified & updated to new repository layout +- po/Makefile simplified & updated to new repository layout +- src/Makefile simplified & updated to new repository layout +- Repository scheme updated to new layout +- fedora-readonly: command substitution warning fixed (null-byte input) + +* Fri May 25 2018 David Kaspar [Dee'Kej] <dkaspar@redhat.com> - 9.80-1 +- sysconfig/readonly-root: Clarify the usage of readonly-root +- use proper shebang where appropriate +- specfile: remove the systemctl call in the %postun phase +- network-functions: use tr to upper case strings rather than awk +- network-functions: add error messages for bonding installation +- ifdown-eth: no longer needed 'pidof -x dhclient' condition removed +- netconsole: LSB header added +- po/xgettext_sh*: converted to use to python3 +- network.service: 'reload' removed +- ifup-tunnel: Support 'external' tunnels +- spec: add gcc to BuildRequires +- init.d/functions: fix sourcing for ksh + +* Tue Jan 02 2018 David Kaspar [Dee'Kej] <dkaspar@redhat.com> - 9.79-1 +- ifdown-post: fix logical error in commit 5d61564 +- network: add knob to optionally keep interfaces up during shutdown +- network-functions: use POSIX forwarding instead of bash-ism + * Wed Nov 08 2017 David Kaspar [Dee'Kej] <dkaspar@redhat.com> - 9.78-1 - specfile: drop dependancy on /etc/system-release - ifup-post: always update nameserver & search entries in /etc/resolv.conf @@ -379,7 +699,7 @@ ng * Tue Jan 14 2014 Lukáš Nykrýn <lnykryn@redhat.com> 9.51-1 - readonly-root: bind-mount only necessary subset of entries in rwtab - readonly-root: Add /var/log/audit/audit.log to rwtab -- readonly-root: restore selinux context after bind mount +- readonly-root: restore SELinux context after bind mount - rename_device: remove comments and trailing whitespaces - service: suggest using systemctl if unknown action is used - ifup-eth: fix typo in error message |