diff options
Diffstat (limited to 'sys')
-rw-r--r-- | sys/libs/libfreebob/Manifest | 25 | ||||
-rwxr-xr-x | sys/libs/libfreebob/libfreebob.SlackBuild | 99 |
2 files changed, 106 insertions, 18 deletions
diff --git a/sys/libs/libfreebob/Manifest b/sys/libs/libfreebob/Manifest new file mode 100644 index 00000000..5c98fe4d --- /dev/null +++ b/sys/libs/libfreebob/Manifest @@ -0,0 +1,25 @@ +-----BEGIN PGP SIGNED MESSAGE----- +Hash: SHA1 + +DIST libfreebob-1.0.11.tar.gz 483687 MD5 e49eed0084b9e793e7a0713aa99c196c RMD160 f9d4293cc3599d74f214cc2ac0ca986cc2934c18 SHA1 cde4a90e2e23f1ba4ed4b665d1663520fef85980 SHA256 1f95f2c038bcba51806051b5849016bd8aeb92351933f68f7e2e3dae827c14ec SHA512 59afecb6f67c1623748dddbf35e14fb07dc5c97803972206d603f67381eb5c942d359fa0f6847352362c99ed48b34c9e9e9d21f5802a21fbdd1d7bbfd7283e58 +MKBUILD libfreebob.mkbuild 4683 MD5 75657a1877f616180ceb5393e5996b52 RMD160 8a06692300cea856d6f9f3262f8cc704107e40ba SHA1 568c791d37cb739e5a8873bbb2512a9be32a3f0c SHA256 9889c751604b16c79afb1bbea45dfd6f9c99d88cb6f3d6faa118872ba37c01c9 SHA512 921c7a35ad8f0ce838bdffa22c7c63e0e06717b033707f8c554e3c2da4aa81e1d5802174257b27e200d6a2c4e2688a31361a3d1bc38208035419cd78c708e0b2 +PATCH libfreebob-1.0.11.diff 457 MD5 46892e8a638f389595eb9c4af31d348f RMD160 217dc5447466fc6bc5b6e42cda3c8a5827517210 SHA1 d248cdcd03b07c2e9a30508736cb06f2d1093ffd SHA256 146e41b3f00b85be55bb3ec38bbe6124de7e94e48a4bc1c2288c412056ae2f0a SHA512 033302ff3c5ff8259910d3e48b1fe642cec0d0b53b1ab23efc616e5ffea68b1bb452317ddc260a102baaed7d90d95e5223b3d301cf9e675b4408dca41fec19e9 +SLACK-REQUIRED slack-required 213 MD5 b8b158f8e3d77f2f8553385fe92a2777 RMD160 3730668e8be787e7ef9049f87686bb70bcca01a0 SHA1 6017b7af0ad54e192f4bead9385edf669d0b3c95 SHA256 6a77656c4a2ac422b53b2b12786f8adba6110f7455f8b6b4ae86395a4cee34ea SHA512 6ab6273285e17617f484347a83ac601a0d401c6032b107cd863866d078927627c6272a3f42de6f41e7ac3c7a8a0fcc6d5bfca16ee64b30cea72af7dcd995b60f +SLACKBUILD libfreebob.SlackBuild 8482 MD5 786cb1d68a6ecdc210bda9320b14cfae RMD160 0c28f419f15a3ae702e05741ae2b012e224ede69 SHA1 ab988a7fbf45be8340037e01d8631b69d173561d SHA256 745f98ba49661e613f4247e715a52688036e70ffd2a13b4169445cfdaf687994 SHA512 c11ab5cd0d6df7d749205920ce38cda30aa306520f79ff18d7dab0b319c0bba4e9fed982a3b5e01b172a3c5b8e2bb6a74dd6cab456490c39153d2f5fddc21777 +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v1.4.9 (GNU/Linux) + +iQIcBAEBAgAGBQJJ/HIpAAoJEEHL93ESzgeil9kP/378II6p0uwZSxexzLv0cq1n +lVY1BzGvp1aXu53/hyAzPSKbZOIGjesZYWl62EwuFdQ72+71hjil7bNU9P3nWkd/ +6b7Jch+JOSFsT92YjcA8ptXzRa+Shgxmy66XILIaHTNCIlflJJ9q9THdNcPfmHWH +4O07bio5VjQSpi0OhvfIT5Ig2kFi3iCFzui9w+zfKquj5DU2Y7dlWQbxeGCBiomw +pp1EvlhOWHRYLNvVOh6MYvVMXimRYy1OoZFpWrYoBJ0jnhr5Zw8RIUcA+87r4n4z +eJ8hpHDE8SwoYYL/YcRe2gtKCLm7P4bpBjgkdTVdM6XCbClf6QryzybVc7kqQ560 +K5l9d9EbQzx0wgmScUzWntC61epZ+rLvthx5wj3Kpi35EOhJbyS/HXfBXOEbWojG +LovSbjDG2Ujt2G/AW9wPd1eQIca5HJH6e0jLjFq4h83ghWXPYw/Ax3d9NxOf9d3T +Zih0nlpdQ41LJhnK3AnHi+Bp/Xpr7LM+c/mwuZsj2a9estoUV/kAEFwSCnumKzUE +RWqsCPP2lkq4GWmIkcbz9VZhmCv7rbG/KNzBf3tUsX9R03BNspmF3DOk5/EipiMX +EyuUMOg017HJBkYP8ktauFdX7WxemV3K2DIzImbEA8+CXBBWW/HekaMwQdXLTWhy +RC6yVZr6h95tEDRTIe0x +=VJEV +-----END PGP SIGNATURE----- diff --git a/sys/libs/libfreebob/libfreebob.SlackBuild b/sys/libs/libfreebob/libfreebob.SlackBuild index b110cfe8..32b232e6 100755 --- a/sys/libs/libfreebob/libfreebob.SlackBuild +++ b/sys/libs/libfreebob/libfreebob.SlackBuild @@ -15,8 +15,9 @@ # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA # # slackbuild for libfreebob, by Rudson R. Alves -# requires: cxxlibs gcc glibc-solibs alsa-lib libavc1394 libiec61883 libraw1394 libxml2 +# requires: # tested: libfreebob-1.0.11 +# model: generic.mkSlackBuild $Rev: 805 $ # # Look for slackbuildrc @@ -33,23 +34,24 @@ PKG_NAME="libfreebob" ARCH=${ARCH:=i486} SRC_VERSION=${VERSION:=1.0.11} PKG_VERSION="$(echo "$SRC_VERSION" | tr '[[:blank:]-]' '_')" -BUILD=${BUILD:=2rra} +BUILD=${BUILD:=3rra} SRC_DIR=${SRC_DIR:=$CWD}/$PKG_NAME TMP=${TMP:=/tmp} PKG=${PKG:=$TMP/package-$PKG_NAME} REPOS=${REPOS:=$TMP} +SLACKBUILD_PATH=${SLACKBUILD_PATH:="sys/libs/libfreebob"} PREFIX=${PREFIX:=/usr} PKG_WORK="$TMP/$SRC_NAME" CONF_OPTIONS=${CONF_OPTIONS:="--program-prefix= --program-suffix= --build=$ARCH-slackware-linux"} -NUMJOBS=${NUMJOBS:="-j7"} +NUMJOBS=${NUMJOBS:=""} # Set system libraries' path and optmization flags based on $ARCH LIBDIR="$PREFIX/lib" if [ "$ARCH" = "i386" ]; then - SLKCFLAGS="-O2 -march=i386 -mcpu=i686" + SLKCFLAGS="-O2 -march=i386 -mtune=i686" elif [ "$ARCH" = "i486" ]; then - SLKCFLAGS="-O2 -march=i486 -mcpu=i686" + SLKCFLAGS="-O2 -march=i486 -mtune=i686" elif [ "$ARCH" = "i686" ]; then SLKCFLAGS="-O2 -march=i686" elif [ "$ARCH" = "s390" ]; then @@ -65,6 +67,7 @@ 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 @@ -84,6 +87,72 @@ 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 @@ -91,10 +160,11 @@ PKG_SRC="$PWD/`ls -l | awk '/^d/ { print $NF }'`" cd "$PKG_SRC" # Patch source -patches=" +patches=" [[PATCH URLS]] $PKG_NAME.diff $PKG_NAME-$PKG_VERSION.diff $PKG_NAME-$PKG_VERSION-$ARCH.diff $PKG_NAME-$ARCH.diff" for patch in $patches; do + patch="`basename $patch`" if [ -f "$CWD/$patch" ]; then patch -Np1 < "$CWD/$patch" || exit $ERROR_PATCH elif [ -f "$CWD/patches/$patch" ]; then @@ -103,15 +173,7 @@ for patch in $patches; do gzip -dc "$CWD/$patch.gz" | patch -Np1 || exit $ERROR_PATCH elif [ -f "$CWD/patches/$patch.gz" ]; then gzip -dc "$CWD/patches/$patch.gz" | patch -Np1 || exit $ERROR_PATCH - fi -done - -if echo [[PATCH URLS]] | grep -q -v "PATCH URLS"; then - for patch_url in [[PATCH URLS]]; do - patch="`basename $patch_url`" - if [ ! -s "$SRC_DIR/$patch" ]; then - wget "$patch_url" -O "$SRC_DIR/$patch" || exit $ERROR_WGET - fi + elif [ -f "$SRC_DIR/$patch" ]; then if [ "`basename $patch .gz`" != "$patch" ]; then gzip -dc $SRC_DIR/$patch | patch -Np1 || exit $ERROR_PATCH elif [ "`basename $patch .bz2`" != "$patch" ]; then @@ -119,8 +181,8 @@ if echo [[PATCH URLS]] | grep -q -v "PATCH URLS"; then else patch -Np1 < "$SRC_DIR/$patch" || exit $ERROR_PATCH fi - done -fi + fi +done # Configure CFLAGS="$SLKCFLAGS" \ @@ -183,7 +245,8 @@ fi # Build the package cd "$PKG" -makepkg -l y -c n "$REPOS/$PKG_NAME-$PKG_VERSION-$ARCH-$BUILD.tgz" || exit $ERROR_MKPKG +mkdir -p $REPOS/$SLACKBUILD_PATH +makepkg -l y -c n "$REPOS/$SLACKBUILD_PATH/$PKG_NAME-$PKG_VERSION-$ARCH-$BUILD.tgz" || exit $ERROR_MKPKG # Delete source and build directories if requested if [ "$CLEANUP" == "yes" ] || [ "$1" = "--cleanup" ]; then |