#!/bin/bash # # tty0tty.SlackBuild is free software; you can redistribute it and/or modify it under the # terms of the GNU General Public License as published by the Free Software # Foundation; either version 2 of the License, or any later version. # # tty0tty.SlackBuild is distributed in the hope that it will be useful, but WITHOUT ANY # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR # A PARTICULAR PURPOSE. See the GNU General Public License for more details. # # You should have received a copy of the GNU General Public License along with # this program; if not, write to the Free Software Foundation, Inc., 59 Temple # Place - Suite 330, Boston, MA 02111-1307, USA # # default settings PACKAGE="tty0tty" PACKAGE_EXT="gz" VERSION=${VERSION:=1.4} BUILD=${BUILD:=1} KERNEL=${KERNEL:-$(uname -r)} KERNELPATH=${KERNELPATH:-/lib/modules/$KERNEL/build} if [ -f ~/.slackbuildrc ]; then . ~/.slackbuildrc elif [ -f ../../runtime/slackbuildrc ]; then . ../../runtime/slackbuildrc fi PVERSION=${PVERSION}_$(echo ${KERNEL} | tr '-' '_') check_required SRC="$PACKAGE-$VERSION.tar.$PACKAGE_EXT" URL="https://github.com/lcgamboa/tty0tty/archive/refs/tags/v${VERSION}.tar.gz" get_source $SRC $URL unpack_source $SRC $PACKAGE-$VERSION # Build and install kernel module. ( cd module mkdir -p $PKG/lib/modules/$KERNEL/misc/ make #DEBFLAGS=" -O -DTTY0TTY_MINORS=16" make -C /lib/modules/$(uname -r)/build M=$PWD modules install -m 0644 tty0tty.ko $PKG/lib/modules/$KERNEL/misc/ ) mkdir -p $PKG/lib/udev/rules.d cp $CWD/99-tty0tty.rules $PKG/lib/udev/rules.d ( cd ssniffer make install -D -m 0755 ssniffer $PKG/usr/bin/ssniffer ) mkdir -p $DOCS cp -a AUTHORS COPYING README* $DOCS mkdir -p $PKG/install cat << EOF > $PKG/install/doinst.sh /sbin/depmod -a $KERNEL /sbin/udevadm control --reload EOF fixup_package $PKG # Clean up the extra stuff: set +u if [ "$1" = "--cleanup" ]; then rm -rf $TMP/$PACKAGE-$VERSION rm -rf $PKG fi