diff options
Diffstat (limited to 'net/libs/librsync')
-rw-r--r-- | net/libs/librsync/Manifest | 3 | ||||
-rwxr-xr-x | net/libs/librsync/librsync.SlackBuild | 77 |
2 files changed, 71 insertions, 9 deletions
diff --git a/net/libs/librsync/Manifest b/net/libs/librsync/Manifest new file mode 100644 index 00000000..166e1f7c --- /dev/null +++ b/net/libs/librsync/Manifest @@ -0,0 +1,3 @@ +DIST librsync-0.9.7.tar.gz 453802 MD5 24cdb6b78f45e0e83766903fd4f6bc84 RMD160 39ca29334d0efabc0ee9e4d44abbe73a7d2fe831 SHA1 d575eb5cae7a815798220c3afeff5649d3e8b4ab SHA256 6633e4605662763a03bb6388529cbdfd3b11a9ec55b8845351c1bd9a92bc41d6 SHA512 339362fd01c94411849d3e4a6e95db1bef6cffa0475b1af49d73f11be0421a12d4c73ecbf1a272af01b2a21cec81b4a801c1f7d735e107d0242707fb4c45f9ef +MKBUILD librsync.mkbuild 2869 MD5 a1ab537be5d339c3a8f4cb7923a5f583 RMD160 025ee45159a153f6132582ec4fa0ca8797d21fd9 SHA1 c0e01eab6944a5fa8620c7017d6409a230c6fa5e SHA256 820fb6765af28d22c14119f8c99287f33e13226182682589d74929f1ec352d2f SHA512 941331ecc9cb0659a26565e6c26ff8b8a46f78568e85d8131b9e945e87ee504b6e6192475f40f0e9d9d28a12f21d16894d4a41ff226f9578a6d47869a1409110 +SLACKBUILD librsync.SlackBuild 6665 MD5 2dde78a6abc3aa579576ae2ceb2239c6 RMD160 e67c62ad173023945a2550dde47d5b6b08b6630b SHA1 4c5f39a273c2d3aa469e9633c6231e5868714df0 SHA256 cb8fcedd5cf01bf7648eb2d53f1a23f5d4c699e4fd2b0c76f5ca6dcb6140139d SHA512 f4fbfa676450ae613e2548a61aaa0c10aac4571e32437408ba4f84c2aede747d817a5945b8cbe498494fa1c0b8c21794e545e756f4ec7969e284cbc8e1ccbfbc diff --git a/net/libs/librsync/librsync.SlackBuild b/net/libs/librsync/librsync.SlackBuild index 016c0a2e..b726f3e0 100755 --- a/net/libs/librsync/librsync.SlackBuild +++ b/net/libs/librsync/librsync.SlackBuild @@ -10,9 +10,9 @@ # 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 librsync, by Silvio Rhatto # requires: @@ -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 @@ -83,10 +85,67 @@ 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_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" # Configure @@ -122,9 +181,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 ':'. @@ -147,6 +206,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 |