summaryrefslogtreecommitdiff
blob: 01088fb3a4f66a73daf40b721c3141fe57cfcd58 (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
93
94
95
96
97
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

EAPI="2"

inherit eutils confutils

DESCRIPTION="Redmine is a flexible project management web application written using Ruby on Rails framework"
HOMEPAGE="http://www.redmine.org/"
SRC_URI="mirror://rubyforge/${PN}/${P}.tar.gz"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64"
IUSE="cvs darcs git imagemagick mercurial mysql postgres sqlite3 subversion"

DEPEND=">=dev-ruby/rails-2.1.2:2.1
	dev-ruby/activerecord:2.1[mysql?,postgres?,sqlite3?]
	imagemagick? ( dev-ruby/rmagick )"
RDEPEND="${DEPEND}
	dev-ruby/actionwebservice
	dev-ruby/rails-acts_as_tree
	dev-ruby/rails-acts_as_versioned
	dev-ruby/coderay
	dev-ruby/rails-engines
	dev-ruby/gloc
	dev-ruby/ruby-net-ldap
	darcs? ( dev-util/darcs )
	git? ( dev-util/git )
	mercurial? ( dev-util/mercurial )
	subversion? ( >=dev-util/subversion-1.3 )"
#	dev-ruby/rails-gravatarplugin
#	dev-ruby/rails-rfpdf

REDMINE_DIR="/var/lib/${PN}"

pkg_setup() {
	confutils_require_any mysql postgres sqlite3

	enewgroup redmine
	# home directory is required for SCM.
	enewuser redmine -1 -1 "${REDMINE_DIR}" redmine
}

src_prepare() {
	# remove delete.me cruft
	rm -rf log files/delete.me
	# remove bundled libraries and plugins
	rm -rf \
		vendor/rails \
		vendor/plugins/{actionwebservice,classic_pagination} \
		vendor/plugins/acts_as_{tree,versioned} \
		vendor/plugins/{classic_pagination,engines} \
		vendor/plugins/ruby-net-ldap*
#		vendor/plugins/{gravatar,rfpdf} \
#		vendor/plugins/coderay* vendor/plugins/gloc* \
}


src_install() {
	dodoc doc/{CHANGELOG,INSTALL,UPGRADING}
	rm -rf doc

	mv config/database.yml{.example,}
	mv config/email.yml{.example,}

	insinto /etc/redmine
	doins -r config/*
	rm -rf config

	dodir /var/lib/redmine
	dosym /etc/redmine/ "${REDMINE_DIR}/config"
	keepdir /var/log/redmine
	dosym /var/log/redmine/ "${REDMINE_DIR}/log"

	insinto "${REDMINE_DIR}"
	doins -r . || die
	keepdir "${REDMINE_DIR}/files"

	fowners -R redmine:redmine \
		"${REDMINE_DIR}/files" \
		"${REDMINE_DIR}/tmp" \
		/var/log/redmine || die
	fowners redmine:redmine /etc/redmine/environment.rb || die

	# for SCM
	fowners redmine:redmine "${REDMINE_DIR}" || die
}

pkg_postinst()
{
	elog "Installation notes are at official site:"
	elog "    http://www.redmine.org/wiki/redmine/RedmineInstall"
	elog "For upgrade instructions take a look at:"
	elog "    http://www.redmine.org/wiki/redmine/RedmineUpgrade"
}