#!/bin/bash # # Script : slackwarearm-current/source/x/x11/indibuild # Purpose: Build modular X.org packages, handling build numbers # and X.org section types (app/driver/util) automatically. # by Stuart Winter # # Copyright 2008-2010 Stuart Winter, Surrey, England. # 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. # # Building individual packages # ----------------------------- # This script aids with building, unattended, the individual components. # Before running this script, be sure to wipe the existing packages from the # 'slackware/x' directory. This helps determine if any of the builds failed/ # if there packages missing. # It's a bit clunky, but we love it :) # # Build numbers # ------------- # You can set specific build numbers by creating the # package name inside build-nums dir: # echo 2 > build-nums/xinit # # The way build numbers are handled in Slackware ARM is that # when building individual components (which is always the way # unless you're starting a port from scratch), you: # # 1. Check if there's a file with the package base name inside the 'build-nums' directory # and create one if there isn't. # # 2. Adjust the build number -- either increasing it if it's a package rebuild, # or resetting it to '1' if it's a version update. # # The reason for this is that Slackware build numbers often differ from Slackware ARM # since it takes a while to catch up, and there may have already been several # rebuilds in Slackware before we even start looking at rebuilding the package. ####################################################################################### source /usr/share/slackdev/buildkit.sh ORIGCWD=$PWD mkdir -vpm755 $ORIGCWD/build-logs ############################################################## # # Syntax: # build [U|R] # U=Package version upgrade, so the .tgz will be at build '1' # do this for NEW packages also # R=Package rebuild, so the .tgz will be build+1 # # If you exclude R or U then the build number is unmodified. # function build () { unset MODBUILDNOBUMP ## allow build number to be incremented. INDIPKG=$1 echo "*********************************" echo "***** Working on modular package: $INDIPKG *****" echo "*********************************" # If it's an upgrade then we delete any build number, otherwise if it's a rebuild, # we'd want to update the build number but I'll leave that until later :) if [ "$2" = "U" ]; then echo "This is tagged as a package UPGRADE/NEW PACKAGE, set build: 1." echo "MODBUILD=1" > $ORIGCWD/build-nums/$INDIPKG elif [ "$2" = "R" ]; then # It's a rebuild & increment the build number: if [ -s $ORIGCWD/build-nums/$INDIPKG ]; then source $ORIGCWD/build-nums/$INDIPKG let MODBUILD++ echo "Tagged as a rebuild - will be build: $MODBUILD" echo "_PKGVER=$PKGVER" > $ORIGCWD/build-nums/$INDIPKG echo "MODBUILD=$MODBUILD" >> $ORIGCWD/build-nums/$INDIPKG else # x11.SlackBuild assumes a build number of what is set in "arm/build" if there isn't a # build stamp file for a particular modular package. # but if we've not already got a build number, but got a package then we need # to assume that this is going to be the 2nd build. # This is because we only started creating build stamp files much later in the # evolution of X11 packaging for Slackware ARM. # There's no package version included at this point but that does not # matter - it'll be dealt with in x11.SlackBuild. echo "MODBUILD=2" > $ORIGCWD/build-nums/$INDIPKG echo "Tagged as a rebuild but has no build stamp file - setting as build: 2" fi # If we don't specify either U or R, then we leave the build number alone # since we may be just making some test packages prior to a public tree push. # Build numbers are never updated when the build of a particular package version # hasn't ever been pushed publically. elif [ -z "$2" ]; then export MODBUILDNOBUMP=Yes echo "*** Package rebuild without build increment ***" fi # Determine the section of X where we'll find the source: #~/armedslack/dbuild $( basename $( find $SLACKSOURCE/x/x11/src -name "*$INDIPKG*" -printf "%h\n" )) $INDIPKG 2>&1 | tee $ORIGCWD/build-logs/$INDIPKG.log ./arm/build $( basename $( find $SLACKSOURCE/x/x11/src -name "*$INDIPKG*" -printf "%h\n" )) $INDIPKG 2>&1 | tee $ORIGCWD/build-logs/$INDIPKG.log } ######################################################################################### # Slackware ARM packages # These packages aren't included in Slackware either because they aren't needed # or are found not to work. # # They're needed on the ARM platform though. ######################################################################################### # # This is cheating - a dirty work around to avoid hacking x11.SlackBuild some more. # fbdev is removed from Slackware since it causes failures when a machine has no xorg.conf, but # we need it for ARMedslack - and it works with or without an xorg.conf. # ################################### # Package: driver/xf86-video-fbdev ################################### # # Remove it from the package black list, allowing it to build: sed -i 's?xf86-video-fbdev??g' $SLACKSOURCE/x/x11/package-blacklist || exit 1 # Install our local copy into the Slackware tree because this is easier than modifying # the x11.SlackBuild to find the source in our local tree. It's a little hacky I agree but # for one package, I adjust my standards ;-) #cp -favv $ORIGCWD/src/driver/xf86-video-fbdev* $SLACKSOURCE/x/x11/src/driver/ || exit 1 #build xf86-video-fbdev #rm -fv $SLACKSOURCE/x/x11/src/driver/xf86-video-fbdev* # ### ## this stuff is deprecated in X.org 7.5 but is left here as reference for ## how to add any ARM specific stuff. ## # Both liblbxutil & lbxproxy are needed for app/proxymngr to compile. # ########################## # Package: lib/liblbxutil ########################## #cp -favv $ORIGCWD/src/lib/liblbxutil* $SLACKSOURCE/x/x11/src/lib/ #build liblbxutil U #rm -fv $SLACKSOURCE/x/x11/src/lib/liblbxutil* # ######################### # Package: app/lbxproxy ######################### #cp -favv $ORIGCWD/src/app/lbxproxy* $SLACKSOURCE/x/x11/src/app/ #build lbxproxy U #rm -fv $SLACKSOURCE/x/x11/src/app/lbxproxy* ## # You'll probably want to build this next since it relies on both of the above "*lbx*" # packages being installed. #build proxymngr ######################################################################################## # The following packages are both in Slackware x86 & ARM ######################################################################################## #build xf86-video-ati #build xf86-input-penmount build xrdb U #build xf86-video-siliconmotion exit # Upgrade a bunch of stuff: # When upgrading "xorg-server" packages, you only need to rebuild the # base "xorg-server" - the others "xnest" etc will be built during that run. for i in \ xorg-server \ ; do build $i U done #build xdm R #build compiz #build imake U #build pixman R #build xorg-server U # build proto U # build pixman U # EOF