#!/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.2} 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" # git clone https://github.com/freemed/tty0tty unpack_source $SRC $PACKAGE make mkdir -p $PKG/lib/modules/$KERNEL/misc/ install -m 0644 module/tty0tty.ko $PKG/lib/modules/$KERNEL/misc/ mkdir -p $PKG/lib/udev/rules.d cp $CWD/99-tty0tty.rules $PKG/lib/udev/rules.d mkdir -p $DOCS cp -a AUTHORS COPYING README README.md $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