You are not logged in.

#1 2007-08-26 06:53:01

awagner
Member
From: Mainz, Germany
Registered: 2007-08-24
Posts: 191

disc-cover PKGBUILD: is this okay? (my 1st one)

Hi all,
I have finished my first package build, but before I submit anything anywhere "official", I'd like to have someone look over it.
Is it okay this way?:

PKGBUILD:

# Disc-Cover 1.5.6 by J.I. van Hemert
# Contributor: Andreas Wagner <A.Wagner@stud.uni-frankfurt.de>

pkgname=disc-cover
pkgver=1.5.6
pkgrel=1
pkgdesc="Retrieves CDDB entries for a CD and creates a leaflet (/dev/cd -> xy.ps)"
arch=('i686' 'x86_64')
url="http://www.vanhemert.co.uk/disc-cover.html"
license=('GPL')
depends=('perl' 
        'perl-mime-base64' 
        'perl-uri' 
        'perl-html-parser' 
        'perl-digest-md5' 
        'perl-libnet' 
        'perl-libwww' 
        'perl-cddb' 
        'perl-audio-cd' )
install=(disc-cover.install)

source=(http://downloads.sourceforge.net/disc-cover/$pkgname-$pkgver.tar.gz)
md5sums=('4d8cf0e644a9b311f7e6ed44944b9033')

build() {
  cd "$startdir/src/$pkgname-$pkgver"
  
  mkdir -p $startdir/pkg/usr/bin
  cp disc-cover $startdir/pkg/usr/bin

  mkdir -p $startdir/pkg/usr/share/$pkgname
  cp -r templates $startdir/pkg/usr/share/$pkgname
  
}


# vim:set ts=2 sw=2 et:

disc-cover.install:

post_install() {
  echo "Note: Disc-cover will absolutely not run unless you have some latex package installed!!"
  echo "But since tetex is discontinued and deprecated in favour of TeXLive, which there is no package for,"
  echo "disc-cover relies on you to install something appropriate."
  echo "You can use 'disc-cover -C ~/.disc-coverrc' to create a config file."
  /bin/true
}

op=$1
shift
[ "$(type -t "$op")" = "function" ] && $op "$@"

# vim:set ts=2 sw=2 et:

Thanks for any feedback,
Andreas

Last edited by awagner (2007-08-26 06:53:52)

Offline

#2 2007-08-26 07:11:01

tardo
Member
Registered: 2006-07-15
Posts: 526

Re: disc-cover PKGBUILD: is this okay? (my 1st one)

in your build function, try to use 'install' instead of mkdir and cp. read the man page for it or look at other pkgbuilds.
also, if the program won't run without texlive, create an aur pkgbuild (if there isn't one already). you absolutely have to have that as a dependency.

Offline

#3 2007-08-26 07:22:48

shining
Pacman Developer
Registered: 2006-05-10
Posts: 2,043

Re: disc-cover PKGBUILD: is this okay? (my 1st one)

Why does a tool like that absolutely require tex ?


pacman roulette : pacman -S $(pacman -Slq | LANG=C sort -R | head -n $((RANDOM % 10)))

Offline

#4 2007-08-26 09:25:18

awagner
Member
From: Mainz, Germany
Registered: 2007-08-24
Posts: 191

Re: disc-cover PKGBUILD: is this okay? (my 1st one)

Thanks for your hints. Right now, I'm studying man pages and try to catch up with the texlive threads/wiki. (As I am running everything tex-wise from a loop-mounted dvd iso, I'll probably try to build some dummy package as mentioned in this thread.)
I think I'll report back here when I have made progress there.

@shining: I haven't looked at the (perl) code, so I can't tell which parts exactly of tex it needs, but AFAIU, it does the layout of the leaflet (drawing borders, rotating text for the sides of the jewel case, including cover images, and of course the actual typesetting) with latex. The samples on the project's homepage might tell you more.

Andreas

Offline

#5 2007-08-26 10:10:13

awagner
Member
From: Mainz, Germany
Registered: 2007-08-24
Posts: 191

Re: disc-cover PKGBUILD: is this okay? (my 1st one)

decided to deal with tex(live) later. here are the revised files then:

# Disc-Cover 1.5.6 by J.I. van Hemert
# Contributor: Andreas Wagner <A.Wagner@stud.uni-frankfurt.de>

pkgname=disc-cover
pkgver=1.5.6
pkgrel=1
pkgdesc="Retrieves CDDB entries for a CD and creates a leaflet (/dev/cd -> xy.ps)"
arch=('i686' 'x86_64')
url="http://www.vanhemert.co.uk/disc-cover.html"
license=('GPL')
depends=('perl' 
        'perl-mime-base64' 
        'perl-uri' 
        'perl-html-parser' 
        'perl-digest-md5' 
        'perl-libnet' 
        'perl-libwww' 
        'perl-cddb' 
        'perl-audio-cd' 
        'tetex' )
install="$pkgname.install"

source=(http://downloads.sourceforge.net/disc-cover/$pkgname-$pkgver.tar.gz)
md5sums=('4d8cf0e644a9b311f7e6ed44944b9033')

build() {
  cd "$startdir/src/$pkgname-$pkgver"
  install -D disc-cover $startdir/pkg/usr/bin/disc-cover
  install -d $startdir/pkg/usr/share/$pkgname/templates
  install templates/* $startdir/pkg/usr/share/$pkgname/templates
}


# vim:set ts=2 sw=2 et:

and disc-cover.install:

post_install() {
  echo "You can use 'disc-cover -C ~/.disc-coverrc' to create a config file."
  /bin/true
}

op=$1
shift
[ "$(type -t "$op")" = "function" ] && $op "$@"

# vim:set ts=2 sw=2 et:

Offline

#6 2007-08-26 19:27:19

tardo
Member
Registered: 2006-07-15
Posts: 526

Re: disc-cover PKGBUILD: is this okay? (my 1st one)

install -D -m 755 disc-cover $startdir/pkg/usr/bin/disc-cover

I'm picky about permissions.

Offline

#7 2007-08-26 19:55:08

awagner
Member
From: Mainz, Germany
Registered: 2007-08-24
Posts: 191

Re: disc-cover PKGBUILD: is this okay? (my 1st one)

Right. The other copy operations don't need this?
I also tend to frown when I come across some whatever-file in a /usr/shared/xy directory or so that has its executable bit set for no reason, so I'm making sure -assuming it doesn't hurt. And somewhere here I've just read explicit over implicit.

like this then:

build() {
  cd "$startdir/src/$pkgname-$pkgver"
  install -D -m 755 disc-cover $startdir/pkg/usr/bin/disc-cover
  install -d -m 755 $startdir/pkg/usr/share/$pkgname/templates
  install -m 644 templates/* $startdir/pkg/usr/share/$pkgname/templates
}

Thanks for your help and patience again,
Andreas


PS. The install manpage says:

-m, --mode=MODE
  set permission mode (as in chmod), instead of rwxr-xr-x

so I was thinking it is -m 755 anyway if you don't specify differently. (I know - then I shouldn't have left the templates files without -m 644.)

Last edited by awagner (2007-08-26 19:56:49)

Offline

Board footer

Powered by FluxBB