You are not logged in.

#1 2009-12-22 19:34:08

Floft
Member
Registered: 2009-11-15
Posts: 43

a simple script in the AUR

I decided to put a simple script I created the other day in the AUR. It is: http://aur.archlinux.org/packages.php?ID=33073 but I'm not sure if I did the PKGBUILD file correctly. I know it installs since I ran it and it worked fine, but is the way I did it standard? Or.... should I not even put scripts like that which don't have to be compiled in the AUR?

Garrett

Offline

#2 2009-12-22 19:42:42

Ghost1227
Forum Fellow
From: Omaha, NE, USA
Registered: 2008-04-21
Posts: 1,422
Website

Re: a simple script in the AUR

Nope. It should be something like this...

# Contributor: Garrett 
pkgname=mantiukhdr
pkgver=0.1
pkgrel=1
pkgdesc="A shell script that uses pfstmo_mantiuk06 to create HDR images. NOTE: if you are on x86_64, you'll have to install pfstmo tools by manually allowing the architecture in the PKGBUILD file."
arch=('i686' 'x86_64')
url="http://mantiukhdr.sourceforge.net/"
license=('GPL')
depends=('pfstools' 'pfstmo' 'enblend-enfuse')
source=()
noextract=(http://downloads.sourceforge.net/project/mantiukhdr/$pkgname)
md5sums=('da2697ca50d3f1377d072e279d6dc782')

build() {
  cd ${srcdir}
  install -Dm755 ${pkgname} ${pkgdir}/usr/bin
}

I'm at work so I can't really test it, and I don't know how the package is actually put together, but that's more what you're looking for. The PKGBUILD itself build in a temporary pkg directory which is overwritten each time makepkg is run, making the sanity check you put in unnecessary. Additionally, wget shouldn't be used to download the source file, that's what the source array is for.

Last edited by Ghost1227 (2010-11-08 21:30:32)


.:[My Blog] || [My GitHub]:.

Offline

#3 2009-12-22 20:06:05

Floft
Member
Registered: 2009-11-15
Posts: 43

Re: a simple script in the AUR

Thanks! That almost worked. It created a file "/usr/bin" instead of "/usr/bin/mantiukhdr" though. I successfully got this code to work.

pkgname=mantiukhdr
pkgver=0.1
pkgrel=1
pkgdesc="A shell script that uses pfstmo_mantiuk06 to create HDR images. NOTE: if you are on x86_64, you'll have to install pfstmo tools by manually allowing the architecture in the PKGBUILD file."
arch=('i686' 'x86_64')
url="http://mantiukhdr.sourceforge.net/"
license=('GPL')
depends=('pfstools' 'pfstmo' 'enblend-enfuse')
source=(http://downloads.sourceforge.net/project/mantiukhdr/$pkgname)
md5sums=('e2cadff40e738729ee286476f22c7e88')

build() {
  cd ${srcdir}
  mkdir "${pkgdir}/usr"
  mkdir "${pkgdir}/usr/bin"
  install -Dm755 "${pkgname}" "${pkgdir}/usr/bin/"
}

Am I supposed to create those two directories? I couldn't get it to work when I didn't.

Last edited by Floft (2010-11-08 21:11:56)

Offline

#4 2009-12-22 20:17:46

brisbin33
Member
From: boston, ma
Registered: 2008-07-24
Posts: 1,796
Website

Re: a simple script in the AUR

this is the PKGBUILD that i use for aurget.  it's also a bash script that just needs to be downloaded and saved to /usr/bin.

pkgname=aurget
pkgver=1.2
pkgrel=3
pkgdesc="A simple Pacman-like interface to the AUR"
arch=('any')
url="http://pbrisbin.com:8080/pages/$pkgname.html"
license="GPL"
conflicts=('aurget-git' 'aurget-jordz')
depends=('curl')
install=aurget.install
source=(http://pbrisbin.com:8080/sources/$pkgname)
md5sums=('4c0f0fb61ed622fe2a6456dfd13456a4')

build() {
  install -D -m755 ./$pkgname $pkgdir/usr/bin/$pkgname || return 1
}

the lack of quoting is probably something i should fix...

Last edited by brisbin33 (2009-12-22 20:18:23)

Offline

#5 2009-12-22 20:43:23

Ghost1227
Forum Fellow
From: Omaha, NE, USA
Registered: 2008-04-21
Posts: 1,422
Website

Re: a simple script in the AUR

Change the line

install -Dm755 ${pkgname} ${pkgdir}/usr/bin

to

install -Dm755 ${pkgname} ${pkgdir}/usr/bin/${pkgname}

.:[My Blog] || [My GitHub]:.

Offline

#6 2009-12-22 21:41:22

Floft
Member
Registered: 2009-11-15
Posts: 43

Re: a simple script in the AUR

Okay, I have fixed it. Thank you for the assistance

Offline

#7 2009-12-22 21:45:01

Ghost1227
Forum Fellow
From: Omaha, NE, USA
Registered: 2008-04-21
Posts: 1,422
Website

Re: a simple script in the AUR

Not a problem! Welcome to the community!


.:[My Blog] || [My GitHub]:.

Offline

Board footer

Powered by FluxBB