development/nexus: Rearrange and OCDize some build lines

Functionally, this *should* be identical to the previous
version.  Aesthetically, it's better, but of course, that's
just this guy's opinion, and we know how that goes... :-)

Signed-off-by: Robby Workman <rworkman@slackbuilds.org>
This commit is contained in:
Robby Workman 2013-07-05 01:59:59 -05:00 committed by Niels Horn
parent d09870e2e2
commit 341756a6b8

View file

@ -79,49 +79,50 @@ find . \
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
-exec chmod 644 {} \;
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
mkdir -p $PKG/var/{lib,log,run,tmp}/$PRGNAM
mkdir -p $PKG/etc/rc.d
mkdir -p $PKG/etc/$PRGNAM
mkdir -p $PKG/usr/share/$PRGNAM/bin/jsw/lib
mv *.txt $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
mv lib $PKG/usr/share/$PRGNAM
mv $PRGNAM $PKG/usr/share/$PRGNAM/
mv conf/* $PKG/etc/$PRGNAM
mv bin/$PRGNAM $PKG/usr/share/$PRGNAM/bin
mv bin/jsw/conf/* $PKG/etc/$PRGNAM
mv bin/jsw/license $PKG/usr/share/$PRGNAM/bin/jsw
mv bin/jsw/lib/*.jar $PKG/usr/share/$PRGNAM/bin/jsw/lib
mv bin/jsw/lib/libwrapper-$NEXUS_ARCH.so $PKG/usr/share/$PRGNAM/bin/jsw/lib
mv bin/jsw/$NEXUS_ARCH $PKG/usr/share/$PRGNAM/bin/jsw
cd $PKG/usr/share/$PRGNAM
ln -sf ../../../etc/$PRGNAM conf
ln -sf ../../../var/tmp/$PRGNAM tmp
ln -sf ../../../var/log/$PRGNAM logs
cd -
cd $PKG/usr/share/$PRGNAM/bin/jsw
ln -sf ../../../../../etc/$PRGNAM conf
cd -
mkdir -p $PKG/etc/$PRGNAM
mv conf/* $PKG/etc/$PRGNAM
mv bin/jsw/conf/* $PKG/etc/$PRGNAM
mkdir -p $PKG/var/{lib,log,run,tmp}/$PRGNAM
ln -sf /etc/$PRGNAM $PKG/usr/share/$PRGNAM/conf
ln -sf /etc/$PRGNAM $PKG/usr/share/$PRGNAM/bin/jsw/conf
ln -sf /var/tmp/$PRGNAM $PKG/usr/share/$PRGNAM/tmp
ln -sf /var/log/$PRGNAM $PKG/usr/share/$PRGNAM/logs
mkdir -p $PKG/etc/rc.d
mv bin/$PRGNAM $PKG/etc/rc.d/rc.$PRGNAM.new
# Rename to rc.nexus
mv $PKG/usr/share/$PRGNAM/bin/$PRGNAM $PKG/etc/rc.d/rc.$PRGNAM.new
# Fix configuration files
sed -i "s:NEXUS_HOME=\"..\":NEXUS_HOME=\"/usr/share/$PRGNAM\":g" $PKG/etc/rc.d/rc.$PRGNAM.new
sed -i "s:#RUN_AS_USER=:RUN_AS_USER=nexus:g" $PKG/etc/rc.d/rc.$PRGNAM.new
sed -i "s:#PIDDIR=\".\":PIDDIR=\"/var/run/$PRGNAM\":g" $PKG/etc/rc.d/rc.$PRGNAM.new
sed -i "s:DIST_ARCH=\`uname -p:DIST_ARCH=\`uname -m:g" $PKG/etc/rc.d/rc.$PRGNAM.new
sed -i "s:nexus-work=\${bundleBasedir}/../sonatype-work/nexus:nexus-work=/var/lib/$PRGNAM:g" $PKG/etc/$PRGNAM/$PRGNAM.properties
sed -i "s:wrapper.working.dir=../../..:wrapper.working.dir=/usr/share/$PRGNAM:g" $PKG/etc/$PRGNAM/wrapper.conf
sed -i "s:wrapper.java.command=java:wrapper.java.command=/usr/lib$LIBDIRSUFFIX/java/bin/java:g" $PKG/etc/$PRGNAM/wrapper.conf
mv $PKG/etc/$PRGNAM/$PRGNAM.properties $PKG/etc/$PRGNAM/$PRGNAM.properties.new
mv $PKG/etc/$PRGNAM/wrapper.conf $PKG/etc/$PRGNAM/wrapper.conf.new
sed -i $PKG/etc/rc.d/rc.$PRGNAM.new \
-e "s:NEXUS_HOME=\"..\":NEXUS_HOME=\"/usr/share/$PRGNAM\":g" \
-e "s:#RUN_AS_USER=:RUN_AS_USER=nexus:g" \
-e "s:#PIDDIR=\".\":PIDDIR=\"/var/run/$PRGNAM\":g" \
-e "s:DIST_ARCH=\`uname -p:DIST_ARCH=\`uname -m:g"
sed -i \
"s:nexus-work=\${bundleBasedir}/../sonatype-work/nexus:nexus-work=/var/lib/$PRGNAM:g" \
$PKG/etc/$PRGNAM/$PRGNAM.properties
sed -i $PKG/etc/$PRGNAM/wrapper.conf \
-e "s:wrapper.working.dir=../../..:wrapper.working.dir=/usr/share/$PRGNAM:g" \
-e "s:wrapper.java.command=java:wrapper.java.command=/usr/lib$LIBDIRSUFFIX/java/bin/java:g"
#Fix ownership of some dirs
mv $PKG/etc/$PRGNAM/$PRGNAM.properties{,.new}
mv $PKG/etc/$PRGNAM/wrapper.conf{,.new}
# Fix ownership of some dirs
chown -R nexus:nexus $PKG/var/{lib,log,run,tmp}/$PRGNAM
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
mv *.txt $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cat $CWD/doinst.sh > $PKG/install/doinst.sh