You are not logged in.

#1 2006-05-11 22:49:20

copernikus
Member
From: Philadelphia, PA
Registered: 2005-12-09
Posts: 16

driftnet, 1st pkgbuild

Alright, I think I have a functional pkgbuild for driftnet, but want to make sure I am doing it right. Can someone review it and let me know.

pkgname=driftnet
pkgver=0.1.6
pkgrel=1
pkgdesc="Driftnet is a program which listens to network traffic and picks out images from TCP streams it observes. Fun to run on a host which sees lots of web traffic"
url="http://www.ex-parrot.com/~chris/driftnet/"
license=""
depends=('libjpeg', 'libungif', 'gtk', 'libpcap')
makedepends=('imake')
conflicts=()
replaces=()
backup=()
install=()
source=(http://www.ex-parrot.com/~chris/driftnet/$pkgname-$pkgver.tar.gz)
md5sums=('8e11d77770452f97bb3c23f510489815')

build() {
        cd $startdir/src/$pkgname-$pkgver
        patch < ../../driftnet.patch || return -1
        make DESTDIR=$startdir/pkg
        install -D -m755 $pkgname $startdir/pkg/usr/bin/$pkgname
}

and for the little patch to actually make it compile...

--- driftnet.c  2006-05-11 18:17:43.000000000 -0400
+++ ../src/driftnet-0.1.6/driftnet.c    2002-07-09 15:26:41.000000000 -0400
@@ -585,7 +585,7 @@
     } else {
         /* need to make a temporary directory. */
         for (;;) {
-            tmpdir = strdup(tmpnam(NULL));
+            tmpdir = strdup(mkstemp(NULL));
             if (mkdir(tmpdir, 0700) == 0)
                 break;
             free(tmpdir);

Offline

#2 2006-05-12 08:00:57

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

Re: driftnet, 1st pkgbuild

Just one thing wrong - the patch file should be included in the source= array, like this:

source=(http://www.ex-parrot.com/~chris/driftnet/$pkgname-$pkgver.tar.gz driftnet.patch)

with a corresponding entry in the md5sums= array, and path adjustment in the patch command.

Other than that, you can tidy it up a bit by removing fields with no value - conflicts etc.

Offline

#3 2006-05-21 07:22:36

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

Re: driftnet, 1st pkgbuild

hmm.. since nobody seems to be doing anything more i "fixed" it up and sent it to AUR.

thanks for the work copernikus!


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

#4 2006-05-21 15:34:52

copernikus
Member
From: Philadelphia, PA
Registered: 2005-12-09
Posts: 16

Re: driftnet, 1st pkgbuild

test1000 wrote:

hmm.. since nobody seems to be doing anything more i "fixed" it up and sent it to AUR.

thanks for the work copernikus!

heh... I've been meaning to put it in AUR, but with haven't had the time... thanks.

-Fran

Offline

#5 2006-10-18 03:56:14

nadman10
Member
From: Erie, PA
Registered: 2005-10-15
Posts: 200

Re: driftnet, 1st pkgbuild

How do you apply th patch?

Offline

#6 2006-10-21 01:54:13

djscholl
Member
From: Michigan, USA
Registered: 2006-05-24
Posts: 56

Re: driftnet, 1st pkgbuild

The patch is applied automatically by the build script in the PKGBUILD when makepkg is run. Look for the line:

patch < ../../driftnet.patch || return -1 

Offline

Board footer

Powered by FluxBB