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