You are not logged in.

#1 2005-04-23 00:47:12

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

Openswan Makefile needs changing - how?

I've just put together an initial PKGBUILD for Openswan - it looks like this:

# Contributor: Tom Killian <tomk@runbox.com>

pkgname=openswan
pkgver=2.3.1
pkgrel=1
pkgdesc="Open Source implementation of IPsec for the Linux operating system"
url="http://www.openswan.org"
depends=('iproute' 'gmp')
source=(http://www.openswan.org/download/$pkgname-$pkgver.tar.gz)

build() {
  cd $startdir/src/$pkgname-$pkgver
  make programs || return 1
  make DESTDIR=$startdir/pkg install
}

Note the absence of ./configure - this is correct, according to the README. However, it means that I can't specify prefix=/usr, so my package has everything in /usr/local.

Now AFAICS, this path is set in a secondary Makefile called Makefile.inc, which is included in the master Makefile. The relevant section of Makefile.inc looks like this:

# "local" part of tree, used in building other pathnames
INC_USRLOCAL=/usr/local

What would be the easiest was for a novice like me to change that to /usr?

Offline

#2 2005-04-23 01:17:42

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: Openswan Makefile needs changing - how?

the best way to handle such things is to take the Makefile.inc and copy it next to your PKGBUILD... add it in the source=() line too.  This file would then be part of the build process in the same way a package.install file is.

then, change the file to suit your needs...
in the PKGBUILD, just do something like:

cp $startdir/src/Makefile.inc $startdir/src/package-1.0/
make

Offline

#3 2005-04-23 10:27:33

JGC
Developer
Registered: 2003-12-03
Posts: 1,664

Re: Openswan Makefile needs changing - how?

If it's only a /usr/local to /usr change, this would help:

sed -i -e 's:/usr/local:/usr:g' Makefile.inc

Put it inside your PKGBUILD at the point you want to edit the Makefile.inc

Offline

#4 2005-04-23 19:41:38

sarah31
Member
From: Middle of Canada
Registered: 2002-08-20
Posts: 2,975
Website

Re: Openswan Makefile needs changing - how?

the problem I still see is that the buid will directly install the files onto your computer. it is best that you probably get the package to build within the directory you are working in then copy the files over to the pkg/ directory.

I dunno i haven't tried your PKGBUILD and have no way of testing it. You will likely have success using components of all the suggestions so far.


AKA uknowme

I am not your friend

Offline

#5 2005-04-23 23:52:49

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

Re: Openswan Makefile needs changing - how?

Thanks for the suggestions folks. I've tried both ways, and they both work - I think I'll go with the sed method, so I don't have to worry about additional source files.

sarah31 - I don't understand your post. I've specified DESTDIR in the make install command, so how will the build directly install the files onto my computer?

Offline

#6 2005-04-24 00:21:14

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

Re: Openswan Makefile needs changing - how?

The PKGBUILD looks like this now:

# Contributor: Tom Killian <tomk@runbox.com>

pkgname=openswan
pkgver=2.3.1
pkgrel=1
pkgdesc="Open Source implementation of IPsec for the Linux operating system"
url="http://www.openswan.org"
depends=('iproute' 'gmp' 'perl')
backup=('/etc/ipsec.conf' '/etc/ipsec.secrets' '/etc/ipsec.d/')
source=("http://www.openswan.org/download/$pkgname-$pkgver.tar.gz")
md5sums=('3dcf1cd7efcbe8db3148fc288d429db1')

build() {
  #cp $startdir/src/Makefile.inc $startdir/src/$pkgname-$pkgver/
  mkdir -p $startdir/pkg/etc/rc.d
  cd $startdir/src/$pkgname-$pkgver
  sed -i -e 's:/usr/local:/usr:g' Makefile.inc
  make programs || return 1
  make DESTDIR=$startdir/pkg install
  rm -r $startdir/pkg/etc/rc[0-6].d
}

And the resulting package looks good - except for one thing. If I compile and install the app manually, I get files in five directories under /usr/local, as follows:

/lib
/libexec
/man
/sbin
/share

In the package, I have four directories under /usr (thanks to that sed command), as follows:

/lib
/libexec
/man
/sbin

The contents of these four directories are identical to their counterparts in the manual install.

The missing /share directory contains the documentation in html - essentially all the man pages, linked together with a TOC. The obvious implication is that the change from /usr/local to /usr has affected this somehow. I'm picking my way through the various Makefiles to see if I can spot anything.

Any suggestions would be gratefully received.

Offline

#7 2005-05-06 14:17:51

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

Re: Openswan Makefile needs changing - how?

I've now put Openswan in the AUR, having solved the problems I was having. In particular, I'll admit to being lazy, and initially not reading the Arch Packaging Guidelines, which immediately explained the missing documentation  :oops:  :oops: .....

Offline

Board footer

Powered by FluxBB