3 # Slackware build script for qutebrowser
5 # Copyright 2017 Maximilian Friederdorff
7 # This program is free software: you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation, either version 3 of the License, or
10 # (at your option) any later version.
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with this program. If not, see <http://www.gnu.org/licenses/>.
21 # set up some variables for the build process
23 if [ "$TMP" = "" ]; then
28 VERSION=${VERSION:-1.0.3}
31 # Detect the architecture
32 if [ -z "$ARCH" ]; then
33 case "$( uname -m )" in
34 i?86) export ARCH=i586 ;;
35 arm*) export ARCH=arm ;;
36 # Unless $ARCH is already set, use uname -m for all other archs:
37 *) export ARCH=$( uname -m ) ;;
41 if [ "$ARCH" = "i486" ]; then
42 SLKCFLAGS="-O2 -march=i486 -mtune=i686"
43 elif [ "$ARCH" = "x86_64" ]; then
47 NUMJOBS=${NUMJOBS:-" -j4 "}
52 # Clean build location in case of previous build attempts
55 rm -rf $TMP/$APP-$VERSION
60 tar -zxvf $CWD/${APP}-${VERSION}-1.tar.gz || exit 1
61 cd $APP-$VERSION || exit 1
63 # Ensure ownership and permissions are consistant
65 chmod -R u+w,go+r-w,a-s .
68 python3 setup.py build
69 python3 setup.py install --root="$PKG/" --optimize=1
70 install -dm755 $PKG/usr/share/qutebrowser/userscripts
71 find misc/userscripts -type f -exec install -m755 {} $PKG/usr/share/qutebrowser/userscripts \;
73 # Install documentation
74 a2x -f manpage doc/qutebrowser.1.asciidoc
75 install -Dm644 doc/qutebrowser.1 $PKG/usr/man/man1/qutebrowser.1
77 mkdir -p $PKG/usr/doc/$APP-$VERSION
78 cp -a README.asciidoc LICENSE MANIFEST.in doc/ $PKG/usr/doc/$APP-$VERSION
79 find $PKG/usr/doc/$APP-$VERSION -type f -exec chmod 644 {} \;
80 cat $CWD/$APP.SlackBuild > $PKG/usr/doc/$APP-$VERSION/$APP.SlackBuild
82 # Install slack-desc file
84 cat $CWD/slack-desc > $PKG/install/slack-desc
86 # Strip some libraries and binaries
88 # Compress man pages if they exist
89 if [ -d $PKG/usr/man ]; then
91 find . -type f -exec gzip -9 {} \;
92 for i in $(find . -type l) ; do ln -s $(readlink $i).gz $i.gz ; rm $i ; done
96 # Compress info pages if they exist (and remove the dir file)
97 if [ -d $PKG/usr/info ]; then
98 gzip -9 $PKG/usr/info/*.info
99 rm -f $PKG/usr/info/dir
104 /sbin/makepkg -l y -c n $TMP/$APP-$PKG_VERSION-$ARCH-$BUILD.tgz