Gentoo Archives: gentoo-commits

From: Georgy Yakovlev <gyakovlev@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-apps/systemd-tmpfiles/
Date: Mon, 31 May 2021 03:19:11
Message-Id: 1622431092.0ff249b92fdabfb4d7ddbfc0dfa5865dec8e4863.gyakovlev@gentoo
1 commit: 0ff249b92fdabfb4d7ddbfc0dfa5865dec8e4863
2 Author: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
3 AuthorDate: Mon May 31 03:17:26 2021 +0000
4 Commit: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
5 CommitDate: Mon May 31 03:18:12 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0ff249b9
7
8 sys-apps/systemd-tmpfiles: add 248.3, unkeyworded
9
10 needs more testing, will restore keywords later
11 Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org>
12
13 sys-apps/systemd-tmpfiles/Manifest | 2 +
14 .../systemd-tmpfiles/systemd-tmpfiles-248.3.ebuild | 224 +++++++++++++++++++++
15 2 files changed, 226 insertions(+)
16
17 diff --git a/sys-apps/systemd-tmpfiles/Manifest b/sys-apps/systemd-tmpfiles/Manifest
18 index ff1d4d1bf45..c04aac30f3d 100644
19 --- a/sys-apps/systemd-tmpfiles/Manifest
20 +++ b/sys-apps/systemd-tmpfiles/Manifest
21 @@ -1,2 +1,4 @@
22 DIST systemd-246.tar.gz 9534036 BLAKE2B 71b72abcd4d066d35d45d9835d41bec8faa9a7eddc80b48fe7073223f07d32f78a8442c52dc0800940f9750d9c5502123a633738981d797cf610d85df2035bf0 SHA512 7103f7da53f7ced3b5543c238f23bd11c82af8e37166c1720a90576b6b431b4329320c78726166c65a9f5e101dd465c0a86dd13c586c4e55e608a6273d8f324f
23 +DIST systemd-stable-248.3.tar.gz 10320940 BLAKE2B 725494e0197dd182de55e4967088f4b4b709e6b2242723368b6cd95606582e01a57322b1f18fa194149055140a90993696734ad3c004843bfaceb72cd04a3a84 SHA512 8e7ff0d5e63cc933e4dc23f7e0bef9707fde90396605eb8822d34de90d7abe8fd37e5739e33b657868218aa7281147cc944c096c007324c3e6fb54d833a83485
24 DIST systemd-tmpfiles-246-musl.tar.xz 25860 BLAKE2B 87fc4ca37abec9c1a0cee48bf78c575bd53e16a50d427eff338159dc6d5474ffd328af533ccf90a0e1e160a16baa7378070f418f2be0d7f77e00907a5d07d30e SHA512 4a93d9f0cb2df2dd0a2f91820615dd3a95d19583f45dc0589e37ceaedfc2040112310a6e3fc525e28e222e96a91498af2fe8541b5bf86a635c0f52dd1a84deb7
25 +DIST systemd-tmpfiles-248.3-musl.tar.xz 22904 BLAKE2B a277ce86577644cecbca5dbfde34aec494e3e14075ab4f7fcbb02f9307d714a93ca63f38e346a1e98391ca9c55860c7e90789cd5edb9b196cf638d54bfe1153b SHA512 d3db6a90bed6b6c1a9f6bce138137554742d1bc60da142fbadbd49b64677a562e47d8140b9c413857106e053d740476744b7f7e05af9dd4a1329058c78cef940
26
27 diff --git a/sys-apps/systemd-tmpfiles/systemd-tmpfiles-248.3.ebuild b/sys-apps/systemd-tmpfiles/systemd-tmpfiles-248.3.ebuild
28 new file mode 100644
29 index 00000000000..8306be7d3a9
30 --- /dev/null
31 +++ b/sys-apps/systemd-tmpfiles/systemd-tmpfiles-248.3.ebuild
32 @@ -0,0 +1,224 @@
33 +# Copyright 2020-2021 Gentoo Authors
34 +# Distributed under the terms of the GNU General Public License v2
35 +
36 +EAPI=7
37 +
38 +if [[ ${PV} == *.* ]]; then
39 + MY_PN=systemd-stable
40 +else
41 + MY_PN=systemd
42 +fi
43 +
44 +MINKV="3.11"
45 +PYTHON_COMPAT=( python3_{8..10} )
46 +inherit meson python-any-r1
47 +
48 +DESCRIPTION="Creates, deletes and cleans up volatile and temporary files and directories"
49 +HOMEPAGE="https://www.freedesktop.org/wiki/Software/systemd"
50 +SRC_URI="https://github.com/systemd/${MY_PN}/archive/v${PV}.tar.gz -> ${MY_PN}-${PV}.tar.gz
51 + elibc_musl? ( https://dev.gentoo.org/~gyakovlev/distfiles/${P}-musl.tar.xz )"
52 +
53 +LICENSE="BSD-2 GPL-2 LGPL-2.1 MIT public-domain"
54 +SLOT="0"
55 +#KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
56 +IUSE="selinux test"
57 +RESTRICT="!test? ( test )"
58 +
59 +DEPEND="
60 + sys-apps/acl:0=
61 + >=sys-apps/util-linux-2.30:0=
62 + >=sys-kernel/linux-headers-${MINKV}
63 + sys-libs/libcap:0=
64 + selinux? ( sys-libs/libselinux:0= )
65 +"
66 +RDEPEND="${DEPEND}
67 + !sys-apps/opentmpfiles
68 + !sys-apps/systemd
69 +"
70 +
71 +BDEPEND="
72 + ${PYTHON_DEPS}
73 + app-text/docbook-xml-dtd:4.2
74 + app-text/docbook-xml-dtd:4.5
75 + app-text/docbook-xsl-stylesheets
76 + dev-libs/libxslt:0
77 + dev-util/gperf
78 + >=dev-util/meson-0.46
79 + >=dev-util/intltool-0.50
80 + >=sys-apps/coreutils-8.16
81 + sys-devel/m4
82 + virtual/pkgconfig
83 +"
84 +
85 +S="${WORKDIR}/${MY_PN}-${PV}"
86 +
87 +pkg_setup() {
88 + python-any-r1_pkg_setup
89 +}
90 +
91 +src_prepare() {
92 + # musl patchset from:
93 + # http://cgit.openembedded.org/openembedded-core/tree/meta/recipes-core/systemd/systemd
94 + use elibc_musl && eapply "${WORKDIR}/${P}-musl"
95 + default
96 +
97 + # https://bugs.gentoo.org/767403
98 + python_fix_shebang src/test/*.py
99 + python_fix_shebang tools/*.py
100 +}
101 +
102 +src_configure() {
103 + # disable everything until configure says "enabled features: ACL, tmpfiles, standalone-binaries"
104 + # and optionally selinux feature can be enabled to make tmpfiles secontext-aware
105 + local systemd_disable_options=(
106 + adm-group
107 + analyze
108 + apparmor
109 + audit
110 + backlight
111 + binfmt
112 + blkid
113 + bzip2
114 + coredump
115 + dbus
116 + efi
117 + elfutils
118 + environment-d
119 + fdisk
120 + gcrypt
121 + glib
122 + gshadow
123 + gnutls
124 + hibernate
125 + hostnamed
126 + hwdb
127 + idn
128 + ima
129 + initrd
130 + firstboot
131 + kernel-install
132 + kmod
133 + ldconfig
134 + libcryptsetup
135 + libcurl
136 + libfido2
137 + libidn
138 + libidn2
139 + libiptc
140 + link-networkd-shared
141 + link-systemctl-shared
142 + link-timesyncd-shared
143 + link-udev-shared
144 + localed
145 + logind
146 + lz4
147 + machined
148 + microhttpd
149 + networkd
150 + nscd
151 + nss-myhostname
152 + nss-resolve
153 + nss-systemd
154 + oomd
155 + openssl
156 + p11kit
157 + pam
158 + pcre2
159 + polkit
160 + portabled
161 + pstore
162 + pwquality
163 + randomseed
164 + resolve
165 + rfkill
166 + seccomp
167 + smack
168 + sysext
169 + sysusers
170 + timedated
171 + timesyncd
172 + tpm
173 + qrencode
174 + quotacheck
175 + userdb
176 + utmp
177 + vconsole
178 + wheel-group
179 + xdg-autostart
180 + xkbcommon
181 + xz
182 + zlib
183 + zstd
184 + )
185 +
186 + # prepend -D and append =false, e.g. zstd becomes -Dzstd=false
187 + systemd_disable_options=( ${systemd_disable_options[@]/#/-D} )
188 + systemd_disable_options=( ${systemd_disable_options[@]/%/=false} )
189 +
190 + local emesonargs=(
191 + -Dacl=true
192 + -Dtmpfiles=true
193 + -Dstandalone-binaries=true # this and below option does the magic
194 + -Dstatic-libsystemd=true
195 + -Dsysvinit-path=''
196 + ${systemd_disable_options[@]}
197 + $(meson_use selinux)
198 + )
199 + meson_src_configure
200 +}
201 +
202 +src_compile() {
203 + # tmpfiles and sysusers can be built as standalone, link systemd-shared in statically.
204 + # https://github.com/systemd/systemd/pull/16061 original implementation
205 + # we just need to pass -Dstandalone-binaries=true and
206 + # use <name>.standalone target below.
207 + # check meson.build for if have_standalone_binaries condition per target.
208 + local mytargets=(
209 + systemd-tmpfiles.standalone
210 + man/tmpfiles.d.5
211 + man/systemd-tmpfiles.8
212 + )
213 + meson_src_compile "${mytargets[@]}"
214 +}
215 +
216 +src_install() {
217 + # lean and mean installation, single binary and man-pages
218 + pushd "${BUILD_DIR}" > /dev/null || die
219 + into /
220 + newbin systemd-tmpfiles.standalone systemd-tmpfiles
221 +
222 + doman man/{systemd-tmpfiles.8,tmpfiles.d.5}
223 +
224 + popd > /dev/null || die
225 +
226 + # service files adapter from opentmpfiles
227 + newinitd "${FILESDIR}"/stmpfiles-dev.initd stmpfiles-dev
228 + newinitd "${FILESDIR}"/stmpfiles-setup.initd stmpfiles-setup
229 +
230 + # same content, but install as different file
231 + newconfd "${FILESDIR}"/stmpfiles.confd stmpfiles-dev
232 + newconfd "${FILESDIR}"/stmpfiles.confd stmpfiles-setup
233 +}
234 +
235 +src_test() {
236 + # 'meson test' will compile full systemd, but we can still outsmart it
237 + "${EPYTHON}" test/test-systemd-tmpfiles.py \
238 + "${BUILD_DIR}"/systemd-tmpfiles.standalone || die "${FUNCNAME} failed"
239 +}
240 +
241 +# adapted from opentmpfiles ebuild
242 +add_service() {
243 + local initd=$1
244 + local runlevel=$2
245 +
246 + elog "Auto-adding '${initd}' service to your ${runlevel} runlevel"
247 + mkdir -p "${EROOT}/etc/runlevels/${runlevel}"
248 + ln -snf "${EPREFIX}/etc/init.d/${initd}" "${EROOT}/etc/runlevels/${runlevel}/${initd}"
249 +}
250 +
251 +pkg_postinst() {
252 + if [[ -z $REPLACING_VERSIONS ]]; then
253 + add_service stmpfiles-dev sysinit
254 + add_service stmpfiles-setup boot
255 + fi
256 +}