You are not logged in.

#1 2016-06-08 22:14:06

Loen
Member
Registered: 2016-06-08
Posts: 7

[SOLVED] PKGBUILD review request: anonsurf

Hello, this is my first PKGBUILD so I would like to get some reviews from other archers. Should I change something?

# 
pkgname=anonsurf	
pkgver=2.0
pkgrel=1
pkgdesc="A script from ParrotSec that provides a strong system-wide anonymization module"
arch=(any)
url="https://www.parrotsec.org"
license=('GPL')
depends=('tor' 'iptables')
provides=('anonsurf')
conflicts=('anonsurf')
source=("http://downloads.sourceforge.net/project/aur-anonsurf/aur-anonsurf/anonsurf.tar?r=https%3A%2F%2Fsourceforge.net%2Fprojects%2Faur-anonsurf%2Ffiles%2Faur-anonsurf%2F&ts=1465421554&use_mirror=master")
md5sums=(901b5aa3848cd442269873e265699222)

package() {
	   cd $pkgname
           mkdir $pkgdir/usr && mkdir $pkgdir/usr/share && mkdir $pkgdir/usr/share/$pkgname && mkdir $pkgdir/usr/bin
           mv * $pkgdir/usr/share/$pkgname/
           ln -s /usr/share/anonsurf/anonsurf.sh $pkgdir/usr/bin/anonsurf
}

Last edited by Loen (2016-06-09 20:42:38)

Offline

#2 2016-06-08 22:29:42

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

Re: [SOLVED] PKGBUILD review request: anonsurf

There's no reason to list the pkgname in "conflicts" and "provides"
That source url seems fishy. Why is it aur-anonsurf?
Your mkdir command would be much simpler with mkdir -p, or install -d. Really, you only need to run the command once, not 4 times.
You should not be changing things in $srcdir in the package function. Copy/install instead of move.
You should quote all paths that use variables you don't control, such as $pkgdir. You don't know if it contains a space or not.
Kind of nit-picky, but all of your array entries are quoted except in the architecture array. They should be consistent.

Online

#3 2016-06-08 22:40:10

Loen
Member
Registered: 2016-06-08
Posts: 7

Re: [SOLVED] PKGBUILD review request: anonsurf

Okay, so... i tried to rewrite package(), maybe now it's better?

package() {
           install -dm755 $pkgdir/usr/share/$pkgname
           cp -rf $pkgname/* $pkgdir/usr/share/$pkgname/
           mkdir $pkgdir/usr/bin
           ln -s /usr/share/anonsurf/anonsurf.sh $pkgdir/usr/bin/anonsurf
}

Offline

#4 2016-06-08 22:42:12

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

Re: [SOLVED] PKGBUILD review request: anonsurf

Much better, except for the quoting. You could also combine the third line into the first if you'd like, install can take multiple arguments.

Online

#5 2016-06-08 22:44:39

Loen
Member
Registered: 2016-06-08
Posts: 7

Re: [SOLVED] PKGBUILD review request: anonsurf

And for the source link: anonsurf is a script coming from ParrotSec OS and configured for their distro, so i had to modify some little things to make it work on arch. So i created a new tar archive and i uploaded it on sourceforge.

Offline

#6 2016-06-10 14:52:23

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,911

Re: [SOLVED] PKGBUILD review request: anonsurf

Loen,

typical solution for such things is to use the original source and modifiy that in the PKGBUILD prepare() function .


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

Board footer

Powered by FluxBB