From 13cb383e1e9d053ad4c2012c978128d8a4647a28 Mon Sep 17 00:00:00 2001 From: Damien Goutte-Gattat Date: Mon, 16 May 2016 21:58:16 +0200 Subject: [PATCH] l/bctoolbox: Added bctoolbox-0.0.3. --- l/bctoolbox/bctoolbox-0.0.3-fix-libdir.diff | 28 +++++ l/bctoolbox/bctoolbox.SlackBuild | 108 ++++++++++++++++++++ l/bctoolbox/slack-desc | 12 +++ 3 files changed, 148 insertions(+) create mode 100644 l/bctoolbox/bctoolbox-0.0.3-fix-libdir.diff create mode 100755 l/bctoolbox/bctoolbox.SlackBuild create mode 100644 l/bctoolbox/slack-desc diff --git a/l/bctoolbox/bctoolbox-0.0.3-fix-libdir.diff b/l/bctoolbox/bctoolbox-0.0.3-fix-libdir.diff new file mode 100644 index 00000000..dcd8c58e --- /dev/null +++ b/l/bctoolbox/bctoolbox-0.0.3-fix-libdir.diff @@ -0,0 +1,28 @@ +diff -Naur bctoolbox-0.0.3.orig/CMakeLists.txt bctoolbox-0.0.3/CMakeLists.txt +--- bctoolbox-0.0.3.orig/CMakeLists.txt 2016-04-08 15:53:01.000000000 +0200 ++++ bctoolbox-0.0.3/CMakeLists.txt 2016-05-16 21:56:44.801533595 +0200 +@@ -51,24 +51,6 @@ + + add_subdirectory(build) + +-# Note for Gnu/Unix systems: +-# The library install director should ideally be set, according to GNUInstallDirs, +-# to ${CMAKE_INSTALL_LIBDIR} for libraries, which are OS specific. +-# HOWEVER autotools does not care about these specificities and ALWAYS sets them +-# to $(exec_prefix)/lib (cf https://www.gnu.org/prep/standards/html_node/Directory-Variables.html) +-# When using a custom prefix, we should follow the autotools guidelines because any project using pkg-config to find our library +-# will expect it to be in $(exec_prefix)/lib, and NOT in $(exec_prefix)/${CMAKE_INSTALL_LIBDIR} since +-# pkg-config does not let us introduce an -rpath settings to tell it where our library is located. +-# Conversely, when NOT using a custom prefix, we can properly install our library in ${CMAKE_INSTALL_LIBDIR} +-# because systems add extra locations for pkg-config to search in. +-if("${CPACK_GENERATOR}" STREQUAL "RPM" OR "${CPACK_GENERATOR}" STREQUAL "DEB") +- # do nothing, we are using the "officials" install prefix +-else() +- # force them to the default autotools values +- message("Setting CMAKE_INSTALL_LIBDIR to ${CMAKE_INSTALL_PREFIX}/lib for non-package build") +- set(CMAKE_INSTALL_LIBDIR ${CMAKE_INSTALL_PREFIX}/lib) +-endif() +- + list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") + + if(NOT CMAKE_INSTALL_RPATH AND CMAKE_INSTALL_PREFIX) diff --git a/l/bctoolbox/bctoolbox.SlackBuild b/l/bctoolbox/bctoolbox.SlackBuild new file mode 100755 index 00000000..bcfa580c --- /dev/null +++ b/l/bctoolbox/bctoolbox.SlackBuild @@ -0,0 +1,108 @@ +#!/bin/bash +# Build script for Slackware +# Copyright (C) 2016 Damien Goutte-Gattat +# +# Redistribution and use of this script, with or without modifications, +# is permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, +# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING +# IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# +# Contact: Damien Goutte-Gattat +# +# Latest bctoolbox sourcecode is available at: . +# +# Depends: l/mbedtls + +# Source package infos +NAMESRC=${NAMESRC:-bctoolbox} +VERSION=${VERSION:-0.0.3} +ARCHIVE=${ARCHIVE:-$NAMESRC-$VERSION.tar.gz} +REPOS=${REPOS:-git://git.linphone.org/bctoolbox.git} + +# Build infos +NAMEPKG=${NAMEPKG:-bctoolbox} +BUILD=${BUILD:-1GGD} +ARCH=${ARCH:-$(uname -m | sed 's/^i.86$/i486/;s/^arm.*/arm/')} +JOBS=${JOBS:-1} +EXT=${EXT:-txz} + +# Directories +TMP=${TMP:-/tmp} +OUT=${OUT:-$TMP/build} +PKG=${PKG:-$OUT/$NAMEPKG} +CWD=$(pwd) + +set -e # Quit if a command returns non-zero + +# Sanity checks +if [ $UID -eq 0 ]; then + echo "You should NOT run this script as ROOT!" + exit 1 +fi +if [ ! -d $TMP ]; then + echo "$TMP does not exists or is not a directory!" + exit 1 +fi + +LIBDIRSUFFIX="" +[ "x$ARCH" = xx86_64 ] && LIBDIRSUFFIX=64 + +# Get and verify the source archive +if [ ! -r $ARCHIVE ]; then + git clone $REPOS + cd bctoolbox + git archive --prefix=$NAMESRC-$VERSION/ $VERSION | gzip -c > ../$ARCHIVE + cd .. + rm -rf bctoolbox +fi + +# Compile +cd $TMP +echo "Building $ARCHIVE..." +tar xf $CWD/$ARCHIVE +cd $NAMESRC-$VERSION +patch -p 1 < $CWD/bctoolbox-0.0.3-fix-libdir.diff +mkdir build-linux && cd build-linux +cmake \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_INSTALL_LIBDIR=lib$LIBDIRSUFFIX \ + -DENABLE_STATIC=Off \ + .. +make -j $JOBS +make install/strip DESTDIR=$PKG +cd .. + +# Install the documentation +mkdir -p $PKG/usr/doc/$NAMESRC-$VERSION +install -m 644 AUTHORS COPYING README $PKG/usr/doc/$NAMESRC-$VERSION + +# Copy slack-desc file +install -D -m 644 $CWD/slack-desc $PKG/install/slack-desc + +# Package the tree +cd $PKG +mkdir -p $OUT +PACKAGING=" +chown root:root . -R +/sbin/makepkg -l y -c n $OUT/$NAMEPKG-$VERSION-$ARCH-$BUILD.$EXT +rm -rf $PKG +rm -rf $TMP/$NAMESRC-$VERSION +" +if type -p fakeroot ; then + echo "$PACKAGING" | fakeroot +else + su -c "$PACKAGING" +fi diff --git a/l/bctoolbox/slack-desc b/l/bctoolbox/slack-desc new file mode 100644 index 00000000..a41ffe2d --- /dev/null +++ b/l/bctoolbox/slack-desc @@ -0,0 +1,12 @@ + |-----handy-ruler-----------------------------------------------------| +bctoolbox: bctoolbox (Belledone Communications helper library) +bctoolbox: +bctoolbox: Bctoolbox is a utilities library used by Belledone Communications +bctoolbox: softwares like belle-sip, mediastreamer2 and linphone. +bctoolbox: +bctoolbox: +bctoolbox: +bctoolbox: +bctoolbox: +bctoolbox: +bctoolbox: