summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiego Elio Pettenò <flameeyes@gentoo.org>2010-11-19 19:36:33 +0000
committerDiego Elio Pettenò <flameeyes@gentoo.org>2010-11-19 19:36:33 +0000
commitb1429339bd36271aa6b79e38082fbf507bd503a2 (patch)
treef03158d377074d63dccd9880bdf1873221ec8d44 /sys-block
parentAutomated update of use.local.desc (diff)
downloadhistorical-b1429339bd36271aa6b79e38082fbf507bd503a2.tar.gz
historical-b1429339bd36271aa6b79e38082fbf507bd503a2.tar.bz2
historical-b1429339bd36271aa6b79e38082fbf507bd503a2.zip
Version bump (bug #330159), with fixes for PAM (bug #261686) and init script. Remove man pages that we no longer install.
Package-Manager: portage-2.2.0_alpha4/cvs/Linux x86_64
Diffstat (limited to 'sys-block')
-rw-r--r--sys-block/partimage/ChangeLog10
-rw-r--r--sys-block/partimage/Manifest19
-rw-r--r--sys-block/partimage/files/partimage.1177
-rw-r--r--sys-block/partimage/files/partimaged.858
-rw-r--r--sys-block/partimage/files/partimaged.init.229
-rw-r--r--sys-block/partimage/files/partimaged.pam.27
-rw-r--r--sys-block/partimage/files/partimagedusers.548
-rw-r--r--sys-block/partimage/partimage-0.6.9.ebuild137
8 files changed, 197 insertions, 288 deletions
diff --git a/sys-block/partimage/ChangeLog b/sys-block/partimage/ChangeLog
index f503f0806757..c12efca8c8a9 100644
--- a/sys-block/partimage/ChangeLog
+++ b/sys-block/partimage/ChangeLog
@@ -1,6 +1,14 @@
# ChangeLog for sys-block/partimage
# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-block/partimage/ChangeLog,v 1.48 2010/08/11 21:00:19 josejx Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-block/partimage/ChangeLog,v 1.49 2010/11/19 19:36:33 flameeyes Exp $
+
+*partimage-0.6.9 (19 Nov 2010)
+
+ 19 Nov 2010; Diego E. Pettenò <flameeyes@gentoo.org>
+ +partimage-0.6.9.ebuild, +files/partimaged.init.2, +files/partimaged.pam.2,
+ -files/partimage.1, -files/partimaged.8, -files/partimagedusers.5:
+ Version bump (bug #330159), with fixes for PAM (bug #261686) and init script.
+ Remove man pages that we no longer install.
11 Aug 2010; Joseph Jezak <josejx@gentoo.org> partimage-0.6.8.ebuild:
Marked ppc stable for bug #159556.
diff --git a/sys-block/partimage/Manifest b/sys-block/partimage/Manifest
index 7c066a4216e0..88c65f7384f3 100644
--- a/sys-block/partimage/Manifest
+++ b/sys-block/partimage/Manifest
@@ -1,13 +1,24 @@
+-----BEGIN PGP SIGNED MESSAGE-----
+Hash: SHA1
+
AUX partimage-0.6.8-destdir.patch 562 RMD160 24cf252d35451474a90da88f4dc5354f33979965 SHA1 6825cb3015b3d271110d99686324d83f5333047d SHA256 ba51a0397ae9e220da4a76d2f441c96e1327e9bf6a696f44b6d01baf31e4603a
AUX partimage-0.6.8-openssl-1.patch 593 RMD160 df47fd0d19baf3fccffd654f82667f3ca5f73f3f SHA1 5faeab46525557247f21cb3f629dcd33e58050fb SHA256 179e0876c29bc619d3bec50565122681f36396cc68cce563679e82d04b31671e
-AUX partimage.1 4492 RMD160 6d35af437de84b7825d089aa7883593bd93124ef SHA1 1b9514e8e8b13a7e4a3dc1b497008e79fc295a48 SHA256 9c6f726dd4e873271765c402d6b1d971532d0c3540fb78a09ed4ddf8d06ba2e6
-AUX partimaged.8 1448 RMD160 8cd38ac1b519f805b43fea713f15067c1ae4eec9 SHA1 8d370d024934b416d2ad8ed4c297e78acabe3679 SHA256 f82674fb2956836afacc440b03703fb7a48339abad7d1e8573f208adf8fffa51
AUX partimaged.conf 424 RMD160 e1dbe5dd5a3eec01b3061cce992f1fbee4bec167 SHA1 f571f19bf872f43df9c086162aed96992a073db3 SHA256 f794f539051e0f2e5f3ce357c4683c4a22a9e87b31f1ae113fcf58cd8bda43cf
AUX partimaged.init 760 RMD160 21e18889534c4714ae90db869fbae4c5774d2228 SHA1 8b804b97391469811b29d2a2a84d11c7ca0090f5 SHA256 43d774892dac80d07052f8cbc2b2223e6d29c763ccaa8162e04b3b534a361aff
+AUX partimaged.init.2 748 RMD160 5139309e959992774d8d1ef492932f0e2825552a SHA1 4c268f4cfe0ff34578d9c17811f55197aa6dd204 SHA256 d6249338b5450de5ee4c8d101cbfe49ff465de18cec6eafdcc488079bc4300cc
AUX partimaged.pam 266 RMD160 07b472d4ffdf3f5c10e7b04ba0c1df87e3e1cf9d SHA1 8955da1485c3d15d6193a4a405bc841cf7698017 SHA256 6072116adb36c49a4a4c36a134355162bf215ec7b6716593de76de3123c5adbe
-AUX partimagedusers.5 1263 RMD160 6416fd7f013e637b99f10c32607994e11728bdd0 SHA1 56afebd408dc14d3270a9a43702d335fa598998e SHA256 6037d086ddcdebd76b2f2477252173e8242ac528bc7025a391364a4da174f0f3
+AUX partimaged.pam.2 249 RMD160 99bff4002bb655b42bc19f5f5cc620789edd87a9 SHA1 f3213d0749316c40b41b3eb4e51c63961a61c96a SHA256 1f050f33a6646d067476746ea56a4fd8c7beb9ce06a859d9a454c3f78d66cb8a
AUX servercert.cnf 1096 RMD160 8786b07466c5330254eb96e1de6f754e8a68e77f SHA1 64fc34b0fbb8a07dc90ea6be932c4e51a6839721 SHA256 9a9cae8cd6c7bbc6f71cd619829b7a6a47d6aae34831cc44a6cc3bf3e7917953
DIST partimage-0.6.8.tar.bz2 631193 RMD160 93262d84c69719451ad82b7cbb7e07f8dced61bc SHA1 e88c22e8ba67545dc9d836c12ec56c89c0c11663 SHA256 98f91bf6baa108e390989ce963f75bc30f40ba9c6eb4e953abeedca9a6e6e4b4
+DIST partimage-0.6.9.tar.bz2 666522 RMD160 b3678ddb8de4adb55a522df0d2ce110944517554 SHA1 3b9804b2289d7876835042a144d5fd1949aef1a4 SHA256 753a6c81f4be18033faed365320dc540fe5e58183eaadcd7a5b69b096fec6635
EBUILD partimage-0.6.8.ebuild 3711 RMD160 26d0bb51cd5de844f9581a35e91e4d56b02a6d8c SHA1 98b8a541c5786a51ddca6db3b9661c9a01bd1654 SHA256 2e79f5741e51f7b528be65a8d5e731a1087f6a6e3c34b395ae5ed5fd84ac9584
-MISC ChangeLog 12665 RMD160 b2c8de409d90f30609162f61ff9e24081dd2ef45 SHA1 aa782ddcc2ef8ee6e0fd85c9724e807d580f776f SHA256 ef0efad5eaa61bcbfd51b3f7633dffcd10aa7f4f9e30cf6b767b699a08b12348
+EBUILD partimage-0.6.9.ebuild 3610 RMD160 93308e9a851f64cf18e971a3c1bb60ac34f35f60 SHA1 ee15cabd8e1619fe6a8308148dc0f55ca759e094 SHA256 0411b529ea6f4d76e3379aa33b1af9f0330c414839d6391848d04d4806a6faa2
+MISC ChangeLog 13030 RMD160 9cd08143e9de0013c453c55847f6e225f7c71e71 SHA1 320da354dcac235ec02843774ba880bb3092d33e SHA256 20ad86dd14c3d4bc9df695df28260a3fc6ac0ec44166ba0acd356300a677c979
MISC metadata.xml 263 RMD160 f6a0896b330530ad4354f3d145b000d57dafb95a SHA1 cd64d6abb8aff2ed3503c5695884453506e3d952 SHA256 1067ab0115fc08e2b71da0707f6cacd6a229d6f1ce5ea3a57c24dc1c171948f5
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v2.0.16 (GNU/Linux)
+
+iEYEARECAAYFAkzm0YEACgkQAiZjviIA2XipQQCbBiwCJyLqm3Dasvg3IXJJOpxY
+614AoOTUwBGRW0pR0Ti/CXV86FuyQgXe
+=gb5W
+-----END PGP SIGNATURE-----
diff --git a/sys-block/partimage/files/partimage.1 b/sys-block/partimage/files/partimage.1
deleted file mode 100644
index 3d2c84676363..000000000000
--- a/sys-block/partimage/files/partimage.1
+++ /dev/null
@@ -1,177 +0,0 @@
-.\"
-.\" Copyright (c) 2001 Partition Image Team
-.\" All rights reserved.
-.\"
-.\" Permission is granted to copy, distribute and/or modify this
-.\" document under the terms of the GNU Free Documentation License,
-.\" Version 1.1 or any later version published by the Free Software
-.\" Foundation; with no Invariant Sections, with no Front-Cover Texts, and
-.\" with no Back-Cover Texts.
-.\"
-.TH partimage 1 "24 June 2001"
-.UC 1
-.SH NAME
-partimage \- back up and restore disk partitions
-.SH SYNOPSIS
-.B partimage
-.RB [ " \-bcdehimMnoSvwy " ]
-.RB [ \-B\ 'pattern\ response\ string' ]
-.RB [ \-z\ compresslevel ]
-.RB [ \-V\ volumesize ]
-.RB [ \-f\ actionatend ]
-.RB [ \-s\ server ]
-.RB [ \-p\ port ]
-.RB [ \-a\ mountoptions ]
-.RB [ \-g\ loglevel ]
-[
-.I "save"
-.I "device"
-.I "image_file"
-]
-.br
-.B partimage
-.RB [ " \-bcdehimMnoSvwy " ]
-.RB [ \-B\ 'pattern\ response\ string' ]
-.RB [ \-z\ compresslevel ]
-.RB [ \-V\ volumesize ]
-.RB [ \-f\ actionatend ]
-.RB [ \-s\ server ]
-.RB [ \-p\ port ]
-.RB [ \-a\ mountoptions ]
-.RB [ \-g\ loglevel ]
-[
-.I "restore"
-.I "device"
-.I "image_file/'stdin'"
-]
-.br
-.B partimage
-[
-.I "restmbr"
-.I "image_file"
-]
-.br
-.B partimage
-[
-.I "imginfo"
-.I "image_file"
-]
-.SH DESCRIPTION
-\fIpartimage\fR backs up disk partitions into image files and restores them.
-.SH OPTIONS
-.TP
-.B \-z val, --compress val
-Set image file compression level:
-.br
-val=0: don't compress: very fast but very big image file
-.br
-val=1: compress using gzip: fast and small image file (default)
-.br
-val=2: compress using bzip2: very slow and very small image file
-.TP
-.B \-c, --nocheck
-Don't check the partition before saving.
-.TP
-.B \-o, --overwrite
-Overwrite the existing image file without confirmation.
-.TP
-.B \-d, --nodesc
-Don't ask any description for the image file.
-.TP
-.B \-V vol, --volume vol
-Split image into multiple volumes files. vol will be the size in KB of volumes.
-.TP
-.B \-w, --waitvol
-Wait for a confirmation after each volume change.
-.TP
-.B \-e, --erase
-Erase empty blocks on restore with zero bytes.
-.TP
-.B \-m, --allowmnt
-Don't fail if the partition is mounted. Dangerous!
-.TP
-.B \-M, --nombr
-Don't create a backup of the MBR (Mast Boot Record) in the image file.
-.TP
-.B \-h, --help
-Show help.
-.TP
-.B \-v, --version
-Show version.
-.TP
-.B \-f action, --finish action
-Action to do if finished successfully:
-.br
-action=0: wait (do nothing)
-.br
-action=1: halt (power off the computer)
-.br
-action=2: reboot (restart the computer)
-.br
-action=3: quit
-.TP
-.B \-b, --batch
-batch mode: the GUI won't wait for an user action.
-.TP
-.B \-B 'pattern response string', --fully-batch 'pattern response string'
-full batch mode: the GUI is not being displayed. Rather status messages
-are displayed as normal text.
-The pattern response string has the following format:
-.br
-.B \'<glob-pattern>=<response-value>;...\'
-.br
-where the glob pattern is matched against the string
-.B <window-title>/<message-text>
-of the message dialogue box to be displayed. For dialog boxes with
-buttons in the window, the <response> must be the exact button text.
-The pattern response string usually needs to be quoted as above.
-.TP
-.B \-y, --nosync
-Don't synchronize the disks at the end of the operation. Dangerous!
-.TP
-.B \-s addr, --server addr
-Give partimaged server's ip address.
-.TP
-.B \-p port, --port port
-Give partimaged server's listening port.
-.TP
-.B \-g debuglevel, --debug debuglevel
-Set the debug level to debuglevel (defaults to 1).
-.TP
-.B \-n, --nossl
-Disable SSL in network mode.
-.TP
-.B \-S, --simulate
-Simulation of restoration mode.
-.TP
-.B \-a str, --automnt str
-Automatic mount with X options. Read the doc for more details.
-
-.SH EXAMPLE
-partimage -z1 -o -d save /dev/hda12 /mnt/backup/redhat-6.2.partimg.gz
-.br
-partimage -z1 -om save /dev/hda9 /mnt/backup/win95-osr2.partimg.gz
-.br
-partimage restore /dev/hda13 /mnt/backup/suse-6.4.partimg
-.br
-cat debian.partimg.000 debian.partimg.001 | partimage restore /dev/hda1 stdin
-.br
-partimage restmbr /mnt/backup/debian-potato-2.2.partimg.bz2
-.br
-partimage imginfo /mnt/backup/debian-potato-2.2.partimg.bz2
-.SH SEE ALSO
-.BR partimaged(8)
-.SH DIAGNOSTICS
-You can read options set at compile time running 'partimage -i'.
-.PP
-When using batchmode, exit status is normaly 0.
-.SH CAVEATS
-For now, only ext2fs, FAT16, FAT32, NTFS, HPFS, JFS, XFS, reiserfs are supported.
-.PP
-FAT12 will never be supported.
-.SH BUGS
-Refer to BUGS file to read them.
-.SH AUTHOR
-.nf
-Franck Ladurelle <ladurelf@partimage.org>
-
diff --git a/sys-block/partimage/files/partimaged.8 b/sys-block/partimage/files/partimaged.8
deleted file mode 100644
index 8e21ffe3213c..000000000000
--- a/sys-block/partimage/files/partimaged.8
+++ /dev/null
@@ -1,58 +0,0 @@
-.\"
-.\" Copyright (c) 2001 Partition Image Team
-.\" All rights reserved.
-.\"
-.\" Permission is granted to copy, distribute and/or modify this
-.\" document under the terms of the GNU Free Documentation License,
-.\" Version 1.1 or any later version published by the Free Software
-.\" Foundation; with no Invariant Sections, with no Front-Cover Texts, and
-.\" with no Back-Cover Texts.
-.\"
-.TH partimaged 8 "24 June 2001"
-.UC 1
-.SH NAME
-partimaged \- backups/restores partitions server
-.SH SYNOPSIS
-.B partimaged
-.RB [ " \-Dhnv " ]
-.RB [ \-r\ directory ]
-.RB [ \-p\ port ]
-.RB [ \-g\ loglevel ]
-.SH DESCRIPTION
-.B partimaged
-can be used to use partimage on network. Run partimaged on the computer where
-you want to save imagefiles and run partimage on stations you want to backup.
-.SH OPTIONS
-.TP
-.B \-D --daemon
-Start server in daemon mode.
-.TP
-.B \-h --help
-show help
-.TP
-.B \-v --version
-show version
-.TP
-.B \-p port --port port
-Give server's listening port.
-.TP
-.B \-d directory --dest directory
-Directory where the images will be stored.
-.TP
-.B \-g debuglevel --debug debuglevel
-Set the debug level to debuglevel (defaults to 1).
-.TP
-.B \-r dir --chroot dir
-Use chroot to improve security.
-.SH SEE ALSO
-.BR partimage(1) ,
-.BR partimagedusers(5)
-.SH DIAGNOSTICS
-You can read options set at compile time running 'partimage -i'.
-.SH BUGS
-Refer to BUGS file to read them.
-.SH AUTHOR
-.nf
-Franck Ladurelle <ladurelf@partimage.org>
-
-
diff --git a/sys-block/partimage/files/partimaged.init.2 b/sys-block/partimage/files/partimaged.init.2
new file mode 100644
index 000000000000..707454d6b328
--- /dev/null
+++ b/sys-block/partimage/files/partimaged.init.2
@@ -0,0 +1,29 @@
+#!/sbin/runscript
+# Copyright 2005-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License, v2 or later
+# $Header: /var/cvsroot/gentoo-x86/sys-block/partimage/files/partimaged.init.2,v 1.1 2010/11/19 19:36:33 flameeyes Exp $
+
+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 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/partimagedusers.5 b/sys-block/partimage/files/partimagedusers.5
deleted file mode 100644
index 502312506202..000000000000
--- a/sys-block/partimage/files/partimagedusers.5
+++ /dev/null
@@ -1,48 +0,0 @@
-.\"
-.\" Copyright (c) 2001 Partition Image Team
-.\" All rights reserved.
-.\"
-.\" Permission is granted to copy, distribute and/or modify this
-.\" document under the terms of the GNU Free Documentation License,
-.\" Version 1.1 or any later version published by the Free Software
-.\" Foundation; with no Invariant Sections, with no Front-Cover Texts, and
-.\" with no Back-Cover Texts. A copy of the license is included in top of
-.\" package.
-.\"
-.TH partimagedusers 5 "23 June 2001"
-.UC 5
-.SH NAME
-partimagedusers \- list of allowed users.
-.SH DESCRIPTION
-The
-.B partimagedusers
-file
-lists all allowed users to connect partimaged. This file must belong to user \
- "partimag" and must have permissions -rw------- or -r-------.
-.PP
-The configuration file consists of a set of lines.
-All empty lines will be ignored.
-Comments begin with a #, and everything on the line after them are ignored.
-.PP
-Put all allowed to connect partimaged users on the remaining lines, one
-login per line.
-.SH EXAMPLE
-.LP
-.PD .1v
-.RS
-.nf
-#
-# Sample users list for partimaged
-# We only allow user2 and user6 to connect partimaged
-# from partimage
-user2
-user6
-# end of list
-.PD
-.SH "SEE ALSO"
-.BR partimage(1) ,
-.BR partimaged(8)
-.SH AUTHOR
-.nf
-Franck Ladurelle <ladurelf@partimage.org>
-
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..c818f31e8718
--- /dev/null
+++ b/sys-block/partimage/partimage-0.6.9.ebuild
@@ -0,0 +1,137 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-block/partimage/partimage-0.6.9.ebuild,v 1.1 2010/11/19 19:36:33 flameeyes Exp $
+
+EAPI=3
+inherit eutils flag-o-matic pam
+
+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_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) \
+ --disable-dependency-tracking \
+ $(use_enable ssl) \
+ --disable-pam \
+ $(use_enable static all-static) \
+ --with-log-dir="${EPREFIX}"/var/log/partimage \
+ ${myconf}
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die
+ dodoc BOOT-ROOT.txt FORMAT FUTURE THANKS
+
+ keepdir /var/lib/partimage
+ keepdir /var/log/partimage
+
+ newinitd "${FILESDIR}"/partimaged.init.2 partimaged || die
+ newconfd "${FILESDIR}"/partimaged.conf partimaged || die
+
+ if use ssl; then
+ insinto /etc/partimaged
+ doins "${FILESDIR}"/servercert.cnf || die
+ fi
+
+ if use pam; then
+ newpamd "${FILESDIR}"/partimaged.pam.2 partimaged || die
+ fi
+}
+
+confdir=${ROOT}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 "Failed!"
+ 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 "Failed!"
+ 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 "Failed!"
+ else
+ einfo "Self-signed certifcate already exists: ${cert}"
+ fi
+ einfo "Setting permissions"
+ partimagesslperms || die "Failed!"
+ 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 "${ROOT}"etc/partimaged/partimagedusers || die
+}