You are not logged in.

#1 2008-05-21 09:28:59

Diego Gaustein
Member
Registered: 2008-05-21
Posts: 7

First PKGBUILD - syncevolution

Please review and don't hesitate to point out every mistake I must've made. Had to patch 2 files (just added #includes) according to http://gcc.gnu.org/gcc-4.3/porting_to.html for it to compile.

(I had to copy the example configuration files manually, is there a less ugly way to do it?)

PKGBUILD

# Contributor: Diego Gaustein <_firstname_@_lastname_.com.ar>

pkgname=syncevolution
pkgver=0.7
pkgrel=1
pkgdesc="Synchronize personal information management (PIM) via SyncML"
arch=('i686')
url="http://www.estamos.de/projects/SyncML/"
license=('GPL')
depends=('curl' 'evolution-data-server')
source=(http://www.estamos.de/download/$pkgname/sources/$pkgname-$pkgver.tar.gz \
        gcc43_headers.diff)
md5sums=('e2ecb9fdcb4d61276d73385e4a303179'
         '72479d450adcc096ba0fe8055c342fff')
options=('!emptydirs')

build() {
  cd $startdir/src/$pkgname-$pkgver
  patch -p0 < ../gcc43_headers.diff || exit 1
  ./configure --prefix=/usr || exit 1
  make || exit 1
  make DESTDIR="$pkgdir" install || exit 1
  install -dm755 "$pkgdir"/etc/skel/syncevolution
  cp -R etc/funambol "$pkgdir"/etc/skel/syncevolution
  cp -R etc/scheduleworld "$pkgdir"/etc/skel/syncevolution
  cp etc/*.txt "$pkgdir"/etc/skel/syncevolution
}

gcc43_headers.diff

--- src/EvolutionSyncClient.cpp.orig    2008-05-21 05:42:01.000000000 -0300
+++ src/EvolutionSyncClient.cpp    2008-05-21 05:45:38.000000000 -0300
@@ -39,6 +39,9 @@
 #include <dirent.h>
 #include <errno.h>
 
+#include <algorithm>
+
+
 SourceList *EvolutionSyncClient::m_sourceListPtr;
 
 EvolutionSyncClient::EvolutionSyncClient(const string &server,
--- src/syncevolution.cpp.orig    2008-05-21 05:41:40.000000000 -0300
+++ src/syncevolution.cpp    2008-05-21 05:36:16.000000000 -0300
@@ -19,7 +19,7 @@
 
 #include <config.h>
 #include <stddef.h>
-
+#include <memory>
 #include <base/Log.h>
 #include <posix/base/posixlog.h>
 #include <spds/spdsutils.h>

Cheers.

Last edited by Diego Gaustein (2008-05-22 01:11:50)

Offline

#2 2008-05-21 10:21:54

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,405
Website

Re: First PKGBUILD - syncevolution

Your PKGBUILD is a great first effort! I mainly have very minor comments below.

It would have been much easier to just post the PKGBUILD here so we did have to download it.

Anyway, you can remove empty fields (makedepends).  It would be good if you named your patch something informative, e.g. gcc43-header-fix.diff.  I would have done the "make install" before installing the extra config files.    I see you are copying whole directories, so I suppose using cp is fine.  Just remember where possible, you should use install instead, as that way you can make sure you get the right permissions.

Offline

#3 2008-05-21 15:22:04

Diego Gaustein
Member
Registered: 2008-05-21
Posts: 7

Re: First PKGBUILD - syncevolution

Allan wrote:

Your PKGBUILD is a great first effort!

Thanks smile

Allan wrote:

It would have been much easier to just post the PKGBUILD here so we did have to download it.

It seems the forums don't have a way to upload files, but I guess I could post the PKGBUILD and the patch. Is /usr/share/syncevolution the right place to put example config files? (they are skeletons to copy to each user's home dir and modify)

I updated my first post

Last edited by Diego Gaustein (2008-05-21 19:40:39)

Offline

#4 2008-05-21 16:46:30

Doc Angelo
Member
From: Germany
Registered: 2007-11-28
Posts: 52

Re: First PKGBUILD - syncevolution

I would say the /etc/skel/ is the right place to copy the example config files to.

Offline

#5 2008-05-21 19:39:40

Diego Gaustein
Member
Registered: 2008-05-21
Posts: 7

Re: First PKGBUILD - syncevolution

Doc Angelo wrote:

I would say the /etc/skel/ is the right place to copy the example config files to.

I didn't think about that. Thanks.

Offline

#6 2008-05-21 23:59:53

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,405
Website

Re: First PKGBUILD - syncevolution

I just noticed, you need to have the patch in the "source" array.  Then you will only need one set of ../ because it will get linked to your source directory.

Offline

#7 2008-05-22 00:51:45

Diego Gaustein
Member
Registered: 2008-05-21
Posts: 7

Re: First PKGBUILD - syncevolution

Thanks. I forgot the patch file has to be in listed in source=() when uploading to ABS. I've updated my first post. Do you see anything else or is it OK to upload to ABS?

Cheers.

Offline

#8 2008-05-22 01:02:12

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,405
Website

Re: First PKGBUILD - syncevolution

That looks good to go into the AUR to me.

In the quest for perfection, I will just add some incredibly minor cosmetic comments.  Instead of putting the "-R" at the end of the "cp" lines, use "cp -R".  I just makes things a bit clearer.  Instead of "mkdir" you can use "install -dm755" to ensure the permissions get set right.  And finally, you mix the use of $startdir/pkg and $pkgdir.

Offline

#9 2008-05-22 01:12:40

Diego Gaustein
Member
Registered: 2008-05-21
Posts: 7

Re: First PKGBUILD - syncevolution

Allan wrote:

That looks good to go into the AUR to me.

In the quest for perfection, I will just add some incredibly minor cosmetic comments.  Instead of putting the "-R" at the end of the "cp" lines, use "cp -R".  I just makes things a bit clearer.  Instead of "mkdir" you can use "install -dm755" to ensure the permissions get set right.  And finally, you mix the use of $startdir/pkg and $pkgdir.

Done, done and done. I'd forgotten about permissions and the existence of $pkgdir.

Offline

#10 2008-07-01 01:24:31

chris256
Member
From: US - Birmingham, AL
Registered: 2008-07-01
Posts: 13

Re: First PKGBUILD - syncevolution

I couldn't find this in the AUR.  Is it in there?  Before I found your PKGBUILD I tried to use the binary from SyncEvolution's web site but it would not work.  Since I could not find this or any other PKGBUILD I just used the code you posted in this thread to make the package.  It compiled and installed O.K. though it gives me a segmentation fault when I run it.

Last edited by chris256 (2008-07-01 01:25:51)

Offline

#11 2008-07-01 01:33:52

Diego Gaustein
Member
Registered: 2008-05-21
Posts: 7

Re: First PKGBUILD - syncevolution

chris256 wrote:

I couldn't find this in the AUR.  Is it in there?  Before I found your PKGBUILD I tried to use the binary from SyncEvolution's web site but it would not work.  Since I could not find this or any other PKGBUILD I just used the code you posted in this thread to make the package.  It compiled and installed O.K. though it gives me a segmentation fault when I run it.

I didn't post it since I ended up not using it, and I didn't test it enough. Sorry to hear it's segfaulting, but I've no idea what it can be.

Cheers.

Offline

#12 2008-07-01 07:23:37

Purch
Member
From: Finland
Registered: 2006-02-23
Posts: 229

Re: First PKGBUILD - syncevolution

Allan wrote:

... I see you are copying whole directories, so I suppose using cp is fine. Just remember where possible, you should use install instead, as that way you can make sure you get the right permissions.

A simple for-find does directory install really simple

for file in $(find DIR/ -max-depth 1 -type f); do install -T -m 0644 $file $startdir/pkg/$file ;done

Offline

#13 2008-07-19 03:39:57

chris256
Member
From: US - Birmingham, AL
Registered: 2008-07-01
Posts: 13

Re: First PKGBUILD - syncevolution

BTW, I rebuilt from your PKGBUILD and it works fine now.  I think it was segfaulting last time because of some nuances with my confg files that I retained from the same program with another distro.  I re-did the config files using the skel files from your package and all is well now.  Thanks.

Offline

Board footer

Powered by FluxBB