diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2013-06-07 06:35:13 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2013-06-07 06:37:20 +0000 |
commit | 8ed8b68db8951bb319d136b679bd214139db2523 (patch) | |
tree | 95b8bc30b6cb4bb5ae5ea700beb7d7bed91e295b /testing/quassel | |
parent | 5464baf2f95c314d2f37acd78aa3fdbf126992d4 (diff) | |
download | aports-8ed8b68db8951bb319d136b679bd214139db2523.tar.bz2 aports-8ed8b68db8951bb319d136b679bd214139db2523.tar.xz |
testing/quassel: misc fixes
- use tabs as indent (for consistency with other apkbuilds)
- build -common and -client subpackage
- build mono
- use init.d script from gentoo
- use /sbin/nologin as shell instead of /bin/false
Diffstat (limited to 'testing/quassel')
-rw-r--r-- | testing/quassel/APKBUILD | 96 | ||||
-rw-r--r-- | testing/quassel/quassel-core.defaultd | 10 | ||||
-rw-r--r-- | testing/quassel/quassel-core.initd | 42 | ||||
-rw-r--r-- | testing/quassel/quassel-core.pre-install | 2 | ||||
-rw-r--r-- | testing/quassel/quasselcore.confd | 22 | ||||
-rw-r--r-- | testing/quassel/quasselcore.initd | 63 |
6 files changed, 143 insertions, 92 deletions
diff --git a/testing/quassel/APKBUILD b/testing/quassel/APKBUILD index 349b26929c..5e41d94f40 100644 --- a/testing/quassel/APKBUILD +++ b/testing/quassel/APKBUILD @@ -7,57 +7,75 @@ url="http://www.quassel-irc.org/" pkgdesc="Distributed IRC client - metapackage" arch="all" license="GPL" -makedepends="qt-dev cmake" -subpackages="$pkgname-core" +install="quassel-core.pre-install" +depends="quassel-common" +makedepends="qt-dev cmake dbus-dev openssl-dev" +subpackages="$pkgname-common $pkgname-core $pkgname-client" source="http://www.quassel-irc.org/pub/quassel-$pkgver.tar.bz2 - $pkgname-core.defaultd - $pkgname-core.initd" + quasselcore.confd + quasselcore.initd" build() { - cd "$srcdir" - mkdir core + cd "$srcdir" + mkdir build - cd core - cmake \ - -DCMAKE_INSTALL_PREFIX=/usr/ \ - -DWITH_KDE=0 \ - -DCMAKE_BUILD_TYPE="Release" \ - -DWITH_OPENSSL=ON \ - -DWANT_CORE=ON \ - -DWANT_MONO=OFF \ - -DWANT_QTCLIENT=OFF \ - -DWITH_DBUS=OFF \ - -DWITH_OXYGEN=OFF \ - -DWITH_PHONON=OFF \ - -DWITH_WEBKIT=OFF \ - -DCMAKE_BUILD_TYPE="Release" \ - ../quassel-$pkgver/ || return 1 + cd build + cmake \ + -DCMAKE_INSTALL_PREFIX=/usr/ \ + -DWITH_KDE=0 \ + -DCMAKE_BUILD_TYPE="Release" \ + -DWITH_OPENSSL=ON \ + -DWANT_CORE=ON \ + -DWANT_MONO=ON \ + -DWANT_QTCLIENT=ON \ + -DWITH_DBUS=OFF \ + -DWITH_OXYGEN=OFF \ + -DWITH_PHONON=OFF \ + -DWITH_WEBKIT=OFF \ + ../quassel-$pkgver/ || return 1 + make } package() { - mkdir -p "$pkgdir" && return 0 + cd "$srcdir"/build + make DESTDIR="$pkgdir" install/fast } -core() { - pkgdesc="Core component of distributed IRC client" - install="quassel-core.pre-install" - - cd "$srcdir"/core - make DESTDIR="$subpkgdir" install - rm -r "$subpkgdir"/usr/share +common() { + pkgdesc="Quassel common/shared files" + mkdir -p "$subpkgdir"/usr/share/ + mv "$pkgdir"/usr/share/apps \ + "$pkgdir"/usr/share/icons \ + "$subpkgdir"/usr/share +} - install -Dm0644 "$srcdir"/$subpkgname.defaultd \ - "$subpkgdir"/etc/conf.d/quassel-core || return 1 - install -Dm0755 ${srcdir}/$subpkgname.initd \ - "$subpkgdir"/etc/init.d/quassel-core || return 1 +core() { + pkgdesc="Core component of distributed IRC client" + depends="$pkgname-common" + mkdir -p "$subpkgdir"/usr/bin + mv "$pkgdir"/usr/bin/quasselcore "$subpkgdir"/usr/bin/ || return 1 + install -Dm0644 "$srcdir"/quasselcore.confd \ + "$subpkgdir"/etc/conf.d/quasselcore || return 1 + install -Dm0755 ${srcdir}/quasselcore.initd \ + "$subpkgdir"/etc/init.d/quasselcore || return 1 } +client() { + pkgdesc="Quassel client" + depends="$pkgname-common" + mkdir -p "$subpkgdir"/usr/bin \ + "$subpkgdir"/usr/share/ + mv "$pkgdir"/usr/bin/quasselclient "$subpkgdir"/usr/bin/ || return 1 + mv "$pkgdir"/usr/share/pixmaps \ + "$pkgdir"/usr/share/applications \ + "$subpkgdir"/usr/share/ +} md5sums="29b843f18d703abfadb8fc729ca1df11 quassel-0.9.0.tar.bz2 -560e396db1e85d641c15eb6b15cbae74 quassel-core.defaultd -5d4d6dee89961fb2108727b56b8bf75d quassel-core.initd" +b196216514a44fd596a664a53e05d93e quasselcore.confd +92fb2f2f7a8658e52640d7ae6c709698 quasselcore.initd" sha256sums="2e3fe06ae3731c829aa3c2f6bb5320619bad264c831f322985c3aa3fe58b6027 quassel-0.9.0.tar.bz2 -9e916cefd6a1be7218249410490ce07c8a98ba8f96b2c3c16b3ee3f1222dbd51 quassel-core.defaultd -6ad0a474f3978980a3337e6b523b88c6dd81850b6b7f0538cbe86d36345f1605 quassel-core.initd" +16cfaf919268ee3c3281fc4ad0dfc128b1c98f5edfc5cc522addd512f36d293c quasselcore.confd +af041a6c800ffb443d008b861c639bf32580b3655f7db3bc00db833374af6b2e quasselcore.initd" sha512sums="5f0b54c7c0e839d30ec5cc1c76f115f60aef35c53b2ed1cc69cb856413e0b381bfa3b56d6a9b60d8a118d216930adb52856d39b1bbd4c96e8c0f3809756f6f21 quassel-0.9.0.tar.bz2 -6f8120cf08b676a896a63e370d9c0e16db72cf2a9b1a8db52f5ce3b983ce38a7d157d6346282158fd0d440048aad00bb3c57d6b5c81a0ab5a92918b11d15aa6d quassel-core.defaultd -f761d881973af0151b4e39419b972d8e9c5e9f43d3ae52d64fefc1fd631c397fee5a929b7d559705d2fbf53bd2adff943451d8402059e3ac6893b3b9fe72d979 quassel-core.initd" +e03df342f47945f948106883a7757262ab7a8a7d21f0b4dd01cfcc95e836c2e00f2e0177a353b4f7a4b6f80ffa970be06d49aa9a42cad1f3834382267e5a0d7f quasselcore.confd +0405af90fe65589e163d6b2470ea4d4d3b8dad49ee3b89caba9bcffd7186bd92f204da4f8404e5ed489a949fc89b898f0b94c94c8382f90f89ccda5e2b8e2382 quasselcore.initd" diff --git a/testing/quassel/quassel-core.defaultd b/testing/quassel/quassel-core.defaultd deleted file mode 100644 index 7835da37c4..0000000000 --- a/testing/quassel/quassel-core.defaultd +++ /dev/null @@ -1,10 +0,0 @@ -# Quasselcore default configuration - -QUASSEL_CORE_PORT='4242' - -QUASSEL_CORE_LOG_FILE=/var/log/quassel/quasselcore.log -QUASSEL_CORE_LOG_LEVEL='info' - -QUASSEL_CORE_DATADIR=/usr/local/quasselcore - -QUASSEL_CORE_DAEMON_OPTS='' diff --git a/testing/quassel/quassel-core.initd b/testing/quassel/quassel-core.initd deleted file mode 100644 index b866600816..0000000000 --- a/testing/quassel/quassel-core.initd +++ /dev/null @@ -1,42 +0,0 @@ -#!/sbin/runscript -# quasselcore init.d file for alpine linux. - -QUASSEL_CONFIG=/etc/config.d/quassel-core -DAEMON=/usr/bin/quassel-core -ACCOUNT=quassel -PID=/var/run/quassel-core.pid - -# Load defaults -. /etc/default.d/quassel-core - -# Load specific configuration -if [ -e ${QUASSEL_CONFIG} ] ; then - . ${QUASSEL_CONFIG} -fi - -depend() { - need net - after firewall -} - -start() { - ebegin "Starting quasselcore" - start-stop-daemon --start \ - --pidfile ${PID} \ - --make-pidfile \ - --background \ - --user ${ACCOUNT} \ - --exec ${DAEMON} -- \ - --logfile=${QUASSEL_CORE_LOG_FILE} \ - --loglevel=${QUASSEL_CORE_LOG_LEVEL} \ - --configdir=${QUASSEL_CORE_DATADIR} \ - --port=${QUASSEL_CORE_PORT} \ - ${QUASSEL_CORE_DAEMON_OPTS} - eend $? -} - -stop() { - ebegin "Stopping quasselcore" - start-stop-daemon --stop --pidfile ${PID} - eend $? -} diff --git a/testing/quassel/quassel-core.pre-install b/testing/quassel/quassel-core.pre-install index 6d63d02d58..15864e5428 100644 --- a/testing/quassel/quassel-core.pre-install +++ b/testing/quassel/quassel-core.pre-install @@ -1,5 +1,5 @@ #!/bin/sh -adduser -S -h /usr/lib/quassel -s /bin/false -D quassel 2>/dev/null +adduser -S -h /var/lib/quassel -s /sbin/nologin -D quassel 2>/dev/null exit 0 diff --git a/testing/quassel/quasselcore.confd b/testing/quassel/quasselcore.confd new file mode 100644 index 0000000000..c687337775 --- /dev/null +++ b/testing/quassel/quasselcore.confd @@ -0,0 +1,22 @@ +# Copyright 1999-2010 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-irc/quassel/files/quasselcore.conf,v 1.5 2010/11/04 14:22:44 scarabeus Exp $ + +# Loglevel Debug|Info|Warning|Error. Default is: Info +# The logfile is located at /var/log/quassel.log. +#LOGLEVEL="Info" + +# The address(es) quasselcore will listen on. Default is 0.0.0.0 +#LISTEN="0.0.0.0" + +# The port quasselcore will listen at. Default is: 4242 +#PORT="4242" + +# User we want our daemon to run under. +#USER="quassel" + +# Directory we store all quasselcore content. +#CONFIGDIR="/var/lib/quassel" + +# File quasselcore will log all its events into. +#LOGFILE="/var/log/quassel.log"
\ No newline at end of file diff --git a/testing/quassel/quasselcore.initd b/testing/quassel/quasselcore.initd new file mode 100644 index 0000000000..58aedfa536 --- /dev/null +++ b/testing/quassel/quasselcore.initd @@ -0,0 +1,63 @@ +#!/sbin/runscript +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-irc/quassel/files/quasselcore.init,v 1.8 2011/08/19 11:43:49 scarabeus Exp $ + +depend() { + need localmount net + after bootmisc postgres +} + +CORE="$(which quasselcore)" +PID="/var/run/quassel.pid" +LOGFILE=${LOGFILE:-"/var/log/quassel.log"} +CONFIGDIR=${CONFIGDIR:-"/var/lib/quassel"} +QUASSEL_USER=${QUASSEL_USER:-"quassel"} + +checkconfig() { + # set defaults + LOGLEVEL=${LOGLEVEL:-"Info"} + + # check config folder + if [ ! -d "${CONFIGDIR}" ]; then + mkdir "${CONFIGDIR}" || return 1 + fi + # permissions always changed just to avoid runtime issues + chown -R "${QUASSEL_USER}":"${QUASSEL_USER}" "${CONFIGDIR}" || return 1 + + # check log file + if [ ! -e "${LOGFILE}" ]; then + touch "${LOGFILE}" || return 1 + fi + # permissions always changed just to avoid runtime issues + chown "${QUASSEL_USER}":"${QUASSEL_USER}" "${LOGFILE}" || return 1 +} + +start() { + checkconfig || return 1 + + ebegin "Starting Quassel Core" + + if [ -n "${RC_UNAME}" ]; then + # running on baselayout-2/openrc + start-stop-daemon --start --user "${QUASSEL_USER}" --background --make-pidfile \ + --pidfile "${PID}" \ + --exec "${CORE}" -- --logfile="${LOGFILE}" --loglevel="${LOGLEVEL}" \ + ${LISTEN:+--listen="${LISTEN}"} ${PORT:+--port="${PORT}"} \ + --configdir="${CONFIGDIR}" + else + # running on baselayout-1 + start-stop-daemon --start --chuid "${QUASSEL_USER}" --background --make-pidfile \ + --pidfile "${PID}" --env HOME="${CONFIGDIR}" \ + --exec "${CORE}" -- --logfile="${LOGFILE}" --loglevel="${LOGLEVEL}" \ + ${LISTEN:+--listen="${LISTEN}"} ${PORT:+--port="${PORT}"} \ + --configdir="${CONFIGDIR}" + fi + eend $? +} + +stop() { + ebegin "Stopping Quassel Core" + start-stop-daemon --stop --pidfile "${PID}" --exec "${CORE}" + eend $? +} |