You are not logged in.

#1 2006-01-11 19:46:45

RobK
Member
Registered: 2005-12-07
Posts: 121

Creating a Package for a System Binary

I am creating a package for a system binary going into /sbin.  It is easy to manually compile and install the software.  Just run "make" and then "make install".  There is no ./configure step.  The resulting system binary is installed in /sbin. 

Here is my build script (modelled after the example in the manpage for makepkg):

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

Do I need to do this for system binaries going into /sbin?
Won't the last line with "mv ..." cause problems?

Can I replace the last two line with "make prefix=$startdir/pkg/sbin install"?

Rob

Offline

#2 2006-01-11 20:46:55

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

Re: Creating a Package for a System Binary

make prefix=$startdir/pkg/ will allow you to get rid of the last 'mv' command

Offline

#3 2006-01-11 21:16:15

RobK
Member
Registered: 2005-12-07
Posts: 121

Re: Creating a Package for a System Binary

makepkg is compiling the source code okay but it fails the "make prefix=.. install" step. 

==> Starting build()...
cc -c -O -Wall   ezusb.c -o ezusb.o
cc -c -O -Wall   main.c -o main.o
cc -o fxload ezusb.o main.o
/usr/bin/install -cD fxload /var/abs/local/fxload/pkg/usr/sbin/fxload
make: /usr/bin/install: Command not found
make: *** [install] Error 127
mv: cannot stat `/var/abs/local/fxload/pkg/usr/sbin': No such file or directory
==> ERROR: Build Failed.  Aborting...

The Makefile uses /usr/bin/install to install the binaries.  It is not on my arch system.  But I do have it on my other Linux boxes which run Slackware.

Where can I get /usr/bin/install for Arch?

Rob
P.S.  I am still confused about the right syntax for the "make .. install" line in my PKBUILD.
I tried "make prefix=$startdir/pkg install" but that appears to cause more problems. 

Can I just use "make prefix=$startdir/pkg/sbin install" or do I need to use two lines -- one with a mv command as in my original post?

Offline

#4 2006-01-11 21:20:55

Dusty
Schwag Merchant
From: Medicine Hat, Alberta, Canada
Registered: 2004-01-18
Posts: 5,986
Website

Re: Creating a Package for a System Binary

I have /bin/install. maybe you need to edit the makefile?

Dusty

Offline

#5 2006-01-11 22:05:56

RobK
Member
Registered: 2005-12-07
Posts: 121

Re: Creating a Package for a System Binary

Thanks Dusty.  I must have been asleep.  Yes I also found install in /bin (as opposed to /usr/bin).  So the easy solution is to use sed to edit the Makefile that comes with the source.

I got makepkg to work with the following build script in PKGBUILD:

build() {
  cd $startdir/src/$pkgname-$pkgver
  make || return 1
  sed -i 's|/usr/bin/install|/bin/install|' Makefile
  make prefix=$startdir/pkg/usr install
  mv $startdir/pkg/usr/sbin $startdir/pkg
}

Where do I submit my new package for inclusion in the arch repositories?

Rob

Offline

#6 2006-01-11 22:09:58

Dusty
Schwag Merchant
From: Medicine Hat, Alberta, Canada
Registered: 2004-01-18
Posts: 5,986
Website

Re: Creating a Package for a System Binary

aur.archlinux.org

Offline

#7 2006-01-11 22:40:20

RobK
Member
Registered: 2005-12-07
Posts: 121

Re: Creating a Package for a System Binary

Thanks Dusty.   

I also need to apologize to Phrakture.   Using "make prefix=$startdir/pkg" works.  In fact it works better since I noticed that my previous build script was putting the man pages in the wrong place -- /usr/usr/man/man8/fxload...  instead of /usr/man/man8/...

So here is my final build script which works fine.  I even checked the resulting package with namcap.

build() {
  cd $startdir/src/$pkgname-$pkgver
  make || return 1
  sed -i 's|/usr/bin/install|/bin/install|' Makefile
  make prefix=$startdir/pkg install
}

Rob

Offline

#8 2006-01-11 22:48:00

RobK
Member
Registered: 2005-12-07
Posts: 121

Re: Creating a Package for a System Binary

Oh one last question when I run "namcap PKGBUILD", I get the following warnings:

PKGBUILD (fxload)    W: Missing Maintainer tag
PKGBUILD (fxload)    W: Missing CVS Id tag
PKGBUILD (fxload)    W: Attempting to use specific sf.net mirror, use dl.sourceforge.net instead

The first warning is easy to fix.  The last warning I will need to ignore since the sourcecode is not located in all the mirrors.  (e.g.  It is in the Phoenix mirror but not the Atlanta mirror).

But what is this message -- Missing CVS Id Tag?

Rob

Offline

#9 2006-01-12 00:18:13

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

Re: Creating a Package for a System Binary

You should use a Contributor tag, not a Maintainer tag.  Maintainer tags are for devs and TU.
Disregard the 'Missing CVS Id tag ' message. It's for PKGBUILD in official repos.
Use the dl.sourceforge.net for the source. It will download the sources from a mirror that has them.

Offline

Board footer

Powered by FluxBB