mirror of
https://github.com/Ponce/slackbuilds
synced 2024-11-16 19:50:19 +01:00
network/ptokax: Added (Direct Connect Peer-To-Peer sharing network).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
This commit is contained in:
parent
d8f613f9da
commit
3af05a73db
6 changed files with 189 additions and 0 deletions
2
network/ptokax/README
Normal file
2
network/ptokax/README
Normal file
|
@ -0,0 +1,2 @@
|
|||
PtokaX Direct Connect Hub is a multi-platform server application
|
||||
for Neo-Modus Direct Connect Peer-To-Peer sharing network.
|
32
network/ptokax/doinst.sh
Normal file
32
network/ptokax/doinst.sh
Normal file
|
@ -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
|
85
network/ptokax/ptokax.SlackBuild
Normal file
85
network/ptokax/ptokax.SlackBuild
Normal file
|
@ -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}
|
10
network/ptokax/ptokax.info
Normal file
10
network/ptokax/ptokax.info
Normal file
|
@ -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"
|
41
network/ptokax/rc.ptokax
Normal file
41
network/ptokax/rc.ptokax
Normal file
|
@ -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
|
19
network/ptokax/slack-desc
Normal file
19
network/ptokax/slack-desc
Normal file
|
@ -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:
|
Loading…
Reference in a new issue