summaryrefslogtreecommitdiff
path: root/sys-block/partimage
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /sys-block/partimage
reinit the tree, so we can have metadata
Diffstat (limited to 'sys-block/partimage')
-rw-r--r--sys-block/partimage/Manifest13
-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-zlib-1.2.5.2.patch33
-rw-r--r--sys-block/partimage/files/partimaged.conf9
-rw-r--r--sys-block/partimage/files/partimaged.init28
-rw-r--r--sys-block/partimage/files/partimaged.init.228
-rw-r--r--sys-block/partimage/files/partimaged.pam11
-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.ebuild139
11 files changed, 331 insertions, 0 deletions
diff --git a/sys-block/partimage/Manifest b/sys-block/partimage/Manifest
new file mode 100644
index 000000000000..fae1d20e67b5
--- /dev/null
+++ b/sys-block/partimage/Manifest
@@ -0,0 +1,13 @@
+AUX partimage-0.6.9-minor-typo.patch 313 SHA256 b228103401a0e62158234d7a2f69cab237624c4f352a492a6c8bf629d7e124d3 SHA512 7bf9de9b08afce5c3b2bfa8943561df0605066866f7ba748872c9f81e1be4033e6f88c8033af1e1b7e2adb64263e8177ba9bcad1ac2e613b27e9c219fbff6828 WHIRLPOOL bb5e7ebe63ce64eb2ebe6ba27bef39b0d7f1a4673e84d9ab1440ebc9001846d6634932450eb4dbc34b64d2922b54ab1aa50363e7b6d74157f085d3b85b4a9f05
+AUX partimage-0.6.9-zlib-1.2.5.2.patch 975 SHA256 b8bd5502ec538031ad48082915507274a0001ac7412a2cd04b8cc888b807ba5a SHA512 8f5310a65e77822f816bedca9281be7627246f111960fc4092c2e3d44fa1bfcea786c130899970ce35da8be536491ae46b0ac1825d85ab6ccb6b1332f2f1b4e2 WHIRLPOOL c005d749465565f22a1acdc34d15583ba539f6db5c24bc3c7ece780f04b55c5ff21b3e0a5327bb2ec0c0a75de63ba1a5c293b5a0a02a64e2051425068f9c7f46
+AUX partimaged.conf 307 SHA256 5bacfba0b806e8293575cb7d9708b1afbb72c04a4d4c892125b5eaca83f77dd5 SHA512 1be320a8dceb3076e6aa2d8b1a8a4d01a380ad1209133997fd0d87cf1d0974fc4877c3c8b41c07fbb99249c8a00132f2c5fa7ffadf26f4e41cc2abfcd6b62116 WHIRLPOOL 5a80a6eaa89039f39c9d1ffe9ae57fb5f3ea08f5ed7ca83c597723f6ff882c257404916ad10baa19f510136abbc9b524a2d31b13e4f0b834fadcea33749ab67f
+AUX partimaged.init 644 SHA256 a17fff3efb5c897bab0135bf193b8ee261dc07cde788e7710a00635fe48e5ce7 SHA512 1e85bcd3012897cb093e87667a4c937b390967317ceaa547484d4f56c760a746faeb4290996155505978eefb4bd1e84e4b11fcc31a59f1e322c83351227c96d5 WHIRLPOOL fd9cea184686296d10f912141090f66e6f559896c46a5ca711f46ba8de3a53d26e9cc5964bb21cfa146275c18286027ebffdd21ce6f80513a7b60ae3edfd4e9d
+AUX partimaged.init.2 628 SHA256 0ceed689d3d840d8ac66ecb2a8f3f176c5714fd78ecf1f8b3f147e53b8c250d6 SHA512 48919e1be73d0aaeeaf0f8b510af05eda613aa7aa6773e0886ca2d46119521326f46d8503f23b2dcb133ec4c8bc5a89f92787275bba869c6990074825515278f WHIRLPOOL d1b7df4f23019e72da50b0e5df9096fd606241c25807d60224802c8ec095a2f3f118c8e56b28e917486c970a53dd8df3341150166f8218a81af8fd98aac7fe11
+AUX partimaged.pam 266 SHA256 6072116adb36c49a4a4c36a134355162bf215ec7b6716593de76de3123c5adbe SHA512 993bffc8ecabde1148ad75f559348ed4a8d5f9d13b326676dc6d217aa890e7ab35884dda4a71be8090e3aef05cd6711e2705e3190d1cdb8bfe23213453418e6e WHIRLPOOL 4d09a92bc770d655890d530ad0d7e28f390f7433661e3361c3a26c4ac8fa4a14ef912af77622ee70701affaf9e6339d981c297afee1a86e2e44e2cf6b296f23f
+AUX partimaged.pam.2 249 SHA256 1f050f33a6646d067476746ea56a4fd8c7beb9ce06a859d9a454c3f78d66cb8a SHA512 ad55a61e574dc44cdda723bb5a46349d15e50353dcdb99474b9acafd56c93bc6ffdd75f5b0d9e80849d9bebf5c7b9a2f84c7cefc5f0a86f54f9477a0962794cd WHIRLPOOL de6955eba541a5b8b0d4d455ce0557f33c23f5abc358aa84232302e99f2517a6f4d38d4a00879cfa625af9e1e8811d8fe4c80a92c45d2e7d2f4a90e0a0faf1c7
+AUX servercert.cnf 980 SHA256 daf5610830bec262b033255ad0ad0263d3e5d25a657bd3037b7e66510a974fff SHA512 8aa0592ce0be3f08124880b823db59aa167e7d509ea1a9b48d9f895482f96e99a6e4df330c567b9ce331eed43cb4f1a70b1b7727878972a8b074265898b1e557 WHIRLPOOL e49a6ab6e166838b1e18f8bcbc5cb916dba1b2f7f468da34a1e76063680e2ba57e039d5856144cf11135fb3315f8f2ceed6cebb67157f436e7f60d27091a0767
+DIST partimage-0.6.9.tar.bz2 666522 SHA256 753a6c81f4be18033faed365320dc540fe5e58183eaadcd7a5b69b096fec6635 SHA512 252885921b23933fdcdf0bb6efa4b82066b08ca95cc653296912d384ae875b421c1d39f347a90115315139176d4eab4a930c24919c2d38cf00ed29c764cd14d9 WHIRLPOOL a4e30ea6240c89b568fd5959f4d72130e3737a409270d9336e45f2c4f85c2e6c1c66b5b60abdf47aa238ec4159010cbbcc75c02c6e5a1cb309e2fceee1df7750
+EBUILD partimage-0.6.9.ebuild 3448 SHA256 7dcc8fbb677ddc09df470a6291109fba92ad1b9e2633387e69f3314a4cb9aa43 SHA512 3633ffc3970121daae9594508c3efa5a6b44bf40f01ea5565ba87d763d2adc98921151c4ef12c121ea519eb9d0f10975a2d6901f038b6692d120371b0f66fa17 WHIRLPOOL 2d27f55a9e8bce8edbb1bd8fe3365bda2b5c5b6072f5d6f0e2bb167594d63daebe3148756b23ee3445f64f1333457e907e0b1aae1f64cbf32da9c0d485fd6a9f
+MISC ChangeLog 3698 SHA256 980ad8677d5fdd01b384870d99fab787d140ae2d34bdd9ce66c2ac5fddb686d6 SHA512 65e8c8983ac618d386d34cb17ab5ad337cd4dbfdf3ecaa893618fbcb864e9bfd0ff038941882eedf5108321c4e60737b8fedec08e7d1df7ffae01d24e11c2345 WHIRLPOOL c8f5f468de8896e40daa95283c641df150dbe0803b5baef9b100aee1e01da39269a591529bed6454028a1ceab5de289cf8c76e39c6dd349500bbea4d7fe7da0e
+MISC ChangeLog-2015 13701 SHA256 d6d8fb937cb07ca292abf08c5733b2e405ef57824ae9c8dad90a9efaf380bd49 SHA512 e1a8a2aa9e5556fe814f4da7d7657e38223bced354ff656c23100d9973a328e9d33f5497d44693ea38545d3613dc1884376d8b56e170ef1f61ea41901f684a8f WHIRLPOOL 31d2217709d8ff2fc2b8793672cc70206663bca28dea8fa951c41e53601a5028d0f295cd5600015f74e50285c2e1cdebe659b806b21c7cb92403f1e9ba6d9198
+MISC metadata.xml 427 SHA256 97d42203fd5752637c7f95006f0e9652c02fa3753d8d7c067f62eb12cc241289 SHA512 e5e5377e9f6cf6337b93ea8609424ce4b9514b0b0d9628ef22999537af616f24e4882a915cf6249f8d0e721b5e25e0a50f5e046b8ac9991c130b4f5892298e67 WHIRLPOOL 964e1d04319e248a804b2f47b94e2c2f62ab2c5dc57360cc49fe3d49a70d1e957c1be534665465ec06f2dd1087b3b935056c6e61eebfab279783ff86fe97bf2d
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 000000000000..8e0e00e05659
--- /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-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 000000000000..57f87a5d5225
--- /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 000000000000..0f4301b4bb68
--- /dev/null
+++ b/sys-block/partimage/files/partimaged.conf
@@ -0,0 +1,9 @@
+# Copyright 2005 Gentoo Foundation
+# 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 b/sys-block/partimage/files/partimaged.init
new file mode 100644
index 000000000000..72891f97cf9b
--- /dev/null
+++ b/sys-block/partimage/files/partimaged.init
@@ -0,0 +1,28 @@
+#!/sbin/openrc-run
+# Copyright 2005 Gentoo Foundation
+# 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 --quiet --exec ${PARTIMAGED} \
+ -- ${PARTIMAGED_OPTS} --daemon > /dev/null 2>&1
+ eend $? || failed_startup
+}
+
+stop() {
+ ebegin "Stopping partimaged"
+ start-stop-daemon --stop --exec ${PARTIMAGED}
+ eend $?
+}
diff --git a/sys-block/partimage/files/partimaged.init.2 b/sys-block/partimage/files/partimaged.init.2
new file mode 100644
index 000000000000..f19cebacf89a
--- /dev/null
+++ b/sys-block/partimage/files/partimaged.init.2
@@ -0,0 +1,28 @@
+#!/sbin/openrc-run
+# Copyright 2005-2010 Gentoo Foundation
+# 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 b/sys-block/partimage/files/partimaged.pam
new file mode 100644
index 000000000000..6ffb16fdf80b
--- /dev/null
+++ b/sys-block/partimage/files/partimaged.pam
@@ -0,0 +1,11 @@
+# PAM config file for Partimaged
+
+auth required pam_unix.so
+auth required pam_warn.so
+auth required pam_listfile.so \
+ onerr=fail item=user sense=allow \
+ file=/etc/partimaged/partimagedusers
+
+account include system-auth
+session include system-auth
+
diff --git a/sys-block/partimage/files/partimaged.pam.2 b/sys-block/partimage/files/partimaged.pam.2
new file mode 100644
index 000000000000..9ed5507a74f9
--- /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 000000000000..63de305e3ea7
--- /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 000000000000..0862b0608db1
--- /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.ebuild b/sys-block/partimage/partimage-0.6.9.ebuild
new file mode 100644
index 000000000000..fea44be61e02
--- /dev/null
+++ b/sys-block/partimage/partimage-0.6.9.ebuild
@@ -0,0 +1,139 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=4
+inherit eutils flag-o-matic pam user
+
+DESCRIPTION="Console-based application to efficiently save raw partition data to an 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 )"
+PAM_DEPEND="!static? ( pam? ( virtual/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() {
+ epatch "${FILESDIR}"/${P}-zlib-1.2.5.2.patch #405323
+ epatch "${FILESDIR}"/${P}-minor-typo.patch #580290
+}
+
+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 \
+ --docdir="${EPREFIX}"/usr/share/doc/${PF} \
+ --sysconfdir="${EPREFIX}"/etc \
+ $(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
+}