diff options
author | Asaf Ohayon <asaf@sysbind.co.il> | 2016-09-08 19:33:00 +0700 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2016-09-08 19:33:00 +0700 |
commit | 1fbe9244dbf553f59d3421d17233ee71887c2e7e (patch) | |
tree | 05198647d8fff3518e7527731ed7cd25c8fd165f /system/containerd/containerd.SlackBuild | |
parent | 112b58229e4741ef0c272ce4fe79145fbf6bae98 (diff) |
system/containerd: Added (linux containers manager).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'system/containerd/containerd.SlackBuild')
-rw-r--r-- | system/containerd/containerd.SlackBuild | 83 |
1 files changed, 83 insertions, 0 deletions
diff --git a/system/containerd/containerd.SlackBuild b/system/containerd/containerd.SlackBuild new file mode 100644 index 0000000000000..298911d25c3dc --- /dev/null +++ b/system/containerd/containerd.SlackBuild @@ -0,0 +1,83 @@ +#!/bin/sh + +# Slackware build script for containerd +# Written by Asaf Ohayon <asaf@sysbind.co.il> + +PRGNAM=containerd +VERSION=${VERSION:-0.2.3} +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} + +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) ARCH=i586 ;; + arm*) ARCH=arm ;; + *) ARCH=$( uname -m ) ;; + esac +fi + +CWD=$(pwd) +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +if [ "$ARCH" = "i586" ]; then + SLKCFLAGS="-O2 -march=i586 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" +else + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" +fi + +set -e + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf $PRGNAM-$VERSION +tar xvf $CWD/containerd-${VERSION}.tar.gz || tar xvf $CWD/v$VERSION.tar.gz +cd $PRGNAM-$VERSION +chown -R root:root . +# the have symlinks in their testdata that goes outside the context of this build +find -L . ! -type l \ + \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ + -o -perm 511 \) -exec chmod 755 {} \; -o ! -type l \ + \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ + -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; + +source /etc/profile.d/go.sh + +unset GOPATH +export GOPATH="${TMP}/${PRGNAM}-${VERSION}" +mkdir -p src/github.com/docker +cd src/github.com/docker/ +ln -rsf "${TMP}/${PRGNAM}-${VERSION}" containerd +cd containerd +LDFLAGS= make + +cd src/github.com/docker/containerd/bin +for file in $(find . -type f -print); do + echo ${file} + install -Dm755 ${file} ${PKG}/usr/bin/${file} + file=$(echo ${file} | sed 's/\.\///g') + if [[ "${file}" == "ctr" ]]; then + ln -s ${file} ${PKG}/usr/bin/docker-containerd-${file} + else + ln -s ${file} ${PKG}/usr/bin/docker-${file} + fi +done + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc + +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz} |