Gentoo Archives: gentoo-commits

From: Lars Wendler <polynomial-c@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-apps/shadow/
Date: Sat, 25 Jan 2020 10:06:58
Message-Id: 1579946810.6faf33f53659138cd8aeb4f9ce9d75b2f81037da.polynomial-c@gentoo
1 commit: 6faf33f53659138cd8aeb4f9ce9d75b2f81037da
2 Author: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
3 AuthorDate: Sat Jan 25 10:05:24 2020 +0000
4 Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
5 CommitDate: Sat Jan 25 10:06:50 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6faf33f5
7
8 sys-apps/shadow: Bump to version 4.8.1
9
10 Package-Manager: Portage-2.3.85, Repoman-2.3.20
11 Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>
12
13 sys-apps/shadow/Manifest | 1 +
14 sys-apps/shadow/shadow-4.8.1.ebuild | 232 ++++++++++++++++++++++++++++++++++++
15 2 files changed, 233 insertions(+)
16
17 diff --git a/sys-apps/shadow/Manifest b/sys-apps/shadow/Manifest
18 index 2833ecca8e6..37a6f8d7768 100644
19 --- a/sys-apps/shadow/Manifest
20 +++ b/sys-apps/shadow/Manifest
21 @@ -1,3 +1,4 @@
22 DIST shadow-4.6.tar.gz 3804282 BLAKE2B 268c90e7daba138827aec6039f428f52cdcf7929743fa1f49f801cc669de7456ec5a69531194cdb29f051ce7d0b2f1e966fdf2513a9fc8f7fbdeb29d786a509f SHA512 36358333e7f03ef558772f3361bc5851a7d7fd3d85c993a6b732e37304b8068b2893d55607b9bfe8b8eed616a687264f947ff66cefc74ea1a48ba9396d464714
23 DIST shadow-4.7.tar.gz 3833335 BLAKE2B 8e030d3dcc5eb76332ff76aad8e9141edb4ae660f56dd3b420968c538d3022a72ab620710b9274b9afb44f497399f5c4ceef339b7d2c52106b9b8368ff127654 SHA512 9b134dc90d8fb39bc72db69ddb78cef6263921c8a2f00abc00ac796bf468ac18393399920eec14bd2a78b814a06fc18eb6f5685ede13fe222fc66b2e411cbb01
24 +DIST shadow-4.8.1.tar.xz 1611196 BLAKE2B 952707cdd55dc6c00dcbc60dbc3bf84ac618dbe916b36d993802b3ce42594de332a9bc22933a28881af3d317a340eab017ada55511b4e4fbc3ca6b422c4bc254 SHA512 780a983483d847ed3c91c82064a0fa902b6f4185225978241bc3bc03fcc3aa143975b46aee43151c6ba43efcfdb1819516b76ba7ad3d1d3c34fcc38ea42e917b
25 DIST shadow-4.8.tar.xz 1609060 BLAKE2B 9d0b515e40f45c0baf420ef7ffaf5b6dd7989b26c93fc6dd610876263ac22e61fbc2821649d347c28055ae84f64cd5ab5c2435450c55339c80b4ae5062ccc44f SHA512 1c607aec541400fc179d6cbbac7511289c618ab2ce6ee9d7c18a8bfda00421c62d4b9e58aff52b5f82d485468e7db955c186ea0faad9a08003ffc01bdf2ccece
26
27 diff --git a/sys-apps/shadow/shadow-4.8.1.ebuild b/sys-apps/shadow/shadow-4.8.1.ebuild
28 new file mode 100644
29 index 00000000000..124f30408d1
30 --- /dev/null
31 +++ b/sys-apps/shadow/shadow-4.8.1.ebuild
32 @@ -0,0 +1,232 @@
33 +# Copyright 1999-2020 Gentoo Authors
34 +# Distributed under the terms of the GNU General Public License v2
35 +
36 +EAPI=7
37 +
38 +inherit autotools libtool pam
39 +
40 +DESCRIPTION="Utilities to deal with user accounts"
41 +HOMEPAGE="https://github.com/shadow-maint/shadow"
42 +SRC_URI="https://github.com/shadow-maint/shadow/releases/download/${PV}/${P}.tar.xz"
43 +
44 +LICENSE="BSD GPL-2"
45 +SLOT="0"
46 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sh ~sparc ~x86"
47 +IUSE="acl audit bcrypt +cracklib nls pam selinux skey split-usr +su xattr"
48 +# Taken from the man/Makefile.am file.
49 +LANGS=( cs da de es fi fr hu id it ja ko pl pt_BR ru sv tr zh_CN zh_TW )
50 +
51 +DEPEND="
52 + acl? ( sys-apps/acl:0= )
53 + audit? ( >=sys-process/audit-2.6:0= )
54 + cracklib? ( >=sys-libs/cracklib-2.7-r3:0= )
55 + nls? ( virtual/libintl )
56 + pam? ( sys-libs/pam:0= )
57 + skey? ( sys-auth/skey:0= )
58 + selinux? (
59 + >=sys-libs/libselinux-1.28:0=
60 + sys-libs/libsemanage:0=
61 + )
62 + su? ( !sys-apps/util-linux[su] )
63 + xattr? ( sys-apps/attr:0= )
64 +"
65 +BDEPEND="
66 + app-arch/xz-utils
67 + sys-devel/gettext
68 +"
69 +RDEPEND="
70 + ${DEPEND}
71 + pam? ( >=sys-auth/pambase-20150213 )
72 +"
73 +
74 +PATCHES=(
75 + "${FILESDIR}/${PN}-4.1.3-dots-in-usernames.patch"
76 +)
77 +
78 +src_prepare() {
79 + default
80 + eautoreconf
81 + #elibtoolize
82 +}
83 +
84 +src_configure() {
85 + local myeconfargs=(
86 + --disable-account-tools-setuid
87 + --enable-shared=no
88 + --enable-static=yes
89 + --with-btrfs
90 + --without-group-name-max-length
91 + --without-tcb
92 + $(use_enable nls)
93 + $(use_with acl)
94 + $(use_with audit)
95 + $(use_with bcrypt)
96 + $(use_with cracklib libcrack)
97 + $(use_with elibc_glibc nscd)
98 + $(use_with pam libpam)
99 + $(use_with selinux)
100 + $(use_with skey)
101 + $(use_with su)
102 + $(use_with xattr attr)
103 + )
104 + econf "${myeconfargs[@]}"
105 +
106 + has_version 'sys-libs/uclibc[-rpc]' && sed -i '/RLOGIN/d' config.h #425052
107 +
108 + if use nls ; then
109 + local l langs="po" # These are the pot files.
110 + for l in ${LANGS[*]} ; do
111 + has ${l} ${LINGUAS-${l}} && langs+=" ${l}"
112 + done
113 + sed -i "/^SUBDIRS = /s:=.*:= ${langs}:" man/Makefile || die
114 + fi
115 +}
116 +
117 +set_login_opt() {
118 + local comment="" opt=$1 val=$2
119 + if [[ -z ${val} ]]; then
120 + comment="#"
121 + sed -i \
122 + -e "/^${opt}\>/s:^:#:" \
123 + "${ED}"/etc/login.defs || die
124 + else
125 + sed -i -r \
126 + -e "/^#?${opt}\>/s:.*:${opt} ${val}:" \
127 + "${ED}"/etc/login.defs
128 + fi
129 + local res=$(grep "^${comment}${opt}\>" "${ED}"/etc/login.defs)
130 + einfo "${res:-Unable to find ${opt} in /etc/login.defs}"
131 +}
132 +
133 +src_install() {
134 + emake DESTDIR="${D}" suidperms=4711 install
135 +
136 + # Remove libshadow and libmisc; see bug 37725 and the following
137 + # comment from shadow's README.linux:
138 + # Currently, libshadow.a is for internal use only, so if you see
139 + # -lshadow in a Makefile of some other package, it is safe to
140 + # remove it.
141 + rm -f "${ED}"/{,usr/}$(get_libdir)/lib{misc,shadow}.{a,la}
142 +
143 + insinto /etc
144 + if ! use pam ; then
145 + insopts -m0600
146 + doins etc/login.access etc/limits
147 + fi
148 +
149 + # needed for 'useradd -D'
150 + insinto /etc/default
151 + insopts -m0600
152 + doins "${FILESDIR}"/default/useradd
153 +
154 + if use split-usr ; then
155 + # move passwd to / to help recover broke systems #64441
156 + # We cannot simply remove this or else net-misc/scponly
157 + # and other tools will break because of hardcoded passwd
158 + # location
159 + dodir /bin
160 + mv "${ED}"/usr/bin/passwd "${ED}"/bin/ || die
161 + dosym ../../bin/passwd /usr/bin/passwd
162 + fi
163 +
164 + cd "${S}" || die
165 + insinto /etc
166 + insopts -m0644
167 + newins etc/login.defs login.defs
168 +
169 + set_login_opt CREATE_HOME yes
170 + if ! use pam ; then
171 + set_login_opt MAIL_CHECK_ENAB no
172 + set_login_opt SU_WHEEL_ONLY yes
173 + set_login_opt CRACKLIB_DICTPATH /usr/$(get_libdir)/cracklib_dict
174 + set_login_opt LOGIN_RETRIES 3
175 + set_login_opt ENCRYPT_METHOD SHA512
176 + set_login_opt CONSOLE
177 + else
178 + dopamd "${FILESDIR}"/pam.d-include/shadow
179 +
180 + for x in chsh shfn ; do
181 + newpamd "${FILESDIR}"/pam.d-include/passwd ${x}
182 + done
183 +
184 + newpamd "${FILESDIR}"/pam.d-include/shadow-r1 groupmems
185 +
186 + # comment out login.defs options that pam hates
187 + local opt sed_args=()
188 + for opt in \
189 + CHFN_AUTH \
190 + CONSOLE \
191 + CRACKLIB_DICTPATH \
192 + ENV_HZ \
193 + ENVIRON_FILE \
194 + FAILLOG_ENAB \
195 + FTMP_FILE \
196 + LASTLOG_ENAB \
197 + MAIL_CHECK_ENAB \
198 + MOTD_FILE \
199 + NOLOGINS_FILE \
200 + OBSCURE_CHECKS_ENAB \
201 + PASS_ALWAYS_WARN \
202 + PASS_CHANGE_TRIES \
203 + PASS_MIN_LEN \
204 + PORTTIME_CHECKS_ENAB \
205 + QUOTAS_ENAB \
206 + SU_WHEEL_ONLY
207 + do
208 + set_login_opt ${opt}
209 + sed_args+=( -e "/^#${opt}\>/b pamnote" )
210 + done
211 + sed -i "${sed_args[@]}" \
212 + -e 'b exit' \
213 + -e ': pamnote; i# NOTE: This setting should be configured via /etc/pam.d/ and not in this file.' \
214 + -e ': exit' \
215 + "${ED}"/etc/login.defs || die
216 +
217 + # remove manpages that pam will install for us
218 + # and/or don't apply when using pam
219 + find "${ED}"/usr/share/man -type f \
220 + '(' -name 'limits.5*' -o -name 'suauth.5*' ')' \
221 + -delete
222 +
223 + # Remove pam.d files provided by pambase.
224 + rm "${ED}"/etc/pam.d/{login,passwd} || die
225 + if use su ; then
226 + rm "${ED}"/etc/pam.d/su || die
227 + fi
228 + fi
229 +
230 + # Remove manpages that are handled by other packages
231 + find "${ED}"/usr/share/man \
232 + '(' -name id.1 -o -name passwd.5 -o -name getspnam.3 ')' \
233 + -delete
234 +
235 + cd "${S}" || die
236 + dodoc ChangeLog NEWS TODO
237 + newdoc README README.download
238 + cd doc || die
239 + dodoc HOWTO README* WISHLIST *.txt
240 +}
241 +
242 +pkg_preinst() {
243 + rm -f "${EROOT}"/etc/pam.d/system-auth.new \
244 + "${EROOT}/etc/login.defs.new"
245 +}
246 +
247 +pkg_postinst() {
248 + # Enable shadow groups.
249 + if [ ! -f "${EROOT}"/etc/gshadow ] ; then
250 + if grpck -r -R "${EROOT}" 2>/dev/null ; then
251 + grpconv -R "${EROOT}"
252 + else
253 + ewarn "Running 'grpck' returned errors. Please run it by hand, and then"
254 + ewarn "run 'grpconv' afterwards!"
255 + fi
256 + fi
257 +
258 + [[ ! -f "${EROOT}"/etc/subgid ]] &&
259 + touch "${EROOT}"/etc/subgid
260 + [[ ! -f "${EROOT}"/etc/subuid ]] &&
261 + touch "${EROOT}"/etc/subuid
262 +
263 + einfo "The 'adduser' symlink to 'useradd' has been dropped."
264 +}