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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.10 - (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.9: +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.ebuild,v 1.9 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 epatch ${FILESDIR}/${P}-fixserverargs.diff || die
43 # Patch Makefile.am so we can take over some of is install work
44 #patch -p1 < ${FILESDIR}/${PF}-gentoo.patch || die "patch failed"
45 sed '18d' -i configure.ac
46 sed '1iACLOCAL_AMFLAGS = -I macros' -i Makefile.am
47 for i in intl/Makefile.in po/Makefile.in.in; do
48 sed 's/^mkinstalldirs =.*/mkinstalldirs = mkdir -p /g' -i ${i}
49 done
50 sed 's/chown partimag.root/chown partimag:root/g' -i Makefile.am
51 gnuconfig_update
52 automake
53 aclocal
54 autoconf
55 }
56
57 src_compile() {
58 # SSL is optional
59 local myconf
60 myconf="--cache-file=${S}/config.cache"
61 use ssl || myconf="${myconf} --disable-ssl"
62 use nologin && myconf="${myconf} --disable-login"
63 econf \
64 ${myconf} \
65 --infodir=/usr/share/doc/${PF} || die "econf failed"
66 cp Makefile Makefile.orig
67 sed -e "s/partimag\.root/root:root/g" Makefile.orig > Makefile
68 emake || die
69 }
70
71 src_install() {
72 make \
73 prefix=${D}/usr \
74 sysconfdir=${D}/etc \
75 mandir=${D}/usr/share/man \
76 datadir=${D}/usr/share \
77 infodir=${D}/usr/share/doc/${PF} \
78 localedir=${D}/usr/share/locale \
79 gettextsrcdir=${D}/usr/share/gettext/po \
80 install || die
81 keepdir /var/log/partimage
82 insinto /etc/partimaged
83 doins ${FILESDIR}/servercert.cnf
84
85 # init.d / conf.d
86 exeinto /etc/init.d ; newexe ${FILESDIR}/${PN}d.init ${PN}d || die
87 insinto /etc/conf.d ; newins ${FILESDIR}/${PN}d.conf ${PN}d || die
88
89 doman debian/partimage.1 debian/partimaged.8 ${FILESDIR}/partimagedusers.5 || die
90 }
91
92 pkg_config() {
93 local dir=${ROOT}etc/partimaged
94 privkey="${dir}/partimaged.key"
95 cnf="${dir}/servercert.cnf"
96 csr="${dir}/partimaged.csr"
97 cert="${dir}/partimaged.cert"
98 if use ssl; then
99 ewarn "Please customize /etc/partimaged/servercert.cnf before you continue!"
100 ewarn "Press Ctrl-C to break now for it, or press enter to continue."
101 read
102 if [ ! -f ${privkey} ]; then
103 einfo "Generating unencrypted private key: ${privkey}"
104 openssl genrsa -out ${privkey} 1024 || die "Failed!"
105 else
106 einfo "Private key already exists: ${privkey}"
107 fi
108 if [ ! -f ${csr} ]; then
109 einfo "Generating certificate request: ${csr}"
110 openssl req -new -x509 -outform PEM -out ${csr} -key ${privkey} -config ${cnf} || die "Failed!"
111 else
112 einfo "Certificate request already exists: ${csr}"
113 fi
114 if [ ! -f ${cert} ]; then
115 einfo "Generating self-signed certificate: ${cert}"
116 openssl x509 -in ${csr} -out ${cert} -signkey ${privkey} || die "Failed!"
117 else
118 einfo "Self-signed certifcate already exists: ${cert}"
119 fi
120 einfo "Setting permissions"
121 chmod 600 ${privkey} || die "Failed!"
122 chown partimag:root ${privkey} || die "Failed!"
123 chmod 644 ${cert} ${csr} || die "Failed!"
124 chown root:root ${cert} ${csr} || die "Failed!"
125 einfo "Done"
126 else
127 einfo "SSL is disabled, not building certificates"
128 fi
129 }
130
131 pkg_postinst() {
132 if use ssl; then
133 einfo "To create the required SSL certificates, please do:"
134 einfo "ebuild /var/db/pkg/${CATEGORY}/${PF}/${PF}.ebuild config"
135 fi
136 }

  ViewVC Help
Powered by ViewVC 1.1.20