Page 1 of 1
[SOLVED] problem with slkbuild
Posted: 8. Jan 2010, 14:38
by tasodan
I've a problem with slkbuild, i want to create a package txz of this: But the source code doesn't use the classical sequence configure ---> make ---> make install, but "python setup.py install", so this was the build section of SLKBUILD that I've created:
Code: Select all
build() {
cd $startdir/src/$pkgname-$pkgver
python setup.py install -O1 --root="$startdir/pkg" --prefix=/usr
}
This creates file build-poackage.sh but it doesn't run:
Code: Select all
root[trash-cli]# sh build-package.sh
tar -xf package.tar.gz
Traceback (most recent call last):
File "setup.py", line 27, in <module>
from setuptools import setup
ImportError: No module named setuptools
build() failed.
How can I adjust my SLKBUILD?
EDIT: I solved installing setuptools...ahahah

Re: problem with slkbuild
Posted: 8. Jan 2010, 15:29
by thenktor
Yes, not a slkbuild but a python problem

Re: [SOLVED] problem with slkbuild
Posted: 8. Jan 2010, 18:01
by Shador
Usually before packaging a program, it's recommendable to build it "manually". As the last message told you your build() function failed and that's (almost) always your fault.
In this case it's as simple as installing my setuptools package from the repo (setuptools is afaik always build-time only dependency).

The error message is quite clear about it, too. Oh and don't panic due to errors, reading it solves the problem usually much faster and saves much time.

Re: [SOLVED] problem with slkbuild
Posted: 8. Jan 2010, 19:26
by thenktor
Shador wrote:Usually before packaging a program, it's recommendable to build it "manually".
Not really needed. Just add a "|| return 1" after every important command (e.g. configure, make) and if something goes wrong you'll see the same error message as in a manual build immediately.
Re: [SOLVED] problem with slkbuild
Posted: 9. Jan 2010, 01:01
by Shador
thenktor wrote:Shador wrote:Usually before packaging a program, it's recommendable to build it "manually".
Not really needed. Just add a "|| return 1" after every important command (e.g. configure, make) and if something goes wrong you'll see the same error message as in a manual build immediately.
That was not my point. It's make sense to know how to build a program before actually packaging it. This means for me that one has the deps installed, too.
Anyway that's what he already got, as it was the last command. Good tip though.

I already thought about using 'set -e' in my build scripts, which would exit on any error (with exceptions of course like ||, !, if, ...). This would force the exact opposite because for any "allowed" failure one had to append a "|| true".
Re: [SOLVED] problem with slkbuild
Posted: 9. Jan 2010, 01:16
by thenktor
Yes, you're right. It may be a good idea to build manually first.
I've done this in the past, too. But in the meanwhile I've packages so much stuff, that I start right from the beginning with slkbuild. You just get used to such things

Re: [SOLVED] problem with slkbuild
Posted: 9. Jan 2010, 15:35
by toothandnail
I find that my most frequent problems are making sure that everyting goes in the right place (so docs in /usr/doc/<pkgname>-<pkgver>, .dekstop in /usr/share/applications, etc). As a result, I always use slkbuild first. If it generates a package, I check the package for location specific stuff, then try the package out if everything had gone to the correct place.
Running the build-<pkgname> script with '2>&1 | tee build<pkgname>.log' means that I usually have a record of any configure or build errors anyway, so it is usually a last resort to try to build the application manually.
paul.
Re: [SOLVED] problem with slkbuild
Posted: 9. Jan 2010, 16:49
by thenktor
toothandnail wrote:Running the build-<pkgname> script with '2>&1 | tee build<pkgname>.log' means that I usually have a record of any configure or build errors anyway, so it is usually a last resort to try to build the application manually.
Try "slkbuild -X"
