From d2ba8ccb1b74b374c83ea6fa35e4fa3eee72a1af53467d3071751fb01e508950 Mon Sep 17 00:00:00 2001 From: Frederic Crozat Date: Wed, 19 Jun 2013 11:05:44 +0000 Subject: [PATCH] Accepting request 179649 from home:-miska-:branches:Base:System We talked about using %patch, but in that case I would need a tarball of systemd in rpm-macros package which depends on xz which is part of many circles. OBS-URL: https://build.opensuse.org/request/show/179649 OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=399 --- macros.systemd.upstream | 73 +++++++++++++++++++++++++++++++++++++++++ systemd-mini.changes | 6 ++++ systemd-mini.spec | 11 ++----- systemd.changes | 6 ++++ systemd.spec | 11 ++----- 5 files changed, 91 insertions(+), 16 deletions(-) create mode 100644 macros.systemd.upstream diff --git a/macros.systemd.upstream b/macros.systemd.upstream new file mode 100644 index 00000000..dc19f937 --- /dev/null +++ b/macros.systemd.upstream @@ -0,0 +1,73 @@ +# -*- Mode: makefile; indent-tabs-mode: t -*- */ +# +# This file is part of systemd. +# +# Copyright 2012 Lennart Poettering +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. +# +# systemd is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with systemd; If not, see . + +# RPM macros for packages installing systemd unit files + +%_unitdir @systemunitdir@ +%_presetdir @systempresetdir@ +%_udevhwdbdir @udevhwdbdir@ +%_udevrulesdir @udevrulesdir@ +%_journalcatalogdir @catalogdir@ +%_tmpfilesdir @tmpfilesdir@ +%_sysctldir @sysctldir@ + +%systemd_requires \ +Requires(post): systemd \ +Requires(preun): systemd \ +Requires(postun): systemd \ +%{nil} + +%systemd_post() \ +if [ $1 -eq 1 ] ; then \ + # Initial installation \ + @rootbindir@/systemctl preset %{?*} >/dev/null 2>&1 || : \ +fi \ +%{nil} + +%systemd_preun() \ +if [ $1 -eq 0 ] ; then \ + # Package removal, not upgrade \ + @rootbindir@/systemctl --no-reload disable %{?*} > /dev/null 2>&1 || : \ + @rootbindir@/systemctl stop %{?*} > /dev/null 2>&1 || : \ +fi \ +%{nil} + +%systemd_postun() \ +@rootbindir@/systemctl daemon-reload >/dev/null 2>&1 || : \ +%{nil} + +%systemd_postun_with_restart() \ +@rootbindir@/systemctl daemon-reload >/dev/null 2>&1 || : \ +if [ $1 -ge 1 ] ; then \ + # Package upgrade, not uninstall \ + @rootbindir@/systemctl try-restart %{?*} >/dev/null 2>&1 || : \ +fi \ +%{nil} + +%udev_hwdb_update() \ +@rootbindir@/udevadm hwdb --update >/dev/null 2>&1 || : \ +%{nil} + +%udev_rules_update() \ +@rootbindir@/udevadm control --reload >/dev/null 2>&1 || : \ +%{nil} + +%journal_catalog_update() \ +@rootbindir@/journalctl --update-catalog >/dev/null 2>&1 || : \ +%{nil} diff --git a/systemd-mini.changes b/systemd-mini.changes index fb7a4288..0a35d39c 100644 --- a/systemd-mini.changes +++ b/systemd-mini.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Jun 19 08:44:52 UTC 2013 - mhrusecky@suse.com + +- Dropped backward compatibility +- Added check for upstream rpm macros changes + ------------------------------------------------------------------- Mon Jun 18 12:13:25 UTC 2013 - mhrusecky@suse.com diff --git a/systemd-mini.spec b/systemd-mini.spec index fbc1390e..024ccfed 100644 --- a/systemd-mini.spec +++ b/systemd-mini.spec @@ -110,6 +110,7 @@ Source6: baselibs.conf Source7: libgcrypt.m4 Source8: systemd-journald.init Source9: nss-myhostname-config +Source10: macros.systemd.upstream Source1060: boot.udev Source1061: write_dev_root_rule @@ -215,9 +216,7 @@ Summary: Development headers for systemd License: LGPL-2.1+ Group: Development/Libraries/C and C++ Requires: %{name} = %{version} -%if 0%{suse_version} > 1230 Requires: systemd-rpm-macros -%endif %if 0%{?bootstrap} Conflicts: systemd-devel %endif @@ -370,6 +369,8 @@ This package marks the installation to not use syslog but only the journal. %prep %setup -q -n systemd-%{version} +echo "Checking whether upstream rpm macros changed..." +[ -z "`diff -Naru "%{S:10}" src/core/macros.systemd.in`" ] || exit 1 # only needed for bootstrap %if 0%{?bootstrap} @@ -493,13 +494,7 @@ sed -ie "s|@@PREFIX@@|%{_prefix}/lib/udev|g" %{S:1062} install -m644 -D %{S:1062} $RPM_BUILD_ROOT/%{_prefix}/lib/systemd/system/systemd-udev-root-symlink.service mkdir -p $RPM_BUILD_ROOT/%{_prefix}/lib/systemd/system/basic.target.wants ln -sf ../systemd-udev-root-symlink.service $RPM_BUILD_ROOT/%{_prefix}/lib/systemd/system/basic.target.wants - -%if 0%{suse_version} < 1310 -mkdir -p %{buildroot}%{_sysconfdir}/rpm -install -m644 %{S:4} %{buildroot}%{_sysconfdir}/rpm -%else rm -rf %{buildroot}%{_sysconfdir}/rpm -%endif find %{buildroot} -type f -name '*.la' -delete mkdir -p %{buildroot}/{sbin,var/lib/systemd/sysv-convert,var/lib/systemd/migrated} %{buildroot}/usr/lib/systemd/{system-generators,user-generators,system-preset,user-preset,system/halt.target.wants,system/kexec.target.wants,system/poweroff.target.wants,system/reboot.target.wants} diff --git a/systemd.changes b/systemd.changes index fb7a4288..702cc8d2 100644 --- a/systemd.changes +++ b/systemd.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Jun 19 08:44:06 UTC 2013 - mhrusecky@suse.com + +- Dropped backward compatibility +- Added check for upstream rpm macros changes + ------------------------------------------------------------------- Mon Jun 18 12:13:25 UTC 2013 - mhrusecky@suse.com diff --git a/systemd.spec b/systemd.spec index 91f46dfb..daba57f1 100644 --- a/systemd.spec +++ b/systemd.spec @@ -105,6 +105,7 @@ Source6: baselibs.conf Source7: libgcrypt.m4 Source8: systemd-journald.init Source9: nss-myhostname-config +Source10: macros.systemd.upstream Source1060: boot.udev Source1061: write_dev_root_rule @@ -210,9 +211,7 @@ Summary: Development headers for systemd License: LGPL-2.1+ Group: Development/Libraries/C and C++ Requires: %{name} = %{version} -%if 0%{suse_version} > 1230 Requires: systemd-rpm-macros -%endif %if 0%{?bootstrap} Conflicts: systemd-devel %endif @@ -365,6 +364,8 @@ This package marks the installation to not use syslog but only the journal. %prep %setup -q -n systemd-%{version} +echo "Checking whether upstream rpm macros changed..." +[ -z "`diff -Naru "%{S:10}" src/core/macros.systemd.in`" ] || exit 1 # only needed for bootstrap %if 0%{?bootstrap} @@ -488,13 +489,7 @@ sed -ie "s|@@PREFIX@@|%{_prefix}/lib/udev|g" %{S:1062} install -m644 -D %{S:1062} $RPM_BUILD_ROOT/%{_prefix}/lib/systemd/system/systemd-udev-root-symlink.service mkdir -p $RPM_BUILD_ROOT/%{_prefix}/lib/systemd/system/basic.target.wants ln -sf ../systemd-udev-root-symlink.service $RPM_BUILD_ROOT/%{_prefix}/lib/systemd/system/basic.target.wants - -%if 0%{suse_version} < 1310 -mkdir -p %{buildroot}%{_sysconfdir}/rpm -install -m644 %{S:4} %{buildroot}%{_sysconfdir}/rpm -%else rm -rf %{buildroot}%{_sysconfdir}/rpm -%endif find %{buildroot} -type f -name '*.la' -delete mkdir -p %{buildroot}/{sbin,var/lib/systemd/sysv-convert,var/lib/systemd/migrated} %{buildroot}/usr/lib/systemd/{system-generators,user-generators,system-preset,user-preset,system/halt.target.wants,system/kexec.target.wants,system/poweroff.target.wants,system/reboot.target.wants}