aboutsummaryrefslogtreecommitdiffstats
path: root/main/redmine/APKBUILD
blob: d156ad6284c9d3a85ab23ee89bb61c4b7e793de6 (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
98
99
100
101
102
103
104
105
106
107
108
109
# Contributor: Carlo Landmeter <clandmeter@gmail.com>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
_railsver=4.2
pkgname=redmine
pkgver=3.0.1
pkgrel=5
pkgdesc="Project management web application written in Ruby"
url="http://redmine.org"
arch="noarch"
license="GPL2"
depends="ruby
	ruby-actionpack-action_caching${_railsver}
	ruby-actionpack-xml_parser${_railsver}
	ruby-bigdecimal
	ruby-coderay
	ruby-fastercsv
	ruby-i18n
	ruby-jquery-rails${_railsver}
	ruby-json
	ruby-mocha
	ruby-net-ldap<0.4
	ruby-openid<2.4
	ruby-rack
	ruby-rack-openid
	ruby-rails${_railsver}
	ruby-rbpdf
	ruby-rdoc
	ruby-redcarpet<3.2
	ruby-request_store
	ruby-rmagick
	ruby-protected_attributes${_railsver}
	"
depends_dev=
makedepends="$depends_dev"
install="$pkgname.pre-install $pkgname.post-install"
subpackages=""
pkgusers="$pkgname"
pkggroups="$pkgname www-data"
source="http://www.redmine.org/releases/redmine-$pkgver.tar.gz
	gemfile.patch
	database.yml.patch
	"
_webapps="usr/share/webapps"

_builddir="$srcdir"/redmine-$pkgver

prepare() {
	local i
	cd "$_builddir"
	for i in $source; do
		case $i in
		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
		esac
	done
}

build() {
	cd "$_builddir"
	# verify that all deps are installed
	if ! bundler check; then
		bundler list
		return 1
	fi
}

package() {
	cd "$_builddir"
	# create dirs
	mkdir -p "$pkgdir/$_webapps/$pkgname" "$pkgdir"/etc/redmine \
		|| return 1
	install -o redmine -g www-data -m775 -d \
		"$pkgdir"/var/lib/redmine "$pkgdir"/var/log/redmine \
		|| return 1

	# move config files
	for i in database.yml.example configuration.yml.example \
			additional_environment.rb.example routes.rb; do
		mv config/${i} "$pkgdir"/etc/redmine/${i%.example} || return 1
		ln -s /etc/redmine/${i%.example} config/${i%.example} \
			|| return 1
	done

	# writeable data dirs
	for i in db files tmp public/plugin_assets; do
		chown redmine:www-data $i || return 1
		chmod 775 $i || return 1
		mv $i "$pkgdir"/var/lib/redmine/ || return 1
		ln -s /var/lib/redmine/${i#*/} $i || return 1
	done
	chown redmine Gemfile.lock || return 1

	# the secret token is generated by post-install
	ln -s /var/lib/redmine/secret_token.rb config/initializers/

	# log dir
	rm -r log && ln -s /var/log/redmine log || return 1

	mv * "$pkgdir/$_webapps/$pkgname" || return 1
}

md5sums="bf63ceef4fde0d38d17d94969478d422  redmine-3.0.1.tar.gz
2e8ee0e7dff0a8e558660a585e456c17  gemfile.patch
d834bef9b5f01484f1e0ee82676f4109  database.yml.patch"
sha256sums="9b701ff471bf1d9c9fd671e6a3d3c426850df5411a73f891f49c2cd79d489d5a  redmine-3.0.1.tar.gz
cdf1dc2357d161b3109ce99dea7964085b4fae9ba88cb8fce1f592f3508ee0f3  gemfile.patch
28b1ec099ae87c43d00d7e997edabaece01d6fc2e67b46c50735e9a1bb72f130  database.yml.patch"
sha512sums="689e8625197b4668bc06c68b0502a23e50675ad13d17a67a25cb51d68b1ac15ff4395783003ce696994bd15191139adde6bc21add0b81b4a40e9979e95753e18  redmine-3.0.1.tar.gz
6a32297e96dc3a986d51d1b9267cb2b401c2eda0f5a45381c2c424c625604de37b6c0060fc70a92c4ca87e533f9dade4c4e4fbd19f9390e5170fc4f0ecb81cbf  gemfile.patch
1b5880979f050a71d726c844369cc5340a8d4aa0b59b2301e1d32dea28f70ca2a85e619c8b845c37de08772154eef13fa63716c1beaaa50d97b80fd65c297bf9  database.yml.patch"