From a17c9d439da4f7e3bfec0ce4c3b178232d28d3fb Mon Sep 17 00:00:00 2001 From: Christian Glombek Date: Mar 15 2022 09:56:57 +0000 Subject: Provide a sysusers.d file to get user() and group() provides (see https://fedoraproject.org/wiki/Changes/Adopting_sysusers.d_format). --- diff --git a/openvswitch.spec b/openvswitch.spec index 428c21c..f01e09e 100644 --- a/openvswitch.spec +++ b/openvswitch.spec @@ -43,9 +43,9 @@ Epoch: 1 Name: openvswitch Summary: Open vSwitch daemon/database/utilities -URL: http://www.openvswitch.org/ +URL: https://www.openvswitch.org/ Version: 2.17.0 -Release: 1%{?dist} +Release: 2%{?dist} # Nearly all of openvswitch is ASL 2.0. The bugtool is LGPLv2+, and the # lib/sflow*.[ch] files are SISSL @@ -56,10 +56,11 @@ License: ASL 2.0 and LGPLv2+ and SISSL %define dpdkarches aarch64 i686 ppc64le x86_64 %if 0%{?commit0:1} -Source: https://github.com/openvswitch/ovs/archive/%{commit0}.tar.gz#/%{name}-%{shortcommit0}.tar.gz +Source0: https://github.com/openvswitch/ovs/archive/%{commit0}.tar.gz#/%{name}-%{shortcommit0}.tar.gz %else -Source: http://openvswitch.org/releases/%{name}-%{version}.tar.gz +Source0: https://www.openvswitch.org/releases/%{name}-%{version}.tar.gz %endif +Source1: openvswitch.sysusers # ovs-patches @@ -67,7 +68,8 @@ Source: http://openvswitch.org/releases/%{name}-%{version}.tar.gz BuildRequires: gcc gcc-c++ make BuildRequires: autoconf automake libtool -BuildRequires: systemd-units openssl openssl-devel +BuildRequires: systemd-rpm-macros +BuildRequires: openssl openssl-devel BuildRequires: python3-devel python3-six python3-setuptools python3-sortedcontainers BuildRequires: python3-sphinx BuildRequires: desktop-file-utils @@ -105,13 +107,10 @@ Requires: openssl iproute module-init-tools #Upstream kernel commit 4f647e0a3c37b8d5086214128614a136064110c3 #Requires: kernel >= 3.15.0-0 -Requires(pre): shadow-utils +%{?systemd_requires} +%{?sysusers_requires_compat} + Requires(post): /bin/sed -Requires(post): /usr/sbin/usermod -Requires(post): /usr/sbin/groupadd -Requires(post): systemd-units -Requires(preun): systemd-units -Requires(postun): systemd-units Obsoletes: openvswitch-controller <= 0:2.1.0-1 %description @@ -223,6 +222,8 @@ install -d -m 0755 $RPM_BUILD_ROOT%{_rundir}/openvswitch install -d -m 0750 $RPM_BUILD_ROOT%{_localstatedir}/log/openvswitch install -d -m 0755 $RPM_BUILD_ROOT%{_sysconfdir}/openvswitch +install -p -D -m 0644 %{SOURCE1} $RPM_BUILD_ROOT%{_sysusersdir}/openvswitch.conf + install -p -D -m 0644 rhel/usr_lib_udev_rules.d_91-vfio.rules \ $RPM_BUILD_ROOT%{_udevrulesdir}/91-vfio.rules @@ -333,13 +334,7 @@ rm -f $RPM_BUILD_ROOT%{_includedir}/ovn/* %endif %pre -getent group openvswitch >/dev/null || groupadd -r openvswitch -getent passwd openvswitch >/dev/null || \ - useradd -r -g openvswitch -d / -s /sbin/nologin \ - -c "Open vSwitch Daemons" openvswitch -getent group hugetlbfs >/dev/null || groupadd -r hugetlbfs -usermod -a -G hugetlbfs openvswitch -exit 0 +%sysusers_create_compat %{SOURCE1} %post if [ $1 -eq 1 ]; then @@ -483,8 +478,13 @@ chown -R openvswitch:openvswitch /etc/openvswitch %{_sysconfdir}/sysconfig/network-scripts/ifup-ovs %{_sysconfdir}/sysconfig/network-scripts/ifdown-ovs %endif +%{_sysusersdir}/openvswitch.conf %changelog +* Tue Mar 15 2022 Christian Glombek - 2.17.0-2 +- Provide a sysusers.d file to get user() and group() provides + (see https://fedoraproject.org/wiki/Changes/Adopting_sysusers.d_format). + * Fri Mar 11 2022 Timothy Redaelli - 2.17.0-1 - Update to 2.17.0 (#1978767) diff --git a/openvswitch.sysusers b/openvswitch.sysusers new file mode 100644 index 0000000..9a464c2 --- /dev/null +++ b/openvswitch.sysusers @@ -0,0 +1,3 @@ +#Type Name ID GECOS Home directory Shell +u openvswitch - "Open vSwitch Daemons" / /sbin/nologin +m openvswitch hugetlbfs