]> git.ipfire.org Git - ipfire-3.x.git/blame - systemd/systemd.nm
systemd: Add upstream patch to support "is-enabled" for templated units.
[ipfire-3.x.git] / systemd / systemd.nm
CommitLineData
c8ef6def 1###############################################################################
802ea3af
MT
2# IPFire.org - An Open Source Firewall Solution #
3# Copyright (C) - IPFire Development Team <info@ipfire.org> #
c8ef6def
SS
4###############################################################################
5
802ea3af 6name = systemd
1b81106b 7version = 204
17bafa6d 8release = 2
c8ef6def 9
802ea3af
MT
10maintainer = Stefan Schantl <stefan.schantl@ipfire.org>
11groups = System/Base
12url = http://www.freedesktop.org/wiki/Software/systemd
13license = GPLv2+
14summary = A System and Service Manager.
c8ef6def 15
802ea3af
MT
16description
17 systemd is a system and service manager for Linux, compatible with
c8ef6def 18 SysV and LSB init scripts.
802ea3af
MT
19end
20
5e38e9bb 21source_dl = http://cgit.freedesktop.org/systemd/systemd/snapshot/
802ea3af
MT
22
23build
6793fec1
MT
24 unitdir = %{prefix}/lib/systemd/system
25
802ea3af 26 requires
b329a155 27 attr-devel
802ea3af
MT
28 audit-devel
29 automake
30 autoconf
2d01364a 31 cryptsetup-luks-devel >= 1.4.2
802ea3af 32 dbus-devel
fe6e3719
SS
33 docbook-utils
34 docbook-xsl
bfabb323 35 gettext-devel
2d01364a
SS
36 glib2-devel
37 gobject-introspection-devel >= 1.31
38 gperf
39 hwdata
802ea3af 40 intltool
6793fec1 41 kmod-devel >= 5
2a824e90 42 libacl-devel
2d01364a 43 libblkid-devel
802ea3af 44 libcap-devel
4990bf7f 45 libgcrypt-devel
802ea3af
MT
46 libselinux-devel
47 libtool
4990bf7f 48 libuuid-devel
802ea3af 49 pam-devel
2d01364a
SS
50 pciutils-devel
51 usbutils
53a325cb 52 vala
6793fec1 53 xz-devel
802ea3af
MT
54 end
55
56 configure_options += \
7f84cbd5
SS
57 --with-sysvinit-path= \
58 --with-sysvrcnd-path= \
59 --enable-introspection=yes \
2d01364a 60 --disable-static
802ea3af
MT
61
62 prepare_cmds
63 ./autogen.sh ac
64 end
65
802ea3af 66 install_cmds
755fe986
SS
67 # Create folder in log to store the journal.
68 mkdir -pv %{BUILDROOT}/var/log/journal
69
802ea3af 70 # Create sysv compatible symlinks.
6793fec1
MT
71 mkdir -pv %{BUILDROOT}%{sbindir}
72 ln -svf ../lib/systemd/systemd %{BUILDROOT}/%{sbindir}/init
73 ln -svf ../lib/systemd/systemd %{BUILDROOT}/%{bindir}/systemd
74 ln -svf ../bin/systemctl %{BUILDROOT}/%{sbindir}/reboot
75 ln -svf ../bin/systemctl %{BUILDROOT}/%{sbindir}/halt
76 ln -svf ../bin/systemctl %{BUILDROOT}/%{sbindir}/poweroff
77 ln -svf ../bin/systemctl %{BUILDROOT}/%{sbindir}/shutdown
802ea3af
MT
78
79 # Create empty machine-id file.
80 touch %{BUILDROOT}/etc/machine-id
81
82 # Copy locale and console settings
6793fec1
MT
83 mkdir -pv %{BUILDROOT}%{sysconfdir}
84 cp -vf %{DIR_SOURCE}/{locale,vconsole}.conf %{BUILDROOT}%{sysconfdir}
802ea3af
MT
85
86 # Recreate all targets
0976fbe4
SS
87 rm -rfv %{BUILDROOT}/%{sysconfdir}/systemd/system/*.target.wants
88 for i in basic.target.wants default.target.wants dbus.target.wants getty.target.wants \
89 multi-user.target.wants syslog.target.wants; do
90 mkdir -pv %{BUILDROOT}/%{sysconfdir}/systemd/system/${i} || exit 1
6793fec1 91 done
802ea3af
MT
92
93 # Remove runlevel targets and graphical.target
6793fec1
MT
94 rm -rfv %{BUILDROOT}%{unitdir}/runlevel*
95 rm -rfv %{BUILDROOT}%{unitdir}/graphical.target
802ea3af 96
2d01364a
SS
97 # Remove service files for utmp update.
98 rm -rvf %{BUILDROOT}%{unitdir}/systemd-update-utmp-*.service
99 rm -rvf %{BUILDROOT}%{unitdir}/shutdown.target.wants/systemd-update-utmp-*.service
100
802ea3af 101 # Set default target to multi-user
6793fec1 102 ln -svf multi-user.target %{BUILDROOT}%{unitdir}/default.target
802ea3af
MT
103
104 # Replace absolute symlinks by relative ones.
6793fec1 105 cd %{BUILDROOT}%{unitdir}/../user
7f84cbd5 106 for i in bluetooth local-fs paths printer remote-fs shutdown smartcard sockets sound swap timers; do
6793fec1
MT
107 ln -svf ../system/${i}.target ${i}.target || exit 1
108 done
109
802ea3af
MT
110 # Remove tmpfile for X11
111 rm -rfv %{BUILDROOT}/usr/lib/tmpfiles.d/x11.conf
112
7f84cbd5
SS
113 # Remove unneeded stuff for xdg
114 rm -rfv %{BUILDROOT}/etc/xdg
115
116 # Remove unneeded stuff for rpm.
117 rm -rvf %{BUILDROOT}/etc/rpm
755fe986
SS
118
119 # Use journald. Enable the import of kernel messages.
120 # Stop forwarding to a syslog daemon.
121 sed \
122 -e "s/^#ForwardToSyslog=.*$/ForwardToSyslog=no/" \
123 -e "s/^#ImportKernel=.*$/ImportKernel=yes/" \
124 -i %{BUILDROOT}/etc/systemd/journald.conf
f2ada565
SS
125
126 # Install legacy tmpfile to autocreate /run/lock on startup.
127 install -v -m 644 %{DIR_APP}/tmpfiles.d/legacy.conf %{BUILDROOT}%{prefix}/lib/tmpfiles.d/
802ea3af
MT
128 end
129end
130
131packages
132 package %{name}
2d01364a
SS
133 groups += Base
134
6793fec1
MT
135 prerequires += authconfig
136
514357ad
SS
137 requires
138 dbus
2d01364a 139 hwdata
514357ad 140 python-cairo
1d40b321 141 python-dbus
7f84cbd5 142 python-gobject3
214d8f27 143 %{name}-units=%{thisver}
514357ad
SS
144 util-linux>=2.19
145 end
1d40b321 146
216fde50
SS
147 provides
148 /bin/systemd
149 /sbin/halt
150 /sbin/init
151 /sbin/poweroff
152 /sbin/reboot
153 /sbin/shutdown
2d01364a 154
755fe986 155 syslog
2d01364a 156 udev = %{thisver}
216fde50
SS
157 end
158
6793fec1 159 conflicts
7f84cbd5 160 bash-completion < 2.1
2d01364a 161 dracut < 019
6793fec1 162 filesystem < 002
755fe986 163 rsyslog < 5.8.6-4
6793fec1
MT
164 upstart
165 end
ef438375 166
2d01364a
SS
167 obsoletes
168 udev < 183
169 end
170
171 configfiles
172 /etc/locale.conf
173 /etc/machine-id
174 /etc/systemd/journald.conf
175 /etc/systemd/logind.conf
176 /etc/systemd/system.conf
177 /etc/systemd/user.conf
178 /etc/udev/udev.conf
179 /etc/vconsole.conf
180 end
181
182 script prein
183 # Create groups for udev.
184 getent group cdrom >/dev/null || groupadd -g 11 cdrom || :
185 getent group tape >/dev/null || groupadd -g 33 tape || :
186 getent group dialout >/dev/null || groupadd -g 18 dialout || :
187 getent group floppy >/dev/null || groupadd -g 19 floppy || :
188 end
189
1d40b321
SS
190 script postin
191 # Generate Machine ID.
6793fec1 192 /usr/bin/systemd-machine-id-setup > /dev/null 2>&1 || :
1d40b321
SS
193
194 # Reexec systemd daemon.
6793fec1 195 /usr/bin/systemctl daemon-reexec > /dev/null 2>&1 || :
1d40b321
SS
196
197 # Make sure pam_systemd is enabled
6793fec1
MT
198 if ! grep -q pam_systemd /etc/pam.d/system-auth-ac ; then
199 authconfig --update --nostart >/dev/null 2>&1 || :
1d40b321
SS
200
201 # Try harder
6793fec1 202 grep -q pam_systemd /etc/pam.d/system-auth-ac || authconfig --updateall --nostart >/dev/null 2>&1 || :
1d40b321 203 fi
5e462903
MT
204
205 /usr/bin/systemctl enable \
206 getty@.service \
50affca1 207 remote-fs.target \
5e462903
MT
208 systemd-readahead-replay.service \
209 systemd-readahead-collect.service \
210 >/dev/null 2>&1 || :
1d40b321
SS
211 end
212
2d01364a
SS
213 script preup
214 # Be sure to stop the old udev before updating.
215 /usr/bin/systemctl stop udev.service udev-trigger.service \
216 udev-control.socket udev-kernel.socket >/dev/null 2>&1 || :
217 end
218
1d40b321
SS
219 script postup
220 # Restart login service after update
5e462903 221 /usr/bin/systemctl daemon-reload >/dev/null 2>&1 || :
6793fec1 222 /usr/bin/systemctl try-restart systemd-logind.service >/dev/null 2>&1 || :
755fe986
SS
223
224 # Use the new journald configuration file and restart the service.
225 if ! grep -xq ImportKernel=yes /etc/systemd/journald.conf ; then
226 mv /etc/systemd/journald.conf.paknew /etc/systemd/journald.conf
227 /usr/bin/systemctl restart systemd-journald.service >/dev/null 2>&1 || :
228 fi
1d40b321 229 end
2d01364a
SS
230
231 # Be sure to start the new udev after everything is done.
232 script posttransup
233 /usr/bin/systemctl start systemd-udev.service >/dev/null 2>&1 || :
234 end
802ea3af 235 end
1f9bc2f0 236
802ea3af
MT
237 # Package information for systemd-units
238 package %{name}-units
239 summary = Configuration files, directories and installation tool for systemd.
240 description
241 This package contains all needed configuration files, directories
242 and installation / configuration tool for systemd.
243 end
1f9bc2f0 244
5e38e9bb
SS
245 prerequires
246 /bin/sh
247 coreutils
248 end
249
6793fec1 250 provides
802ea3af 251 /bin/systemctl
802ea3af 252 end
1d40b321 253
6793fec1
MT
254 conflicts
255 filesystem < 002
1d40b321
SS
256 end
257
6793fec1
MT
258 files
259 %{sysconfdir}/etc/systemd/system
260 %{sysconfdir}/tmpfiles.d
261 %{sysconfdir}/bash_completion.d/systemctl-bash-completion.sh
262 %{unitdir}
263 %{bindir}/systemctl
264 %{bindir}/systemd-tmpfiles
265 %{mandir}/man1/systemctl.*
1d40b321
SS
266 end
267
268 script postup
269 # Reload service files
6793fec1 270 /usr/bin/systemctl daemon-reload > /dev/null 2>&1 || :
1d40b321 271 end
802ea3af 272 end
1f9bc2f0 273
1191e383
SS
274 package %{name}-libs
275 template LIBS
276 end
277
802ea3af
MT
278 package %{name}-devel
279 template DEVEL
6793fec1
MT
280
281 files += %{prefix}/lib/pakfire/macros/
802ea3af 282 end
1f9bc2f0 283
2d01364a
SS
284 package libudev
285 summary = Libraries for adding libudev support to applications.
286 description
287 This package contains the libraries that make it easier to use libudev
288 functionality from applications.
289 end
290 license = LGPLv2+
291
292 conflicts
293 filesystem < 002
294 end
295
296 files
1191e383 297 %{libdir}/lib*udev*.so.*
2d01364a
SS
298 %{libidr}/girepository*/
299 end
300 end
301
302 package libudev-devel
303 summary = Header files for adding libudev support to applications.
304 description
305 This package contains the header and pkg-config files for developing
306 applications using libudev functionality.
307 end
308 license = LGPLv2+
309
310 conflicts
311 filesystem < 002
312 end
313
314 files
a8aa3ead 315 %{libdir}/lib*udev*.so
73eb4724 316 %{libdir}/pkgconfig/lib*udev.pc
2d01364a 317 %{libdir}/pkgconfig/gudev*
a8aa3ead 318 %{includedir}/lib*udev.h
2d01364a
SS
319 %{includedir}/gudev*
320 %{datadir}/gir-*
321 %{datadir}/gtk-doc/html/gudev
322 end
323 end
324
1f9bc2f0
MT
325 package %{name}-debuginfo
326 template DEBUGINFO
327 end
802ea3af 328end