updated on Thu Jan 19 20:01:47 UTC 2012
[aur-mirror.git] / opengrok / PKGBUILD
blobcd009ad41def6f6c9807534f1b20803e0f07e62d
1 # Contributor: Vojtech Horky <vojta . horky at-symbol seznam . cz>
2 pkgname=opengrok
3 pkgver=0.10
4 pkgrel=1
5 pkgdesc="A wicked fast source browser."
6 url="http://hub.opensolaris.org/bin/view/Project+opengrok/"
7 arch=('any')
8 license=('CDDL')
9 depends=('tomcat' 'jre' 'ctags' 'sh')
10 makedepends=('sed')
11 source=(
12         "http://hub.opensolaris.org/bin/download/Project+opengrok/files/${pkgname}-${pkgver}.tar.gz"
13         deploy.sh)
14 md5sums=(
15         'b25fba90b2b521f58e802d03e7f498d4'
16         'abef99ea9922f52fd09956ef8d579787')
19 build() {
20         # nothing to build
21         echo -n;
24 package() {
25         cd "${srcdir}/${pkgname}-${pkgver}"
26         
27         # OpenGrok script in /usr/bin
28         mkdir -p "${pkgdir}/usr/bin" || return 1
29         ln -s /opt/opengrok/bin/OpenGrok "${pkgdir}/usr/bin/OpenGrok"
30         
31         # copy everything
32         mkdir -p "${pkgdir}/opt/opengrok" || return 1
33         cp -R * "${pkgdir}/opt/opengrok" || return 1
34         msg "Patching OpenGrok binary for Arch Linux..."
35         # on Arch,
36         # - ctags command is ctags
37         # - Tomcat is installed into /opt/tomcat
38         # - need to pretend that the script is in /opt/opengrok
39         sed \
40                 -e 's#SCRIPT_DIRECTORY=.*dirname.*#SCRIPT_DIRECTORY="/opt/opengrok/bin"#' \
41                 -e '/Linux/s:commandName="ctags-exuberant":commandName="ctags":' \
42                 -e '/DetermineWarDirectoryTomcat[(]/,/^[ \t]*}[ \t]*$/s#.*OPENGROK_TOMCAT_BASE.*#\t/opt/tomcat \\\n&#' \
43                 -e '/StdInvocation/,/^\}/s/"\${@}"/${OPENGROK_EXTRA_PARAMS} &/' \
44                 -i "${pkgdir}/opt/opengrok/bin/OpenGrok"
45         
46         install -m0755 "${srcdir}/deploy.sh" "${pkgdir}/opt/opengrok/bin/tomcat-deploy-helper"