rules

Leslie Viljoen leslie at camary.co.za
Thu Jun 23 06:36:10 CDT 2005


Søren Hansen wrote:

>tor, 23 06 2005 kl. 11:20 +0200, skrev Leslie Viljoen:
>  
>
>>Now is there a variable in the rules file that will give me the 
>>final /usr/share directory, like $(SHAREDIR), or can I hardcode that
>>to /usr/share?
>>    
>>
>
>The magic of creating a Debian or Ubuntu package is to make it install
>in one place, but expect to find stuff in another place. I.e. install in
>$(UCRDIR)/debian/foo/usr/bin, but look for libraries in /usr/lib.
>
>Just remember that everything you put in the rules file is gone when
>you're done creating the .deb, so it doesn't make any sense to use any
>special variables, as they will not exist once the .deb is created and
>installed.
>
>  
>
>>The package requires that the binary be executed from the 
>>/usr/share/tesseracttrainer/system directory, so on install I need to
>>create a script to change to that directory and then run the binary.
>>    
>>
>
>I don't quite understand. To run the program, you need to run something
>in /usr/share/... ?  Why is this not in /usr/bin ?
>  
>
No, you run the binary but first you have to change directory to
/usr/share/tesseracttrainer/system because the binary is looking
for files in it's current directory when you run it.

To be perfectly clear, a file called "tesseracttrainer" gets installed
in /usr/bin. This file is actually a script that does this:

cd /usr/share/tesseracttrainer/system
tesseracttrainer-binary

Then the binary file uses files in it's current directory
(/usr/share/tesseracttrainer/system)


I don't know why it works this way, but if I have to tell upstream to
change things, I'd like to know how the configure script passes this
information to the binary that is built.

ie. I can run ./configure --libdir=/my/cool/libdir and it will write
a Makefile with an install target that puts the libraries in 
/my/cool/libdir.
Later the binary has to find these files, how does it know where they
went?



>  
>
>>It seems a bit unorthodox - if this is not the right way(tm), what do
>>you do
>>in a situation like this? I know a program can access configure script
>>variables by using #include config.h, but installation path info is
>>not in there. 
>>    
>>
>
>The packaged programs should always expect to find their files
>in /usr/bin, /usr/lib, /usr/share etc., and NEVER in the debian/foo
>directory as that is merely a temporary location.
>
>  
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ubuntu.com/archives/ubuntu-devel/attachments/20050623/c03e1951/attachment-0001.htm


More information about the ubuntu-devel mailing list