diff options
author | rhatto <rhatto@370017ae-e619-0410-ac65-c121f96126d4> | 2009-01-24 23:53:30 +0000 |
---|---|---|
committer | rhatto <rhatto@370017ae-e619-0410-ac65-c121f96126d4> | 2009-01-24 23:53:30 +0000 |
commit | 3cab539d0a7f5593fec7a702b5e63efaba1cea41 (patch) | |
tree | 4f2bfdb55d12333a9be398f4f18f85c44e8be5f9 /sys/apps | |
parent | 76951e173341ef628fe1cb89a4a4c7c65b1093aa (diff) | |
download | slackbuilds-3cab539d0a7f5593fec7a702b5e63efaba1cea41.tar.gz slackbuilds-3cab539d0a7f5593fec7a702b5e63efaba1cea41.tar.bz2 |
fakeroot: adding fakeroot
git-svn-id: svn+slack://slack.fluxo.info/var/svn/slackbuilds@2094 370017ae-e619-0410-ac65-c121f96126d4
Diffstat (limited to 'sys/apps')
-rw-r--r-- | sys/apps/fakeroot/Manifest | 23 | ||||
-rw-r--r-- | sys/apps/fakeroot/fakeroot.SlackBuild | 220 |
2 files changed, 243 insertions, 0 deletions
diff --git a/sys/apps/fakeroot/Manifest b/sys/apps/fakeroot/Manifest new file mode 100644 index 00000000..13f239e0 --- /dev/null +++ b/sys/apps/fakeroot/Manifest @@ -0,0 +1,23 @@ +-----BEGIN PGP SIGNED MESSAGE----- +Hash: SHA1 + +DIST fakeroot_1.5.10.tar.gz 817885 MD5 76730bf4c9068773e857e18c346d8c81 RMD160 ec22edd8025b57fceee4777d2bcb0d1024b54163 SHA1 2b5b90f812c0d99617936e49c740fdfdc5766220 SHA256 933db73928dd159d429cf932f916b018f0c1ae1a8b16e45b033f363d650584e1 SHA512 f0418a25d5b602680fdb40e7f52434a52c33b0e4a8af3ea818139992de1f2a64ba4ec7467585bbdc8bb3fed670de920f102b885f9952ddda1ae865f23f5e76e8 +MKBUILD fakeroot.mkbuild 3551 MD5 1fef5628fff32c586ffe5a5ced933b03 RMD160 7167760aad8b394447275b6dfae1569e9e3bbd94 SHA1 b00f30b9f875ceb6264f176a165295c2b171b2e6 SHA256 5322a97dd89a77053d72ee2dd97057ec8a6b663111e4562c20c98af80b722f0e SHA512 22c2e3d651994a91f12179bf07ae46f0892f144492bdb6e4a37e1c07cd0adc7fcbdfb845c7a1c53b923cdf6eb44b44e46361bf9b1506c3530dfb15cecb4d0120 +SLACKBUILD fakeroot.SlackBuild 6869 MD5 62bce6be0a9e2b4d705ac3b2486ec071 RMD160 7a866e57c61458adb5a1ca16962d38fa384c93b9 SHA1 99e1569b7f016f7ad4a06e957f1abf80a77b71d1 SHA256 56a96c7383bb6053d8ad58286999aa71d417ac6a22eeee67bde35c58908d9169 SHA512 8317a6c96eb11d826dce1c47143ce00f87146fb960152c184daf11b967f7f2209e558d164010c6602d34533e6de0d720ed9dd0805d3813207a26ef86d4960289 +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v1.4.9 (GNU/Linux) + +iQIcBAEBAgAGBQJJe6lYAAoJEEHL93ESzgeiL2oP/i9Bti71LR3fHA0WBTyc0xNv +guxR4Ke97kIV6DJU0Uy6gLZHMbnunEkczmjjL5QiG5TVxBkdwHY1s76zWe10LD6u +TvDhhmaxhGwDG8IHTQOcx3ESPqHeRZcclgqc5cKwVbJ5hzR0YnbCc+YwRStd/0m4 +0horwhRGB7EVcJ7Wbheuct4OCfz+CDoL0TAF5skS9xVwe2jyixGcA8krLfTPhflO +qJrz/HxVneb8DskeKVg7ovSIcIr54Vh3BHr6FD4buHhhIfBYgbSwLB4+9XgULLAK +i288RyRbfobRH7nrrcGU5h2SQsvj1E3cIoz27nuCgACHfqy+rhkZhFMbkuj+HDzi +RBDXELPiE/TmXjzJDkhe65LxXz5u8wQ2jrPanhHhr4B4Vpu/0kdaKDq1bY7IKNSO +YVjis9Ys3pdg59tPtF9/6IzYaFLVvmlmRBbG9V8ydVzBM8X3/mAgIprd4K6EOwY9 +69tBW2RfHEW5MreZJo3Vxag1NMxZPmwU9iDNi5H9ygD4RBhVwnWwz7O/+98R4MMB +uYS4ixaNpcZYHbRSKkqUkazMeN8pIfbR0/dSh6Lt5tm63iRq/9N1O9rW0dRirDgo +HkofIru8i/++ahtsduYlXWAQQIkF2Ndk1JH51h5AsZXRfF1W2+ZpuGINAzT1Qnj7 +05gPXMrk/lVSQKi2ila4 +=0eY/ +-----END PGP SIGNATURE----- diff --git a/sys/apps/fakeroot/fakeroot.SlackBuild b/sys/apps/fakeroot/fakeroot.SlackBuild new file mode 100644 index 00000000..2bbe2c4a --- /dev/null +++ b/sys/apps/fakeroot/fakeroot.SlackBuild @@ -0,0 +1,220 @@ +#!/bin/bash +# +# fakeroot.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. +# +# fakeroot.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 +# +# slackbuild for fakeroot, by Silvio Rhatto +# requires: +# tested: fakeroot-1.5.10 +# + +# Look for slackbuildrc +if [ -f ~/.slackbuildrc ]; then + source ~/.slackbuildrc +elif [ -f /etc/slackbuildrc ]; then + source /etc/slackbuildrc +fi + +# Set variables +CWD="$(pwd)" +SRC_NAME="fakeroot" +PKG_NAME="fakeroot" +ARCH=${ARCH:=i486} +SRC_VERSION=${VERSION:=1.5.10} +PKG_VERSION="$(echo "$SRC_VERSION" | tr '[[:blank:]-]' '_')" +BUILD=${BUILD:=1rha} +SRC_DIR=${SRC_DIR:=$CWD}/$PKG_NAME +TMP=${TMP:=/tmp} +PKG=${PKG:=$TMP/package-$PKG_NAME} +REPOS=${REPOS:=$TMP} +PREFIX=${PREFIX:=/usr} +PKG_WORK="$TMP/$SRC_NAME" +CONF_OPTIONS=${CONF_OPTIONS:=""} +NUMJOBS=${NUMJOBS:=""} + +# Set system libraries' path and optmization flags based on $ARCH +LIBDIR="$PREFIX/lib" + +if [ "$ARCH" = "i386" ]; then + SLKCFLAGS="-O2 -march=i386 -mtune=i686" +elif [ "$ARCH" = "i486" ]; then + SLKCFLAGS="-O2 -march=i486 -mtune=i686" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686" +elif [ "$ARCH" = "s390" ]; then + SLKCFLAGS="-O2" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIR="$PREFIX/lib64" + LDFLAGS="-L/lib64 -L/usr/lib64" +fi + +# Set error codes (used by createpkg) +ERROR_WGET=31; ERROR_MAKE=32; ERROR_INSTALL=33 +ERROR_MD5=34; ERROR_CONF=35; ERROR_HELP=36 +ERROR_TAR=37; ERROR_MKPKG=38; ERROR_GPG=39 +ERROR_PATCH=40; ERROR_VCS=41; ERROR_MKDIR=42 +ERROR_MANIFEST=43; + +# Clean up any leftovers of previous builds +rm -rf "$PKG_WORK" 2> /dev/null +rm -rf "$PKG" 2> /dev/null + +# Create directories if necessary +mkdir -p "$SRC_DIR" || exit $ERROR_MKDIR +mkdir -p "$PKG" || exit $ERROR_MKDIR +mkdir -p "$REPOS" || exit $ERROR_MKDIR +mkdir -p "$PKG_WORK" || exit $ERROR_MKDIR + +# Dowload source if necessary +SRC="$SRC_NAME"_"$VERSION.tar.gz" +URL="http://ftp.de.debian.org/debian/pool/main/f/fakeroot/$SRC" + +if [ ! -s "$SRC_DIR/$SRC" ] || ! gunzip -t "$SRC_DIR/$SRC" 2> /dev/null; then + wget "$URL" -O "$SRC_DIR/$SRC" || exit $ERROR_WGET +fi + +# Check Manifest file +if [ -e "$CWD/Manifest" ]; then + + # Manifest signature checking + if grep -q -- "-----BEGIN PGP SIGNED MESSAGE-----" $CWD/Manifest; then + echo "Checking Manifest signature..." + gpg --verify $CWD/Manifest + if [ "$?" != "0" ]; then + exit $ERROR_MANIFEST + fi + fi + + MANIFEST_LINES="`grep -E -v "^(MKBUILD|SLACKBUILD)" $CWD/Manifest | wc -l`" + + for ((MANIFEST_COUNT=1; MANIFEST_COUNT <= $MANIFEST_LINES; MANIFEST_COUNT++)); do + + MANIFEST_LINE="`grep -E -v "^(MKBUILD|SLACKBUILD)" $CWD/Manifest | head -n $MANIFEST_COUNT | tail -n 1`" + MANIFEST_FILE="`echo $MANIFEST_LINE | awk '{ print $2 }'`" + MANIFEST_FILE_TYPE="`echo $MANIFEST_LINE | awk '{ print $1 }'`" + + if [ -e "$SRC_DIR/$MANIFEST_FILE" ]; then + MANIFEST_FILE="$SRC_DIR/$MANIFEST_FILE" + else + MANIFEST_FILE="`find $CWD -name $MANIFEST_FILE`" + fi + + if [ ! -e "$MANIFEST_FILE" ] || [ -d "$MANIFEST_FILE" ]; then + continue + fi + + echo "Checking Manifest for $MANIFEST_FILE_TYPE $MANIFEST_FILE integrity..." + + SIZE_SRC="`wc -c $MANIFEST_FILE | awk '{ print $1 }'`" + SIZE_MANIFEST="`echo $MANIFEST_LINE | awk '{ print $3 }'`" + + # Check source code size + if [ "$SIZE_SRC" != "$SIZE_MANIFEST" ]; then + echo "SIZE Manifest: $SIZE_MANIFEST; SIZE $SRC: $SIZE_SRC" + exit $ERROR_MANIFEST + else + echo "Size match." + fi + + # Check source code integrity + for ALGO in md5 rmd160 sha1 sha256 sha512; do + if [ $ALGO = "rmd160" ]; then + ALGO_SRC="`openssl rmd160 $MANIFEST_FILE | awk '{ print $2 }'`" + else + ALGO_SRC="`"$ALGO"sum $MANIFEST_FILE | awk '{ print $1 }'`" + fi + ALGO="`echo $ALGO | tr '[:lower:]' '[:upper:]'`" + ALGO_MANIFEST=$(echo $MANIFEST_LINE | sed "s/.* $ALGO //" | awk '{ print $1 }') + if [ "$ALGO_SRC" != "$ALGO_MANIFEST" ]; then + echo "$ALGO Manifest: $ALGO_MANIFEST; $ALGO $SRC: $ALGO_SRC" + exit $ERROR_MANIFEST + else + echo "$ALGO match." + fi + done + + done + +else + exit $ERROR_MANIFEST +fi + +# Untar +cd "$PKG_WORK" +tar --no-same-owner --no-same-permissions -xvf "$SRC_DIR/$SRC" || exit $ERROR_TAR +PKG_SRC="$PWD/`ls -l | awk '/^d/ { print $NF }'`" +cd "$PKG_SRC" + +# Configure +CFLAGS="$SLKCFLAGS" \ + CXXFLAGS="$SLKCFLAGS" \ + ./configure \ + --prefix="$PREFIX" --libdir="$LIBDIR" $CONF_OPTIONS || exit $ERROR_CONF + +# Compile +make $NUMJOBS || exit $ERROR_MAKE + +# Install +make install DESTDIR="$PKG" || exit $ERROR_INSTALL + +# Strip binaries +( cd "$PKG" + find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | \ + xargs strip --strip-unneeded 2> /dev/null + find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | \ + xargs strip --strip-unneeded 2> /dev/null +) + +# Install documentation +DOCS="AUTHORS BUGS COPYING ChangeLog DEBUG NEWS README README.fake" +mkdir -p "$PKG/usr/doc/$PKG_NAME-$PKG_VERSION" || exit $ERROR_MKDIR +for doc in $DOCS; do + if [ -f "$doc" ]; then + cp -a $doc "$PKG/usr/doc/$PKG_NAME-$PKG_VERSION" + fi +done + +# Add package description (slack-desc) +mkdir -p "$PKG/install" || exit $ERROR_MKDIR +cat << EODESC > "$PKG/install/slack-desc" +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. Line +# up the first '|' above the ':' following the base package name, and the '|' +# on the right side marks the last column you can put a character in. You must +# make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':'. + + |-----handy-ruler-----------------------------------------------------| +fakeroot: fakeroot +fakeroot: +fakeroot: fakeroot fakes root permissions. It can be especially useful +fakeroot: for use with slacktrack (or any other packing building) when +fakeroot: the user does not have root access. +fakeroot: +fakeroot: fakeroot belongs to the Debian distribution. +fakeroot: +fakeroot: +fakeroot: +fakeroot: +EODESC + +# Build the package +cd "$PKG" +makepkg -l y -c n "$REPOS/$PKG_NAME-$PKG_VERSION-$ARCH-$BUILD.tgz" || exit $ERROR_MKPKG + +# Delete source and build directories if requested +if [ "$CLEANUP" == "yes" ] || [ "$1" = "--cleanup" ]; then + rm -rf "$PKG_WORK" "$PKG" +fi |