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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.8 - (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.7: +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-r1.ebuild,v 1.7 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 ~ppc"
13 IUSE="ssl nologin"
14
15 RDEPEND="virtual/libc
16 >=sys-libs/zlib-1.1.4
17 >=dev-libs/lzo-1.08
18 >=dev-libs/newt-0.50.35-r1
19 >=sys-libs/slang-1.4.5-r2
20 app-arch/bzip2
21 ssl? ( >=dev-libs/openssl-0.9.6g )"
22
23 DEPEND="${RDEPEND} sys-devel/autoconf"
24
25 PARTIMAG_GROUP_GID=91
26 PARTIMAG_USER_UID=91
27 PARTIMAG_GROUP_NAME=partimag
28 PARTIMAG_USER_NAME=partimag
29 PARTIMAG_USER_SH=/bin/false
30 PARTIMAG_USER_HOMEDIR=/var/log/partimage
31 PARTIMAG_USER_GROUPS=partimag
32
33 pkg_setup() {
34 # Now add users if needed
35 enewgroup ${PARTIMAG_GROUP_NAME} ${PARTIMAG_GROUP_GID}
36 enewuser ${PARTIMAG_USER_NAME} ${PARTIMAG_USER_UID} ${PARTIMAG_USER_SH} ${PARTIMAG_USER_HOMEDIR} ${PARTIMAG_USER_GROUPS}
37 }
38
39 src_unpack() {
40 unpack ${A}
41 cd ${S}
42 # we can do better security ourselves
43 epatch ${FILESDIR}/${P}-nodumbpermchecks.diff || die
44 epatch ${FILESDIR}/${P}-fixserverargs.diff || die
45 # Patch Makefile.am so we can take over some of is install work
46 #patch -p1 < ${FILESDIR}/${PF}-gentoo.patch || die "patch failed"
47 sed '18d' -i configure.ac
48 sed '1iACLOCAL_AMFLAGS = -I macros' -i Makefile.am
49 for i in intl/Makefile.in po/Makefile.in.in; do
50 sed 's/^mkinstalldirs =.*/mkinstalldirs = mkdir -p /g' -i ${i}
51 done
52 sed 's/chown partimag.root/chown partimag:root/g' -i Makefile.am
53 gnuconfig_update
54 automake
55 aclocal
56 autoconf
57 }
58
59 src_compile() {
60 # SSL is optional
61 local myconf
62 myconf="--cache-file=${S}/config.cache"
63 use ssl || myconf="${myconf} --disable-ssl"
64 use nologin && myconf="${myconf} --disable-login"
65 econf \
66 ${myconf} \
67 --infodir=/usr/share/doc/${PF} || die "econf failed"
68 cp Makefile Makefile.orig
69 sed -e "s/partimag\.root/root:root/g" Makefile.orig > Makefile
70 emake || die
71 }
72
73 src_install() {
74 make \
75 prefix=${D}/usr \
76 sysconfdir=${D}/etc \
77 mandir=${D}/usr/share/man \
78 datadir=${D}/usr/share \
79 infodir=${D}/usr/share/doc/${PF} \
80 localedir=${D}/usr/share/locale \
81 gettextsrcdir=${D}/usr/share/gettext/po \
82 install || die
83 keepdir /var/log/partimage
84 insinto /etc/partimaged
85 doins ${FILESDIR}/servercert.cnf
86
87 # init.d / conf.d
88 exeinto /etc/init.d ; newexe ${FILESDIR}/${PN}d.init ${PN}d || die
89 insinto /etc/conf.d ; newins ${FILESDIR}/${PN}d.conf ${PN}d || die
90
91 doman debian/partimage.1 debian/partimaged.8 ${FILESDIR}/partimagedusers.5 || die
92 }
93
94 # vars for SSL stuff
95 confdir="${ROOT}etc/partimaged"
96 privkey="${confdir}/partimaged.key"
97 cnf="${confdir}/servercert.cnf"
98 csr="${confdir}/partimaged.csr"
99 cert="${confdir}/partimaged.cert"
100
101 pkg_config() {
102 if use ssl; then
103 ewarn "Please customize /etc/partimaged/servercert.cnf before you continue!"
104 ewarn "Press Ctrl-C to break now for it, or press enter to continue."
105 read
106 if [ ! -f ${privkey} ]; then
107 einfo "Generating unencrypted private key: ${privkey}"
108 openssl genrsa -out ${privkey} 1024 || die "Failed!"
109 else
110 einfo "Private key already exists: ${privkey}"
111 fi
112 if [ ! -f ${csr} ]; then
113 einfo "Generating certificate request: ${csr}"
114 openssl req -new -x509 -outform PEM -out ${csr} -key ${privkey} -config ${cnf} || die "Failed!"
115 else
116 einfo "Certificate request already exists: ${csr}"
117 fi
118 if [ ! -f ${cert} ]; then
119 einfo "Generating self-signed certificate: ${cert}"
120 openssl x509 -in ${csr} -out ${cert} -signkey ${privkey} || die "Failed!"
121 else
122 einfo "Self-signed certifcate already exists: ${cert}"
123 fi
124 einfo "Setting permissions"
125 partimagesslperms || die "Failed!"
126 einfo "Done"
127 else
128 einfo "SSL is disabled, not building certificates"
129 fi
130 }
131
132 partimagesslperms() {
133 local ret=0
134 chmod 600 ${privkey} 2>/dev/null
135 ret=$((${ret}+$?))
136 chown partimag:root ${privkey} 2>/dev/null
137 ret=$((${ret}+$?))
138 chmod 644 ${cert} ${csr} 2>/dev/null
139 ret=$((${ret}+$?))
140 chown root:root ${cert} ${csr} 2>/dev/null
141 ret=$((${ret}+$?))
142 return $ret
143 }
144
145 pkg_postinst() {
146 if use ssl; then
147 einfo "To create the required SSL certificates, please do:"
148 einfo "ebuild /var/db/pkg/${CATEGORY}/${PF}/${PF}.ebuild config"
149 # force a permmissions fixup
150 partimagesslperms
151 return 0
152 fi
153 }

  ViewVC Help
Powered by ViewVC 1.1.20