|
|
|
@ -1,6 +1,6 @@
|
|
|
|
|
#!/bin/bash |
|
|
|
|
# Build script for Slackware |
|
|
|
|
# Copyright (C) 2009,2011,2012,2014 Damien Goutte-Gattat |
|
|
|
|
# Copyright (C) 2009,2011,2012,2014,2016 Damien Goutte-Gattat |
|
|
|
|
# |
|
|
|
|
# Redistribution and use of this script, with or without modifications, |
|
|
|
|
# is permitted provided that the following conditions are met: |
|
|
|
@ -24,13 +24,15 @@
|
|
|
|
|
# |
|
|
|
|
# Latest ice sourcecode is available at: <http://www.zeroc.com/> |
|
|
|
|
# |
|
|
|
|
# Depends: d/mcpp, d/apache-ant |
|
|
|
|
# Depends: d/pysetuptools, l/db53 |
|
|
|
|
|
|
|
|
|
# Source package infos |
|
|
|
|
NAMESRC=${NAMESRC:-Ice} |
|
|
|
|
VERSION=${VERSION:-3.5.1} |
|
|
|
|
NAMESRC=${NAMESRC:-ice} |
|
|
|
|
VERSION=${VERSION:-3.6.2} |
|
|
|
|
ARCHIVE=${ARCHIVE:-$NAMESRC-$VERSION.tar.gz} |
|
|
|
|
WGET=${WGET:-http://www.zeroc.com/download/Ice/3.5/$ARCHIVE} |
|
|
|
|
MCPP_ARCHIVE=${MCPP_ARCHIVE:-mcpp-2.7.2-4ice.tar.gz} |
|
|
|
|
MCPP_WGET=${MCPP_WGET:-https://github.com/zeroc-ice/mcpp/archive/v2.7.2-4ice.tar.gz} |
|
|
|
|
|
|
|
|
|
# Build infos |
|
|
|
|
NAMEPKG=${NAMEPKG:-ice} |
|
|
|
@ -45,6 +47,9 @@ OUT=${OUT:-$TMP/build}
|
|
|
|
|
PKG=${PKG:-$OUT/$NAMEPKG} |
|
|
|
|
CWD=$(pwd) |
|
|
|
|
|
|
|
|
|
LIBDIRSUFFIX= |
|
|
|
|
[ "x$ARCH" = xx86_64 ] && LIBDIRSUFFIX=64 |
|
|
|
|
|
|
|
|
|
set -e # Quit if a command returns non-zero |
|
|
|
|
|
|
|
|
|
# Sanity checks |
|
|
|
@ -57,85 +62,58 @@ if [ ! -d $TMP ]; then
|
|
|
|
|
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 archive |
|
|
|
|
# Get and verify the source archives |
|
|
|
|
if [ ! -r $ARCHIVE ]; then |
|
|
|
|
wget -c -O $ARCHIVE.part "$WGET" |
|
|
|
|
mv $ARCHIVE.part $ARCHIVE |
|
|
|
|
fi |
|
|
|
|
sha1sum -c $ARCHIVE.sha1 |
|
|
|
|
if [ ! -r $MCPP_ARCHIVE ]; then |
|
|
|
|
wget -c -O $MCPP_ARCHIVE.part "$MCPP_WGET" |
|
|
|
|
mv $MCPP_ARCHIVE.part $MCPP_ARCHIVE |
|
|
|
|
fi |
|
|
|
|
sha1sum -c checksums |
|
|
|
|
NAME=$(tar ft $ARCHIVE | head -n 1 | cut -d / -f 1) |
|
|
|
|
|
|
|
|
|
# Compile |
|
|
|
|
cd $TMP |
|
|
|
|
echo "Building $ARCHIVE..." |
|
|
|
|
tar xf $CWD/$ARCHIVE |
|
|
|
|
cd $NAME/cpp |
|
|
|
|
CFLAGS=$CPUOPT \ |
|
|
|
|
CXXFLAGS=$CPUOPT \ |
|
|
|
|
make -j $JOBS \ |
|
|
|
|
prefix=/usr \ |
|
|
|
|
install_slicedir=/usr/share/slice \ |
|
|
|
|
install_configdir=/etc/slice |
|
|
|
|
make install \ |
|
|
|
|
prefix=$PKG/usr \ |
|
|
|
|
install_slicedir=$PKG/usr/share/slice \ |
|
|
|
|
install_configdir=$PKG/etc/slice |
|
|
|
|
mkdir -p $PKG/usr/share/$NAME |
|
|
|
|
mv $PKG/usr/lib/ImportKey.class $PKG/usr/share/$NAME |
|
|
|
|
if [ "x$ARCH" = xx86_64 ]; then |
|
|
|
|
rmdir $PKG/usr/lib |
|
|
|
|
fi |
|
|
|
|
cd $NAME/cpp/third-party-packages |
|
|
|
|
tar xf $CWD/$MCPP_ARCHIVE |
|
|
|
|
cd mcpp-2.7.2-4ice |
|
|
|
|
echo "Building custom MCPP library..." |
|
|
|
|
make -j $JOBS |
|
|
|
|
|
|
|
|
|
# Install Python bindings |
|
|
|
|
cd ../py |
|
|
|
|
CFLAGS=$CPUOPT \ |
|
|
|
|
CXXFLAGS=$CPUOPT \ |
|
|
|
|
cd ../.. |
|
|
|
|
echo "Building Ice C++..." |
|
|
|
|
make -j $JOBS \ |
|
|
|
|
prefix=/usr \ |
|
|
|
|
install_slicedir=/usr/share/slice \ |
|
|
|
|
install_pythondir=/usr/lib$LIBDIRSUFFIX/ice-python \ |
|
|
|
|
install_libdir=/usr/lib$LIBDIRSUFFIX/ice-python |
|
|
|
|
mkdir -p $PKG/usr/lib$LIBDIRSUFFIX/ice-python |
|
|
|
|
DB_FLAGS=-I/usr/include/db53 \ |
|
|
|
|
DB_LIBS=-ldb_cxx-5.3 \ |
|
|
|
|
MCPP_LIBS="-L$TMP/$NAME/cpp/third-party-packages/mcpp-2.7.2-4ice/lib$LIBDIRSUFFIX -l mcpp" |
|
|
|
|
make install \ |
|
|
|
|
prefix=$PKG/usr \ |
|
|
|
|
install_slicedir=$PKG/usr/share/slice \ |
|
|
|
|
install_pythondir=$PKG/usr/lib$LIBDIRSUFFIX/ice-python \ |
|
|
|
|
install_libdir=$PKG/usr/lib$LIBDIRSUFFIX/ice-python |
|
|
|
|
mkdir -p $PKG/usr/lib$LIBDIRSUFFIX/python2.7/site-packages |
|
|
|
|
echo /usr/lib$LIBDIRSUFFIX/ice-python > \ |
|
|
|
|
$PKG/usr/lib$LIBDIRSUFFIX/python2.7/site-packages/ice.pth |
|
|
|
|
DESTDIR=$PKG \ |
|
|
|
|
prefix=/usr \ |
|
|
|
|
install_mandir=/usr/man/man1 \ |
|
|
|
|
DB_LIBS=-ldb_cxx-5.3 \ |
|
|
|
|
MCPP_LIBS="-L$TMP/$NAME/cpp/third-party-packages/mcpp-2.7.2-4ice/lib$LIBDIRSUFFIX -l mcpp" |
|
|
|
|
|
|
|
|
|
# Install Java bindings |
|
|
|
|
cd ../java |
|
|
|
|
ant ice-jar |
|
|
|
|
install -D -m 644 lib/Ice.jar $PKG/usr/share/java/ice-$VERSION.jar |
|
|
|
|
cd ../python |
|
|
|
|
echo "Building Ice Python..." |
|
|
|
|
make -j $JOBS prefix=/usr |
|
|
|
|
make install prefix=/usr DESTDIR=$PKG |
|
|
|
|
|
|
|
|
|
# Strip binaries |
|
|
|
|
find $PKG | xargs file | grep "ELF \(32\|64\)-bit LSB" | cut -d : -f 1 | \ |
|
|
|
|
xargs strip --strip-unneeded 2> /dev/null |
|
|
|
|
|
|
|
|
|
# Compress man pages |
|
|
|
|
find $PKG/usr/man -type f -exec gzip -9 {} \; |
|
|
|
|
|
|
|
|
|
# Install the documentation |
|
|
|
|
mkdir -p $PKG/usr/doc/$NAMEPKG-$VERSION |
|
|
|
|
mv $PKG/usr/CHANGES $PKG/usr/ICE_LICENSE $PKG/usr/LICENSE \ |
|
|
|
|
$PKG/usr/RELEASE_NOTES $PKG/usr/doc/$NAMEPKG-$VERSION |
|
|
|
|
cd ../cpp/doc |
|
|
|
|
make |
|
|
|
|
cp -r reference $PKG/usr/doc/$NAMEPKG-$VERSION/ |
|
|
|
|
mkdir -p $PKG/usr/doc/$NAME |
|
|
|
|
cd .. |
|
|
|
|
install -m 644 CHANGELOG-?.?.md CONTRIBUTING.md ICE_LICENSE LICENSE \ |
|
|
|
|
README.md $PKG/usr/doc/$NAME |
|
|
|
|
|
|
|
|
|
# Copy slack-desc file |
|
|
|
|
install -D -m 644 $CWD/slack-desc $PKG/install/slack-desc |
|
|
|
|