You are not logged in.

#1 2015-02-01 18:27:47

DoTheEvolution
Member
Registered: 2014-05-07
Posts: 24

My first PKGBUILD, would like consultation before submitting to AUR

Heads up, I am new to both python and arch/linux

projects github page
The program is done in python with pyside(Qt) for GUI, theres no compilation just copying stuff

Heres the PKGFILE:

# Maintainer: DoTheEvolution <DoTheEvo@gmail.com>
pkgname="angrysearch"
pkgver=0.5.0
pkgrel=1
pkgdesc="An instant file search"
arch=("i686" "x86_64")
url="https://github.com/dotheevo/$pkgname/"
license=("GPL")
depends=("python-pyside" "mlocate")
source=("https://github.com/DoTheEvo/ANGRYsearch/archive/v$pkgver.tar.gz")
md5sums=("ad17b0b86a9c0f92cdce3e917281e04a")

package() {
 cd "$srcdir/ANGRYsearch-$pkgver"
 install -d $pkgdir/usr/share/$pkgname
 install -d $pkgdir/usr/share/applications
 install -d $pkgdir/usr/share/pixmaps
 install -m755 angrysearch.py $pkgdir/usr/share/$pkgname
 install -m755 angrysearch.svg $pkgdir/usr/share/pixmaps
 install -m755 angrysearch.desktop $pkgdir/usr/share/applications
}

Theres also a database being created by the program, which will end up in /var/lib/angrysearch/angry_database.db
and theres also use of /tmp but temp files created are deleted once the program is done with it
also theres just plain asking for sudo password by the program, to execute updatedb and various other commands that need it.
Dunno if its OK with some standards.

Thanks

/edit
huh, I thought I was posting it in the "Creating & Modifying Packages", well...

Last edited by DoTheEvolution (2015-02-01 18:31:03)

Offline

#2 2015-02-01 18:47:53

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,612

Re: My first PKGBUILD, would like consultation before submitting to AUR

overall, it looks pretty good. A few suggestions, though:
1. There doesn't appear to be anything architecture specific in the final package, so the arch array should probably just be "any"
2. I don't think you want the icon and  desktop file to be executable (755). You'd be better setting them to 644.
3. Please quote any paths that contain variable that may have a space, specifically $pkgdir.
4. If it needs sudo, it should probably be in the depends array.
5. I would atleast create the /var/lib/angrysearch directory, so that pacman can track it. If you can create an empty database so that pacman can track that, too, it would be even better.

Last edited by Scimmia (2015-02-01 18:48:08)

Offline

#3 2015-02-01 19:37:35

DoTheEvolution
Member
Registered: 2014-05-07
Posts: 24

Re: My first PKGBUILD, would like consultation before submitting to AUR

Thanks.
That last point was really important, quite monstrously large database could have been left there (locate + btrfs snapshots can really go wild)

updated it accordingly, tested it once in VM for now
Updated PKGFILE:

# Maintainer: DoTheEvolution <DoTheEvo@gmail.com>
pkgname="angrysearch"
pkgver=0.5.0
pkgrel=1
pkgdesc="An instant file search"
arch=("any")
url="https://github.com/dotheevo/$pkgname/"
license=("GPL")
depends=("python-pyside" "mlocate" "sudo")
source=("https://github.com/DoTheEvo/ANGRYsearch/archive/v$pkgver.tar.gz")
md5sums=("ad17b0b86a9c0f92cdce3e917281e04a")

package() {
 install -d "$pkgdir/usr/share/$pkgname"
 install -d "$pkgdir/usr/share/applications"
 install -d "$pkgdir/usr/share/pixmaps"
 install -d "$pkgdir/var/lib/$pkgname"
 touch "$pkgdir/var/lib/$pkgname/angry_database.db"
 cd "$srcdir/ANGRYsearch-$pkgver"
 install -m755 angrysearch.py "$pkgdir/usr/share/$pkgname"
 install -m644 angrysearch.svg "$pkgdir/usr/share/pixmaps"
 install -m644 angrysearch.desktop "$pkgdir/usr/share/applications"
}

Offline

#4 2015-02-01 20:53:21

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,612

Re: My first PKGBUILD, would like consultation before submitting to AUR

Looks good to me! Last thing, and it doesn't really matter, if you specify the destination filename with install, you can use the -D switch to create the directory automatically. So this:

 install -d "$pkgdir/usr/share/$pkgname"
 install -m755 angrysearch.py "$pkgdir/usr/share/$pkgname"

Can just be this:

 install -Dm755 angrysearch.py "$pkgdir/usr/share/$pkgname/angrysearch.py"

As I said, doesn't really matter, either way works. If you want to stick with creating the dirs separately, you can create them all in one command, just list all of the dirs at once.

Last edited by Scimmia (2015-02-01 20:56:55)

Offline

#5 2015-02-01 20:58:06

DoTheEvolution
Member
Registered: 2014-05-07
Posts: 24

Re: My first PKGBUILD, would like consultation before submitting to AUR

Yeah, I thought that was the case from reading the manpage and looking at other PKGBUILD files on AUR, but was not 100% sure and felt like at first doing stuff explicitly step by step.

Thanks for the help.

Offline

Board footer

Powered by FluxBB