diff options
author | Max Falk | 2016-07-22 11:06:10 +0200 |
---|---|---|
committer | Max Falk | 2016-07-22 11:06:10 +0200 |
commit | 1526c02a4f4891ff00045af75df6648bbb74d4ed (patch) | |
tree | d54d0411cc60e62287d5bb3553ad75dccd8b4733 | |
parent | d5fa66f3974e48a4e7beaf93d462dde845163f00 (diff) | |
download | aur-1526c02a4f4891ff00045af75df6648bbb74d4ed.tar.gz |
start maintaining project, overhaul packaging and bump from 5.2 to 5.6
-rw-r--r-- | .SRCINFO | 27 | ||||
-rw-r--r-- | .gitignore | 5 | ||||
-rw-r--r-- | PKGBUILD | 139 | ||||
-rw-r--r-- | sonar.sh.patch | 14 | ||||
-rw-r--r-- | sonarqube-tmpfile.conf | 4 | ||||
-rw-r--r-- | sonarqube-user.conf | 1 | ||||
-rw-r--r-- | sonarqube.install | 82 | ||||
-rw-r--r-- | sonarqube.service | 23 | ||||
-rw-r--r-- | wrapper.conf.patch | 182 |
9 files changed, 103 insertions, 374 deletions
@@ -1,35 +1,32 @@ # Generated by mksrcinfo v8 -# Wed Dec 30 18:08:41 UTC 2015 +# Fri Jul 22 09:01:08 UTC 2016 pkgbase = sonarqube - pkgdesc = A code quality management platform. - pkgver = 5.2 + pkgdesc = An open source platform for continuous inspection of code quality + pkgver = 5.6 pkgrel = 1 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 + depends = java-runtime>=8 + optdepends = apache: a fully featured webserver optdepends = mariadb: Fast SQL database server, drop-in replacement for MySQL optdepends = maven: a java project management and project comprehension tool optdepends = postgresql: A sophisticated object-relational DBMS 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 = https://sonarsource.bintray.com/Distribution/sonarqube/sonarqube-5.6.zip source = sonarqube.service - source = sonarqube.install - md5sums = 3d0e923a11f3ce5caa272e5ce86a711a - md5sums = f9200f1722578c3e3af312c74295db9c - md5sums = 0561e8954de393e963b5b9f991a080cb - md5sums = d7450179d89871589e7a377fbd696258 - md5sums = d2b63c1fd37954bb470a7d9003aed7f4 + source = sonarqube-tmpfile.conf + source = sonarqube-user.conf + sha256sums = 397c4eaf1d220cc2cef2075f709a4c50208dc91289e0234b0ae5954533f66994 + sha256sums = acf98543b635778a690c5d1a8796bf67de725eeda1c72856bd63ea148a892223 + sha256sums = 6e024de469ebb1bc4083274412f0a5d68d5fa511c2139ce4cb1d243c51ff9535 + sha256sums = 43ff10bbb495827e952225dce79da79bb800627eaa6f1d933f8f7fb408aafe6d pkgname = sonarqube diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000000..5defd62caeec --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +pkg/ +src/ +*.tar.xz +*.zip + @@ -1,95 +1,72 @@ -# Maintaner: Atsushi Ichiki <hitotuky at gmail dot com> +# Submitter: Atsushi Ichiki <hitotuky at gmail dot com> +# Maintainer: Max Falk <gmdfalk at gmail dot com> -pkgname=sonarqube -pkgver=5.2 +_pkgname=sonarqube +pkgname=${_pkgname} +pkgver=5.6 pkgrel=1 -pkgdesc="A code quality management platform." +pkgdesc="An open source platform for continuous inspection of code quality" +arch=("i686" "x86_64") url="http://www.sonarqube.org/" -arch=('i686' 'x86_64') license=('LGPL3') -depends=('java-environment-common') -optdepends=('apache: a full featured webserver' + +depends=('java-runtime>=8') + +optdepends=('apache: a fully featured webserver' 'mariadb: Fast SQL database server, drop-in replacement for MySQL' 'maven: a java project management and project comprehension tool' 'postgresql: A sophisticated object-relational DBMS') -backup=('etc/sonarqube/sonar.properties' - 'etc/sonarqube/wrapper.conf') +backup=("etc/${_pkgname}/sonar.properties" + "etc/${_pkgname}/wrapper.conf") + +conflicts=("${_pkgname}-lts") +provides=("${_pkgname}") +options=('!strip') 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' - 'd7450179d89871589e7a377fbd696258' - 'd2b63c1fd37954bb470a7d9003aed7f4') +source=("https://sonarsource.bintray.com/Distribution/${_pkgname}/${_pkgname}-${pkgver}.zip" + "${_pkgname}.service" + "${_pkgname}-tmpfile.conf" + "${_pkgname}-user.conf") + +sha256sums=('397c4eaf1d220cc2cef2075f709a4c50208dc91289e0234b0ae5954533f66994' + 'acf98543b635778a690c5d1a8796bf67de725eeda1c72856bd63ea148a892223' + '6e024de469ebb1bc4083274412f0a5d68d5fa511c2139ce4cb1d243c51ff9535' + '43ff10bbb495827e952225dce79da79bb800627eaa6f1d933f8f7fb408aafe6d') 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 - ln -s /etc/${pkgname} ${pkgdir}/usr/share/${pkgname}/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 - 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 - ln -s /var/log/${pkgname} ${pkgdir}/usr/share/${pkgname}/logs - - # copy the source to the final directory - msg "Copy Source to final directory" - cp -a ${srcdir}/${pkgname}-${pkgver}/* ${pkgdir}/usr/share/${pkgname} || return 1 - - install -m755 -d ${pkgdir}/run/${pkgname} - - install -Dm644 "${srcdir}/sonarqube.service" "${pkgdir}/usr/lib/systemd/system/sonarqube.service" + cd "${srcdir}/${_pkgname}-${pkgver}" + + # Copy everything except bin and conf to /usr/share/sonarqube. + install -dm755 "${pkgdir}/usr/share/${_pkgname}" + cp -dr --no-preserve=ownership {bin,data,extensions,lib,temp,web} "${pkgdir}/usr/share/${_pkgname}/" + + # Install the license. + install -Dm644 "COPYING" "${pkgdir}/usr/share/doc/${_pkgname}/COPYING" + + # Install the configuration files to /etc/sonarqube. + install -Dm644 "conf/sonar.properties" "${pkgdir}/etc/${_pkgname}/sonar.properties" + install -Dm644 "conf/wrapper.conf" "${pkgdir}/etc/${_pkgname}/wrapper.conf" + + # Install the systemd configuration and service files. + cd "${srcdir}" + install -Dm644 "${_pkgname}.service" "${pkgdir}/usr/lib/systemd/system/${_pkgname}.service" + install -Dm644 "${_pkgname}-user.conf" "${pkgdir}/usr/lib/sysusers.d/${_pkgname}.conf" + install -Dm644 "${_pkgname}-tmpfile.conf" "${pkgdir}/usr/lib/tmpfiles.d/${_pkgname}.conf" + + # Symbolic links because SonarQube expects a specific directory layout. + ln -s "/var/log/${_pkgname}" "${pkgdir}/usr/share/${_pkgname}/logs" + ln -s "/run/${_pkgname}" "${pkgdir}/usr/share/${_pkgname}/run" + ln -s "/etc/${_pkgname}" "${pkgdir}/usr/share/${_pkgname}/conf" + + # Modify the service file in place to adjust the binary path to the CPU architecture. This is necessary because + # SonarQube expects a certain directory layout. The alternative would be to patch SonarQube's config files which is messy. + if [[ "$CARCH" == 'x86_64' ]]; then + sed -i 's/\$ARCH/linux-x86-64/g' "${pkgdir}/usr/lib/systemd/system/${_pkgname}.service" + elif [[ "$CARCH" == 'i686' ]]; then + sed -i 's/\$ARCH/linux-x86-32/g' "${pkgdir}/usr/lib/systemd/system/${_pkgname}.service" + fi } + diff --git a/sonar.sh.patch b/sonar.sh.patch deleted file mode 100644 index f9634f69ff56..000000000000 --- a/sonar.sh.patch +++ /dev/null @@ -1,14 +0,0 @@ -@@ -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-tmpfile.conf b/sonarqube-tmpfile.conf new file mode 100644 index 000000000000..fc5767027131 --- /dev/null +++ b/sonarqube-tmpfile.conf @@ -0,0 +1,4 @@ +d /run/sonarqube 0755 sonarqube sonarqube - +f /run/sonarqube/SonarQube.pid 0644 sonarqube sonarqube - +d /var/log/sonarqube 0755 sonarqube sonarqube - +d /etc/sonarqube 0755 sonarqube sonarqube - diff --git a/sonarqube-user.conf b/sonarqube-user.conf new file mode 100644 index 000000000000..800410a57f66 --- /dev/null +++ b/sonarqube-user.conf @@ -0,0 +1 @@ +u sonarqube - "SonarQube user" diff --git a/sonarqube.install b/sonarqube.install index 6b1c61703c40..e44ee8bda428 100644 --- a/sonarqube.install +++ b/sonarqube.install @@ -1,76 +1,22 @@ -#!/bin/sh -# $Id$ -# vim:set ts=2 sw=2 et: +#!/usr/bin/env sh +# vim:set ts=4 sw=4 et: -# arg 1: the new package version -pre_install() { - /bin/true -} +username="sonarqube" -# 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 - - ln -s /var/log/sonarqube /usr/share/sonarqube/logs - - 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 + systemd-sysusers "${username}.conf" + systemd-tmpfiles --create "${username}.conf" + chown -R "$username:$username" /etc/$username /run/$username /usr/share/$username /var/log/$username } -# 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 +post_upgrade(){ + getent passwd "${username}" >/dev/null 2>&1 || systemd-sysusers "${username}.conf" + systemd-tmpfiles --create sonarqube.conf - if [ -x /var/run/sonarqube ] ; then - rm -r /var/run/sonarqube - fi + if [ "$(vercmp $2 5.6)" -lt 0 ]; then + echo " >> " + echo " >> Major version update from 5.2 to 5.6. Please take a look at http://www.sonarqube.org/downloads/ for more information." + echo " >> " + fi } diff --git a/sonarqube.service b/sonarqube.service index 7da163d99fe1..556ceaf6ef6b 100644 --- a/sonarqube.service +++ b/sonarqube.service @@ -1,24 +1,19 @@ [Unit] -Description=A code quality management platform. +Description=An open source platform for continuous inspection of code quality +Documentation=http://www.sonarqube.org +Wants=network.target After=network.target [Service] -User=sonar -Grup=sonar Type=forking +User=sonarqube +Group=sonarqube 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 +SyslogIdentifier=sonarqube +RuntimeDirectory=sonarqube +ExecStart=/usr/share/sonarqube/bin/$ARCH/sonar.sh start +ExecStop=/usr/share/sonarqube/bin/$ARCH/sonar.sh stop [Install] WantedBy=multi-user.target diff --git a/wrapper.conf.patch b/wrapper.conf.patch deleted file mode 100644 index b95d1cd4173e..000000000000 --- a/wrapper.conf.patch +++ /dev/null @@ -1,182 +0,0 @@ ---- 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 |