]> git.ipfire.org Git - people/stevee/ipfire-3.x.git/blob - systemd/systemd.nm
Merge remote-tracking branch 'stevee/bash-comletion'
[people/stevee/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 = 215
8 release = 1
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 >= 15
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-networkd \
61 --disable-resolvd \
62 --disable-sysusers \
63 --disable-timesyncd \
64 --disable-static
65
66 prepare_cmds
67 ./autogen.sh ac
68 end
69
70 install_cmds
71 # Create folder in log to store the journal.
72 mkdir -pv %{BUILDROOT}/var/log/journal
73
74 # Create sysv compatible symlinks.
75 mkdir -pv %{BUILDROOT}%{sbindir}
76 ln -svf ../lib/systemd/systemd %{BUILDROOT}/%{sbindir}/init
77 ln -svf ../lib/systemd/systemd %{BUILDROOT}/%{bindir}/systemd
78 ln -svf ../bin/systemctl %{BUILDROOT}/%{sbindir}/reboot
79 ln -svf ../bin/systemctl %{BUILDROOT}/%{sbindir}/halt
80 ln -svf ../bin/systemctl %{BUILDROOT}/%{sbindir}/poweroff
81 ln -svf ../bin/systemctl %{BUILDROOT}/%{sbindir}/shutdown
82
83 # Create empty machine-id file.
84 touch %{BUILDROOT}/etc/machine-id
85
86 # Copy locale and console settings
87 mkdir -pv %{BUILDROOT}%{sysconfdir}
88 cp -vf %{DIR_SOURCE}/{locale,vconsole}.conf %{BUILDROOT}%{sysconfdir}
89
90 # Recreate all targets
91 rm -rfv %{BUILDROOT}/%{sysconfdir}/systemd/system/*.target.wants
92 for i in basic.target.wants default.target.wants dbus.target.wants getty.target.wants \
93 multi-user.target.wants syslog.target.wants; do
94 mkdir -pv %{BUILDROOT}/%{sysconfdir}/systemd/system/${i} || exit 1
95 done
96
97 # Remove runlevel targets and graphical.target
98 rm -rfv %{BUILDROOT}%{unitdir}/runlevel*
99 rm -rfv %{BUILDROOT}%{unitdir}/graphical.target
100
101 # Remove service files for utmp update.
102 rm -rvf %{BUILDROOT}%{unitdir}/systemd-update-utmp-*.service
103 rm -rvf %{BUILDROOT}%{unitdir}/shutdown.target.wants/systemd-update-utmp-*.service
104
105 # Set default target to multi-user
106 ln -svf multi-user.target %{BUILDROOT}%{unitdir}/default.target
107
108 # Replace absolute symlinks by relative ones.
109 cd %{BUILDROOT}%{unitdir}/../user
110 for i in bluetooth local-fs paths printer remote-fs shutdown smartcard sockets sound swap timers; do
111 ln -svf ../system/${i}.target ${i}.target || exit 1
112 done
113
114 # Remove tmpfile for X11
115 rm -rfv %{BUILDROOT}/usr/lib/tmpfiles.d/x11.conf
116
117 # Remove unneeded stuff for xdg
118 rm -rfv %{BUILDROOT}/etc/xdg
119
120 # Remove unneeded stuff for rpm.
121 rm -rvf %{BUILDROOT}/etc/rpm
122
123 # Use journald. Enable the import of kernel messages.
124 # Stop forwarding to a syslog daemon.
125 sed \
126 -e "s/^#ForwardToSyslog=.*$/ForwardToSyslog=no/" \
127 -e "s/^#ImportKernel=.*$/ImportKernel=yes/" \
128 -i %{BUILDROOT}/etc/systemd/journald.conf
129
130 # Install legacy tmpfile to autocreate /run/lock on startup.
131 install -v -m 644 %{DIR_APP}/tmpfiles.d/legacy.conf %{BUILDROOT}%{prefix}/lib/tmpfiles.d/
132
133 # Remove udev rules for "predictable" network device renaming.
134 # http://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames/
135 rm -vf %{BUILDROOT}/usr/lib/udev/rules.d/80-net-name-slot.rules
136 end
137 end
138
139 packages
140 package %{name}
141 groups += Base
142
143 prerequires += authconfig
144
145 requires
146 dbus
147 hwdata
148 python-cairo
149 python-dbus
150 python-gobject3
151 %{name}-libs=%{thisver}
152 %{name}-units=%{thisver}
153 util-linux>=2.19
154 end
155
156 provides
157 /bin/systemd
158 /sbin/halt
159 /sbin/init
160 /sbin/poweroff
161 /sbin/reboot
162 /sbin/shutdown
163
164 syslog
165 udev = %{thisver}
166 end
167
168 conflicts
169 bash-completion < 2.1
170 dracut < 019
171 filesystem < 002
172 rsyslog < 5.8.6-4
173 upstart
174 end
175
176 obsoletes
177 udev < 183
178 end
179
180 configfiles
181 /etc/locale.conf
182 /etc/machine-id
183 /etc/systemd/journald.conf
184 /etc/systemd/logind.conf
185 /etc/systemd/system.conf
186 /etc/systemd/user.conf
187 /etc/udev/udev.conf
188 /etc/vconsole.conf
189 end
190
191 script prein
192 # Create groups for udev.
193 getent group cdrom >/dev/null || groupadd -g 11 cdrom || :
194 getent group tape >/dev/null || groupadd -g 33 tape || :
195 getent group dialout >/dev/null || groupadd -g 18 dialout || :
196 getent group floppy >/dev/null || groupadd -g 19 floppy || :
197 end
198
199 script postin
200 # Generate Machine ID.
201 /usr/bin/systemd-machine-id-setup > /dev/null 2>&1 || :
202
203 # Reexec systemd daemon.
204 /usr/bin/systemctl daemon-reexec > /dev/null 2>&1 || :
205
206 # Make sure pam_systemd is enabled
207 if ! grep -q pam_systemd /etc/pam.d/system-auth-ac ; then
208 authconfig --update --nostart >/dev/null 2>&1 || :
209
210 # Try harder
211 grep -q pam_systemd /etc/pam.d/system-auth-ac || authconfig --updateall --nostart >/dev/null 2>&1 || :
212 fi
213
214 /usr/bin/systemctl enable \
215 getty@.service \
216 remote-fs.target \
217 systemd-readahead-replay.service \
218 systemd-readahead-collect.service \
219 >/dev/null 2>&1 || :
220 end
221
222 script preup
223 # Be sure to stop the old udev before updating.
224 /usr/bin/systemctl stop udev.service udev-trigger.service \
225 udev-control.socket udev-kernel.socket >/dev/null 2>&1 || :
226 end
227
228 script postup
229 # Restart login service after update
230 /usr/bin/systemctl daemon-reload >/dev/null 2>&1 || :
231 /usr/bin/systemctl try-restart systemd-logind.service >/dev/null 2>&1 || :
232
233 # Use the new journald configuration file and restart the service.
234 if ! grep -xq ImportKernel=yes /etc/systemd/journald.conf ; then
235 mv /etc/systemd/journald.conf.paknew /etc/systemd/journald.conf
236 /usr/bin/systemctl restart systemd-journald.service >/dev/null 2>&1 || :
237 fi
238 end
239
240 # Be sure to start the new udev after everything is done.
241 script posttransup
242 /usr/bin/systemctl start systemd-udev.service >/dev/null 2>&1 || :
243 end
244 end
245
246 # Package information for systemd-units
247 package %{name}-units
248 summary = Configuration files, directories and installation tool for systemd.
249 description
250 This package contains all needed configuration files, directories
251 and installation / configuration tool for systemd.
252 end
253
254 prerequires
255 /bin/sh
256 coreutils
257 end
258
259 provides
260 /bin/systemctl
261 end
262
263 conflicts
264 filesystem < 002
265 end
266
267 files
268 %{sysconfdir}/etc/systemd/system
269 %{sysconfdir}/tmpfiles.d
270 %{sysconfdir}/bash_completion.d/systemctl-bash-completion.sh
271 %{unitdir}
272 %{bindir}/systemctl
273 %{bindir}/systemd-tmpfiles
274 %{mandir}/man1/systemctl.*
275 end
276
277 script postup
278 # Reload service files
279 /usr/bin/systemctl daemon-reload > /dev/null 2>&1 || :
280 end
281 end
282
283 package %{name}-libs
284 template LIBS
285
286 groups += Base
287
288 prerequires
289 /etc/nsswitch.conf
290 end
291
292 provides
293 nss-myhostname = %{thisver}
294 end
295
296 obsoletes
297 nss-myhostname <= 0.3-3
298 end
299
300 conflicts
301 # Ensure that the version of systemd matches systemd-libs.
302 systemd > %{thisver}
303 systemd < %{thisver}
304 end
305
306 # Add myhostname to the hosts line of /etc/nsswitch.conf
307 script postin
308 if [ -f "/etc/nsswitch.conf" ]; then
309 sed -i.bak -e '
310 /^hosts:/ !b
311 /\<myhostname\>/ b
312 s/[[:blank:]]*$/ myhostname/
313 ' /etc/nsswitch.conf
314 fi
315 end
316
317 # Remove myhostname from the hosts line of /etc/nsswitch.conf
318 script postun
319 if [ -f "/etc/nsswitch.conf" ]; then
320 sed -i.bak -e '
321 /^hosts:/ !b
322 s/[[:blank:]]\+myhostname\>//
323 ' /etc/nsswitch.conf
324 fi
325 end
326 end
327
328 package %{name}-devel
329 template DEVEL
330
331 files += %{prefix}/lib/pakfire/macros/
332 end
333
334 package libudev
335 summary = Libraries for adding libudev support to applications.
336 description
337 This package contains the libraries that make it easier to use libudev
338 functionality from applications.
339 end
340 license = LGPLv2+
341
342 conflicts
343 filesystem < 002
344 end
345
346 files
347 %{libdir}/lib*udev*.so.*
348 %{libidr}/girepository*/
349 end
350 end
351
352 package libudev-devel
353 summary = Header files for adding libudev support to applications.
354 description
355 This package contains the header and pkg-config files for developing
356 applications using libudev functionality.
357 end
358 license = LGPLv2+
359
360 conflicts
361 filesystem < 002
362 end
363
364 files
365 %{libdir}/lib*udev*.so
366 %{libdir}/pkgconfig/lib*udev.pc
367 %{libdir}/pkgconfig/gudev*
368 %{includedir}/lib*udev.h
369 %{includedir}/gudev*
370 %{datadir}/gir-*
371 %{datadir}/gtk-doc/html/gudev
372 end
373 end
374
375 package %{name}-debuginfo
376 template DEBUGINFO
377 end
378 end