summaryrefslogtreecommitdiff
blob: 802825d5244ee8aeed0e959bb99c105c810db503 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# Copyright 1999-2002 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-db/mysqltool/mysqltool-0.95-r1.ebuild,v 1.9 2002/11/26 23:54:06 rphillips Exp $

inherit perl-module

S=${WORKDIR}/MysqlTool-${PV}
DESCRIPTION="Web interface for managing one or more mysql server installations"
SRC_URI="http://www.dajoba.com/projects/mysqltool/MysqlTool-${PV}.tar.gz"
HOMEPAGE="http://www.dajoba.com/projects/mysqltool/"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="x86 sparc64"

DEPEND="virtual/glibc
	sys-devel/perl"
RDEPEND="${DEPEND}
	>=net-www/apache-1.3.24-r1
	>=dev-db/mysql-3.23.38
	dev-perl/CGI
	dev-perl/Apache-DBI
	dev-perl/DBI
	dev-perl/DBD-mysql
	dev-perl/Crypt-Blowfish"

APACHE_ROOT="`grep '^DocumentRoot' /etc/apache/conf/apache.conf | cut -d\  -f2`"
[ -z "${APACHE_ROOT}" ] && APACHE_ROOT="/home/httpd/htdocs"

src_install() {
	eval `perl '-V:installarchlib'`
	dodir /$installarchlib

	cp ${S}/Makefile ${S}/Makefile.orig
	cat ${S}/Makefile | sed -e "s!INSTALLMAN1DIR = /usr/share/man/man1!INSTALLMAN1DIR = ${D}/usr/share/man/man1!" -e "s!INSTALLMAN3DIR = /usr/share/man/man3!INSTALLMAN3DIR = ${D}/usr/share/man/man3!" > ${S}/Makefile.gentoo
	mv ${S}/Makefile.gentoo ${S}/Makefile

	make install || die

	dodoc COPYING Changes MANIFEST README Upgrade

	# the cgi and images..
	dodir ${APACHE_ROOT}/mysqltool
	cp -a htdocs/* ${D}${APACHE_ROOT}/mysqltool
	rm ${D}${APACHE_ROOT}/mysqltool/mysqltool.conf

	# the config file..
	insinto /etc/apache/conf/addon-modules
	doins htdocs/mysqltool.conf
	fowners apache.apache /etc/apache/conf/addon-modules/mysqltool.conf
	fperms 0600 /etc/apache/conf/addon-modules/mysqltool.conf

	# now fix its location in the main cgi..
	cp ${D}${APACHE_ROOT}/mysqltool/index.cgi \
		${D}${APACHE_ROOT}/mysqltool/index.cgi.orig
	sed -e "s:^\(require\).*:\1 '/etc/apache/conf/addon-modules/mysqltool.conf';:" \
		${D}${APACHE_ROOT}/mysqltool/index.cgi.orig > \
		${D}${APACHE_ROOT}/mysqltool/index.cgi
	rm ${D}${APACHE_ROOT}/mysqltool/index.cgi.orig
}

pkg_postinst() {
	einfo "Please add the following to commonapache.conf:"
	einfo "PerlRequire {apache_root}/conf/mysqltool.conf"
	einfo "<Directory {apache_document_root}/htdocs/mysqltool>"
    einfo "Options ExecCGI"
    einfo "<Files *.cgi>"
    einfo "SetHandler perl-script"
	einfo "PerlHandler MysqlTool"
	einfo "</Files>"
	einfo "</Directory>"
}