1 |
commit: 06d012cc3dacb4a2c7ac2e28553c96965f9ddea9 |
2 |
Author: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Oct 29 04:57:19 2020 +0000 |
4 |
Commit: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Oct 29 05:03:19 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=06d012cc |
7 |
|
8 |
sys-apps/systemd-tmpfiles: new package |
9 |
|
10 |
Package-Manager: Portage-3.0.8, Repoman-3.0.2 |
11 |
Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org> |
12 |
|
13 |
sys-apps/systemd-tmpfiles/Manifest | 1 + |
14 |
.../systemd-tmpfiles/files/stmpfiles-dev.confd | 2 + |
15 |
.../systemd-tmpfiles/files/stmpfiles-dev.initd | 20 +++ |
16 |
.../systemd-tmpfiles/files/stmpfiles-setup.confd | 2 + |
17 |
.../systemd-tmpfiles/files/stmpfiles-setup.initd | 19 +++ |
18 |
sys-apps/systemd-tmpfiles/metadata.xml | 8 + |
19 |
.../systemd-tmpfiles/systemd-tmpfiles-246.ebuild | 173 +++++++++++++++++++++ |
20 |
7 files changed, 225 insertions(+) |
21 |
|
22 |
diff --git a/sys-apps/systemd-tmpfiles/Manifest b/sys-apps/systemd-tmpfiles/Manifest |
23 |
new file mode 100644 |
24 |
index 00000000000..0e7a4c8589d |
25 |
--- /dev/null |
26 |
+++ b/sys-apps/systemd-tmpfiles/Manifest |
27 |
@@ -0,0 +1 @@ |
28 |
+DIST systemd-246.tar.gz 9534036 BLAKE2B 71b72abcd4d066d35d45d9835d41bec8faa9a7eddc80b48fe7073223f07d32f78a8442c52dc0800940f9750d9c5502123a633738981d797cf610d85df2035bf0 SHA512 7103f7da53f7ced3b5543c238f23bd11c82af8e37166c1720a90576b6b431b4329320c78726166c65a9f5e101dd465c0a86dd13c586c4e55e608a6273d8f324f |
29 |
|
30 |
diff --git a/sys-apps/systemd-tmpfiles/files/stmpfiles-dev.confd b/sys-apps/systemd-tmpfiles/files/stmpfiles-dev.confd |
31 |
new file mode 100644 |
32 |
index 00000000000..2ec4b5f0d8b |
33 |
--- /dev/null |
34 |
+++ b/sys-apps/systemd-tmpfiles/files/stmpfiles-dev.confd |
35 |
@@ -0,0 +1,2 @@ |
36 |
+# Extra options to pass to stmpfiles |
37 |
+#stmpfiles_opts="" |
38 |
|
39 |
diff --git a/sys-apps/systemd-tmpfiles/files/stmpfiles-dev.initd b/sys-apps/systemd-tmpfiles/files/stmpfiles-dev.initd |
40 |
new file mode 100644 |
41 |
index 00000000000..0952ef12cc2 |
42 |
--- /dev/null |
43 |
+++ b/sys-apps/systemd-tmpfiles/files/stmpfiles-dev.initd |
44 |
@@ -0,0 +1,20 @@ |
45 |
+#!/sbin/openrc-run |
46 |
+# Copyright 1999-2020 Gentoo Authors |
47 |
+# Released under the 2-clause BSD license. |
48 |
+ |
49 |
+description="Set up tmpfiles.d entries for /dev" |
50 |
+ |
51 |
+depend() |
52 |
+{ |
53 |
+ provide stmpfiles-dev stmpfiles.dev tmpfiles-dev tmpfiles.dev |
54 |
+ use dev-mount |
55 |
+ before dev |
56 |
+ keyword -prefix -vserver |
57 |
+} |
58 |
+ |
59 |
+start() |
60 |
+{ |
61 |
+ ebegin "Setting up tmpfiles.d entries for /dev" |
62 |
+ /bin/systemd-tmpfiles --prefix=/dev --create --boot ${stmpfiles_opts} |
63 |
+ eend $? |
64 |
+} |
65 |
|
66 |
diff --git a/sys-apps/systemd-tmpfiles/files/stmpfiles-setup.confd b/sys-apps/systemd-tmpfiles/files/stmpfiles-setup.confd |
67 |
new file mode 100644 |
68 |
index 00000000000..2ec4b5f0d8b |
69 |
--- /dev/null |
70 |
+++ b/sys-apps/systemd-tmpfiles/files/stmpfiles-setup.confd |
71 |
@@ -0,0 +1,2 @@ |
72 |
+# Extra options to pass to stmpfiles |
73 |
+#stmpfiles_opts="" |
74 |
|
75 |
diff --git a/sys-apps/systemd-tmpfiles/files/stmpfiles-setup.initd b/sys-apps/systemd-tmpfiles/files/stmpfiles-setup.initd |
76 |
new file mode 100644 |
77 |
index 00000000000..a55163d3fd6 |
78 |
--- /dev/null |
79 |
+++ b/sys-apps/systemd-tmpfiles/files/stmpfiles-setup.initd |
80 |
@@ -0,0 +1,19 @@ |
81 |
+#!/sbin/openrc-run |
82 |
+# Copyright 1999-2020 Gentoo Authors |
83 |
+# Released under the 2-clause BSD license. |
84 |
+ |
85 |
+description="Set up tmpfiles.d entries" |
86 |
+ |
87 |
+depend() |
88 |
+{ |
89 |
+ provide stmpfiles-setup stmpfiles.setup tmpfiles-setup tmpfiles.setup |
90 |
+ need localmount |
91 |
+} |
92 |
+ |
93 |
+start() |
94 |
+{ |
95 |
+ ebegin "Setting up tmpfiles.d entries" |
96 |
+ /bin/systemd-tmpfiles --exclude-prefix=/dev --create --remove --boot \ |
97 |
+ ${stmpfiles_opts} |
98 |
+ eend $? |
99 |
+} |
100 |
|
101 |
diff --git a/sys-apps/systemd-tmpfiles/metadata.xml b/sys-apps/systemd-tmpfiles/metadata.xml |
102 |
new file mode 100644 |
103 |
index 00000000000..efcd58fe0b9 |
104 |
--- /dev/null |
105 |
+++ b/sys-apps/systemd-tmpfiles/metadata.xml |
106 |
@@ -0,0 +1,8 @@ |
107 |
+<?xml version="1.0" encoding="UTF-8"?> |
108 |
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> |
109 |
+<pkgmetadata> |
110 |
+ <maintainer type="person"> |
111 |
+ <email>gyakovlev@g.o</email> |
112 |
+ <name>Georgy Yakovlev</name> |
113 |
+ </maintainer> |
114 |
+</pkgmetadata> |
115 |
|
116 |
diff --git a/sys-apps/systemd-tmpfiles/systemd-tmpfiles-246.ebuild b/sys-apps/systemd-tmpfiles/systemd-tmpfiles-246.ebuild |
117 |
new file mode 100644 |
118 |
index 00000000000..5b99c6958bc |
119 |
--- /dev/null |
120 |
+++ b/sys-apps/systemd-tmpfiles/systemd-tmpfiles-246.ebuild |
121 |
@@ -0,0 +1,173 @@ |
122 |
+# Copyright 2020 Gentoo Authors |
123 |
+# Distributed under the terms of the GNU General Public License v2 |
124 |
+ |
125 |
+EAPI=7 |
126 |
+ |
127 |
+MINKV="3.11" |
128 |
+inherit meson |
129 |
+ |
130 |
+DESCRIPTION="Creates, deletes and cleans up volatile and temporary files and directories" |
131 |
+HOMEPAGE="https://www.freedesktop.org/wiki/Software/systemd" |
132 |
+SRC_URI="https://github.com/systemd/systemd/archive/v${PV}.tar.gz -> systemd-${PV}.tar.gz" |
133 |
+ |
134 |
+LICENSE="BSD-2 GPL-2 LGPL-2.1 MIT public-domain" |
135 |
+SLOT="0" |
136 |
+KEYWORDS="" |
137 |
+ |
138 |
+DEPEND=" |
139 |
+ >=sys-kernel/linux-headers-${MINKV} |
140 |
+ sys-apps/acl:0= |
141 |
+ >=sys-apps/util-linux-2.30:0= |
142 |
+ sys-libs/libcap:0= |
143 |
+" |
144 |
+RDEPEND="${DEPEND} |
145 |
+ !sys-apps/opentmpfiles |
146 |
+ !sys-apps/systemd |
147 |
+" |
148 |
+ |
149 |
+S="${WORKDIR}/systemd-${PV}" |
150 |
+ |
151 |
+src_configure() { |
152 |
+ # disable everything until configure says "enabled features: ACL, tmpfiles" |
153 |
+ local systemd_disable_options=( |
154 |
+ adm-group |
155 |
+ analyze |
156 |
+ apparmor |
157 |
+ audit |
158 |
+ backlight |
159 |
+ binfmt |
160 |
+ blkid |
161 |
+ bzip2 |
162 |
+ coredump |
163 |
+ dbus |
164 |
+ efi |
165 |
+ elfutils |
166 |
+ environment-d |
167 |
+ fdisk |
168 |
+ gcrypt |
169 |
+ glib |
170 |
+ gshadow |
171 |
+ gnutls |
172 |
+ hibernate |
173 |
+ hostnamed |
174 |
+ hwdb |
175 |
+ idn |
176 |
+ ima |
177 |
+ initrd |
178 |
+ firstboot |
179 |
+ kernel-install |
180 |
+ kmod |
181 |
+ ldconfig |
182 |
+ libcryptsetup |
183 |
+ libcurl |
184 |
+ libfido2 |
185 |
+ libidn |
186 |
+ libidn2 |
187 |
+ libiptc |
188 |
+ link-networkd-shared |
189 |
+ link-systemctl-shared |
190 |
+ link-timesyncd-shared |
191 |
+ link-udev-shared |
192 |
+ localed |
193 |
+ logind |
194 |
+ lz4 |
195 |
+ machined |
196 |
+ microhttpd |
197 |
+ networkd |
198 |
+ nss-myhostname |
199 |
+ nss-resolve |
200 |
+ nss-systemd |
201 |
+ openssl |
202 |
+ p11kit |
203 |
+ pam |
204 |
+ pcre2 |
205 |
+ polkit |
206 |
+ portabled |
207 |
+ pstore |
208 |
+ pwquality |
209 |
+ randomseed |
210 |
+ resolve |
211 |
+ rfkill |
212 |
+ seccomp |
213 |
+ selinux |
214 |
+ smack |
215 |
+ sysusers |
216 |
+ timedated |
217 |
+ timesyncd |
218 |
+ tpm |
219 |
+ qrencode |
220 |
+ quotacheck |
221 |
+ userdb |
222 |
+ utmp |
223 |
+ vconsole |
224 |
+ wheel-group |
225 |
+ xdg-autostart |
226 |
+ xkbcommon |
227 |
+ xz |
228 |
+ zlib |
229 |
+ zstd |
230 |
+ ) |
231 |
+ |
232 |
+ # prepend -D and append =false, e.g. zstd becomes -Dzstd=false |
233 |
+ systemd_disable_options=( ${systemd_disable_options[@]/#/-D} ) |
234 |
+ systemd_disable_options=( ${systemd_disable_options[@]/%/=false} ) |
235 |
+ |
236 |
+ local emesonargs=( |
237 |
+ -Dtmpfiles=true |
238 |
+ -Dacl=true |
239 |
+ -Dstandalone-binaries=true # this and below option does the magic |
240 |
+ -Dstatic-libsystemd=true |
241 |
+ -Dsysvinit-path='' |
242 |
+ ${systemd_disable_options[@]} |
243 |
+ ) |
244 |
+ meson_src_configure |
245 |
+} |
246 |
+ |
247 |
+src_compile() { |
248 |
+ # tmpfiles and sysusers can be built as standalone, link systemd-shared in statically. |
249 |
+ # https://github.com/systemd/systemd/pull/16061 original implementation |
250 |
+ # we just need to pass -Dstandalone-binaries=true and |
251 |
+ # use <name>.standalone target below. |
252 |
+ # check meson.build for if have_standalone_binaries condition per target. |
253 |
+ local mytargets=( |
254 |
+ systemd-tmpfiles.standalone |
255 |
+ man/tmpfiles.d.5 |
256 |
+ man/systemd-tmpfiles.8 |
257 |
+ ) |
258 |
+ meson_src_compile "${mytargets[@]}" |
259 |
+} |
260 |
+ |
261 |
+src_install() { |
262 |
+ # lean and mean installation, single binary and man-pages |
263 |
+ pushd "${BUILD_DIR}" > /dev/null || die |
264 |
+ into / |
265 |
+ newbin systemd-tmpfiles.standalone systemd-tmpfiles |
266 |
+ |
267 |
+ doman man/{systemd-tmpfiles.8,tmpfiles.d.5} |
268 |
+ |
269 |
+ popd > /dev/null || die |
270 |
+ |
271 |
+ # service files adapter from opentmpfiles |
272 |
+ newinitd "${FILESDIR}"/stmpfiles-dev.initd stmpfiles-dev |
273 |
+ newinitd "${FILESDIR}"/stmpfiles-setup.initd stmpfiles-setup |
274 |
+ |
275 |
+ newconfd "${FILESDIR}"/stmpfiles-dev.confd stmpfiles-dev |
276 |
+ newconfd "${FILESDIR}"/stmpfiles-setup.confd stmpfiles-setup |
277 |
+} |
278 |
+ |
279 |
+# adapted from opentmpfiles ebuild |
280 |
+add_service() { |
281 |
+ local initd=$1 |
282 |
+ local runlevel=$2 |
283 |
+ |
284 |
+ elog "Auto-adding '${initd}' service to your ${runlevel} runlevel" |
285 |
+ mkdir -p "${EROOT}/etc/runlevels/${runlevel}" |
286 |
+ ln -snf "${EROOT}/etc/init.d/${initd}" "${EROOT}/etc/runlevels/${runlevel}/${initd}" |
287 |
+} |
288 |
+ |
289 |
+pkg_postinst() { |
290 |
+ if [[ -z $REPLACING_VERSIONS ]]; then |
291 |
+ add_service stmpfiles-dev sysinit |
292 |
+ add_service stmpfiles-setup boot |
293 |
+ fi |
294 |
+} |