package/nodejs: bump version to 5.6.0
[buildroot-gz.git] / package / systemd / systemd.mk
blobe4320697f6bb07b21700e3e8a8764ce74e1f865b
1 ################################################################################
3 # systemd
5 ################################################################################
7 SYSTEMD_VERSION = 228
8 SYSTEMD_SITE = $(call github,systemd,systemd,v$(SYSTEMD_VERSION))
9 SYSTEMD_LICENSE = LGPLv2.1+, GPLv2+ (udev), Public Domain (few source files, see README)
10 SYSTEMD_LICENSE_FILES = LICENSE.GPL2 LICENSE.LGPL2.1 README
11 SYSTEMD_INSTALL_STAGING = YES
12 SYSTEMD_DEPENDENCIES = \
13 host-intltool \
14 libcap \
15 util-linux \
16 kmod \
17 host-gperf
19 SYSTEMD_PROVIDES = udev
20 SYSTEMD_AUTORECONF = YES
22 # Make sure that systemd will always be built after busybox so that we have
23 # a consistent init setup between two builds
24 ifeq ($(BR2_PACKAGE_BUSYBOX),y)
25 SYSTEMD_DEPENDENCIES += busybox
26 endif
28 SYSTEMD_CONF_OPTS += \
29 --with-rootprefix= \
30 --enable-static=no \
31 --disable-manpages \
32 --disable-selinux \
33 --disable-pam \
34 --disable-libcryptsetup \
35 --with-dbuspolicydir=/etc/dbus-1/system.d \
36 --with-dbussessionservicedir=/usr/share/dbus-1/services \
37 --with-dbussystemservicedir=/usr/share/dbus-1/system-services \
38 --disable-efi \
39 --disable-gnuefi \
40 --disable-ldconfig \
41 --disable-tests \
42 --disable-dbus \
43 --without-python
45 SYSTEMD_CFLAGS = $(TARGET_CFLAGS) -fno-lto
47 # Override path to kmod, used in kmod-static-nodes.service
48 SYSTEMD_CONF_ENV = \
49 CFLAGS="$(SYSTEMD_CFLAGS)" \
50 ac_cv_path_KMOD=/usr/bin/kmod
52 define SYSTEMD_RUN_INTLTOOLIZE
53 cd $(@D) && $(HOST_DIR)/usr/bin/intltoolize --force --automake
54 endef
55 SYSTEMD_PRE_CONFIGURE_HOOKS += SYSTEMD_RUN_INTLTOOLIZE
57 ifeq ($(BR2_PACKAGE_SYSTEMD_COMPAT),y)
58 SYSTEMD_CONF_OPTS += --enable-compat-libs
59 else
60 SYSTEMD_CONF_OPTS += --disable-compat-libs
61 endif
63 ifeq ($(BR2_PACKAGE_ACL),y)
64 SYSTEMD_CONF_OPTS += --enable-acl
65 SYSTEMD_DEPENDENCIES += acl
66 else
67 SYSTEMD_CONF_OPTS += --disable-acl
68 endif
70 ifeq ($(BR2_PACKAGE_LIBSECCOMP),y)
71 SYSTEMD_CONF_OPTS += --enable-seccomp
72 SYSTEMD_DEPENDENCIES += libseccomp
73 else
74 SYSTEMD_CONF_OPTS += --disable-seccomp
75 endif
77 ifeq ($(BR2_PACKAGE_SYSTEMD_KDBUS),y)
78 SYSTEMD_CONF_OPTS += --enable-kdbus
79 else
80 SYSTEMD_CONF_OPTS += --disable-kdbus
81 endif
83 ifeq ($(BR2_PACKAGE_SYSTEMD_ALL_EXTRAS),y)
84 SYSTEMD_DEPENDENCIES += xz libgcrypt
85 SYSTEMD_CONF_OPTS += \
86 --enable-xz \
87 --enable-gcrypt \
88 --with-libgcrypt-prefix=$(STAGING_DIR)/usr
89 else
90 SYSTEMD_CONF_OPTS += \
91 --disable-xz \
92 --disable-gcrypt
93 endif
95 ifeq ($(BR2_PACKAGE_SYSTEMD_JOURNAL_GATEWAY),y)
96 SYSTEMD_DEPENDENCIES += libmicrohttpd
97 else
98 SYSTEMD_CONF_OPTS += --disable-microhttpd
99 endif
101 ifeq ($(BR2_PACKAGE_SYSTEMD_NETWORKD),y)
102 SYSTEMD_CONF_OPTS += --enable-networkd
103 define SYSTEMD_INSTALL_RESOLVCONF_HOOK
104 ln -sf ../run/systemd/resolve/resolv.conf \
105 $(TARGET_DIR)/etc/resolv.conf
106 endef
107 else
108 SYSTEMD_CONF_OPTS += --disable-networkd
109 define SYSTEMD_INSTALL_SERVICE_NETWORK
110 $(INSTALL) -D -m 644 package/systemd/network.service \
111 $(TARGET_DIR)/etc/systemd/system/network.service
112 mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
113 ln -fs ../network.service \
114 $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/network.service
115 endef
116 endif
118 ifeq ($(BR2_PACKAGE_SYSTEMD_TIMESYNCD),y)
119 SYSTEMD_CONF_OPTS += --enable-timesyncd
120 define SYSTEMD_INSTALL_SERVICE_TIMESYNC
121 mkdir -p $(TARGET_DIR)/etc/systemd/system/sysinit.target.wants
122 ln -sf ../../../../lib/systemd/system/systemd-timesyncd.service \
123 $(TARGET_DIR)/etc/systemd/system/sysinit.target.wants/systemd-timesyncd.service
124 endef
125 else
126 SYSTEMD_CONF_OPTS += --disable-timesyncd
127 endif
129 ifeq ($(BR2_PACKAGE_SYSTEMD_SMACK_SUPPORT),y)
130 SYSTEMD_CONF_OPTS += --enable-smack
131 else
132 SYSTEMD_CONF_OPTS += --disable-smack
133 endif
135 # mq_getattr needs -lrt
136 SYSTEMD_MAKE_OPTS += LIBS=-lrt
137 SYSTEMD_MAKE_OPTS += LDFLAGS+=-ldl
139 define SYSTEMD_INSTALL_INIT_HOOK
140 ln -fs ../lib/systemd/systemd $(TARGET_DIR)/sbin/init
141 ln -fs ../bin/systemctl $(TARGET_DIR)/sbin/halt
142 ln -fs ../bin/systemctl $(TARGET_DIR)/sbin/poweroff
143 ln -fs ../bin/systemctl $(TARGET_DIR)/sbin/reboot
145 ln -fs ../../../lib/systemd/system/multi-user.target \
146 $(TARGET_DIR)/etc/systemd/system/default.target
147 endef
149 define SYSTEMD_INSTALL_MACHINEID_HOOK
150 touch $(TARGET_DIR)/etc/machine-id
151 endef
153 define SYSTEMD_SANITIZE_PATH_IN_UNITS
154 find $(TARGET_DIR)/lib/systemd/system -name '*.service' \
155 -exec $(SED) 's,$(HOST_DIR),,g' {} \;
156 endef
158 SYSTEMD_POST_INSTALL_TARGET_HOOKS += \
159 SYSTEMD_INSTALL_INIT_HOOK \
160 SYSTEMD_INSTALL_MACHINEID_HOOK \
161 SYSTEMD_INSTALL_RESOLVCONF_HOOK \
162 SYSTEMD_SANITIZE_PATH_IN_UNITS
164 define SYSTEMD_USERS
165 systemd-journal -1 systemd-journal -1 * /var/log/journal - - Journal
166 systemd-journal-gateway -1 systemd-journal-gateway -1 * /var/log/journal - - Journal Gateway
167 systemd-journal-remote -1 systemd-journal-remote -1 * /var/log/journal/remote - - Journal Remote
168 systemd-journal-upload -1 systemd-journal-upload -1 * - - - Journal Upload
169 systemd-resolve -1 systemd-resolve -1 * - - - Network Name Resolution Manager
170 systemd-bus-proxy -1 systemd-bus-proxy -1 * - - - Proxy D-Bus messages to/from a bus
171 systemd-timesync -1 systemd-timesync -1 * - - - Network Time Synchronization
172 systemd-network -1 systemd-network -1 * - - - Network Manager
173 - - input -1 * - - - Input device group
174 endef
176 define SYSTEMD_DISABLE_SERVICE_TTY1
177 rm -f $(TARGET_DIR)/etc/systemd/system/getty.target.wants/getty@tty1.service
178 endef
180 ifneq ($(call qstrip,$(BR2_TARGET_GENERIC_GETTY_PORT)),)
181 # systemd needs getty.service for VTs and serial-getty.service for serial ttys
182 define SYSTEMD_INSTALL_SERVICE_TTY
183 if echo $(BR2_TARGET_GENERIC_GETTY_PORT) | egrep -q 'tty[0-9]*$$'; \
184 then \
185 SERVICE="getty"; \
186 else \
187 SERVICE="serial-getty"; \
188 fi; \
189 ln -fs ../../../../lib/systemd/system/$${SERVICE}@.service \
190 $(TARGET_DIR)/etc/systemd/system/getty.target.wants/$${SERVICE}@$(BR2_TARGET_GENERIC_GETTY_PORT).service
191 endef
192 endif
194 define SYSTEMD_INSTALL_INIT_SYSTEMD
195 $(SYSTEMD_DISABLE_SERVICE_TTY1)
196 $(SYSTEMD_INSTALL_SERVICE_TTY)
197 $(SYSTEMD_INSTALL_SERVICE_NETWORK)
198 $(SYSTEMD_INSTALL_SERVICE_TIMESYNC)
199 endef
201 $(eval $(autotools-package))