You are not logged in.

#1 2009-02-13 04:34:25

thesame
Member
Registered: 2009-02-13
Posts: 13

setup.py to PKGBUILD

Is there a script that can create new PKGBUILD using setup.py?

Offline

#2 2009-02-13 04:42:58

tdy
Member
From: Sacremende
Registered: 2008-12-14
Posts: 440

Re: setup.py to PKGBUILD

What do you mean exactly?  If there is a setup.py file, you can just put this in the build function:

  python setup.py install --prefix=/usr --root="$pkgdir" || return 1

If you are asking something else, please clarify.

Last edited by tdy (2009-02-13 04:46:20)

Offline

#3 2009-02-13 04:45:55

thesame
Member
Registered: 2009-02-13
Posts: 13

Re: setup.py to PKGBUILD

I mean script that will generate new PKGBUILD. setup.py contains almost all information that is needed for PKGBUILD so why packager must write PKGBUILD by hands?

Offline

#4 2009-02-13 04:59:57

tdy
Member
From: Sacremende
Registered: 2008-12-14
Posts: 440

Re: setup.py to PKGBUILD

If someone has written a script for this, I don't know of it.  Python PKGBUILDs are so simple to write that it doesn't seem worth the effort to create such a parser.  You'd still have to manually fill in fields like (opt)depends, .install, source, md5sums, and possibly more depending on how much the author included in setup().

Last edited by tdy (2009-02-13 05:08:35)

Offline

#5 2009-03-29 00:02:10

warlord
Member
Registered: 2007-07-04
Posts: 58

Re: setup.py to PKGBUILD

tdy wrote:

What do you mean exactly?  If there is a setup.py file, you can just put this in the build function:

  python setup.py install --prefix=/usr --root="$pkgdir" || return 1

If you are asking something else, please clarify.

I have a pkgbuild with a install.py file that ignores everything after "python install.py" and tries to write at /usr/local/bin and not at $pkgdir.

Is there any way to set the root= prefix for the entire pkgbuild? Or to set it before the python command?

Offline

#6 2009-03-29 11:41:57

thesame
Member
Registered: 2009-02-13
Posts: 13

Re: setup.py to PKGBUILD

If you don't want to dive into depth setup script the easiest solution is to call install under chroot and then move all files to $pkgdir

Offline

#7 2009-03-29 12:07:24

warlord
Member
Registered: 2007-07-04
Posts: 58

Re: setup.py to PKGBUILD

If you mean use chroot in the PKGBUILd, this will give permission error, as chroot cannot be used by non root users.

Offline

Board footer

Powered by FluxBB