Gentoo Archives: gentoo-commits

From: William Hubbs <williamh@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-apps/baselayout/
Date: Sat, 28 Jan 2023 22:14:20
Message-Id: 1674944022.1cbc36adc37249afbc864623bf2a3f4fb5a9c35d.williamh@gentoo
1 commit: 1cbc36adc37249afbc864623bf2a3f4fb5a9c35d
2 Author: William Hubbs <williamh <AT> gentoo <DOT> org>
3 AuthorDate: Sat Jan 28 22:13:42 2023 +0000
4 Commit: William Hubbs <williamh <AT> gentoo <DOT> org>
5 CommitDate: Sat Jan 28 22:13:42 2023 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1cbc36ad
7
8 sys-apps/baselayout: drop 2.13
9
10 Signed-off-by: William Hubbs <williamh <AT> gentoo.org>
11
12 sys-apps/baselayout/baselayout-2.13.ebuild | 376 -----------------------------
13 1 file changed, 376 deletions(-)
14
15 diff --git a/sys-apps/baselayout/baselayout-2.13.ebuild b/sys-apps/baselayout/baselayout-2.13.ebuild
16 deleted file mode 100644
17 index 97ceb30c3290..000000000000
18 --- a/sys-apps/baselayout/baselayout-2.13.ebuild
19 +++ /dev/null
20 @@ -1,376 +0,0 @@
21 -# Copyright 1999-2023 Gentoo Authors
22 -# Distributed under the terms of the GNU General Public License v2
23 -
24 -EAPI=7
25 -
26 -inherit multilib prefix
27 -
28 -DESCRIPTION="Filesystem baselayout and init scripts"
29 -HOMEPAGE="https://wiki.gentoo.org/wiki/No_homepage"
30 -if [[ ${PV} = 9999 ]]; then
31 - EGIT_REPO_URI="https://anongit.gentoo.org/git/proj/${PN}.git"
32 - inherit git-r3
33 -else
34 - SRC_URI="https://gitweb.gentoo.org/proj/${PN}.git/snapshot/${P}.tar.bz2"
35 - KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris ~x86-winnt"
36 -fi
37 -
38 -LICENSE="GPL-2"
39 -SLOT="0"
40 -IUSE="build +split-usr"
41 -
42 -RDEPEND="!sys-apps/baselayout-prefix"
43 -
44 -pkg_setup() {
45 - multilib_layout
46 -}
47 -
48 -riscv_compat_symlink() {
49 - # Here we apply some special sauce for riscv.
50 - # Two multilib layouts exist for now:
51 - # 1) one level libdirs, (32bit) "lib" and (64bit) "lib64"
52 - # these are chosen by us to closely resemble other arches
53 - # 2) two level libdirs, "lib64/lp64d" "lib64/lp64" "lib32/ilp32d" ...
54 - # this is the glibc/gcc default
55 - # Unfortunately, the default has only one fallback, which is "lib"
56 - # for both 32bit and 64bit. So things do not break in 1), we need
57 - # to provide compatibility symlinks...
58 -
59 - # This function has exactly two parameters:
60 - # - the default libdir, to determine if 1) or 2) applies
61 - # - the location of the symlink (which points to ".")
62 -
63 - # Note: we call this only in the ${SYMLINK_LIB} = no codepath, since
64 - # there never was a ${SYMLINK_LIB} = yes riscv profile.
65 -
66 - case ${CHOST} in
67 - riscv*)
68 - # are we on a one level libdir profile? is there no symlink yet?
69 - if [[ ${1} != */* && ! -L ${2} ]] ; then
70 - ln -s . $2 || die "Unable to make $2 riscv compatibility symlink"
71 - fi
72 - ;;
73 - esac
74 -}
75 -
76 -# Create our multilib dirs - the Makefile has no knowledge of this
77 -multilib_layout() {
78 - local dir def_libdir libdir libdirs
79 - local prefix prefix_lst
80 - def_libdir=$(get_abi_LIBDIR $DEFAULT_ABI)
81 - libdirs=$(get_all_libdirs)
82 -
83 - if [[ -z "${SYMLINK_LIB}" || ${SYMLINK_LIB} = no ]] ; then
84 - prefix_lst=( "${EROOT}"/{,usr/,usr/local/} )
85 - for prefix in "${prefix_lst[@]}"; do
86 - for libdir in ${libdirs}; do
87 - dir="${prefix}${libdir}"
88 - if [[ -e "${dir}" ]]; then
89 - [[ ! -d "${dir}" ]] &&
90 - die "${dir} exists but is not a directory"
91 - continue
92 - fi
93 - if ! use split-usr && [[ ${prefix} = ${EROOT}/ ]]; then
94 - libdir="${libdir%%/*}"
95 - dir="${prefix}${libdir}"
96 - einfo "symlinking ${dir} to usr/${libdir}"
97 - ln -s usr/${libdir} ${dir} ||
98 - die "Unable to make ${dir} symlink"
99 - else
100 - einfo "creating directory ${dir}"
101 - mkdir -p "${dir}" ||
102 - die "Unable to create ${dir} directory"
103 - fi
104 - done
105 - [[ -d "${prefix}${def_libdir}" ]] && riscv_compat_symlink "${def_libdir}" "${prefix}${def_libdir}/${DEFAULT_ABI}"
106 - done
107 - return 0
108 - fi
109 -
110 - [ -z "${def_libdir}" ] &&
111 - die "your DEFAULT_ABI=$DEFAULT_ABI appears to be invalid"
112 -
113 - # figure out which paths should be symlinks and which should be directories
114 - local dirs syms exp d
115 - for libdir in ${libdirs} ; do
116 - if use split-usr ; then
117 - exp=( {,usr/,usr/local/}${libdir} )
118 - else
119 - exp=( {usr/,usr/local/}${libdir} )
120 - fi
121 - for d in "${exp[@]}" ; do
122 - # most things should be dirs
123 - if [ "${SYMLINK_LIB}" = "yes" ] && [ "${libdir}" = "lib" ] ; then
124 - [ ! -h "${d}" ] && [ -e "${d}" ] && dirs+=" ${d}"
125 - else
126 - [ -h "${d}" ] && syms+=" ${d}"
127 - fi
128 - done
129 - done
130 - if [ -n "${syms}${dirs}" ] ; then
131 - ewarn "Your system profile has SYMLINK_LIB=${SYMLINK_LIB:-no}, so that means you need to"
132 - ewarn "have these paths configured as follows:"
133 - [ -n "${dirs}" ] && ewarn "symlinks to '${def_libdir}':${dirs}"
134 - [ -n "${syms}" ] && ewarn "directories:${syms}"
135 - ewarn "The ebuild will attempt to fix these, but only for trivial conversions."
136 - ewarn "If things fail, you will need to manually create/move the directories."
137 - echo
138 - fi
139 -
140 - # setup symlinks and dirs where we expect them to be; do not migrate
141 - # data ... just fall over in that case.
142 - if use split-usr ; then
143 - prefix_lst=( "${EROOT}"/{,usr/,usr/local/} )
144 - else
145 - prefix_lst=( "${EROOT}"/{usr/,usr/local/} )
146 - fi
147 - for prefix in "${prefix_lst[@]}"; do
148 - if [ "${SYMLINK_LIB}" = yes ] ; then
149 - # we need to make sure "lib" points to the native libdir
150 - if [ -h "${prefix}lib" ] ; then
151 - # it's already a symlink! assume it's pointing to right place ...
152 - continue
153 - elif [ -d "${prefix}lib" ] ; then
154 - # "lib" is a dir, so need to convert to a symlink
155 - ewarn "Converting ${prefix}lib from a dir to a symlink"
156 - rm -f "${prefix}lib"/.keep || die
157 - if rmdir "${prefix}lib" 2>/dev/null ; then
158 - ln -s ${def_libdir} "${prefix}lib" || die
159 - else
160 - die "non-empty dir found where we needed a symlink: ${prefix}lib"
161 - fi
162 - else
163 - # nothing exists, so just set it up sanely
164 - ewarn "Initializing ${prefix}lib as a symlink"
165 - mkdir -p "${prefix}" || die
166 - rm -f "${prefix}lib" || die
167 - ln -s ${def_libdir} "${prefix}lib" || die
168 - mkdir -p "${prefix}${def_libdir}" || die #423571
169 - fi
170 - else
171 - # we need to make sure "lib" is a dir
172 - if [ -h "${prefix}lib" ] ; then
173 - # "lib" is a symlink, so need to convert to a dir
174 - ewarn "Converting ${prefix}lib from a symlink to a dir"
175 - rm -f "${prefix}lib" || die
176 - if [ -d "${prefix}lib32" ] ; then
177 - ewarn "Migrating ${prefix}lib32 to ${prefix}lib"
178 - mv "${prefix}lib32" "${prefix}lib" || die
179 - else
180 - mkdir -p "${prefix}lib" || die
181 - fi
182 - elif [ -d "${prefix}lib" ] && ! has lib32 ${libdirs} ; then
183 - # make sure the old "lib" ABI location does not exist; we
184 - # only symlinked the lib dir on systems where we moved it
185 - # to "lib32" ...
186 - case ${CHOST} in
187 - i?86*|x86_64*|powerpc*|sparc*|s390*)
188 - if [[ -d ${prefix}lib32 && ! -h ${prefix}lib32 ]] ; then
189 - rm -f "${prefix}lib32"/.keep || die
190 - if ! rmdir "${prefix}lib32" 2>/dev/null ; then
191 - ewarn "You need to merge ${prefix}lib32 into ${prefix}lib"
192 - die "non-empty dir found where there should be none: ${prefix}lib32"
193 - fi
194 - fi
195 - ;;
196 - esac
197 - else
198 - # nothing exists, so just set it up sanely
199 - ewarn "Initializing ${prefix}lib as a dir"
200 - mkdir -p "${prefix}lib" || die
201 - fi
202 - fi
203 - done
204 - if ! use split-usr ; then
205 - for libdir in ${libdirs}; do
206 - if [[ ! -e "${EROOT}${libdir}" ]]; then
207 - ln -s usr/"${libdir}" "${EROOT}${libdir}" ||
208 - die "Unable to make ${EROOT}${libdir} symlink"
209 - fi
210 - done
211 - fi
212 -}
213 -
214 -pkg_preinst() {
215 - # This is written in src_install (so it's in CONTENTS), but punt all
216 - # pending updates to avoid user having to do etc-update (and make the
217 - # pkg_postinst logic simpler).
218 - rm -f "${EROOT}"/etc/._cfg????_gentoo-release || die
219 -
220 - # We need to install directories and maybe some dev nodes when building
221 - # stages, but they cannot be in CONTENTS.
222 - # Also, we cannot reference $S as binpkg will break so we do this.
223 - multilib_layout
224 - if use build ; then
225 - if use split-usr ; then
226 - emake -C "${ED}/usr/share/${PN}" DESTDIR="${EROOT}" layout
227 - else
228 - emake -C "${ED}/usr/share/${PN}" DESTDIR="${EROOT}" layout-usrmerge
229 - fi
230 - fi
231 - rm -f "${ED}"/usr/share/${PN}/Makefile || die
232 -}
233 -
234 -src_prepare() {
235 - default
236 -
237 - # don't want symlinked directories in PATH on systems with usr-merge
238 - if ! use split-usr && ! use prefix-guest; then
239 - sed \
240 - -e 's|:/usr/sbin:|:|g' \
241 - -e 's|:/sbin:|:|g' \
242 - -e 's|:/bin:|:|g' \
243 - -i etc/env.d/50baselayout || die
244 - fi
245 -
246 - if use prefix; then
247 - hprefixify -e "/EUID/s,0,${EUID}," -q '"' etc/profile
248 - hprefixify etc/shells share.Linux/passwd
249 - hprefixify -w '/PATH=/' etc/env.d/50baselayout
250 - hprefixify -w 1 etc/env.d/50baselayout
251 - echo PATH=/usr/sbin:/sbin:/usr/bin:/bin >> etc/env.d/99host
252 -
253 - # change branding
254 - sed -i \
255 - -e '/gentoo-release/s/Gentoo Base/Gentoo Prefix Base/' \
256 - -e '/make_os_release/s/${OS}/Prefix/' \
257 - Makefile || die
258 - fi
259 -
260 - # handle multilib paths. do it here because we want this behavior
261 - # regardless of the C library that you're using. we do explicitly
262 - # list paths which the native ldconfig searches, but this isn't
263 - # problematic as it doesn't change the resulting ld.so.cache or
264 - # take longer to generate. similarly, listing both the native
265 - # path and the symlinked path doesn't change the resulting cache.
266 - local libdir ldpaths
267 - for libdir in $(get_all_libdirs) ; do
268 - if use split-usr || use prefix-guest; then
269 - ldpaths+=":${EPREFIX}/${libdir}"
270 - fi
271 - ldpaths+=":${EPREFIX}/usr/${libdir}"
272 - ldpaths+=":${EPREFIX}/usr/local/${libdir}"
273 - done
274 - echo "LDPATH='${ldpaths#:}'" >> etc/env.d/50baselayout
275 -}
276 -
277 -src_install() {
278 - emake \
279 - DESTDIR="${ED}" \
280 - install
281 -
282 - if [[ ${CHOST} == *-darwin* ]] ; then
283 - # add SDK path which contains development manpages
284 - echo "MANPATH=${EPREFIX}/MacOSX.sdk/usr/share/man" \
285 - > "${ED}"/etc/env.d/98macos-sdk
286 - fi
287 -
288 - # need the makefile in pkg_preinst
289 - insinto /usr/share/${PN}
290 - doins Makefile
291 -
292 - dodoc ChangeLog
293 -
294 - # bug 858596
295 - if use prefix-guest ; then
296 - dodir sbin
297 - cat > "${ED}"/sbin/runscript <<- EOF
298 - #!/usr/bin/env sh
299 - source "${EPREFIX}/lib/gentoo/functions.sh"
300 -
301 - eerror "runscript/openrc-run not supported by Gentoo Prefix Base System release ${PV}" 1>&2
302 - exit 1
303 - EOF
304 - chmod 755 "${ED}"/sbin/runscript || die
305 - cp "${ED}"/sbin/{runscript,openrc-run} || die
306 - fi
307 -}
308 -
309 -pkg_postinst() {
310 - local x
311 -
312 - # We installed some files to /usr/share/baselayout instead of /etc to stop
313 - # (1) overwriting the user's settings
314 - # (2) screwing things up when attempting to merge files
315 - # (3) accidentally packaging up personal files with quickpkg
316 - # If they don't exist then we install them
317 - for x in master.passwd passwd shadow group fstab ; do
318 - [ -e "${EROOT}/etc/${x}" ] && continue
319 - [ -e "${EROOT}/usr/share/baselayout/${x}" ] || continue
320 - cp -p "${EROOT}/usr/share/baselayout/${x}" "${EROOT}"/etc || die
321 - done
322 -
323 - # Force shadow permissions to not be world-readable #260993
324 - for x in shadow ; do
325 - if [ -e "${EROOT}/etc/${x}" ] ; then
326 - chmod o-rwx "${EROOT}/etc/${x}" || die
327 - fi
328 - done
329 -
330 - # Take care of the etc-update for the user
331 - if [ -e "${EROOT}"/etc/._cfg0000_gentoo-release ] ; then
332 - mv "${EROOT}"/etc/._cfg0000_gentoo-release "${EROOT}"/etc/gentoo-release || die
333 - fi
334 -
335 - # whine about users that lack passwords #193541
336 - if [[ -e "${EROOT}"/etc/shadow ]] ; then
337 - local bad_users=$(sed -n '/^[^:]*::/s|^\([^:]*\)::.*|\1|p' "${EROOT}"/etc/shadow)
338 - if [[ -n ${bad_users} ]] ; then
339 - echo
340 - ewarn "The following users lack passwords!"
341 - ewarn ${bad_users}
342 - fi
343 - fi
344 -
345 - # whine about users with invalid shells #215698
346 - if [[ -e "${EROOT}"/etc/passwd ]] ; then
347 - local bad_shells=$(awk -F: 'system("test -e ${ROOT}" $7) { print $1 " - " $7}' "${EROOT}"/etc/passwd | sort)
348 - if [[ -n ${bad_shells} ]] ; then
349 - echo
350 - ewarn "The following users have non-existent shells!"
351 - ewarn "${bad_shells}"
352 - fi
353 - fi
354 -
355 - # https://bugs.gentoo.org/361349
356 - if use kernel_linux; then
357 - mkdir -p "${EROOT}"/run || die
358 -
359 - local found fstype mountpoint
360 - while read -r _ mountpoint fstype _; do
361 - [[ ${mountpoint} = /run ]] && [[ ${fstype} = tmpfs ]] && found=1
362 - done < "${ROOT}"/proc/mounts
363 - [[ -z ${found} ]] &&
364 - ewarn "You should reboot now to get /run mounted with tmpfs!"
365 - fi
366 -
367 - for x in ${REPLACING_VERSIONS}; do
368 - if ver_test 2.4 -lt ${x}; then
369 - ewarn "After updating ${EROOT}/etc/profile, please run"
370 - ewarn "env-update && . /etc/profile"
371 - fi
372 -
373 - if ver_test 2.6 -lt ${x}; then
374 - ewarn "Please run env-update then log out and back in to"
375 - ewarn "update your path."
376 - fi
377 - # clean up after 2.5 typos
378 - # https://bugs.gentoo.org/show_bug.cgi?id=656380
379 - if [[ ${x} == 2.5 ]]; then
380 - rm -fr "${EROOT}/{,usr" || die
381 - fi
382 - done
383 -
384 - if [[ -e "${EROOT}"/etc/env.d/00basic ]]; then
385 - ewarn "${EROOT}/etc/env.d/00basic is now ${EROOT}/etc/env.d/50baselayout"
386 - ewarn "Please migrate your changes."
387 - fi
388 -
389 - # Restore /var/run and /var/lock if we just removed them from 2.11 or 2.12
390 - if [[ ! -L ${EROOT}/var/run && ! -e ${EROOT}/var/run ]]; then
391 - ln -s ../run "${EROOT}"/var/run
392 - fi
393 - if [[ ! -L ${EROOT}/var/lock && ! -e ${EROOT}/var/lock ]]; then
394 - ln -s ../run/lock "${EROOT}"/var/lock
395 - fi
396 -}