--- /dev/null
+# Maintainer: Thomas Mudrunka <harvie@@email..cz>
+# Contributor: Thomas Mudrunka <harvie@@email..cz>
+# 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}
+}
--- /dev/null
+[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
--- /dev/null
+#!/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;