summaryrefslogtreecommitdiff
blob: 7ea1236b07d45e58582405239b0190ea95189018 (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
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

EAPI="2"
inherit eutils subversion confutils

DESCRIPTION="Redmine is a flexible project management web application written using Ruby on Rails framework"
HOMEPAGE="http://www.redmine.org/"
ESVN_REPO_URI="svn://rubyforge.org/var/svn/${PN}/trunk"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="cvs darcs git imagemagick +mysql postgres sqlite3 subversion"

# TODO: 
# 1. separate plugins....
#	dev-ruby/actionwebservice (rm vendor/plugins/{actionwebservice)
DEPEND=">=virtual/ruby-1.8.6_p200
	dev-ruby/rails:2.1
	mysql? ( dev-ruby/activerecord:2.1[mysql] )
	postgres? ( dev-ruby/activerecord:2.1[postgres] )
	sqlite3? ( dev-ruby/activerecord:2.1[sqlite3] )
	www-servers/mongrel
	dev-ruby/coderay
	dev-ruby/ruby-net-ldap
	imagemagick? ( dev-ruby/rmagick )
"

RDEPEND="${DEPEND}
	cvs? ( >=dev-util/cvs-1.12 )
	darcs? ( dev-util/darcs )
	git? ( dev-util/git )
	mercurial? ( dev-util/mercurial )
	subversion? ( >=dev-util/subversion-1.3 )
"

pkg_setup() {
	confutils_require_any mysql postgres sqlite3

	enewgroup redmine
	enewuser  redmine -1 -1 -1 redmine
}

src_install() {
	dodoc doc/{UPGRADING,INSTALL,CHANGELOG}
	rm -fr doc vendor/plugins/{coderay-*,ruby-net-ldap-*}

	mv config/database.yml{.example,}
	mv config/email.yml{.example,}
	insinto /etc/${PN}
	doins -r config/*
	rm -rf config log
	dosym /etc/${PN}/ /var/lib/${PN}/config
	keepdir /var/log/${PN}
	dosym /var/log/${PN} /var/lib/${PN}/log

	rm files/delete.me
	insinto /var/lib/${PN}
	doins -r .
	keepdir /var/lib/${PN}/files
	fowners -R redmine:redmine /var/lib/${PN}/{files,tmp,public} /var/log/${PN}

	newconfd "${FILESDIR}/redmine.confd" redmine
	newinitd "${FILESDIR}/redmine.initd" redmine
}

pkg_postinst() {
	einfo
	elog "Installation notes can be found on official site"
	elog "http://www.redmine.org/wiki/redmine/RedmineInstall"
	elog
	elog "Upgrade from previous version can be found on official site"
	elog "http://www.redmine.org/wiki/redmine/RedmineUpgrade"
	einfo
}