chiark / gitweb /
dbus: shut down bus connection cleanly and fully when a direct client disconnects
[elogind.git] / Makefile.am
1 #  This file is part of systemd.
2 #
3 #  Copyright 2010 Lennart Poettering
4 #
5 #  systemd is free software; you can redistribute it and/or modify it
6 #  under the terms of the GNU General Public License as published by
7 #  the Free Software Foundation; either version 2 of the License, or
8 #  (at your option) any later version.
9 #
10 #  systemd is distributed in the hope that it will be useful, but
11 #  WITHOUT ANY WARRANTY; without even the implied warranty of
12 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 #  General Public License for more details.
14 #
15 #  You should have received a copy of the GNU General Public License
16 #  along with systemd; If not, see <http://www.gnu.org/licenses/>.
17
18 ACLOCAL_AMFLAGS = -I m4
19
20 # Dirs of external packages
21 dbuspolicydir=@dbuspolicydir@
22 dbussessionservicedir=@dbussessionservicedir@
23 dbussystemservicedir=@dbussystemservicedir@
24 dbusinterfacedir=@dbusinterfacedir@
25 udevrulesdir=@udevrulesdir@
26 pamlibdir=@pamlibdir@
27 pkgconfigdatadir=$(datadir)/pkgconfig
28
29 # Our own, non-special dirs
30 pkgsysconfdir=$(sysconfdir)/systemd
31 sessionunitdir=$(pkgdatadir)/session
32
33 # And these are the special ones for /
34 rootdir=@rootdir@
35 rootbindir=$(rootdir)/bin
36 rootlibexecdir=$(rootdir)/lib/systemd
37 systemunitdir=$(rootdir)/lib/systemd/system
38
39 AM_CPPFLAGS = \
40         -include $(top_builddir)/config.h \
41         -DSYSTEM_CONFIG_FILE=\"$(pkgsysconfdir)/system.conf\" \
42         -DSYSTEM_CONFIG_UNIT_PATH=\"$(pkgsysconfdir)/system\" \
43         -DSYSTEM_DATA_UNIT_PATH=\"$(systemunitdir)\" \
44         -DSYSTEM_SYSVINIT_PATH=\"$(SYSTEM_SYSVINIT_PATH)\" \
45         -DSYSTEM_SYSVRCND_PATH=\"$(SYSTEM_SYSVRCND_PATH)\" \
46         -DSESSION_CONFIG_FILE=\"$(pkgsysconfdir)/session.conf\" \
47         -DSESSION_CONFIG_UNIT_PATH=\"$(pkgsysconfdir)/session\" \
48         -DSESSION_DATA_UNIT_PATH=\"$(sessionunitdir)\" \
49         -DCGROUP_AGENT_PATH=\"$(rootlibexecdir)/systemd-cgroups-agent\" \
50         -DSYSTEMD_BINARY_PATH=\"$(rootbindir)/systemd\" \
51         -DSYSTEMCTL_BINARY_PATH=\"$(rootbindir)/systemctl\" \
52         -DRUNTIME_DIR=\"$(localstatedir)/run\" \
53         -I $(top_srcdir)/src
54
55 rootbin_PROGRAMS = \
56         systemd \
57         systemctl \
58         systemd-notify
59
60 bin_PROGRAMS = \
61         systemd-install
62
63 if HAVE_GTK
64 bin_PROGRAMS += \
65         systemadm
66 endif
67
68 rootlibexec_PROGRAMS = \
69         systemd-logger \
70         systemd-cgroups-agent \
71         systemd-initctl
72
73 noinst_PROGRAMS = \
74         test-engine \
75         test-job-type \
76         test-ns \
77         test-loopback \
78         test-daemon \
79         test-cgroup
80
81 if HAVE_PAM
82 pamlib_LTLIBRARIES = \
83         pam_systemd.la
84 endif
85
86 dist_pkgsysconf_DATA = \
87         src/system.conf
88
89 dist_dbuspolicy_DATA = \
90         src/org.freedesktop.systemd1.conf
91
92 dist_dbussystemservice_DATA = \
93         src/org.freedesktop.systemd1.service
94
95 dist_udevrules_DATA = \
96         src/99-systemd.rules
97
98 dbusinterface_DATA = \
99         org.freedesktop.systemd1.Manager.xml \
100         org.freedesktop.systemd1.Job.xml \
101         org.freedesktop.systemd1.Unit.xml \
102         org.freedesktop.systemd1.Service.xml \
103         org.freedesktop.systemd1.Socket.xml \
104         org.freedesktop.systemd1.Timer.xml \
105         org.freedesktop.systemd1.Target.xml \
106         org.freedesktop.systemd1.Device.xml \
107         org.freedesktop.systemd1.Mount.xml \
108         org.freedesktop.systemd1.Automount.xml \
109         org.freedesktop.systemd1.Snapshot.xml \
110         org.freedesktop.systemd1.Swap.xml \
111         org.freedesktop.systemd1.Path.xml
112
113 dist_systemunit_DATA = \
114         units/emergency.service \
115         units/basic.target \
116         units/getty.target \
117         units/halt.target \
118         units/local-fs.target \
119         units/network.target \
120         units/nss-lookup.target \
121         units/mail-transfer-agent.target \
122         units/poweroff.target \
123         units/reboot.target \
124         units/rescue.target \
125         units/rpcbind.target \
126         units/rtc-set.target \
127         units/shutdown.target \
128         units/sigpwr.target \
129         units/sockets.target \
130         units/swap.target \
131         units/systemd-initctl.socket \
132         units/systemd-logger.socket \
133         units/dev-hugepages.automount \
134         units/dev-hugepages.mount \
135         units/dev-mqueue.automount \
136         units/dev-mqueue.mount \
137         units/proc-sys-fs-binfmt_misc.automount \
138         units/proc-sys-fs-binfmt_misc.mount \
139         units/sys-kernel-debug.automount \
140         units/sys-kernel-debug.mount \
141         units/sys-kernel-security.automount \
142         units/sys-kernel-security.mount \
143         units/var-lock.mount \
144         units/var-run.mount
145
146 nodist_systemunit_DATA = \
147         units/sysinit.target \
148         units/getty@.service \
149         units/graphical.target \
150         units/remote-fs.target \
151         units/multi-user.target \
152         units/systemd-initctl.service \
153         units/systemd-logger.service \
154         units/syslog.target \
155         units/dbus.target
156
157 dist_sessionunit_DATA = \
158         units/session/default.target
159
160 nodist_sessionunit_DATA = \
161         units/session/remote-fs.target \
162         units/session/exit.service
163
164 EXTRA_DIST = \
165         units/sysinit.target.m4 \
166         units/getty@.service.m4 \
167         units/graphical.target.m4 \
168         units/multi-user.target.m4 \
169         units/remote-fs.target.m4 \
170         units/systemd-initctl.service.in \
171         units/systemd-logger.service.in \
172         units/syslog.target.in \
173         units/dbus.target.in \
174         units/session/exit.service.in \
175         systemd.pc.in
176
177 if TARGET_FEDORA
178 dist_systemunit_DATA += \
179         units/fedora/halt.service \
180         units/fedora/killall.service \
181         units/fedora/poweroff.service \
182         units/fedora/prefdm.service \
183         units/fedora/rc-local.service \
184         units/fedora/reboot.service \
185         units/fedora/sysinit.service
186 endif
187
188 if TARGET_SUSE
189 dist_systemunit_DATA += \
190         units/suse/halt.service \
191         units/suse/poweroff.service \
192         units/suse/reboot.service
193 endif
194
195 if TARGET_GENTOO
196 dist_systemunit_DATA += \
197         units/gentoo/halt.service \
198         units/gentoo/killall.service \
199         units/gentoo/poweroff.service \
200         units/gentoo/reboot.service \
201         units/gentoo/xdm.service
202 endif
203
204 if TARGET_ARCH
205 dist_systemunit_DATA += \
206         units/arch/sysinit.service \
207         units/arch/rc-local.service \
208         units/arch/halt.service \
209         units/arch/poweroff.service \
210         units/arch/reboot.service
211 endif
212
213 dist_doc_DATA = \
214         README \
215         LICENSE \
216         DISTRO_PORTING \
217         src/sd-daemon.h \
218         src/sd-daemon.c
219
220 pkgconfigdata_DATA = \
221         systemd.pc
222
223 noinst_LTLIBRARIES = \
224         libsystemd-basic.la \
225         libsystemd-core.la
226
227 libsystemd_basic_la_SOURCES = \
228         src/util.c \
229         src/hashmap.c \
230         src/set.c \
231         src/strv.c \
232         src/conf-parser.c \
233         src/socket-util.c \
234         src/log.c \
235         src/ratelimit.c
236
237 libsystemd_core_la_SOURCES = \
238         src/unit.c \
239         src/job.c \
240         src/manager.c \
241         src/path-lookup.c \
242         src/load-fragment.c \
243         src/service.c \
244         src/automount.c \
245         src/mount.c \
246         src/swap.c \
247         src/device.c \
248         src/target.c \
249         src/snapshot.c \
250         src/socket.c \
251         src/timer.c \
252         src/path.c \
253         src/load-dropin.c \
254         src/execute.c \
255         src/dbus.c \
256         src/dbus-manager.c \
257         src/dbus-unit.c \
258         src/dbus-job.c \
259         src/dbus-service.c \
260         src/dbus-socket.c \
261         src/dbus-timer.c \
262         src/dbus-target.c \
263         src/dbus-mount.c \
264         src/dbus-automount.c \
265         src/dbus-swap.c \
266         src/dbus-snapshot.c \
267         src/dbus-device.c \
268         src/dbus-execute.c \
269         src/dbus-path.c \
270         src/cgroup.c \
271         src/mount-setup.c \
272         src/hostname-setup.c \
273         src/loopback-setup.c \
274         src/kmod-setup.c \
275         src/modprobe-setup.c \
276         src/utmp-wtmp.c \
277         src/specifier.c \
278         src/unit-name.c \
279         src/fdset.c \
280         src/namespace.c \
281         src/tcpwrap.c \
282         src/cgroup-util.c
283
284 libsystemd_core_la_CFLAGS = \
285         $(AM_CFLAGS) \
286         $(DBUS_CFLAGS) \
287         $(UDEV_CFLAGS) \
288         $(CGROUP_CFLAGS)
289
290 libsystemd_core_la_LIBADD = \
291         libsystemd-basic.la \
292         $(DBUS_LIBS) \
293         $(UDEV_LIBS) \
294         $(CGROUP_LIBS) \
295         $(LIBWRAP_LIBS) \
296         $(PAM_LIBS)
297
298 # This is needed because automake is buggy in how it generates the
299 # rules for C programs, but not Vala programs.  We therefore can't
300 # list the .h files as dependencies if we want make dist to work.
301
302 EXTRA_DIST += \
303         ${libsystemd_basic_la_SOURCES:.c=.h} \
304         ${libsystemd_core_la_SOURCES:.c=.h} \
305         src/macro.h \
306         src/ioprio.h \
307         src/missing.h \
308         src/list.h \
309         src/securebits.h \
310         src/linux/auto_dev-ioctl.h \
311         src/initreq.h \
312         src/sd-daemon.h \
313         src/special.h \
314         src/dbus-common.h
315
316 MANPAGES = \
317         man/systemd.1 \
318         man/systemctl.1 \
319         man/systemadm.1 \
320         man/systemd-install.1 \
321         man/systemd-notify.1 \
322         man/sd_notify.3 \
323         man/sd_booted.3 \
324         man/sd_listen_fds.3 \
325         man/sd_is_fifo.3 \
326         man/systemd.unit.5 \
327         man/systemd.service.5 \
328         man/systemd.socket.5 \
329         man/systemd.mount.5 \
330         man/systemd.automount.5 \
331         man/systemd.swap.5 \
332         man/systemd.timer.5 \
333         man/systemd.path.5 \
334         man/systemd.target.5 \
335         man/systemd.device.5 \
336         man/systemd.snapshot.5 \
337         man/systemd.exec.5 \
338         man/daemon.7 \
339         man/sd-daemon.7 \
340         man/runlevel.8 \
341         man/telinit.8 \
342         man/halt.8 \
343         man/shutdown.8 \
344         man/pam_systemd.8 \
345         man/systemd.conf.5
346
347 MANPAGES_ALIAS = \
348         man/reboot.8 \
349         man/poweroff.8 \
350         man/sd_is_socket.3 \
351         man/sd_is_socket_unix.3 \
352         man/sd_is_socket_inet.3 \
353         man/sd_notifyf.3 \
354         man/init.1
355
356 man/reboot.8: man/halt.8
357 man/poweroff.8: man/halt.8
358 man/sd_is_socket.3: man/sd_is_fifo.3
359 man/sd_is_socket_unix.3: man/sd_is_fifo.3
360 man/sd_is_socket_inet.3: man/sd_is_fifo.3
361 man/sd_notifyf.3: man/sd_notify.3
362 man/init.1: man/systemd.1
363
364 dist_man_MANS = \
365         $(MANPAGES) \
366         $(MANPAGES_ALIAS)
367
368 nodist_man_MANS = \
369         man/systemd.special.7
370
371 XML_FILES = \
372         ${patsubst %.1,%.xml,${patsubst %.3,%.xml,${patsubst %.5,%.xml,${patsubst %.7,%.xml,${patsubst %.8,%.xml,$(MANPAGES)}}}}}
373
374 XML_IN_FILES = \
375         ${patsubst %.1,%.xml.in,${patsubst %.3,%.xml.in,${patsubst %.5,%.xml.in,${patsubst %.7,%.xml.in,${patsubst %.8,%.xml.in,$(nodist_man_MANS)}}}}}
376
377 dist_noinst_DATA = \
378         ${XML_FILES:.xml=.html}
379
380 nodist_noinst_DATA = \
381         ${XML_IN_FILES:.xml.in=.html}
382
383 EXTRA_DIST += \
384         $(XML_FILES) \
385         $(XML_IN_FILES) \
386         ${nodist_man_MANS:=.in} \
387         ${XML_IN_FILES:.xml.in=.html.in}
388
389 systemd_SOURCES = \
390         src/main.c
391
392 systemd_CFLAGS = \
393         $(AM_CFLAGS) \
394         $(DBUS_CFLAGS) \
395         $(UDEV_CFLAGS) \
396         $(CGROUP_CFLAGS)
397
398 systemd_LDADD = \
399         libsystemd-core.la
400
401 test_engine_SOURCES = \
402         src/test-engine.c
403
404 test_engine_CFLAGS = $(systemd_CFLAGS)
405 test_engine_LDADD = $(systemd_LDADD)
406
407 test_job_type_SOURCES = \
408         src/test-job-type.c
409
410 test_job_type_CFLAGS = $(systemd_CFLAGS)
411 test_job_type_LDADD = $(systemd_LDADD)
412
413 test_ns_SOURCES = \
414         src/test-ns.c
415
416 test_ns_CFLAGS = $(systemd_CFLAGS)
417 test_ns_LDADD = $(systemd_LDADD)
418
419 test_loopback_SOURCES = \
420         src/test-loopback.c \
421         src/loopback-setup.c
422
423 test_loopback_LDADD = \
424         libsystemd-basic.la
425
426 test_daemon_SOURCES = \
427         src/test-daemon.c \
428         src/sd-daemon.c
429
430 test_daemon_LDADD = \
431         libsystemd-basic.la
432
433 test_cgroup_SOURCES = \
434         src/test-cgroup.c \
435         src/cgroup-util.c
436
437 test_cgroup_CFLAGS = \
438         $(AM_CFLAGS) \
439         $(CGROUP_CFLAGS)
440
441 test_cgroup_LDADD = \
442         libsystemd-basic.la \
443         $(CGROUP_LIBS)
444
445 systemd_logger_SOURCES = \
446         src/logger.c \
447         src/sd-daemon.c \
448         src/tcpwrap.c
449
450 systemd_logger_LDADD = \
451         libsystemd-basic.la \
452         $(LIBWRAP_LIBS)
453
454 systemd_initctl_SOURCES = \
455         src/initctl.c \
456         src/sd-daemon.c \
457         src/dbus-common.c
458
459 systemd_initctl_CFLAGS = \
460         $(AM_CFLAGS) \
461         $(DBUS_CFLAGS)
462
463 systemd_initctl_LDADD = \
464         libsystemd-basic.la \
465         $(DBUS_LIBS)
466
467 systemd_cgroups_agent_SOURCES = \
468         src/cgroups-agent.c
469
470 systemd_cgroups_agent_CFLAGS = \
471         $(AM_CFLAGS) \
472         $(DBUS_CFLAGS)
473
474 systemd_cgroups_agent_LDADD = \
475         libsystemd-basic.la \
476         $(DBUS_LIBS)
477
478 systemctl_SOURCES = \
479         src/systemctl.c \
480         src/utmp-wtmp.c \
481         src/dbus-common.c
482
483 systemctl_CFLAGS = \
484         $(AM_CFLAGS) \
485         $(DBUS_CFLAGS)
486
487 systemctl_LDADD = \
488         libsystemd-basic.la \
489         $(DBUS_LIBS)
490
491 systemd_notify_SOURCES = \
492         src/notify.c \
493         src/sd-daemon.c
494
495 systemd_notify_LDADD = \
496         libsystemd-basic.la
497
498 systemd_install_SOURCES = \
499         src/install.c \
500         src/path-lookup.c \
501         src/dbus-common.c
502
503 systemd_install_LDADD = \
504         libsystemd-basic.la \
505         $(DBUS_LIBS)
506
507 systemd_install_CFLAGS = \
508         $(AM_CFLAGS) \
509         $(DBUS_CFLAGS)
510
511 systemadm_SOURCES = \
512         src/systemadm.vala \
513         src/systemd-interfaces.vala
514
515 systemadm_CFLAGS = \
516         $(AM_CFLAGS) \
517         $(DBUSGLIB_CFLAGS) \
518         $(GTK_CFLAGS) \
519         -Wno-unused-variable \
520         -Wno-unused-function \
521         -Wno-shadow \
522         -Wno-format-nonliteral
523
524 systemadm_VALAFLAGS = \
525         --pkg=dbus-glib-1 \
526         --pkg=posix \
527         --pkg=gtk+-2.0 \
528         -g
529
530 systemadm_LDADD = \
531         $(DBUSGLIB_LIBS) \
532         $(GTK_LIBS)
533
534 pam_systemd_la_SOURCES = \
535         src/pam-module.c \
536         src/cgroup-util.c \
537         src/sd-daemon.c
538
539 pam_systemd_la_CFLAGS = \
540         $(AM_CFLAGS) \
541         $(CGROUP_CFLAGS) \
542         -fvisibility=hidden
543
544 pam_systemd_la_LDFLAGS = \
545         -module \
546         -export-dynamic \
547         -avoid-version \
548         -shared \
549         -export-symbols-regex '^pam_sm_.*'
550
551 pam_systemd_la_LIBADD = \
552         libsystemd-basic.la \
553         $(PAM_LIBS) \
554         $(CGROUP_LIBS)
555
556 SED_PROCESS = \
557         $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
558         $(SED)  -e 's,@rootlibexecdir\@,$(rootlibexecdir),g' \
559                 -e 's,@SPECIAL_SYSLOG_SERVICE\@,$(SPECIAL_SYSLOG_SERVICE),g' \
560                 -e 's,@SPECIAL_DBUS_SERVICE\@,$(SPECIAL_DBUS_SERVICE),g' \
561                 -e 's,@SYSTEMCTL\@,$(rootbindir)/systemctl,g' \
562                 -e 's,@pkgsysconfdir\@,$(pkgsysconfdir),g' \
563                 -e 's,@pkgdatadir\@,$(pkgdatadir),g' \
564                 -e 's,@systemunitdir\@,$(systemunitdir),g' \
565                 -e 's,@PACKAGE_VERSION\@,$(PACKAGE_VERSION),g' \
566                 -e 's,@PACKAGE_NAME\@,$(PACKAGE_NAME),g' \
567                 -e 's,@PACKAGE_URL\@,$(PACKAGE_URL),g' \
568                 -e 's,@prefix\@,$(prefix),g' \
569                 < $< > $@
570
571 units/%: units/%.in Makefile
572         $(SED_PROCESS)
573
574 man/%: man/%.in Makefile
575         $(SED_PROCESS)
576
577 %.pc: %.pc.in Makefile
578         $(SED_PROCESS)
579
580 M4_PROCESS_SYSTEM = \
581         $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
582         $(M4) -P $(M4_DISTRO_FLAG) -DFOR_SYSTEM=1 < $< > $@
583
584 M4_PROCESS_SESSION = \
585         $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
586         $(M4) -P $(M4_DISTRO_FLAG) -DFOR_SESSION=1 < $< > $@
587
588 units/%: units/%.m4 Makefile
589         $(M4_PROCESS_SYSTEM)
590
591 units/session/%: units/%.m4 Makefile
592         $(M4_PROCESS_SESSION)
593
594 CLEANFILES = \
595         $(nodist_systemunit_DATA) \
596         $(nodist_sessionunit_DATA) \
597         $(nodist_man_MANS) \
598         ${XML_IN_FILES:.xml.in=.html} \
599         $(pkgconfigdata_DATA)
600
601 if HAVE_VALAC
602 CLEANFILES += \
603         ${systemadm_SOURCES:.vala=.c}
604 endif
605
606 if HAVE_XSLTPROC
607 XSLTPROC_FLAGS = \
608         --nonet \
609         --param funcsynopsis.style "'ansi'"
610
611 XSLTPROC_PROCESS_MAN = \
612         $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
613         $(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
614
615 XSLTPROC_PROCESS_MAN_IN = \
616         $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
617         $(XSLTPROC) -o ${@:.in=} $(XSLTPROC_FLAGS) http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $< && \
618         mv ${@:.in=} $@
619
620 XSLTPROC_PROCESS_HTML = \
621         $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
622         $(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) http://docbook.sourceforge.net/release/xsl/current/xhtml-1_1/docbook.xsl $<
623
624 XSLTPROC_PROCESS_HTML_IN = \
625         $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
626         $(XSLTPROC) -o ${@:.in=} $(XSLTPROC_FLAGS) http://docbook.sourceforge.net/release/xsl/current/xhtml-1_1/docbook.xsl $< && \
627         mv ${@:.in=} $@
628
629 man/%.1: man/%.xml
630         $(XSLTPROC_PROCESS_MAN)
631
632 man/%.1.in: man/%.xml.in
633         $(XSLTPROC_PROCESS_MAN)
634
635 man/%.3: man/%.xml
636         $(XSLTPROC_PROCESS_MAN)
637
638 man/%.3.in: man/%.xml.in
639         $(XSLTPROC_PROCESS_MAN)
640
641 man/%.5: man/%.xml
642         $(XSLTPROC_PROCESS_MAN)
643
644 man/%.5.in: man/%.xml.in
645         $(XSLTPROC_PROCESS_MAN)
646
647 man/%.7: man/%.xml
648         $(XSLTPROC_PROCESS_MAN)
649
650 man/%.7.in: man/%.xml.in
651         $(XSLTPROC_PROCESS_MAN_IN)
652
653 man/%.8: man/%.xml
654         $(XSLTPROC_PROCESS_MAN)
655
656 man/%.8.in: man/%.xml.in
657         $(XSLTPROC_PROCESS_MAN_IN)
658
659 man/%.html: man/%.xml
660         $(XSLTPROC_PROCESS_HTML)
661
662 man/%.html.in: man/%.xml.in
663         $(XSLTPROC_PROCESS_HTML_IN)
664
665 CLEANFILES += \
666         $(dist_man_MANS) \
667         ${nodist_man_MANS:=.in} \
668         ${XML_FILES:.xml=.html} \
669         ${XML_IN_FILES:.xml.in=.html.in}
670 endif
671
672 org.freedesktop.systemd1.%.xml: systemd
673         $(AM_V_GEN)./systemd --introspect=${@:.xml=} > $@
674
675 CLEANFILES += \
676         $(dbusinterface_DATA)
677
678 install-data-hook:
679         $(MKDIR_P) -m 0755 \
680                 $(DESTDIR)$(systemunitdir) \
681                 $(DESTDIR)$(sessionunitdir) \
682                 $(DESTDIR)$(systemunitdir)/sockets.target.wants \
683                 $(DESTDIR)$(systemunitdir)/sysinit.target.wants \
684                 $(DESTDIR)$(pkgsysconfdir)/system \
685                 $(DESTDIR)$(pkgsysconfdir)/system/getty.target.wants \
686                 $(DESTDIR)$(pkgsysconfdir)/system/multi-user.target.wants \
687                 $(DESTDIR)$(pkgsysconfdir)/system/graphical.target.wants \
688                 $(DESTDIR)$(pkgsysconfdir)/session \
689                 $(DESTDIR)$(sysconfdir)/xdg/systemd
690         $(MKDIR_P) -m 0755 $(DESTDIR)/cgroup || \
691                 echo "Don't forget to create /cgroup! Couldn't create it for you, continuing anyway."
692         ( cd $(DESTDIR)$(sysconfdir)/xdg/systemd/ && \
693                 rm -f session && \
694                 $(LN_S) $(pkgsysconfdir)/session session )
695         ( cd $(DESTDIR)$(systemunitdir)/sockets.target.wants && \
696                 rm -f systemd-initctl.socket systemd-logger.socket && \
697                 $(LN_S) ../systemd-logger.socket systemd-logger.socket && \
698                 $(LN_S) ../systemd-initctl.socket systemd-initctl.socket )
699         ( cd $(DESTDIR)$(sessionunitdir) && \
700                 rm -f shutdown.target sockets.target local-fs.target swap.target && \
701                 $(LN_S) $(systemunitdir)/shutdown.target shutdown.target && \
702                 $(LN_S) $(systemunitdir)/sockets.target sockets.target && \
703                 $(LN_S) $(systemunitdir)/local-fs.target local-fs.target && \
704                 $(LN_S) $(systemunitdir)/swap.target swap.target )
705         ( cd $(DESTDIR)$(systemunitdir) && \
706                 rm -f runlevel0.target runlevel1.target runlevel6.target && \
707                 $(LN_S) poweroff.target runlevel0.target && \
708                 $(LN_S) rescue.target runlevel1.target && \
709                 $(LN_S) reboot.target runlevel6.target )
710         ( cd $(DESTDIR)$(pkgsysconfdir)/system && \
711                 rm -f default.target ctrl-alt-del.target kbrequest.target && \
712                 $(LN_S) $(systemunitdir)/graphical.target default.target && \
713                 $(LN_S) $(systemunitdir)/reboot.target ctrl-alt-del.target && \
714                 $(LN_S) $(systemunitdir)/rescue.target kbrequest.target && \
715                 rm -f runlevel2.target runlevel3.target runlevel4.target runlevel5.target && \
716                 $(LN_S) $(systemunitdir)/multi-user.target runlevel2.target && \
717                 $(LN_S) $(systemunitdir)/multi-user.target runlevel3.target && \
718                 $(LN_S) $(systemunitdir)/multi-user.target runlevel4.target && \
719                 $(LN_S) $(systemunitdir)/graphical.target runlevel5.target )
720         ( cd $(DESTDIR)$(pkgsysconfdir)/system/getty.target.wants && \
721                 rm -f getty@tty1.service getty@tty2.service getty@tty3.service getty@tty4.service getty@tty5.service getty@tty6.service && \
722                 $(LN_S) $(systemunitdir)/getty@.service getty@tty1.service && \
723                 $(LN_S) $(systemunitdir)/getty@.service getty@tty2.service && \
724                 $(LN_S) $(systemunitdir)/getty@.service getty@tty3.service && \
725                 $(LN_S) $(systemunitdir)/getty@.service getty@tty4.service && \
726                 $(LN_S) $(systemunitdir)/getty@.service getty@tty5.service && \
727                 $(LN_S) $(systemunitdir)/getty@.service getty@tty6.service )
728         ( cd $(DESTDIR)$(pkgsysconfdir)/system/multi-user.target.wants && \
729                 rm -f getty.target remote-fs.target && \
730                 $(LN_S) $(systemunitdir)/getty.target getty.target && \
731                 $(LN_S) $(systemunitdir)/remote-fs.target remote-fs.target )
732         ( cd $(DESTDIR)$(systemunitdir)/sysinit.target.wants && \
733                 rm -f dev-hugepages.automount \
734                         dev-mqueue.automount \
735                         proc-sys-fs-binfmt_misc.automount \
736                         sys-kernel-debug.automount \
737                         sys-kernel-security.automount && \
738                 $(LN_S) ../dev-hugepages.automount dev-hugepages.automount && \
739                 $(LN_S) ../dev-mqueue.automount dev-mqueue.automount && \
740                 $(LN_S) ../proc-sys-fs-binfmt_misc.automount proc-sys-fs-binfmt_misc.automount && \
741                 $(LN_S) ../sys-kernel-debug.automount sys-kernel-debug.automount && \
742                 $(LN_S) ../sys-kernel-security.automount sys-kernel-security.automount )
743         ( cd $(DESTDIR)$(dbussessionservicedir) && \
744                 rm -f org.freedesktop.systemd1.service && \
745                 $(LN_S) ../system-services/org.freedesktop.systemd1.service org.freedesktop.systemd1.service )
746 if TARGET_FEDORA
747         $(MKDIR_P) -m 0755 \
748                 $(DESTDIR)$(SYSTEM_SYSVINIT_PATH)
749         ( cd $(DESTDIR)$(pkgsysconfdir)/system && \
750                 rm -f display-manager.service && \
751                 $(LN_S) $(systemunitdir)/prefdm.service display-manager.service )
752         ( cd $(DESTDIR)$(pkgsysconfdir)/system/graphical.target.wants && \
753                 rm -f prefdm.service && \
754                 $(LN_S) ../prefdm.service prefdm.service )
755         ( cd $(DESTDIR)$(pkgsysconfdir)/system/multi-user.target.wants && \
756                 rm -f rc-local.service && \
757                 $(LN_S) $(systemunitdir)/rc-local.service rc-local.service )
758         ( cd $(DESTDIR)$(systemunitdir) && \
759                 rm -f local.service && \
760                 $(LN_S) rc-local.service local.service )
761         ( cd $(DESTDIR)$(SYSTEM_SYSVINIT_PATH) && \
762                 $(LN_S) halt reboot > /dev/null 2>&1 || true )
763 endif
764 if TARGET_GENTOO
765         ( cd $(DESTDIR)$(pkgsysconfdir)/system && \
766                 rm -f display-manager.service && \
767                 $(LN_S) $(systemunitdir)/xdm.service display-manager.service )
768         ( cd $(DESTDIR)$(pkgsysconfdir)/system/graphical.target.wants && \
769                 rm -f prefdm.service && \
770                 $(LN_S) ../prefdm.service prefdm.service )
771 endif
772
773 DISTCHECK_CONFIGURE_FLAGS = \
774         --with-dbuspolicydir=$$dc_install_base/$(dbuspolicydir) \
775         --with-dbussessionservicedir=$$dc_install_base/$(dbussessionservicedir) \
776         --with-dbussystemservicedir=$$dc_install_base/$(dbussystemservicedir) \
777         --with-dbusinterfacedir=$$dc_install_base/$(dbusinterfacedir) \
778         --with-udevrulesdir=$$dc_install_base/$(udevrulesdir) \
779         --with-pamlibdir=$$dc_install_base/$(pamlibdir) \
780         --with-rootdir=$$dc_install_base/$(rootdir)