diff options
Diffstat (limited to 'dev/util/bzr')
-rw-r--r-- | dev/util/bzr/Manifest | 23 | ||||
-rwxr-xr-x | dev/util/bzr/bzr.SlackBuild | 136 |
2 files changed, 147 insertions, 12 deletions
diff --git a/dev/util/bzr/Manifest b/dev/util/bzr/Manifest new file mode 100644 index 00000000..317c7952 --- /dev/null +++ b/dev/util/bzr/Manifest @@ -0,0 +1,23 @@ +-----BEGIN PGP SIGNED MESSAGE----- +Hash: SHA1 + +DIST bzr-1.11.tar.gz 3962105 MD5 08f8e60cfd7a60e8a2552dee0df9a7e8 RMD160 85f55eb30f24200810c431af049ea1894172aa46 SHA1 074ecf3f7a7867edf994acc182087effb1fbd92a SHA256 1f6c6dd1e999fac9b94702ff8c7d9e1c3b14859f13486900cf7609c6c8ce04e1 SHA512 26c09476c4da11ecca02be5eb23ca8e62d9a63460bea51ed4557b2c83c49d53272f9ad93943ddda1f78764488f72d8972a03eb0b0b6a292f2f9b962353c515c8 +MKBUILD bzr.mkbuild 2558 MD5 b8bbe5f2d4bc02f6b6dcf1cb9453b753 RMD160 6211cfbef3c0471b02e8e45550834c7d0e421d0b SHA1 1179a29068a150c672ada06e5aa038539c96c6d9 SHA256 2ea5a5fc2ca81566d7ec0c0212e381c858c8df22f3e84d8eb9f76207c000de89 SHA512 77930d002a9ed77f8ef22226eee865c296f07643cf923fe90bb22aa97402d4feae94c0a1eb1aea1889d8ba6c7e7a890c0dff423774cc2ee0f8ae6fbb1482190b +SLACKBUILD bzr.SlackBuild 7845 MD5 0b189800a2b7a836dea5c31b29a96f8e RMD160 be6f4e51cbaacf280cf1929bc7080adfb9223c55 SHA1 40b793e94dfa91ca52c949f645c454b7447faaca SHA256 6be8aa7891953f324bea4f65e408f12d58c1fd47943005102df5e21bfb9c3ef0 SHA512 7c8188d2985c6e6ca114df2493d924c0bbe2662e3ca825f5de90870674a3189534bf0b2062d5536dacea0d79630b497bdd54c373d6cf1c7ad87f77842c08ba39 +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v1.4.9 (GNU/Linux) + +iQIcBAEBAgAGBQJJd9OmAAoJEEHL93ESzgei+E8QAKa7iYo60IhfnIZnR/AgpeH+ +UGzah2EZkIPDOKaRl47SB28y2Pq0L1Kq2Eo2vqzyusho0nuIlwKmY90ZBfYDAXfg +/h+Ymdrh44lO2SMbt4DcElw5nX80d49FZQ9+UbbD4LwAZtouHcfKRiXehqO6XC67 +J27h0QiMOAuKRY7NlmAc3ohRSoV0LYVIRa4yZxTbyAKCjWFMIHbaGBZiYe9yy8rp +lFi6QUr85OE8ZjMTt9tWvMoqmLLKwNis5l37GHz0Zk1Wu/ydQ4aBNoVzrqvgRxQI +cklI02bIUUZksbTE3iGtB58ssmPfIWscgKTkXnSYqmaXqMOUi9s/vpyraBKwwRee +KhbpwGfPvK3nUUnG4D1a3MD2GMpc2VoD9hRAWUVfsmAcM1JpkqPckNhilSEATnd2 +1AfwNfonNKSdQ84QJ1xgJGbL49ffX6X3W28/nnwC6LZ3ZmtoDMRxYv1BXT6mYhtz +r8h22rZb1mklv+nMmCCAfajsfUYyv7BVmz9xDaiirXte/9wUCuPsAEndhQMx50ul +TukzDtN4qUCZnuYC7h1PIes4sopy1OW+L5n+0XzkUL/YcIdsmC9IPDF23MjYjTR1 +p6cQQ4QF2vxu3HBqOqOfQW54TTXIXoWeWaTmVAHRojtmDmjkzjtJMqGj4tcWBRXK +XfRmnKPQwum38izYjhsz +=c5wM +-----END PGP SIGNATURE----- diff --git a/dev/util/bzr/bzr.SlackBuild b/dev/util/bzr/bzr.SlackBuild index 9692bae9..faae85d0 100755 --- a/dev/util/bzr/bzr.SlackBuild +++ b/dev/util/bzr/bzr.SlackBuild @@ -10,13 +10,13 @@ # 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 +# 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 bzr, by Silvio Rhatto # requires: -# tested: bzr-1.3.1 +# tested: bzr-1.11 # # Look for slackbuildrc @@ -31,7 +31,7 @@ CWD="$(pwd)" SRC_NAME="bzr" PKG_NAME="bzr" ARCH=${ARCH:=i486} -SRC_VERSION=${VERSION:=1.3.1} +SRC_VERSION=${VERSION:=1.11} PKG_VERSION="$(echo "$SRC_VERSION" | tr '[[:blank:]-]' '_')" BUILD=${BUILD:=1rha} SRC_DIR=${SRC_DIR:=$CWD}/$PKG_NAME @@ -47,9 +47,9 @@ NUMJOBS=${NUMJOBS:=""} 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 @@ -57,6 +57,7 @@ elif [ "$ARCH" = "s390" ]; then elif [ "$ARCH" = "x86_64" ]; then SLKCFLAGS="-O2 -fPIC" LIBDIR="$PREFIX/lib64" + LDFLAGS="-L/lib64 -L/usr/lib64" fi # Set error codes (used by createpkg) @@ -64,6 +65,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 @@ -77,16 +79,126 @@ mkdir -p "$PKG_WORK" || exit $ERROR_MKDIR # Dowload source if necessary SRC="$SRC_NAME-$VERSION.tar.gz" -URL="http://launchpad.net/bzr/1.3/1.3.1/+download/$SRC" +URL="http://launchpad.net/bzr/1.11/1.11/+download/$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 +# Import minimized signing key from +if echo [[SIGNING KEY URL]] | grep -q -v "SIGNING KEY URL"; then + lynx -dump [[SIGNING KEY URL]] | gpg --import || exit $ERROR_GPG +elif echo A0B3E88B | grep -q -v "SIGNING KEY ID"; then + gpg --recv-keys A0B3E88B || exit $ERROR_GPG +else + gpg --import << EOKEY || exit $ERROR_GPG +[[SIGNING KEY]] +EOKEY +fi + +# Download source's signature if necessary and check it +if echo [[SIGNING URL]] | grep -q -v "SIGNING URL"; then + SIGNATURE="`basename [[SIGNING URL]]`" + if [ ! -s "$SRC_DIR/$SIGNATURE" ]; then + wget "[[SIGNING URL]]" -O "$SRC_DIR/$SIGNATURE" || exit $ERROR_WGET + fi +else + if [ -s "$SRC_DIR/$SRC.sig" ]; then + SIGNATURE="$SRC.sig" + elif [ -s "$SRC_DIR/$SRC.asc" ]; then + SIGNATURE="$SRC.asc" + else + echo Trying to get signature file from $URL.sig... + if wget "$URL.sig" -O "$SRC_DIR/$SRC.sig"; then + SIGNATURE="$SRC.sig" + else + rm $SRC_DIR/$SRC.sig + echo Trying to get signature file from $URL.asc... + if wget "$URL.asc" -O "$SRC_DIR/$SRC.asc"; then + SIGNATURE="$SRC.asc" + else + rm $SRC_DIR/$SRC.asc + echo "Error getting source's signature file" + exit $ERROR_GPG + fi + fi + fi +fi + +echo Checking $SRC_DIR/$SRC with gpg using $SRC_DIR/$SIGNATURE... +gpg --verify "$SRC_DIR/$SIGNATURE" "$SRC_DIR/$SRC" || exit $ERROR_GPG +echo Success. + +# 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 $8 }'`" +PKG_SRC="$PWD/`ls -l | awk '/^d/ { print $NF }'`" cd "$PKG_SRC" # Build and install package @@ -113,9 +225,9 @@ done 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 +# 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 +# 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 ':'. @@ -138,6 +250,6 @@ 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" ]; then +if [ "$CLEANUP" == "yes" ] || [ "$1" = "--cleanup" ]; then rm -rf "$PKG_WORK" "$PKG" fi |