Browse Source

l/restbed: Added rested-4.6.

slackware-14.2
Damien Goutte-Gattat 3 years ago
parent
commit
b38ab2b0f4
  1. 3
      l/restbed/checksums
  2. 138
      l/restbed/restbed.SlackBuild
  3. 12
      l/restbed/slack-desc

3
l/restbed/checksums

@ -0,0 +1,3 @@
a9091b4de847539fa5b2259bf76a5355339c7eaaa5e33d7d4ae74d614c21965a asio-1.12.1.tar.bz2
51239356e07c2ac935d0aa56ac3c760ad304757a4ca998b8b5d9e3602aa0975f kashmir-dependency-2f3913f49c4ac7f9bff9224db5178f6f8f0ff3ee.tar.gz
b2b75c39129bf667a3e1a9494b9cf0e3dcf6d2b081746918f0f6ba202f14a7e4 restbed-4.6.tar.gz

138
l/restbed/restbed.SlackBuild

@ -0,0 +1,138 @@
#!/bin/bash
# Build script for Slackware
# Copyright (C) 2018 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 <dgouttegattat@incenp.org>
#
# Latest restbed sourcecode is available at:
# <https://github.com/Corvusoft/restbed>.
# Source package infos
NAMESRC=${NAMESRC:-restbed}
VERSION=${VERSION:-4.6}
ARCHIVE=${ARCHIVE:-$NAMESRC-$VERSION.tar.gz}
WGET=${WGET:-https://github.com/Corvusoft/restbed/archive/$VERSION.tar.gz}
# Bundled dependencies
ASIO_VERSION=${ASIO_VERSION:-1.12.1}
ASIO_ARCHIVE=${ASIO_ARCHIVE:-asio-$ASIO_VERSION.tar.bz2}
ASIO_WGET=${ASIO_WGET:-https://download.sourceforge.net/project/asio/asio/$ASIO_VERSION%20%28Stable%29/$ASIO_ARCHIVE}
KASHMIR_VERSION=${KASHMIR_VERSION:-2f3913f49c4ac7f9bff9224db5178f6f8f0ff3ee}
KASHMIR_ARCHIVE=${KASHMIR_ARCHIVE:-kashmir-dependency-$KASHMIR_VERSION.tar.gz}
KASHMIR_WGET=${KASHMIR_WGET:-https://github.com/Corvusoft/kashmir-dependency/archive/$KASHMIR_VERSION.tar.gz}
# Build infos
NAMEPKG=${NAMEPKG:-restbed}
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
# Compilation flags
LIBDIRSUFFIX=""
case "$ARCH" in
i?86)
CPUOPT="-O2 -march=$ARCH -mtune=i686"
;;
x86_64)
CPUOPT="-O2 -fPIC"
LIBDIRSUFFIX="64"
;;
*)
CPUOPT="-O2"
;;
esac
# Get and verify the source archives
for name in "" ASIO_ KASHMIR_ ; do
eval archive=\$${name}ARCHIVE
eval url=\$${name}WGET
if [ ! -r $archive ]; then
wget -c -O $archive.part $url
mv $archive.part $archive
fi
eval ${name}NAME=$(tar ft $archive | head -n 1 | cut -d / -f 1)
done
# Compile
cd $TMP
echo "Building $ARCHIVE..."
tar xf $CWD/$ARCHIVE
tar xf $CWD/$ASIO_ARCHIVE
tar xf $CWD/$KASHMIR_ARCHIVE
cd $NAME
mkdir build && cd build
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_FLAGS="$CPUOPT" \
-DCMAKE_CXX_FLAGS="$CPUOPT" \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_INSTALL_LIBDIR=lib$LIBDIRSUFFIX \
-DBUILD_SHARED=YES \
-DBUILD_SSL=YES \
-DBUILD_EXAMPLES=NO \
-DBUILD_TESTS=NO \
-Dasio_INCLUDE=$TMP/$ASIO_NAME/include \
-Dkashmir_INCLUDE=$TMP/$KASHMIR_NAME \
..
make -j $JOBS
make install/strip DESTDIR=$PKG
cd ..
# Install the documentation
mkdir -p $PKG/usr/doc/$NAME
install -m 644 LICENSE README.md documentation/*.md $PKG/usr/doc/$NAME
# 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/$NAME $TMP/$ASIO_NAME $TMP/$KASHMIR_NAME
"
if type -p fakeroot ; then
echo "$PACKAGING" | fakeroot
else
su -c "$PACKAGING"
fi

12
l/restbed/slack-desc

@ -0,0 +1,12 @@
|-----handy-ruler-----------------------------------------------------|
restbed: restbed (asynchronous C++11 RESTful framework)
restbed:
restbed: Restbed is a comprehensive and consistent programming model for
restbed: building applications that require seamless and secure communication
restbed: over HTTP, with the ability to model a range of business processes,
restbed: designed to target mobile, tablet, desktop and embedded production
restbed: environments.
restbed:
restbed:
restbed:
restbed:
Loading…
Cancel
Save