]> git.ipfire.org Git - people/ms/ipfire-3.x.git/blob - systemd/systemd.nm
systemd: Remove udev rules for "predictable" network device names
[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 = 5
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
129 # Remove udev rules for "predictable" network device renaming.
130 # http://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames/
131 rm -vf %{BUILDROOT}/usr/lib/udev/rules.d/80-net-name-slot.rules
132 end
133 end
134
135 packages
136 package %{name}
137 groups += Base
138
139 prerequires += authconfig
140
141 requires
142 dbus
143 hwdata
144 python-cairo
145 python-dbus
146 python-gobject3
147 %{name}-libs=%{thisver}
148 %{name}-units=%{thisver}
149 util-linux>=2.19
150 end
151
152 provides
153 /bin/systemd
154 /sbin/halt
155 /sbin/init
156 /sbin/poweroff
157 /sbin/reboot
158 /sbin/shutdown
159
160 syslog
161 udev = %{thisver}
162 end
163
164 conflicts
165 bash-completion < 2.1
166 dracut < 019
167 filesystem < 002
168 rsyslog < 5.8.6-4
169 upstart
170 end
171
172 obsoletes
173 udev < 183
174 end
175
176 configfiles
177 /etc/locale.conf
178 /etc/machine-id
179 /etc/systemd/journald.conf
180 /etc/systemd/logind.conf
181 /etc/systemd/system.conf
182 /etc/systemd/user.conf
183 /etc/udev/udev.conf
184 /etc/vconsole.conf
185 end
186
187 script prein
188 # Create groups for udev.
189 getent group cdrom >/dev/null || groupadd -g 11 cdrom || :
190 getent group tape >/dev/null || groupadd -g 33 tape || :
191 getent group dialout >/dev/null || groupadd -g 18 dialout || :
192 getent group floppy >/dev/null || groupadd -g 19 floppy || :
193 end
194
195 script postin
196 # Generate Machine ID.
197 /usr/bin/systemd-machine-id-setup > /dev/null 2>&1 || :
198
199 # Reexec systemd daemon.
200 /usr/bin/systemctl daemon-reexec > /dev/null 2>&1 || :
201
202 # Make sure pam_systemd is enabled
203 if ! grep -q pam_systemd /etc/pam.d/system-auth-ac ; then
204 authconfig --update --nostart >/dev/null 2>&1 || :
205
206 # Try harder
207 grep -q pam_systemd /etc/pam.d/system-auth-ac || authconfig --updateall --nostart >/dev/null 2>&1 || :
208 fi
209
210 /usr/bin/systemctl enable \
211 getty@.service \
212 remote-fs.target \
213 systemd-readahead-replay.service \
214 systemd-readahead-collect.service \
215 >/dev/null 2>&1 || :
216 end
217
218 script preup
219 # Be sure to stop the old udev before updating.
220 /usr/bin/systemctl stop udev.service udev-trigger.service \
221 udev-control.socket udev-kernel.socket >/dev/null 2>&1 || :
222 end
223
224 script postup
225 # Restart login service after update
226 /usr/bin/systemctl daemon-reload >/dev/null 2>&1 || :
227 /usr/bin/systemctl try-restart systemd-logind.service >/dev/null 2>&1 || :
228
229 # Use the new journald configuration file and restart the service.
230 if ! grep -xq ImportKernel=yes /etc/systemd/journald.conf ; then
231 mv /etc/systemd/journald.conf.paknew /etc/systemd/journald.conf
232 /usr/bin/systemctl restart systemd-journald.service >/dev/null 2>&1 || :
233 fi
234 end
235
236 # Be sure to start the new udev after everything is done.
237 script posttransup
238 /usr/bin/systemctl start systemd-udev.service >/dev/null 2>&1 || :
239 end
240 end
241
242 # Package information for systemd-units
243 package %{name}-units
244 summary = Configuration files, directories and installation tool for systemd.
245 description
246 This package contains all needed configuration files, directories
247 and installation / configuration tool for systemd.
248 end
249
250 prerequires
251 /bin/sh
252 coreutils
253 end
254
255 provides
256 /bin/systemctl
257 end
258
259 conflicts
260 filesystem < 002
261 end
262
263 files
264 %{sysconfdir}/etc/systemd/system
265 %{sysconfdir}/tmpfiles.d
266 %{sysconfdir}/bash_completion.d/systemctl-bash-completion.sh
267 %{unitdir}
268 %{bindir}/systemctl
269 %{bindir}/systemd-tmpfiles
270 %{mandir}/man1/systemctl.*
271 end
272
273 script postup
274 # Reload service files
275 /usr/bin/systemctl daemon-reload > /dev/null 2>&1 || :
276 end
277 end
278
279 package %{name}-libs
280 template LIBS
281
282 groups += Base
283
284 prerequires
285 /etc/nsswitch.conf
286 end
287
288 provides
289 nss-myhostname = %{thisver}
290 end
291
292 obsoletes
293 nss-myhostname <= 0.3-3
294 end
295
296 conflicts
297 # Ensure that the version of systemd matches systemd-libs.
298 systemd > %{thisver}
299 systemd < %{thisver}
300 end
301
302 # Add myhostname to the hosts line of /etc/nsswitch.conf
303 script postin
304 if [ -f "/etc/nsswitch.conf" ]; then
305 sed -i.bak -e '
306 /^hosts:/ !b
307 /\<myhostname\>/ b
308 s/[[:blank:]]*$/ myhostname/
309 ' /etc/nsswitch.conf
310 fi
311 end
312
313 # Remove myhostname from the hosts line of /etc/nsswitch.conf
314 script postun
315 if [ -f "/etc/nsswitch.conf" ]; then
316 sed -i.bak -e '
317 /^hosts:/ !b
318 s/[[:blank:]]\+myhostname\>//
319 ' /etc/nsswitch.conf
320 fi
321 end
322 end
323
324 package %{name}-devel
325 template DEVEL
326
327 files += %{prefix}/lib/pakfire/macros/
328 end
329
330 package libudev
331 summary = Libraries for adding libudev support to applications.
332 description
333 This package contains the libraries that make it easier to use libudev
334 functionality from applications.
335 end
336 license = LGPLv2+
337
338 conflicts
339 filesystem < 002
340 end
341
342 files
343 %{libdir}/lib*udev*.so.*
344 %{libidr}/girepository*/
345 end
346 end
347
348 package libudev-devel
349 summary = Header files for adding libudev support to applications.
350 description
351 This package contains the header and pkg-config files for developing
352 applications using libudev functionality.
353 end
354 license = LGPLv2+
355
356 conflicts
357 filesystem < 002
358 end
359
360 files
361 %{libdir}/lib*udev*.so
362 %{libdir}/pkgconfig/lib*udev.pc
363 %{libdir}/pkgconfig/gudev*
364 %{includedir}/lib*udev.h
365 %{includedir}/gudev*
366 %{datadir}/gir-*
367 %{datadir}/gtk-doc/html/gudev
368 end
369 end
370
371 package %{name}-debuginfo
372 template DEBUGINFO
373 end
374 end