[Distutils] stdeb-0.3 error
Gerry Reno
greno at verizon.net
Sat Sep 19 08:59:18 CEST 2009
Ok, I got the __file__ problem solved but now I want to do this whole
deb pkg create as just a single command in my own setup.py. How can I
do this?
I'm thinking something like:
# my setup.py
import stdeb
Command(mycmd):
initialize_option...
finalize_option...
run
sub_commands=[('sdist_dsc', None),]
system('dpgk-source ...)
print ".deb is here..."
Would this work and is this how to do it?
Regards,
Gerry
Andrew Straw wrote:
> Gerry Reno wrote:
>
>> sudo easy_install stdeb # brought in stdeb 0.3
>>
>> $ cd myappdir # where my setup.py is located
>>
>> $# following http://github.com/astraw/stdeb/ quickstart 1
>>
>> $ python -c "import stdeb; execfile('setup.py')" sdist_dsc && \
>>
>>> cd `find deb_dist -mindepth 1 -maxdepth 1 -type d` && \
>>> dpkg-buildpackage -rfakeroot -uc -us && \
>>> cd ../.. &&
>>> echo ".deb created successfully in deb_dist/"
>>>
>> Traceback (most recent call last):
>> File "<string>", line 1, in <module>
>> File "setup.py", line 41, in <module>
>>
>> sys.path.append(os.path.join(os.path.abspath(os.path.dirname(__file__)),
>> "bin"))
>> NameError: name '__file__' is not defined
>>
>
> You can use something more elaborate like
>
> python -c "import
> stdeb,sys;f='setup.py';sys.argv[0]=f;execfile(f,{'__file__':f,'__name__':'__main__'})"
> sdist_dsc
>
> for the first line.
>
>
>
More information about the Distutils-SIG
mailing list