systemd/systemd.spec
OBS User autobuild e6c4d27af6 Accepting request 44710 from Base:System
Copy from Base:System/systemd based on submit request 44710 from user kay_sievers

OBS-URL: https://build.opensuse.org/request/show/44710
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/systemd?expand=0&rev=3
2010-08-09 00:23:44 +00:00

204 lines
6.7 KiB
RPMSpec

#
# spec file for package systemd (Version 6)
#
# Copyright (c) 2010 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/
#
# norootforbuild
Name: systemd
Url: http://www.freedesktop.org/wiki/Software/systemd
Version: 6
Release: 1
License: GPLv2+
Group: System/Base
Summary: A System and Session Manager
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: libudev-devel udev
BuildRequires: libcap-devel
BuildRequires: tcpd-devel
BuildRequires: pam-devel
BuildRequires: pkg-config
BuildRequires: dbus-1-glib-devel gtk2-devel
BuildRequires: libselinux-devel libsepol-devel
Requires: udev >= 160
Requires: dbus-1 >= 1.3.2
Conflicts: mkinitrd < 2.6.0-5
Source0: http://www.freedesktop.org/software/systemd/releases/%{name}-%{version}.tar.bz2
Source1: systemd-rpmlintrc
%description
Systemd is a system and session manager, compatible with SysV and LSB
init scripts for Linux. systemd provides aggressive parallelization
capabilities, uses socket and D-Bus activation for starting services,
offers on-demand starting of daemons, keeps track of processes using
Linux cgroups, supports snapshotting and restoring of the system state,
maintains mount and automount points and implements an elaborate
transactional dependency-based service control logic. It can work as a
drop-in replacement for sysvinit.
%package gtk
License: GPLv2+
Group: System/Base
Summary: Graphical front-end for systemd
Requires: %{name} = %{version}-%{release}
%description gtk
Graphical front-end for systemd system and session manager.
%package sysvinit
License: GPLv2+
Group: System/Base
Summary: System V init tools
Requires: %{name} = %{version}-%{release}
Provides: sbin_init
Conflicts: sysvinit
Conflicts: upstart
%description sysvinit
Drop-in replacement of System V init tools.
%prep
%setup -q
%build
# prevent pre-generated and distributed files from re-building
find . -name "*.[1-8]" -exec touch '{}' \;
touch src/systemadm.c
export V=1
%configure \
--with-distro=suse \
--docdir=%{_docdir}/systemd \
--with-rootdir= \
CFLAGS="$RPM_OPT_FLAGS"
make %{?_smp_mflags}
%install
%makeinstall
find $RPM_BUILD_ROOT -type f -name '*.la' -exec rm -f {} ';'
mkdir -p $RPM_BUILD_ROOT/sbin
ln -s ../bin/systemd $RPM_BUILD_ROOT/sbin/init
ln -s ../bin/systemctl $RPM_BUILD_ROOT/sbin/reboot
ln -s ../bin/systemctl $RPM_BUILD_ROOT/sbin/halt
ln -s ../bin/systemctl $RPM_BUILD_ROOT/sbin/shutdown
ln -s ../bin/systemctl $RPM_BUILD_ROOT/sbin/poweroff
ln -s ../bin/systemctl $RPM_BUILD_ROOT/sbin/telinit
ln -s ../bin/systemctl $RPM_BUILD_ROOT/sbin/runlevel
rm -rf $RPM_BUILD_ROOT/etc/systemd/system/*.target.wants
rm -f $RPM_BUILD_ROOT/etc/systemd/system/default.target
%pre
# kernel changes are pending to move this to /sys/fs/cgroup
mkdir -p -m 0755 /cgroup || :
%post
# Create default config in /etc at first install.
# Later package updates should not overwrite these settings.
if [ "$1" -eq 1 ]; then
# Try to read default runlevel from the old inittab if it exists
runlevel=$(awk -F ':' '$3 == "initdefault" && $1 !~ "^#" { print $2 }' /etc/inittab 2> /dev/null)
if [ -z "$runlevel" ] ; then
target="/lib/systemd/system/graphical.target"
else
target="/etc/systemd/system/runlevel$runlevel.target"
fi
/bin/ln -sf "$target" /etc/systemd/system/default.target 2>&1 || :
# Enable the services we install by default.
/bin/systemctl enable getty@.service >/dev/null 2>&1 || :
/bin/systemctl enable getty.target >/dev/null 2>&1 || :
/bin/systemctl enable remote-fs.target >/dev/null 2>&1 || :
/bin/systemctl enable var-run.mount >/dev/null 2>&1 || :
/bin/systemctl enable var-lock.mount >/dev/null 2>&1 || :
fi
# Make sure we always enable these basic services, in case something went
# wrong at the time these packages got installed. Usual systems can not
# properly work without these services.
/bin/systemctl enable udev.service >/dev/null 2>&1 || :
/bin/systemctl enable dbus.service >/dev/null 2>&1 || :
# temporary fix
/bin/systemctl enable getty.target >/dev/null 2>&1 || :
%preun
if [ $1 -eq 0 ]; then
/bin/systemctl disable getty@.service >/dev/null 2>&1 || :
/bin/systemctl disable getty.target >/dev/null 2>&1 || :
/bin/systemctl disable remote-fs.target >/dev/null 2>&1 || :
/bin/systemctl disable var-run.mount >/dev/null 2>&1 || :
/bin/systemctl disable var-lock.mount >/dev/null 2>&1 || :
rm -f /etc/systemd/system/default.target 2>&1 || :
fi
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root)
/bin/systemd
/bin/systemctl
/bin/systemd-notify
%{_bindir}/systemd-cgls
/lib/systemd/systemd-*
/%{_lib}/security/pam_systemd.so
%dir %{_sysconfdir}/systemd/system
%dir %{_sysconfdir}/systemd/session
%dir %{_sysconfdir}/xdg/systemd/session
%config(noreplace) %{_sysconfdir}/systemd/system.conf
%config(noreplace) %{_sysconfdir}/systemd/system/ctrl-alt-del.target
%config(noreplace) %{_sysconfdir}/systemd/system/kbrequest.target
%config(noreplace) %{_sysconfdir}/systemd/system/runlevel2.target
%config(noreplace) %{_sysconfdir}/systemd/system/runlevel3.target
%config(noreplace) %{_sysconfdir}/systemd/system/runlevel4.target
%config(noreplace) %{_sysconfdir}/systemd/system/runlevel5.target
%config(noreplace) %{_sysconfdir}/dbus-1/system.d/org.freedesktop.systemd1.conf
%{_datadir}/dbus-1/interfaces/org.freedesktop.systemd1.*.xml
%{_datadir}/dbus-1/services/org.freedesktop.systemd1.service
%{_datadir}/dbus-1/system-services/org.freedesktop.systemd1.service
%{_datadir}/systemd
%{_datadir}/pkgconfig/systemd.pc
%{_mandir}/man1/*.1*
%{_mandir}/man3/*.3*
%{_mandir}/man5/*.5*
%{_mandir}/man7/*.7*
%{_mandir}/man8/*.8*
%{_docdir}/systemd
/lib/udev/rules.d/*.rules
%dir /lib/systemd
/lib/systemd/system
%dir %{_sysconfdir}/systemd
%files gtk
%defattr(-,root,root,-)
%{_bindir}/systemadm
%{_mandir}/man1/systemadm.1*
%files sysvinit
%defattr(-,root,root,-)
/sbin/init
/sbin/reboot
/sbin/halt
/sbin/shutdown
/sbin/poweroff
/sbin/telinit
/sbin/runlevel
%{_mandir}/man1/init.1*
%{_mandir}/man8/halt.8*
%{_mandir}/man8/reboot.8*
%{_mandir}/man8/shutdown.8*
%{_mandir}/man8/poweroff.8*
%{_mandir}/man8/telinit.8*
%{_mandir}/man8/runlevel.8*
%changelog