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: Mon, 28 May 2018 20:14:09
Message-Id: 1527538421.f20b3833cb60131d3a725cbe0789ab45037655ea.williamh@gentoo
1 commit: f20b3833cb60131d3a725cbe0789ab45037655ea
2 Author: William Hubbs <williamh <AT> gentoo <DOT> org>
3 AuthorDate: Mon May 28 20:12:49 2018 +0000
4 Commit: William Hubbs <williamh <AT> gentoo <DOT> org>
5 CommitDate: Mon May 28 20:13:41 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f20b3833
7
8 sys-apps/baselayout: 2.6 bump
9
10 Package-Manager: Portage-2.3.24, Repoman-2.3.6
11
12 sys-apps/baselayout/Manifest | 1 +
13 sys-apps/baselayout/baselayout-2.6.ebuild | 272 ++++++++++++++++++++++++++++++
14 2 files changed, 273 insertions(+)
15
16 diff --git a/sys-apps/baselayout/Manifest b/sys-apps/baselayout/Manifest
17 index 0512ad54a4a..e11a0bd8f7d 100644
18 --- a/sys-apps/baselayout/Manifest
19 +++ b/sys-apps/baselayout/Manifest
20 @@ -1,2 +1,3 @@
21 DIST baselayout-2.4.1.tar.bz2 31307 BLAKE2B da26f7fbeefa5efecb6e5d9ded6c2bf3148cd1fcfc6ebb86535f5a9c086c4bb55f6a8420a3c0d0f7008251637f3e4653db875ec427745d039f753008d2f21be2 SHA512 e505ad81834aafb574ffee9bc1fce216c1c8c7fa11b0095580f87a37e4b9efb057ee78db7cd5affc64f05d5dd0592c671304414c119b37d86dfaa1e7b84ce7c1
22 DIST baselayout-2.5.tar.bz2 31368 BLAKE2B 73a939bf9a180da151804045ff0e57e4def11e9bca8f55b2b891437712877b718faaf7d6ef006161d92e853c747246b20adc7d26105832c5c3120510325cbc67 SHA512 5705740c0be47a7c76d480c1173fd69a5cfc278351f34ab0c4f54220da81617fc4755c8f61888985611f77881cc89b273775fec593915f344076fc3264ea6934
23 +DIST baselayout-2.6.tar.bz2 31871 BLAKE2B 4a51d173dc5a2837f78cd1247b5eadd89e7d0b5f2dbc72e75f027b0c23a5db9a386c53e756e80240f36ad4d63e3fe421bf9510c18321d7a31fda140ad47b2860 SHA512 5cad5faf56871ae951120643e29db0c39fea6dc845b4755382bd469eca32639ec6cd0cd046d3c439a7cc607b18770036f9c256260d35beaffb094e23cb13740b
24
25 diff --git a/sys-apps/baselayout/baselayout-2.6.ebuild b/sys-apps/baselayout/baselayout-2.6.ebuild
26 new file mode 100644
27 index 00000000000..866701708dc
28 --- /dev/null
29 +++ b/sys-apps/baselayout/baselayout-2.6.ebuild
30 @@ -0,0 +1,272 @@
31 +# Copyright 1999-2018 Gentoo Foundation
32 +# Distributed under the terms of the GNU General Public License v2
33 +
34 +EAPI=6
35 +
36 +inherit multilib versionator prefix
37 +
38 +DESCRIPTION="Filesystem baselayout and init scripts"
39 +HOMEPAGE="https://www.gentoo.org/"
40 +if [[ ${PV} = 9999 ]]; then
41 + EGIT_REPO_URI="https://anongit.gentoo.org/git/proj/${PN}.git"
42 + inherit git-r3
43 +else
44 + SRC_URI="https://gitweb.gentoo.org/proj/${PN}.git/snapshot/${P}.tar.bz2"
45 + KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd"
46 +fi
47 +
48 +LICENSE="GPL-2"
49 +SLOT="0"
50 +IUSE="build kernel_FreeBSD kernel_linux +split-usr"
51 +
52 +pkg_setup() {
53 + multilib_layout
54 +}
55 +
56 +# Create our multilib dirs - the Makefile has no knowledge of this
57 +multilib_layout() {
58 + local def_libdir libdir libdirs
59 + def_libdir=$(get_abi_LIBDIR $DEFAULT_ABI)
60 + libdirs=$(get_all_libdirs)
61 + : ${libdirs:=lib} # it isn't that we don't trust multilib.eclass...
62 +
63 + [ -z "${def_libdir}" ] && die "your DEFAULT_ABI=$DEFAULT_ABI appears to be invalid"
64 +
65 + # figure out which paths should be symlinks and which should be directories
66 + local dirs syms exp d
67 + for libdir in ${libdirs} ; do
68 + if use split-usr ; then
69 + exp=( {,usr/,usr/local/}${libdir} )
70 + else
71 + exp=( {usr/,usr/local/}${libdir} )
72 + fi
73 + for d in "${exp[@]}" ; do
74 + # most things should be dirs
75 + if [ "${SYMLINK_LIB}" = "yes" ] && [ "${libdir}" = "lib" ] ; then
76 + [ ! -h "${d}" ] && [ -e "${d}" ] && dirs+=" ${d}"
77 + else
78 + [ -h "${d}" ] && syms+=" ${d}"
79 + fi
80 + done
81 + done
82 + if [ -n "${syms}${dirs}" ] ; then
83 + ewarn "Your system profile has SYMLINK_LIB=${SYMLINK_LIB:-no}, so that means you need to"
84 + ewarn "have these paths configured as follows:"
85 + [ -n "${dirs}" ] && ewarn "symlinks to '${def_libdir}':${dirs}"
86 + [ -n "${syms}" ] && ewarn "directories:${syms}"
87 + ewarn "The ebuild will attempt to fix these, but only for trivial conversions."
88 + ewarn "If things fail, you will need to manually create/move the directories."
89 + echo
90 + fi
91 +
92 + # setup symlinks and dirs where we expect them to be; do not migrate
93 + # data ... just fall over in that case.
94 + local prefix prefix_lst
95 + if use split-usr ; then
96 + prefix_lst=( "${EROOT}"{,usr/,usr/local/} )
97 + else
98 + prefix_lst=( "${EROOT}"{usr/,usr/local/} )
99 + fi
100 + for prefix in "${prefix_lst[@]}"; do
101 + if [ "${SYMLINK_LIB}" = yes ] ; then
102 + # we need to make sure "lib" points to the native libdir
103 + if [ -h "${prefix}lib" ] ; then
104 + # it's already a symlink! assume it's pointing to right place ...
105 + continue
106 + elif [ -d "${prefix}lib" ] ; then
107 + # "lib" is a dir, so need to convert to a symlink
108 + ewarn "Converting ${prefix}lib from a dir to a symlink"
109 + rm -f "${prefix}lib"/.keep
110 + if rmdir "${prefix}lib" 2>/dev/null ; then
111 + ln -s ${def_libdir} "${prefix}lib" || die
112 + else
113 + die "non-empty dir found where we needed a symlink: ${prefix}lib"
114 + fi
115 + else
116 + # nothing exists, so just set it up sanely
117 + ewarn "Initializing ${prefix}lib as a symlink"
118 + mkdir -p "${prefix}" || die
119 + rm -f "${prefix}lib" || die
120 + ln -s ${def_libdir} "${prefix}lib" || die
121 + mkdir -p "${prefix}${def_libdir}" #423571
122 + fi
123 + else
124 + # we need to make sure "lib" is a dir
125 + if [ -h "${prefix}lib" ] ; then
126 + # "lib" is a symlink, so need to convert to a dir
127 + ewarn "Converting ${prefix}lib from a symlink to a dir"
128 + rm -f "${prefix}lib" || die
129 + if [ -d "${prefix}lib32" ] ; then
130 + ewarn "Migrating ${prefix}lib32 to ${prefix}lib"
131 + mv "${prefix}lib32" "${prefix}lib" || die
132 + else
133 + mkdir -p "${prefix}lib" || die
134 + fi
135 + elif [ -d "${prefix}lib" ] && ! has lib32 ${libdirs} ; then
136 + # make sure the old "lib" ABI location does not exist; we
137 + # only symlinked the lib dir on systems where we moved it
138 + # to "lib32" ...
139 + case ${CHOST} in
140 + *-gentoo-freebsd*) ;; # We want it the other way on fbsd.
141 + i?86*|x86_64*|powerpc*|sparc*|s390*)
142 + if [[ -d ${prefix}lib32 && ! -h ${prefix}lib32 ]] ; then
143 + rm -f "${prefix}lib32"/.keep
144 + if ! rmdir "${prefix}lib32" 2>/dev/null ; then
145 + ewarn "You need to merge ${prefix}lib32 into ${prefix}lib"
146 + die "non-empty dir found where there should be none: ${prefix}lib32"
147 + fi
148 + fi
149 + ;;
150 + esac
151 + else
152 + # nothing exists, so just set it up sanely
153 + ewarn "Initializing ${prefix}lib as a dir"
154 + mkdir -p "${prefix}lib" || die
155 + fi
156 + fi
157 + done
158 + if ! use split-usr ; then
159 + for libdir in ${libdirs}; do
160 + if [[ ! -e "${EROOT}${libdir}" ]]; then
161 + ln -s usr/"${libdir}" "${EROOT}${libdir}"
162 + fi
163 + done
164 + fi
165 +}
166 +
167 +pkg_preinst() {
168 + # This is written in src_install (so it's in CONTENTS), but punt all
169 + # pending updates to avoid user having to do etc-update (and make the
170 + # pkg_postinst logic simpler).
171 + rm -f "${EROOT}"/etc/._cfg????_gentoo-release
172 +
173 + # We need to install directories and maybe some dev nodes when building
174 + # stages, but they cannot be in CONTENTS.
175 + # Also, we cannot reference $S as binpkg will break so we do this.
176 + multilib_layout
177 + if use build ; then
178 + if use split-usr ; then
179 + emake -C "${ED}/usr/share/${PN}" DESTDIR="${EROOT}" layout
180 + else
181 + emake -C "${ED}/usr/share/${PN}" DESTDIR="${EROOT}" layout-usrmerge
182 + fi
183 + fi
184 + rm -f "${ED}"/usr/share/${PN}/Makefile
185 +}
186 +
187 +src_prepare() {
188 + default
189 + if use prefix; then
190 + hprefixify -e "/EUID/s,0,${EUID}," -q '"' etc/profile
191 + hprefixify etc/{env.d/50baselayout,shells} share.Linux/passwd
192 + echo PATH=/usr/bin:/bin >> etc/env.d/99host
193 + echo ROOTPATH=/usr/sbin:/sbin:/usr/bin:/bin >> etc/env.d/99host
194 + fi
195 +
196 + # handle multilib paths. do it here because we want this behavior
197 + # regardless of the C library that you're using. we do explicitly
198 + # list paths which the native ldconfig searches, but this isn't
199 + # problematic as it doesn't change the resulting ld.so.cache or
200 + # take longer to generate. similarly, listing both the native
201 + # path and the symlinked path doesn't change the resulting cache.
202 + local libdir ldpaths
203 + for libdir in $(get_all_libdirs) ; do
204 + ldpaths+=":${EPREFIX}/${libdir}:${EPREFIX}/usr/${libdir}"
205 + ldpaths+=":${EPREFIX}/usr/local/${libdir}"
206 + done
207 + echo "LDPATH='${ldpaths#:}'" >> etc/env.d/50baselayout
208 +
209 + # rc-scripts version for testing of features that *should* be present
210 + echo "Gentoo Base System release ${PV}" > etc/gentoo-release
211 +}
212 +
213 +src_install() {
214 + emake \
215 + OS=$(usex kernel_FreeBSD BSD Linux) \
216 + DESTDIR="${ED}" \
217 + install
218 + dodoc ChangeLog
219 +
220 + # need the makefile in pkg_preinst
221 + insinto /usr/share/${PN}
222 + doins Makefile
223 +}
224 +
225 +pkg_postinst() {
226 + local x
227 +
228 + # We installed some files to /usr/share/baselayout instead of /etc to stop
229 + # (1) overwriting the user's settings
230 + # (2) screwing things up when attempting to merge files
231 + # (3) accidentally packaging up personal files with quickpkg
232 + # If they don't exist then we install them
233 + for x in master.passwd passwd shadow group fstab ; do
234 + [ -e "${EROOT}etc/${x}" ] && continue
235 + [ -e "${EROOT}usr/share/baselayout/${x}" ] || continue
236 + cp -p "${EROOT}usr/share/baselayout/${x}" "${EROOT}"etc
237 + done
238 +
239 + # Force shadow permissions to not be world-readable #260993
240 + for x in shadow ; do
241 + [ -e "${EROOT}etc/${x}" ] && chmod o-rwx "${EROOT}etc/${x}"
242 + done
243 +
244 + # Take care of the etc-update for the user
245 + if [ -e "${EROOT}"etc/._cfg0000_gentoo-release ] ; then
246 + mv "${EROOT}"etc/._cfg0000_gentoo-release "${EROOT}"etc/gentoo-release
247 + fi
248 +
249 + # whine about users that lack passwords #193541
250 + if [[ -e "${EROOT}"etc/shadow ]] ; then
251 + local bad_users=$(sed -n '/^[^:]*::/s|^\([^:]*\)::.*|\1|p' "${EROOT}"/etc/shadow)
252 + if [[ -n ${bad_users} ]] ; then
253 + echo
254 + ewarn "The following users lack passwords!"
255 + ewarn ${bad_users}
256 + fi
257 + fi
258 +
259 + # whine about users with invalid shells #215698
260 + if [[ -e "${EROOT}"etc/passwd ]] ; then
261 + local bad_shells=$(awk -F: 'system("test -e " $7) { print $1 " - " $7}' "${EROOT}"etc/passwd | sort)
262 + if [[ -n ${bad_shells} ]] ; then
263 + echo
264 + ewarn "The following users have non-existent shells!"
265 + ewarn "${bad_shells}"
266 + fi
267 + fi
268 +
269 + # https://bugs.gentoo.org/361349
270 + if use kernel_linux; then
271 + mkdir -p "${EROOT}"run
272 +
273 + local found fstype mountpoint
274 + while read -r _ mountpoint fstype _; do
275 + [[ ${mountpoint} = /run ]] && [[ ${fstype} = tmpfs ]] && found=1
276 + done < "${ROOT}"proc/mounts
277 + [[ -z ${found} ]] &&
278 + ewarn "You should reboot now to get /run mounted with tmpfs!"
279 + fi
280 +
281 + for x in ${REPLACING_VERSIONS}; do
282 + if ! version_is_at_least 2.4 ${x}; then
283 + ewarn "After updating ${EROOT}etc/profile, please run"
284 + ewarn "env-update && . /etc/profile"
285 + fi
286 +
287 + if ! version_is_at_least 2.5 ${x}; then
288 + ewarn "Please run env-update then log out and back in to"
289 + ewarn "update your path."
290 + fi
291 + # clean up after 2.5 typos
292 + # https://bugs.gentoo.org/show_bug.cgi?id=656380
293 + if [[ ${x} == 2.5 ]]; then
294 + rm -fr "${EROOT}{,usr"
295 + fi
296 + done
297 +
298 + if [[ -e "${EROOT}"etc/env.d/00basic ]]; then
299 + ewarn "${EROOT}etc/env.d/00basic is now ${EROOT}etc/env.d/50baselayout"
300 + ewarn "Please migrate your changes."
301 + fi
302 +}