#!/bin/sh # Slackware build script for cpint ## Copyright (c) 2008, Antonio Hernandez Blas # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # 1.- Redistributions of source code 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. # Modified by Robby Workman # Modified by Patrick Volkerding PRGNAM=cpint VERSION=${VERSION:-2.5.3} ARCH=${ARCH:-s390x} BUILD=${BUILD:-1} KERNVER=${KERNVER:-`uname -r`} INCLUDEDIR="-I/lib/modules/${KERNVER}/build/include -I/usr/include" CWD=$(pwd) TMP=${TMP:-/tmp} PKG=${TMP}/package-${PRGNAM} NUMJOBS=${NUMJOBS:--j6} rm -rf ${PKG} mkdir -p ${TMP} ${PKG} cd ${TMP} || exit 1 rm -rf ${PRGNAM}-${VERSION} tar xvf ${CWD}/${PRGNAM}-${VERSION}.tar.gz || exit 1 cd ${PRGNAM}-${VERSION} || exit 1 chown -R root:root . chmod -R a-s,u+rw,go-w . echo ----------------------------------------------- makefile.diff cat ${CWD}/makefile.diff | patch -p1 || exit 1 echo ----------------------------------------------- cpint-include-stdlib #cat ${CWD}/cpint-include-stdlib | patch -p1 || exit 1 echo ----------------------------------------------- cpint-fix-class-simple cat ${CWD}/cpint-fix-class-simple | patch -p1 || exit 1 echo ----------------------------------------------- cpint-remove-asm-from-hcp #cat ${CWD}/cpint-remove-asm-from-hcp | patch -p1 || exit 1 echo ----------------------------------------------- cpint-include-stdlib cat ${CWD}/cpint.kernel.diff | patch -p1 || exit 1 make ${NUMJOBS} INCLUDEDIR="${INCLUDEDIR}" || make INCLUDEDIR="${INCLUDEDIR}" || exit 1 ARCH=s390 make V=1 -C /usr/src/linux modules M=$(pwd) || exit 1 make install prefix=${PKG} VER=$KERNVER || exit 1 ( cd ${PKG} find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | \ xargs strip --strip-unneeded 2> /dev/null || true find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | \ xargs strip --strip-unneeded 2> /dev/null ) rm -rf ${PKG}/usr/share/doc mkdir -p ${PKG}/usr/doc/${PRGNAM}-${VERSION} cp -a \ ChangeLog HOW-TO \ ${PKG}/usr/doc/${PRGNAM}-${VERSION} find ${PKG}/lib/modules -type f | xargs gzip -9 mkdir -p ${PKG}/install cat ${CWD}/slack-desc > ${PKG}/install/slack-desc echo /sbin/depmod -a > ${PKG}/install/doinst.sh cd ${PKG} /sbin/makepkg -l y -c n ${TMP}/${PRGNAM}-${VERSION}-${ARCH}-${BUILD}.tgz