From e84b080cf49f64d1b967ad730cfedb117d1afe00 Mon Sep 17 00:00:00 2001 From: Sam James Date: Wed, 30 Jun 2021 19:38:25 +0100 Subject: sys-block/partimage: add libcrypt dependency Only needed when login functionality is enabled. Signed-off-by: Sam James --- sys-block/partimage/partimage-0.6.9-r1.ebuild | 142 ------------------------- sys-block/partimage/partimage-0.6.9-r2.ebuild | 143 ++++++++++++++++++++++++++ 2 files changed, 143 insertions(+), 142 deletions(-) delete mode 100644 sys-block/partimage/partimage-0.6.9-r1.ebuild create mode 100644 sys-block/partimage/partimage-0.6.9-r2.ebuild (limited to 'sys-block') diff --git a/sys-block/partimage/partimage-0.6.9-r1.ebuild b/sys-block/partimage/partimage-0.6.9-r1.ebuild deleted file mode 100644 index 60d1e2982bd6..000000000000 --- a/sys-block/partimage/partimage-0.6.9-r1.ebuild +++ /dev/null @@ -1,142 +0,0 @@ -# Copyright 1999-2020 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=6 -inherit autotools flag-o-matic pam user - -DESCRIPTION="Console-based application to efficiently save raw partition data to image file" -HOMEPAGE="http://www.partimage.org/" -SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="amd64 ppc ~sparc x86" -IUSE="nls nologin pam ssl static" - -LIBS_DEPEND="app-arch/bzip2 - >=dev-libs/newt-0.52 - >=sys-libs/slang-2 - sys-libs/zlib:= - ssl? ( dev-libs/openssl:0= )" -PAM_DEPEND="!static? ( pam? ( sys-libs/pam ) )" -RDEPEND="${PAM_DEPEND} - !static? ( ${LIBS_DEPEND} )" -DEPEND="${PAM_DEPEND} - ${LIBS_DEPEND} - nls? ( sys-devel/gettext )" - -pkg_setup() { - enewgroup partimag 91 - enewuser partimag 91 -1 /var/lib/partimage partimag -} - -src_prepare() { - eapply -p0 "${FILESDIR}"/${P}-zlib-1.2.5.2.patch #405323 - eapply "${FILESDIR}"/${P}-minor-typo.patch #580290 - eapply "${FILESDIR}"/${P}-openssl-1.1-compatibility.patch - - eapply_user - - eautoreconf -} - -src_configure() { - # XXX: Do we still need these? - filter-flags -fno-exceptions - use ppc && append-flags -fsigned-char - - local myconf - - use nologin && myconf="${myconf} --disable-login" - - if use pam && ! use static; then - myconf="${myconf} --enable-pam" - fi - - econf \ - $(use_enable nls) \ - $(use_enable ssl) \ - --disable-pam \ - $(use_enable static all-static) \ - --with-log-dir="${EPREFIX}"/var/log/partimage \ - ${myconf} -} - -src_install() { - default - - keepdir /var/lib/partimage - keepdir /var/log/partimage - - newinitd "${FILESDIR}"/partimaged.init.2 partimaged - newconfd "${FILESDIR}"/partimaged.conf partimaged - - if use ssl; then - insinto /etc/partimaged - doins "${FILESDIR}"/servercert.cnf - fi - - if use pam; then - newpamd "${FILESDIR}"/partimaged.pam.2 partimaged - fi -} - -confdir=${EROOT%/}/etc/partimaged -privkey=${confdir}/partimaged.key -cnf=${confdir}/servercert.cnf -csr=${confdir}/partimaged.csr -cert=${confdir}/partimaged.cert - -pkg_config() { - if use ssl; then - ewarn "Please customize /etc/partimaged/servercert.cnf before you continue!" - ewarn "Press Ctrl-C to break now for it, or press enter to continue." - read - if [ ! -f ${privkey} ]; then - einfo "Generating unencrypted private key: ${privkey}" - openssl genrsa -out ${privkey} 1024 || die - else - einfo "Private key already exists: ${privkey}" - fi - if [ ! -f ${csr} ]; then - einfo "Generating certificate request: ${csr}" - openssl req -new -x509 -outform PEM -out ${csr} -key ${privkey} -config ${cnf} || die - else - einfo "Certificate request already exists: ${csr}" - fi - if [ ! -f ${cert} ]; then - einfo "Generating self-signed certificate: ${cert}" - openssl x509 -in ${csr} -out ${cert} -signkey ${privkey} || die - else - einfo "Self-signed certifcate already exists: ${cert}" - fi - einfo "Setting permissions" - partimagesslperms || die - einfo "Done" - else - einfo "SSL is disabled, not building certificates" - fi -} - -partimagesslperms() { - local ret=0 - chmod 600 ${privkey} 2>/dev/null - ret=$((${ret}+$?)) - chown partimag:0 ${privkey} 2>/dev/null - ret=$((${ret}+$?)) - chmod 644 ${cert} ${csr} 2>/dev/null - ret=$((${ret}+$?)) - chown root:0 ${cert} ${csr} 2>/dev/null - ret=$((${ret}+$?)) - return $ret -} - -pkg_postinst() { - if use ssl; then - einfo "To create the required SSL certificates, please do:" - einfo "emerge --config =${PF}" - partimagesslperms - return 0 - fi - chown partimag:0 "${EROOT%/}"/etc/partimaged/partimagedusers || die -} diff --git a/sys-block/partimage/partimage-0.6.9-r2.ebuild b/sys-block/partimage/partimage-0.6.9-r2.ebuild new file mode 100644 index 000000000000..e2fe1d3a98af --- /dev/null +++ b/sys-block/partimage/partimage-0.6.9-r2.ebuild @@ -0,0 +1,143 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 +inherit autotools flag-o-matic pam user + +DESCRIPTION="Console-based application to efficiently save raw partition data to image file" +HOMEPAGE="http://www.partimage.org/" +SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="amd64 ppc ~sparc x86" +IUSE="nls nologin pam ssl static" + +LIBS_DEPEND="app-arch/bzip2 + >=dev-libs/newt-0.52 + >=sys-libs/slang-2 + sys-libs/zlib:= + !nologin? ( virtual/libcrypt:= ) + ssl? ( dev-libs/openssl:0= )" +PAM_DEPEND="!static? ( pam? ( sys-libs/pam ) )" +RDEPEND="${PAM_DEPEND} + !static? ( ${LIBS_DEPEND} )" +DEPEND="${PAM_DEPEND} + ${LIBS_DEPEND} + nls? ( sys-devel/gettext )" + +pkg_setup() { + enewgroup partimag 91 + enewuser partimag 91 -1 /var/lib/partimage partimag +} + +src_prepare() { + eapply -p0 "${FILESDIR}"/${P}-zlib-1.2.5.2.patch #405323 + eapply "${FILESDIR}"/${P}-minor-typo.patch #580290 + eapply "${FILESDIR}"/${P}-openssl-1.1-compatibility.patch + + eapply_user + + eautoreconf +} + +src_configure() { + # XXX: Do we still need these? + filter-flags -fno-exceptions + use ppc && append-flags -fsigned-char + + local myconf + + use nologin && myconf="${myconf} --disable-login" + + if use pam && ! use static; then + myconf="${myconf} --enable-pam" + fi + + econf \ + $(use_enable nls) \ + $(use_enable ssl) \ + --disable-pam \ + $(use_enable static all-static) \ + --with-log-dir="${EPREFIX}"/var/log/partimage \ + ${myconf} +} + +src_install() { + default + + keepdir /var/lib/partimage + keepdir /var/log/partimage + + newinitd "${FILESDIR}"/partimaged.init.2 partimaged + newconfd "${FILESDIR}"/partimaged.conf partimaged + + if use ssl; then + insinto /etc/partimaged + doins "${FILESDIR}"/servercert.cnf + fi + + if use pam; then + newpamd "${FILESDIR}"/partimaged.pam.2 partimaged + fi +} + +confdir=${EROOT%/}/etc/partimaged +privkey=${confdir}/partimaged.key +cnf=${confdir}/servercert.cnf +csr=${confdir}/partimaged.csr +cert=${confdir}/partimaged.cert + +pkg_config() { + if use ssl; then + ewarn "Please customize /etc/partimaged/servercert.cnf before you continue!" + ewarn "Press Ctrl-C to break now for it, or press enter to continue." + read + if [ ! -f ${privkey} ]; then + einfo "Generating unencrypted private key: ${privkey}" + openssl genrsa -out ${privkey} 1024 || die + else + einfo "Private key already exists: ${privkey}" + fi + if [ ! -f ${csr} ]; then + einfo "Generating certificate request: ${csr}" + openssl req -new -x509 -outform PEM -out ${csr} -key ${privkey} -config ${cnf} || die + else + einfo "Certificate request already exists: ${csr}" + fi + if [ ! -f ${cert} ]; then + einfo "Generating self-signed certificate: ${cert}" + openssl x509 -in ${csr} -out ${cert} -signkey ${privkey} || die + else + einfo "Self-signed certifcate already exists: ${cert}" + fi + einfo "Setting permissions" + partimagesslperms || die + einfo "Done" + else + einfo "SSL is disabled, not building certificates" + fi +} + +partimagesslperms() { + local ret=0 + chmod 600 ${privkey} 2>/dev/null + ret=$((${ret}+$?)) + chown partimag:0 ${privkey} 2>/dev/null + ret=$((${ret}+$?)) + chmod 644 ${cert} ${csr} 2>/dev/null + ret=$((${ret}+$?)) + chown root:0 ${cert} ${csr} 2>/dev/null + ret=$((${ret}+$?)) + return $ret +} + +pkg_postinst() { + if use ssl; then + einfo "To create the required SSL certificates, please do:" + einfo "emerge --config =${PF}" + partimagesslperms + return 0 + fi + chown partimag:0 "${EROOT%/}"/etc/partimaged/partimagedusers || die +} -- cgit v1.2.3-65-gdbad