aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJory Pratt <anarchy@gentoo.org>2020-04-12 13:37:45 -0500
committerJory Pratt <anarchy@gentoo.org>2020-04-12 13:37:45 -0500
commit13baed0a13c710252e7e7698d92a9a4da60a62ec (patch)
tree43451b936bac6bf05724ca4d7542b9b31874484a /sys-block
parentx11-apps/igt-gpu-tools: Musl patch (diff)
downloadmusl-13baed0a13c710252e7e7698d92a9a4da60a62ec.tar.gz
musl-13baed0a13c710252e7e7698d92a9a4da60a62ec.tar.bz2
musl-13baed0a13c710252e7e7698d92a9a4da60a62ec.zip
sys-block/partimage: add missing includes
Fixes: https://bugs.gentoo.org/715756 Package-Manager: Portage-2.3.99, Repoman-2.3.22 Signed-off-by: Jory Pratt <anarchy@gentoo.org>
Diffstat (limited to 'sys-block')
-rw-r--r--sys-block/partimage/Manifest1
-rw-r--r--sys-block/partimage/files/partimage-0.6.9-minor-typo.patch13
-rw-r--r--sys-block/partimage/files/partimage-0.6.9-missing-includes.patch37
-rw-r--r--sys-block/partimage/files/partimage-0.6.9-openssl-1.1-compatibility.patch41
-rw-r--r--sys-block/partimage/files/partimage-0.6.9-zlib-1.2.5.2.patch33
-rw-r--r--sys-block/partimage/files/partimaged.conf9
-rw-r--r--sys-block/partimage/files/partimaged.init.228
-rw-r--r--sys-block/partimage/files/partimaged.pam.27
-rw-r--r--sys-block/partimage/files/servercert.cnf36
-rw-r--r--sys-block/partimage/metadata.xml14
-rw-r--r--sys-block/partimage/partimage-0.6.9-r1.ebuild143
11 files changed, 362 insertions, 0 deletions
diff --git a/sys-block/partimage/Manifest b/sys-block/partimage/Manifest
new file mode 100644
index 00000000..d01ed555
--- /dev/null
+++ b/sys-block/partimage/Manifest
@@ -0,0 +1 @@
+DIST partimage-0.6.9.tar.bz2 666522 BLAKE2B d9a240f82a7b6ae73997df46c964fdddf8dddea9e3bd9548252d9409a526358714908316c52864b60bc9fcc1113a5e1c6cf294faff6845a183c7ffe1012475a6 SHA512 252885921b23933fdcdf0bb6efa4b82066b08ca95cc653296912d384ae875b421c1d39f347a90115315139176d4eab4a930c24919c2d38cf00ed29c764cd14d9
diff --git a/sys-block/partimage/files/partimage-0.6.9-minor-typo.patch b/sys-block/partimage/files/partimage-0.6.9-minor-typo.patch
new file mode 100644
index 00000000..8e0e00e0
--- /dev/null
+++ b/sys-block/partimage/files/partimage-0.6.9-minor-typo.patch
@@ -0,0 +1,13 @@
+https://bugs.gentoo.org/580290
+
+--- a/src/client/misc.h
++++ b/src/client/misc.h
+@@ -36,7 +36,7 @@ struct COptions;
+ #endif
+
+ #ifndef makedev
+- #define makedev(maj,min) (((maj) << 8) | min))
++ #define makedev(maj,min) (((maj) << 8) | (min))
+ #endif
+
+ // =======================================================
diff --git a/sys-block/partimage/files/partimage-0.6.9-missing-includes.patch b/sys-block/partimage/files/partimage-0.6.9-missing-includes.patch
new file mode 100644
index 00000000..def27f6e
--- /dev/null
+++ b/sys-block/partimage/files/partimage-0.6.9-missing-includes.patch
@@ -0,0 +1,37 @@
+From 0b7b162fbbab1b1d4adf61c5e33f508be0e68895 Mon Sep 17 00:00:00 2001
+From: Jory Pratt <anarchy@gentoo.org>
+Date: Sun, 12 Apr 2020 13:25:49 -0500
+Subject: [PATCH] add missing includes
+
+---
+ src/client/misc.cpp | 1 +
+ src/shared/common.h | 1 +
+ 2 files changed, 2 insertions(+)
+
+diff --git a/src/client/misc.cpp b/src/client/misc.cpp
+index a094803..1c96ef6 100644
+--- a/src/client/misc.cpp
++++ b/src/client/misc.cpp
+@@ -40,6 +40,7 @@
+
+ #include <ctype.h>
+ #include <sys/types.h>
++#include <sys/sysmacros.h>
+ #include <sys/ioctl.h>
+ #include <sys/mount.h>
+ #include <sys/time.h>
+diff --git a/src/shared/common.h b/src/shared/common.h
+index 71de058..eead7e3 100644
+--- a/src/shared/common.h
++++ b/src/shared/common.h
+@@ -23,6 +23,7 @@
+ #include <pthread.h>
+
+ #include <sys/param.h>
++#include <sys/types.h>
+
+ #include "partimage.h"
+
+--
+2.26.0
+
diff --git a/sys-block/partimage/files/partimage-0.6.9-openssl-1.1-compatibility.patch b/sys-block/partimage/files/partimage-0.6.9-openssl-1.1-compatibility.patch
new file mode 100644
index 00000000..af4d9c15
--- /dev/null
+++ b/sys-block/partimage/files/partimage-0.6.9-openssl-1.1-compatibility.patch
@@ -0,0 +1,41 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -240,7 +240,7 @@ if test "$SSL" = "yes"; then
+ AC_CHECKING([ for SSL Library and Header files ... ])
+ AC_SEARCH_HEADERS(rsa.h crypto.h x509.h pem.h ssl.h err.h,
+ $SSL_HDR_DIR /usr/include/ssl /usr/include/openssl /usr/include,
+- [ AC_CHECK_LIB(crypto, CRYPTO_lock, [LIBS="$LIBS -lcrypto"],
++ [ AC_CHECK_LIB(crypto, X509_new, [LIBS="$LIBS -lcrypto"],
+ AC_MSG_ERROR([ Required for SSL Crypto Library not found. ])
+ )
+ AC_CHECK_LIB(ssl, SSL_CTX_new,
+--- a/src/client/netclient.cpp
++++ b/src/client/netclient.cpp
+@@ -43,7 +43,11 @@ CNetClient::CNetClient(bool bMustLogin, bool bUseSSL):CNet()
+ {
+ showDebug(3, "initializing client ssl\n");
+ SSLeay_add_ssl_algorithms();
+- meth = SSLv2_client_method();
++#if OPENSSL_VERSION_NUMBER < 0x10100000
++ meth = TLSv1_client_method();
++#else
++ meth = TLS_client_method();
++#endif
+ SSL_load_error_strings();
+ ctx = SSL_CTX_new(meth);
+ if (!ctx)
+--- a/src/server/netserver.cpp
++++ b/src/server/netserver.cpp
+@@ -39,7 +39,11 @@ CNetServer::CNetServer(unsigned short int port):CNet()
+ {
+ SSL_load_error_strings();
+ SSLeay_add_ssl_algorithms();
+- meth = SSLv23_server_method();
++#if OPENSSL_VERSION_NUMBER < 0x10100000
++ meth = TLSv1_server_method();
++#else
++ meth = TLS_server_method();
++#endif
+ ctx = SSL_CTX_new(meth);
+ if (!ctx)
+ {
diff --git a/sys-block/partimage/files/partimage-0.6.9-zlib-1.2.5.2.patch b/sys-block/partimage/files/partimage-0.6.9-zlib-1.2.5.2.patch
new file mode 100644
index 00000000..57f87a5d
--- /dev/null
+++ b/sys-block/partimage/files/partimage-0.6.9-zlib-1.2.5.2.patch
@@ -0,0 +1,33 @@
+http://bugs.gentoo.org/405323
+
+--- src/client/imagefile.cpp
++++ src/client/imagefile.cpp
+@@ -783,7 +783,7 @@
+ else if (m_options.dwCompression == COMPRESS_GZIP) // Gzip compression
+ {
+ showDebug(1, "open gzip\n");
+- m_gzImageFile = (gzFile *) gzdopen(m_nFdImage, "wb"); //"wb1h");
++ m_gzImageFile = gzdopen(m_nFdImage, "wb"); //"wb1h");
+ if (m_gzImageFile == NULL)
+ {
+ showDebug(1, "error:%d %s\n", errno, strerror(errno));
+@@ -1098,7 +1098,7 @@
+ }
+ else if (m_options.dwCompression == COMPRESS_GZIP) // Gzip compression
+ {
+- m_gzImageFile = (gzFile *) gzdopen(m_nFdImage, "rb");
++ m_gzImageFile = gzdopen(m_nFdImage, "rb");
+ if (m_gzImageFile == NULL)
+ THROW(ERR_ERRNO, errno);
+ else
+--- src/client/imagefile.h
++++ src/client/imagefile.h
+@@ -41,7 +41,7 @@
+ COptions m_options;
+
+ FILE *m_fImageFile;
+- gzFile *m_gzImageFile;
++ gzFile m_gzImageFile;
+ BZFILE *m_bzImageFile;
+
+ int m_nFdImage;
diff --git a/sys-block/partimage/files/partimaged.conf b/sys-block/partimage/files/partimaged.conf
new file mode 100644
index 00000000..8d95f559
--- /dev/null
+++ b/sys-block/partimage/files/partimaged.conf
@@ -0,0 +1,9 @@
+# Copyright 2005-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+# You can define the following optional arguments:
+# -d <dest> Destination directory for the backup images
+# -pX Server port
+# -r <dest> Chroot directory for improved security
+
+#PARTIMAGED_OPTS=""
diff --git a/sys-block/partimage/files/partimaged.init.2 b/sys-block/partimage/files/partimaged.init.2
new file mode 100644
index 00000000..3bbb99d1
--- /dev/null
+++ b/sys-block/partimage/files/partimaged.init.2
@@ -0,0 +1,28 @@
+#!/sbin/openrc-run
+# Copyright 2005-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License, v2 or later
+
+PARTIMAGED="/usr/sbin/partimaged"
+
+failed_startup() {
+ eerror "The PartImage daemon did not start up correctly."
+ eerror "Perhaps you compiled it with SSL support but forgot to run the ebuild config?"
+ return 1
+}
+
+depend() {
+ need net
+}
+
+start() {
+ ebegin "Starting partimaged"
+ start-stop-daemon --start --exec ${PARTIMAGED} \
+ -- ${PARTIMAGED_OPTS} --daemon
+ eend $? || failed_startup
+}
+
+stop() {
+ ebegin "Stopping partimaged"
+ start-stop-daemon --stop --exec ${PARTIMAGED}
+ eend $?
+}
diff --git a/sys-block/partimage/files/partimaged.pam.2 b/sys-block/partimage/files/partimaged.pam.2
new file mode 100644
index 00000000..9ed5507a
--- /dev/null
+++ b/sys-block/partimage/files/partimaged.pam.2
@@ -0,0 +1,7 @@
+# PAM config file for Partimaged
+
+auth required pam_listfile.so onerr=fail item=user sense=allow file=/etc/partimaged/partimagedusers
+auth optional pam_warn.so
+auth include system-auth
+account include system-auth
+session include system-auth
diff --git a/sys-block/partimage/files/servercert.cnf b/sys-block/partimage/files/servercert.cnf
new file mode 100644
index 00000000..63de305e
--- /dev/null
+++ b/sys-block/partimage/files/servercert.cnf
@@ -0,0 +1,36 @@
+# Robin H. Johnson <robbat2@gentoo.org> - October 17, 2003
+# This is the openssl config file to generate keys for partimage
+# It is read by mkservercert
+
+[ req ]
+# you can increase this value, but be aware that it will make things much slower
+# this should be a power of 2!
+default_bits = 1024
+# leave the rest of these alone!
+encrypt_key = yes
+distinguished_name = req_dn
+x509_extensions = cert_type
+prompt = no
+
+[ req_dn ]
+# 2-Letter ISO country code
+C=US
+# FULL name of state/province/district
+# NO abbreviations!
+ST=Alabama
+# FULL name of city
+# NO abbreviations!
+L=Mobile
+# Full Name of your organization
+# NO abbreviations!
+O=Foobar Systems
+# Leave this alone unless specifically need to change it!
+OU=Automatically-generated PartImage SSL key
+# This should be a FQDN that resolves to the IP of your server
+CN=localhost
+# This should be the email address for the administrator of the server
+emailAddress=root@localhost
+
+# Leave this alone!
+[ cert_type ]
+nsCertType = server
diff --git a/sys-block/partimage/metadata.xml b/sys-block/partimage/metadata.xml
new file mode 100644
index 00000000..0862b060
--- /dev/null
+++ b/sys-block/partimage/metadata.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="project">
+ <email>base-system@gentoo.org</email>
+ <name>Gentoo Base System</name>
+</maintainer>
+<use>
+ <flag name="nologin">Do not include login support when connecting partimaged</flag>
+</use>
+<upstream>
+ <remote-id type="sourceforge">partimage</remote-id>
+</upstream>
+</pkgmetadata>
diff --git a/sys-block/partimage/partimage-0.6.9-r1.ebuild b/sys-block/partimage/partimage-0.6.9-r1.ebuild
new file mode 100644
index 00000000..71fc7cdb
--- /dev/null
+++ b/sys-block/partimage/partimage-0.6.9-r1.ebuild
@@ -0,0 +1,143 @@
+# 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 "${FILESDIR}"/${P}-missing-includes.patch #715756
+
+ 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
+}