From 50da1beac18895c493f44554b475aa00942cf631 Mon Sep 17 00:00:00 2001 From: Kevin Paulus Date: Sun, 7 Dec 2014 00:32:51 +0700 Subject: [PATCH] network/valknut: Added patch. Signed-off-by: Willy Sudiarto Raharjo --- network/valknut/dcoptions.patch | 55 +++++++++++++++++++ network/valknut/doinst.sh | 1 - .../{valknut-0.4.9.patch => main.patch} | 0 network/valknut/valknut.SlackBuild | 12 ++-- 4 files changed, 63 insertions(+), 5 deletions(-) create mode 100644 network/valknut/dcoptions.patch rename network/valknut/{valknut-0.4.9.patch => main.patch} (100%) diff --git a/network/valknut/dcoptions.patch b/network/valknut/dcoptions.patch new file mode 100644 index 0000000000..1d218cc2ed --- /dev/null +++ b/network/valknut/dcoptions.patch @@ -0,0 +1,55 @@ +--- valknut/dcoptions.cpp.orig 2014-12-02 20:28:59.039798842 +0100 ++++ valknut/dcoptions.cpp 2014-12-02 22:25:06.352312671 +0100 +@@ -808,15 +808,18 @@ + { + PushButton_GETINTERNETIP->setEnabled(false); + +- QHttpRequestHeader header( "GET", "/ip.php" ); +- header.setValue( "Host", "wxdcgui.sourceforge.net" ); ++ //QHttpRequestHeader header( "GET", "/ip.php" ); ++ QHttpRequestHeader header( "GET", "/" ); ++ //header.setValue( "Host", "wxdcgui.sourceforge.net" ); ++ header.setValue( "Host", "www.myip.se" ); + QString useragent = QString("Valknut/") + PACKAGE_VERSION; + //printf("User-Agent=%s\n", useragent.toAscii().constData()); + header.setValue( "User-Agent", useragent ); + + m_pHttp = new QHttp(); + connect( m_pHttp, SIGNAL(done(bool)), this, SLOT(slotGotInternetIP(bool)) ); +- m_pHttp->setHost( "wxdcgui.sourceforge.net" ); ++ //m_pHttp->setHost( "wxdcgui.sourceforge.net" ); ++ m_pHttp->setHost( "www.myip.se" ); + m_pHttp->request( header ); + } + +@@ -834,20 +837,25 @@ + else + { + QString html = QString(m_pHttp->readAll()); +- int start = html.indexOf("<ip>"); +- int end = html.indexOf("</ip>",start); +- ++ ++ int start = html.indexOf(""); ++ // We need the 2nd "bold" () attribute ++ start = html.indexOf("",start+3); ++ int end = html.indexOf("",start); ++ + if ( ( start == -1 ) || ( end < start ) ) + { + QMessageBox::warning( + this, + tr("Get Internet IP"), +- tr("Unexpected response from ") + "http://wxdcgui.sourceforge.net" ++ tr("Unexpected response from ") + "http://www.myip.se" ++ // tr("Unexpected response from ") + "http://wxdcgui.sourceforge.net" + ); + } + else + { +- start += 10; ++ //start += 10; // wxgui.sourceforge.net ++ start += 21; // www.myip.se + QString ip = html.mid( start, end - start ); + + if ( QHostAddress().setAddress(ip) ) diff --git a/network/valknut/doinst.sh b/network/valknut/doinst.sh index 4e8ba7071d..5fb28930db 100644 --- a/network/valknut/doinst.sh +++ b/network/valknut/doinst.sh @@ -1,4 +1,3 @@ if [ -x /usr/bin/update-desktop-database ]; then /usr/bin/update-desktop-database -q usr/share/applications >/dev/null 2>&1 fi - diff --git a/network/valknut/valknut-0.4.9.patch b/network/valknut/main.patch similarity index 100% rename from network/valknut/valknut-0.4.9.patch rename to network/valknut/main.patch diff --git a/network/valknut/valknut.SlackBuild b/network/valknut/valknut.SlackBuild index 5f586c448e..e9a39d993e 100644 --- a/network/valknut/valknut.SlackBuild +++ b/network/valknut/valknut.SlackBuild @@ -24,7 +24,7 @@ PRGNAM=valknut VERSION=${VERSION:-0.4.9} -BUILD=${BUILD:-1} +BUILD=${BUILD:-2} TAG=${TAG:-_SBo} if [ -z "$ARCH" ]; then @@ -69,7 +69,11 @@ find -L . \ \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; -patch -p0 < "$CWD"/valknut-0.4.9.patch valknut/main.cpp +# Main patch +patch -p0 < "$CWD"/main.patch valknut/main.cpp + +# Dcoptions (myip) patch +patch -p0 < "$CWD"/dcoptions.patch valknut/dcoptions.cpp CFLAGS="$SLKCFLAGS" \ ./configure \ @@ -89,14 +93,14 @@ find $PKG/usr/man -type f -exec gzip -9 {} \; for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION -cp -a AUTHORS COPYING* ChangeLog INSTALL NEWS README TODO "$PKG"/usr/doc/$PRGNAM-$VERSION +cp -a AUTHORS COPYING* ChangeLog INSTALL NEWS README TODO $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 -# Remove misplaced file - this one is already available in usr/doc/$PRGNAM-$VERSION rm $PKG/usr/share/valknut/COPYING cd $PKG