Skip to content

Commit

Permalink
Merge pull request #980
Browse files Browse the repository at this point in the history
spec: cleanup artefacts and fix some rpmlint warnings
  • Loading branch information
cfconrad committed Jun 15, 2023
2 parents aa4a8ff + 544d48d commit 6a67928
Showing 1 changed file with 10 additions and 111 deletions.
121 changes: 10 additions & 111 deletions wicked.spec.in
@@ -1,7 +1,7 @@
#
# spec file for package wicked
#
# Copyright (c) 2021 SUSE LLC
# Copyright (c) 2023 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
Expand Down Expand Up @@ -41,7 +41,7 @@ BuildRequires: automake
BuildRequires: libtool
BuildRequires: make
%if %{with wicked_devel}
# libwicked-%{version}.so shlib package compatible match for wicked-devel
# libwicked-%%{version}.so shlib package compatible match for wicked-devel
Provides: libwicked@LIBWICKED_PACKAGE_SUFFIX@ = %{version}-%{release}
%endif
# uninstall obsolete libwicked-0-6 (libwicked-0.so.6, wicked < 0.6.60)
Expand All @@ -63,13 +63,6 @@ Obsoletes: libwicked-0-6 < %{version}
%else
%bcond_with dhcp6_nis
%endif
%if 0%{?suse_version} >= 1230
%bcond_without systemd
%bcond_with dbusstart
%else
%bcond_with systemd
%bcond_with dbusstart
%endif

%bcond_with wicked_devel

Expand All @@ -93,7 +86,6 @@ Requires(pre): util-linux-systemd
Requires(pre): util-linux
%endif

%if %{with systemd}
BuildRequires: systemd-rpm-macros
BuildRequires: pkgconfig(libsystemd)
%{?systemd_requires}
Expand All @@ -102,11 +94,6 @@ Requires(pre): %fillup_prereq
Requires: sysconfig-netconfig
%endif
Requires: %{name}-service = %{version}
%else
%if 0%{?suse_version:1}
PreReq: %fillup_prereq %insserv_prereq
%endif
%endif
%if %{defined _rundir}
%define wicked_piddir %_rundir/%{name}
%define wicked_statedir %_rundir/%{name}
Expand Down Expand Up @@ -144,8 +131,6 @@ Specification 1.0 and convert it to wicked configuration.

%endif

%if %{with systemd}

%package service
Summary: Network configuration infrastructure - systemd service
Group: System/Management
Expand All @@ -155,7 +140,6 @@ Provides: /sbin/ifup
Provides: service(network)
Provides: sysvinit(network)
Conflicts: otherproviders(/sbin/ifup)
Obsoletes: sysconfig-network

%description service
Wicked is a network configuration infrastructure incorporating a number
Expand All @@ -164,24 +148,6 @@ interface to network configuration.

This package provides the wicked systemd service files.

%else

%package service
Summary: Network configuration infrastructure - SysVinit service
Group: System/Management
Requires(pre): %name = %{version}
Provides: /sbin/ifup
Provides: sysvinit(network)
# sysvinit test package only, unsupported -> no more deps

%description service
Wicked is a network configuration infrastructure incorporating a number
of existing frameworks into a unified architecture, providing a DBUS
interface to network configuration.

This package provides the wicked system V init scripts.

%endif

%if %{with wicked_devel}
%package devel
Expand Down Expand Up @@ -223,15 +189,9 @@ export CFLAGS="-std=gnu89 $RPM_OPT_FLAGS -fPIC" LDFLAGS="-pie"
%if %{without nbft}
--disable-nbft \
%endif
%if %{with systemd}
--enable-systemd \
--with-systemd-unitdir=%{_unitdir} \
%else
--enable-systemv \
%endif
%if ! %{with dbusstart}
--without-dbus-servicedir \
%endif
--with-dbus-configdir=%{dbus_config_base}/system.d \
--disable-static
make %{?_smp_mflags}
Expand All @@ -254,17 +214,12 @@ done
%__rm -f ${RPM_BUILD_ROOT}%_libdir/libwicked*.*a
# create reboot-persistent (leases) store directory
%__mkdir_p -m 0750 ${RPM_BUILD_ROOT}%{wicked_storedir}
%if %{with systemd}
ln -sf %_sbindir/service ${RPM_BUILD_ROOT}%_sbindir/rcwicked
ln -sf %_sbindir/service ${RPM_BUILD_ROOT}%_sbindir/rcwickedd
ln -sf %_sbindir/service ${RPM_BUILD_ROOT}%_sbindir/rcwickedd-nanny
ln -sf %_sbindir/service ${RPM_BUILD_ROOT}%_sbindir/rcwickedd-dhcp6
ln -sf %_sbindir/service ${RPM_BUILD_ROOT}%_sbindir/rcwickedd-dhcp4
ln -sf %_sbindir/service ${RPM_BUILD_ROOT}%_sbindir/rcwickedd-auto4
%else
ln -sf %_sysconfdir/init.d/wickedd ${RPM_BUILD_ROOT}%_sbindir/rcwickedd
ln -sf %_sysconfdir/init.d/network ${RPM_BUILD_ROOT}%_sbindir/rcnetwork
%endif
ln -sf service ${RPM_BUILD_ROOT}%_sbindir/rcwicked
ln -sf service ${RPM_BUILD_ROOT}%_sbindir/rcwickedd
ln -sf service ${RPM_BUILD_ROOT}%_sbindir/rcwickedd-nanny
ln -sf service ${RPM_BUILD_ROOT}%_sbindir/rcwickedd-dhcp6
ln -sf service ${RPM_BUILD_ROOT}%_sbindir/rcwickedd-dhcp4
ln -sf service ${RPM_BUILD_ROOT}%_sbindir/rcwickedd-auto4

%if %{without wicked_devel}
pushd $RPM_BUILD_ROOT
Expand All @@ -276,14 +231,7 @@ rm -rfv \
popd
%endif

%if %{with systemd}

%pre service
# upgrade from sysconfig[-network] scripts
_id=`readlink /etc/systemd/system/network.service 2>/dev/null` || :
if test "x${_id##*/}" = "xnetwork.service" -a -x /etc/init.d/network ; then
/etc/init.d/network stop-all-dhcp-clients || :
fi
%{service_add_pre wicked.service}

%post service
Expand All @@ -309,24 +257,6 @@ esac
# restart wickedd after upgrade
%{service_del_postun wickedd.service}

%else

%post service
%{fillup_and_insserv wickedd}

%preun service
if test -x /etc/init.d/wicked ; then
%stop_on_removal wickedd
fi

%postun service
if test -x /etc/init.d/wicked ; then
%restart_on_update wickedd
fi
%insserv_cleanup

%endif

%post
/sbin/ldconfig
%{fillup_only -dns config wicked network}
Expand Down Expand Up @@ -360,7 +290,8 @@ fi

%files
%defattr (-,root,root)
%doc ChangeLog ANNOUNCE COPYING README TODO samples
%doc ChangeLog ANNOUNCE README TODO samples
%license COPYING
%_sbindir/wicked
%_sbindir/wickedd
%_sbindir/wickedd-nanny
Expand Down Expand Up @@ -393,13 +324,6 @@ fi
%{dbus_config_tag} %{dbus_config_base}/system.d/org.opensuse.Network.DHCP4.conf
%{dbus_config_tag} %{dbus_config_base}/system.d/org.opensuse.Network.DHCP6.conf
%{dbus_config_tag} %{dbus_config_base}/system.d/org.opensuse.Network.Nanny.conf
%if %{with dbusstart}
%if "%dbus_config_base" != "%_datadir/dbus-1"
%dir %_datadir/dbus-1
%endif
%dir %_datadir/dbus-1/system-services
%_datadir/dbus-1/system-services/org.opensuse.Network.*.service
%endif
%dir %_datadir/wicked
%dir %_datadir/wicked/schema
%_datadir/wicked/schema/*.xml
Expand Down Expand Up @@ -443,8 +367,6 @@ fi

%endif

%if %{with systemd}

%files service
%defattr (-,root,root)
%_unitdir/wickedd-auto4.service
Expand Down Expand Up @@ -474,29 +396,6 @@ fi
%_sbindir/rcwickedd
%_sbindir/rcwicked

%else

%files service
%defattr (-,root,root)
%_sysconfdir/init.d/wickedd
%_sysconfdir/init.d/network
%_sbindir/rcwickedd
%_sbindir/rcnetwork
%attr(0600,root,root) %config /etc/sysconfig/network/ifcfg-lo
%_sbindir/ifup
%if 0%{?suse_version} < 1550
/sbin/ifup
/sbin/ifdown
/sbin/ifstatus
/sbin/ifprobe
%else
%_sbindir/ifdown
%_sbindir/ifstatus
%_sbindir/ifprobe
%endif

%endif

%if %{with wicked_devel}
%files devel
%defattr (-,root,root)
Expand Down

0 comments on commit 6a67928

Please sign in to comment.