summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO27
-rw-r--r--.gitignore51
-rw-r--r--PKGBUILD123
-rw-r--r--sonar.sh.patch11
-rw-r--r--sonarqube-lts.install17
-rw-r--r--sonarqube.service15
-rw-r--r--sonarqube.tmpfiles2
7 files changed, 159 insertions, 87 deletions
diff --git a/.SRCINFO b/.SRCINFO
index b2bdaddefa07..40b1415dcc8f 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,24 +1,31 @@
# Generated by mksrcinfo v8
-# Fri Dec 11 08:17:34 UTC 2015
+# Tue Jul 5 18:44:18 UTC 2016
pkgbase = sonarqube-lts
- pkgdesc = An open platform to manage code quality
- pkgver = 4.5.6
+ pkgdesc = An open source platform for continuous inspection of code quality
+ pkgver = 5.6
pkgrel = 1
url = http://www.sonarqube.org/
install = sonarqube-lts.install
arch = i686
arch = x86_64
license = LGPL3
- depends = java-runtime>=7
- conflicts = sonar
+ depends = java-environment-common
+ 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
+ replaces = sonarqube
options = !strip
- source = https://sonarsource.bintray.com/Distribution/sonarqube/sonarqube-4.5.6.zip
+ backup = etc/sonarqube/sonar.properties
+ backup = etc/sonarqube/wrapper.conf
+ source = https://sonarsource.bintray.com/Distribution/sonarqube/sonarqube-5.6.zip
source = sonarqube.service
- source = sonar.sh.patch
- md5sums = 3b372503944e1b21138d605d85cbf025
- md5sums = e98cb43f4f6b9af33312fa1d8aba88e3
- md5sums = 2b443049eede589adc4ad451197f1c10
+ source = sonarqube.tmpfiles
+ sha256sums = 397c4eaf1d220cc2cef2075f709a4c50208dc91289e0234b0ae5954533f66994
+ sha256sums = acf98543b635778a690c5d1a8796bf67de725eeda1c72856bd63ea148a892223
+ sha256sums = 8f830104d96c5d19ab1b72165515648595d1b32d4c03e607d78de532cdbd510c
pkgname = sonarqube-lts
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000000..81e720129838
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,51 @@
+pkg
+src
+sonarqube*.zip
+sonarqube*.pkg.tar.xz
+
+# Created by .ignore support plugin (hsz.mobi)
+### JetBrains template
+# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
+# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
+
+# User-specific stuff:
+.idea/workspace.xml
+.idea/tasks.xml
+.idea/dictionaries
+.idea/vcs.xml
+.idea/jsLibraryMappings.xml
+
+# Sensitive or high-churn files:
+.idea/dataSources.ids
+.idea/dataSources.xml
+.idea/dataSources.local.xml
+.idea/sqlDataSources.xml
+.idea/dynamic.xml
+.idea/uiDesigner.xml
+
+# Gradle:
+.idea/gradle.xml
+.idea/libraries
+
+# Mongo Explorer plugin:
+.idea/mongoSettings.xml
+
+## File-based project format:
+*.iws
+
+## Plugin-specific files:
+
+# IntelliJ
+/out/
+
+# mpeltonen/sbt-idea plugin
+.idea_modules/
+
+# JIRA plugin
+atlassian-ide-plugin.xml
+
+# Crashlytics plugin (for Android Studio and IntelliJ)
+com_crashlytics_export_strings.xml
+crashlytics.properties
+crashlytics-build.properties
+fabric.properties
diff --git a/PKGBUILD b/PKGBUILD
index 8eff7c0ccb93..41bfe4c4787b 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,63 +1,78 @@
-# Maintainer: Peter Lamby <peterlamby@web.de>
-pkgname=sonarqube-lts
-pkgver=4.5.6
+# Submitter: Peter Lamby <peterlamby@web.de>
+# Maintainer: Max Falk <gmdfalk@gmail.com>
+
+_pkgname=sonarqube
+pkgname=${_pkgname}-lts
+pkgver=5.6
pkgrel=1
-pkgdesc='An open platform to manage code quality'
-arch=('i686' 'x86_64')
-url='http://www.sonarqube.org/'
+pkgdesc="An open source platform for continuous inspection of code quality"
+arch=("i686" "x86_64")
+url="http://www.sonarqube.org/"
license=('LGPL3')
-depends=('java-runtime>=7')
-conflicts=('sonar' 'sonarqube')
-options=('!strip')
-install=sonarqube-lts.install
-source=("https://sonarsource.bintray.com/Distribution/sonarqube/sonarqube-${pkgver}.zip"
- 'sonarqube.service'
- 'sonar.sh.patch')
-md5sums=('3b372503944e1b21138d605d85cbf025'
- 'e98cb43f4f6b9af33312fa1d8aba88e3'
- '2b443049eede589adc4ad451197f1c10')
-
-prepare() {
- cd ${srcdir}
-
- # Customize .service for $CARCH
- if [ $CARCH = 'x86_64' ]; then
- sed -i 's/ARCH/linux-x86-64/g' sonarqube.service
- else
- sed -i '/s/ARCH/linux-x86-32/g' sonarqube.service
- fi
-
- cd sonarqube-${pkgver}
-
- cd bin
- # Delete unneeded binaries
- rm -rf linux-ppc-64 macosx-universal-64 solaris* windows*
-
- if [ $CARCH = 'x86_64' ]; then
- patch linux-x86-64/sonar.sh < "${srcdir}/sonar.sh.patch"
- rm -rf linux-x86-32
- else
- patch linux-x86-32/sonar.sh < "${srcdir}/sonar.sh.patch"
- rm -rf linux-x86-64
- fi
- cd ..
-
- # Fix EOL in configuration files
- for i in conf/* ; do
- awk '{ sub("\r$", ""); print }' $i > $i.new
- mv $i.new $i
- done
-}
+depends=("java-environment-common")
+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/${_pkgname}/sonar.properties"
+ "etc/${_pkgname}/wrapper.conf")
+
+conflicts=("${_pkgname}")
+provides=("${_pkgname}")
+replaces=("${_pkgname}")
+options=('!strip')
+install=${pkgname}.install
+source=("https://sonarsource.bintray.com/Distribution/${_pkgname}/${_pkgname}-${pkgver}.zip"
+ "${_pkgname}.service"
+ "${_pkgname}.tmpfiles")
+
+sha256sums=('397c4eaf1d220cc2cef2075f709a4c50208dc91289e0234b0ae5954533f66994'
+ 'acf98543b635778a690c5d1a8796bf67de725eeda1c72856bd63ea148a892223'
+ '8f830104d96c5d19ab1b72165515648595d1b32d4c03e607d78de532cdbd510c')
+
package() {
cd "${srcdir}"
+ local src="${srcdir}/${_pkgname}-${pkgver}"
+
+ # Copy most files to /usr/share/sonarqube.
+ install -dm755 "${pkgdir}/usr/share/${_pkgname}"
+ cp -dr --no-preserve=ownership "${src}/"{bin,data,extensions,lib,temp,web} "${pkgdir}/usr/share/${_pkgname}/"
+
+ # Install docs.
+ install -Dm644 "${src}/COPYING" "${pkgdir}/usr/share/doc/${_pkgname}/COPYING"
+
+ # Copy the configuration files to /etc/sonarqube.
+ install -Dm644 "${src}/conf/sonar.properties" "${pkgdir}/etc/${_pkgname}/sonar.properties"
+ install -Dm644 "${src}/conf/wrapper.conf" "${pkgdir}/etc/${_pkgname}/wrapper.conf"
+
+ # Copy the service file to /usr/lib/systemd/system/sonarqube.service.
+ install -Dm644 ../${_pkgname}.service "${pkgdir}/usr/lib/systemd/system/${_pkgname}.service"
+ # 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.
+ 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
+
+ # Copy the tmpfiles configuration to /usr/lib/tmpfiles.d/sonarqube.conf.
+ install -Dm644 ../${_pkgname}.tmpfiles "${pkgdir}/usr/lib/tmpfiles.d/${_pkgname}.conf"
+
+ # Log directory.
+ install -dm755 "${pkgdir}/var/log/${_pkgname}"
- install -Dm644 sonarqube.service "${pkgdir}/usr/lib/systemd/system/sonarqube.service"
-
- cd sonarqube-${pkgver}
- install -d "${pkgdir}/opt/sonarqube"
- cp -r * "${pkgdir}/opt/sonarqube/"
- mkdir "${pkgdir}/opt/sonarqube/run"
+ # Runtime directory and lockfile.
+ install -dm755 "${pkgdir}/run/${_pkgname}"
+ touch "${pkgdir}/run/${_pkgname}/SonarQube.pid"
+
+ # 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"
+
}
+
diff --git a/sonar.sh.patch b/sonar.sh.patch
deleted file mode 100644
index 04f443e3c675..000000000000
--- a/sonar.sh.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- sonar.sh 2015-02-26 21:29:16.000000000 +0100
-+++ sonar.sh.new 2015-07-03 14:32:42.594080161 +0200
-@@ -30,7 +30,7 @@
- PRIORITY=
-
- # Location of the pid file.
--PIDDIR="."
-+PIDDIR="../../run"
-
- # 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-lts.install b/sonarqube-lts.install
index cb2e4447eaac..f37ad85dccd6 100644
--- a/sonarqube-lts.install
+++ b/sonarqube-lts.install
@@ -1,12 +1,13 @@
-pre_install() {
- getent group sonarqube > /dev/null || groupadd -g 123 sonarqube 1>/dev/null
- getent passwd sonarqube > /dev/null || useradd -u 123 -d /opt/sonarqube -g sonarqube -s /bin/false sonarqube 1>/dev/null
-}
+#!/usr/bin/env sh
+# vim:set ts=4 sw=4 et:
post_install() {
- chown -R sonarqube:sonarqube /opt/sonarqube/{logs,run,temp,data,extensions,web}
+ local username="sonarqube"
+ if ! getent passwd "$username" &>/dev/null; then
+ groupadd -g 123 "$username"
+ useradd -c 'User to manage the SonarQube code analysis platform' -u 123 -g "$username" -d "/var/lib/$username" -s /bin/false "$username"
+ passwd -l "$username" &>/dev/null
+ fi
+ chown -R "$username:$username" /etc/sonarqube /run/sonarqube /usr/share/sonarqube /var/log/sonarqube
}
-post_upgrade() {
- post_install
-}
diff --git a/sonarqube.service b/sonarqube.service
index 42a1d3b159b0..556ceaf6ef6b 100644
--- a/sonarqube.service
+++ b/sonarqube.service
@@ -1,13 +1,20 @@
[Unit]
-Description=An open platform to manage code quality
+Description=An open source platform for continuous inspection of code quality
+Documentation=http://www.sonarqube.org
+Wants=network.target
After=network.target
[Service]
+Type=forking
User=sonarqube
Group=sonarqube
-PIDFile=/opt/sonarqube/run/SonarQube.pid
-ExecStart=/opt/sonarqube/bin/ARCH/sonar.sh start
-ExecStop=/opt/sonarqube/bin/ARCH/sonar.sh stop
+StandardOutput=syslog
+StandardError=syslog
+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/sonarqube.tmpfiles b/sonarqube.tmpfiles
new file mode 100644
index 000000000000..a79c2e48ecc3
--- /dev/null
+++ b/sonarqube.tmpfiles
@@ -0,0 +1,2 @@
+d /run/sonarqube 0755 sonarqube sonarqube - -
+f /run/sonarqube/SonarQube.pid 0644 sonarqube sonarqube - -