You are not logged in.

#1 2006-05-07 02:01:10

elasticdog
Member
From: Washington, USA
Registered: 2005-05-02
Posts: 995
Website

PKGBUILD Help: Man File isn't Being Installed Properly

I'm updating the optipng PKGBUILD for the AUR and am not quite grasping why the man file for it isn't being installed properly.  The man page was just added in the latest version by the developer, and from what I can tell the <code>gcc.mak</code> file tries to install it properly in the <code>/usr/local/man/</code> directory.  Here's the relevant portion of the make file:

prefix=/usr/local
mandir=${prefix}/man
man1dir=${mandir}/man1

install: $(OPTIPNG)
        -@if [ ! -d ${man1dir} ]; then mkdir -p ${man1dir}; fi
        -@rm -f ${man1dir}/optipng.1
        cp -p ../man/optipng.1 ${man1dir}

I also looked through the <code>makepkg</code> documentation, and it doesn't seem like that directory is one that automatically gets cleaned.  Ideally it should end up in </code>/usr/man/man1/</code>, right?  Will I have to copy it over myself, or am I missing something obvious?  If you want my updated PKGBUILD that I've been messing with, here it is:

# Contributer: Aaron Schaefer <aaron>
pkgname=optipng
pkgver=0.5.1
pkgrel=1
pkgdesc="A PNG optimizer that recompresses image files to a smaller size, without losing any information"
url="http://optipng.sourceforge.net/"
license=""
depends=('glibc')
source=(http://dl.sourceforge.net/sourceforge/$pkgname/$pkgname-$pkgver.tar.gz)
md5sums=('309239fb5f4dfa751f3b893bef58e316')

build() {
  cd $startdir/src/$pkgname-$pkgver/src
  make -f scripts/gcc.mak || return 1
  install -D -m755 optipng $startdir/pkg/usr/bin/optipng
}

Offline

#2 2006-05-07 04:08:08

Cerebral
Forum Fellow
From: Waterloo, ON, CA
Registered: 2005-04-08
Posts: 3,108
Website

Re: PKGBUILD Help: Man File isn't Being Installed Properly

This seems to work fine:

# Contributer: Aaron Schaefer <aaron>
pkgname=optipng
pkgver=0.5.1
pkgrel=1
pkgdesc="A PNG optimizer that recompresses image files to a smaller size, without losing any information"
url="http://optipng.sourceforge.net/"
license=""
depends=('glibc')
source=(http://dl.sourceforge.net/sourceforge/$pkgname/$pkgname-$pkgver.tar.gz)
md5sums=('309239fb5f4dfa751f3b893bef58e316')

build() {
  cd $startdir/src/$pkgname-$pkgver/src

  make -f scripts/gcc.mak prefix=/usr || return 1
  make -f scripts/gcc.mak prefix=$startdir/pkg/usr install || return 1

  #install -D -m755 optipng $startdir/pkg/usr/bin/optipng
}

The makefile has code to install the binary too, so I commented out the install line on the bottom.  Just make sure to set the prefix to $startdir/pkg/usr when installing so that it properly puts stuff in the pkg folder.

Offline

#3 2006-05-07 04:19:26

WillySilly
Member
Registered: 2005-01-14
Posts: 268

Re: PKGBUILD Help: Man File isn't Being Installed Properly

Looks like Cerebral beat me to the punch

Offline

#4 2006-05-07 04:27:44

elasticdog
Member
From: Washington, USA
Registered: 2005-05-02
Posts: 995
Website

Re: PKGBUILD Help: Man File isn't Being Installed Properly

So I can understand this...why did you run the make file twice?  Did you mean to leave in the line where it sets the prefix to just /usr?  Admittedly I'm learning here, thanks for your patience...

Offline

#5 2006-05-07 04:38:57

Cerebral
Forum Fellow
From: Waterloo, ON, CA
Registered: 2005-04-08
Posts: 3,108
Website

Re: PKGBUILD Help: Man File isn't Being Installed Properly

The first time I run the makefile is to build the app, I set prefix=/usr there in case it's needed anywhere in the real code to know where it's eventually being installed.

The second time, I actually run make install, which actually runs the install target you pointed to in the makefile - this target isn't called automatically.

Offline

#6 2006-05-07 05:17:31

elasticdog
Member
From: Washington, USA
Registered: 2005-05-02
Posts: 995
Website

Re: PKGBUILD Help: Man File isn't Being Installed Properly

Ahhhh...I'm a little slow.  :oops:  I didn't see the install part there.  Thanks for the hand-holding on this one...I'm finally starting to get how make files work!

Offline

#7 2006-05-07 05:33:58

Cerebral
Forum Fellow
From: Waterloo, ON, CA
Registered: 2005-04-08
Posts: 3,108
Website

Re: PKGBUILD Help: Man File isn't Being Installed Properly

Heh, not a problem.  I still balk at some of the really complicated makefiles out there from time to time - they can get pretty crazy, especially when ./configure is involved. wink

Offline

Board footer

Powered by FluxBB