You are not logged in.
I just wrote my first PKGBUILD for the full-circle-notifier (it's a notification program that will notify the user when a new issue of Full Circle Magazine is released/a new Full Circle podcast is available). I write for the magazine, hence I decided to pitch in here too.
I'd basically just like any suggestions people can give me as to what I should change, before submitting it to the AUR. I realize I left most of the variables empty, and I'll delete the empty ones before uploading it, I just figured I'd leave them there until I get to that stage.
# Maintainer: Lucas Westermann <lswest34@gmail.com>
pkgname=full-circle-notifier
pkgver=1.0
pkgrel=beta1
pkgdesc="Notifier for the popular FCM Ubuntu Community Magazine."
arch=('x86_64' 'i686')
url="ttp://bitbucket.org/mrmonday/full-circle-notifier/get/$pkgver-$pkgrel.tar.gz"
license=('GPL')
groups=()
depends=('qjson')
makedepends=()
optdepends=()
provides=()
conflicts=()
replaces=()
backup=()
options=()
install=full-circle-notifier.install
changelog=
source=($pkgname-$pkgver-$pkgrel.tar.gz)
noextract=()
md5sums=('3aa7ba198afcfe748c72aeed7e57111e')
build() {
cd "$srcdir/$pkgname"
qmake
make
}
package() {
cd "$srcdir/$pkgname"
mkdir -p "$pkgdir/usr/bin"
mkdir -p "$pkgdir/opt"
cp -r "$srcdir/$pkgname" "$pkgdir/opt"
}.install
post_install() {
ln -s /opt/full-circle-notifier/fcnotifier /usr/bin/fcnotifier
}Last edited by lswest (2010-08-25 01:47:23)
Lswest <- the first letter of my username is a lowercase "L".
"...the Linux philosophy is "laugh in the face of danger". Oops. Wrong one. "Do it yourself". That's it." - Linus Torvalds
Offline
normally its not a great idea to use mv and cp in your install although it works. You should use install instead.
Also I just tend to install everything within the build function. Have a look at some of my PKGBUILDS in AUR
There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !
Offline
You don't need to install file. You can do this in package() instead:
ln -s /opt/full-circle-notifier/fcnotifier $pkgdir/usr/bin/fcnotifierOther than that, looks good ![]()
Are you familiar with our Forum Rules, and How To Ask Questions The Smart Way?
BlueHackers // fscanary // resticctl
Offline
* Typo in your source URL.
* pkgrel has to be strictly numerical. It's not related to the program, but to your packaging.
* Qt is a depend.
Also, not crucial, but you can omit fields in the PKGBUILD that you aren't using to clean up the file.
Offline
Thanks for the quick replies. Just to make sure I've understood you both correctly, the following PKGBUILD would be what you were thinking of?
Also, would I still need the mkdir -p line in the PKGBUILD (if I read the manpage of install correctly, it should create the path automatically, correct?)
Thanks again for the replies,
Lswest
*EDIT* Thanks for that, totally overlooked the missing "h" in the source line. I also appreciate the pointers on the dependency and standards regarding pkgrel.
*EDIT 2* I just ran the new PKGBUILD, and I discovered that the build fails if the symbolic link exists. What would you guys suggest, should I have the package remove the /usr/bin/fcnotifier file first, or have ln force the symbolic link, so it overwrites the existing one? Or should I run some sort of check beforehand/have the package ignore the failure?
# Maintainer: Lucas Westermann <lswest34@gmail.com>
pkgname=full-circle-notifier
pkgver=1.0
pkgrel=1
pkgdesc="Notifier for the popular FCM Ubuntu Community Magazine."
arch=('x86_64' 'i686')
url="http://bitbucket.org/mrmonday/full-circle-notifier/get/$pkgver-beta1.tar.gz"
license=('GPL')
depends=('qjson' 'qt')
source=($pkgname-$pkgver-beta1.tar.gz)
md5sums=('3aa7ba198afcfe748c72aeed7e57111e')
build() {
cd "$srcdir/$pkgname"
qmake
make
}
package() {
cd "$srcdir/$pkgname"
mkdir -p "$pkgdir/opt"
install -Dd "$srcdir/$pkgname" "$pkgdir/opt/full-circle-notifier"
ln -s /opt/full-circle-notifier/fcnotifier /usr/bin/fcnotifier
}Last edited by lswest (2010-08-24 23:45:51)
Lswest <- the first letter of my username is a lowercase "L".
"...the Linux philosophy is "laugh in the face of danger". Oops. Wrong one. "Do it yourself". That's it." - Linus Torvalds
Offline
You need to create the symlinks inside the $pkgdir.
package() {
mkdir -p "$pkgdir/opt" "$pkgdir/usr/bin"
install -Dd "$srcdir/$pkgname" "$pkgdir/opt/full-circle-notifier"
ln -s "$pkgdir/opt/full-circle-notifier/fcnotifier" "$pkgdir/usr/bin/fcnotifier"
}Also, the way you've written the package function, the cd is unnecessary as you're always providing absolute paths (probably a good thing!).
Last edited by falconindy (2010-08-24 23:48:55)
Offline
Awesome, thanks!
*edit* @falconindy. I had to remove the $pkgdir from the first half of the ln command, since the symlink otherwise pointed to ¨/Packages/full-circle-notifier/pkg/opt/full-circle-notifier/fcnotifier. However, after that change I noticed that the install command doesn't copy the contents of the directory into the folder, but rather creates the directory and stops there. I'll keep trying it out, since I assume it's an error with the command I'm using, but if you have any suggestions, I'd be happy to try them out ![]()
Thanks again for the help.
Last edited by lswest (2010-08-24 23:59:57)
Lswest <- the first letter of my username is a lowercase "L".
"...the Linux philosophy is "laugh in the face of danger". Oops. Wrong one. "Do it yourself". That's it." - Linus Torvalds
Offline
Er, right on. Somewhere between fukawi's and my suggestion exists a reasonable middle ground.
Happy packaging!
edit: my only other suggestion is to declare what was your pkgrel as another variable. It'll make maintaining the PKGBUILD a lot easier. You're free to use your own variables, just make sure that you name them appropriately (e.g. prefix with an underscore) to try and avoid namespace clash.
Last edited by falconindy (2010-08-25 00:29:43)
Offline
Fukawi's suggestion was actually correct, I overlooked the $pkgdir variable in his code snippet. As for the variable, I may create it, but I believe the creator of the program will avoid that naming scheme once it's no longer in beta, making it irrelevant for the time being.
Still no luck with the install line
Anyways, thanks again, I'll be putting the PKGBUILD up as soon as I get it working right.
Wasn't able to get the install line to work, so I've gone back to using mv for the time being.
Install line that fails:
install -Dd "$srcdir/$pkgname" "$pkgdir/opt/full-circle-notifier"Results (without the -d) in omitting directory warnings, and with -d it results in an empty directory.
Package is here for anyone interested: http://aur.archlinux.org/packages.php?ID=40227
Final PKGBUILD:
# Maintainer: Lucas Westermann <lswest34@gmail.com>
pkgname=full-circle-notifier
pkgver=1.0
pkgrel=1
pkgdesc="Notifier for the popular FCM Ubuntu Community Magazine."
arch=('x86_64' 'i686')
url="http://bitbucket.org/mrmonday/full-circle-notifier/get/$pkgver-beta1.tar.gz"
license=('GPL')
depends=('qjson' 'qt')
source=($pkgname-$pkgver-beta1.tar.gz)
md5sums=('3aa7ba198afcfe748c72aeed7e57111e')
build() {
cd "$srcdir/$pkgname"
qmake
make
}
package() {
mkdir -p $pkgdir/opt/full-circle-notifier/ $pkgdir/usr/bin
mv $srcdir/$pkgname/ $pkgdir/opt/
ln -s "/opt/full-circle-notifier/fcnotifier" "$pkgdir/usr/bin/fcnotifier"
}Last edited by lswest (2010-08-25 01:32:46)
Lswest <- the first letter of my username is a lowercase "L".
"...the Linux philosophy is "laugh in the face of danger". Oops. Wrong one. "Do it yourself". That's it." - Linus Torvalds
Offline