summaryrefslogtreecommitdiff
blob: 6e7f10da264079f3f37fe647e69a1de32fe4e7b6 (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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/www-apps/issue-tracker/issue-tracker-4.0.3.ebuild,v 1.2 2004/09/03 17:17:20 pvdabeel Exp $

inherit webapp-apache

DESCRIPTION="Issue tracking system"
HOMEPAGE="http://www.issue-tracker.com/"
SRC_URI="mirror://sourceforge/issue-tracker/issue-tracker-4.0.3.tar.bz2"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~x86 ppc"
IUSE=""
DEPEND=""
RDEPEND="virtual/php
	|| ( dev-db/mysql dev-db/postgresql )"

S=${WORKDIR}/${P}

src_unpack() {
	unpack ${A}
	file ${S}/conf/const.php
	cp ${S}/conf/const.php ${S}/conf/const.php.b0rken || die
	sed -r 's/(Could not.*_URL_.*manually.*)\"\);/\1\";/' \
		< ${S}/conf/const.php.b0rken \
		> ${S}/conf/const.php || die
}

pkg_setup() {
	webapp-detect || export NO_WEBSERVER=1
	webapp-pkg_setup "${NO_WEBSERVER}"
	einfo "Installing for ${WEBAPP_SERVER}"
}

src_install() {
	webapp-detect
	webapp-mkdirs

	dodir "${HTTPD_ROOT}/issue-tracker"
	cp -a * "${D}/${HTTPD_ROOT}/issue-tracker/"
	rm -rf "${D}/${HTTPD_ROOT}/issue-tracker/docs"

	dodoc docs/*

	chown -R "${HTTPD_USER}:${HTTPD_GROUP}" "${D}/${HTTPD_ROOT}/issue-tracker/"
	chmod 0755 "${D}/${HTTPD_ROOT}/issue-tracker"
	find "${D}/${HTTPD_ROOT}/issue-tracker/" -type d | xargs chmod 2775
	find "${D}/${HTTPD_ROOT}/issue-tracker/" -type f | xargs chmod 0664

}

pkg_postinst() {
	webapp-detect

	einfo "You will need to configure issue-tracker for a particular database"
	einfo ""
	einfo "(1) First, you must decide on:"
	einfo " - a database username, <it-username>"
	einfo " - a database name in the database, <it-dbname>"
	einfo ""
	einfo "(2) Next, you must create the database"
	einfo ""
	einfo "For MySQL:"
	einfo "mysqladmin -p -u <it-username> create <it-dbname>"
	einfo "mysql -p -u <it-username> <it-dbname> \\"
	einfo "      < ${HTTPD_ROOT}/issue-tracker/setup/schema.mysql"
	einfo "mysql -p -u <it-username> <it-dbname> \\"
	einfo "      < ${HTTPD_ROOT}/issue-tracker/setup/data.sql"
	einfo "mysql -p -u <it-username> <it-dbname> \\"
	einfo "      < ${HTTPD_ROOT}/issue-tracker/setup/indexes.sql"
	einfo ""
	einfo "For PostgreSQL:"
	einfo "createdb -U <it-username> <it-dbname>"
	einfo "psql -U <it-username> \\"
	einfo "     < ${HTTPD_ROOT}/issue-tracker/setup/schema.pgsql"
	einfo "psql -U <it-username> \\"
	einfo "     < ${HTTPD_ROOT}/issue-tracker/setup/data.sql"
	einfo "psql -U <it-username> \\"
	einfo "     < ${HTTPD_ROOT}/issue-tracker/setup/indexes.sql"
	einfo ""
	einfo "(3) Next, you will need to configure issue-tracker"
	einfo "cp ${HTTPD_ROOT}/issue-tracker/conf/config.php-default \\"
	einfo "   ${HTTPD_ROOT}/issue-tracker/conf/config.php"
	einfo ""
	einfo "Edit ${HTTPD_ROOT}/issue-tracker/conf/config.php"
	einfo "with name=<it-dbname>, user=<it-username> and the correct db info"
	einfo ""
	ewarn "Make sure you don't just edit the commented-out example;)"
	einfo ""
	ewarn "(4) Finally, you must log in to the issue-tracker as admin/demo, and"
	ewarn "change the password in Preferences."
}