Gentoo Archives: gentoo-commits

From: "Anthony G. Basile" <blueness@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/proj/ppc64le:master commit in: sys-block/partimage/files/, sys-block/partimage/
Date: Tue, 28 Jun 2016 17:39:46
Message-Id: 1467135678.ac7763cfd629bdf3f90ed5c38f4f2cfe38db14f8.blueness@gentoo
1 commit: ac7763cfd629bdf3f90ed5c38f4f2cfe38db14f8
2 Author: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
3 AuthorDate: Tue Jun 28 17:41:18 2016 +0000
4 Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
5 CommitDate: Tue Jun 28 17:41:18 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/proj/ppc64le.git/commit/?id=ac7763cf
7
8 sys-block/partimage: copy from tree
9
10 sys-block/partimage/Manifest | 1 +
11 .../partimage/files/partimage-0.6.8-destdir.patch | 11 ++
12 .../files/partimage-0.6.8-openssl-1.patch | 30 +++++
13 .../files/partimage-0.6.9-minor-typo.patch | 13 ++
14 .../files/partimage-0.6.9-zlib-1.2.5.2.patch | 33 +++++
15 sys-block/partimage/files/partimaged.conf | 10 ++
16 sys-block/partimage/files/partimaged.init | 29 +++++
17 sys-block/partimage/files/partimaged.init.2 | 29 +++++
18 sys-block/partimage/files/partimaged.pam | 11 ++
19 sys-block/partimage/files/partimaged.pam.2 | 7 ++
20 sys-block/partimage/files/servercert.cnf | 37 ++++++
21 sys-block/partimage/metadata.xml | 14 +++
22 sys-block/partimage/partimage-0.6.9.ebuild | 140 +++++++++++++++++++++
23 13 files changed, 365 insertions(+)
24
25 diff --git a/sys-block/partimage/Manifest b/sys-block/partimage/Manifest
26 new file mode 100644
27 index 0000000..4d387ce
28 --- /dev/null
29 +++ b/sys-block/partimage/Manifest
30 @@ -0,0 +1 @@
31 +DIST partimage-0.6.9.tar.bz2 666522 SHA256 753a6c81f4be18033faed365320dc540fe5e58183eaadcd7a5b69b096fec6635 SHA512 252885921b23933fdcdf0bb6efa4b82066b08ca95cc653296912d384ae875b421c1d39f347a90115315139176d4eab4a930c24919c2d38cf00ed29c764cd14d9 WHIRLPOOL a4e30ea6240c89b568fd5959f4d72130e3737a409270d9336e45f2c4f85c2e6c1c66b5b60abdf47aa238ec4159010cbbcc75c02c6e5a1cb309e2fceee1df7750
32
33 diff --git a/sys-block/partimage/files/partimage-0.6.8-destdir.patch b/sys-block/partimage/files/partimage-0.6.8-destdir.patch
34 new file mode 100644
35 index 0000000..12eb8c4
36 --- /dev/null
37 +++ b/sys-block/partimage/files/partimage-0.6.8-destdir.patch
38 @@ -0,0 +1,11 @@
39 +--- Makefile.am
40 ++++ Makefile.am
41 +@@ -48,7 +48,7 @@
42 + $(DESTDIR)${sysconfdir}/partimaged/partimagedusers ;\
43 + echo -n "#add only users allowed to " >> \
44 + $(DESTDIR)${sysconfdir}/partimaged/partimagedusers ;\
45 +- echo "connect partimaged" >> ${sysconfdir}/partimaged/partimagedusers ;\
46 ++ echo "connect partimaged" >> $(DESTDIR)${sysconfdir}/partimaged/partimagedusers ;\
47 + echo "# (only one login per line)" >> \
48 + $(DESTDIR)${sysconfdir}/partimaged/partimagedusers ;\
49 + echo "" >> $(DESTDIR)${sysconfdir}/partimaged/partimagedusers ;\
50
51 diff --git a/sys-block/partimage/files/partimage-0.6.8-openssl-1.patch b/sys-block/partimage/files/partimage-0.6.8-openssl-1.patch
52 new file mode 100644
53 index 0000000..69268a9
54 --- /dev/null
55 +++ b/sys-block/partimage/files/partimage-0.6.8-openssl-1.patch
56 @@ -0,0 +1,30 @@
57 +http://bugs.gentoo.org/326879
58 +
59 +--- src/client/netclient.h
60 ++++ src/client/netclient.h
61 +@@ -35,7 +35,11 @@
62 + #ifdef HAVE_SSL
63 + SSL_CTX * ctx;
64 + X509 * server_cert;
65 ++ #if OPENSSL_VERSION_NUMBER >= 0x10000000L
66 ++ const SSL_METHOD * meth;
67 ++ #else
68 + SSL_METHOD * meth;
69 ++ #endif
70 + #endif
71 + bool m_bUseSSL;
72 + bool m_bMustLogin;
73 +--- src/server/netserver.h
74 ++++ src/server/netserver.h
75 +@@ -41,7 +41,11 @@
76 + #ifdef HAVE_SSL
77 + SSL_CTX * ctx;
78 + X509 * client_cert;
79 ++ #if OPENSSL_VERSION_NUMBER >= 0x10000000L
80 ++ const SSL_METHOD * meth;
81 ++ #else
82 + SSL_METHOD * meth;
83 ++ #endif
84 + int err;
85 + #endif
86 +
87
88 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
89 new file mode 100644
90 index 0000000..8e0e00e
91 --- /dev/null
92 +++ b/sys-block/partimage/files/partimage-0.6.9-minor-typo.patch
93 @@ -0,0 +1,13 @@
94 +https://bugs.gentoo.org/580290
95 +
96 +--- a/src/client/misc.h
97 ++++ b/src/client/misc.h
98 +@@ -36,7 +36,7 @@ struct COptions;
99 + #endif
100 +
101 + #ifndef makedev
102 +- #define makedev(maj,min) (((maj) << 8) | min))
103 ++ #define makedev(maj,min) (((maj) << 8) | (min))
104 + #endif
105 +
106 + // =======================================================
107
108 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
109 new file mode 100644
110 index 0000000..57f87a5
111 --- /dev/null
112 +++ b/sys-block/partimage/files/partimage-0.6.9-zlib-1.2.5.2.patch
113 @@ -0,0 +1,33 @@
114 +http://bugs.gentoo.org/405323
115 +
116 +--- src/client/imagefile.cpp
117 ++++ src/client/imagefile.cpp
118 +@@ -783,7 +783,7 @@
119 + else if (m_options.dwCompression == COMPRESS_GZIP) // Gzip compression
120 + {
121 + showDebug(1, "open gzip\n");
122 +- m_gzImageFile = (gzFile *) gzdopen(m_nFdImage, "wb"); //"wb1h");
123 ++ m_gzImageFile = gzdopen(m_nFdImage, "wb"); //"wb1h");
124 + if (m_gzImageFile == NULL)
125 + {
126 + showDebug(1, "error:%d %s\n", errno, strerror(errno));
127 +@@ -1098,7 +1098,7 @@
128 + }
129 + else if (m_options.dwCompression == COMPRESS_GZIP) // Gzip compression
130 + {
131 +- m_gzImageFile = (gzFile *) gzdopen(m_nFdImage, "rb");
132 ++ m_gzImageFile = gzdopen(m_nFdImage, "rb");
133 + if (m_gzImageFile == NULL)
134 + THROW(ERR_ERRNO, errno);
135 + else
136 +--- src/client/imagefile.h
137 ++++ src/client/imagefile.h
138 +@@ -41,7 +41,7 @@
139 + COptions m_options;
140 +
141 + FILE *m_fImageFile;
142 +- gzFile *m_gzImageFile;
143 ++ gzFile m_gzImageFile;
144 + BZFILE *m_bzImageFile;
145 +
146 + int m_nFdImage;
147
148 diff --git a/sys-block/partimage/files/partimaged.conf b/sys-block/partimage/files/partimaged.conf
149 new file mode 100644
150 index 0000000..032b1cb
151 --- /dev/null
152 +++ b/sys-block/partimage/files/partimaged.conf
153 @@ -0,0 +1,10 @@
154 +# Copyright 2005 Gentoo Foundation
155 +# Distributed under the terms of the GNU General Public License v2
156 +# $Id$
157 +
158 +# You can define the following optional arguments:
159 +# -d <dest> Destination directory for the backup images
160 +# -pX Server port
161 +# -r <dest> Chroot directory for improved security
162 +
163 +#PARTIMAGED_OPTS=""
164
165 diff --git a/sys-block/partimage/files/partimaged.init b/sys-block/partimage/files/partimaged.init
166 new file mode 100644
167 index 0000000..b3b1499
168 --- /dev/null
169 +++ b/sys-block/partimage/files/partimaged.init
170 @@ -0,0 +1,29 @@
171 +#!/sbin/openrc-run
172 +# Copyright 2005 Gentoo Foundation
173 +# Distributed under the terms of the GNU General Public License, v2 or later
174 +# $Id$
175 +
176 +PARTIMAGED="/usr/sbin/partimaged"
177 +
178 +failed_startup() {
179 + eerror "The PartImage daemon did not start up correctly."
180 + eerror "Perhaps you compiled it with SSL support but forgot to run the ebuild config?"
181 + return 1
182 +}
183 +
184 +depend() {
185 + need net
186 +}
187 +
188 +start() {
189 + ebegin "Starting partimaged"
190 + start-stop-daemon --start --quiet --exec ${PARTIMAGED} \
191 + -- ${PARTIMAGED_OPTS} --daemon > /dev/null 2>&1
192 + eend $? || failed_startup
193 +}
194 +
195 +stop() {
196 + ebegin "Stopping partimaged"
197 + start-stop-daemon --stop --exec ${PARTIMAGED}
198 + eend $?
199 +}
200
201 diff --git a/sys-block/partimage/files/partimaged.init.2 b/sys-block/partimage/files/partimaged.init.2
202 new file mode 100644
203 index 0000000..61e6e64
204 --- /dev/null
205 +++ b/sys-block/partimage/files/partimaged.init.2
206 @@ -0,0 +1,29 @@
207 +#!/sbin/openrc-run
208 +# Copyright 2005-2010 Gentoo Foundation
209 +# Distributed under the terms of the GNU General Public License, v2 or later
210 +# $Id$
211 +
212 +PARTIMAGED="/usr/sbin/partimaged"
213 +
214 +failed_startup() {
215 + eerror "The PartImage daemon did not start up correctly."
216 + eerror "Perhaps you compiled it with SSL support but forgot to run the ebuild config?"
217 + return 1
218 +}
219 +
220 +depend() {
221 + need net
222 +}
223 +
224 +start() {
225 + ebegin "Starting partimaged"
226 + start-stop-daemon --start --exec ${PARTIMAGED} \
227 + -- ${PARTIMAGED_OPTS} --daemon
228 + eend $? || failed_startup
229 +}
230 +
231 +stop() {
232 + ebegin "Stopping partimaged"
233 + start-stop-daemon --stop --exec ${PARTIMAGED}
234 + eend $?
235 +}
236
237 diff --git a/sys-block/partimage/files/partimaged.pam b/sys-block/partimage/files/partimaged.pam
238 new file mode 100644
239 index 0000000..6ffb16f
240 --- /dev/null
241 +++ b/sys-block/partimage/files/partimaged.pam
242 @@ -0,0 +1,11 @@
243 +# PAM config file for Partimaged
244 +
245 +auth required pam_unix.so
246 +auth required pam_warn.so
247 +auth required pam_listfile.so \
248 + onerr=fail item=user sense=allow \
249 + file=/etc/partimaged/partimagedusers
250 +
251 +account include system-auth
252 +session include system-auth
253 +
254
255 diff --git a/sys-block/partimage/files/partimaged.pam.2 b/sys-block/partimage/files/partimaged.pam.2
256 new file mode 100644
257 index 0000000..9ed5507
258 --- /dev/null
259 +++ b/sys-block/partimage/files/partimaged.pam.2
260 @@ -0,0 +1,7 @@
261 +# PAM config file for Partimaged
262 +
263 +auth required pam_listfile.so onerr=fail item=user sense=allow file=/etc/partimaged/partimagedusers
264 +auth optional pam_warn.so
265 +auth include system-auth
266 +account include system-auth
267 +session include system-auth
268
269 diff --git a/sys-block/partimage/files/servercert.cnf b/sys-block/partimage/files/servercert.cnf
270 new file mode 100644
271 index 0000000..cf6af7e
272 --- /dev/null
273 +++ b/sys-block/partimage/files/servercert.cnf
274 @@ -0,0 +1,37 @@
275 +# $Id$
276 +# Robin H. Johnson <robbat2@g.o> - October 17, 2003
277 +# This is the openssl config file to generate keys for partimage
278 +# It is read by mkservercert
279 +
280 +[ req ]
281 +# you can increase this value, but be aware that it will make things much slower
282 +# this should be a power of 2!
283 +default_bits = 1024
284 +# leave the rest of these alone!
285 +encrypt_key = yes
286 +distinguished_name = req_dn
287 +x509_extensions = cert_type
288 +prompt = no
289 +
290 +[ req_dn ]
291 +# 2-Letter ISO country code
292 +C=US
293 +# FULL name of state/province/district
294 +# NO abbreviations!
295 +ST=Alabama
296 +# FULL name of city
297 +# NO abbreviations!
298 +L=Mobile
299 +# Full Name of your organization
300 +# NO abbreviations!
301 +O=Foobar Systems
302 +# Leave this alone unless specifically need to change it!
303 +OU=Automatically-generated PartImage SSL key
304 +# This should be a FQDN that resolves to the IP of your server
305 +CN=localhost
306 +# This should be the email address for the administrator of the server
307 +emailAddress=root@localhost
308 +
309 +# Leave this alone!
310 +[ cert_type ]
311 +nsCertType = server
312
313 diff --git a/sys-block/partimage/metadata.xml b/sys-block/partimage/metadata.xml
314 new file mode 100644
315 index 0000000..0862b06
316 --- /dev/null
317 +++ b/sys-block/partimage/metadata.xml
318 @@ -0,0 +1,14 @@
319 +<?xml version="1.0" encoding="UTF-8"?>
320 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
321 +<pkgmetadata>
322 +<maintainer type="project">
323 + <email>base-system@g.o</email>
324 + <name>Gentoo Base System</name>
325 +</maintainer>
326 +<use>
327 + <flag name="nologin">Do not include login support when connecting partimaged</flag>
328 +</use>
329 +<upstream>
330 + <remote-id type="sourceforge">partimage</remote-id>
331 +</upstream>
332 +</pkgmetadata>
333
334 diff --git a/sys-block/partimage/partimage-0.6.9.ebuild b/sys-block/partimage/partimage-0.6.9.ebuild
335 new file mode 100644
336 index 0000000..10f9545
337 --- /dev/null
338 +++ b/sys-block/partimage/partimage-0.6.9.ebuild
339 @@ -0,0 +1,140 @@
340 +# Copyright 1999-2012 Gentoo Foundation
341 +# Distributed under the terms of the GNU General Public License v2
342 +# $Id$
343 +
344 +EAPI=4
345 +inherit eutils flag-o-matic pam user
346 +
347 +DESCRIPTION="Console-based application to efficiently save raw partition data to an image file"
348 +HOMEPAGE="http://www.partimage.org/"
349 +SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2"
350 +
351 +LICENSE="GPL-2"
352 +SLOT="0"
353 +KEYWORDS="amd64 ppc ~sparc x86"
354 +IUSE="nls nologin pam ssl static"
355 +
356 +LIBS_DEPEND="app-arch/bzip2
357 + >=dev-libs/newt-0.52
358 + >=sys-libs/slang-2
359 + sys-libs/zlib
360 + ssl? ( dev-libs/openssl )"
361 +PAM_DEPEND="!static? ( pam? ( virtual/pam ) )"
362 +RDEPEND="${PAM_DEPEND}
363 + !static? ( ${LIBS_DEPEND} )"
364 +DEPEND="${PAM_DEPEND}
365 + ${LIBS_DEPEND}
366 + nls? ( sys-devel/gettext )"
367 +
368 +pkg_setup() {
369 + enewgroup partimag 91
370 + enewuser partimag 91 -1 /var/lib/partimage partimag
371 +}
372 +
373 +src_prepare() {
374 + epatch "${FILESDIR}"/${P}-zlib-1.2.5.2.patch #405323
375 + epatch "${FILESDIR}"/${P}-minor-typo.patch #580290
376 +}
377 +
378 +src_configure() {
379 + # XXX: Do we still need these?
380 + filter-flags -fno-exceptions
381 + use ppc && append-flags -fsigned-char
382 +
383 + local myconf
384 +
385 + use nologin && myconf="${myconf} --disable-login"
386 +
387 + if use pam && ! use static; then
388 + myconf="${myconf} --enable-pam"
389 + fi
390 +
391 + econf \
392 + --docdir="${EPREFIX}"/usr/share/doc/${PF} \
393 + --sysconfdir="${EPREFIX}"/etc \
394 + $(use_enable nls) \
395 + $(use_enable ssl) \
396 + --disable-pam \
397 + $(use_enable static all-static) \
398 + --with-log-dir="${EPREFIX}"/var/log/partimage \
399 + ${myconf}
400 +}
401 +
402 +src_install() {
403 + default
404 +
405 + keepdir /var/lib/partimage
406 + keepdir /var/log/partimage
407 +
408 + newinitd "${FILESDIR}"/partimaged.init.2 partimaged
409 + newconfd "${FILESDIR}"/partimaged.conf partimaged
410 +
411 + if use ssl; then
412 + insinto /etc/partimaged
413 + doins "${FILESDIR}"/servercert.cnf
414 + fi
415 +
416 + if use pam; then
417 + newpamd "${FILESDIR}"/partimaged.pam.2 partimaged
418 + fi
419 +}
420 +
421 +confdir=${EROOT}/etc/partimaged
422 +privkey=${confdir}/partimaged.key
423 +cnf=${confdir}/servercert.cnf
424 +csr=${confdir}/partimaged.csr
425 +cert=${confdir}/partimaged.cert
426 +
427 +pkg_config() {
428 + if use ssl; then
429 + ewarn "Please customize /etc/partimaged/servercert.cnf before you continue!"
430 + ewarn "Press Ctrl-C to break now for it, or press enter to continue."
431 + read
432 + if [ ! -f ${privkey} ]; then
433 + einfo "Generating unencrypted private key: ${privkey}"
434 + openssl genrsa -out ${privkey} 1024 || die
435 + else
436 + einfo "Private key already exists: ${privkey}"
437 + fi
438 + if [ ! -f ${csr} ]; then
439 + einfo "Generating certificate request: ${csr}"
440 + openssl req -new -x509 -outform PEM -out ${csr} -key ${privkey} -config ${cnf} || die
441 + else
442 + einfo "Certificate request already exists: ${csr}"
443 + fi
444 + if [ ! -f ${cert} ]; then
445 + einfo "Generating self-signed certificate: ${cert}"
446 + openssl x509 -in ${csr} -out ${cert} -signkey ${privkey} || die
447 + else
448 + einfo "Self-signed certifcate already exists: ${cert}"
449 + fi
450 + einfo "Setting permissions"
451 + partimagesslperms || die
452 + einfo "Done"
453 + else
454 + einfo "SSL is disabled, not building certificates"
455 + fi
456 +}
457 +
458 +partimagesslperms() {
459 + local ret=0
460 + chmod 600 ${privkey} 2>/dev/null
461 + ret=$((${ret}+$?))
462 + chown partimag:0 ${privkey} 2>/dev/null
463 + ret=$((${ret}+$?))
464 + chmod 644 ${cert} ${csr} 2>/dev/null
465 + ret=$((${ret}+$?))
466 + chown root:0 ${cert} ${csr} 2>/dev/null
467 + ret=$((${ret}+$?))
468 + return $ret
469 +}
470 +
471 +pkg_postinst() {
472 + if use ssl; then
473 + einfo "To create the required SSL certificates, please do:"
474 + einfo "emerge --config =${PF}"
475 + partimagesslperms
476 + return 0
477 + fi
478 + chown partimag:0 "${EROOT}"/etc/partimaged/partimagedusers || die
479 +}