diff options
author | Atsushi Ichiki | 2015-11-09 02:58:32 +0900 |
---|---|---|
committer | Atsushi Ichiki | 2015-11-09 02:58:32 +0900 |
commit | 57826d280e13bc2b50cc6ea56a00042f0bed37a5 (patch) | |
tree | 8e664e13999aea3f00d92a85e7010556bdfe0883 | |
download | aur-57826d280e13bc2b50cc6ea56a00042f0bed37a5.tar.gz |
Initial import
-rw-r--r-- | .SRCINFO | 32 | ||||
-rw-r--r-- | PKGBUILD | 95 | ||||
-rw-r--r-- | sonar.sh.patch | 14 | ||||
-rw-r--r-- | sonarqube.install | 74 | ||||
-rw-r--r-- | sonarqube.service | 24 | ||||
-rw-r--r-- | wrapper.conf.patch | 182 |
6 files changed, 421 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..f325d7b6815b --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,32 @@ +pkgbase = sonarqube + pkgdesc = A code quality management platform. + pkgver = 5.2 + pkgrel = 0 + url = http://www.sonarqube.org/ + install = sonarqube.install + arch = i686 + arch = x86_64 + license = LGPL3 + depends = java-environment-common + optdepends = apache: a full featured webserver + optdepends = mariadb: Fast SQL database server, drop-in replacement for MySQL + optdepends = maven: a java project management and project comprehension tool + provides = sonarqube + conflicts = sonarqube-lts + replaces = sonarqube + options = !strip + backup = etc/sonarqube/sonar.properties + backup = etc/sonarqube/wrapper.conf + source = https://sonarsource.bintray.com/Distribution/sonarqube/sonarqube-5.2.zip + source = wrapper.conf.patch + source = sonar.sh.patch + source = sonarqube.service + source = sonarqube.install + md5sums = 3d0e923a11f3ce5caa272e5ce86a711a + md5sums = f9200f1722578c3e3af312c74295db9c + md5sums = 0561e8954de393e963b5b9f991a080cb + md5sums = 04484a8a3cc5cac4d8fbeddbdea1fbd0 + md5sums = 2298d28f6be2114fbe1911cf6e5f78fc + +pkgname = sonarqube + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..cc2667290562 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,95 @@ +# Maintaner: Atsushi Ichiki <hitotuky at gmail dot com> + +pkgname=sonarqube +pkgver=5.2 +pkgrel=0 +pkgdesc="A code quality management platform." +url="http://www.sonarqube.org/" +arch=('i686' 'x86_64') +license=('LGPL3') +depends=('java-environment-common') +optdepends=('apache: a full featured webserver' + 'mariadb: Fast SQL database server, drop-in replacement for MySQL' + 'maven: a java project management and project comprehension tool') + +backup=('etc/sonarqube/sonar.properties' + 'etc/sonarqube/wrapper.conf') + +install=${pkgname}.install +conflicts=('sonarqube-lts') +provides=('sonarqube') +replaces=('sonarqube') +options=(!strip) + +source=(https://sonarsource.bintray.com/Distribution/${pkgname}/${pkgname}-${pkgver}.zip + 'wrapper.conf.patch' + 'sonar.sh.patch' + 'sonarqube.service' + 'sonarqube.install') + +md5sums=('3d0e923a11f3ce5caa272e5ce86a711a' + 'f9200f1722578c3e3af312c74295db9c' + '0561e8954de393e963b5b9f991a080cb' + '04484a8a3cc5cac4d8fbeddbdea1fbd0' + '2298d28f6be2114fbe1911cf6e5f78fc') + +package() { + cd ${srcdir} + + # Create directory and copy everything + install -d ${pkgdir}/usr/share/${pkgname} + + # modify the current config files for working with arch + msg "Patch files" + patch ${srcdir}/${pkgname}-${pkgver}/conf/wrapper.conf < ${srcdir}/wrapper.conf.patch + if [ $CARCH = 'x86_64' ]; then + patch ${srcdir}/${pkgname}-${pkgver}/bin/linux-x86-64/sonar.sh < ${srcdir}/sonar.sh.patch + #sed -i "s/ARCH/linux-x86-64/g" ${srcdir}/sonarqube.service + elif [ $CARCH = 'i686' ]; then + patch ${srcdir}/${pkgname}-${pkgver}/bin/linux-x86-32/sonar.sh < ${srcdir}/sonar.sh.patch + #sed - "s/ARCH/linux-x86-32/g" ${srcdir}/sonarqube.service + fi + + # moving only $CARCH specific files to pkg, delete the rest + msg "Determine right architecture" + mkdir -p ${pkgdir}/usr/share/${pkgname}/bin/ + if [ $CARCH = 'x86_64' ]; then + cp -r ${srcdir}/${pkgname}-${pkgver}/bin/linux-x86-64/* ${pkgdir}/usr/share/${pkgname}/bin || return 1 + rm -r ${srcdir}/${pkgname}-${pkgver}/bin || return 1 + elif [ $CARCH = 'i686' ]; then + cp -r ${srcdir}/${pkgname}-${pkgver}/bin/linux-x86-32/* ${pkgdir}/usr/share/${pkgname}/bin || return 1 + rm -r ${srcdir}/${pkgname}-${pkgver}/bin || return 1 + fi + + # install the additional config files to the desired destination + msg "Installing configuration files" + mkdir -p ${pkgdir}/etc/${pkgname} + install ${srcdir}/${pkgname}-${pkgver}/conf/sonar.properties ${pkgdir}/etc/${pkgname}/sonar.properties + install ${srcdir}/${pkgname}-${pkgver}/conf/wrapper.conf ${pkgdir}/etc/${pkgname}/wrapper.conf + rm -r ${srcdir}/${pkgname}-${pkgver}/conf + + # copy documentation + msg "Copy documentation" + mkdir -p ${pkgdir}/usr/share/doc/${pkgname}/ + install ${srcdir}/${pkgname}-${pkgver}/COPYING ${pkgdir}/usr/share/doc/${pkgname} + rm ${srcdir}/${pkgname}-${pkgver}/COPYING + + # delete not needed directories + rm -r ${srcdir}/${pkgname}-${pkgver}/logs + ln -s /var/log/${pkgname} ${pkgdir}/usr/share/${pkgname}/logs + #mkdir -p /var/log/ + + # copy the source to the final directory + msg "Copy Source to final directory" + cp -a ${srcdir}/${pkgname}-${pkgver}/* ${pkgdir}/usr/share/${pkgname} || return 1 + + mkdir -p ${pkgdir}/var/log/${pkgname}/ + touch ${pkgdir}/var/log/${pkgname}/wrapper.log + touch ${pkgdir}/var/log/${pkgname}/sonar.log + touch ${pkgdir}/var/log/${pkgname}/profiling.log + + install -m755 -d ${pkgdir}/run/${pkgname} + + install -Dm644 "${srcdir}/sonarqube.service" "${pkgdir}/usr/lib/systemd/system/sonarqube.service" +} + diff --git a/sonar.sh.patch b/sonar.sh.patch new file mode 100644 index 000000000000..f9634f69ff56 --- /dev/null +++ b/sonar.sh.patch @@ -0,0 +1,14 @@ +@@ -25,3 +25,3 @@ + WRAPPER_CMD="./wrapper" +-WRAPPER_CONF="../../conf/wrapper.conf" ++WRAPPER_CONF="/etc/sonarqube/wrapper.conf" + +@@ -30,7 +30,7 @@ + PRIORITY= + + # Location of the pid file. +-PIDDIR="." ++PIDDIR="/run/sonarqube" + + # If uncommented, causes the Wrapper to be shutdown using an anchor file. + # When launched with the 'start' command, it will also ignore all INT and diff --git a/sonarqube.install b/sonarqube.install new file mode 100644 index 000000000000..9ee00e4d4ad5 --- /dev/null +++ b/sonarqube.install @@ -0,0 +1,74 @@ +#!/bin/sh +# $Id$ +# vim:set ts=2 sw=2 et: + +# arg 1: the new package version +pre_install() { + /bin/true +} + +# arg 1: the new package version +post_install() { + echo ">>> Creating user and group and setting permissions..." + getent group sonar > /dev/null || usr/sbin/groupadd sonar + getent passwd sonar > /dev/null || usr/sbin/useradd -c \ + 'Sonar Code Quality metric system' -g sonar -d '/etc/sonarqube' \ + --system -s /bin/bash sonar &> /dev/null + + cd /usr/share/sonarqube + + chown -R sonar:sonar * + chown -R sonar:sonar /etc/sonarqube + chown -R sonar:sonar /var/run/sonarqube + chown -R sonar:sonar /var/log/sonarqube + + cat << EOF +>>> +>>> Sonar can now be started via /usr/share/sonarqube/bin/sonar.sh or via +>>> systemctl start sonarqube. +>>> +>>> Sonar will run by default using the Derby embedded database, to change this +>>> to another database (e.g. MySql), please edit the +>>> /etc/sonarqube/sonar.properties accordingly. +>>> +>>> Sonar is running by default on port 9000 and is bound to all interfaces, +>>> you can change this in the file /etc/sonarqube/sonar.properties. +>>> +>>> For additional information please visit http://sonar.codehaus.org +>>> +>>> If you are upgrading from an earlier version, please read http://sonar.codehaus.org/ +>>> and browse to http://localhost:9000/setup. +EOF +} + +# arg 1: the new package version +# arg 2: the old package version +pre_upgrade() { + /bin/true +} + +# arg 1: the new package version +# arg 2: the old package version +post_upgrade() { + cd /usr/share/sonarqube + + chown -R sonar:sonar * + chown -R sonar:sonar /etc/sonarqube + chown -R sonar:sonar /var/run/sonarqube + chown -R sonar:sonar /var/log/sonarqube +} + +# arg 1: the old package version +pre_remove() { + /bin/true +} + +# arg 1: the old package version +post_remove() { + getent passwd sonar > /dev/null && usr/sbin/userdel sonar &>/dev/null + getent group sonar > /dev/null && usr/sbin/groupdel sonar &>/dev/null + + if [ -x /var/run/sonarqube ] ; then + rm -r /var/run/sonarqube + fi +} diff --git a/sonarqube.service b/sonarqube.service new file mode 100644 index 000000000000..e5e1dc22fc10 --- /dev/null +++ b/sonarqube.service @@ -0,0 +1,24 @@ +[Unit] +Description=A code quality management platform. +After=network.target + +[Service] +User=sonar +Type=forking +StandardOutput=syslog +StandardError=syslog +SyslogIdentifier=sonar +ExecStart=/usr/share/sonarqube/bin/sonar.sh start +ExecStop=/usr/share/sonarqube/bin/sonar.sh stop +PIDFile=/var/run/sonarqube/SonarQube.pid +OOMScoreAdjust=-1000 +LimitCPU=infinity +LimitFSIZE=infinity +LimitDATA=infinity +LimitCORE=0 +LimitAS=infinity +LimitLOCKS=infinity + +[Install] +WantedBy=multi-user.target + diff --git a/wrapper.conf.patch b/wrapper.conf.patch new file mode 100644 index 000000000000..b95d1cd4173e --- /dev/null +++ b/wrapper.conf.patch @@ -0,0 +1,182 @@ +--- wrapper.conf.orig 2015-11-02 10:08:46.000000000 +0900 ++++ wrapper.conf 2015-11-08 17:01:50.394826988 +0900 +@@ -1,88 +1,90 @@ +-# Path to JVM executable. By default it must be available in PATH.
+-# Can be an absolute path, for example:
+-#wrapper.java.command=/path/to/my/jdk/bin/java
+-wrapper.java.command=java
+-
+-
+-#
+-# DO NOT EDIT THE FOLLOWING SECTIONS
+-#
+-
+-
+-#********************************************************************
+-# Wrapper Java
+-#********************************************************************
+-wrapper.java.additional.1=-Djava.awt.headless=true
+-wrapper.java.mainclass=org.tanukisoftware.wrapper.WrapperSimpleApp
+-wrapper.java.classpath.1=../../lib/jsw/*.jar
+-wrapper.java.classpath.2=../../lib/*.jar
+-wrapper.java.library.path.1=./lib
+-wrapper.app.parameter.1=org.sonar.application.App
+-wrapper.java.initmemory=3
+-wrapper.java.maxmemory=3
+-
+-#********************************************************************
+-# Wrapper Logs
+-#********************************************************************
+-
+-wrapper.console.format=PM
+-wrapper.console.loglevel=INFO
+-wrapper.logfile=../../logs/sonar.log
+-wrapper.logfile.format=M
+-wrapper.logfile.loglevel=INFO
+-
+-# Maximum size that the log file will be allowed to grow to before
+-# the log is rolled. Size is specified in bytes. The default value
+-# of 0, disables log rolling. May abbreviate with the 'k' (kb) or
+-# 'm' (mb) suffix. For example: 10m = 10 megabytes.
+-#wrapper.logfile.maxsize=0
+-
+-# Maximum number of rolled log files which will be allowed before old
+-# files are deleted. The default value of 0 implies no limit.
+-#wrapper.logfile.maxfiles=0
+-
+-# Log Level for sys/event log output. (See docs for log levels)
+-wrapper.syslog.loglevel=NONE
+-
+-#********************************************************************
+-# Wrapper Windows Properties
+-#********************************************************************
+-# Title to use when running as a console
+-wrapper.console.title=SonarQube
+-
+-# Disallow start of multiple instances of an application at the same time on Windows
+-wrapper.single_invocation=true
+-
+-#********************************************************************
+-# Wrapper Windows NT/2000/XP Service Properties
+-#********************************************************************
+-# WARNING - Do not modify any of these properties when an application
+-# using this configuration file has been installed as a service.
+-# Please uninstall the service before modifying this section. The
+-# service can then be reinstalled.
+-
+-# Name of the service
+-wrapper.ntservice.name=SonarQube
+-
+-# Display name of the service
+-wrapper.ntservice.displayname=SonarQube
+-
+-# Description of the service
+-wrapper.ntservice.description=SonarQube
+-
+-# Service dependencies. Add dependencies as needed starting from 1
+-wrapper.ntservice.dependency.1=
+-
+-# Mode in which the service is installed. AUTO_START or DEMAND_START
+-wrapper.ntservice.starttype=AUTO_START
+-
+-# Allow the service to interact with the desktop.
+-wrapper.ntservice.interactive=false
+-
+-#********************************************************************
+-# Forking Properties
+-#********************************************************************
+-wrapper.disable_restarts=TRUE
+-wrapper.ping.timeout=0
+-wrapper.shutdown.timeout=3000
+-wrapper.jvm_exit.timeout=3000 +\ No newline at end of file ++# Path to JVM executable. By default it must be available in PATH. ++# Can be an absolute path, for example: ++#wrapper.java.command=/path/to/my/jdk/bin/java ++wrapper.java.command=java ++ ++ ++# ++# DO NOT EDIT THE FOLLOWING SECTIONS ++# ++ ++export SONAR_HOME=${SONAR_HOME:=/usr/share/sonarqube} ++ ++#******************************************************************** ++# Wrapper Java ++#******************************************************************** ++wrapper.java.additional.1=-Djava.awt.headless=true ++wrapper.java.additional.2=-XX:MaxPermSize=128m ++wrapper.java.mainclass=org.tanukisoftware.wrapper.WrapperSimpleApp ++wrapper.java.classpath.1=../lib/jsw/*.jar ++wrapper.java.classpath.2=../lib/*.jar ++wrapper.java.library.path.1=./lib ++wrapper.app.parameter.1=org.sonar.application.App ++wrapper.java.initmemory=256 ++wrapper.java.maxmemory=512 ++ ++#******************************************************************** ++# Wrapper Logs ++#******************************************************************** ++ ++wrapper.console.format=PM ++wrapper.console.loglevel=INFO ++wrapper.logfile=/var/log/sonarqube/sonar.log ++wrapper.logfile.format=LPTM ++wrapper.logfile.loglevel=INFO ++ ++# Maximum size that the log file will be allowed to grow to before ++# the log is rolled. Size is specified in bytes. The default value ++# of 0, disables log rolling. May abbreviate with the 'k' (kb) or ++# 'm' (mb) suffix. For example: 10m = 10 megabytes. ++#wrapper.logfile.maxsize=0 ++ ++# Maximum number of rolled log files which will be allowed before old ++# files are deleted. The default value of 0 implies no limit. ++#wrapper.logfile.maxfiles=0 ++ ++# Log Level for sys/event log output. (See docs for log levels) ++wrapper.syslog.loglevel=NONE ++ ++#******************************************************************** ++# Wrapper Windows Properties ++#******************************************************************** ++# Title to use when running as a console ++wrapper.console.title=SonarQube ++ ++# Disallow start of multiple instances of an application at the same time on Windows ++wrapper.single_invocation=true ++ ++#******************************************************************** ++# Wrapper Windows NT/2000/XP Service Properties ++#******************************************************************** ++# WARNING - Do not modify any of these properties when an application ++# using this configuration file has been installed as a service. ++# Please uninstall the service before modifying this section. The ++# service can then be reinstalled. ++ ++# Name of the service ++wrapper.ntservice.name=SonarQube ++ ++# Display name of the service ++wrapper.ntservice.displayname=SonarQube ++ ++# Description of the service ++wrapper.ntservice.description=SonarQube ++ ++# Service dependencies. Add dependencies as needed starting from 1 ++wrapper.ntservice.dependency.1= ++ ++# Mode in which the service is installed. AUTO_START or DEMAND_START ++wrapper.ntservice.starttype=AUTO_START ++ ++# Allow the service to interact with the desktop. ++wrapper.ntservice.interactive=false ++ ++#******************************************************************** ++# Forking Properties ++#******************************************************************** ++wrapper.disable_restarts=TRUE ++wrapper.ping.timeout=0 ++wrapper.shutdown.timeout=3000 ++wrapper.jvm_exit.timeout=3000 |