network/driftnet: Fix build with giflib 5.1.

Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
This commit is contained in:
Willy Sudiarto Raharjo 2016-01-04 23:15:22 +07:00
parent 37d75946ea
commit bf4c85e145
2 changed files with 40 additions and 9 deletions

View file

@ -3,8 +3,8 @@
# Written by JK Wood <joshuakwood@gmail.com>
PRGNAM=driftnet
VERSION=0.1.6_p20090401
BUILD=${BUILD:-2}
VERSION=${VERSION:-0.1.6_p20090401}
BUILD=${BUILD:-3}
TAG=${TAG:-_SBo}
if [ -z "$ARCH" ]; then
@ -44,15 +44,18 @@ tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
cd $PRGNAM-$VERSION
chown -R root:root .
find -L . \
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 -o -perm 511 \) \
-exec chmod 755 {} \; -o \
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
-exec chmod 644 {} \;
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
-o -perm 511 \) -exec chmod 755 {} \; -o \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
# Clean up building with libpng14 - thanks Gentoo!
sed -i -e 's:png_set_gray_1_2_4_to_8:png_set_expand_gray_1_2_4_to_8:' png.c
LDFLAGS="-lpng14" \
# patch for giflib 5.1.x
patch -p1 < $CWD/driftnet.patch
LDFLAGS="-lpng16" \
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
ARCH="$ARCH" \
@ -65,8 +68,7 @@ strip --strip-unneeded $PKG/usr/bin/driftnet
gzip -9c driftnet.1 > $PKG/usr/man/man1/driftnet.1.gz
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a CHANGES COPYING CREDITS README TODO \
$PKG/usr/doc/$PRGNAM-$VERSION
cp -a CHANGES COPYING CREDITS README TODO $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
find $PKG/usr/doc -type f -exec chmod 644 {} \;

View file

@ -0,0 +1,29 @@
--- driftnet-0.1.6_p20090401/gif.c.old 2016-01-04 23:08:50.734142148 +0700
+++ driftnet-0.1.6_p20090401/gif.c 2016-01-04 23:11:58.759931300 +0700
@@ -20,7 +20,7 @@
*/
int gif_load_hdr(img I) {
GifFileType *g;
- g = I->us = DGifOpenFileHandle(fileno(I->fp));
+ g = I->us = DGifOpenFileHandle(fileno(I->fp), NULL);
if (!I->us) {
I->err = IE_HDRFORMAT;
return 0;
@@ -36,7 +36,7 @@
* Abort loading a GIF file after the header is done.
*/
int gif_abort_load(img I) {
- DGifCloseFile((GifFileType*)I->us);
+ DGifCloseFile((GifFileType*)I->us, NULL);
return 1;
}
@@ -114,7 +114,7 @@
ret = 1;
fail:
- DGifCloseFile(g);
+ DGifCloseFile(g, NULL);
return ret;
}