From 6e3f7a755e307eeb983931c1fdcfa22e77da7915f2c22f051afda43f54586cad Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Fri, 7 Feb 2014 13:20:42 +0000 Subject: [PATCH] . OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=508 --- macros.systemd | 129 ------------------------------------- systemd-mini.changes | 7 ++ systemd-mini.spec | 10 ++- systemd-rpm-macros.changes | 11 ---- systemd-rpm-macros.spec | 57 ---------------- systemd.changes | 7 ++ systemd.spec | 10 ++- 7 files changed, 32 insertions(+), 199 deletions(-) delete mode 100644 macros.systemd delete mode 100644 systemd-rpm-macros.changes delete mode 100644 systemd-rpm-macros.spec diff --git a/macros.systemd b/macros.systemd deleted file mode 100644 index 1a00395..0000000 --- a/macros.systemd +++ /dev/null @@ -1,129 +0,0 @@ -# -*- Mode: makefile; indent-tabs-mode: t -*- */ -# RPM macros for packages installing systemd unit files -# -### -# -# When a package install systemd unit files, it should use the following macros: -# -# add %systemd_requires in the specfile -# -# %pre -# %service_add_pre demo.service demo1.service -# -# %post -# %service_add_post demo.service demo1.service -# -# %preun -# %service_del_preun demo.service -# -# %postun -# %service_del_postun demo.service -# -### - -# This is for systemctl -%systemd_requires \ -Requires(pre): systemd \ -Requires(post): systemd \ -Requires(preun): systemd \ -Requires(postun): systemd \ - -%_unitdir /usr/lib/systemd/system -%_presetdir /usr/lib/systemd/system-preset -%_udevhwdbdir /usr/lib/udev/hwdb.d -%_udevrulesdir /usr/lib/udev/rules.d -%_journalcatalogdir /usr/lib/systemd/catalog -%_tmpfilesdir /usr/lib/tmpfiles.d -%_sysctldir /usr/lib/sysctl.d - -%service_add_pre() \ -test -n "$FIRST_ARG" || FIRST_ARG=$1 \ -# disable migration if initial install under systemd \ -[ -d /var/lib/systemd/migrated ] || mkdir -p /var/lib/systemd/migrated || : \ -if [ $FIRST_ARG -eq 1 ]; then \ - for service in %{?*} ; do \ - sysv_service=${service%.*} \ - touch "/var/lib/systemd/migrated/$sysv_service" || : \ - done \ -else \ - if [ $FIRST_ARG -gt 1 ]; then \ - for service in %{?*} ; do \ - if [ ! -e "/usr/lib/systemd/system/$service" ]; then \ - touch "/run/rpm-%{name}-update-$service-new-in-upgrade" \ - fi \ - done \ - fi \ - for service in %{?*} ; do \ - sysv_service=${service%.*} \ - if [ ! -e "/var/lib/systemd/migrated/$sysv_service" ]; then \ - services_to_migrate="$services_to_migrate $sysv_service" \ - fi \ - done \ - if [ -n "$services_to_migrate" ]; then \ - /usr/sbin/systemd-sysv-convert --save $services_to_migrate >/dev/null 2>&1 || : \ - fi \ -fi \ -%{nil} - -# On install, tell systemd to reload its unit files -%service_add_post() \ -test -n "$FIRST_ARG" || FIRST_ARG=$1 \ -[ -d /var/lib/systemd/migrated ] || mkdir -p /var/lib/systemd/migrated || : \ -for service in %{?*} ; do \ - sysv_service=${service%.*} \ - if [ ! -e "/var/lib/systemd/migrated/$sysv_service" ]; then \ - services_to_migrate="$services_to_migrate $sysv_service" \ - touch "/var/lib/systemd/migrated/$sysv_service" || : \ - fi \ -done \ -/usr/bin/systemctl daemon-reload >/dev/null 2>&1 || : \ -if [ -n "$services_to_migrate" ]; then \ - /usr/sbin/systemd-sysv-convert --apply $services_to_migrate >/dev/null 2>&1 || : \ -elif [ $FIRST_ARG -eq 1 ]; then \ - /usr/bin/systemctl preset %{?*} >/dev/null 2>&1 || : \ -elif [ $FIRST_ARG -gt 1 ]; then \ - for service in %{?*} ; do \ - if [ -e "/run/rpm-%{name}-update-$service-new-in-upgrade" ]; then \ - rm -f "/run/rpm-%{name}-update-$service-new-in-upgrade" \ - /usr/bin/systemctl preset "$service" >/dev/null 2>&1 || : \ - fi \ - done \ -fi \ -%{nil} - -# On uninstall, disable and stop services -%service_del_preun() \ -test -n "$FIRST_ARG" || FIRST_ARG=$1 \ -if [ $FIRST_ARG -eq 0 ]; then \ -# Package removal, not upgrade \ - /usr/bin/systemctl --no-reload disable %{?*} > /dev/null 2>&1 || : \ - /usr/bin/systemctl stop %{?*} > /dev/null 2>&1 || : \ -fi \ -%{nil} - -# On uninstall, tell systemd to reload its unit files -%service_del_postun() \ -test -n "$FIRST_ARG" || FIRST_ARG=$1 \ -if [ $FIRST_ARG -ge 1 ]; then \ -# Package upgrade, not uninstall \ - /usr/bin/systemctl try-restart %{?*} >/dev/null 2>&1 || : \ -else # package uninstall \ - for service in %{?*} ; do \ - sysv_service=${service%.*} \ - rm -f "/var/lib/systemd/migrated/$sysv_service" 2> /dev/null || : \ - done \ - /usr/bin/systemctl daemon-reload >/dev/null 2>&1 || : \ -fi \ -%{nil} - -%udev_hwdb_update() \ -/usr/bin/udevadm hwdb --update >/dev/null 2>&1 || : \ -%{nil} - -%udev_rules_update() \ -/usr/bin/udevadm control --reload >/dev/null 2>&1 || : \ -%{nil} - -%journal_catalog_update() \ -/usr/bin/journalctl --update-catalog >/dev/null 2>&1 || : \ -%{nil} diff --git a/systemd-mini.changes b/systemd-mini.changes index 30031a9..3a8f13f 100644 --- a/systemd-mini.changes +++ b/systemd-mini.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Fri Feb 7 13:02:28 UTC 2014 - werner@suse.de + +- Split off systemd-rpm-macros as a separate package to avoid + a rebuild of all packages due new systemd package +- Define a sles_version 12 for suse_version 1315 + ------------------------------------------------------------------- Wed Feb 5 11:19:28 UTC 2014 - werner@suse.de diff --git a/systemd-mini.spec b/systemd-mini.spec index fbeba0d..9f09ab0 100644 --- a/systemd-mini.spec +++ b/systemd-mini.spec @@ -23,6 +23,10 @@ %define udevpkgname udev-mini %define udev_major 1 +%if 0%{?sles_version} == 0 && 0%{?suse_version} == 1315 +%global sles_version 12 +%endif + %if 0%{?sles_version} == 0 %global with_bash_completion 1 %endif @@ -63,6 +67,9 @@ BuildRequires: libusb-devel BuildRequires: libxslt-tools %endif BuildRequires: pam-devel +%if 0%{?suse_version} > 1310 +BuildRequires: systemd-rpm-macros +%endif BuildRequires: tcpd-devel BuildRequires: xz BuildRequires: pkgconfig(blkid) >= 2.20 @@ -118,7 +125,6 @@ Source0: http://www.freedesktop.org/software/systemd/systemd-%{version}.t Source1: systemd-rpmlintrc Source2: localfs.service Source3: systemd-sysv-convert -Source4: macros.systemd Source6: baselibs.conf Source7: libgcrypt.m4 Source8: systemd-journald.init @@ -805,8 +811,10 @@ done %fdupes -s %{buildroot}%{_mandir} +%if 0%{suse_version} >= 1310 # packaged in systemd-rpm-macros rm -f %{buildroot}/%{_prefix}/lib/rpm/macros.d/macros.systemd +%endif %pre getent group systemd-journal >/dev/null || groupadd -r systemd-journal || : diff --git a/systemd-rpm-macros.changes b/systemd-rpm-macros.changes deleted file mode 100644 index 165b84c..0000000 --- a/systemd-rpm-macros.changes +++ /dev/null @@ -1,11 +0,0 @@ -------------------------------------------------------------------- -Thu Jul 4 13:59:43 CEST 2013 - fcrozat@suse.com - -- Resync with systemd v205 macros - -------------------------------------------------------------------- -Mon Jun 17 10:49:50 UTC 2013 - mhrusecky@suse.com - -- New package with systemd rpm macros to avoid unnecessary build time - dependencies - diff --git a/systemd-rpm-macros.spec b/systemd-rpm-macros.spec deleted file mode 100644 index c8e0234..0000000 --- a/systemd-rpm-macros.spec +++ /dev/null @@ -1,57 +0,0 @@ -# -# spec file for package systemd-rpm-macros -# -# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany. -# -# All modifications and additions to the file contributed by third parties -# remain the property of their copyright owners, unless otherwise agreed -# upon. The license for this file, and modifications and additions to the -# file, is the same license as for the pristine package itself (unless the -# license for the pristine package is not an Open Source License, in which -# case the license is the MIT License). An "Open Source License" is a -# license that conforms to the Open Source Definition (Version 1.9) -# published by the Open Source Initiative. - -# Please submit bugfixes or comments via http://bugs.opensuse.org/ -# - - -#!BuildIgnore: util-linux - -Name: systemd-rpm-macros -Version: 2 -Release: 0 -Summary: RPM macros for systemd -License: LGPL-2.1+ -Group: System/Base -Url: http://en.opensuse.org/openSUSE:Systemd_packaging_guidelines -Source0: macros.systemd -BuildRoot: %{_tmppath}/%{name}-%{version}-build -BuildArch: noarch - -%description -Starting with openSUSE 12.1, several RPM macros must be used to package systemd -services files. This package provides these macros. - -%prep - -%build - -%install -mkdir -p %{buildroot}%{_sysconfdir}/rpm -install -m644 %{S:0} %{buildroot}%{_sysconfdir}/rpm -UNITDIR="`cat %{S:0} | sed -n 's|.*_unitdir[[:blank:]]*||p'`" -for i in $UNITDIR `dirname $UNITDIR`; do - mkdir -p %{buildroot}$i - echo $i >> unitdir -done - -%post - -%postun - -%files -f unitdir -%defattr(-,root,root) -%{_sysconfdir}/rpm/macros.systemd - -%changelog diff --git a/systemd.changes b/systemd.changes index 30031a9..3a8f13f 100644 --- a/systemd.changes +++ b/systemd.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Fri Feb 7 13:02:28 UTC 2014 - werner@suse.de + +- Split off systemd-rpm-macros as a separate package to avoid + a rebuild of all packages due new systemd package +- Define a sles_version 12 for suse_version 1315 + ------------------------------------------------------------------- Wed Feb 5 11:19:28 UTC 2014 - werner@suse.de diff --git a/systemd.spec b/systemd.spec index 4dfc122..a5c7ece 100644 --- a/systemd.spec +++ b/systemd.spec @@ -21,6 +21,10 @@ %define udevpkgname udev %define udev_major 1 +%if 0%{?sles_version} == 0 && 0%{?suse_version} == 1315 +%global sles_version 12 +%endif + %if 0%{?sles_version} == 0 %global with_bash_completion 1 %endif @@ -58,6 +62,9 @@ BuildRequires: libusb-devel BuildRequires: libxslt-tools %endif BuildRequires: pam-devel +%if 0%{?suse_version} > 1310 +BuildRequires: systemd-rpm-macros +%endif BuildRequires: tcpd-devel BuildRequires: xz BuildRequires: pkgconfig(blkid) >= 2.20 @@ -113,7 +120,6 @@ Source0: http://www.freedesktop.org/software/systemd/systemd-%{version}.t Source1: systemd-rpmlintrc Source2: localfs.service Source3: systemd-sysv-convert -Source4: macros.systemd Source6: baselibs.conf Source7: libgcrypt.m4 Source8: systemd-journald.init @@ -800,8 +806,10 @@ done %fdupes -s %{buildroot}%{_mandir} +%if 0%{suse_version} >= 1310 # packaged in systemd-rpm-macros rm -f %{buildroot}/%{_prefix}/lib/rpm/macros.d/macros.systemd +%endif %pre getent group systemd-journal >/dev/null || groupadd -r systemd-journal || :