You are not logged in.

#1 2010-11-06 14:47:04

Kasumi_Ninja
Member
Registered: 2009-12-31
Posts: 54

Question about my first PKGBUILD

I made a PKGBUILD for python-beautifulsoup (needed for lyrics wiki support in exaile). It builds fine, how I can I further improve my PKGBUILD and is it possible to change 'pkgname=' to python-beautifulsoup instead of BeautifulSoup and still use $srcdir/$pkgname-$pkgver?

# This is an example PKGBUILD file. Use this as a start to creating your own,
# and remove these comments. For more information, see 'man PKGBUILD'.
# NOTE: Please fill out the license field for your package! If it is unknown,
# then please put 'unknown'.

# Maintainer: Your Name <youremail@domain.com>
pkgname=BeautifulSoup
pkgver=3.0.8.1
pkgrel=1
pkgdesc="a Python HTML/XML parser "
arch=('i686' 'x86_64')
url="http://www.crummy.com/software/BeautifulSoup"
license=('BSD')
#groups=()
depends=(python)
#makedepends=()
#optdepends=()
#provides=()
#conflicts=()
#replaces=()
#backup=()
#options=()
#install=
#changelog=
source=(http://www.crummy.com/software/BeautifulSoup/download/3.x/$pkgname-$pkgver.tar.gz)
#noextract=()
md5sums=('d2f7b6b25bd26cd15e8b8a60ecc49c90')

build() {
  cd "$srcdir/$pkgname-$pkgver"

python2 setup.py install --prefix=/usr --root=$pkgdir || return 1
}

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

Offline

#2 2010-11-06 14:54:21

wonder
Developer
From: Bucharest, Romania
Registered: 2006-07-05
Posts: 5,941
Website

Re: Question about my first PKGBUILD

better use python-beautifulsoup like this

pkgname=python-beautifulsoup
pkgbasename=BeautifulSoup
...
source=(http://www.crummy.com/software/BeautifulSoup/download/3.x/$pkgbasename-$pkgver.tar.gz)
...
cd "$srcdir/$pkgbasename-$pkgver"

Also drop empty vars instead of commenting

Last edited by wonder (2010-11-06 15:08:12)


Give what you have. To someone, it may be better than you dare to think.

Offline

#3 2010-11-06 15:02:57

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: Question about my first PKGBUILD

This app is already in the community repo - it's called beautiful-soup. You can have a look at the PKGBUILD for comparison.

In no particular order:
- pkgname is always lower case
- remove unused fields
- 'return 1' is not required
- depends=('python2')

Offline

#4 2010-11-06 15:06:54

Kasumi_Ninja
Member
Registered: 2009-12-31
Posts: 54

Re: Question about my first PKGBUILD

Thanks! I adjusted it to:


# Maintainer: Your Name <youremail@domain.com>
pkgname=python-beautifulsoup
pkgnamebase=BeautifulSoup
pkgver=3.0.8.1
pkgrel=1
pkgdesc="a Python HTML/XML parser "
arch=('i686' 'x86_64')
url="http://www.crummy.com/software/BeautifulSoup"
license=('BSD')
depends=(python)
source=(http://www.crummy.com/software/BeautifulSoup/download/3.x/$pkgbasename-$pkgver.tar.gz)
md5sums=('d2f7b6b25bd26cd15e8b8a60ecc49c90')

build() {
  cd "$srcdir/$pkgname-$pkgver"

python2 setup.py install --prefix=/usr --root=$pkgdir || return 1
}

Last edited by Kasumi_Ninja (2010-11-06 15:07:04)

Offline

#5 2010-11-06 15:09:27

Kasumi_Ninja
Member
Registered: 2009-12-31
Posts: 54

Re: Question about my first PKGBUILD

tomk wrote:

This app is already in the community repo - it's called beautiful-soup. You can have a look at the PKGBUILD for comparison.

In no particular order:
- pkgname is always lower case
- remove unused fields
- 'return 1' is not required
- depends=('python2')

Thanks! I searched for python-beautifulsoup, python- and beautifulsoup in the package database but couldn't find anything

Offline

#6 2010-11-06 20:05:52

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: Question about my first PKGBUILD

Understandable - don't know why it's hyphenated like that, it really shouldn't be.

Offline

#7 2010-11-06 20:17:37

wonder
Developer
From: Bucharest, Romania
Registered: 2006-07-05
Posts: 5,941
Website

Re: Question about my first PKGBUILD

open a bug and suggest python2-beautifulsoup name. i guess that package is in repo since long time ago and we didn't have a python naming scheme


Give what you have. To someone, it may be better than you dare to think.

Offline

Board footer

Powered by FluxBB