[aur-general] PKGBUILD Review Request: syncevolution
I scratched an itch and would now like feedback on my first PKGBUILD. I enabled the features I need (which are all basic), plus all those that did not pull in too many additional dependencies and compiled without fuss. I split out syncevo-http-server because it depends on many Python packages, and many users won't need it. The patch (not included) replaces python by python2, fixes two minor compilation issues, and applies a hack to get it to work with libical2. (Upstream is aware.) (There are obsolete syncevolution packages in the AUR Archive, but I decided to start from scratch.) Thanks, Justus # Maintainer: Justus Piater <Justus-dev@Piater.name> pkgname=('syncevolution' 'syncevolution-http') pkgver=1.5.1 pkgrel=1 pkgdesc="Synchronize PIM data via various protocols" arch=('i686' 'x86_64') url="https://syncevolution.org/" license=('LGPL') depends=('evolution-data-server' 'neon' 'openobex' 'python2' 'libunique') makedepends=('intltool' 'boost') #changelog= source=("https://download.01.org/syncevolution/syncevolution/sources/$pkgname-$pkgver..." "$pkgname-$pkgver.patch") sha256sums=('39f52049006c4a703bfe4b7cea3bb3298fe61b4ba9a8dbc367492409e4091c70' 'e8592cff59bc0ebc9bb2b35b63840d4207bb8bc321f244294122a40910b6aeb2') prepare() { cd "$pkgname-$pkgver" patch -p1 -i "$srcdir/$pkgname-$pkgver.patch" } build() { cd "$pkgname-$pkgver" ./configure --prefix=/usr --libexecdir=/usr/lib/syncevolution --sysconfdir=/etc CXXFLAGS=-std=gnu++98 --enable-bluetooth --enable-core --enable-dbus-service --enable-notify --enable-notify-compatibility --enable-gui --enable-pbap --enable-dav make } package_syncevolution() { cd "$pkgbase-$pkgver" make DESTDIR="$pkgdir/" install rm -f $pkgdir/usr/bin/syncevo-http-server rmdir $pkgdir/usr/lib/syncevolution/test } package_syncevolution-http() { pkgdesc="Synchronize PIM data via various protocols (HTTP server)" arch=('any') depends=('syncevolution' 'python2-dbus' 'python2-twisted' 'python2-gobject2' 'python2-pyopenssl' 'python2-service-identity') #changelog= cd "$pkgbase-$pkgver" mkdir -p $pkgdir/usr/bin /usr/bin/install -c test/syncevo-http-server.py $pkgdir/usr/bin/syncevo-http-server }
On Sat, 25 Jun 2016 08:46:05 +0200 Justus-dev@Piater.name wrote:
I scratched an itch and would now like feedback on my first PKGBUILD. I enabled the features I need (which are all basic), plus all those that did not pull in too many additional dependencies and compiled without fuss. I split out syncevo-http-server because it depends on many Python packages, and many users won't need it.
The patch (not included) replaces python by python2, fixes two minor compilation issues, and applies a hack to get it to work with libical2. (Upstream is aware.)
Sounds like it should be at least 3 separate patches.
(There are obsolete syncevolution packages in the AUR Archive, but I decided to start from scratch.)
Thanks, Justus
# Maintainer: Justus Piater <Justus-dev@Piater.name> pkgname=('syncevolution' 'syncevolution-http') pkgver=1.5.1 pkgrel=1 pkgdesc="Synchronize PIM data via various protocols" arch=('i686' 'x86_64') url="https://syncevolution.org/" license=('LGPL') depends=('evolution-data-server' 'neon' 'openobex' 'python2' 'libunique') makedepends=('intltool' 'boost') #changelog= source=("https://download.01.org/syncevolution/syncevolution/sources/$pkgname-$pkgver..." "$pkgname-$pkgver.patch") sha256sums=('39f52049006c4a703bfe4b7cea3bb3298fe61b4ba9a8dbc367492409e4091c70' 'e8592cff59bc0ebc9bb2b35b63840d4207bb8bc321f244294122a40910b6aeb2')
prepare() { cd "$pkgname-$pkgver" patch -p1 -i "$srcdir/$pkgname-$pkgver.patch" }
build() { cd "$pkgname-$pkgver" ./configure --prefix=/usr --libexecdir=/usr/lib/syncevolution --sysconfdir=/etc CXXFLAGS=-std=gnu++98 --enable-bluetooth --enable-core --enable-dbus-service --enable-notify --enable-notify-compatibility --enable-gui --enable-pbap --enable-dav
The guidelines ask to limit lines to somewhere around 100 characters. Not required, but considered good form.
make }
package_syncevolution() { cd "$pkgbase-$pkgver" make DESTDIR="$pkgdir/" install rm -f $pkgdir/usr/bin/syncevo-http-server rmdir $pkgdir/usr/lib/syncevolution/test
Missing some quotes here. You don't know if $pkgdir contains a space or not. You could also combine these two into one command.
}
package_syncevolution-http() { pkgdesc="Synchronize PIM data via various protocols (HTTP server)" arch=('any') depends=('syncevolution' 'python2-dbus' 'python2-twisted' 'python2-gobject2' 'python2-pyopenssl' 'python2-service-identity') #changelog=
cd "$pkgbase-$pkgver" mkdir -p $pkgdir/usr/bin /usr/bin/install -c test/syncevo-http-server.py $pkgdir/usr/bin/syncevo-http-server
More missing quotes. Not sure why you're specifying the full path for install, and you could use the -D switch to create the dir, so the preceding mkdir isn't necessary. The -c switch does nothing. I'm assuming you want this to be executable, so adding -m755 would be a good idea as well.
}
On Sat, 25 Jun 2016 11:25:02 -0500 Doug Newgard <scimmia@archlinux.info> wrote:
On Sat, 25 Jun 2016 08:46:05 +0200 Justus-dev@Piater.name wrote:
I scratched an itch and would now like feedback on my first PKGBUILD. I enabled the features I need (which are all basic), plus all those that did not pull in too many additional dependencies and compiled without fuss. I split out syncevo-http-server because it depends on many Python packages, and many users won't need it.
The patch (not included) replaces python by python2, fixes two minor compilation issues, and applies a hack to get it to work with libical2. (Upstream is aware.)
Sounds like it should be at least 3 separate patches.
(There are obsolete syncevolution packages in the AUR Archive, but I decided to start from scratch.)
Thanks, Justus
# Maintainer: Justus Piater <Justus-dev@Piater.name> pkgname=('syncevolution' 'syncevolution-http') pkgver=1.5.1 pkgrel=1 pkgdesc="Synchronize PIM data via various protocols" arch=('i686' 'x86_64') url="https://syncevolution.org/" license=('LGPL') depends=('evolution-data-server' 'neon' 'openobex' 'python2' 'libunique') makedepends=('intltool' 'boost') #changelog= source=("https://download.01.org/syncevolution/syncevolution/sources/$pkgname-$pkgver..." "$pkgname-$pkgver.patch") sha256sums=('39f52049006c4a703bfe4b7cea3bb3298fe61b4ba9a8dbc367492409e4091c70' 'e8592cff59bc0ebc9bb2b35b63840d4207bb8bc321f244294122a40910b6aeb2')
prepare() { cd "$pkgname-$pkgver" patch -p1 -i "$srcdir/$pkgname-$pkgver.patch" }
build() { cd "$pkgname-$pkgver" ./configure --prefix=/usr --libexecdir=/usr/lib/syncevolution --sysconfdir=/etc CXXFLAGS=-std=gnu++98 --enable-bluetooth --enable-core --enable-dbus-service --enable-notify --enable-notify-compatibility --enable-gui --enable-pbap --enable-dav
The guidelines ask to limit lines to somewhere around 100 characters. Not required, but considered good form.
Another thing I noticed here, you don't want to completely override CXXFLAGS. You should add the option to what is already set. I also wouldn't intermix that in with the configure options.
make }
package_syncevolution() { cd "$pkgbase-$pkgver" make DESTDIR="$pkgdir/" install rm -f $pkgdir/usr/bin/syncevo-http-server rmdir $pkgdir/usr/lib/syncevolution/test
Missing some quotes here. You don't know if $pkgdir contains a space or not. You could also combine these two into one command.
}
package_syncevolution-http() { pkgdesc="Synchronize PIM data via various protocols (HTTP server)" arch=('any') depends=('syncevolution' 'python2-dbus' 'python2-twisted' 'python2-gobject2' 'python2-pyopenssl' 'python2-service-identity') #changelog=
cd "$pkgbase-$pkgver" mkdir -p $pkgdir/usr/bin /usr/bin/install -c test/syncevo-http-server.py $pkgdir/usr/bin/syncevo-http-server
More missing quotes. Not sure why you're specifying the full path for install, and you could use the -D switch to create the dir, so the preceding mkdir isn't necessary. The -c switch does nothing. I'm assuming you want this to be executable, so adding -m755 would be a good idea as well.
}
Thanks for the suggestions. I implemented all but the -m755 as that's the default anyway. If there are no more comments I'll upload to AUR. Justus # Maintainer: Justus Piater <Justus-dev at Piater dot name> pkgname=('syncevolution' 'syncevolution-http') pkgver=1.5.1 pkgrel=1 pkgdesc="Synchronize PIM data via various protocols" arch=('i686' 'x86_64') url="https://syncevolution.org/" license=('LGPL') depends=('evolution-data-server' 'neon' 'openobex' 'python2' 'libunique') makedepends=('intltool' 'boost') #changelog= source=("https://download.01.org/syncevolution/syncevolution/sources/$pkgname-$pkgver..." "$pkgname-$pkgver-casts.patch" "$pkgname-$pkgver-libical2.patch" "$pkgname-$pkgver-python2.patch") sha256sums=('39f52049006c4a703bfe4b7cea3bb3298fe61b4ba9a8dbc367492409e4091c70' 'c72fcc0f06d7958fbef98ffd379ebc95407d7bd29924e6ba63507ba7f82fcac6' 'e12fd70af74b2771c6a83a6f42cfd64a943e9e5d3db93624865b08476d4b8f2c' '3ccb195d45de1c1ad87f76dfc5927997988afa7031feb9f335fab63d6a317910') prepare() { cd "$pkgname-$pkgver" for patch in casts libical2 python2; do patch -p1 -i "$srcdir/$pkgname-$pkgver-$patch.patch" done } build() { cd "$pkgname-$pkgver" export CXXFLAGS="$CXXFLAGS -std=gnu++98" ./configure --prefix=/usr \ --libexecdir=/usr/lib/syncevolution \ --sysconfdir=/etc \ --enable-bluetooth \ --enable-core \ --enable-dbus-service \ --enable-notify \ --enable-notify-compatibility \ --enable-gui \ --enable-pbap \ --enable-dav make } package_syncevolution() { cd "$pkgbase-$pkgver" make DESTDIR="$pkgdir/" install rm -df "$pkgdir/usr/bin/syncevo-http-server" \ "$pkgdir/usr/lib/syncevolution/test" } package_syncevolution-http() { pkgdesc="Synchronize PIM data via various protocols (HTTP server)" arch=('any') depends=('syncevolution' 'python2-dbus' 'python2-twisted' 'python2-gobject2' 'python2-pyopenssl' 'python2-service-identity') #changelog= /usr/bin/install -D "$pkgbase-$pkgver/test/syncevo-http-server.py" \ "$pkgdir/usr/bin/syncevo-http-server" }
thanks for your response ______________________________________________________ Persian web-based mail | MihanMail.Com
I just uploaded my package to AUR and ran aursync -c syncevolution-http As the PKGBUILD specifies, this downloads and builds syncevolution, and creates both the syncevolution and syncevolution-http packages. It indeed makes little sense to upgrade or install syncevolution-http without syncevolution. Also, running aursync -c syncevolution syncevolution-http builds syncevolution only once, as I would expect. However, if you have been running syncevolution and later install syncevolution-http, the syncevolution build is useless. Syncevolution-http does not require syncevolution to be built (if it is already installed) - it just needs to patch and extract a Python script from the source tree. Thus, I could presumably override build() inside package_syncevolution-http() with a no-op. On the other hand, the impossibility [1] to correspondingly override makedepends suggests that this is not the recommended way to proceed. So, how should this be resolved: (a) Leave it as-is, with an installation of syncevolution-http triggering a (needless) build of syncevolution? (b) Avoid this build by overriding build() (and prepare()), but (inconsistently) not makedepends? (c) Instead of a split package, package syncevolution-http independently (which would presumably cause a joint install to download the source tarball twice)? Thanks, Justus [1] https://wiki.archlinux.org/index.php/PKGBUILD#pkgbase
participants (4)
-
Doug Newgard
-
hojat mombeini
-
Justus Piater
-
Justus-dev@Piater.name