[aur-general] PKGBUILD review request
I've been trying to improve my AUR packages for the last few days. I'm still a beginner in package maintaining so I would like to have some feedback on some of my PKGBUILDs. I would love to hear everything that is wrong about them. Thanks! # Maintainer: Josef Miegl <josef@miegl.cz> pkgname=osmo-bsc-git pkgver=1.4.0.15.g7cfdbe727 pkgrel=1 pkgdesc="Open Source BSC (GSM Base Station Controller) with A-bis/IP and A/IP interface" url="https://osmocom.org/projects/osmobsc" arch=('i686' 'x86_64' 'aarch64' 'armv7h') license=(GPL) depends=('libosmocore' 'libosmo-abis' 'libosmo-sccp' 'osmo-mgw') makedepends=('git' 'talloc') provides=("${pkgname%-git}") conflicts=("${pkgname%-git}") backup=('etc/osmocom/osmo-bsc.cfg') source=("git+https://git.osmocom.org/${pkgname%-git}") sha256sums=('SKIP') pkgver() { cd "${srcdir}/${pkgname%-git}" echo $(git describe --always | sed 's/-/./g') } build() { cd "${srcdir}/${pkgname%-git}" autoreconf -i ./configure --prefix=/usr --sysconfdir=/etc make } package() { cd "${srcdir}/${pkgname%-git}" make DESTDIR=${pkgdir} install } # vim:set ts=2 sw=2 et: # Maintainer: Josef Miegl <josef@miegl.cz> # Contributor: goll <adrian.goll+aur[at]gmail> # Contributor: Kosava <kosava@gmail.com> pkgname=butt pkgver=0.1.17 pkgrel=1 pkgdesc="Easy to use, multi OS streaming tool" arch=('i686' 'x86_64' 'aarch64' 'armv7h') license=('GPL2') url="http://butt.sourceforge.net/" depends=('fltk' 'libpng12' 'portaudio' 'libfdk-aac' 'libvorbis' 'libogg' 'lame' 'flac' 'opus' 'libsamplerate') source=(${pkgname}-${pkgver}.tar.gz::"http://sourceforge.net/projects/${pkgname}/files/${pkgname}/${pkgname}-${pkgver}/${pkgname}-${pkgver}.tar.gz") sha256sums=('afe9596b1d9ef38d2fde1f3255e5a3a12b206c73c8e6601e37cccb07e67ae33d') build() { cd "${srcdir}/${pkgname}-${pkgver}" ./configure --prefix=/usr make } package() { cd "${srcdir}/${pkgname}-${pkgver}" make DESTDIR="${pkgdir}" install # Desktop file install -Dm644 "usr/share/applications/${pkgname}.desktop" "${pkgdir}/usr/share/applications/${pkgname}.desktop" # Icons for size in 16 22 24 32 48 64 96 128 256 512; do format="${size}x${size}" install -Dm644 "icons/icon_${format}.png" "${pkgdir}/usr/share/icons/hicolor/${format}/apps/${pkgname}.png" done install -Dm644 "icons/icon_scalable.svg" "${pkgdir}/usr/share/icons/hicolor/scalable/apps/${pkgname}.svg" # Documentation for doc in AUTHORS ChangeLog KNOWN_BUGS NEWS README THANKS; do install -Dm644 "${doc}" "${pkgdir}/usr/share/doc/${pkgname}/${doc}" done # Pixmaps for file in usr/share/pixmaps/"${pkgname}"*; do filename=`basename "${file}"` install -Dm644 "${file}" "${pkgdir}/usr/share/pixmaps/${filename}" done } # vim:set ts=2 sw=2 et:
Am 07.02.2019 um 23:13 schrieb Josef Miegl:
I've been trying to improve my AUR packages for the last few days. I'm still a beginner in package maintaining so I would like to have some feedback on some of my PKGBUILDs. I would love to hear everything that is wrong about them. Thanks!
You don't need "$srcdir" (the build starts there), nor for loops with install (use -t /some/directory). I didn't check if the upstream Makefile respects CFLAGS etc., but you might. Otherwise looks fine to me. Doesn't look like beginners' work at all. Alad
# Maintainer: Josef Miegl <josef@miegl.cz>
pkgname=osmo-bsc-git pkgver=1.4.0.15.g7cfdbe727 pkgrel=1 pkgdesc="Open Source BSC (GSM Base Station Controller) with A-bis/IP and A/IP interface" url="https://osmocom.org/projects/osmobsc" arch=('i686' 'x86_64' 'aarch64' 'armv7h') license=(GPL) depends=('libosmocore' 'libosmo-abis' 'libosmo-sccp' 'osmo-mgw') makedepends=('git' 'talloc') provides=("${pkgname%-git}") conflicts=("${pkgname%-git}") backup=('etc/osmocom/osmo-bsc.cfg') source=("git+https://git.osmocom.org/${pkgname%-git}") sha256sums=('SKIP')
pkgver() { cd "${srcdir}/${pkgname%-git}" echo $(git describe --always | sed 's/-/./g') }
build() { cd "${srcdir}/${pkgname%-git}" autoreconf -i ./configure --prefix=/usr --sysconfdir=/etc make }
package() { cd "${srcdir}/${pkgname%-git}" make DESTDIR=${pkgdir} install }
# vim:set ts=2 sw=2 et:
# Maintainer: Josef Miegl <josef@miegl.cz> # Contributor: goll <adrian.goll+aur[at]gmail> # Contributor: Kosava <kosava@gmail.com>
pkgname=butt pkgver=0.1.17 pkgrel=1 pkgdesc="Easy to use, multi OS streaming tool" arch=('i686' 'x86_64' 'aarch64' 'armv7h') license=('GPL2') url="http://butt.sourceforge.net/" depends=('fltk' 'libpng12' 'portaudio' 'libfdk-aac' 'libvorbis' 'libogg' 'lame' 'flac' 'opus' 'libsamplerate') source=(${pkgname}-${pkgver}.tar.gz::"http://sourceforge.net/projects/${pkgname}/files/${pkgname}/${pkgname}-${pkgver}/${pkgname}-${pkgver}.tar.gz") sha256sums=('afe9596b1d9ef38d2fde1f3255e5a3a12b206c73c8e6601e37cccb07e67ae33d')
build() { cd "${srcdir}/${pkgname}-${pkgver}" ./configure --prefix=/usr make }
package() { cd "${srcdir}/${pkgname}-${pkgver}" make DESTDIR="${pkgdir}" install
# Desktop file install -Dm644 "usr/share/applications/${pkgname}.desktop" "${pkgdir}/usr/share/applications/${pkgname}.desktop"
# Icons for size in 16 22 24 32 48 64 96 128 256 512; do format="${size}x${size}" install -Dm644 "icons/icon_${format}.png" "${pkgdir}/usr/share/icons/hicolor/${format}/apps/${pkgname}.png" done
install -Dm644 "icons/icon_scalable.svg" "${pkgdir}/usr/share/icons/hicolor/scalable/apps/${pkgname}.svg"
# Documentation for doc in AUTHORS ChangeLog KNOWN_BUGS NEWS README THANKS; do install -Dm644 "${doc}" "${pkgdir}/usr/share/doc/${pkgname}/${doc}" done
# Pixmaps for file in usr/share/pixmaps/"${pkgname}"*; do filename=`basename "${file}"` install -Dm644 "${file}" "${pkgdir}/usr/share/pixmaps/${filename}" done }
# vim:set ts=2 sw=2 et:
Hey ho, On February 7, 2019 11:13:34 PM GMT+01:00, Josef Miegl <josef@miegl.cz> wrote:
I've been trying to improve my AUR packages for the last few days. I'm still a beginner in package maintaining so I would like to have some feedback on some of my PKGBUILDs. I would love to hear everything that is wrong about them. Thanks!
pkgver() { cd "${srcdir}/${pkgname%-git}" echo $(git describe --always | sed 's/-/./g') }
Please do not use pkgver functions like that, they don't work in vercmp as you would assume. If upstream releases with a fix up version release you gonna end up with a epoch bump. You could do something like described in the wiki sed 's/\([^-]*-g\)/r\1/;s/-/./g' } This prefixes the revision count like: 2.0.r6.ga17a017 Which behaves properly. https://wiki.archlinux.org/index.php/VCS_package_guidelines#The_pkgver()_fun...
On 2/7/19 5:38 PM, Levente Polyak via aur-general wrote:
Hey ho,
On February 7, 2019 11:13:34 PM GMT+01:00, Josef Miegl <josef@miegl.cz> wrote:
I've been trying to improve my AUR packages for the last few days. I'm still a beginner in package maintaining so I would like to have some feedback on some of my PKGBUILDs. I would love to hear everything that is wrong about them. Thanks!
pkgver() { cd "${srcdir}/${pkgname%-git}" echo $(git describe --always | sed 's/-/./g') }
Please do not use pkgver functions like that, they don't work in vercmp as you would assume. If upstream releases with a fix up version release you gonna end up with a epoch bump.
You could do something like described in the wiki
sed 's/\([^-]*-g\)/r\1/;s/-/./g' }
This prefixes the revision count like: 2.0.r6.ga17a017
Which behaves properly.
https://wiki.archlinux.org/index.php/VCS_package_guidelines#The_pkgver()_fun...
I would like to add to this, that in addition, there is no need to use: echo $(git describe ... | sed ...) since it is literally the same thing as not using the echo and simply using: git describe ... | sed ... Except not using the echo is a) faster b) as a general scripting practice, advisable due to not reparsing the string, thus introducing modification of whitespace. If you're going to use echo $() then at least quote the "$()". Failure to quote the $() means that echo treats each whitespace-separated string as a separate argument to echo, even if they are separated by multiple spaces, or tabs. Of course, for PKGBUILDs, whitespace is forbidden in pkgver() output. -- Eli Schwartz Bug Wrangler and Trusted User
On 07-02-2019 23:13, Josef Miegl wrote:
I've been trying to improve my AUR packages for the last few days. I'm still a beginner in package maintaining so I would like to have some feedback on some of my PKGBUILDs. I would love to hear everything that is wrong about them. Thanks!
# Maintainer: Josef Miegl <josef@miegl.cz>
pkgname=osmo-bsc-git pkgver=1.4.0.15.g7cfdbe727 pkgrel=1 pkgdesc="Open Source BSC (GSM Base Station Controller) with A-bis/IP and A/IP interface" url="https://osmocom.org/projects/osmobsc" arch=('i686' 'x86_64' 'aarch64' 'armv7h') license=(GPL) depends=('libosmocore' 'libosmo-abis' 'libosmo-sccp' 'osmo-mgw') makedepends=('git' 'talloc') provides=("${pkgname%-git}") conflicts=("${pkgname%-git}") backup=('etc/osmocom/osmo-bsc.cfg') source=("git+https://git.osmocom.org/${pkgname%-git}") sha256sums=('SKIP')
pkgver() { cd "${srcdir}/${pkgname%-git}" echo $(git describe --always | sed 's/-/./g') }
build() { cd "${srcdir}/${pkgname%-git}" autoreconf -i ./configure --prefix=/usr --sysconfdir=/etc make }
On archlinux we usually need to add the -f / --force option to autoreconf. Also autoreconf does change source files. That should be done in prepare() function, not build() . LW
package() { cd "${srcdir}/${pkgname%-git}" make DESTDIR=${pkgdir} install }
# vim:set ts=2 sw=2 et:
Thanks for all the suggestions. I will update all my packages accordingly :) Josef Miegl
participants (5)
-
alad
-
Eli Schwartz
-
Josef Miegl
-
Levente Polyak
-
Lone_Wolf