#!/bin/sh # # This script generate some valid Slackware packages # # # Some variables. # CWD=`pwd` PACKAGE=@PACKAGE@.tgz SLCK=$CWD/slack PREFIX=@prefix@ PKG=$CWD/slktmp TMPBUILD=$CWD/tmpbuild #DOINSTDIR=/install # # Create package description for pkgtool. # do_descr() { cat > package_descriptions << EOF @PACKAGE@: @PACKAGE@ @SPEC_VERSION@. @PACKAGE@: @PACKAGE@: xine is a free gpl-licensed video player for unix-like systems. @PACKAGE@: We support mpeg-2 and mpeg-1 system (audio + video multiplexed) streams, @PACKAGE@: eventually mpeg-4 and other formats might be added. @PACKAGE@: xine plays the video and audio data of mpeg-2 videos and synchronizes @PACKAGE@: the playback of both. Depending on the properties of the mpeg stream, @PACKAGE@: playback will need more or less processor power, 100% frame rate @PACKAGE@: has been seen on a 400 MHz P II system. EOF } # # Building binaries process, then install and move package in right place # do_build() { cd $CWD rm -rf $TMPBUILD mkdir -p $TMPBUILD cd $TMPBUILD && tar -xzf $CWD/@TAR_NAME@.tar.gz cd @TAR_NAME@ DIE=1 ./configure --prefix=$PREFIX && make && make install-strip prefix=$PKG/$PREFIX && \ cd $PKG && \ echo "n" | makepkg $PACKAGE && \ mv $PACKAGE $SLCK && \ cd $SLCK && DIE=0 do_descr } # # Cleaning building directory # do_clean() { rm -rf $TMPBUILD rm -f $PACKAGE package_descriptions rm -rf $PKG cd $CWD } # # Build for PPro # build_pentiumpro() { echo "*****************************************************" echo echo "building slack for @PACKAGE@ @VERSION@" echo echo "current architecture:pentiumpro" echo "slackware package will be copied to ./slack directory" echo echo "*****************************************************" rm -rf $PKG export XINE_BUILD=i686-pc-linux-gnu do_build if test "$DIE" -eq 0; then tar -czvf @PACKAGE@-@VERSION@-i686.tar.gz $PACKAGE package_descriptions fi do_clean } # # Build for Pentium # build_pentium() { echo "*****************************************************" echo echo "building slack for @PACKAGE@ @VERSION@" echo echo "current architecture:pentium" echo "slackware package will be copied to ./slack directory" echo echo "*****************************************************" rm -rf $PKG export XINE_BUILD=i586-pc-linux-gnu do_build if test "$DIE" -eq 0; then tar -czvf @PACKAGE@-@VERSION@-i586.tar.gz $PACKAGE package_descriptions fi do_clean } # # Build for K6 # build_k6() { echo "*****************************************************" echo echo "building slack for @PACKAGE@ @VERSION@" echo echo "current architecture:k6" echo "slackware package will be copied to ./slack directory" echo echo "*****************************************************" rm -rf $PKG export XINE_BUILD=k6-pc-linux-gnu do_build if test "$DIE" -eq 0; then tar -czvf @PACKAGE@-@VERSION@-k6.tar.gz $PACKAGE package_descriptions fi do_clean } # # Build for K7 # build_k7() { echo "*****************************************************" echo echo "building slack for @PACKAGE@ @VERSION@" echo echo "current architecture:k7" echo "slackware package will be copied to ./slack directory" echo echo "*****************************************************" rm -rf $PKG export XINE_BUILD=athlon-pc-linux-gnu do_build if test "$DIE" -eq 0; then tar -czvf @PACKAGE@-@VERSION@-k7.tar.gz $PACKAGE package_descriptions fi do_clean } # # Main function # main() { rm -rf $SLCK mkdir -p $SLCK rm -f config.cache && ./autogen.sh && make dist build_pentiumpro build_pentium build_k6 build_k7 mv -f $CWD/@TAR_NAME@.tar.gz $SLCK } # # Handle arguments if available. # build_arch() { rm -rf $SLCK mkdir -p $SLCK rm -f config.cache && ./autogen.sh && make dist $barch mv -f $CWD/@TAR_NAME@.tar.gz $SLCK } case "$1" in pentiumpro | ppro | i686 | 686) barch=build_pentiumpro build_arch ;; pentium | i586 | 586) barch=build_pentium build_arch ;; k6) barch=build_k6 build_arch ;; k7 | athlon) barch=build_k7 build_arch ;; *) main ;; esac