Skip to content

Instantly share code, notes, and snippets.

@hadess
Created January 20, 2012 16:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save hadess/1648324 to your computer and use it in GitHub Desktop.
Save hadess/1648324 to your computer and use it in GitHub Desktop.
RPM spec file for systemd-services
Name: systemd-services
Url: http://www.freedesktop.org/wiki/Software/systemd
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Version: 38
Release: 1%{?dist}
License: GPLv2+
Group: System Environment/Base
Summary: A System and Service Manager
BuildRequires: libudev-devel >= 160
BuildRequires: libcap-devel
BuildRequires: pam-devel
BuildRequires: audit-libs-devel
BuildRequires: cryptsetup-luks-devel
BuildRequires: libxslt
BuildRequires: docbook-style-xsl
BuildRequires: vala >= 0.11
BuildRequires: pkgconfig
BuildRequires: libgee-devel
BuildRequires: libnotify-devel >= 0.7
BuildRequires: automake
BuildRequires: autoconf
BuildRequires: libtool
BuildRequires: make
BuildRequires: intltool >= 0.40.0
BuildRequires: binutils
BuildRequires: gperf
BuildRequires: gawk
Requires(post): authconfig
Requires: systemd-units = %{version}-%{release}
Requires: dbus >= 1.4.6-3.fc15
Requires: udev >= 167
Requires: libudev >= 160
Requires: initscripts >= 9.28
Requires: filesystem >= 2.4.40
Conflicts: selinux-policy < 3.9.16-12.fc15
Conflicts: kernel < 2.6.35.2-9.fc14
Requires: nss-myhostname
Source0: http://www.freedesktop.org/software/systemd/systemd-%{version}.tar.xz
Patch0: 0001-don-t-build-systemd-journald-don-t-need-it.patch
%description
systemd is a system and service manager for Linux, compatible with
SysV and LSB init scripts. 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.
%prep
%setup -q -n systemd-%{version}
%patch0 -p1
autoreconf
%build
%configure --with-rootprefix= --with-distro=ubuntu --with-rootlibdir=/%{_lib} --disable-selinux --disable-xz --disable-tcpwrap --disable-pam --disable-gtk --disable-logind --disable-readahead --disable-quotacheck --disable-randomseed --disable-acl
make %{?_smp_mflags}
%install
rm -rf %{buildroot}
make DESTDIR=%{buildroot} install
find %{buildroot} \( -name '*.a' -o -name '*.la' \) -exec rm {} \;
# Create new-style configuration files so that we can ghost-own them
touch %{buildroot}%{_sysconfdir}/hostname
touch %{buildroot}%{_sysconfdir}/vconsole.conf
touch %{buildroot}%{_sysconfdir}/locale.conf
touch %{buildroot}%{_sysconfdir}/os-release
touch %{buildroot}%{_sysconfdir}/machine-id
touch %{buildroot}%{_sysconfdir}/machine-info
touch %{buildroot}%{_sysconfdir}/timezone
mkdir -p %{buildroot}%{_sysconfdir}/X11/xorg.conf.d
touch %{buildroot}%{_sysconfdir}/X11/xorg.conf.d/00-keyboard.conf
mv %{buildroot}/lib/systemd/systemd-timedated \
%{buildroot}/lib/systemd/systemd-localed \
%{buildroot}/lib/systemd/systemd-hostnamed \
%{buildroot}/lib/
rm -rf %{buildroot}/bin \
%{buildroot}%{_sysconfdir}/bash_completion.d/ \
%{buildroot}%{_sysconfdir}/systemd \
%{buildroot}%{_sysconfdir}/xdg \
%{buildroot}/lib/systemd \
%{buildroot}/lib/udev \
%{buildroot}/lib64 \
%{buildroot}/%{_bindir} \
%{buildroot}/%{_includedir} \
%{buildroot}/usr/lib \
%{buildroot}/%{_libdir} \
%{buildroot}/%{_datadir}/doc \
%{buildroot}/%{_datadir}/pkgconfig \
%{buildroot}/%{_sysconfdir}/dbus-1/system.d/org.freedesktop.systemd1.conf
# FIXME remove only the relevant man pages
rm -rf %{buildroot}/%{_mandir}
# Create service files
for i in hostname timedate locale ; do \
sed -i "s,/bin/false,/lib/systemd-${i}d," %{buildroot}/%{_datadir}/dbus-1/system-services/org.freedesktop.${i}1.service ; \
done
%clean
rm -rf $RPM_BUILD_ROOT
%post
/bin/systemd-machine-id-setup > /dev/null 2>&1 || :
%postun
%files
%defattr(-,root,root,-)
%config(noreplace) %{_sysconfdir}/dbus-1/system.d/org.freedesktop.hostname1.conf
%config(noreplace) %{_sysconfdir}/dbus-1/system.d/org.freedesktop.locale1.conf
%config(noreplace) %{_sysconfdir}/dbus-1/system.d/org.freedesktop.timedate1.conf
/lib/systemd-*
%ghost %config(noreplace) %{_sysconfdir}/hostname
%ghost %config(noreplace) %{_sysconfdir}/vconsole.conf
%ghost %config(noreplace) %{_sysconfdir}/locale.conf
%ghost %config(noreplace) %{_sysconfdir}/os-release
%ghost %config(noreplace) %{_sysconfdir}/machine-id
%ghost %config(noreplace) %{_sysconfdir}/machine-info
%ghost %config(noreplace) %{_sysconfdir}/timezone
%ghost %config(noreplace) %{_sysconfdir}/X11/xorg.conf.d/00-keyboard.conf
%{_datadir}/systemd/kbd-model-map
%{_datadir}/dbus-1/services/org.freedesktop.systemd1.service
%{_datadir}/dbus-1/system-services/org.freedesktop.systemd1.service
%{_datadir}/dbus-1/system-services/org.freedesktop.hostname1.service
%{_datadir}/dbus-1/system-services/org.freedesktop.locale1.service
%{_datadir}/dbus-1/system-services/org.freedesktop.timedate1.service
%{_datadir}/dbus-1/interfaces/org.freedesktop.systemd1.*.xml
%{_datadir}/dbus-1/interfaces/org.freedesktop.hostname1.xml
%{_datadir}/dbus-1/interfaces/org.freedesktop.locale1.xml
%{_datadir}/dbus-1/interfaces/org.freedesktop.timedate1.xml
%{_datadir}/polkit-1/actions/org.freedesktop.systemd1.policy
%{_datadir}/polkit-1/actions/org.freedesktop.hostname1.policy
%{_datadir}/polkit-1/actions/org.freedesktop.locale1.policy
%{_datadir}/polkit-1/actions/org.freedesktop.timedate1.policy
%changelog
* Fri Jan 20 2012 Bastien Nocera <bnocera@redhat.com> 38-1
- First version based on the systemd RPM for Fedora 17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment