diff options
Diffstat (limited to 'network')
-rw-r--r-- | network/ptokax/README | 2 | ||||
-rw-r--r-- | network/ptokax/doinst.sh | 32 | ||||
-rw-r--r-- | network/ptokax/ptokax.SlackBuild | 85 | ||||
-rw-r--r-- | network/ptokax/ptokax.info | 10 | ||||
-rw-r--r-- | network/ptokax/rc.ptokax | 41 | ||||
-rw-r--r-- | network/ptokax/slack-desc | 19 |
6 files changed, 189 insertions, 0 deletions
diff --git a/network/ptokax/README b/network/ptokax/README new file mode 100644 index 0000000000..6718457c8e --- /dev/null +++ b/network/ptokax/README @@ -0,0 +1,2 @@ +PtokaX Direct Connect Hub is a multi-platform server application +for Neo-Modus Direct Connect Peer-To-Peer sharing network. diff --git a/network/ptokax/doinst.sh b/network/ptokax/doinst.sh new file mode 100644 index 0000000000..aa9f0c920d --- /dev/null +++ b/network/ptokax/doinst.sh @@ -0,0 +1,32 @@ +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 +} + +preserve_perms etc/rc.d/rc.ptokax.new +config etc/ptokax/cfg/BanList.xml.new +config etc/ptokax/cfg/Motd.txt.new +config etc/ptokax/cfg/Profiles.xml.new +config etc/ptokax/cfg/RegisteredUsers.xml.new +config etc/ptokax/cfg/ReservedNicks.xml.new +config etc/ptokax/cfg/Scripts.xml.new +config etc/ptokax/cfg/Settings.xml.new diff --git a/network/ptokax/ptokax.SlackBuild b/network/ptokax/ptokax.SlackBuild new file mode 100644 index 0000000000..7739204390 --- /dev/null +++ b/network/ptokax/ptokax.SlackBuild @@ -0,0 +1,85 @@ +#!/bin/sh + +# Slackware build script for ptokax + +# +# Script created by mara <mara@fail.pp.ua> +# + +PRGNAM=ptokax +VERSION=${VERSION:-0.5.0.1} +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} + +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) ARCH=i486 ;; + arm*) ARCH=arm ;; + *) ARCH=$( uname -m ) ;; + esac +fi + +CWD=$(pwd) +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +if [ "$ARCH" = "i486" ]; then + SLKCFLAGS="-O2 -march=i486 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" +else + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" +fi + +set -e + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf PtokaX +tar xvf $CWD/$VERSION-nix-src.tgz +cd PtokaX +chown -R root:root . +find -L . \ + \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ + -o -perm 511 \) -exec chmod 755 {} \; -o \ + \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ + -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; + +sed -i 's/-llua5.1/-llua/' makefile +CFLAGS="$SLKCFLAGS" \ +CXXFLAGS="$SLKCFLAGS" \ +cd skein/ +make +cd ../tinyxml/ +make +cd ../ +make PtokaX + +for f in cfg.example/*;do + install -Dm644 $f $PKG/etc/ptokax/cfg/$(echo $f | cut -d "/" -f2).new +done + +find language/* -exec install -Dm644 {} $PKG/etc/ptokax/{} \; +install -Dm755 PtokaX $PKG/usr/bin/$PRGNAM +install -Dm755 $CWD/rc.ptokax $PKG/etc/rc.d/rc.ptokax.new + +find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \ + | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true + +mkdir -p $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 + +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz} diff --git a/network/ptokax/ptokax.info b/network/ptokax/ptokax.info new file mode 100644 index 0000000000..bd3ca3d019 --- /dev/null +++ b/network/ptokax/ptokax.info @@ -0,0 +1,10 @@ +PRGNAM="ptokax" +VERSION="0.5.0.1" +HOMEPAGE="http://www.ptokax.org/" +DOWNLOAD="http://www.ptokax.org/files/0.5.0.1-nix-src.tgz" +MD5SUM="911b97d0c696b82a75786fd8be96a626" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +REQUIRES="lua" +MAINTAINER="mara" +EMAIL="mara@fail.pp.ua" diff --git a/network/ptokax/rc.ptokax b/network/ptokax/rc.ptokax new file mode 100644 index 0000000000..8fd308095b --- /dev/null +++ b/network/ptokax/rc.ptokax @@ -0,0 +1,41 @@ +#!/bin/bash + +NAME=ptokax +PREFIX=/usr +DAEMON=$PREFIX/bin/${NAME} +CONFIG=/etc/${NAME}/ + +start() { + pid=$(pidof -o %PPID $NAME) + if [[ -z $pid ]]; then + echo "Start services: $NAME" + $DAEMON -d -c $CONFIG 2>&1 >> /dev/null + else + echo "Services $NAME already running." + fi +} + +stop() { + echo "Stop services: $NAME." + killall -9 $NAME 2> /dev/null +} + +restart() { + stop + sleep 2 + start +} + +case $1 in +'start') + start + ;; +'stop') + stop + ;; +'restart') + restart + ;; +*) + echo "Usage $0 {start|stop|restart}" +esac diff --git a/network/ptokax/slack-desc b/network/ptokax/slack-desc new file mode 100644 index 0000000000..753d49f875 --- /dev/null +++ b/network/ptokax/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. +# Line up the first '|' above the ':' following the base package name, and +# the '|' on the right side marks the last column you can put a character in. +# You must make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':' except on otherwise blank lines. + + |-----handy-ruler------------------------------------------------------| +PtokaX: PtokaX (Direct Connect Peer-To-Peer sharing network) +PtokaX: +PtokaX: PtokaX Direct Connect Hub is a multi-platform server application +PtokaX: for Neo-Modus Direct Connect Peer-To-Peer sharing network. +PtokaX: +PtokaX: +PtokaX: +PtokaX: +PtokaX: +PtokaX: Home page http://www.ptokax.org +PtokaX: |