Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

[SOLVED] Packagebuild fails

User discussion about Debian Development, Debian Project News and Announcements. Not for support questions.
Post Reply
Message
Author
User avatar
p00d73
Posts: 32
Joined: 2012-05-19 15:06
Location: Belgium

[SOLVED] Packagebuild fails

#1 Post by p00d73 »

Hi, I'm trying to get a package that uses a Python script to process some files. I use os.environ['DESTDIR'], example in the script:

Code: Select all

cremona_root = os.path.join(os.environ['DESTDIR'], 'usr', 'share', 'cremona')
My Makefile looks like this (there's no compiling needed):

Code: Select all

all:
	python buildEllipticCurves.py
Building the package gives following errors, on all the lines where I use os.environ['DESTDIR']:

Code: Select all

Traceback (most recent call last):
  File "buildEllipticCurves.py", line 81, in <module>
    install_cremona()
  File "buildEllipticCurves.py", line 9, in install_cremona
    cremona_root = os.path.join(os.environ['DESTDIR'], 'usr', 'share', 'cremona')
  File "/usr/lib/python2.7/UserDict.py", line 23, in __getitem__
    raise KeyError(key)
KeyError: 'DESTDIR'
Why can't Python find DESTDIR? Doesn't "make" set DESTDIR automatically at the start?
Last edited by p00d73 on 2012-06-18 15:19, edited 1 time in total.
Debian sid AMD64 + Xfce *** Linux Mint 13 AMD64 + Cinnamon *** Debian Wheezy ARM + Enlightenment *** Ångström ARM + Xfce

User avatar
stevepusser
Posts: 12930
Joined: 2009-10-06 05:53
Has thanked: 41 times
Been thanked: 71 times

Re: Packagebuild fails

#2 Post by stevepusser »

I don't know about python, but in the debian/rules makefiles that I've seen, it's been inside curly brackets:

Code: Select all

DESTDIR= /usr/share
...
...

cp something.py ${DESTDIR}/cremora
Though you can also just use /debian/install files to manually put any file anyplace you wish:

Code: Select all

something.py usr/share/cremora
MX Linux packager and developer

User avatar
p00d73
Posts: 32
Joined: 2012-05-19 15:06
Location: Belgium

Re: Packagebuild fails

#3 Post by p00d73 »

Apparently scripts that are called from the Makefile don't support the DESTDIR environment variable, I changed them all to a real path.
Debian sid AMD64 + Xfce *** Linux Mint 13 AMD64 + Cinnamon *** Debian Wheezy ARM + Enlightenment *** Ångström ARM + Xfce

Post Reply