slackbuilds

Personal Slackbuilds in the style of slackbuilds.org
git clone git://git.danielmoch.com/slackbuilds.git
Log | Files | Refs

surf.SlackBuild (2746B)


      1 #!/bin/sh
      2 
      3 # Slackware build script for surf
      4 
      5 # Written by B. Watson (yalhcru@gmail.com)
      6 # Modified by Daniel Moch <daniel@danielmoch.com>
      7 
      8 # Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
      9 
     10 # 20170625 bkw:
     11 # - updated for v2.0 (webkit2gtk now required).
     12 # - re-work searchengines.diff and homepage.diff for v2.0.
     13 # - remove "sw" search from searchengines.diff, since packages.slackware.eu
     14 #   no longer exists. Before you ask, no, I can't replace it with the official
     15 #   search at packages.slackware.com, because searchengines.diff only does
     16 #   HTTP GET requests. Find me a working Slackware package search that doesn't
     17 #   require a POST request, and I'll add it to searchengines.diff.
     18 
     19 # 20170121 bkw:
     20 # - updated for v0.7.
     21 # - remove patches/startfullscreen.diff as it's integrated into 0.7
     22 # - update homepage.diff and searchengines.diff for 0.7
     23 
     24 PRGNAM=surf
     25 VERSION=${VERSION:-2.0}
     26 BUILD=${BUILD:-1}
     27 TAG=${TAG:-_djmoch}
     28 
     29 if [ -z "$ARCH" ]; then
     30   case "$( uname -m )" in
     31     i?86) ARCH=i586 ;;
     32     arm*) ARCH=arm ;;
     33        *) ARCH=$( uname -m ) ;;
     34   esac
     35 fi
     36 
     37 CWD=$(pwd)
     38 TMP=${TMP:-/tmp/djmoch}
     39 PKG=$TMP/package-$PRGNAM
     40 OUTPUT=${OUTPUT:-/tmp}
     41 
     42 if [ "$ARCH" = "i586" ]; then
     43   SLKCFLAGS="-O2 -march=i586 -mtune=i686"
     44   LIBDIRSUFFIX=""
     45 elif [ "$ARCH" = "i686" ]; then
     46   SLKCFLAGS="-O2 -march=i686 -mtune=i686"
     47   LIBDIRSUFFIX=""
     48 elif [ "$ARCH" = "x86_64" ]; then
     49   SLKCFLAGS="-O2 -fPIC"
     50   LIBDIRSUFFIX="64"
     51 else
     52   SLKCFLAGS="-O2"
     53   LIBDIRSUFFIX=""
     54 fi
     55 
     56 set -e
     57 
     58 rm -rf $PKG
     59 mkdir -p $TMP $PKG $OUTPUT
     60 cd $TMP
     61 rm -rf $PRGNAM-$VERSION
     62 tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
     63 cd $PRGNAM-$VERSION
     64 chown -R root:root .
     65 find -L . \
     66  \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 -o -perm 511 \) \
     67  -exec chmod 755 {} \; -o \
     68  \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
     69  -exec chmod 644 {} \;
     70 
     71 # Customization.
     72 
     73 cp $CWD/config.h .
     74 
     75 sed -i \
     76   -e 's,/usr/local,/usr,g' \
     77   -e "s,\<lib\>,lib$LIBDIRSUFFIX,g" \
     78   -e 's,share/man,man,g' \
     79   -e "s,-Os,$SLKCFLAGS," \
     80   config.mk
     81 
     82 make
     83 strip $PRGNAM
     84 make install DESTDIR=$PKG
     85 gzip -9 $PKG/usr/man/man?/*.?
     86 
     87 mkdir -p $PKG/usr/share/pixmaps
     88 cat $PRGNAM.png > $PKG/usr/share/pixmaps/$PRGNAM.png
     89 
     90 # .desktop written for this SlackBuild
     91 mkdir -p $PKG/usr/share/applications
     92 cat $CWD/$PRGNAM.desktop > $PKG/usr/share/applications/$PRGNAM.desktop
     93 
     94 mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
     95 cp -a LICENSE README TODO.md $PKG/usr/doc/$PRGNAM-$VERSION
     96 cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
     97 
     98 mkdir -p $PKG/install
     99 cat $CWD/slack-desc > $PKG/install/slack-desc
    100 cat $CWD/doinst.sh > $PKG/install/doinst.sh
    101 
    102 cd $PKG
    103 /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}