#!/bin/bash # # vdelug4.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. # # vdeplug4.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 # # WARNING WARNING this build pollutes the system root WARNING WARNING # vdeplug4 depends on s2argv-execs and expects that to be installed. # Since we include that in this build and it is impossible (for me) to # let cmake know that it is installed in /tmp/package-vdeplug4/ that # library is installed in the root as well. # If someone knows how to deal with this, let me know. # default settings PACKAGE="vdeplug4" PACKAGE_EXT="gz" VERSION=${VERSION:=4.0.1} BUILD=${BUILD:=0d} PACKAGE2="vde2" PACKAGE_EXT2="gz" VERSION2=${VERSION2:=2.3.3} PACKAGE3="s2argv-execs" PACKAGE_EXT3="gz" VERSION3=${VERSION3:=1.4} if [ -f ~/.slackbuildrc ]; then . ~/.slackbuildrc elif [ -f ../../runtime/slackbuildrc ]; then . ../../runtime/slackbuildrc elif [ -f ../../source/runtime/slackbuildrc ]; then . ../../source/runtime/slackbuildrc fi check_required found=0 for installed_package in /var/log/packages/vde2* ; do if [ "$(package_name $installed_package)" = "vde2" ]; then # found one found=1 break fi done if [ $found != 0 ]; then echo "Conflicting package vde2 installed, please remove it first." exit 1 fi SRC="$PACKAGE-$VERSION.tar.$PACKAGE_EXT" URL="https://github.com/rd235/vdeplug4/archive/refs/tags/v${VERSION}.tar.$PACKAGE_EXT" get_source $SRC $URL unpack_source $SRC $PACKAGE-$VERSION SRC2="$PACKAGE2-$VERSION2.tar.$PACKAGE_EXT2" URL2="https://github.com/virtualsquare/vde-2/archive/refs/tags/v${VERSION2}.tar.$PACKAGE_EXT2" get_source $SRC2 $URL2 unpack_source $SRC2 vde-2-$VERSION2 SRC3="$PACKAGE3-$VERSION3.tar.$PACKAGE_EXT3" URL3="https://github.com/virtualsquare/s2argv-execs/archive/refs/tags/${VERSION3}.tar.$PACKAGE_EXT3" get_source $SRC3 $URL3 unpack_source $SRC3 $PACKAGE3-$VERSION3 mkdir -p $DOCS/$PACKAGE3 mkdir -p build cd build cmake \ -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \ -DCMAKE_INSTALL_PREFIX=/usr \ .. make make DESTDIR=$PKG install # Pollution !! make install cd .. cp -a COPYING README.md $DOCS/$PACKAGE3 cd $TMP/vde-2-$VERSION2 echo "" echo "=========================" echo " Build $PACKAGE2" echo "=========================" autoreconf --force --install CFLAGS="$SLKCFLAGS" ./configure \ --prefix=/usr \ --libdir=${LIBDIR} \ --sysconfdir=/etc \ --localstatedir=/ \ --mandir=/usr/share/man \ --enable-shared=yes \ --disable-static \ --enable-experimental \ --build=$ARCH-slackware-linux || exit 1 # Don't use -j3 make || exit 2 make DESTDIR=$PKG install # No .la files rm -f $PKG/${LIBDIR}/vde2/plugins/*.la $PKG/${LIBDIR}/vde2/*.la # Move configdir mv $PKG/etc/vde2 $PKG/etc/vdeplug4 mkdir -p $DOCS/$PACKAGE2 cp -a COPYING Changelog INSTALL README doc/README.* doc/*HOWTO $DOCS/$PACKAGE2 # Now build and install vdeplug4 echo "" echo "=========================" echo " Build $PACKAGE" echo "=========================" cd $TMP/$PACKAGE-$VERSION mkdir -p build cd build cmake \ -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \ -DCMAKE_INSTALL_PREFIX=/usr \ .. make make install DESTDIR=$PKG cd .. # Move these mv $PKG/usr/share/man $PKG/usr/ rm -rf $PKG/usr/share cp -a COPYING* README.md doc/howto* $DOCS cp $CWD/README.Slackware $DOCS # init mkdir -p $PKG/etc/rc.d install -m 755 $CWD/vdeplug4.init $PKG/etc/rc.d/rc.vdeplug4 # Examples. mkdir -p $PKG/etc/vdeplug4/conf.d install -m 644 $CWD/vde-config.sample $PKG/etc/vdeplug4/conf.d # Not installed obsolete command rm -f $PKG/usr/man/man1/vde_vxlan.1 # Backwards compatible link cd $PKG/etc ln -s vdeplug4 vde2 cd - fixup_package $PKG # Clean up the extra stuff: set +u if [ "$1" = "--cleanup" ]; then rm -rf $TMP/$PACKAGE-$VERSION rm -rf $PKG fi