From a91dd0a552eb9bdda4d17508485f0a51e39406a9 Mon Sep 17 00:00:00 2001 From: "Markus M. May" Date: Tue, 17 Nov 2009 23:38:26 +0100 Subject: [PATCH] Cleanup Nexus --- nexus/PKGBUILD | 141 ++++++++++++++++++++++-------------------------- nexus/nexus | 50 ----------------- nexus/nexus.install | 23 +------- nexus/plexus.properties | 17 ++++++ 4 files changed, 81 insertions(+), 150 deletions(-) rewrite nexus/PKGBUILD (66%) delete mode 100755 nexus/nexus create mode 100644 nexus/plexus.properties diff --git a/nexus/PKGBUILD b/nexus/PKGBUILD dissimilarity index 66% index 2d7f9ba..5273d13 100644 --- a/nexus/PKGBUILD +++ b/nexus/PKGBUILD @@ -1,78 +1,63 @@ -#Contributor: Markus M. May -pkgname=nexus -pkgver=1.4.0 -pkgrel=1 -pkgdesc="A Maven Repository Manager." -url="http://nexus.sonatype.org" -arch=('i686' 'x86_64') -license=('GPL3') -depends=('java-environment') -optdepends=('apache: a full featured webserver' - 'maven: a java project management and project comprehension tool') - -install=nexus.install -conflicts=('java-nexus') -provides=('java-nexus' 'nexus') -options=(!strip !docs) - -source=(http://nexus.sonatype.org/downloads/nexus-webapp-${pkgver}-bundle.tar.gz - 'nexus.sh' - 'wrapper.conf' - 'nexus') - -md5sums=('a6926740cd54fff66bd24db6b23ff63f' - '09355624885f13411b906ceeefcc2c84' - 'cf73635687f9252cf851a3a2d62513d1' - 'ea96c854c4486b5aa9114c93314488ab') - -build() { - cd ${srcdir} - - # Create directory and copy everything - install -d $pkgdir/opt/$pkgname - - mv $srcdir/$pkgname-webapp-$pkgver $srcdir/$pkgname-$pkgver - - # deleting unnecessary files before copying them - if [ $CARCH = 'x86_64' ]; then - mv $srcdir/$pkgname-${pkgver}/bin/jsw/linux-x86-64 $pkgdir/opt/$pkgname/bin || return 1 - rm -r $srcdir/$pkgname-${pkgver}/bin || return 1 - elif [ $CARCH} = 'i686' ]; then - mv $srcdir/$pkname-${pkgver}/bin/jsw/linux-x86-32 $pkgdir/opt/$pkgname/bin || return 1 - rm -r $srcdir/$pkname-${pkgver}/bin - fi - - # copy example configuration and documentation - mkdir -p $pkgdir/usr/share/doc/$pkgname/conf - mv $srcdir/$pkgname-$pkgver/conf/examples $pkgdir/usr/share/doc/$pkgname/conf/examples - install $srcdir/$pkgname-$pkgver/LICENSE.txt $pkgdir/usr/share/doc/$pkgname - rm $srcdir/$pkgname-$pkgver/LICENSE.txt - install $srcdir/$pkgname-$pkgver/NOTICE.txt $pkgdir/usr/share/doc/$pkgname - rm $srcdir/$pkgname-$pkgver/NOTICE.txt - - # install the additional config files to the desired destination - mkdir -p $pkgdir/etc/$pkgname || return 1 -### - install $srcdir/$pkgname-${pkgver}/conf/plexus.properties $pkgdir/etc/$pkgname/plexus.properties - install $srcdir/$pkgname-${pkgver}/conf/plexus.xml $pkgdir/etc/$pkgname/plexus.xml - install $srcdir/$pkgname-${pkgver}/conf/classworlds.conf $pkgdir/etc/$pkgname/classworlds.conf - install $srcdir/wrapper.conf $pkgdir/etc/$pkgname || return 1 - rm -r $srcdir/$pkgname-$pkgver/conf - - # install startup script - mkdir -p $pkgdir/etc/rc.d - install $srcdir/$pkgname $pkgdir/etc/rc.d/$pkgname - - # delete not needed directories - rm -r $srcdir/$pkgname-$pkgver/logs - - # copy the source to the final directory - cp -a $srcdir/$pkgname-${pkgver}/* $pkgdir/opt/$pkgname || return 1 - - mkdir -p $pkgdir/etc/rc.d || return 1 - install $srcdir/$pkgname.sh $pkgdir/opt/$pkgname/bin || return 1 - - mkdir -p $pkgdir/var/log/$pkgname/ - touch $pkgdir/var/log/$pkgname/wrapper.log - -} +#Contributor: Markus M. May +pkgname=nexus +pkgver=1.4.0 +pkgrel=1 +pkgdesc="A Maven Repository Manager." +url="http://nexus.sonatype.org" +arch=('i686' 'x86_64') +license=('GPL3') +depends=('java-environment') +optdepends=('apache: a full featured webserver' + 'maven: a java project management and project comprehension tool') + +install=nexus.install +conflicts=('java-nexus') +provides=('java-nexus' 'nexus') +options=(!strip !docs) + +source=(http://nexus.sonatype.org/downloads/nexus-webapp-${pkgver}-bundle.tar.gz + 'nexus.sh' + 'wrapper.conf' + 'plexus.properties') + +md5sums=('a6926740cd54fff66bd24db6b23ff63f' + '09355624885f13411b906ceeefcc2c84' + 'cf73635687f9252cf851a3a2d62513d1' + 'bb6a45b862eeaf26c8da2df3d1ce0e5f') + +build() { + cd ${srcdir} + + # Create directory + install -d $pkgdir/opt/nexus + + # deleting unnecessary files before copying them + if [ $CARCH = 'x86_64' ]; then + mv $srcdir/$pkgname-webapp-${pkgver}/bin/jsw/linux-x86-64 $pkgdir/opt/$pkgname/bin || return 1 + rm -r $srcdir/$pkgname-webapp-${pkgver}/bin || return 1 + elif [ $CARCH} = 'i686' ]; then + mv $srcdir/$pkgname-webapp-${pkgver}/bin/jsw/linux-x86-32 $pkgdir/opt/$pkgname/bin || return 1 + rm -r $srcdir/nexus-webapp-${pkgver}/bin || return 1 + fi + + # move documentation to the right location + mkdir -p $pkgdir/usr/share/doc/$pkgname + install $srcdir/$pkgname-webapp-$pkgver/*.txt $pkgdir/usr/share/doc/nexus + rm $srcdir/$pkgname-webapp-$pkgver/*.txt + + mkdir -p $pkgdir/opt/$pkgname/conf + install $srcdir/$pkgname.sh $pkgdir/opt/$pkgname/bin/$pkgname.sh + install $srcdir/wrapper.conf $pkgdir/opt/$pkgname/conf/wrapper.conf + install $srcdir/plexus.properties $pkgdir/opt/$pkgname/conf/plexus.properties + + # temporary, please remove later + rm $pkgdir/opt/$pkgname/bin/$pkgname + rm $srcdir/$pkgname-webapp-$pkgver/conf/wrapper.conf + rm $srcdir/$pkgname-webapp-$pkgver/conf/plexus.properties + + mkdir -p $pkgdir/var/lib/nexus + + # copy the source to the final directory + cp -a $srcdir/nexus-webapp-${pkgver}/* $pkgdir/opt/nexus || return 1 + +} diff --git a/nexus/nexus b/nexus/nexus deleted file mode 100755 index 98c3a9c..0000000 --- a/nexus/nexus +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/bash - -# general config -. /etc/rc.conf -. /etc/rc.d/functions - -# environment variables for the use with sonar -PID_DIR=/var/run/nexus -HOME_DIR=/opt/nexus -BIN_DIR=$HOME_DIR/bin -ETC_DIR=/etc/nexus - - - -case "$1" in - start) - stat_busy "Starting Nexus Repository Manager" - - if [ ! -x $PID_DIR ] ; then - install -m755 -g nexus -o nexus -d $PID_DIR - fi - - su -c "$BIN_DIR/nexus.sh start" nexus - if [ $? -gt 0 ]; then - stat_fail - else - stat_done - fi - ;; - stop) - stat_busy "Stopping Nexus Repository Manager" - - [ -f $PID_DIR/nexus.pid ] && su -c "$BIN_DIR/nexus.sh stop" nexus 2>&1 - if [ $? -gt 0 ]; then - stat_fail - else - rm -r $PID_DIR - stat_done - fi - ;; - restart) - $0 stop - sleep 1 - $0 start - ;; - *) - echo "usage: $0 {start|stop|restart}" - ;; -esac -exit 0 diff --git a/nexus/nexus.install b/nexus/nexus.install index 94a3354..c9a4fc0 100644 --- a/nexus/nexus.install +++ b/nexus/nexus.install @@ -9,23 +9,8 @@ pre_install() { # arg 1: the new package version post_install() { - echo ">>> Creating user and group and setting permissions..." - getent group nexus > /dev/null || usr/sbin/groupadd nexus - getent passwd nexus > /dev/null || usr/sbin/useradd -c \ - 'Nexus Repository Manager' -g nexus -d '/opt/nexus' \ - --system -s /bin/bash nexus &> /dev/null - - cd opt/nexus - - chown -R nexus:nexus * - chown -R root:sonar /var/log/nexus - chmod -R 775 /var/log/nexus cat << EOF >>> ->>> This package is part of the ArchLinux Development Stack, vist ->>> http://openpario.mime.oregonstate.edu:3000/projects/archdevstack for ->>> more information. ->>> >>> Nexus can now be started via /opt/nexus/bin/nexus. >>> To run nexus as a service, please link the above mentioned script into the >>> /etc/rc.d directory. @@ -54,12 +39,6 @@ pre_remove() { # arg 1: the old package version post_remove() { - getent passwd nexus > /dev/null || usr/sbin/userdel nexus &>/dev/null - getent group nexus > /dev/null || usr/sbin/groupdel nexus &>/dev/null - - if [ -x /var/run/nexus ] ; then - rm -r /var/run/nexus - fi - + /bin/true } diff --git a/nexus/plexus.properties b/nexus/plexus.properties new file mode 100644 index 0000000..0efa14f --- /dev/null +++ b/nexus/plexus.properties @@ -0,0 +1,17 @@ +application-port=8081 +application-host=0.0.0.0 +runtime=${basedir}/runtime +apps=${runtime}/apps +nexus-work=/var/lib/nexus +nexus-app=${runtime}/apps/nexus +webapp=${runtime}/apps/nexus/webapp +webapp-context-path=/nexus +security-xml-file=${nexus-work}/conf/security.xml +application-conf=${nexus-work}/conf + +# If this file is present, it will be used to configure Jetty. +jetty.xml=${basedir}/conf/jetty.xml + +# Uncomment this to use the debug js files +#index.template.file=templates/index-debug.vm + -- 2.11.4.GIT