#!/bin/sh # # Copyright 2010, 2012, 2013, 2016, 2017 Patrick J. Volkerding, Sebeka, Minnesota, USA # All rights reserved. # # Redistribution and use of this script, with or without modification, is # permitted provided that the following conditions are met: # # 1. Redistributions of this script must retain the above copyright # notice, this list of conditions and the following disclaimer. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # Modified for Slint by Didier Spaier # Set initial variables: PRGNAM=brltty CWD=$(pwd) TMP=${TMP:-$CWD} SRCNAM=BRLTTY VERSION=6.4.1 PKG=$TMP/package-$PRGNAM BUILD=1slint OUTPUT=${OUTPUT:-$CWD} # Automatically determine the architecture we're building on: if [ -z "$ARCH" ]; then case "$( uname -m )" in i?86) export ARCH=i486 ;; arm*) export ARCH=arm ;; # Unless $ARCH is already set, use uname -m for all other archs: *) export ARCH=$( uname -m ) ;; esac fi if [ "$ARCH" = "x86_64" ]; then LIBDIRSUFFIX="64" else LIBDIRSUFFIX="" fi NUMJOBS=${NUMJOBS:-" -j7 "} rm -rf $PKG mkdir -p $PKG cd $TMP rm -rf brltty-$VERSION tar xf $CWD/$SRCNAM-$VERSION.tar.gz || exit 1 cd brltty-BRLTTY-$VERSION #git reset --hard $COMMIT || exit 1 #Remove the unneeded DOS/Windows stuff. rm -rf DOS Windows chown -R root:root . find . -perm 775 -exec chmod 755 {} \; find . -perm 700 -exec chmod 755 {} \; find . -perm 744 -exec chmod 755 {} \; find . -perm 664 -exec chmod 644 {} \; find . -perm 600 -exec chmod 644 {} \; # Let's help to find the headers shipped with speech-dispatcher CPPFLAGS="-I/usr/include -I/usr/include/speech-dispatcher" \ ./autogen PYTHON=/usr/bin/python3 \ ./configure \ --prefix=/usr \ --bindir=/bin \ --sbindir=/sbin \ --libdir=/lib${LIBDIRSUFFIX} \ --infodir=/usr/info \ --mandir=/usr/man \ --docdir=/usr/doc/brltty-$VERSION \ --htmldir=/usr/doc/brltty-$VERSION/html \ --pdfdir=/usr/doc/brltty-$VERSION/pdf \ --with-writable-directory=/var/brltty \ --sysconfdir=/etc \ --localstatedir=/var \ --disable-java-bindings \ --without-espeak \ --with-privilege-parameters=lx:user=brltty,lx:path=/bin:/usr/bin,ls:sfcmode=log,lx:shell=/bin/bash \ --build=$ARCH-slackware-linux make -j4 || exit 1 make install INSTALL_ROOT=$PKG || exit 1 chmod 755 $PKG/bin/* $PKG/lib${LIBDIRSUFFIX}/brltty/* make install-udev INSTALL_ROOT=$PKG || exit 1 make install-polkit INSTALL_ROOT=$PKG || exit 1 ( cd $PKG find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null ) # bp2cf comes handy to customize the config file mkdir -p $PKG/usr/sbin cp Bootdisks/bp2cf $PKG/usr/sbin mkdir -p $PKG/usr/doc/brltty-$VERSION cp -a \ doc/README \ doc/LICENSE* \ doc/TODO \ doc/CONTRIBUTORS \ doc/HISTORY \ doc/Manual-BRLTTY \ doc/*html \ $PKG/usr/doc/brltty-$VERSION ( cd $PKG/usr/doc/brltty-$VERSION find . -name "Makefile*" -exec rm -f {} \; find . -name "*.sgml" -exec rm -f {} \; find . -size 0 -type f -exec rm -f {} \; ) # If there's a ChangeLog, installing at least part of the recent history # is useful, but don't let it get totally out of control: if [ -f doc/ChangeLog ]; then head -n 1000 doc/ChangeLog> $PKG/usr/doc/brltty-$VERSION/ChangeLog fi gzip -9 $PKG/usr/man/man?/*.? mkdir -p $PKG/etc cp -a Documents/brltty.conf $PKG/etc/brltty.conf.new mkdir -p $PKG/etc/rc.d cp -a $CWD/rc.brltty $PKG/etc/rc.d/rc.brltty.new mkdir -p $PKG/install cp $CWD/slack-desc $PKG/install/slack-desc cp $CWD/doinst.sh $PKG/install/doinst.sh mkdir $PKG/sbin cp $CWD/wrapupgradepkg $PKG/sbin || exit 1 chmod 755 $PKG/sbin/wrapupgradepkg chown -R root:root $PKG cd $PKG /sbin/makepkg -l y -c n $CWD/$PRGNAM-$VERSION-$ARCH-$BUILD.txz