1 #Contributor: Markus M. May <mmay AT javafreedom DOT org>
5 pkgdesc="A code quality management platform."
6 url="http://sonar.codehaus.org"
9 depends=('mysql' 'java-environment')
10 optdepends=('apache: a full featured webserver'
11 'maven: a java project management and project comprehension tool')
13 backup=('etc/sonar/sonar.properties'
14 'etc/sonar/wrapper.conf'
15 'etc/sonar/logback.xml')
17 install=${pkgname}.install
18 conflicts=('java-sonar')
19 provides=('java-sonar' 'sonar')
22 source=(http://dist.sonar.codehaus.org/${pkgname}-${pkgver}.zip
27 md5sums=('84080b76ffc386f0ef906501122c9fc1'
28 '36351479f8861f6043021f9a7b4a40a7'
29 '3cac81e4078940c907cee5c2dd154df0'
30 'e235ae1698147995a9961a951438f00d')
35 # Create directory and copy everything
36 install -d ${pkgdir}/opt/${pkgname}
38 # moving only $CARCH specific files to pkg, delete the rest
39 msg "Determine right architecture"
40 if [ $CARCH = 'x86_64' ]; then
41 cp -r ${srcdir}/${pkgname}-${pkgver}/bin/linux-x86-64 ${pkgdir}/opt/${pkgname}/bin || return 1
42 rm -r ${srcdir}/${pkgname}-${pkgver}/bin || return 1
43 elif [ $CARCH = 'i686' ]; then
44 cp -r ${srcdir}/${pkgname}-${pkgver}/bin/linux-x86-32 ${pkgdir}/opt/${pkgname}/bin || return 1
45 rm -r ${srcdir}/${pkgname}-${pkgver}/bin || return 1
48 # delete unnecessary log file
49 #rm ${pkgdir}/opt/${pkgname}/bin/wrapper.log
51 # install the additional config files to the desired destination
52 msg "Installing configuration files"
53 mkdir -p ${pkgdir}/etc/${pkgname} || return 1
54 install ${srcdir}/${pkgname}-${pkgver}/conf/${pkgname}.properties ${pkgdir}/etc/${pkgname}/${pkgname}.properties
55 install ${srcdir}/${pkgname}-${pkgver}/conf/derby.properties ${pkgdir}/etc/${pkgname}/derby.properties
56 install ${srcdir}/logback.xml ${pkgdir}/etc/${pkgname}/logback.xml
57 install ${srcdir}/wrapper.conf ${pkgdir}/etc/${pkgname} || return 1
58 rm -r ${srcdir}/${pkgname}-${pkgver}/conf
61 msg "Copy documentation"
62 mkdir -p ${pkgdir}/usr/share/doc/${pkgname}/
63 install ${srcdir}/${pkgname}-${pkgver}/COPYING ${pkgdir}/usr/share/doc/${pkgname}
64 rm ${srcdir}/${pkgname}-${pkgver}/COPYING
66 # delete not needed directories
67 rm -r ${srcdir}/${pkgname}-${pkgver}/logs
69 # copy the source to the final directory
70 msg "Copy Source to final directory"
71 cp -a ${srcdir}/${pkgname}-${pkgver}/* ${pkgdir}/opt/${pkgname} || return 1
73 install ${srcdir}/${pkgname}.sh ${pkgdir}/opt/${pkgname}/bin || return 1
75 mkdir -p ${pkgdir}/var/log/${pkgname}/
76 touch ${pkgdir}/var/log/${pkgname}/wrapper.log
78 install -m755 -d ${pkgdir}/var/run/${pkgname}