diff options
author | Eric Hameleers <alien@slackware.com> | 2009-09-11 22:22:30 +0000 |
---|---|---|
committer | Eric Hameleers <alien@slackware.com> | 2009-09-11 22:22:30 +0000 |
commit | f6b6e3e1b3cb6e0e8064e7ec860368386e27ee2c (patch) | |
tree | 99cbf98b82e8c77978bb4807800255076b13b83e /lxde/build | |
parent | d285676bfc67f12b768b67ecb17b0da3cad7169e (diff) | |
download | asb-f6b6e3e1b3cb6e0e8064e7ec860368386e27ee2c.tar.gz asb-f6b6e3e1b3cb6e0e8064e7ec860368386e27ee2c.tar.xz |
Initial revision
Diffstat (limited to 'lxde/build')
-rwxr-xr-x | lxde/build/lxdm.SlackBuild | 224 | ||||
-rw-r--r-- | lxde/build/rc.4.patch | 26 |
2 files changed, 250 insertions, 0 deletions
diff --git a/lxde/build/lxdm.SlackBuild b/lxde/build/lxdm.SlackBuild new file mode 100755 index 00000000..180c33bf --- /dev/null +++ b/lxde/build/lxdm.SlackBuild @@ -0,0 +1,224 @@ +#!/bin/sh +# $Id$ +# Copyright (c) 2009 Eric Hameleers, Eindhoven, NL +# All rights reserved. +# +# Permission to use, copy, modify, and distribute this software for +# any purpose with or without fee is hereby granted, provided that +# the above copyright notice and this permission notice appear in all +# copies. +# +# THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED 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 AUTHORS AND COPYRIGHT HOLDERS AND THEIR +# CONTRIBUTORS 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. +# ----------------------------------------------------------------------------- +# +# Slackware SlackBuild script +# =========================== +# By: Eric Hameleers <alien@slackware.com> +# For: lxdm +# Descr: LXDE Display Manager +# URL: http://lxde.sourceforge.net/ +# Needs: +# Changelog: +# r1999-1: 11/sep/2009 by Eric Hameleers <alien@slackware.com> +# * Initial build. +# +# Run 'sh lxdm.SlackBuild --cleanup' to build a Slackware package. +# The package (.tgz) plus descriptive .txt file are created in /tmp . +# Install using 'installpkg'. +# +# ----------------------------------------------------------------------------- + +# Set initial variables: + +PRGNAM=lxdm +VERSION=${VERSION:-r1999} +ARCH=${ARCH:-i486} +BUILD=${BUILD:-1} +TAG=${TAG:-alien} + +DOCS="AUTHORS COPYING ChangeLog NEWS README" + +# Where do we look for sources? +SRCDIR=$(cd $(dirname $0); pwd) + +# Place to build (TMP) package (PKG) and output (OUTPUT) the program: +TMP=${TMP:-/tmp/build} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +SOURCE[0]="$SRCDIR/${PRGNAM}-${VERSION}.tar.gz" +SRCURL[0]="" + +## +## --- with a little luck, you won't have to edit below this point --- ## +## + +# Exit the script on errors: +set -e +trap 'echo "$0 FAILED at line ${LINENO}" | tee $OUTPUT/error-${PRGNAM}.log' ERR +# Catch unitialized variables: +set -u +P1=${1:-1} + +case "$ARCH" in + i486) SLKCFLAGS="-O2 -march=i486 -mtune=i686" + SLKLDFLAGS=""; LIBDIRSUFFIX="" + ;; + s390) SLKCFLAGS="-O2" + SLKLDFLAGS=""; LIBDIRSUFFIX="" + ;; + powerpc) SLKCFLAGS="-O2" + SLKLDFLAGS=""; LIBDIRSUFFIX="" + ;; + x86_64) SLKCFLAGS="-O2 -fPIC" + SLKLDFLAGS="-L/usr/lib64"; LIBDIRSUFFIX="64" + ;; +esac + +# Create working directories: +mkdir -p $OUTPUT # place for the package to be saved +mkdir -p $TMP/tmp-$PRGNAM # location to build the source +mkdir -p $PKG # place for the package to be built +rm -rf $PKG/* # always erase old package's contents +rm -rf $TMP/tmp-$PRGNAM/* # remove the remnants of previous build + +# Source file availability: +# Use the src_checkout() function if no downloadable tarball exists. +# This function checks out sources from SVN/CVS and creates a tarball of them. +src_checkout() { + # Param #1 : index in the SOURCE[] array. + # Param #2 : full path to where SOURCE[$i] tarball should be created. + # Determine the tarball extension: + PEXT=$(echo "${2}" | sed -r -e 's/.*[^.].(tar.xz|tar.gz|tar.bz2|tgz).*/\1/') + case "$PEXT" in + "tar.xz") TARCOMP="J" ;; + "tar.gz") TARCOMP="z" ;; + "tgz") TARCOMP="z" ;; + "tar.bz2") TARCOMP="j" ;; + *) echo "Archive can only have extension 'tar.xz', '.tar.gz' '.tar.bz2' or '.tgz'" ; exit 1 ;; + esac + case ${1} in + 0) # ${PRGNAM}-${VERSION} + if [ "$(echo ${VERSION}|cut -c1)" == 'r' ]; then # revision instead of date + REV=$(echo ${VERSION} | cut -c2-) + else + REV="{${VERSION}}" + fi + mkdir ${PRGNAM}-${VERSION} \ + && cd ${PRGNAM}-${VERSION} \ + && svn co --revision $REV http://lxde.svn.sourceforge.net/svnroot/lxde/trunk/${PRGNAM} . \ + && find . -type d -name '.svn' -depth | xargs rm -rf \ + && chown -R root:root . \ + && cd .. \ + && tar -${TARCOMP}cf ${2} ${PRGNAM}-${VERSION} + rm -rf ${PRGNAM}-${VERSION} + ;; + *) # Do nothing + ;; + esac +} + +# Regular URL downloads follow: +for (( i = 0; i < ${#SOURCE[*]}; i++ )) ; do + if ! [ -f ${SOURCE[$i]} ]; then + echo "Source '$(basename ${SOURCE[$i]})' not available yet..." + # Check if the $SRCDIR is writable at all - if not, download to $OUTPUT + [ -w "$SRCDIR" ] || SOURCE[$i]="$OUTPUT/$(basename ${SOURCE[$i]})" + if ! [ "x${SRCURL[$i]}" == "x" ]; then + echo "Will download file to $(dirname $SOURCE[$i])" + if ! $(wget -nv -T 20 -O "${SOURCE[$i]}" "${SRCURL[$i]}"); then + echo "Downloading '$(basename ${SOURCE[$i]})' failed.. aborting the build." + mv -f "${SOURCE[$i]}" "${SOURCE[$i]}".FAIL + exit 1 + fi + else + # Try if we have a SVN/CVS download routine for ${SOURCE[$i]} + echo "Will checkout sources to $(dirname $SOURCE[$i])" + src_checkout $i "${SOURCE[$i]}" + fi + if [ ! -f "${SOURCE[$i]}" -o ! -s "${SOURCE[$i]}" ]; then + echo "File '$(basename ${SOURCE[$i]})' not available.. aborting the build." + exit 1 + fi + fi +done + +if [ "$P1" == "--download" ]; then + echo "Download complete." + exit 0 +fi + +# --- PACKAGE BUILDING --- + +echo "++" +echo "|| $PRGNAM-$VERSION" +echo "++" + +cd $TMP/tmp-$PRGNAM +echo "Extracting the source archive(s) for $PRGNAM..." +tar -xvf ${SOURCE} +cd ${PRGNAM}-${VERSION} +chown -R root:root . +chmod -R u+w,go+r-w,a-s . + +echo Building ... +LDFLAGS="$SLKLDFLAGS" \ +CXXFLAGS="$SLKCFLAGS" \ +CFLAGS="$SLKCFLAGS" \ +./configure \ + --prefix=/usr \ + --libdir=/usr/lib${LIBDIRSUFFIX} \ + --localstatedir=/var \ + --sysconfdir=/etc \ + --mandir=/usr/man \ + --program-prefix= \ + --program-suffix= \ + --build=$ARCH-slackware-linux \ + 2>&1 | tee $OUTPUT/configure-${PRGNAM}.log +make 2>&1 | tee $OUTPUT/make-${PRGNAM}.log +make DESTDIR=$PKG install 2>&1 |tee $OUTPUT/install-${PRGNAM}.log + +# Add documentation: +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cp -a $DOCS $PKG/usr/doc/$PRGNAM-$VERSION || true +cat $SRCDIR/$(basename $0) | sed \ + -e "/^VERSION=/s/:-.*}/:-$VERSION}/" \ + -e "/^ARCH=/s/:-.*}/:-$ARCH}/" \ + -e "/^BUILD=/s/:-.*}/:-$BUILD}/" \ + > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild +chown -R root:root $PKG/usr/doc/$PRGNAM-$VERSION +find $PKG/usr/doc -type f -exec chmod 644 {} \; + +# Compress the man page(s): +if [ -d $PKG/usr/man ]; then + find $PKG/usr/man -type f -name "*.?" -exec gzip -9f {} \; + for i in $(find $PKG/usr/man -type l -name "*.?") ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done +fi + +# Strip binaries: +find $PKG | xargs file | grep -e "executable" -e "shared object" \ + | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null + +# Add a package description: +mkdir -p $PKG/install +cat $SRCDIR/slack-desc.$PRGNAM > $PKG/install/slack-desc + +# Build the package: +cd $PKG +makepkg --linkadd y --chown n $OUTPUT/${PRGNAM}-${VERSION}-${ARCH}-${BUILD}${TAG}.tgz 2>&1 | tee $OUTPUT/makepkg-${PRGNAM}.log +cd $OUTPUT +md5sum ${PRGNAM}-${VERSION}-${ARCH}-${BUILD}${TAG}.tgz > ${PRGNAM}-${VERSION}-${ARCH}-${BUILD}${TAG}.tgz.md5 +cd - +cat $PKG/install/slack-desc | grep "^${PRGNAM}" > $OUTPUT/${PRGNAM}-${VERSION}-${ARCH}-${BUILD}${TAG}.txt + diff --git a/lxde/build/rc.4.patch b/lxde/build/rc.4.patch new file mode 100644 index 00000000..25fc92c6 --- /dev/null +++ b/lxde/build/rc.4.patch @@ -0,0 +1,26 @@ +The LXDM login manager can be made the preferred login manager of Slackware +in runlevel 4 (graphical login) by editing the file /etc/rc.d/rc.4 - +Use the patch below to add LXDM right at the top before GDM/KDM/XDM. +Run these two commands (use the full path to the rc.4.patch file if you +keep it in another directory than '/etc/rc.d' ): +# cd /etc/rc.d +# cat /full/path/to/rc.4.patch | patch -p0 + +Eric Hameleers <alien@slackware.com> + +--- rc.4.orig 2007-03-27 03:12:55.000000000 +0200 ++++ rc.4 2009-09-12 00:24:58.000000000 +0200 +@@ -12,6 +12,13 @@ + # Tell the viewers what's going to happen... + echo "Starting up X11 session manager..." + ++# Try to use LXDM login manager. This comes first because if ++# LXDM is on the machine then the user probably installed it and wants ++# to use it by default: ++if [ -x /usr/bin/lxdm ]; then ++ exec /usr/bin/lxdm ++fi ++ + # Try to use GNOME's gdm session manager. This comes first because if + # gdm is on the machine then the user probably installed it and wants + # to use it by default: |