1 |
commit: 2ebad37c60d021927f58df29a58627e12fbceb30 |
2 |
Author: Mike Gilbert <floppym <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Nov 23 02:29:40 2015 +0000 |
4 |
Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Nov 23 02:30:24 2015 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2ebad37c |
7 |
|
8 |
sys-apps/systemd: Bump to 228 |
9 |
|
10 |
Package-Manager: portage-2.2.25_p7 |
11 |
|
12 |
sys-apps/systemd/Manifest | 1 + |
13 |
sys-apps/systemd/systemd-228.ebuild | 475 ++++++++++++++++++++++++++++++++++++ |
14 |
2 files changed, 476 insertions(+) |
15 |
|
16 |
diff --git a/sys-apps/systemd/Manifest b/sys-apps/systemd/Manifest |
17 |
index c8d71ba..9a79f06 100644 |
18 |
--- a/sys-apps/systemd/Manifest |
19 |
+++ b/sys-apps/systemd/Manifest |
20 |
@@ -3,4 +3,5 @@ DIST systemd-219_p112.tar.xz 3944604 SHA256 8394ca0d55b05cb07c2187da8b614f3cb4ea |
21 |
DIST systemd-224.tar.gz 3868075 SHA256 0d7ac1532a57639fbc828f8a5051a090883c6ad2908618a7a13ab386db831bfc SHA512 7717d340c6de11afd589234b7ec8952fe2ffcd05829622bd7ea8e008870c0e3b83eb1eaf20e85ffffa7adafc9c0c0b94fd93784510792109240e22e6b963f198 WHIRLPOOL 645b08ff0c20994b17b8ed585fb0eef682336961d7fedf25031fa4dc89a4d9a2b58c254e0f9baeedcb228435316fdfb562f9fefd21e5a63f94499d2f1040e093 |
22 |
DIST systemd-225.tar.gz 3878442 SHA256 b2f576bb3688e9315f2f49b98e141ac6f964567370e98ebd8fd7332a0a6f9701 SHA512 35b3946509c7b01660da4370d3c51ff0e6a537dadd9dbb0a039c4f7ed552fd4e02ebac6eb8a788f61f1e3ba99444238d959051dd004c174b027729a80368ac19 WHIRLPOOL 47cd3b5690dafdf3c0ef6a9767e947666b1853541f8aefd17eb5c07eee1477daf32f3b249b04327b1c56d8ec430745725383750b97755bb6cf594d354a7ffdf8 |
23 |
DIST systemd-226.tar.gz 3914162 SHA256 baff6a938c5579769330d0224280bf1a1ff5920151d7201545fc9880b6326c67 SHA512 565331661e7d144dcdf1505f9a1a70b20a9b904567478593a8fa47ed18f9eb68a9339cf32f117ede994676a84d0cfe3fcedbc9b8d8c964445b741a32271e5584 WHIRLPOOL 9f0d7b761ad84f0bb557a22738d7fcc1b6515340db776790d9199401017747a62c24de214300c1f00fb33f86284f3498cadbece713d6e66a30903475f6bce273 |
24 |
+DIST systemd-228.tar.gz 4034401 SHA256 dd124ff561a07e6439ed2b3713f38ca914df7747f110ce86deea17b56d245ae6 SHA512 e54f282f550854dc082a4788709905e5767b75d2057e18d749b54821f2e44e0a8d1349b1a9180036cc854ecccaf5ff86b3b1dba4d3c2ce1b1fc766930ea4c0ea WHIRLPOOL 16b28367edc29a74f5b08691839da39a02d55bf5bcdffef55bfb1a2e8065eeecbe22a2b661e2d5f161f008d05baa000aff60d662d65db380d6c3fe0c1380eea1 |
25 |
DIST systemd.conf.m4-v219 1493 SHA256 90ee489b6e34945e5cda27a269e1247644382084f5a145a2df691282007c6768 SHA512 a117c40229af3ba2a0cec4c3db01728c3cab49bb6403fc84cb34f8a09979d98f7a200cd28bf2bbc7a71cbad856edf31190fba30a9d5810c55911746457bbf31a WHIRLPOOL a1604a4fdf5e2d4a4505252859c64d0a3c131b4bb371cff8c75331438f291f138d2732d939947988ab95b040e377412db84fbf6c45866fee028a2aac70e8eb9f |
26 |
|
27 |
diff --git a/sys-apps/systemd/systemd-228.ebuild b/sys-apps/systemd/systemd-228.ebuild |
28 |
new file mode 100644 |
29 |
index 0000000..440c35f |
30 |
--- /dev/null |
31 |
+++ b/sys-apps/systemd/systemd-228.ebuild |
32 |
@@ -0,0 +1,475 @@ |
33 |
+# Copyright 1999-2015 Gentoo Foundation |
34 |
+# Distributed under the terms of the GNU General Public License v2 |
35 |
+# $Id$ |
36 |
+ |
37 |
+EAPI=5 |
38 |
+ |
39 |
+if [[ ${PV} == 9999 ]]; then |
40 |
+ EGIT_REPO_URI="https://github.com/systemd/systemd.git" |
41 |
+ inherit git-r3 |
42 |
+else |
43 |
+ SRC_URI="https://github.com/systemd/systemd/archive/v${PV}.tar.gz -> ${P}.tar.gz" |
44 |
+ KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~ppc ~ppc64 ~sparc ~x86" |
45 |
+fi |
46 |
+ |
47 |
+inherit autotools bash-completion-r1 linux-info multilib \ |
48 |
+ multilib-minimal pam systemd toolchain-funcs udev user |
49 |
+ |
50 |
+DESCRIPTION="System and service manager for Linux" |
51 |
+HOMEPAGE="http://www.freedesktop.org/wiki/Software/systemd" |
52 |
+ |
53 |
+LICENSE="GPL-2 LGPL-2.1 MIT public-domain" |
54 |
+SLOT="0/2" |
55 |
+IUSE="acl apparmor audit cryptsetup curl elfutils gcrypt gnuefi http |
56 |
+ idn importd +kdbus +kmod +lz4 lzma nat pam policykit |
57 |
+ qrcode +seccomp selinux ssl sysv-utils test vanilla xkb" |
58 |
+ |
59 |
+REQUIRED_USE="importd? ( curl gcrypt lzma )" |
60 |
+ |
61 |
+MINKV="3.11" |
62 |
+ |
63 |
+COMMON_DEPEND=">=sys-apps/util-linux-2.27.1:0=[${MULTILIB_USEDEP}] |
64 |
+ sys-libs/libcap:0=[${MULTILIB_USEDEP}] |
65 |
+ !<sys-libs/glibc-2.16 |
66 |
+ acl? ( sys-apps/acl:0= ) |
67 |
+ apparmor? ( sys-libs/libapparmor:0= ) |
68 |
+ audit? ( >=sys-process/audit-2:0= ) |
69 |
+ cryptsetup? ( >=sys-fs/cryptsetup-1.6:0= ) |
70 |
+ curl? ( net-misc/curl:0= ) |
71 |
+ elfutils? ( >=dev-libs/elfutils-0.158:0= ) |
72 |
+ gcrypt? ( >=dev-libs/libgcrypt-1.4.5:0=[${MULTILIB_USEDEP}] ) |
73 |
+ http? ( |
74 |
+ >=net-libs/libmicrohttpd-0.9.33:0= |
75 |
+ ssl? ( >=net-libs/gnutls-3.1.4:0= ) |
76 |
+ ) |
77 |
+ idn? ( net-dns/libidn:0= ) |
78 |
+ importd? ( |
79 |
+ app-arch/bzip2:0= |
80 |
+ sys-libs/zlib:0= |
81 |
+ ) |
82 |
+ kmod? ( >=sys-apps/kmod-15:0= ) |
83 |
+ lz4? ( >=app-arch/lz4-0_p131:0=[${MULTILIB_USEDEP}] ) |
84 |
+ lzma? ( >=app-arch/xz-utils-5.0.5-r1:0=[${MULTILIB_USEDEP}] ) |
85 |
+ nat? ( net-firewall/iptables:0= ) |
86 |
+ pam? ( virtual/pam:= ) |
87 |
+ qrcode? ( media-gfx/qrencode:0= ) |
88 |
+ seccomp? ( sys-libs/libseccomp:0= ) |
89 |
+ selinux? ( sys-libs/libselinux:0= ) |
90 |
+ sysv-utils? ( |
91 |
+ !sys-apps/systemd-sysv-utils |
92 |
+ !sys-apps/sysvinit ) |
93 |
+ xkb? ( >=x11-libs/libxkbcommon-0.4.1:0= ) |
94 |
+ abi_x86_32? ( !<=app-emulation/emul-linux-x86-baselibs-20130224-r9 |
95 |
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)] )" |
96 |
+ |
97 |
+# baselayout-2.2 has /run |
98 |
+RDEPEND="${COMMON_DEPEND} |
99 |
+ >=sys-apps/baselayout-2.2 |
100 |
+ !sys-auth/nss-myhostname |
101 |
+ !sys-fs/eudev |
102 |
+ !sys-fs/udev" |
103 |
+ |
104 |
+# sys-apps/dbus: the daemon only (+ build-time lib dep for tests) |
105 |
+PDEPEND=">=sys-apps/dbus-1.6.8-r1:0[systemd] |
106 |
+ >=sys-apps/hwids-20150417[udev] |
107 |
+ >=sys-fs/udev-init-scripts-25 |
108 |
+ policykit? ( sys-auth/polkit ) |
109 |
+ !vanilla? ( sys-apps/gentoo-systemd-integration )" |
110 |
+ |
111 |
+# Newer linux-headers needed by ia64, bug #480218 |
112 |
+DEPEND="${COMMON_DEPEND} |
113 |
+ app-arch/xz-utils:0 |
114 |
+ dev-util/gperf |
115 |
+ >=dev-util/intltool-0.50 |
116 |
+ >=sys-apps/coreutils-8.16 |
117 |
+ >=sys-devel/binutils-2.23.1 |
118 |
+ >=sys-devel/gcc-4.6 |
119 |
+ >=sys-kernel/linux-headers-${MINKV} |
120 |
+ virtual/pkgconfig |
121 |
+ gnuefi? ( >=sys-boot/gnu-efi-3.0.2 ) |
122 |
+ test? ( >=sys-apps/dbus-1.6.8-r1:0 ) |
123 |
+ app-text/docbook-xml-dtd:4.2 |
124 |
+ app-text/docbook-xml-dtd:4.5 |
125 |
+ app-text/docbook-xsl-stylesheets |
126 |
+ dev-libs/libxslt:0 |
127 |
+" |
128 |
+ |
129 |
+pkg_pretend() { |
130 |
+ local CONFIG_CHECK="~AUTOFS4_FS ~BLK_DEV_BSG ~CGROUPS |
131 |
+ ~DEVPTS_MULTIPLE_INSTANCES ~DEVTMPFS ~DMIID ~EPOLL ~FANOTIFY ~FHANDLE |
132 |
+ ~INOTIFY_USER ~IPV6 ~NET ~NET_NS ~PROC_FS ~SECCOMP ~SIGNALFD ~SYSFS |
133 |
+ ~TIMERFD ~TMPFS_XATTR |
134 |
+ ~!FW_LOADER_USER_HELPER ~!GRKERNSEC_PROC ~!IDE ~!SYSFS_DEPRECATED |
135 |
+ ~!SYSFS_DEPRECATED_V2" |
136 |
+ |
137 |
+ use acl && CONFIG_CHECK+=" ~TMPFS_POSIX_ACL" |
138 |
+ kernel_is -lt 3 7 && CONFIG_CHECK+=" ~HOTPLUG" |
139 |
+ |
140 |
+ if linux_config_exists; then |
141 |
+ local uevent_helper_path=$(linux_chkconfig_string UEVENT_HELPER_PATH) |
142 |
+ if [ -n "${uevent_helper_path}" ] && [ "${uevent_helper_path}" != '""' ]; then |
143 |
+ ewarn "It's recommended to set an empty value to the following kernel config option:" |
144 |
+ ewarn "CONFIG_UEVENT_HELPER_PATH=${uevent_helper_path}" |
145 |
+ fi |
146 |
+ fi |
147 |
+ |
148 |
+ if [[ ${MERGE_TYPE} != binary ]]; then |
149 |
+ if [[ $(gcc-major-version) -lt 4 |
150 |
+ || ( $(gcc-major-version) -eq 4 && $(gcc-minor-version) -lt 6 ) ]] |
151 |
+ then |
152 |
+ eerror "systemd requires at least gcc 4.6 to build. Please switch the active" |
153 |
+ eerror "gcc version using gcc-config." |
154 |
+ die "systemd requires at least gcc 4.6" |
155 |
+ fi |
156 |
+ fi |
157 |
+ |
158 |
+ if [[ ${MERGE_TYPE} != buildonly ]]; then |
159 |
+ if kernel_is -lt ${MINKV//./ }; then |
160 |
+ ewarn "Kernel version at least ${MINKV} required" |
161 |
+ fi |
162 |
+ |
163 |
+ check_extra_config |
164 |
+ fi |
165 |
+} |
166 |
+ |
167 |
+pkg_setup() { |
168 |
+ : |
169 |
+} |
170 |
+ |
171 |
+src_unpack() { |
172 |
+ default |
173 |
+ [[ ${PV} != 9999 ]] || git-r3_src_unpack |
174 |
+} |
175 |
+ |
176 |
+src_prepare() { |
177 |
+ # Bug 463376 |
178 |
+ sed -i -e 's/GROUP="dialout"/GROUP="uucp"/' rules/*.rules || die |
179 |
+ epatch "${FILESDIR}/218-Dont-enable-audit-by-default.patch" |
180 |
+ epatch "${FILESDIR}/228-noclean-tmp.patch" |
181 |
+ epatch_user |
182 |
+ eautoreconf |
183 |
+} |
184 |
+ |
185 |
+src_configure() { |
186 |
+ # Keep using the one where the rules were installed. |
187 |
+ MY_UDEVDIR=$(get_udevdir) |
188 |
+ # Fix systems broken by bug #509454. |
189 |
+ [[ ${MY_UDEVDIR} ]] || MY_UDEVDIR=/lib/udev |
190 |
+ |
191 |
+ # Prevent conflicts with i686 cross toolchain, bug 559726 |
192 |
+ tc-export AR CC NM OBJCOPY RANLIB |
193 |
+ |
194 |
+ multilib-minimal_src_configure |
195 |
+} |
196 |
+ |
197 |
+multilib_src_configure() { |
198 |
+ local myeconfargs=( |
199 |
+ # disable -flto since it is an optimization flag |
200 |
+ # and makes distcc less effective |
201 |
+ cc_cv_CFLAGS__flto=no |
202 |
+ |
203 |
+ # Workaround for gcc-4.7, bug 554454. |
204 |
+ cc_cv_CFLAGS__Werror_shadow=no |
205 |
+ |
206 |
+ # Workaround for bug 516346 |
207 |
+ --enable-dependency-tracking |
208 |
+ |
209 |
+ --disable-maintainer-mode |
210 |
+ --localstatedir=/var |
211 |
+ --with-pamlibdir=$(getpam_mod_dir) |
212 |
+ # avoid bash-completion dep |
213 |
+ --with-bashcompletiondir="$(get_bashcompdir)" |
214 |
+ # make sure we get /bin:/sbin in $PATH |
215 |
+ --enable-split-usr |
216 |
+ # For testing. |
217 |
+ --with-rootprefix="${ROOTPREFIX-/usr}" |
218 |
+ --with-rootlibdir="${ROOTPREFIX-/usr}/$(get_libdir)" |
219 |
+ # disable sysv compatibility |
220 |
+ --with-sysvinit-path= |
221 |
+ --with-sysvrcnd-path= |
222 |
+ # no deps |
223 |
+ --enable-efi |
224 |
+ --enable-ima |
225 |
+ --without-python |
226 |
+ |
227 |
+ # Optional components/dependencies |
228 |
+ $(multilib_native_use_enable acl) |
229 |
+ $(multilib_native_use_enable apparmor) |
230 |
+ $(multilib_native_use_enable audit) |
231 |
+ $(multilib_native_use_enable cryptsetup libcryptsetup) |
232 |
+ $(multilib_native_use_enable curl libcurl) |
233 |
+ $(multilib_native_use_enable elfutils) |
234 |
+ $(use_enable gcrypt) |
235 |
+ $(multilib_native_use_enable gnuefi) |
236 |
+ $(multilib_native_use_enable http microhttpd) |
237 |
+ $(usex http $(multilib_native_use_enable ssl gnutls) --disable-gnutls) |
238 |
+ $(multilib_native_use_enable idn libidn) |
239 |
+ $(multilib_native_use_enable importd) |
240 |
+ $(multilib_native_use_enable importd bzip2) |
241 |
+ $(multilib_native_use_enable importd zlib) |
242 |
+ $(use_enable kdbus) |
243 |
+ $(multilib_native_use_enable kmod) |
244 |
+ $(use_enable lz4) |
245 |
+ $(use_enable lzma xz) |
246 |
+ $(multilib_native_use_enable nat libiptc) |
247 |
+ $(multilib_native_use_enable pam) |
248 |
+ $(multilib_native_use_enable policykit polkit) |
249 |
+ $(multilib_native_use_enable qrcode qrencode) |
250 |
+ $(multilib_native_use_enable seccomp) |
251 |
+ $(multilib_native_use_enable selinux) |
252 |
+ $(multilib_native_use_enable test tests) |
253 |
+ $(multilib_native_use_enable test dbus) |
254 |
+ $(multilib_native_use_enable xkb xkbcommon) |
255 |
+ |
256 |
+ # hardcode a few paths to spare some deps |
257 |
+ QUOTAON=/usr/sbin/quotaon |
258 |
+ QUOTACHECK=/usr/sbin/quotacheck |
259 |
+ |
260 |
+ # TODO: we may need to restrict this to gcc |
261 |
+ EFI_CC="$(tc-getCC)" |
262 |
+ |
263 |
+ # dbus paths |
264 |
+ --with-dbuspolicydir="${EPREFIX}/etc/dbus-1/system.d" |
265 |
+ --with-dbussessionservicedir="${EPREFIX}/usr/share/dbus-1/services" |
266 |
+ --with-dbussystemservicedir="${EPREFIX}/usr/share/dbus-1/system-services" |
267 |
+ |
268 |
+ --with-ntp-servers="0.gentoo.pool.ntp.org 1.gentoo.pool.ntp.org 2.gentoo.pool.ntp.org 3.gentoo.pool.ntp.org" |
269 |
+ ) |
270 |
+ |
271 |
+ # Work around bug 463846. |
272 |
+ tc-export CC |
273 |
+ |
274 |
+ ECONF_SOURCE="${S}" econf "${myeconfargs[@]}" |
275 |
+} |
276 |
+ |
277 |
+multilib_src_compile() { |
278 |
+ local mymakeopts=( |
279 |
+ udevlibexecdir="${MY_UDEVDIR}" |
280 |
+ ) |
281 |
+ |
282 |
+ if multilib_is_native_abi; then |
283 |
+ emake "${mymakeopts[@]}" |
284 |
+ else |
285 |
+ echo 'gentoo: $(BUILT_SOURCES)' | \ |
286 |
+ emake "${mymakeopts[@]}" -f Makefile -f - gentoo |
287 |
+ echo 'gentoo: $(lib_LTLIBRARIES) $(pkgconfiglib_DATA)' | \ |
288 |
+ emake "${mymakeopts[@]}" -f Makefile -f - gentoo |
289 |
+ fi |
290 |
+} |
291 |
+ |
292 |
+multilib_src_test() { |
293 |
+ multilib_is_native_abi || continue |
294 |
+ |
295 |
+ # Needed for bus-related tests |
296 |
+ local -x SANDBOX_WRITE=${SANDBOX_WRITE} |
297 |
+ addwrite /sys/fs/kdbus |
298 |
+ |
299 |
+ default |
300 |
+} |
301 |
+ |
302 |
+multilib_src_install() { |
303 |
+ local mymakeopts=( |
304 |
+ # automake fails with parallel libtool relinking |
305 |
+ # https://bugs.gentoo.org/show_bug.cgi?id=491398 |
306 |
+ -j1 |
307 |
+ |
308 |
+ udevlibexecdir="${MY_UDEVDIR}" |
309 |
+ dist_udevhwdb_DATA= |
310 |
+ DESTDIR="${D}" |
311 |
+ ) |
312 |
+ |
313 |
+ if multilib_is_native_abi; then |
314 |
+ emake "${mymakeopts[@]}" install |
315 |
+ else |
316 |
+ mymakeopts+=( |
317 |
+ install-libLTLIBRARIES |
318 |
+ install-pkgconfiglibDATA |
319 |
+ install-includeHEADERS |
320 |
+ # safe to call unconditionally, 'installs' empty list |
321 |
+ install-pkgincludeHEADERS |
322 |
+ ) |
323 |
+ |
324 |
+ emake "${mymakeopts[@]}" |
325 |
+ fi |
326 |
+ |
327 |
+ # install compat pkg-config files |
328 |
+ # Change dbus to >=sys-apps/dbus-1.8.8 if/when this is dropped. |
329 |
+ local pcfiles=( src/compat-libs/libsystemd-{daemon,id128,journal,login}.pc ) |
330 |
+ emake "${mymakeopts[@]}" install-pkgconfiglibDATA \ |
331 |
+ pkgconfiglib_DATA="${pcfiles[*]}" |
332 |
+} |
333 |
+ |
334 |
+multilib_src_install_all() { |
335 |
+ prune_libtool_files --modules |
336 |
+ einstalldocs |
337 |
+ |
338 |
+ if use sysv-utils; then |
339 |
+ for app in halt poweroff reboot runlevel shutdown telinit; do |
340 |
+ dosym "..${ROOTPREFIX-/usr}/bin/systemctl" /sbin/${app} |
341 |
+ done |
342 |
+ dosym "..${ROOTPREFIX-/usr}/lib/systemd/systemd" /sbin/init |
343 |
+ else |
344 |
+ # we just keep sysvinit tools, so no need for the mans |
345 |
+ rm "${D}"/usr/share/man/man8/{halt,poweroff,reboot,runlevel,shutdown,telinit}.8 \ |
346 |
+ || die |
347 |
+ rm "${D}"/usr/share/man/man1/init.1 || die |
348 |
+ fi |
349 |
+ |
350 |
+ # Disable storing coredumps in journald, bug #433457 |
351 |
+ mv "${D}"/usr/lib/sysctl.d/50-coredump.conf{,.disabled} || die |
352 |
+ |
353 |
+ # Preserve empty dirs in /etc & /var, bug #437008 |
354 |
+ keepdir /etc/binfmt.d /etc/modules-load.d /etc/tmpfiles.d \ |
355 |
+ /etc/systemd/ntp-units.d /etc/systemd/user /var/lib/systemd \ |
356 |
+ /var/log/journal/remote |
357 |
+ |
358 |
+ # Symlink /etc/sysctl.conf for easy migration. |
359 |
+ dosym ../sysctl.conf /etc/sysctl.d/99-sysctl.conf |
360 |
+ |
361 |
+ # If we install these symlinks, there is no way for the sysadmin to remove them |
362 |
+ # permanently. |
363 |
+ rm "${D}"/etc/systemd/system/multi-user.target.wants/systemd-networkd.service || die |
364 |
+ rm "${D}"/etc/systemd/system/multi-user.target.wants/systemd-resolved.service || die |
365 |
+ rm -r "${D}"/etc/systemd/system/network-online.target.wants || die |
366 |
+ rm -r "${D}"/etc/systemd/system/sockets.target.wants || die |
367 |
+ rm -r "${D}"/etc/systemd/system/sysinit.target.wants || die |
368 |
+} |
369 |
+ |
370 |
+migrate_locale() { |
371 |
+ local envd_locale_def="${EROOT%/}/etc/env.d/02locale" |
372 |
+ local envd_locale=( "${EROOT%/}"/etc/env.d/??locale ) |
373 |
+ local locale_conf="${EROOT%/}/etc/locale.conf" |
374 |
+ |
375 |
+ if [[ ! -L ${locale_conf} && ! -e ${locale_conf} ]]; then |
376 |
+ # If locale.conf does not exist... |
377 |
+ if [[ -e ${envd_locale} ]]; then |
378 |
+ # ...either copy env.d/??locale if there's one |
379 |
+ ebegin "Moving ${envd_locale} to ${locale_conf}" |
380 |
+ mv "${envd_locale}" "${locale_conf}" |
381 |
+ eend ${?} || FAIL=1 |
382 |
+ else |
383 |
+ # ...or create a dummy default |
384 |
+ ebegin "Creating ${locale_conf}" |
385 |
+ cat > "${locale_conf}" <<-EOF |
386 |
+ # This file has been created by the sys-apps/systemd ebuild. |
387 |
+ # See locale.conf(5) and localectl(1). |
388 |
+ |
389 |
+ # LANG=${LANG} |
390 |
+ EOF |
391 |
+ eend ${?} || FAIL=1 |
392 |
+ fi |
393 |
+ fi |
394 |
+ |
395 |
+ if [[ ! -L ${envd_locale} ]]; then |
396 |
+ # now, if env.d/??locale is not a symlink (to locale.conf)... |
397 |
+ if [[ -e ${envd_locale} ]]; then |
398 |
+ # ...warn the user that he has duplicate locale settings |
399 |
+ ewarn |
400 |
+ ewarn "To ensure consistent behavior, you should replace ${envd_locale}" |
401 |
+ ewarn "with a symlink to ${locale_conf}. Please migrate your settings" |
402 |
+ ewarn "and create the symlink with the following command:" |
403 |
+ ewarn "ln -s -n -f ../locale.conf ${envd_locale}" |
404 |
+ ewarn |
405 |
+ else |
406 |
+ # ...or just create the symlink if there's nothing here |
407 |
+ ebegin "Creating ${envd_locale_def} -> ../locale.conf symlink" |
408 |
+ ln -n -s ../locale.conf "${envd_locale_def}" |
409 |
+ eend ${?} || FAIL=1 |
410 |
+ fi |
411 |
+ fi |
412 |
+} |
413 |
+ |
414 |
+migrate_net_name_slot() { |
415 |
+ # If user has disabled 80-net-name-slot.rules using a empty file or a symlink to /dev/null, |
416 |
+ # do the same for 80-net-setup-link.rules to keep the old behavior |
417 |
+ local net_move=no |
418 |
+ local net_name_slot_sym=no |
419 |
+ local net_rules_path="${EROOT%/}"/etc/udev/rules.d |
420 |
+ local net_name_slot="${net_rules_path}"/80-net-name-slot.rules |
421 |
+ local net_setup_link="${net_rules_path}"/80-net-setup-link.rules |
422 |
+ if [[ -e ${net_setup_link} ]]; then |
423 |
+ net_move=no |
424 |
+ elif [[ -f ${net_name_slot} && $(sed -e "/^#/d" -e "/^\W*$/d" ${net_name_slot} | wc -l) == 0 ]]; then |
425 |
+ net_move=yes |
426 |
+ elif [[ -L ${net_name_slot} && $(readlink ${net_name_slot}) == /dev/null ]]; then |
427 |
+ net_move=yes |
428 |
+ net_name_slot_sym=yes |
429 |
+ fi |
430 |
+ if [[ ${net_move} == yes ]]; then |
431 |
+ ebegin "Copying ${net_name_slot} to ${net_setup_link}" |
432 |
+ |
433 |
+ if [[ ${net_name_slot_sym} == yes ]]; then |
434 |
+ ln -nfs /dev/null "${net_setup_link}" |
435 |
+ else |
436 |
+ cp "${net_name_slot}" "${net_setup_link}" |
437 |
+ fi |
438 |
+ eend $? || FAIL=1 |
439 |
+ fi |
440 |
+} |
441 |
+ |
442 |
+reenable_unit() { |
443 |
+ if systemctl is-enabled --root="${ROOT}" "$1" &> /dev/null; then |
444 |
+ ebegin "Re-enabling $1" |
445 |
+ systemctl reenable --root="${ROOT}" "$1" |
446 |
+ eend $? || FAIL=1 |
447 |
+ fi |
448 |
+} |
449 |
+ |
450 |
+pkg_postinst() { |
451 |
+ newusergroup() { |
452 |
+ enewgroup "$1" |
453 |
+ enewuser "$1" -1 -1 -1 "$1" |
454 |
+ } |
455 |
+ |
456 |
+ enewgroup input |
457 |
+ enewgroup systemd-journal |
458 |
+ newusergroup systemd-bus-proxy |
459 |
+ newusergroup systemd-journal-gateway |
460 |
+ newusergroup systemd-journal-remote |
461 |
+ newusergroup systemd-journal-upload |
462 |
+ newusergroup systemd-network |
463 |
+ newusergroup systemd-resolve |
464 |
+ newusergroup systemd-timesync |
465 |
+ use http && newusergroup systemd-journal-gateway |
466 |
+ |
467 |
+ systemd_update_catalog |
468 |
+ |
469 |
+ # Keep this here in case the database format changes so it gets updated |
470 |
+ # when required. Despite that this file is owned by sys-apps/hwids. |
471 |
+ if has_version "sys-apps/hwids[udev]"; then |
472 |
+ udevadm hwdb --update --root="${ROOT%/}" |
473 |
+ fi |
474 |
+ |
475 |
+ udev_reload || FAIL=1 |
476 |
+ |
477 |
+ # Bug 465468, make sure locales are respect, and ensure consistency |
478 |
+ # between OpenRC & systemd |
479 |
+ migrate_locale |
480 |
+ |
481 |
+ # Migrate 80-net-name-slot.rules -> 80-net-setup-link.rules |
482 |
+ migrate_net_name_slot |
483 |
+ |
484 |
+ # Re-enable systemd-networkd for socket activation |
485 |
+ reenable_unit systemd-networkd.service |
486 |
+ |
487 |
+ if [[ ${FAIL} ]]; then |
488 |
+ eerror "One of the postinst commands failed. Please check the postinst output" |
489 |
+ eerror "for errors. You may need to clean up your system and/or try installing" |
490 |
+ eerror "systemd again." |
491 |
+ eerror |
492 |
+ fi |
493 |
+ |
494 |
+ if [[ $(readlink "${ROOT}"/etc/resolv.conf) == */run/systemd/network/resolv.conf ]]; then |
495 |
+ ewarn "resolv.conf is now generated by systemd-resolved. To use it, enable" |
496 |
+ ewarn "systemd-resolved.service, and create a symlink from /etc/resolv.conf" |
497 |
+ ewarn "to /run/systemd/resolve/resolv.conf" |
498 |
+ ewarn |
499 |
+ fi |
500 |
+} |
501 |
+ |
502 |
+pkg_prerm() { |
503 |
+ # If removing systemd completely, remove the catalog database. |
504 |
+ if [[ ! ${REPLACED_BY_VERSION} ]]; then |
505 |
+ rm -f -v "${EROOT}"/var/lib/systemd/catalog/database |
506 |
+ fi |
507 |
+} |