/[gentoo-x86]/sys-apps/partimage/partimage-0.6.4-r2.ebuild
Gentoo

Contents of /sys-apps/partimage/partimage-0.6.4-r2.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Sun Mar 6 18:05:51 2005 UTC (14 years, 10 months ago) by ciaranm
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +1 -1 lines
FILE REMOVED
Moved to sys-block/partimage.

1 # Copyright 1999-2005 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/sys-apps/partimage/partimage-0.6.4-r2.ebuild,v 1.1 2005/01/16 15:30:56 xmerlin Exp $
4
5 inherit gnuconfig eutils
6
7 DESCRIPTION="Console-based application to efficiently save raw partition data to an image file. Optional encryption/compression support."
8 HOMEPAGE="http://www.partimage.org/"
9 SRC_URI="mirror://sourceforge/partimage/${P}.tar.bz2"
10 LICENSE="GPL-2"
11 SLOT="0"
12 KEYWORDS="~x86"
13 IUSE="ssl nologin nls"
14
15 DEPEND="${RDEPEND} sys-devel/autoconf"
16
17 RDEPEND="virtual/libc
18 >=sys-libs/zlib-1.1.4
19 >=dev-libs/lzo-1.08
20 >=dev-libs/newt-0.50.35-r1
21 app-arch/bzip2
22 >=sys-libs/slang-1.4.5-r2
23 nls? ( sys-devel/gettext )
24 ssl? ( >=dev-libs/openssl-0.9.6g )"
25
26 PARTIMAG_GROUP_GID=91
27 PARTIMAG_USER_UID=91
28 PARTIMAG_GROUP_NAME=partimag
29 PARTIMAG_USER_NAME=partimag
30 PARTIMAG_USER_SH=/bin/false
31 PARTIMAG_USER_HOMEDIR=/var/log/partimage
32 PARTIMAG_USER_GROUPS=partimag
33
34 pkg_setup() {
35 # Now add users if needed
36 enewgroup ${PARTIMAG_GROUP_NAME} ${PARTIMAG_GROUP_GID}
37 enewuser ${PARTIMAG_USER_NAME} ${PARTIMAG_USER_UID} ${PARTIMAG_USER_SH} ${PARTIMAG_USER_HOMEDIR} ${PARTIMAG_USER_GROUPS}
38 }
39
40 src_unpack() {
41 unpack ${A}
42 cd ${S}
43
44 # we can do better security ourselves
45 epatch ${FILESDIR}/${P}-nodumbpermchecks.diff || die
46 epatch ${FILESDIR}/${P}-chown.patch || die
47 epatch ${FILESDIR}/${P}-not_install_info.patch || die
48 epatch ${FILESDIR}/${P}-fixserverargs.diff || die
49 }
50
51 src_compile() {
52 local myconf
53 use nologin && myconf="${myconf} --disable-login"
54
55 econf \
56 ${myconf} \
57 `use_enable ssl` \
58 `use_enable nls`|| die "econf failed"
59
60 emake || die
61 }
62
63 src_install() {
64 einstall \
65 MKINSTALLDIRS=/usr/share/automake-1.8/mkinstalldirs || die
66
67 keepdir /var/log/partimage
68
69 insinto /etc/partimaged; doins ${FILESDIR}/servercert.cnf || die
70
71 # init.d / conf.d
72 exeinto /etc/init.d ; newexe ${FILESDIR}/${PN}d.init ${PN}d || die
73 insinto /etc/conf.d ; newins ${FILESDIR}/${PN}d.conf ${PN}d || die
74
75 doman debian/partimage.1 debian/partimaged.8 ${FILESDIR}/partimagedusers.5 || die
76 dodoc AUTHORS BUGS COPYING ChangeLog INSTALL README* TODO partimage.lsm
77 }
78
79 # vars for SSL stuff
80 confdir="${ROOT}etc/partimaged"
81 privkey="${confdir}/partimaged.key"
82 cnf="${confdir}/servercert.cnf"
83 csr="${confdir}/partimaged.csr"
84 cert="${confdir}/partimaged.cert"
85
86 pkg_config() {
87 if use ssl; then
88 ewarn "Please customize /etc/partimaged/servercert.cnf before you continue!"
89 ewarn "Press Ctrl-C to break now for it, or press enter to continue."
90 read
91 if [ ! -f ${privkey} ]; then
92 einfo "Generating unencrypted private key: ${privkey}"
93 openssl genrsa -out ${privkey} 1024 || die "Failed!"
94 else
95 einfo "Private key already exists: ${privkey}"
96 fi
97 if [ ! -f ${csr} ]; then
98 einfo "Generating certificate request: ${csr}"
99 openssl req -new -x509 -outform PEM -out ${csr} -key ${privkey} -config ${cnf} || die "Failed!"
100 else
101 einfo "Certificate request already exists: ${csr}"
102 fi
103 if [ ! -f ${cert} ]; then
104 einfo "Generating self-signed certificate: ${cert}"
105 openssl x509 -in ${csr} -out ${cert} -signkey ${privkey} || die "Failed!"
106 else
107 einfo "Self-signed certifcate already exists: ${cert}"
108 fi
109 einfo "Setting permissions"
110 partimagesslperms || die "Failed!"
111 einfo "Done"
112 else
113 einfo "SSL is disabled, not building certificates"
114 fi
115 }
116
117 partimagesslperms() {
118 local ret=0
119 chmod 600 ${privkey} 2>/dev/null
120 ret=$((${ret}+$?))
121 chown partimag:root ${privkey} 2>/dev/null
122 ret=$((${ret}+$?))
123 chmod 644 ${cert} ${csr} 2>/dev/null
124 ret=$((${ret}+$?))
125 chown root:root ${cert} ${csr} 2>/dev/null
126 ret=$((${ret}+$?))
127 return $ret
128 }
129
130 pkg_postinst() {
131 if use ssl; then
132 einfo "To create the required SSL certificates, please do:"
133 einfo "ebuild /var/db/pkg/${CATEGORY}/${PF}/${PF}.ebuild config"
134 # force a permmissions fixup
135 partimagesslperms
136 return 0
137 fi
138 }

  ViewVC Help
Powered by ViewVC 1.1.20