Gentoo Archives: gentoo-commits

From: Patrice Clement <monsieurp@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-libs/pam/
Date: Thu, 23 Nov 2017 22:16:33
Message-Id: 1511475381.c56394beb0ec1d2146e7dcfe6b80d4307db5bb3d.monsieurp@gentoo
1 commit: c56394beb0ec1d2146e7dcfe6b80d4307db5bb3d
2 Author: Patrice Clement <monsieurp <AT> gentoo <DOT> org>
3 AuthorDate: Thu Nov 23 22:05:21 2017 +0000
4 Commit: Patrice Clement <monsieurp <AT> gentoo <DOT> org>
5 CommitDate: Thu Nov 23 22:16:21 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c56394be
7
8 sys-libs/pam: mask app-vim/pam-syntax for removal.
9
10 Bug: https://bugs.gentoo.org/578278
11 Package-Manager: Portage-2.3.8, Repoman-2.3.3
12
13 sys-libs/pam/pam-1.3.0-r1.ebuild | 203 +++++++++++++++++++++++++++++++++++++++
14 1 file changed, 203 insertions(+)
15
16 diff --git a/sys-libs/pam/pam-1.3.0-r1.ebuild b/sys-libs/pam/pam-1.3.0-r1.ebuild
17 new file mode 100644
18 index 00000000000..ee426cd8d88
19 --- /dev/null
20 +++ b/sys-libs/pam/pam-1.3.0-r1.ebuild
21 @@ -0,0 +1,203 @@
22 +# Copyright 1999-2017 Gentoo Foundation
23 +# Distributed under the terms of the GNU General Public License v2
24 +
25 +EAPI="5"
26 +
27 +inherit libtool multilib multilib-minimal eutils pam toolchain-funcs flag-o-matic db-use fcaps
28 +
29 +MY_PN="Linux-PAM"
30 +MY_P="${MY_PN}-${PV}"
31 +
32 +DESCRIPTION="Linux-PAM (Pluggable Authentication Modules)"
33 +HOMEPAGE="http://www.linux-pam.org/ https://fedorahosted.org/linux-pam/"
34 +SRC_URI="http://www.linux-pam.org/library/${MY_P}.tar.bz2
35 + http://www.linux-pam.org/library/${MY_P}-docs.tar.bz2"
36 +
37 +LICENSE="|| ( BSD GPL-2 )"
38 +SLOT="0"
39 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~x86-linux"
40 +IUSE="audit berkdb cracklib debug nis nls +pie selinux test vim-syntax"
41 +
42 +RDEPEND="
43 + nls? ( >=virtual/libintl-0-r1[${MULTILIB_USEDEP}] )
44 + cracklib? ( >=sys-libs/cracklib-2.9.1-r1[${MULTILIB_USEDEP}] )
45 + audit? ( >=sys-process/audit-2.2.2[${MULTILIB_USEDEP}] )
46 + selinux? ( >=sys-libs/libselinux-2.2.2-r4[${MULTILIB_USEDEP}] )
47 + berkdb? ( >=sys-libs/db-4.8.30-r1:=[${MULTILIB_USEDEP}] )
48 + nis? ( >=net-libs/libtirpc-0.2.4-r2[${MULTILIB_USEDEP}] )"
49 +
50 +DEPEND="
51 + ${RDEPEND}
52 + >=sys-devel/libtool-2
53 + >=sys-devel/flex-2.5.39-r1[${MULTILIB_USEDEP}]
54 + nls? ( sys-devel/gettext )
55 + nis? ( >=virtual/pkgconfig-0-r1[${MULTILIB_USEDEP}] )"
56 +
57 +PDEPEND="
58 + sys-auth/pambase
59 + vim-syntax? ( app-editors/vim )"
60 +
61 +RDEPEND="
62 + ${RDEPEND}
63 + !<sys-apps/openrc-0.11.8
64 + !sys-auth/openpam
65 + !sys-auth/pam_userdb"
66 +
67 +S="${WORKDIR}/${MY_P}"
68 +
69 +check_old_modules() {
70 + local retval="0"
71 +
72 + if sed -e 's:#.*::' "${EROOT}"/etc/pam.d/* 2>/dev/null | fgrep -q pam_stack.so; then
73 + eerror ""
74 + eerror "Your current setup is using the pam_stack module."
75 + eerror "This module is deprecated and no longer supported, and since version"
76 + eerror "0.99 is no longer installed, nor provided by any other package."
77 + eerror "The package will be built (to allow binary package builds), but will"
78 + eerror "not be installed."
79 + eerror "Please replace pam_stack usage with proper include directive usage,"
80 + eerror "following the PAM Upgrade guide at the following URL"
81 + eerror " https://wiki.gentoo.org/wiki/Project:PAM/Upgrade_to_0.99"
82 + eerror ""
83 +
84 + retval=1
85 + fi
86 +
87 + if sed -e 's:#.*::' "${EROOT}"/etc/pam.d/* 2>/dev/null | egrep -q 'pam_(pwdb|console)'; then
88 + eerror ""
89 + eerror "Your current setup is using one or more of the following modules,"
90 + eerror "that are not built or supported anymore:"
91 + eerror "pam_pwdb, pam_console"
92 + eerror "If you are in real need for these modules, please contact the maintainers"
93 + eerror "of PAM through https://bugs.gentoo.org/ providing information about its"
94 + eerror "use cases."
95 + eerror "Please also make sure to read the PAM Upgrade guide at the following URL:"
96 + eerror " https://wiki.gentoo.org/wiki/Project:PAM/Upgrade_to_0.99"
97 + eerror ""
98 +
99 + retval=1
100 + fi
101 +
102 + return ${retval}
103 +}
104 +
105 +pkg_pretend() {
106 + # do not error out, this is just a warning, one could build a binpkg
107 + # with old modules enabled.
108 + check_old_modules
109 +}
110 +
111 +src_prepare() {
112 + # Fix non-POSIX shell code.
113 + # https://fedorahosted.org/linux-pam/ticket/60
114 + sed -i \
115 + -e '/ test /s:==:=:' \
116 + configure || die
117 + elibtoolize
118 +}
119 +
120 +multilib_src_configure() {
121 + # Do not let user's BROWSER setting mess us up. #549684
122 + unset BROWSER
123 +
124 + # Disable automatic detection of libxcrypt; we _don't_ want the
125 + # user to link libxcrypt in by default, since we won't track the
126 + # dependency and allow to break PAM this way.
127 + export ac_cv_header_xcrypt_h=no
128 +
129 + local myconf=(
130 + --docdir='$(datarootdir)'/doc/${PF}
131 + --htmldir='$(docdir)/html'
132 + --libdir='$(prefix)'/$(get_libdir)
133 + --enable-securedir="${EPREFIX}"/$(get_libdir)/security
134 + --enable-isadir='.' #464016
135 + $(use_enable nls)
136 + $(use_enable selinux)
137 + $(use_enable cracklib)
138 + $(use_enable audit)
139 + $(use_enable debug)
140 + $(use_enable berkdb db)
141 + $(use_enable nis)
142 + $(use_enable pie)
143 + --with-db-uniquename=-$(db_findver sys-libs/db)
144 + --disable-prelude
145 + --disable-regenerate-docu
146 + )
147 +
148 + ECONF_SOURCE=${S} \
149 + econf "${myconf[@]}"
150 +}
151 +
152 +multilib_src_compile() {
153 + emake sepermitlockdir="${EPREFIX}/run/sepermit"
154 +}
155 +
156 +multilib_src_install() {
157 + emake DESTDIR="${D}" install \
158 + sepermitlockdir="${EPREFIX}/run/sepermit"
159 +
160 + local prefix
161 + if multilib_is_native_abi; then
162 + prefix=
163 + gen_usr_ldscript -a pam pamc pam_misc
164 + else
165 + prefix=/usr
166 + fi
167 +
168 + # create extra symlinks just in case something depends on them...
169 + local lib
170 + for lib in pam pamc pam_misc; do
171 + if ! [[ -f "${ED}"${prefix}/$(get_libdir)/lib${lib}$(get_libname) ]]; then
172 + dosym lib${lib}$(get_libname 0) ${prefix}/$(get_libdir)/lib${lib}$(get_libname)
173 + fi
174 + done
175 +}
176 +
177 +DOCS=( CHANGELOG ChangeLog README AUTHORS Copyright NEWS )
178 +
179 +multilib_src_install_all() {
180 + einstalldocs
181 + prune_libtool_files --all
182 +
183 + docinto modules
184 + local dir
185 + for dir in modules/pam_*; do
186 + newdoc "${dir}"/README README."$(basename "${dir}")"
187 + done
188 +
189 + if use selinux; then
190 + dodir /usr/lib/tmpfiles.d
191 + cat - > "${D}"/usr/lib/tmpfiles.d/${CATEGORY}:${PN}:${SLOT}.conf <<EOF
192 +d /run/sepermit 0755 root root
193 +EOF
194 + fi
195 +}
196 +
197 +pkg_preinst() {
198 + check_old_modules || die "deprecated PAM modules still used"
199 +}
200 +
201 +pkg_postinst() {
202 + ewarn "Some software with pre-loaded PAM libraries might experience"
203 + ewarn "warnings or failures related to missing symbols and/or versions"
204 + ewarn "after any update. While unfortunate this is a limit of the"
205 + ewarn "implementation of PAM and the software, and it requires you to"
206 + ewarn "restart the software manually after the update."
207 + ewarn ""
208 + ewarn "You can get a list of such software running a command like"
209 + ewarn " lsof / | egrep -i 'del.*libpam\\.so'"
210 + ewarn ""
211 + ewarn "Alternatively, simply reboot your system."
212 + if [[ -x "${EROOT}"/var/log/tallylog ]] ; then
213 + elog ""
214 + elog "Because of a bug present up to version 1.1.1-r2, you have"
215 + elog "an executable /var/log/tallylog file. You can safely"
216 + elog "correct it by running the command"
217 + elog " chmod -x /var/log/tallylog"
218 + elog ""
219 + fi
220 +
221 + # The pam_unix module needs to check the password of the user which requires
222 + # read access to /etc/shadow only.
223 + fcaps cap_dac_override sbin/unix_chkpwd
224 +}