From 5635c60b897c4bedbc79b22648ee9e8377c76d3d Mon Sep 17 00:00:00 2001 From: Matteo Bernardini Date: Mon, 17 Sep 2012 00:05:58 +0200 Subject: network/tntnet: Updated for version 2.1, various cleanups. Signed-off-by: Matteo Bernardini --- network/tntnet/doinst.sh | 27 +++++++++++++++++++++++++++ network/tntnet/tntnet.SlackBuild | 10 ++++++++-- network/tntnet/tntnet.info | 4 ++-- 3 files changed, 37 insertions(+), 4 deletions(-) create mode 100644 network/tntnet/doinst.sh (limited to 'network/tntnet') diff --git a/network/tntnet/doinst.sh b/network/tntnet/doinst.sh new file mode 100644 index 0000000000..6a3d11314c --- /dev/null +++ b/network/tntnet/doinst.sh @@ -0,0 +1,27 @@ +config() { + NEW="$1" + OLD="$(dirname $NEW)/$(basename $NEW .new)" + # If there's no config file by that name, mv it over: + if [ ! -r $OLD ]; then + mv $NEW $OLD + elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then + # toss the redundant copy + rm $NEW + fi + # Otherwise, we leave the .new copy for the admin to consider... +} + +preserve_perms() { + NEW="$1" + OLD="$(dirname $NEW)/$(basename $NEW .new)" + if [ -e $OLD ]; then + cp -a $OLD ${NEW}.incoming + cat $NEW > ${NEW}.incoming + mv ${NEW}.incoming $NEW + fi + config $NEW +} + +config etc/tntnet/mime.conf.new +config etc/tntnet/tntnet.conf.new +preserve_perms etc/rc.d/rc.tntnet.new diff --git a/network/tntnet/tntnet.SlackBuild b/network/tntnet/tntnet.SlackBuild index d4c1c84929..467f0d8beb 100644 --- a/network/tntnet/tntnet.SlackBuild +++ b/network/tntnet/tntnet.SlackBuild @@ -22,7 +22,7 @@ # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. PRGNAM=tntnet -VERSION=${VERSION:-2.0} +VERSION=${VERSION:-2.1} BUILD=${BUILD:-1} TAG=${TAG:-_SBo} @@ -58,7 +58,7 @@ set -e rm -rf $PKG mkdir -p $TMP $PKG $OUTPUT cd $TMP -#rm -rf $PRGNAM-$VERSION +rm -rf $PRGNAM-$VERSION tar xvf $CWD/$PRGNAM-$VERSION.tar.gz cd $PRGNAM-$VERSION chown -R root:root . @@ -85,6 +85,12 @@ CXXFLAGS="$SLKCFLAGS" \ make make install DESTDIR=$PKG +mv $PKG/etc/$PRGNAM/mime.conf{,.new} +mv $PKG/etc/$PRGNAM/$PRGNAM.conf{,.new} +sed -i "s|www-data|apache|" $PKG/etc/$PRGNAM/$PRGNAM.conf.new +install -m 0755 -D $PKG/etc/init.d/$PRGNAM $PKG/etc/rc.d/rc.$PRGNAM.new +rm -fr $PKG/etc/init.d + find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \ | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true diff --git a/network/tntnet/tntnet.info b/network/tntnet/tntnet.info index d531830847..febaa934c4 100644 --- a/network/tntnet/tntnet.info +++ b/network/tntnet/tntnet.info @@ -1,7 +1,7 @@ PRGNAM="tntnet" -VERSION="2.0" +VERSION="2.1" HOMEPAGE="http://www.tntnet.org/" -DOWNLOAD="http://www.tntnet.org/download/tntnet-2.0.tar.gz" +DOWNLOAD="http://www.tntnet.org/download/tntnet-2.1.tar.gz" MD5SUM="8f7185eeed23e7ae6a9be314e2fc0d36" DOWNLOAD_x86_64="" MD5SUM_x86_64="" -- cgit v1.2.3