<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Søren Hansen wrote:
<blockquote cite="mid1119520373.30730.7.camel@localhost.localdomain"
 type="cite">
  <pre wrap="">tor, 23 06 2005 kl. 11:20 +0200, skrev Leslie Viljoen:
  </pre>
  <blockquote type="cite">
    <pre wrap="">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?
    </pre>
  </blockquote>
  <pre wrap=""><!---->
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.

  </pre>
  <blockquote type="cite">
    <pre wrap="">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.
    </pre>
  </blockquote>
  <pre wrap=""><!---->
I don't quite understand. To run the program, you need to run something
in /usr/share/... ?  Why is this not in /usr/bin ?
  </pre>
</blockquote>
No, you run the binary but first you have to change directory to<br>
/usr/share/tesseracttrainer/system because the binary is looking<br>
for files in it's current directory when you run it. <br>
<br>
To be perfectly clear, a file called "tesseracttrainer" gets installed<br>
in /usr/bin. This file is actually a script that does this:<br>
<br>
cd /usr/share/tesseracttrainer/system<br>
tesseracttrainer-binary<br>
<br>
Then the binary file uses files in it's current directory <br>
(/usr/share/tesseracttrainer/system)<br>
<br>
<br>
I don't know why it works this way, but if I have to tell upstream to<br>
change things, I'd like to know how the configure script passes this<br>
information to the binary that is built. <br>
<br>
ie. I can run ./configure --libdir=/my/cool/libdir and it will write<br>
a Makefile with an install target that puts the libraries in
/my/cool/libdir.<br>
Later the binary has to find these files, how does it know where they<br>
went?<br>
<br>
<br>
<br>
<blockquote cite="mid1119520373.30730.7.camel@localhost.localdomain"
 type="cite">
  <pre wrap="">
  </pre>
  <blockquote type="cite">
    <pre wrap="">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. 
    </pre>
  </blockquote>
  <pre wrap=""><!---->
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.

  </pre>
</blockquote>
<br>
</body>
</html>