You are not logged in.
hi all, i'm trying to get into writing/maintaining aur packages and was wondering if y'all might check this pretty simple one I wrote for a popular command-line json parser.
here's the PKGBUILD:
# Maintainer: ian <ian at kremlin dot cc>
pkgname=json-sh
pkgver=r71.19aa1be
pkgrel=1
pkgdesc="command line json tool written in bash"
arch=('any')
url="https://github.com/dominictarr/JSON.sh"
license=('MIT' 'APACHE')
makedepends=('git')
source=('git://github.com/dominictarr/JSON.sh.git')
md5sums=('SKIP')
depends=('bash')
pkgver() {
cd "$srcdir/JSON.sh"
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}
check() {
cd "$srcdir/JSON.sh"
sh "all-tests.sh"
}
package() {
cd $pkgdir
mkdir -p usr/bin
mkdir -p usr/share/licenses/$pkgname/
mv $srcdir/JSON.sh/JSON.sh usr/bin/json
install -D -m644 $srcdir/JSON.sh/LICENSE.MIT "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}
any direction would be appreciated. thanks!
Offline
diff -uprN a/PKGBUILD b/PKGBUILD
--- a/PKGBUILD 2013-12-21 21:39:55.685038483 -0500
+++ b/PKGBUILD 2013-12-21 21:39:44.015307280 -0500
@@ -13,7 +13,7 @@ md5sums=('SKIP')
depends=('bash')
pkgver() {
- cd "$srcdir/JSON.sh"
+ cd "JSON.sh"
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}
@@ -23,9 +23,7 @@ check() {
}
package() {
- cd $pkgdir
- mkdir -p usr/bin
- mkdir -p usr/share/licenses/$pkgname/
- mv $srcdir/JSON.sh/JSON.sh usr/bin/json
- install -D -m644 $srcdir/JSON.sh/LICENSE.MIT "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
+ cd "JSON.sh"
+ install -Dm755 "$srcdir/JSON.sh/JSON.sh" "$pkgdir/usr/bin/JSON.sh"
+ install -Dm644 "$srcdir/JSON.sh/LICENSE.MIT" "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}
Looks fine to me but stylistically, people tend to write PKGBUILD with install statements and not moving from $srcdir. Also, always quote your variables. For example:
First and third changes - makepkg always goes into "$srcdir" so no need to repeat it.
Forth and fifth changes - no need for mkdir stuff and either always use {} variables or not, although that is not a deal breaker.
Last edited by graysky (2013-12-22 02:42:48)
CPU-optimized Linux-ck packages @ Repo-ck • AUR packages • Zsh and other configs
Offline
diff -uprN a/PKGBUILD b/PKGBUILD --- a/PKGBUILD 2013-12-21 21:39:55.685038483 -0500 +++ b/PKGBUILD 2013-12-21 21:39:44.015307280 -0500 @@ -13,7 +13,7 @@ md5sums=('SKIP') depends=('bash') pkgver() { - cd "$srcdir/JSON.sh" + cd "JSON.sh" printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" } @@ -23,9 +23,7 @@ check() { } package() { - cd $pkgdir - mkdir -p usr/bin - mkdir -p usr/share/licenses/$pkgname/ - mv $srcdir/JSON.sh/JSON.sh usr/bin/json - install -D -m644 $srcdir/JSON.sh/LICENSE.MIT "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" + cd "JSON.sh" + install -Dm755 "$srcdir/JSON.sh/JSON.sh" "$pkgdir/usr/bin/JSON.sh" + install -Dm644 "$srcdir/JSON.sh/LICENSE.MIT" "$pkgdir/usr/share/licenses/$pkgname/LICENSE" }
Looks fine to me but stylistically, people tend to write PKGBUILD with install statements and not moving from $srcdir. Also, always quote your variables. For example:
First and third changes - makepkg always goes into "$srcdir" so no need to repeat it.
Forth and fifth changes - no need for mkdir stuff and either always use {} variables or not, although that is not a deal breaker.
noted. thanks!
Offline
First and second, not first and third but you get it. Welcome to Arch.
CPU-optimized Linux-ck packages @ Repo-ck • AUR packages • Zsh and other configs
Offline
You're also pulling from git master, the pkgname should be appended with "-git"
I'll disagree with graysky and say there's nothing wrong with cd'ing to $srcdir/whatever. Using an absolute path is fine.
Last edited by Scimmia (2013-12-22 16:16:35)
Online
You're also pulling from git master, the pkgname should be appended with "-git"
I'll disagree with graysky and say there's nothing wrong with cd'ing to $srcdir/whatever. Using an absolute path is fine.
d'oh! i meant to append that but i was so anxious to submit i forgot, haha.
Offline