You are not logged in.

#1 2011-10-12 21:18:08

shadyabhi
Member
From: Bangalore
Registered: 2010-05-23
Posts: 262
Website

Guide me in making AUR for a python package

This is the package http://pypi.python.org/pypi/BitTorrent-bencode/5.0.8

- This python package is wrongly packaged. http://stackoverflow.com/questions/2693 … ode-module
- Also, it contains a test directory. Is it a concern?

This is the AUR (thats wrong)

pkgname=python2-bencode
_realname=BitTorrent-bencode
pkgver=5.0.8
pkgrel=1
pkgdesc="The BitTorrent bencode python module as leight-weight, standalone package."
url="http://pypi.python.org/pypi/BitTorrent-bencode"
arch=('i686' 'x86_64')
license=('GPL')
depends=('python2')
makedepends=('python2-distribute')
source=(http://pypi.python.org/packages/source/B/BitTorrent-bencode/$_realname-$pkgver.tar.gz)
md5sums=('5ad77003d18fc2e698d8d0d83be78d11')
build(){
  cd "$srcdir/$_realname-$pkgver"

  # python2 fix
  for file in $(find . -name '*.py' -print); do
    sed -i 's_#!.*/usr/bin/python_#!/usr/bin/python2_' $file
    sed -i 's_#!.*/usr/bin/env.*python_#!/usr/bin/env python2_' $file
  done

  python2 setup.py install --root="$pkgdir" --optimize=1
}

Guide me in making a perfect PKGBUILD.

Offline

#2 2011-10-12 23:30:14

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,734
Website

Re: Guide me in making AUR for a python package

See /usr/share/pacman/PKGBUILD-python.proto

Offline

#3 2011-10-13 08:26:29

shadyabhi
Member
From: Bangalore
Registered: 2010-05-23
Posts: 262
Website

Re: Guide me in making AUR for a python package

I already have that kind of PKGBUILD. But, the problem here is basically how to patch the package.

Offline

#4 2011-10-13 19:33:20

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,734
Website

Re: Guide me in making AUR for a python package

The syntax of getting a patch to work... or?

Offline

#5 2011-10-13 20:39:43

shadyabhi
Member
From: Bangalore
Registered: 2010-05-23
Posts: 262
Website

Re: Guide me in making AUR for a python package

First, how to solve the issue. (bencode.py is not packaged together if I install using setup.py)

Prepare the patch for the same.

Offline

#6 2011-10-28 01:13:00

synthead
Member
Registered: 2006-05-09
Posts: 1,344

Re: Guide me in making AUR for a python package

What I do is get the sources and MD5s in the PKGBUILD, then makepkg -o.  I'll manually compile the sources but not install them, and when I have a few one-liners that make the magic happen, I put it into the build() section.  Then I'll rm -rf the $srcdir and actually try it with package { true; } as the package() function.  If that works, I'll try some install lines (instead of true) and run find against the $pkgdir.  If it all looks good, I'll make sure my dependencies are in check and pack it up.

Offline

Board footer

Powered by FluxBB