summaryrefslogtreecommitdiff
path: root/sys-block/partimage
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2022-04-06 22:33:41 +0100
committerV3n3RiX <venerix@koprulu.sector>2022-04-06 22:33:41 +0100
commite68d405c5d712af4387159df07e226217bdda049 (patch)
tree009ab0f3d427f0813e62930d71802cb054c07e30 /sys-block/partimage
parent401101f9c8077911929d3f2b60a37098460a5d89 (diff)
gentoo resync : 06.04.2022
Diffstat (limited to 'sys-block/partimage')
-rw-r--r--sys-block/partimage/Manifest3
-rw-r--r--sys-block/partimage/files/partimage-0.6.9-clang.patch181
-rw-r--r--sys-block/partimage/files/partimage-0.6.9-zlib-1.2.5.2-r1.patch33
-rw-r--r--sys-block/partimage/partimage-0.6.9-r3.ebuild141
4 files changed, 358 insertions, 0 deletions
diff --git a/sys-block/partimage/Manifest b/sys-block/partimage/Manifest
index ebab9255e943..fc6ea6ff6522 100644
--- a/sys-block/partimage/Manifest
+++ b/sys-block/partimage/Manifest
@@ -1,6 +1,8 @@
+AUX partimage-0.6.9-clang.patch 8058 BLAKE2B 2784fade3808eef2f8eacaa4441a6df3624c829954e33b186da2b9f8107aa3901b90f2bfb52e9a207e1beb1a3daa16bab18fbfc4db1b3800d97daa6003ea76ce SHA512 b0f17c618ed9e0c0e51c8534a2f0548dd466667eb3bf22a19869790ce8b7596a0f4b5d2aeb75d0a6351aeb83a9ac9f9aa8401d36413a84276714e0f95b6061bc
AUX partimage-0.6.9-minor-typo.patch 313 BLAKE2B c0d04a86e0d4c27ce8a1b097525c029c258ef37968058a888f2fbfc55da2035134b058c8b1118a0f86a3c3b5cd63116d5435371b43f9ba4b0f3e70ec830d18e8 SHA512 7bf9de9b08afce5c3b2bfa8943561df0605066866f7ba748872c9f81e1be4033e6f88c8033af1e1b7e2adb64263e8177ba9bcad1ac2e613b27e9c219fbff6828
AUX partimage-0.6.9-missing-includes.patch 834 BLAKE2B 713279432e869a35b9db5a68db5a1c9f88248c7d89af2d716d75b9d0382df74d72c1a15b5789377b47dcc1dd75bb26512ea6829826745864d37c250387b3c84b SHA512 c1a8251b2ac48add258136edf54f19660ca5528842eac693e9ae1dc47d9c5446037c39237f8eefbfb6def041c7c06826aab8aed67faa7c1e50f027d649cf9bc9
AUX partimage-0.6.9-openssl-1.1-compatibility.patch 1445 BLAKE2B 086fa11a2dc3326b86cdfd43abda921fbf7a03c95adf7cba28675ed5c8334582feedd0e1adbe16e7750333fcf730d67fd02f3a9a49a8f4d08881964eff51dadb SHA512 96c398a3d536ed6dc54ef8d6012f1ecefe78fd8a27b74966ba8d6095e593cbcd33213dc485c6dc13ee45a517928de2bce639b5679e91ed2aea2adb1f5b3efba6
+AUX partimage-0.6.9-zlib-1.2.5.2-r1.patch 983 BLAKE2B 6ee4dba05298ea6d38f4d3917385ffcb91b5f39515d00a8cd12e16087b24821f672e20e3d9591c5681709a3e109b9f213b222eaa96f46a4c884b6b3b2106ebce SHA512 dc1e64c0b852b8f24ed604956c0977cca7a246ee66f9c36a901e26396e9a5f4f99ac0cceb2d5b9c165060fa360519d24e77ea5464479019e8c6b20b93e82cb05
AUX partimage-0.6.9-zlib-1.2.5.2.patch 975 BLAKE2B 0e7e1de1ef590f74b46d94aaaa6eaf2eb62f06c3f33432d0201c820ec4e218d746ee8964e8cdfa1fc31bf31da1fb18fdfe3cb798cbb3111c17194dadbf4d6707 SHA512 8f5310a65e77822f816bedca9281be7627246f111960fc4092c2e3d44fa1bfcea786c130899970ce35da8be536491ae46b0ac1825d85ab6ccb6b1332f2f1b4e2
AUX partimaged.conf 307 BLAKE2B f1d0bc946a517f4896b55c749c0f244731d413119dfc15c22f5e0834ca87cdb37b278f8907bb18dade3a1ab48cbea3a4d7ef5b836af32260cbf1653627855a2f SHA512 1be320a8dceb3076e6aa2d8b1a8a4d01a380ad1209133997fd0d87cf1d0974fc4877c3c8b41c07fbb99249c8a00132f2c5fa7ffadf26f4e41cc2abfcd6b62116
AUX partimaged.init.2 628 BLAKE2B 872f72a4407ca0f923220e2c313779a0e52b6179b753567e125edfa983856695a88b49af2dd005b6bce0e9951ad11177611d3029cd2e02d28ab26b1195847660 SHA512 48919e1be73d0aaeeaf0f8b510af05eda613aa7aa6773e0886ca2d46119521326f46d8503f23b2dcb133ec4c8bc5a89f92787275bba869c6990074825515278f
@@ -8,4 +10,5 @@ AUX partimaged.pam.2 249 BLAKE2B e40a15c5fe4dc394cbcf9c478c3c764e67ec317f31c0397
AUX servercert.cnf 980 BLAKE2B 0660f9b92fe422754e36d6ce1889e8b8feb40954b36b3e00e58f5e534b85171ac42e66f74020a55dd1b14d56d7764c94427b8d1d112ca1a878dff388ac3ea787 SHA512 8aa0592ce0be3f08124880b823db59aa167e7d509ea1a9b48d9f895482f96e99a6e4df330c567b9ce331eed43cb4f1a70b1b7727878972a8b074265898b1e557
DIST partimage-0.6.9.tar.bz2 666522 BLAKE2B d9a240f82a7b6ae73997df46c964fdddf8dddea9e3bd9548252d9409a526358714908316c52864b60bc9fcc1113a5e1c6cf294faff6845a183c7ffe1012475a6 SHA512 252885921b23933fdcdf0bb6efa4b82066b08ca95cc653296912d384ae875b421c1d39f347a90115315139176d4eab4a930c24919c2d38cf00ed29c764cd14d9
EBUILD partimage-0.6.9-r2.ebuild 3562 BLAKE2B 80cca8ac3f798ea30706d000de2c705f6bb1788e85368e3ea3decaa6797508088e2f6a23972e422fc0c3ad09c568a3d0bebddb9a915ecef1c951b608b1e1e0b6 SHA512 362ea71a94a9e11e02596a9a5baf9bfb9070292f632b5b373ad2b45a4ba08cb859478b5c0cfb060236e247d5767e5bcea1ad26239e36cd9e84091504b272d5f6
+EBUILD partimage-0.6.9-r3.ebuild 3441 BLAKE2B 5c43bae80a6306ed47ffc9b2373815fc3dec3388bc39260a960efb9ea69c0798f7beae55ea8b559eac716de2e0b6acef764ece8e6ae2d426332e8cbd248fc014 SHA512 4921c1fee5b2503d43c3a4cb43b95c7810fd01133e2d0cba97af1dcb05d8574d4abc09bba288e6390c102148f0bd5cb8ca6f8032d3cc7d20aaaf9e3b9cec82e8
MISC metadata.xml 428 BLAKE2B 61e6517a2ee09ecc1093f4a90bae9cd7a1228cad3672bfaefba6a3d0785f34d3dfe35689c0798f0db3319441d31777b8f2bc2ca93ccef89780d280c6f0b26130 SHA512 2d0d8f33b9952b027e292899d5c046bed94a56b126d9a3a446ee9e5dc4f48e2a4cd5970cef576b8e72c2926b10ec15e6af2031347a7209a84470fafe3d92a89e
diff --git a/sys-block/partimage/files/partimage-0.6.9-clang.patch b/sys-block/partimage/files/partimage-0.6.9-clang.patch
new file mode 100644
index 000000000000..b6df8868d16e
--- /dev/null
+++ b/sys-block/partimage/files/partimage-0.6.9-clang.patch
@@ -0,0 +1,181 @@
+--- a/src/client/gui_text.cpp
++++ b/src/client/gui_text.cpp
+@@ -341,7 +341,7 @@
+ m_labelSplit = newtLabel(1, 12, i18n("Image split mode"));
+ m_radioSplitAuto = newtRadiobutton(1, 13, i18n("Automatic split (when no space left)"), !options.qwSplitSize, NULL);
+ m_radioSplitSize = newtRadiobutton(1, 14, i18n("Into files whose size is:............"), !!options.qwSplitSize, m_radioSplitAuto);
+- SNPRINTF(szTemp, "%"PRIu64"", (!!options.qwSplitSize) ? (options.qwSplitSize/1024/1024) : 2048);
++ SNPRINTF(szTemp, "%" PRIu64 "", (!!options.qwSplitSize) ? (options.qwSplitSize/1024/1024) : 2048);
+ m_editSplitSize = newtEntry(43, 14, szTemp, 8, NULL, 0);
+ m_labelSplitSizeKB = newtLabel(52, 14, i18n("MiB"));
+ m_checkSplitWait = newtCheckbox(1, 15, i18n("Wait after each volume change"), (!!options.bSplitWait ? 'X' : ' '), " X", NULL);
+@@ -462,7 +462,7 @@
+ SNPRINTF(szTemp, i18n("Partition to save:...........%s"), szDevice);
+ m_labelPartition = newtLabel(1, 0, szTemp);
+
+- SNPRINTF(szTemp, i18n("Size of the Partition:.......%s = %"PRIu64" bytes"), formatSize(qwPartSize, szTemp2), qwPartSize);
++ SNPRINTF(szTemp, i18n("Size of the Partition:.......%s = %" PRIu64 " bytes"), formatSize(qwPartSize, szTemp2), qwPartSize);
+ m_labelPartitionSize = newtLabel(1, 1, szTemp);
+
+ SNPRINTF(szTemp, i18n("Image file to create:........%s"), szImageFile);
+@@ -610,7 +610,7 @@
+ newtLabelSetText(m_labelImageFileSize, szTemp);
+ }
+
+- SNPRINTF (szTemp, i18n("Available space for image:...%s = %"PRIu64" bytes"), formatSize(qwFreeSpace, szTemp2), qwFreeSpace);
++ SNPRINTF (szTemp, i18n("Available space for image:...%s = %" PRIu64 " bytes"), formatSize(qwFreeSpace, szTemp2), qwFreeSpace);
+ newtLabelSetText(m_labelFreeSpace, szTemp);
+
+ //option -B gui=no
+@@ -734,7 +734,7 @@
+ SNPRINTF(szTemp, i18n("Partition to restore:.............%s"), szDevice);
+ m_labelPartition = newtLabel(1, 0, szTemp);
+
+- SNPRINTF(szTemp, i18n("Size of partition to restore:.....%s = %"PRIu64" bytes"), formatSize(qwCurPartSize, szTemp2), qwCurPartSize);
++ SNPRINTF(szTemp, i18n("Size of partition to restore:.....%s = %" PRIu64 " bytes"), formatSize(qwCurPartSize, szTemp2), qwCurPartSize);
+ m_labelPartitionSize = newtLabel(1, 1, szTemp);
+
+ SNPRINTF(szTemp, i18n("Image file to use:................%s"), szImageFile);
+@@ -751,7 +751,7 @@
+ SNPRINTF(szTemp, i18n("Image created on:.................%s\n"), asctime_portable(&dateCreate));
+ m_labelDate = newtLabel(1, 6, szTemp);
+
+- SNPRINTF(szTemp, i18n("Size of the original partition:...%s = %"PRIu64" bytes"), formatSize(qwOrigPartSize, szTemp2), qwOrigPartSize);
++ SNPRINTF(szTemp, i18n("Size of the original partition:...%s = %" PRIu64 " bytes"), formatSize(qwOrigPartSize, szTemp2), qwOrigPartSize);
+ m_labelOriginalPartitionSize = newtLabel(1, 7, szTemp);
+
+ // stats
+--- a/src/client/imginfo.cpp
++++ b/src/client/imginfo.cpp
+@@ -111,7 +111,7 @@
+ {
+ snprintf(szText, nMaxTextLen, i18n("-------------------- MBR %.3d -------------------\n"
+ "Device:................%s\n"
+- "Device blocks count:...%"PRIu64"\n"
++ "Device blocks count:...%" PRIu64 "\n"
+ "Device model:..........%s\n\n"),
+ i, mbr->szDevice, mbr->qwBlocksCount, mbr->szDescModel);
+ }
+@@ -153,7 +153,7 @@
+ snprintf(szText, nMaxTextLen, i18n("Volume number:.........%u\n"
+ "Volume size:...........%s\n"
+ "Compression level: ....%d -> %s\n"
+- "Identificator:.........%"PRIu64"=%"PRIX64"\n\n"),
++ "Identificator:.........%" PRIu64 "=%" PRIX64 "\n\n"),
+ head->dwVolumeNumber, formatSize(qwImageSize, cTemp), dwCompression,
+ szCompression, head->qwIdentificator, head->qwIdentificator);
+ }
+--- a/src/client/main.cpp
++++ b/src/client/main.cpp
+@@ -301,7 +301,7 @@
+ case 'V': // split image into multiple files
+
+ options.qwSplitSize = (QWORD)atol(optarg) * 1024 * 1024;
+- fprintf (stderr, i18n("Volume size: %"PRIu64" bytes (%ld MiB)\n"),
++ fprintf (stderr, i18n("Volume size: %" PRIu64 " bytes (%ld MiB)\n"),
+ options.qwSplitSize, atol(optarg));
+ break;
+
+--- a/src/client/misc.cpp
++++ b/src/client/misc.cpp
+@@ -211,7 +211,7 @@
+ image.closeReading(true);
+ throw excep;
+ }
+- SNPRINTF(szTemp, "%.3u: %s [%"PRIu64" blocks]", i, mbrOriginal[i].szDevice, mbrOriginal[i].qwBlocksCount);
++ SNPRINTF(szTemp, "%.3u: %s [%" PRIu64 " blocks]", i, mbrOriginal[i].szDevice, mbrOriginal[i].qwBlocksCount);
+ if (options->bBatchMode == false)
+ optGui.addMbr(szTemp, i);
+
+--- a/src/client/fs/fs_base.cpp
++++ b/src/client/fs/fs_base.cpp
+@@ -730,10 +730,10 @@
+
+ if (bShowBlocksInfo)
+ {
+- SNPRINTF(szBlocksInfo, i18n("Block size:...................%"PRIu64" bytes\n"
+- "Total blocks count:...........%"PRIu64"\n"
+- "Used blocks count:............%"PRIu64"\n"
+- "Free blocks count:............%"PRIu64"\n"),
++ SNPRINTF(szBlocksInfo, i18n("Block size:...................%" PRIu64 " bytes\n"
++ "Total blocks count:...........%" PRIu64 "\n"
++ "Used blocks count:............%" PRIu64 "\n"
++ "Free blocks count:............%" PRIu64 "\n"),
+ m_header.qwBlockSize,
+ m_header.qwBlocksCount,
+ m_header.qwUsedBlocks,
+@@ -745,7 +745,7 @@
+ }
+
+ snprintf(szDest, nMaxLen, i18n("%s" // Blocks infos
+- "Space usage:..................%"PRIu64" %%\n"
++ "Space usage:..................%" PRIu64 " %%\n"
+ "Used space:...................%s\n"
+ "Free space:...................%s\n"
+ "Bitmap size:..................%s\n"
+--- a/src/client/fs/fs_hfs.cpp
++++ b/src/client/fs/fs_hfs.cpp
+@@ -142,10 +142,10 @@
+ getStdInfos(szText, sizeof(szText), true);
+
+ SNPRINTF(szFullText, i18n("%s" // standard infos
+- "Allocation Group count:.......%"PRIu64"\n"
++ "Allocation Group count:.......%" PRIu64 "\n"
+ "Blocks per Allocation Group:..%u\n"
+ "Allocation Group size:........%s\n"
+- "First allocation block:.......%"PRIu64"\n"),
++ "First allocation block:.......%" PRIu64 "\n"),
+ szText, m_info.qwAllocCount, m_info.dwBlocksPerAlloc,
+ formatSize(m_info.dwAllocSize,szTemp1), m_info.qwFirstAllocBlock);
+
+--- a/src/client/fs/fs_ntfs.cpp
++++ b/src/client/fs/fs_ntfs.cpp
+@@ -312,7 +312,7 @@
+ "Bytes per sector:.............%u\n"
+ "Sectors per cluster:..........%u\n"
+ "File record size:.............%u\n"
+- "LCN of MFT Data attrib:.......%"PRIu64"\n"),
++ "LCN of MFT Data attrib:.......%" PRIu64 "\n"),
+ szText, m_info.nBytesPerSector, m_info.cSectorsPerCluster,
+ m_info.dwFileRecordSize, m_info.qwLCNOfMftDataAttrib);
+
+@@ -730,7 +730,7 @@
+ QWORD i;
+
+ for (i=0L; i < m_qwClustersCount; i++)
+- fprintf(stderr, "cluster[%llu] = %"PRIu64"\n", (long long unsigned int)i, m_qwOffset[i]);
++ fprintf(stderr, "cluster[%llu] = %" PRIu64 "\n", (long long unsigned int)i, m_qwOffset[i]);
+
+ }
+
+--- a/src/client/fs/fs_ufs.cpp
++++ b/src/client/fs/fs_ufs.cpp
+@@ -217,7 +217,7 @@
+ "Cylinder group size:..........%s\n"
+ "Basic blocks per CG:..........%u\n"
+ "Basic block size:.............%u\n"
+- "Data frags count:.............%"PRIu64"\n"),
++ "Data frags count:.............%" PRIu64 "\n"),
+ szText, m_info.dwCylinderGroupsCount,
+ formatSize(m_info.dwCylinderGroupSize*m_info.dwBasicBlockSize,szTemp1),
+ m_info.dwCylinderGroupSize, m_info.dwBasicBlockSize, m_info.qwDataFrags);
+--- a/src/shared/common.cpp
++++ b/src/shared/common.cpp
+@@ -272,7 +272,7 @@
+
+ if (qwSize < llKiloB) // In Bytes
+ {
+- snprintf(szText, nMaxLen, i18n("%"PRId64" bytes"), qwSize);
++ snprintf(szText, nMaxLen, i18n("%" PRId64 " bytes"), qwSize);
+ }
+ else if (qwSize < llMegaB) // In KiloBytes
+ {
+@@ -311,7 +311,7 @@
+
+ if (qwSize < llKiloB) // In Bytes
+ {
+- snprintf(szText, nMaxLen, i18n("%"PRId64" Bytes"), qwSize);
++ snprintf(szText, nMaxLen, i18n("%" PRId64 " Bytes"), qwSize);
+ }
+ else if (qwSize < llMegaB) // In KiloBytes
+ {
diff --git a/sys-block/partimage/files/partimage-0.6.9-zlib-1.2.5.2-r1.patch b/sys-block/partimage/files/partimage-0.6.9-zlib-1.2.5.2-r1.patch
new file mode 100644
index 000000000000..05150e131e36
--- /dev/null
+++ b/sys-block/partimage/files/partimage-0.6.9-zlib-1.2.5.2-r1.patch
@@ -0,0 +1,33 @@
+http://bugs.gentoo.org/405323
+
+--- a/src/client/imagefile.cpp
++++ b/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
+--- a/src/client/imagefile.h
++++ b/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/partimage-0.6.9-r3.ebuild b/sys-block/partimage/partimage-0.6.9-r3.ebuild
new file mode 100644
index 000000000000..acd0d0f68be4
--- /dev/null
+++ b/sys-block/partimage/partimage-0.6.9-r3.ebuild
@@ -0,0 +1,141 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit autotools flag-o-matic pam
+
+DESCRIPTION="Console-based application to efficiently save raw partition data to image file"
+HOMEPAGE="https://www.partimage.org/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2"
+
+LICENSE="GPL-2+"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~sparc ~x86"
+IUSE="nls nologin pam ssl static"
+REQUIRED_USE="static? ( !pam )"
+
+COMMON_DEPEND="
+ acct-group/partimag
+ acct-user/partimag
+"
+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="pam? ( sys-libs/pam )"
+RDEPEND="
+ ${COMMON_DEPEND}
+ ${PAM_DEPEND}
+ !static? ( ${LIBS_DEPEND} )
+"
+DEPEND="
+ ${PAM_DEPEND}
+ ${LIBS_DEPEND}
+"
+BDEPEND="
+ ${COMMON_DEPEND}
+ nls? ( sys-devel/gettext )
+"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-0.6.9-zlib-1.2.5.2-r1.patch #405323
+ "${FILESDIR}"/${PN}-0.6.9-minor-typo.patch #580290
+ "${FILESDIR}"/${PN}-0.6.9-openssl-1.1-compatibility.patch
+ "${FILESDIR}"/${PN}-0.6.9-missing-includes.patch
+ "${FILESDIR}"/${PN}-0.6.9-clang.patch
+)
+
+src_prepare() {
+ default
+ eautoreconf
+}
+
+src_configure() {
+ # XXX: Do we still need these?
+ filter-flags -fno-exceptions
+ use ppc && append-flags -fsigned-char
+
+ local myeconfargs=(
+ $(use_enable nls)
+ $(usex nologin '--disable-login' '')
+ $(use_enable pam)
+ $(use_enable ssl)
+ $(use_enable static all-static)
+ --with-log-dir="${EPREFIX}"/var/log/partimage
+ )
+
+ econf "${myeconfargs[@]}"
+}
+
+src_install() {
+ default
+
+ keepdir /var/lib/partimage
+ keepdir /var/log/partimage
+
+ newinitd "${FILESDIR}"/partimaged.init.2 partimaged
+ newconfd "${FILESDIR}"/partimaged.conf partimaged
+
+ if use pam; then
+ newpamd "${FILESDIR}"/partimaged.pam.2 partimaged
+ fi
+
+ if use ssl; then
+ insinto /etc/partimaged
+ doins "${FILESDIR}"/servercert.cnf
+ fi
+
+ fowners partimag:root /etc/partimaged/partimagedusers
+}
+
+pkg_config() {
+ if use ssl; then
+ local confdir="${EROOT}"/etc/partimaged
+ local privkey="${confdir}"/partimaged.key
+ local cnf="${confdir}"/servercert.cnf
+ local csr="${confdir}"/partimaged.csr
+ local cert="${confdir}"/partimaged.cert
+
+ 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}" 2048 || 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"
+ chmod 600 "${privkey}" || die
+ chown partimag:root "${privkey}" || die
+ chmod 644 "${cert}" "${csr}" || die
+ chown root:root "${cert}" "${csr}" || die
+ einfo "Done"
+ else
+ einfo "SSL is disabled, not building certificates"
+ fi
+}
+
+pkg_postinst() {
+ if use ssl; then
+ einfo "To create the required SSL certificates, please do:"
+ einfo "emerge --config =${PF}"
+ fi
+}