You are not logged in.

#1 2008-11-25 13:06:14

Tristero
Member
From: Germany
Registered: 2008-01-16
Posts: 33

Working on PKGBUILD for retroshare 0.4.09b

Hello Archers!

I am working on a PKGBUILD for the current stable release (0.4.09b) of RetroShare on i686:
http://retroshare.sourceforge.net/index.html

There is an older PKGBUILD for an earlier version in the AUR that is flagged as orphaned:
http://aur.archlinux.org/packages.php?ID=13161

The current stable release of the sources did not compile out of the box on my machine so I spent
some time analyzing the errors and created a patch. (I wonder if it compiles anywhere out of the
box because there are a lot of #include's seem to be missing in several files and in one place in the
code there is a scope that contains two parameters with identical names. Has anyone found out
more about this strange state?)

The package compiles and the software seems to work. So far for the good news. ;-) I would
like to release this PKGBUILD in the AUR but before I would appreciate some Archers to have a look on
it to be sure that it don't mess things up on other systems than mine. Thanks in advance!

How can I provide the PKGBUILD and additional files here?

Last edited by Tristero (2008-11-25 13:07:09)


You might very well think that, I couldn't possibly comment.

Offline

#2 2008-11-25 13:19:05

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: Working on PKGBUILD for retroshare 0.4.09b

Post them in code tags.

Offline

#3 2008-11-25 13:30:10

Tristero
Member
From: Germany
Registered: 2008-01-16
Posts: 33

Re: Working on PKGBUILD for retroshare 0.4.09b

PKGBUILD for RetroShare v0.4.09b

# contributor: tristero

pkgname=retroshare
pkgver=0.4.09b
pkgrel=1

pkgdesc="Retroshare is an encrypted IM with filesharing, mediaplayer, email, chatgroups and some games."
url="http://retroshare.sourceforge.net"

license="LGPL"
arch=('i686')
install=retroshare.install

depends=('qt4')
source=(http://downloads.sourceforge.net/${pkgname}/${pkgname}-pkg-linux-src-v${pkgver}.tgz \
        ${pkgname}-v${pkgver}-linux-compile.patch \
        ${pkgname}.v${pkgver}.desktop \
        ${pkgname}.install)

md5sums=('dd58f3af95534c4cc21df43ab79b5efa' \
         '6780a91c2cf567ee432de4576619e61c' \
         'ad6911b62eb3a552c0b1ff3055957315' \
         '93adeecd6d274cb93783bdfaf89ebc36' )

# file and directory names
_binaryName=Retroshare-v${pkgver}
_binDir=${pkgdir}/usr/bin/
_libDir=${pkgdir}/usr/lib/retroshare
_iconDir=${pkgdir}/usr/share/pixmaps
_desktopDir=${pkgdir}/usr/share/applications

# package versions
RETROSHARE="v${pkgver}"

OPENSSL="openssl-0.9.7g-xpgp-0.1c"
MINIUPNPC="miniupnpc-1.0"
QCHECKERS="qcheckers-svn14"
SMPLAYER="smplayer-svn-280308"

# directories used in the pkgbuild
RS_SRC_DIR="${srcdir}/${pkgname}-package-${RETROSHARE}"
RS_COMMON_DIR="${RS_SRC_DIR}/src/${pkgname}-${RETROSHARE}"
RS_CORE_DIR="${RS_SRC_DIR}/src/${pkgname}-${RETROSHARE}/libretroshare/src"
RS_GUI_DIR="${RS_SRC_DIR}/src/${pkgname}-${RETROSHARE}/retroshare-gui/src"

OPENSSL_DIR="${RS_SRC_DIR}/src/${OPENSSL}"
MINIUPNPC_DIR="${RS_SRC_DIR}/src/${MINIUPNPC}"
QCHECKERS_DIR="${RS_SRC_DIR}/src/${QCHECKERS}"
SMPLAYER_DIR="${RS_SRC_DIR}/src/smplayer"


build() {


        # --- prepare for compilation ---

        [ "$QTDIR" = "" ] && source /etc/profile.d/qt4.sh


        # --- unpack all tars ---

        mkdir -p "${RS_SRC_DIR}/src"
        cd "${RS_SRC_DIR}/src"

        echo "Unpacking openssl"
        tar xfz ../tar/${OPENSSL}.tgz || exit 1

        echo "Unpacking miniupnpc"
        tar xfz ../tar/${MINIUPNPC}-RSa.tar.gz || exit 1

        echo "Unpacking qcheckers"
        tar xfz ../tar/${QCHECKERS}.tgz || exit 1

        echo "Unpacking smplayer"
        tar xfz ../tar/${SMPLAYER}.tgz || exit 1

        echo "Unpacking retroshare"
        tar xfz ../tar/${pkgname}-${RETROSHARE}-src.tgz || exit 1


        # --- patch sources ---

        echo "Patching openssl"
        ##
        cd ${OPENSSL_DIR}
        ##
        ## NOTE: This PKGBUILD is only for arch i686! Therefore it is
        ## assumed that the arcitecture is i686, but for some reasons
        ## Configure may have selected unusual compiler flags.
        ##
        ## adjust make-configurations "linux-pentium" and "linux-ppro" for arch i686
        sed -i "s|-mcpu=pentium\(pro\)\?|-march=i686 -mtune=generic -pipe|" Configure || exit 1
        ## adjust make-configuration "linux-elf" for arch i686
        sed -i "s|-m486|-march=i686 -mtune=generic -pipe|" Configure || exit 1
        ## adjust make-configuration "linux-k6" for arch i686
        sed -i "s|-mcpu=k6|-pipe -march=i386 -mtune=k6|" Configure || exit 1


        echo "Patching miniupnpc"
        ##
        cd ${MINIUPNPC_DIR}
        ## adjust make-configuration for arch i686
        sed -i "s|CFLAGS = -fPIC -O -Wall -DNDEBUG|& -march=i686 -mtune=generic|" ${MINIUPNPC_DIR}/Makefile || exit 1


        echo "Patching retroshare"
        ##
        cd ${RS_CORE_DIR}
        ## adjust make-configuration for arch i686
        sed -i "s|-Wall -g|${CFLAGS} -Wall|" make.opt || exit 1
        sed -i "s|-Wall -g|${CFLAGS} -Wall|" scripts/config-linux.mk || exit 1
        #sed -i "s|-O3 -fomit-frame-pointer -m486|${CFLAGS}|" scripts/config-linux.mk || exit 1
        sed -i "s|-m486|-march=i686 -mtune=generic -pipe|" scripts/config-linux.mk || exit 1
        ## correct compilation errors under linux in 0.4.09b
        cd ${RS_COMMON_DIR}
        patch -p0 < ${startdir}/retroshare-v0.4.09b-linux-compile.patch


        # --- compile sources ---

        mkdir -p "${RS_SRC_DIR}/lib"


        # - openssl

        echo "Compiling openssl"
        cd ${OPENSSL_DIR}

        ./config || exit 1
        make depend || exit 1
        make || exit 1
        cp libcrypto.a libssl.a "${RS_SRC_DIR}/lib" || exit 1


        # - miniupnpc

        echo "Compiling miniupnpc"
        cd ${MINIUPNPC_DIR}

        make || exit 1
        rm libminiupnpc.so || exit 1
        cp libminiupnpc.a "${RS_SRC_DIR}/lib" || exit 1


        # - qcheckers

        echo "Compiling qcheckers"
        cd ${QCHECKERS_DIR}

        /usr/bin/qmake || exit 1
        make || exit 1
        cp src/libqcheckers.a "${RS_SRC_DIR}/lib" || exit 1


        # - smplayer

        echo "Compiling smplayer"
        cd ${SMPLAYER_DIR}

        /usr/bin/qmake || exit 1
        make || exit 1
        cp lib/libsmplayer.a "${RS_SRC_DIR}/lib" || exit 1


        # - retroshare

        echo "Compiling retroshare"
        cd ${RS_CORE_DIR}

        ## One could also use a simple
        ##make || exit 1
        ## but that would run all tests.

        make -C util librs || exit 1
        make -C tcponudp librs || exit 1
        make -C serialiser librs || exit 1
        make -C pqi librs || exit 1
        make -C dbase librs || exit 1
        make -C services librs || exit 1
        make -C dht librs || exit 1
        make -C upnp librs || exit 1
        make -C server librs || exit 1
        make -C rsserver librs || exit 1

        cp lib/libretroshare.a "${RS_SRC_DIR}/lib" || exit 1
        ##cp rsiface/retroshare-nogui "${RS_SRC_DIR}/bin" || exit 1

        # - retroshare gui

        echo "Compiling retroshare gui"
        cd ${RS_GUI_DIR}

        /usr/bin/qmake RetroShare.pro || exit 1
        sed -i "s:-L/usr/lib -L../../../../lib:-L../../../../lib -L/usr/lib:" Makefile || exit 1
        make || exit 1

        ##cp RetroShare "${RS_SRC_DIR}/bin/RetroShare-${RETROSHARE}" || exit 1


        # --- install files ---

        cd "${RS_SRC_DIR}"

        # - libs
        #
        # openssl
        install -D -m 644 lib/libcrypto.a "${_libDir}/libcrypto.a"
        install -D -m 644 lib/libssl.a "${_libDir}/libssl.a"
        # miniupnpc
        install -D -m 644 lib/libminiupnpc.a "${_libDir}/libminiupnpc.a"
        # qcheckers
        install -D -m 644 lib/libqcheckers.a "${_libDir}/libqcheckers.a"
        # smplayer
        install -D -m 644 lib/libsmplayer.a "${_libDir}/libsmplayer.a"
        # retroshare
        install -D -m 644 lib/libretroshare.a "${_libDir}/libretroshare.a"

        # - binaries
        install -D -m 755 ${RS_GUI_DIR}/RetroShare ${_binDir}/${_binaryName}
        install -D -m 755 ${RS_CORE_DIR}/rsiface/retroshare-nogui ${_binDir}
        cd ${_binDir}
        ln -s ${_binaryName} ${pkgname}

        # - icons
        install -D -m 644 ${RS_GUI_DIR}/gui/images/retrosharelogo1.png ${_iconDir}/retroshare_blue.png
        install -D -m 644 ${RS_GUI_DIR}/gui/images/retrosharelogo2.png ${_iconDir}/retroshare.png

        # - desktop file
        install -D -m 644 ${srcdir}/${pkgname}.${RETROSHARE}.desktop ${_desktopDir}/retroshare.desktop
}

Last edited by Tristero (2008-11-25 13:35:22)


You might very well think that, I couldn't possibly comment.

Offline

#4 2008-11-25 13:36:40

Tristero
Member
From: Germany
Registered: 2008-01-16
Posts: 33

Re: Working on PKGBUILD for retroshare 0.4.09b

retroshare-v0.4.09b-linux-compile.patch

diff -Naur ./libretroshare/src/dbase/findex.cc ../../../../retroshare-v0.4.09b/libretroshare/src/dbase/findex.cc
--- ./libretroshare/src/dbase/findex.cc    2008-07-10 19:53:43.000000000 +0200
+++ ../../../../retroshare-v0.4.09b/libretroshare/src/dbase/findex.cc    2008-11-25 02:34:12.000000000 +0100
@@ -30,6 +30,8 @@
 #include <sstream>
 #include <iomanip>
 #include <fstream>
+#include <stdlib.h>
+#include <algorithm>
 
 #include <openssl/sha.h>
 
diff -Naur ./libretroshare/src/dbase/rsexpr.cc ../../../../retroshare-v0.4.09b/libretroshare/src/dbase/rsexpr.cc
--- ./libretroshare/src/dbase/rsexpr.cc    2008-07-10 19:53:07.000000000 +0200
+++ ../../../../retroshare-v0.4.09b/libretroshare/src/dbase/rsexpr.cc    2008-11-25 02:34:12.000000000 +0100
@@ -27,6 +27,7 @@
 #include "dbase/findex.h"
 #include "rsiface/rsexpr.h"
 #include <functional>
+#include <algorithm>
 
 
 /******************************************************************************************
diff -Naur ./libretroshare/src/pqi/pqinetwork.h ../../../../retroshare-v0.4.09b/libretroshare/src/pqi/pqinetwork.h
--- ./libretroshare/src/pqi/pqinetwork.h    2008-07-10 19:53:04.000000000 +0200
+++ ../../../../retroshare-v0.4.09b/libretroshare/src/pqi/pqinetwork.h    2008-11-25 02:34:12.000000000 +0100
@@ -105,7 +105,7 @@
 
 std::string socket_errorType(int err);
 int sockaddr_cmp(struct sockaddr_in &addr1, struct sockaddr_in &addr2 );
-int inaddr_cmp(struct sockaddr_in addr1, struct sockaddr_in addr1 );
+int inaddr_cmp(struct sockaddr_in addr1, struct sockaddr_in addr2 );
 int inaddr_cmp(struct sockaddr_in addr1, unsigned long);
 
 struct in_addr getPreferredInterface(); // returns best addr.
diff -Naur ./libretroshare/src/pqi/pqisecurity.cc ../../../../retroshare-v0.4.09b/libretroshare/src/pqi/pqisecurity.cc
--- ./libretroshare/src/pqi/pqisecurity.cc    2008-07-10 19:53:04.000000000 +0200
+++ ../../../../retroshare-v0.4.09b/libretroshare/src/pqi/pqisecurity.cc    2008-11-25 02:34:12.000000000 +0100
@@ -27,6 +27,7 @@
 
 
 #include "pqi/pqisecurity.h"
+#include <stdlib.h>
 
 
 // Can keep the structure hidden....
diff -Naur ./libretroshare/src/tcponudp/tcpstream.cc ../../../../retroshare-v0.4.09b/libretroshare/src/tcponudp/tcpstream.cc
--- ./libretroshare/src/tcponudp/tcpstream.cc    2008-07-10 19:53:43.000000000 +0200
+++ ../../../../retroshare-v0.4.09b/libretroshare/src/tcponudp/tcpstream.cc    2008-11-25 02:34:12.000000000 +0100
@@ -32,6 +32,7 @@
 #include <assert.h>
 #include <errno.h>
 #include <math.h>
+#include <limits.h>
 
 #include <sys/time.h>
 #include <time.h>
diff -Naur ./retroshare-gui/src/gui/BlogDialog.cpp ../../../../retroshare-v0.4.09b/retroshare-gui/src/gui/BlogDialog.cpp
--- ./retroshare-gui/src/gui/BlogDialog.cpp    2008-07-10 19:53:42.000000000 +0200
+++ ../../../../retroshare-v0.4.09b/retroshare-gui/src/gui/BlogDialog.cpp    2008-11-25 02:34:23.000000000 +0100
@@ -26,6 +26,7 @@
 #include "rsiface/rspeers.h" //to retrieve peer/usrId info
 
 #include "profile/ProfileView.h"
+#include <algorithm>
 
 /** Constructor */
 BlogDialog::BlogDialog(QWidget *parent)
diff -Naur ./retroshare-gui/src/gui/ForumsDialog.cpp ../../../../retroshare-v0.4.09b/retroshare-gui/src/gui/ForumsDialog.cpp
--- ./retroshare-gui/src/gui/ForumsDialog.cpp    2008-07-10 19:53:42.000000000 +0200
+++ ../../../../retroshare-v0.4.09b/retroshare-gui/src/gui/ForumsDialog.cpp    2008-11-25 02:34:23.000000000 +0100
@@ -41,6 +41,7 @@
 #include <QDateTime>
 #include <QHeaderView>
 #include <QTimer>
+#include <algorithm>
 
 /* Images for context menu icons */
 #define IMAGE_MESSAGE        ":/images/folder-draft.png"
diff -Naur ./retroshare-gui/src/gui/NetworkView.cpp ../../../../retroshare-v0.4.09b/retroshare-gui/src/gui/NetworkView.cpp
--- ./retroshare-gui/src/gui/NetworkView.cpp    2008-07-10 19:52:47.000000000 +0200
+++ ../../../../retroshare-v0.4.09b/retroshare-gui/src/gui/NetworkView.cpp    2008-11-25 02:34:23.000000000 +0100
@@ -28,6 +28,7 @@
 #include <QGraphicsItem>
 
 #include <iostream>
+#include <algorithm>
 
 /** Constructor */
 NetworkView::NetworkView(QWidget *parent)
diff -Naur ./retroshare-gui/src/gui/TransfersDialog.cpp ../../../../retroshare-v0.4.09b/retroshare-gui/src/gui/TransfersDialog.cpp
--- ./retroshare-gui/src/gui/TransfersDialog.cpp    2008-07-10 19:53:42.000000000 +0200
+++ ../../../../retroshare-v0.4.09b/retroshare-gui/src/gui/TransfersDialog.cpp    2008-11-25 02:34:23.000000000 +0100
@@ -37,6 +37,7 @@
 

 #include <sstream>

 #include "rsiface/rsiface.h"

+#include <algorithm>

 

 /* Images for context menu icons */

 #define IMAGE_INFO                 ":/images/fileinfo.png"

diff -Naur ./retroshare-gui/src/rsiface/RemoteDirModel.cpp ../../../../retroshare-v0.4.09b/retroshare-gui/src/rsiface/RemoteDirModel.cpp
--- ./retroshare-gui/src/rsiface/RemoteDirModel.cpp    2008-07-10 19:53:42.000000000 +0200
+++ ../../../../retroshare-v0.4.09b/retroshare-gui/src/rsiface/RemoteDirModel.cpp    2008-11-25 02:34:23.000000000 +0100
@@ -7,6 +7,7 @@
 #include <iostream>
 #include <sstream>
 #include <math.h>
+#include <algorithm>
 
 
  bool RemoteDirModel::hasChildren(const QModelIndex &parent) const
diff -Naur ./retroshare-gui/src/util/MouseEventFilter.cpp ../../../../retroshare-v0.4.09b/retroshare-gui/src/util/MouseEventFilter.cpp
--- ./retroshare-gui/src/util/MouseEventFilter.cpp    2008-07-10 19:53:02.000000000 +0200
+++ ../../../../retroshare-v0.4.09b/retroshare-gui/src/util/MouseEventFilter.cpp    2008-11-25 02:34:23.000000000 +0100
@@ -25,6 +25,7 @@
 #include <QtGui/QMouseEvent>
 
 #include <exception>
+#include <typeinfo>
 
 MouseMoveEventFilter::MouseMoveEventFilter(QObject * receiver, const char * member)
     : EventFilter(receiver, member) {

You might very well think that, I couldn't possibly comment.

Offline

#5 2008-11-25 13:39:44

Tristero
Member
From: Germany
Registered: 2008-01-16
Posts: 33

Re: Working on PKGBUILD for retroshare 0.4.09b

retroshare.install

post_install() {
  cat << EOF


ATTENTION retroshare:
----------------------

==> You have to logout once before starting retroshare.


EOF
update-desktop-database
}

post_upgrade() {
  post_install $1
}

op=$1
shift

$op $*

retroshare.v0.4.09b.desktop

[Desktop Entry]
Encoding=UTF-8
Exec=/usr/bin/retroshare
Icon=/usr/share/pixmaps/retroshare.png
Type=Application
Terminal=false
MultipleArgs=false
Name=Retroshare
GenericName=Sharing Network
StartupNotify=true
Categories=Application;Network;

Last edited by Tristero (2008-11-25 13:43:18)


You might very well think that, I couldn't possibly comment.

Offline

#6 2008-11-25 13:49:26

Tristero
Member
From: Germany
Registered: 2008-01-16
Posts: 33

Re: Working on PKGBUILD for retroshare 0.4.09b

These are the four files I can provide for now. If you have any suggestions, improvements, problems etc., I would be thankful for your posting here.

Last edited by Tristero (2008-11-25 13:49:37)


You might very well think that, I couldn't possibly comment.

Offline

#7 2008-11-25 15:53:54

Daenyth
Forum Fellow
From: Boston, MA
Registered: 2008-02-24
Posts: 1,244

Re: Working on PKGBUILD for retroshare 0.4.09b

the "op= " bit in .install isn't needed any more. Don't use it.
In the PKGBUILD, license is an array, not a string.

Try using the namcap tool also.

Offline

#8 2008-11-25 17:09:51

Tristero
Member
From: Germany
Registered: 2008-01-16
Posts: 33

Re: Working on PKGBUILD for retroshare 0.4.09b

Thanks for many good advices so far!

Some of the improvements I could implement immediately, the other will take time. Thanks also for pointing the Arch Packaging Guidelines out to me. Here is a new "release" of the four files where most of the obvious defects where corrected.

I see two possible improvements:

1) Making the build run on x86_64. Unfortunately I cannot test it.

2) RetroShare is packaged with the versions of openssl, miniupnpc, qcheckers and smplayer that are also compiled in this PKGBUILD. Of course, this is not nice. It seems, RetroShare cannot be compiled without qcheckers, so they may remain in the same package, but miniupnpc should reside in an own package which retroshare depends on. RetroShare should be patched or configured to use the Arch default openssl and smplayer packages. I will try to implement this when I have more time.

Any tipps or help will be appreciated!


PKGBUILD for RetroShare v0.4.09b
(Note: the file to be uploaded to AUR will of course contain a Contributor-line. I don't want to post my E-Mail therefore I left the line out.)

pkgname=retroshare
pkgver=0.4.09b
pkgrel=1
pkgdesc="Encrypted IM with filesharing, email, chatgroups, mediaplayer and some games"
url="http://retroshare.sourceforge.net/"
arch=('i686')
license=('LGPL')
depends=('qt4')
install=retroshare.install
source=(http://downloads.sourceforge.net/${pkgname}/${pkgname}-pkg-linux-src-v${pkgver}.tgz \
        ${pkgname}-v${pkgver}-linux-compile.patch \
        ${pkgname}.v${pkgver}.desktop \
        ${pkgname}.install)
md5sums=('dd58f3af95534c4cc21df43ab79b5efa'
         '6780a91c2cf567ee432de4576619e61c'
         '5869b7c86654ef90f5ed30f25dd5c419'
         'f10ea62753d6931b9546b6264d47d2c1')


# --- Directories And Versions

# File And Directory Names
_binDir=${pkgdir}/usr/bin/
_libDir=${pkgdir}/usr/lib/retroshare
_iconDir=${pkgdir}/usr/share/pixmaps
_desktopDir=${pkgdir}/usr/share/applications

# Package Versions
_openssl="openssl-0.9.7g-xpgp-0.1c"
_miniupnpc="miniupnpc-1.0"
_qcheckers="qcheckers-svn14"
_smplayer="smplayer-svn-280308"

# Directories Used In The PKGBUILD
_rs_top_dir="${srcdir}/${pkgname}-package-v${pkgver}"
_rs_libsrc_dir="${_rs_top_dir}/src/${pkgname}-v${pkgver}/libretroshare/src"
_rs_guisrc_dir="${_rs_top_dir}/src/${pkgname}-v${pkgver}/retroshare-gui/src"


build() {


  # --- Prepare For Compilation ---

  [ "$QTDIR" = "" ] && source /etc/profile.d/qt4.sh


  # --- Unpack All Tars ---

  install -d "${_rs_top_dir}/src"
  cd "${_rs_top_dir}/src"

  echo "Unpacking openssl"
  tar xfz ../tar/${_openssl}.tgz || return 1

  echo "Unpacking miniupnpc"
  tar xfz ../tar/${_miniupnpc}-RSa.tar.gz || return 1

  echo "Unpacking qcheckers"
  tar xfz ../tar/${_qcheckers}.tgz || return 1

  echo "Unpacking smplayer"
  tar xfz ../tar/${_smplayer}.tgz || return 1

  echo "Unpacking retroshare"
  tar xfz ../tar/${pkgname}-v${pkgver}-src.tgz || return 1


  # --- Patch Sources ---

  echo "Patching openssl"
  ##
  cd ${_rs_top_dir}/src/${_openssl}
  ##
  ## NOTE: This PKGBUILD Is Only For Arch i686! Therefore It Is
  ## Assumed That The Arcitecture Is i686, But For Some Reasons
  ## The Configure-Script May Have Selected Unusual Compiler Flags.
  ##
  ## Adjust Make-Configurations "linux-pentium" And "linux-ppro" For Arch i686
  sed -i "s|-mcpu=pentium\(pro\)\?|-march=i686 -mtune=generic -pipe|" Configure || return 1
  ## Adjust Make-Configuration "linux-elf" For Arch i686
  sed -i "s|-m486|-march=i686 -mtune=generic -pipe|" Configure || return 1
  ## Adjust Make-Configuration "linux-k6" For Arch i686
  sed -i "s|-mcpu=k6|-pipe -march=i386 -mtune=k6|" Configure || return 1
  ## TODO Add patches for x86_64


  echo "Patching miniupnpc"
  ##
  cd ${_rs_top_dir}/src/${_miniupnpc}
  ## Adjust Make-Configuration For Arch i686
  sed -i "s|CFLAGS = -fPIC -O -Wall -DNDEBUG|& -march=i686 -mtune=generic|" \
      ${_rs_top_dir}/src/${_miniupnpc}/Makefile || return 1
  ## TODO Add patches for x86_64


  echo "Patching retroshare"
  ##
  cd ${_rs_libsrc_dir}
  ## Adjust Make-Configuration For Arch i686
  sed -i "s|-Wall -g|${CFLAGS} -Wall|" make.opt || return 1
  sed -i "s|-Wall -g|${CFLAGS} -Wall|" scripts/config-linux.mk || return 1
  #sed -i "s|-O3 -fomit-frame-pointer -m486|${CFLAGS}|" scripts/config-linux.mk || return 1
  sed -i "s|-m486|-march=i686 -mtune=generic -pipe|" scripts/config-linux.mk || return 1
  ## TODO Add patches for x86_64

  ## Correct Compilation Errors Under Linux In 0.4.09b
  cd ${_rs_top_dir}/src/${pkgname}-v${pkgver}
  patch -p0 < ${startdir}/retroshare-v${pkgver}-linux-compile.patch


  # --- Compile Sources ---

  install -d "${_rs_top_dir}/lib"


  # - openssl

  echo "Compiling openssl"
  cd ${_rs_top_dir}/src/${_openssl}

  ./config || return 1
  make depend || return 1
  make || return 1
  cp libcrypto.a libssl.a "${_rs_top_dir}/lib" || return 1


  # - miniupnpc

  echo "Compiling miniupnpc"
  cd ${_rs_top_dir}/src/${_miniupnpc}

  make || return 1
  rm libminiupnpc.so || return 1
  cp libminiupnpc.a "${_rs_top_dir}/lib" || return 1


  # - qcheckers

  echo "Compiling qcheckers"
  cd ${_rs_top_dir}/src/${_qcheckers}

  /usr/bin/qmake || return 1
  make || return 1
  cp src/libqcheckers.a "${_rs_top_dir}/lib" || return 1


  # - smplayer

  echo "Compiling smplayer"
  cd ${_rs_top_dir}/src/smplayer

  /usr/bin/qmake || return 1
  make || return 1
  cp lib/libsmplayer.a "${_rs_top_dir}/lib" || return 1


  # - retroshare

  echo "Compiling retroshare"
  cd ${_rs_libsrc_dir}

  ## NOTE: One Could Also Use A Simple
  ##make || return 1
  ## But That Would Run All Tests.

  # libretroshare
  make -C util librs || return 1
  make -C tcponudp librs || return 1
  make -C serialiser librs || return 1
  make -C pqi librs || return 1
  make -C dbase librs || return 1
  make -C services librs || return 1
  make -C dht librs || return 1
  make -C upnp librs || return 1
  make -C server librs || return 1
  make -C rsserver librs || return 1

  ## Uncomment The Tests If You Want Them)
  ## make -C util tests || return 1
  ## make -C tcponudp tests || return 1
  ## make -C serialiser tests || return 1
  ## make -C pqi tests || return 1
  ## make -C dbase tests || return 1
  ## make -C services tests || return 1
  ## make -C dht tests || return 1
  ## make -C upnp tests || return 1
  ## make -C server tests || return 1
  ## make -C rsserver tests || return 1

  # retroshare-nogui
  make -C rsiface tests || return 1

  cp lib/libretroshare.a "${_rs_top_dir}/lib" || return 1

  # - retroshare gui

  echo "Compiling retroshare gui"
  cd ${_rs_guisrc_dir}

  /usr/bin/qmake RetroShare.pro || return 1
  sed -i "s:-L/usr/lib -L../../../../lib:-L../../../../lib -L/usr/lib:" Makefile || return 1
  make || return 1


  # --- Install Files ---

  cd "${_rs_top_dir}"

  # - Libs
  #
  # openssl
  install -D -m 644 lib/libcrypto.a "${_libDir}/libcrypto.a"
  install -D -m 644 lib/libssl.a "${_libDir}/libssl.a"
  # miniupnpc
  install -D -m 644 lib/libminiupnpc.a "${_libDir}/libminiupnpc.a"
  # qcheckers
  install -D -m 644 lib/libqcheckers.a "${_libDir}/libqcheckers.a"
  # smplayer
  install -D -m 644 lib/libsmplayer.a "${_libDir}/libsmplayer.a"
  # retroshare
  install -D -m 644 lib/libretroshare.a "${_libDir}/libretroshare.a"

  # - Binaries
  install -D -m 755 ${_rs_guisrc_dir}/RetroShare ${_binDir}/RetroShare-v${pkgver}
  install -D -m 755 ${_rs_libsrc_dir}/rsiface/retroshare-nogui ${_binDir}
  cd ${_binDir}
  ln -s RetroShare-v${pkgver} ${pkgname}

  # - Icons
  install -D -m 644 ${_rs_guisrc_dir}/gui/images/retrosharelogo1.png ${_iconDir}/retroshare_blue.png
  install -D -m 644 ${_rs_guisrc_dir}/gui/images/retrosharelogo2.png ${_iconDir}/retroshare.png

  # - Desktop File
  install -D -m 644 ${srcdir}/${pkgname}.v${pkgver}.desktop ${_desktopDir}/retroshare.desktop
}

retroshare-v0.4.09b-linux-compile.patch

diff -Naur ./libretroshare/src/dbase/findex.cc ../../../../retroshare-v0.4.09b/libretroshare/src/dbase/findex.cc
--- ./libretroshare/src/dbase/findex.cc    2008-07-10 19:53:43.000000000 +0200
+++ ../../../../retroshare-v0.4.09b/libretroshare/src/dbase/findex.cc    2008-11-25 02:34:12.000000000 +0100
@@ -30,6 +30,8 @@
 #include <sstream>
 #include <iomanip>
 #include <fstream>
+#include <stdlib.h>
+#include <algorithm>
 
 #include <openssl/sha.h>
 
diff -Naur ./libretroshare/src/dbase/rsexpr.cc ../../../../retroshare-v0.4.09b/libretroshare/src/dbase/rsexpr.cc
--- ./libretroshare/src/dbase/rsexpr.cc    2008-07-10 19:53:07.000000000 +0200
+++ ../../../../retroshare-v0.4.09b/libretroshare/src/dbase/rsexpr.cc    2008-11-25 02:34:12.000000000 +0100
@@ -27,6 +27,7 @@
 #include "dbase/findex.h"
 #include "rsiface/rsexpr.h"
 #include <functional>
+#include <algorithm>
 
 
 /******************************************************************************************
diff -Naur ./libretroshare/src/pqi/pqinetwork.h ../../../../retroshare-v0.4.09b/libretroshare/src/pqi/pqinetwork.h
--- ./libretroshare/src/pqi/pqinetwork.h    2008-07-10 19:53:04.000000000 +0200
+++ ../../../../retroshare-v0.4.09b/libretroshare/src/pqi/pqinetwork.h    2008-11-25 02:34:12.000000000 +0100
@@ -105,7 +105,7 @@
 
 std::string socket_errorType(int err);
 int sockaddr_cmp(struct sockaddr_in &addr1, struct sockaddr_in &addr2 );
-int inaddr_cmp(struct sockaddr_in addr1, struct sockaddr_in addr1 );
+int inaddr_cmp(struct sockaddr_in addr1, struct sockaddr_in addr2 );
 int inaddr_cmp(struct sockaddr_in addr1, unsigned long);
 
 struct in_addr getPreferredInterface(); // returns best addr.
diff -Naur ./libretroshare/src/pqi/pqisecurity.cc ../../../../retroshare-v0.4.09b/libretroshare/src/pqi/pqisecurity.cc
--- ./libretroshare/src/pqi/pqisecurity.cc    2008-07-10 19:53:04.000000000 +0200
+++ ../../../../retroshare-v0.4.09b/libretroshare/src/pqi/pqisecurity.cc    2008-11-25 02:34:12.000000000 +0100
@@ -27,6 +27,7 @@
 
 
 #include "pqi/pqisecurity.h"
+#include <stdlib.h>
 
 
 // Can keep the structure hidden....
diff -Naur ./libretroshare/src/tcponudp/tcpstream.cc ../../../../retroshare-v0.4.09b/libretroshare/src/tcponudp/tcpstream.cc
--- ./libretroshare/src/tcponudp/tcpstream.cc    2008-07-10 19:53:43.000000000 +0200
+++ ../../../../retroshare-v0.4.09b/libretroshare/src/tcponudp/tcpstream.cc    2008-11-25 02:34:12.000000000 +0100
@@ -32,6 +32,7 @@
 #include <assert.h>
 #include <errno.h>
 #include <math.h>
+#include <limits.h>
 
 #include <sys/time.h>
 #include <time.h>
diff -Naur ./retroshare-gui/src/gui/BlogDialog.cpp ../../../../retroshare-v0.4.09b/retroshare-gui/src/gui/BlogDialog.cpp
--- ./retroshare-gui/src/gui/BlogDialog.cpp    2008-07-10 19:53:42.000000000 +0200
+++ ../../../../retroshare-v0.4.09b/retroshare-gui/src/gui/BlogDialog.cpp    2008-11-25 02:34:23.000000000 +0100
@@ -26,6 +26,7 @@
 #include "rsiface/rspeers.h" //to retrieve peer/usrId info
 
 #include "profile/ProfileView.h"
+#include <algorithm>
 
 /** Constructor */
 BlogDialog::BlogDialog(QWidget *parent)
diff -Naur ./retroshare-gui/src/gui/ForumsDialog.cpp ../../../../retroshare-v0.4.09b/retroshare-gui/src/gui/ForumsDialog.cpp
--- ./retroshare-gui/src/gui/ForumsDialog.cpp    2008-07-10 19:53:42.000000000 +0200
+++ ../../../../retroshare-v0.4.09b/retroshare-gui/src/gui/ForumsDialog.cpp    2008-11-25 02:34:23.000000000 +0100
@@ -41,6 +41,7 @@
 #include <QDateTime>
 #include <QHeaderView>
 #include <QTimer>
+#include <algorithm>
 
 /* Images for context menu icons */
 #define IMAGE_MESSAGE        ":/images/folder-draft.png"
diff -Naur ./retroshare-gui/src/gui/NetworkView.cpp ../../../../retroshare-v0.4.09b/retroshare-gui/src/gui/NetworkView.cpp
--- ./retroshare-gui/src/gui/NetworkView.cpp    2008-07-10 19:52:47.000000000 +0200
+++ ../../../../retroshare-v0.4.09b/retroshare-gui/src/gui/NetworkView.cpp    2008-11-25 02:34:23.000000000 +0100
@@ -28,6 +28,7 @@
 #include <QGraphicsItem>
 
 #include <iostream>
+#include <algorithm>
 
 /** Constructor */
 NetworkView::NetworkView(QWidget *parent)
diff -Naur ./retroshare-gui/src/gui/TransfersDialog.cpp ../../../../retroshare-v0.4.09b/retroshare-gui/src/gui/TransfersDialog.cpp
--- ./retroshare-gui/src/gui/TransfersDialog.cpp    2008-07-10 19:53:42.000000000 +0200
+++ ../../../../retroshare-v0.4.09b/retroshare-gui/src/gui/TransfersDialog.cpp    2008-11-25 02:34:23.000000000 +0100
@@ -37,6 +37,7 @@
 

 #include <sstream>

 #include "rsiface/rsiface.h"

+#include <algorithm>

 

 /* Images for context menu icons */

 #define IMAGE_INFO                 ":/images/fileinfo.png"

diff -Naur ./retroshare-gui/src/rsiface/RemoteDirModel.cpp ../../../../retroshare-v0.4.09b/retroshare-gui/src/rsiface/RemoteDirModel.cpp
--- ./retroshare-gui/src/rsiface/RemoteDirModel.cpp    2008-07-10 19:53:42.000000000 +0200
+++ ../../../../retroshare-v0.4.09b/retroshare-gui/src/rsiface/RemoteDirModel.cpp    2008-11-25 02:34:23.000000000 +0100
@@ -7,6 +7,7 @@
 #include <iostream>
 #include <sstream>
 #include <math.h>
+#include <algorithm>
 
 
  bool RemoteDirModel::hasChildren(const QModelIndex &parent) const
diff -Naur ./retroshare-gui/src/util/MouseEventFilter.cpp ../../../../retroshare-v0.4.09b/retroshare-gui/src/util/MouseEventFilter.cpp
--- ./retroshare-gui/src/util/MouseEventFilter.cpp    2008-07-10 19:53:02.000000000 +0200
+++ ../../../../retroshare-v0.4.09b/retroshare-gui/src/util/MouseEventFilter.cpp    2008-11-25 02:34:23.000000000 +0100
@@ -25,6 +25,7 @@
 #include <QtGui/QMouseEvent>
 
 #include <exception>
+#include <typeinfo>
 
 MouseMoveEventFilter::MouseMoveEventFilter(QObject * receiver, const char * member)
     : EventFilter(receiver, member) {

retroshare.v0.4.09b.desktop

[Desktop Entry]
Encoding=UTF-8
Exec=/usr/bin/retroshare
Icon=/usr/share/pixmaps/retroshare.png
Type=Application
Terminal=false
MultipleArgs=false
Name=Retroshare
GenericName=Sharing Network
StartupNotify=true
Categories=Application;Network;

retroshare.install

post_install() {
  cat << EOF


ATTENTION retroshare:
----------------------

==> You have to logout once before starting retroshare.


EOF
update-desktop-database
}

post_upgrade() {
  post_install $1
}

You might very well think that, I couldn't possibly comment.

Offline

#9 2008-11-25 19:59:18

creslin
Member
Registered: 2008-10-04
Posts: 241

Re: Working on PKGBUILD for retroshare 0.4.09b

Your desktop file has some deprecated syntax.  You can run `desktop-file-validate retroshare.v0.4.09b.desktop` to see the warnings/errors.


ARCH|awesome3.0 powered by Pentium M 750 | 512MB DDR2-533 | Radeon X300 M
The journey is the reward.

Offline

#10 2008-11-25 23:28:48

Tristero
Member
From: Germany
Registered: 2008-01-16
Posts: 33

Re: Working on PKGBUILD for retroshare 0.4.09b

I reworked retroshare.v0.4.09b.desktop to

[Desktop Entry]
Version=1.0
Type=Application
Name=RetroShare
GenericName=Sharing Network
Comment=Secure Communication with Your Friends
Icon=/usr/share/pixmaps/retroshare.png
Exec=/usr/bin/retroshare
Terminal=false
StartupNotify=true
Categories=Network;InstantMessaging;FileTransfer;Chat;Email;

This triggers updates in the md5sum-array in the PKGBUILD.  (New md5sum is f6dc374d95c775bc587ef13841abdab2 .)

'mplayer' has to be added to the depends-array because smplayer needs it to be build.

It seems no trivial task to split retroshare in several packages. There are four sub-packages contained in RetroShare:
openssl, miniupnpc, qcheckers and smplayer. I played a little bit with the relationship between RetroShare, openssl and smplayer.

RetroShare uses a patched version of openssl as can be found here:
http://www.lunamutt.com/retroshare/openssl-css.html
RetroShare does not compile when linked to the default Arch version of openssl. The openssl libs are not just redundant.

RetroShare uses smplayer as a statically linked library. The default Arch package provides an executable binary and does not contain the library. For me it does not seem to be useful to make a 'libsmplayer' which would be as redundant as the current solution. (It would be a nice feature if one could define a custom media player in RetroShare.)


You might very well think that, I couldn't possibly comment.

Offline

#11 2008-11-27 21:07:05

Tristero
Member
From: Germany
Registered: 2008-01-16
Posts: 33

Re: Working on PKGBUILD for retroshare 0.4.09b

I improved the PKGBUILD and I think it is ready for submitting to the AUR. The Arch User Guidelines say:

If you are unsure about the package (or the build/submission process) in any way, submit the PKGBUILD to the AUR Mailing List or the AUR boards on the forum for public review before adding it to the AUR.

I am completely unexperienced as a package maintainer, so please be patient. I simply list some aspects that may be of interest or should perhaps be discussed before submitting.

1) For packaging, I took the current stable package of RetroShare from the project's homepage. It seems to be quite old. I preferred it over the SVN version because it is flagged stable.

2) I had to add some #include's and to correct a minor error in a .h-file to make the sources compile. This is done with the "linux-compile" patch.

3) I found it reasonable to change the hardcoded CFLAGS of the original build scripts to ${CFLAGS} in the PKGBUILD. There are also some other minor changes to the Makefiles.

4) I found that there were some games bundled with the software. They are compiled and linked into the binaries by the original build scripts but the function calls that activate them in the gui are commented out by the authors of RetroShare. There is a discussion in the project, from which I concluded that those games could eventually become plugins for RetroShare. In my opinion these games can hence be considered as dead code in the version I packaged. I patched them away with the "nogames" patch. The patched software passed a smoke test and some clicking around.

5) I wish to provide the PKGBUILD for the x86_64 platform, but I cannot test it on this platform. I think it should work but this should be tested by users who have this platform.

Below I posted the four files that I would like to submit to the AUR: a PKGBUILD for RetroShare, 2 patches to the program and a .desktop file. If there are no further suggestions or improvements to be made, I will adopt the retroshare package in the AUR and submit the files posted here.
(The only change will be to add my email to the PKGBUILD.)

PKGBUILD for RetroShare v0.4.09b:

# Contributor: Tristero <tristero's email will show up in the PKGBUILD>

pkgname=retroshare
pkgver=0.4.09b
pkgrel=1
pkgdesc="Encrypted IM with filesharing, email, chatgroups and mediaplayer"
url="http://retroshare.sourceforge.net/"
arch=('i686' 'x86_64')
license=('GPL')
depends=('qt4' 'mplayer')
source=(http://downloads.sourceforge.net/${pkgname}/${pkgname}-pkg-linux-src-v${pkgver}.tgz \
        ${pkgname}-v${pkgver}-linux-compile.patch \
        ${pkgname}-v${pkgver}-nogames.patch \
        ${pkgname}.desktop )
md5sums=('dd58f3af95534c4cc21df43ab79b5efa'
         '6780a91c2cf567ee432de4576619e61c'
         '18160ad2c1d67bb369bda69536d66527'
         'f6dc374d95c775bc587ef13841abdab2')

# --- Directories And Versions

# PKG Directories
_binDir="${pkgdir}/usr/bin/"
_libDir="${pkgdir}/usr/lib/retroshare"
_iconDir="${pkgdir}/usr/share/pixmaps"
_desktopDir="${pkgdir}/usr/share/applications"

# SRC Directories Used In The PKGBUILD
_rs_top_dir="${srcdir}/${pkgname}-package-v${pkgver}"
_rs_libsrc_dir="${_rs_top_dir}/src/${pkgname}-v${pkgver}/libretroshare/src"
_rs_guisrc_dir="${_rs_top_dir}/src/${pkgname}-v${pkgver}/retroshare-gui/src"

# Subpackage Versions
_openssl="openssl-0.9.7g-xpgp-0.1c"
_miniupnpc="miniupnpc-1.0"
_smplayer="smplayer-svn-280308"

build() {

  # --- Unpack All Tars ---

  install -d "${_rs_top_dir}/src"
  cd "${_rs_top_dir}/src"

  echo "--- Unpacking openssl"
  tar xfz ../tar/${_openssl}.tgz || return 1

  echo "--- Unpacking miniupnpc"
  tar xfz ../tar/${_miniupnpc}-RSa.tar.gz || return 1

  echo "--- Unpacking smplayer"
  tar xfz ../tar/${_smplayer}.tgz || return 1

  echo "--- Unpacking retroshare"
  tar xfz ../tar/${pkgname}-v${pkgver}-src.tgz || return 1

  # --- Patch Sources ---

  echo "+++ Patching openssl"
  ##
  cd "${_rs_top_dir}/src/${_openssl}"
  ##
  ## Adjust Make-Configurations "linux-pentium" And "linux-ppro" For Arch i686 Or x86_64
  sed -i "s|-mcpu=pentium\(pro\)\?|-march=${CARCH} -mtune=generic -pipe|" Configure || return 1
  ## Adjust Make-Configuration "linux-elf" For Arch i686 Or x86_64
  sed -i "s|-m486|-march=${CARCH} -mtune=generic -pipe|" Configure || return 1

  echo "+++ Patching miniupnpc"
  ##
  cd "${_rs_top_dir}/src/${_miniupnpc}"
  ## Adjust Make-Configuration For Arch i686 Or x86_64
  sed -i "s|CFLAGS = -fPIC -O -Wall -DNDEBUG|& -march=${CARCH} -mtune=generic|" \
      "${_rs_top_dir}/src/${_miniupnpc}/Makefile" || return 1

  echo "+++ Patching retroshare"
  ##
  cd "${_rs_libsrc_dir}"
  ## Adjust Make-Configuration For Arch i686 Or x86_64
  sed -i "s|-Wall -g|${CFLAGS} -Wall|" make.opt || return 1
  sed -i "s|-Wall -g|${CFLAGS} -Wall|" scripts/config-linux.mk || return 1
  sed -i "s|-m486|-march=${CARCH} -mtune=generic -pipe|" scripts/config-linux.mk || return 1
  #
  cd "${_rs_top_dir}/src/${pkgname}-v${pkgver}"
  echo "    + Apply Linux Compile-Patch"
  patch -sNp0 -i "${startdir}/retroshare-v${pkgver}-linux-compile.patch" || return 1
  echo "    + Apply Nogames-Patch"
  patch -sNp0 -i "${startdir}/retroshare-v${pkgver}-nogames.patch" || return 1

  # --- Compile Sources ---

  install -d "${_rs_top_dir}/lib"

  # - openssl

  echo "*** Compiling openssl"
  cd "${_rs_top_dir}/src/${_openssl}"
  ./config || return 1
  make depend || return 1
  make || return 1
  cp libcrypto.a libssl.a "${_rs_top_dir}/lib" || return 1

  # - miniupnpc

  echo "*** Compiling miniupnpc"
  cd "${_rs_top_dir}/src/${_miniupnpc}"
  make || return 1
  rm libminiupnpc.so || return 1
  cp libminiupnpc.a "${_rs_top_dir}/lib" || return 1

  # - smplayer

  echo "*** Compiling smplayer"
  cd "${_rs_top_dir}/src/smplayer"
  qmake || return 1
  make || return 1
  cp lib/libsmplayer.a "${_rs_top_dir}/lib" || return 1

  # - retroshare

  echo "*** Compiling retroshare"
  cd ${_rs_libsrc_dir}
  # libretroshare
  make -C util librs || return 1
  make -C tcponudp librs || return 1
  make -C serialiser librs || return 1
  make -C pqi librs || return 1
  make -C dbase librs || return 1
  make -C services librs || return 1
  make -C dht librs || return 1
  make -C upnp librs || return 1
  make -C server librs || return 1
  make -C rsserver librs || return 1
  # retroshare-nogui
  make -C rsiface tests || return 1
  cp lib/libretroshare.a "${_rs_top_dir}/lib" || return 1

  # - retroshare gui

  echo "*** Compiling retroshare gui"
  cd "${_rs_guisrc_dir}"
  qmake RetroShare.pro || return 1
  sed -i "s:-L/usr/lib -L../../../../lib:-L../../../../lib -L/usr/lib:" Makefile || return 1
  make || return 1

  # --- Install Files ---

  echo ">>> Install files to fakeroot-environment"
  cd "${_rs_top_dir}"

  # - Libs
  #
  # openssl
  install -D -m 644 lib/libcrypto.a "${_libDir}/libcrypto.a"
  install -D -m 644 lib/libssl.a "${_libDir}/libssl.a"
  # miniupnpc
  install -D -m 644 lib/libminiupnpc.a "${_libDir}/libminiupnpc.a"
  # smplayer
  install -D -m 644 lib/libsmplayer.a "${_libDir}/libsmplayer.a"
  # retroshare
  install -D -m 644 lib/libretroshare.a "${_libDir}/libretroshare.a"

  # - Binaries
  install -D -m 755 "${_rs_guisrc_dir}/RetroShare" "${_binDir}/RetroShare-v${pkgver}"
  install -D -m 755 "${_rs_libsrc_dir}/rsiface/retroshare-nogui" "${_binDir}"
  cd "${_binDir}"
  ln -s RetroShare-v${pkgver} ${pkgname}

  # - Icons
  install -D -m 644 "${_rs_guisrc_dir}/gui/images/retrosharelogo1.png" \
      "${_iconDir}/retroshare_blue.png"
  install -D -m 644 "${_rs_guisrc_dir}/gui/images/retrosharelogo2.png" \
      "${_iconDir}/retroshare.png"

  # - Desktop File
  install -D -m 644 "${srcdir}/${pkgname}.desktop" "${_desktopDir}/retroshare.desktop"
}

retroshare-v0.4.09b-linux-compile.patch

diff -Naur ./libretroshare/src/dbase/findex.cc ../../../../retroshare-v0.4.09b/libretroshare/src/dbase/findex.cc
--- ./libretroshare/src/dbase/findex.cc    2008-07-10 19:53:43.000000000 +0200
+++ ../../../../retroshare-v0.4.09b/libretroshare/src/dbase/findex.cc    2008-11-25 02:34:12.000000000 +0100
@@ -30,6 +30,8 @@
 #include <sstream>
 #include <iomanip>
 #include <fstream>
+#include <stdlib.h>
+#include <algorithm>
 
 #include <openssl/sha.h>
 
diff -Naur ./libretroshare/src/dbase/rsexpr.cc ../../../../retroshare-v0.4.09b/libretroshare/src/dbase/rsexpr.cc
--- ./libretroshare/src/dbase/rsexpr.cc    2008-07-10 19:53:07.000000000 +0200
+++ ../../../../retroshare-v0.4.09b/libretroshare/src/dbase/rsexpr.cc    2008-11-25 02:34:12.000000000 +0100
@@ -27,6 +27,7 @@
 #include "dbase/findex.h"
 #include "rsiface/rsexpr.h"
 #include <functional>
+#include <algorithm>
 
 
 /******************************************************************************************
diff -Naur ./libretroshare/src/pqi/pqinetwork.h ../../../../retroshare-v0.4.09b/libretroshare/src/pqi/pqinetwork.h
--- ./libretroshare/src/pqi/pqinetwork.h    2008-07-10 19:53:04.000000000 +0200
+++ ../../../../retroshare-v0.4.09b/libretroshare/src/pqi/pqinetwork.h    2008-11-25 02:34:12.000000000 +0100
@@ -105,7 +105,7 @@
 
 std::string socket_errorType(int err);
 int sockaddr_cmp(struct sockaddr_in &addr1, struct sockaddr_in &addr2 );
-int inaddr_cmp(struct sockaddr_in addr1, struct sockaddr_in addr1 );
+int inaddr_cmp(struct sockaddr_in addr1, struct sockaddr_in addr2 );
 int inaddr_cmp(struct sockaddr_in addr1, unsigned long);
 
 struct in_addr getPreferredInterface(); // returns best addr.
diff -Naur ./libretroshare/src/pqi/pqisecurity.cc ../../../../retroshare-v0.4.09b/libretroshare/src/pqi/pqisecurity.cc
--- ./libretroshare/src/pqi/pqisecurity.cc    2008-07-10 19:53:04.000000000 +0200
+++ ../../../../retroshare-v0.4.09b/libretroshare/src/pqi/pqisecurity.cc    2008-11-25 02:34:12.000000000 +0100
@@ -27,6 +27,7 @@
 
 
 #include "pqi/pqisecurity.h"
+#include <stdlib.h>
 
 
 // Can keep the structure hidden....
diff -Naur ./libretroshare/src/tcponudp/tcpstream.cc ../../../../retroshare-v0.4.09b/libretroshare/src/tcponudp/tcpstream.cc
--- ./libretroshare/src/tcponudp/tcpstream.cc    2008-07-10 19:53:43.000000000 +0200
+++ ../../../../retroshare-v0.4.09b/libretroshare/src/tcponudp/tcpstream.cc    2008-11-25 02:34:12.000000000 +0100
@@ -32,6 +32,7 @@
 #include <assert.h>
 #include <errno.h>
 #include <math.h>
+#include <limits.h>
 
 #include <sys/time.h>
 #include <time.h>
diff -Naur ./retroshare-gui/src/gui/BlogDialog.cpp ../../../../retroshare-v0.4.09b/retroshare-gui/src/gui/BlogDialog.cpp
--- ./retroshare-gui/src/gui/BlogDialog.cpp    2008-07-10 19:53:42.000000000 +0200
+++ ../../../../retroshare-v0.4.09b/retroshare-gui/src/gui/BlogDialog.cpp    2008-11-25 02:34:23.000000000 +0100
@@ -26,6 +26,7 @@
 #include "rsiface/rspeers.h" //to retrieve peer/usrId info
 
 #include "profile/ProfileView.h"
+#include <algorithm>
 
 /** Constructor */
 BlogDialog::BlogDialog(QWidget *parent)
diff -Naur ./retroshare-gui/src/gui/ForumsDialog.cpp ../../../../retroshare-v0.4.09b/retroshare-gui/src/gui/ForumsDialog.cpp
--- ./retroshare-gui/src/gui/ForumsDialog.cpp    2008-07-10 19:53:42.000000000 +0200
+++ ../../../../retroshare-v0.4.09b/retroshare-gui/src/gui/ForumsDialog.cpp    2008-11-25 02:34:23.000000000 +0100
@@ -41,6 +41,7 @@
 #include <QDateTime>
 #include <QHeaderView>
 #include <QTimer>
+#include <algorithm>
 
 /* Images for context menu icons */
 #define IMAGE_MESSAGE        ":/images/folder-draft.png"
diff -Naur ./retroshare-gui/src/gui/NetworkView.cpp ../../../../retroshare-v0.4.09b/retroshare-gui/src/gui/NetworkView.cpp
--- ./retroshare-gui/src/gui/NetworkView.cpp    2008-07-10 19:52:47.000000000 +0200
+++ ../../../../retroshare-v0.4.09b/retroshare-gui/src/gui/NetworkView.cpp    2008-11-25 02:34:23.000000000 +0100
@@ -28,6 +28,7 @@
 #include <QGraphicsItem>
 
 #include <iostream>
+#include <algorithm>
 
 /** Constructor */
 NetworkView::NetworkView(QWidget *parent)
diff -Naur ./retroshare-gui/src/gui/TransfersDialog.cpp ../../../../retroshare-v0.4.09b/retroshare-gui/src/gui/TransfersDialog.cpp
--- ./retroshare-gui/src/gui/TransfersDialog.cpp    2008-07-10 19:53:42.000000000 +0200
+++ ../../../../retroshare-v0.4.09b/retroshare-gui/src/gui/TransfersDialog.cpp    2008-11-25 02:34:23.000000000 +0100
@@ -37,6 +37,7 @@
 

 #include <sstream>

 #include "rsiface/rsiface.h"

+#include <algorithm>

 

 /* Images for context menu icons */

 #define IMAGE_INFO                 ":/images/fileinfo.png"

diff -Naur ./retroshare-gui/src/rsiface/RemoteDirModel.cpp ../../../../retroshare-v0.4.09b/retroshare-gui/src/rsiface/RemoteDirModel.cpp
--- ./retroshare-gui/src/rsiface/RemoteDirModel.cpp    2008-07-10 19:53:42.000000000 +0200
+++ ../../../../retroshare-v0.4.09b/retroshare-gui/src/rsiface/RemoteDirModel.cpp    2008-11-25 02:34:23.000000000 +0100
@@ -7,6 +7,7 @@
 #include <iostream>
 #include <sstream>
 #include <math.h>
+#include <algorithm>
 
 
  bool RemoteDirModel::hasChildren(const QModelIndex &parent) const
diff -Naur ./retroshare-gui/src/util/MouseEventFilter.cpp ../../../../retroshare-v0.4.09b/retroshare-gui/src/util/MouseEventFilter.cpp
--- ./retroshare-gui/src/util/MouseEventFilter.cpp    2008-07-10 19:53:02.000000000 +0200
+++ ../../../../retroshare-v0.4.09b/retroshare-gui/src/util/MouseEventFilter.cpp    2008-11-25 02:34:23.000000000 +0100
@@ -25,6 +25,7 @@
 #include <QtGui/QMouseEvent>
 
 #include <exception>
+#include <typeinfo>
 
 MouseMoveEventFilter::MouseMoveEventFilter(QObject * receiver, const char * member)
     : EventFilter(receiver, member) {

retroshare-v0.4.09b-nogames.patch

diff -Naur /var/abs/local/retroshare/src/retroshare-package-v0.4.09b/src/retroshare-v0.4.09b/retroshare-gui/src/gui/GamesDialog.ui ./retroshare-gui/src/gui/GamesDialog.ui
--- /var/abs/local/retroshare/src/retroshare-package-v0.4.09b/src/retroshare-v0.4.09b/retroshare-gui/src/gui/GamesDialog.ui    2008-07-10 19:52:46.000000000 +0200
+++ ./retroshare-gui/src/gui/GamesDialog.ui    2008-11-27 16:55:30.000000000 +0100
@@ -135,9 +135,6 @@
            <property name="text" >
             <string>Create New Game</string>
            </property>
-           <property name="icon" >
-            <iconset resource="images.qrc" >:/images/kbackgammon.png</iconset>
-           </property>
           </widget>
          </item>
          <item>
diff -Naur /var/abs/local/retroshare/src/retroshare-package-v0.4.09b/src/retroshare-v0.4.09b/retroshare-gui/src/gui/images.qrc ./retroshare-gui/src/gui/images.qrc
--- /var/abs/local/retroshare/src/retroshare-package-v0.4.09b/src/retroshare-v0.4.09b/retroshare-gui/src/gui/images.qrc    2008-07-10 19:53:42.000000000 +0200
+++ ./retroshare-gui/src/gui/images.qrc    2008-11-27 17:00:08.000000000 +0100
@@ -136,7 +136,6 @@
         <file>images/informations_24x24.png</file>
         <file>images/invite-friend24.png</file>
         <file>images/invitefriendlabel.png</file>
-        <file>images/kbackgammon.png</file>
         <file>images/kdmconfig.png</file>
         <file>images/konsole.png</file>
         <file>images/ksysguard.png</file>
diff -Naur /var/abs/local/retroshare/src/retroshare-package-v0.4.09b/src/retroshare-v0.4.09b/retroshare-gui/src/gui/MainWindow.cpp ./retroshare-gui/src/gui/MainWindow.cpp
--- /var/abs/local/retroshare/src/retroshare-package-v0.4.09b/src/retroshare-v0.4.09b/retroshare-gui/src/gui/MainWindow.cpp    2008-07-10 19:53:42.000000000 +0200
+++ ./retroshare-gui/src/gui/MainWindow.cpp    2008-11-27 17:01:16.000000000 +0100
@@ -37,7 +37,6 @@
 #include "MessengerWindow.h"
 #include "HelpDialog.h"
 
-#include "games/qbackgammon/bgwindow.h"
 #include "smplayer.h"
 
 #include "statusbar/peerstatus.h"
@@ -661,6 +660,7 @@
     
 }
 
+/*
 void MainWindow::startgammon()
 {
     BgWindow *bgWindow = new BgWindow(this); 
@@ -675,6 +675,7 @@
     top->show();
     
 }
+*/
 
 
 /** Shows smplayer */
diff -Naur /var/abs/local/retroshare/src/retroshare-package-v0.4.09b/src/retroshare-v0.4.09b/retroshare-gui/src/gui/MainWindow.h ./retroshare-gui/src/gui/MainWindow.h
--- /var/abs/local/retroshare/src/retroshare-package-v0.4.09b/src/retroshare-v0.4.09b/retroshare-gui/src/gui/MainWindow.h    2008-07-10 19:52:47.000000000 +0200
+++ ./retroshare-gui/src/gui/MainWindow.h    2008-11-27 16:59:15.000000000 +0100
@@ -42,8 +42,6 @@
 #include "Preferences/PreferencesWindow.h"
 #include "Settings/gsettingswin.h"
 #include "bwgraph/bwgraph.h"
-#include "games/qbackgammon/bgwindow.h"
-#include "toplevel.h"
 
 #include "Preferences/ConfirmQuitDialog.h"
 
@@ -109,8 +107,8 @@
     /** Shows the config dialog with focus set to the given page. */
     void show(Page page);
   
-    void startgammon();
-    void startqcheckers();
+    //void startgammon();
+    //void startqcheckers();
 
     void playFiles(QStringList files);
 
diff -Naur /var/abs/local/retroshare/src/retroshare-package-v0.4.09b/src/retroshare-v0.4.09b/retroshare-gui/src/gui/MainWindow.ui ./retroshare-gui/src/gui/MainWindow.ui
--- /var/abs/local/retroshare/src/retroshare-package-v0.4.09b/src/retroshare-v0.4.09b/retroshare-gui/src/gui/MainWindow.ui    2008-07-10 19:52:46.000000000 +0200
+++ ./retroshare-gui/src/gui/MainWindow.ui    2008-11-27 14:40:38.000000000 +0100
@@ -1184,7 +1184,6 @@
  </customwidgets>
  <resources>
   <include location="images.qrc" />
-  <include location="../games/qcheckers/qcheckers.qrc" />
  </resources>
  <connections/>
 </ui>
diff -Naur /var/abs/local/retroshare/src/retroshare-package-v0.4.09b/src/retroshare-v0.4.09b/retroshare-gui/src/RetroShare.pro ./retroshare-gui/src/RetroShare.pro
--- /var/abs/local/retroshare/src/retroshare-package-v0.4.09b/src/retroshare-v0.4.09b/retroshare-gui/src/RetroShare.pro    2008-07-10 19:53:42.000000000 +0200
+++ ./retroshare-gui/src/RetroShare.pro    2008-11-27 16:53:51.000000000 +0100
@@ -19,7 +19,6 @@
             gui \

             lang \

             util \

-            games\qbackgammon \

             gui\bwgraph \

             gui\chat \

             gui\connect \

@@ -34,7 +33,6 @@
             gui\elastic

             

 INCLUDEPATH += . \

-            games/qcheckers \

             apps/smplayer

 

 # Input

@@ -140,10 +138,6 @@
             gui/advsearch/advancedsearchdialog.h \

             gui/advsearch/expressionwidget.h \

             gui/advsearch/guiexprelement.h \

-            games/qbackgammon/bgwindow.h \

-            games/qbackgammon/bgwidget.h \

-            games/qbackgammon/bgboard.h \

-            games/qbackgammon/optionsdlg.h \

             gui/channels/channelsDialog.h \

             gui/channels/channelBrowserDialog.h \

             gui/channels/channelStatsDialog.h \

@@ -304,10 +298,6 @@
             gui/advsearch/advancedsearchdialog.cpp \

             gui/advsearch/expressionwidget.cpp \

             gui/advsearch/guiexprelement.cpp \

-            games/qbackgammon/bgwindow.cpp \

-            games/qbackgammon/bgwidget.cpp \

-            games/qbackgammon/bgboard.cpp \

-            games/qbackgammon/optionsdlg.cpp \

             gui/channels/channelsDialog.cpp \

             gui/channels/channelBrowserDialog.cpp \

             gui/channels/channelStatsDialog.cpp \

@@ -317,7 +307,7 @@
             gui/elastic/edge.cpp \

             gui/elastic/node.cpp

             

-RESOURCES += gui/images.qrc lang/lang.qrc games/qcheckers/qcheckers.qrc apps/smplayer/icons.qrc

+RESOURCES += gui/images.qrc lang/lang.qrc apps/smplayer/icons.qrc

 TRANSLATIONS +=  \

             lang/retroshare_en.ts \

             lang/retroshare_de.ts \

@@ -364,7 +354,7 @@
     RC_FILE = gui/images/retroshare_win.rc

 

     LIBS += -L"../../../../lib" -lretroshare -lssl -lcrypto -lpthreadGC2d -lKadC -lminiupnpc -lz

-    LIBS += -lqcheckers -lsmplayer 

+    LIBS += -lsmplayer 

     LIBS += -lws2_32 -luuid -lole32 -liphlpapi -lcrypt32-cygwin -gdi32

     LIBS += -lole32 -lwinmm

 

@@ -372,6 +362,6 @@
 

 !win32 {

     LIBS += -L../../../../lib -lretroshare -lminiupnpc -lssl -lcrypto

-    LIBS += -lqcheckers -lsmplayer 

+    LIBS += -lsmplayer 

 }

retroshare.desktop

[Desktop Entry]
Version=1.0
Type=Application
Name=RetroShare
GenericName=Sharing Network
Comment=Secure Communication with Your Friends
Icon=/usr/share/pixmaps/retroshare.png
Exec=/usr/bin/retroshare
Terminal=false
StartupNotify=true
Categories=Network;InstantMessaging;FileTransfer;Chat;Email;

Last edited by Tristero (2008-11-29 16:21:42)


You might very well think that, I couldn't possibly comment.

Offline

#12 2008-11-28 00:21:44

Daenyth
Forum Fellow
From: Boston, MA
Registered: 2008-02-24
Posts: 1,244

Re: Working on PKGBUILD for retroshare 0.4.09b

Unless you *absolutely* need those custom variables, or they make the syntax a lot cleaner, I would remove them. If you don't, I would move the variable declarations inside of build(), and use the "local" keyword to make even more sure there's no name conflicts. Probably overkill though.

Offline

#13 2008-11-28 08:09:59

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: Working on PKGBUILD for retroshare 0.4.09b

The Arch way of handling the bundled apps would be to create separate packages for them, and then list them as dependencies of retroshare. In the case of your mutant openssl version, the package would need a different name e.g. openssl-xpgp, ad it would need to provide and conflict with the official package.

Offline

#14 2008-11-28 12:22:18

Tristero
Member
From: Germany
Registered: 2008-01-16
Posts: 33

Re: Working on PKGBUILD for retroshare 0.4.09b

@Daenyth: I made the custom variables local, thanks for the hint. I would like to keep the variables because I think they improve the maintainability of the PKGBUILD. If this turns out to be a misjudgment, I will remove the local variables in the next version of the PKGBUILD or at least reduce their number.

@tomk: I absolutely agree that the current state of the PKGBUILD is a compromise solution because there are four different software packages in one. The clean solution would be to have four different packages: "retroshare" with three dependencies "openssl-xpgp", "miniupnpc-RS" and the Arch default "smplayer".

The reasons why I did not yet implement this scenario:

1) I have no idea if openssl-xpgp can consistently replace the default openssl package. I will try to understand what modifications the RetroShare people have applied to openssl. This will take time.

2) Same with miniupnpc: the RetroShare creators use a patched version of miniupnpc-1.0 in which the signature of one function is different from the original release. I can confirm that RetroShare will not compile with the official version of miniupnpc-1.0. Perhaps this will change when RetroShare is upgraded to use miniupnpc-1.2 (but I don't know).

3) In case of smplayer, RetroShare definitely relies on being compiled with exactly the version of smplayer that comes with the RetroShare-Bundle.

This packages will in the patched form not be universally usable for other packages that rely on the default APIs of openssl & miniupnpc nor will the packages be separately upgraded without an upgrade of RetroShare. Packaging them in separate PKGBUILDs will hence not reduce the redundancies of a system with RetroShare installed.

Thus the cards are stacked against the packager I think. I hope my solution can be accepted for version 0.4.09b. I will try to implement any improvements as they become possible for me. (But, hey, the software now compiles with gcc 4.3.2, the unused game stuff is gone and the build process is understood on a level that it was possible to throw away the unfriendly RS buildscript. So there is hope for running RetroShare on Arch! ;-))

Last edited by Tristero (2008-11-28 12:24:37)


You might very well think that, I couldn't possibly comment.

Offline

#15 2008-11-28 21:11:11

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: Working on PKGBUILD for retroshare 0.4.09b

Well... you certainly picked a good one for your first package. smile

Fair play to you for sticking with it, but I don't see it ever being an Arch-standard build as long as those patched deps are there. And as you correctly point out, people are likely to be very wary of a patched openssl in particular - I know I would be, without seeing extensive docs about what they've done.

If I were you, I'd ask them why they have to screw around with what is effectively the linux SSL/TLS "industry standard". Maybe they could find a way to do what they need in their own code, so that RS can build against vanilla openssl. I mean no disrespect to the devs, but you may recall that Debian, a well-established and highly respected distro, patched openssl as well - and we all know what happened there.

Offline

#16 2008-11-29 16:09:20

Tristero
Member
From: Germany
Registered: 2008-01-16
Posts: 33

Re: Working on PKGBUILD for retroshare 0.4.09b

I adopted the orphaned retroshare build and uploaded the new tarball.

Thanks to all for support and discussion! I am glad that my contribution was discussed and eventually accepted.

I perfectly agree that the hardlinked smplayer version and especially the patched deps are impediments for becoming an Arch-standard build. A possible way for at least getting rid of patched lib files residing in the file tree would be to link them into the RetroShare binary during the build. Of course this does in no way remove the redundancies on binary level but at least cleans up the file tree. Just an idea.

For the next version I will use the debian package of RetroShare as a source of inspiration for packaging policy. wink


You might very well think that, I couldn't possibly comment.

Offline

#17 2008-12-06 16:45:20

arch0r
Member
From: From the Chron-o-John
Registered: 2008-05-13
Posts: 597

Re: Working on PKGBUILD for retroshare 0.4.09b

thx a lot for writing a pkgbuild! this is just a fantastic piece of software! unfortunately this app isn't quite popular and you've to convince people to use other, much more secure and opensource software (like this one) instead of those commercial, stupid, prorietary crap.

retroshare builds fine and works great! smile

Offline

Board footer

Powered by FluxBB