Make use of $DESTDIR to allow proper package building

5 posts / 0 new
Last post
dietmarw
Offline
Joined: 2009-05-31
Make use of $DESTDIR to allow proper package building

Hi, I tried to create a small christmas present in the shape of debian package of JModelica.org. Unfortunately the way the Makefile is set up currently this is not possible.

In Makefile.am there are statements like:

cp $(abs_top_srcdir)/Compiler/ModelicaCompiler/bin/ModelicaCompiler.jar $(prefix)/lib/

These will fail when trying to build a debian/ubuntu package since it tries to copy to an absolute path. The error message one gets from debuild is then:

make[3]: Entering directory `/home/dietmarw/.workspace/JModelica.org/build-area/jmodelica-1.1b1'
cp /home/dietmarw/.workspace/JModelica.org/build-area/jmodelica-1.1b1/Compiler/ModelicaCompiler/bin/ModelicaCompiler.jar /usr/lib/
cp: kan ikke opprette alminellig fil «/usr/lib/ModelicaCompiler.jar»: Permission denied

To avoid this one needs to use $DESTDIR like this:

cp $(abs_top_srcdir)/Compiler/ModelicaCompiler/bin/ModelicaCompiler.jar $(DESTDIR)$(prefix)/lib/

in all places of install and uninstall. And of course this also needs to be incorporated in the configure process. Currently it will fail since $DESTDIR is not defined (i.e., empty)
Once this is corrected I can continue to build a proper package.

dietmarw
Offline
Joined: 2009-05-31
Looks like the $DESTDIR is

Looks like the $DESTDIR is defined by the debian build routine so no need to declare it seperately. It just needs to be added to the Makefiles,

hubertus
Offline
Joined: 2009-04-24
Build routines

I build team seems to be taking a well-deserved Christmas break, so I would not expect a response soon. If adding $DESTDIR to the Makefiles works, you can add it as a patch.

dietmarw
Offline
Joined: 2009-05-31
I wasn't really expecting any

I wasn't really expecting any reply before 2010 ;)

jakesson
Offline
Joined: 2009-03-14
Hi Dietmar!   Your efforts

Hi Dietmar!
 
Your efforts are greatly appreciated. I have updated Makefile.am so that $(DESTDIR)$(prefix) is used wherever $(prefix) was used before, see https://trac.jmodelica.org/ticket/566. Please let me know if you experience any problems or if there are additional improvements I can make to simplify packaging.
 
Best
/Johan 

Login or register to post comments