From e96e0fec4420ecc96e92d26479c671bcc2667e3b Mon Sep 17 00:00:00 2001 From: Harvie Date: Sun, 11 Jul 2010 16:33:19 +0200 Subject: [PATCH] added gtk-gnutella-upnp --- bash/gtk-gnutella-upnp/PKGBUILD | 23 +++++++++++++++++++ .../gtk-gnutella-upnp.desktop | 13 +++++++++++ bash/gtk-gnutella-upnp/gtk-gnutella-upnp.sh | 11 +++++++++ 3 files changed, 47 insertions(+) create mode 100644 bash/gtk-gnutella-upnp/PKGBUILD create mode 100644 bash/gtk-gnutella-upnp/gtk-gnutella-upnp.desktop create mode 100755 bash/gtk-gnutella-upnp/gtk-gnutella-upnp.sh diff --git a/bash/gtk-gnutella-upnp/PKGBUILD b/bash/gtk-gnutella-upnp/PKGBUILD new file mode 100644 index 0000000..a298cbd --- /dev/null +++ b/bash/gtk-gnutella-upnp/PKGBUILD @@ -0,0 +1,23 @@ +# Maintainer: Thomas Mudrunka +# Contributor: Thomas Mudrunka +# You can also contact me on http://blog.harvie.cz/ + +pkgname=gtk-gnutella-upnp +pkgver=1.0 +pkgrel=1 +pkgdesc="Small wrapper to automatically enable upnp port-forwarding for gtk-gnutella (doesn't work with port randomizing)" +arch=('any') +license=('GPL') +url="http://gtk-gnutella.sourceforge.net/" +depends=(gtk-gnutella miniupnpc) +source=("gtk-gnutella-upnp.sh" "gtk-gnutella-upnp.desktop") +md5sums=('943e64632715b699b23c149787ead1a3' + 'a80c6de2b89bd3f2d13dca3869c81c27') + +build() { + mkdir -p ${pkgdir}/usr/bin + cp ${srcdir}/gtk-gnutella-upnp.sh ${pkgdir}/usr/bin/gtk-gnutella-upnp + mkdir -p ${pkgdir}/usr/share/applications + cp ${srcdir}/gtk-gnutella-upnp.desktop ${pkgdir}/usr/share/applications/ + chmod -R 755 ${pkgdir} +} diff --git a/bash/gtk-gnutella-upnp/gtk-gnutella-upnp.desktop b/bash/gtk-gnutella-upnp/gtk-gnutella-upnp.desktop new file mode 100644 index 0000000..d23565f --- /dev/null +++ b/bash/gtk-gnutella-upnp/gtk-gnutella-upnp.desktop @@ -0,0 +1,13 @@ +[Desktop Entry] +Version=1.0 +Encoding=UTF-8 +Name=gtk-gnutella-upnp +Comment=A GUI based Gnutella Servent (with UPnP) +GenericName=P2P Client (with UPnP) +TryExec=gtk-gnutella-upnp +Exec=gtk-gnutella-upnp +StartupNotify=false +Terminal=false +Type=Application +Categories=GTK;Application;Network;FileTransfer;P2P; +Icon=gtk-gnutella.png diff --git a/bash/gtk-gnutella-upnp/gtk-gnutella-upnp.sh b/bash/gtk-gnutella-upnp/gtk-gnutella-upnp.sh new file mode 100755 index 0000000..d3e8347 --- /dev/null +++ b/bash/gtk-gnutella-upnp/gtk-gnutella-upnp.sh @@ -0,0 +1,11 @@ +#!/bin/bash +upnpc="$(which upnpc)"; +gnet_port="$(grep listen_port ~/.gtk-gnutella/config_gnet | grep -o [0-9]* | head -n 1)"; +test "$gnet_port" -gt 1 || upnpc=true; +"$upnpc" -r "$gnet_port" TCP "$gnet_port" TCP; +"$upnpc" -r "$gnet_port" UDP "$gnet_port" UDP; +echo -e '\n======================= GTK-GNUTELLA =======================\n' +echo "listen_port=$gnet_port" +gtk-gnutella $@; +echo -e '\n===================== GTK-GNUTELLA-END =====================\n' +"$upnpc" -d "$gnet_port" TCP "$gnet_port" UDP; -- 2.30.2