You are not logged in.

#1 2006-05-27 14:49:42

iKevin
Member
From: Ann Arbor, MI
Registered: 2003-07-20
Posts: 132

How to install a package that does not use DESTDIR?

Hi All

I am trying to create a PKGBUILD for a package called cantera.  This package uses the standard "configure", "make", and "make install" process; however,  "--prefix" is supported but DESTDIR is not used.  Unfortunately, this package is very large (many files) and "make install" install with absolute path names.  Is there any strategies for handling this situation?  An example of another package that handles this would be great.

Thanks
Kevin

Offline

#2 2006-05-27 15:45:28

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: How to install a package that does not use DESTDIR?

Try this:

./configure --prefix=/usr
make || return 1
make prefix=$startdir/pkg/usr install

Offline

#3 2006-05-27 16:35:18

iKevin
Member
From: Ann Arbor, MI
Registered: 2003-07-20
Posts: 132

Re: How to install a package that does not use DESTDIR?

Seemed like a good idea.  But it didn't work.  Generally speaking, is it Makefile.in that I should look through when automake is used?

Kev

Offline

#4 2006-05-27 18:09:39

Snowman
Developer/Forum Fellow
From: Montreal, Canada
Registered: 2004-08-20
Posts: 5,212

Re: How to install a package that does not use DESTDIR?

Try with:

./configure --prefix=$startdir/pkg/usr
make
make install

I downloaded the source and it seems that will work.

Offline

#5 2006-05-27 20:38:39

iKevin
Member
From: Ann Arbor, MI
Registered: 2003-07-20
Posts: 132

Re: How to install a package that does not use DESTDIR?

Thanks Snowman.  That worked.
Kev

Offline

#6 2006-06-15 00:07:58

test1000
Member
Registered: 2005-04-03
Posts: 834

Re: How to install a package that does not use DESTDIR?

@Snowman: Just wondering: Is that a safe thing to do in most cases/always? Won't the program look for files in $startdir/pkg/usr hen it runs, or have i misunderstood something/how configure works?

Can someone give a good explanation of configure etc?


KISS = "It can scarcely be denied that the supreme goal of all theory is to make the irreducible basic elements as simple and as few as possible without having to surrender the adequate representation of a single datum of experience." - Albert Einstein

Offline

#7 2006-06-15 00:13:57

neotuli
Lazy Developer
From: London, UK
Registered: 2004-07-06
Posts: 1,204
Website

Re: How to install a package that does not use DESTDIR?

no, that's not safe to do in most cases. A lot of apps hardcode paths into their binaries.

The former method though, which looks like this:

./configure --prefix=/usr
make || return 1
make prefix=$startdir/pkg/usr install

should be safe most of the time.

Explanation?
Well, configure sets up various predefined variables, some of which the app might be hardcoding into its binaries. It also goes through and makes sure your system has all the needed libs, headers, and so forth, as well as stringing together compiler options to make it all work right. Then it goes on to generate a Makefile from a Makefile.in or similar, the "in" version being a generic version, and the final makefile being where things that are specific to the system have been filled in. Make will actually run the specified parts of the makefile, usually just plain "make" compiles everything, but does not install. "make install", obviously, installs, but one can add in variable names beteen the "make" and "install" to override variables in the make file, in this case we override prefix, often we'll override DESTDIR as well.

I hope that clears it up a bit.


The suggestion box only accepts patches.

Offline

#8 2006-06-15 11:56:11

TheGrudge
Member
Registered: 2006-06-15
Posts: 206
Website

Re: How to install a package that does not use DESTDIR?

It doesn't work for me, I get the following error:

/bin/install -c ijs_server_epsonepl -c /var/abs/local/epsoneplijs/pkg/usr/bin/ijs_server_epsonepl
/bin/install: cannot create regular file `/var/abs/local/epsoneplijs/pkg/usr/bin/ijs_server_epsonepl': No such file or directory
make: *** [install] Error 1
==> ERROR: Build Failed.  Aborting...

So I have to create a folder called usr/bin in my pkg-folder, then it will work.
But this is stupid, can't makepkg create those folders by itself?

Hmm ok tried creating the folders and still the same error, here is my PKGBUILD:

pkgname=epsoneplijs
pkgver=0.4.0
pkgrel=1
pkgdesc="a Epson EPL printer driver for ghostscript"
url="http://sourceforge.net/projects/epsonepl/"
source=($pkgname-$pkgver.tgz)
md5sums=('8bc16b9df5b2a4168abc773745b9b2d7')

build() {
  cd $startdir/src/$pkgname-$pkgver
  ./configure --prefix=/usr
  make || return 1
  make prefix=$startdir/pkg/usr install
}

Whats wrong, I don't get it...  sad


digiKam developer - www.digikam.org

Offline

#9 2006-06-15 12:09:34

TheGrudge
Member
Registered: 2006-06-15
Posts: 206
Website

Re: How to install a package that does not use DESTDIR?

OK now it worked...
added in PKGBUILD the following line:

mkdir -p $startdir/pkg/usr/bin

digiKam developer - www.digikam.org

Offline

#10 2006-06-15 12:22:17

brain0
Developer
From: Aachen - Germany
Registered: 2005-01-03
Posts: 1,382

Re: How to install a package that does not use DESTDIR?

Stuff like this happens when Makefiles use cp instead of install -D.

In cases where neither DESTDIR nor prefix (or PREFIX) work correctly, it is a good solution to fix the Makefile, or Makefile.in.

Offline

Board footer

Powered by FluxBB