From 12d5129ba19c376dbdf9b114b676f5fcd816570b Mon Sep 17 00:00:00 2001 From: rhatto Date: Tue, 7 Apr 2009 21:53:32 +0000 Subject: libzrtpcpp: adding libzrtpcpp git-svn-id: svn+slack://slack.fluxo.info/var/svn/slackbuilds@2144 370017ae-e619-0410-ac65-c121f96126d4 --- net/libs/libzrtp/Manifest | 24 +++ net/libs/libzrtp/libzrtpcpp.SlackBuild | 267 +++++++++++++++++++++++++++++++++ net/libs/libzrtp/slack-required | 5 + 3 files changed, 296 insertions(+) create mode 100644 net/libs/libzrtp/Manifest create mode 100644 net/libs/libzrtp/libzrtpcpp.SlackBuild create mode 100644 net/libs/libzrtp/slack-required (limited to 'net') diff --git a/net/libs/libzrtp/Manifest b/net/libs/libzrtp/Manifest new file mode 100644 index 00000000..4d065d5f --- /dev/null +++ b/net/libs/libzrtp/Manifest @@ -0,0 +1,24 @@ +-----BEGIN PGP SIGNED MESSAGE----- +Hash: SHA1 + +DIST libzrtpcpp-1.4.3.tar.gz 449645 MD5 84386a596578a7c0c92c7b999a7f16f0 RMD160 cea510e2df31ed2c2ebe119ac040076792fef648 SHA1 23c4d287349def6f9d87290719a9aefce618994b SHA256 562db1345b4dc6f1fc2ee8c40f4e2fb70bb368f9f2d876b4a05f53f99556c36e SHA512 7dc7cff1c5d97f2e744ef14023352a720b50027f3eeb4ccd709b51d803cdf5893382ba3e8b3ae97ddaf322c21a644dbdc5fda2ac27c54d70d317caa320759829 +MKBUILD libzrtpcpp.mkbuild 5181 MD5 c04b37450a023491eebe23ec14dba3f4 RMD160 0afbc67fe6d2dce230c79db393b93bc3f5e4bb57 SHA1 142ee6a6024fb89dac8fec9513f90bf956dde0f1 SHA256 f75cca9139106220be5af934c706ac74838fc3bc4010f3f706284b8c63e2f672 SHA512 9cf7890fe2b780f521f4a780133d9586f6597cb47a6e109aeb9599c2bdaf8473ae868683636626b3819edde4ddfa7fb368caae9a6012f7d2bfafc837546765a8 +SLACK-REQUIRED slack-required 95 MD5 505c18de34a2ded8efc81e1cb14868e9 RMD160 292acf30531a980132d51b811b7f08ee7a5bec73 SHA1 df80c6b95fc600da2e375f06f2024376bea355f2 SHA256 ae8640d1c10e85f27e75f730da6c3c11cc7c9a662438aa0f7736b36e5a5b3f98 SHA512 8dd1f4297a92d8fd95c7deacee3745fcc6b6a1cd8177a1fcfde2a2d7a7f1463e16e1d8306d8e53c5307232287369c97d3434a393e5923b91cdb5bff41435e283 +SLACKBUILD libzrtpcpp.SlackBuild 8515 MD5 0176061d971837c6bb7168cb6a7cb9a0 RMD160 5508f03c2dcc6a8693df7a9cc75eb9259460c706 SHA1 8f27fadfc30ee5dac40d7b7076474175a156a37e SHA256 09ff0cad04119a0c1032073aaf4a9c6d634e242aa5edac711c0b3eba2ed68924 SHA512 d6d089435785b8b60979a0b417635ce68db6fa0ef9a4a5656d070d12da5e9e772b7b6f2b668d04f299fb459ddc11708e400c4fc821603a25498fd6578134d2f8 +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v1.4.9 (GNU/Linux) + +iQIcBAEBAgAGBQJJ28wPAAoJEEHL93ESzgei5JwP/0JUYVX9FARloXNdLPCwVrt0 +LEJeQnLJ48IKLKgwri+1BiURa9gOIwUnbaKDafgocPpx73UbSS7ZI5hq+39Gz9iw +hnxKQhqJKtvpC/TQDbj8JivmLwQb8Fl0R4o/Uccr+R/AGucTEvNfdWFSDAmWFZ7I +fos1nfgI8OsQZHacu7WYIkBVwxxfVLWZ3XxnWwOt9fa0oAwDbs0mpuHEx9U9zCLN +L7ebVYdvIDrknXXBVvJMagEvT81RgAFPf6NCKjx2hwJ95gKhZJM2YvxxEttSWb5B +tij/B/pO2wHsgaHOj8PEQhIF5s3v3cD2pns/1jLksPrRUunzxdp8Ugan+VhfMhRA +qoGjqbWfmouNjd89okcXX3SiEM517vDppLbF7DlGFKmpdSFVhn7Xh9rlf0GS+mjD +4mP7sryrx2KG859Ffrl/kXL14Cxmot0wpGJxndbHt9RAwf1aZZdNNdxoLIutkKoI +fIUieMbTjHVt3TF6OkrPiIxsQGwwT6cguX8Rzkw73xqFq49+F5Tvj/e4u5v01yJM +bkqeDSUHhACzcsYdd3GlBxZPY/8sM7nayv6jIXx09J5bn6AyXB/8RIWoP3h8cV3a +GPJfXYFAnRfPIxTL8C3+Or8oFIUd3OcscgjL/55D+46w4bpsCsAKQIymJGhb23aa +eXR9EIQg2qbipQM6iLE5 +=tR2k +-----END PGP SIGNATURE----- diff --git a/net/libs/libzrtp/libzrtpcpp.SlackBuild b/net/libs/libzrtp/libzrtpcpp.SlackBuild new file mode 100644 index 00000000..8f7abd02 --- /dev/null +++ b/net/libs/libzrtp/libzrtpcpp.SlackBuild @@ -0,0 +1,267 @@ +#!/bin/bash +# +# libzrtpcpp.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. +# +# libzrtpcpp.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 libzrtpcpp, by Silvio Rhatto +# requires: commoncpp2 ccrtp +# tested: libzrtpcpp-1.4.3 +# model: generic.mkSlackBuild $Rev: 805 $ +# + +# Look for slackbuildrc +if [ -f ~/.slackbuildrc ]; then + source ~/.slackbuildrc +elif [ -f /etc/slackbuildrc ]; then + source /etc/slackbuildrc +fi + +# Set variables +CWD="$(pwd)" +SRC_NAME="libzrtpcpp" +PKG_NAME="libzrtpcpp" +ARCH=${ARCH:=i486} +SRC_VERSION=${VERSION:=1.4.3} +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} +SLACKBUILD_PATH=${SLACKBUILD_PATH:="net/libs/libzrtp"} +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://www.gnutelephony.org/dist/tarballs/$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 3903A6DD | grep -q -v "SIGNING KEY ID"; then + gpg --recv-keys 3903A6DD || 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 $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 COPYING NEWS README" +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---------------------------------------------------| +libzrtpcpp: libzrtpcpp +libzrtpcpp: +libzrtpcpp: This package provides a library that adds ZRTP support to the +libzrtpcpp: GNU ccRTP stack. Phil Zimmermann developed ZRTP to allow ad-hoc, +libzrtpcpp: easy to use key negotiation to setup Secure RTP (SRTP) sessions. +libzrtpcpp: GNU ZRTP together with GNU ccRTP (1.5.0 or later) provides a +libzrtpcpp: ZRTP implementation that can be directly embedded into client +libzrtpcpp: and server applications. +libzrtpcpp: +libzrtpcpp: +libzrtpcpp: +EODESC + +# Build the package +cd "$PKG" +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 + rm -rf "$PKG_WORK" "$PKG" +fi diff --git a/net/libs/libzrtp/slack-required b/net/libs/libzrtp/slack-required new file mode 100644 index 00000000..e524f887 --- /dev/null +++ b/net/libs/libzrtp/slack-required @@ -0,0 +1,5 @@ +# Dependency list to libzrtpcpp +# +# dependency [condition] [version]] +commoncpp2 +ccrtp -- cgit v1.2.3