ap/go-md2man added.

Required by podman components.

Signed-off-by: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl>
This commit is contained in:
Michal Cieslakiewicz 2020-05-28 18:20:05 +02:00
parent 5849eb5f44
commit 606d492458
4 changed files with 125 additions and 0 deletions

View File

@ -71,3 +71,4 @@
l libseccomp # podman
ap slirp4netns # podman
ap conmon # podman
ap go-md2man # podman

5
ap/go-md2man/get_sources.sh Executable file
View File

@ -0,0 +1,5 @@
#!/bin/bash
SRC=go-md2man
VERSION=1.0.10
set -x
wget -O ${SRC}-${VERSION}.tar.gz https://github.com/cpuguy83/${SRC}/archive/v${VERSION}.tar.gz

100
ap/go-md2man/go-md2man.SlackBuild Executable file
View File

@ -0,0 +1,100 @@
#!/bin/sh
# Set initial variables:
CWD=$(pwd)
APP=go-md2man
VERSION=$(ls $APP-*.tar.?z* | sed -e 's/\.tar\..z.*//' | rev | cut -d- -f1 | rev)
ARCH=${ARCH:-x86_64}
BUILD=${BUILD:-1}
TAG=${TAG:-micu}
# The domain part of the go package name, usually the hosting platform
DOMAIN=github.com
# The name of the organization/owner of the package
ORG=cpuguy83
LIBSUFFIX=""
if [ "$ARCH" = "x86_64" ]; then
LIBSUFFIX=${LIBSUFFIX:-64}
fi
if [ "$TMP" = "" ]; then
TMP=/tmp
fi
PKG=$TMP/package-$APP
rm -rf $PKG
mkdir -p $PKG
cd $TMP
rm -rf $APP-$VERSION
mkdir -p $APP-$VERSION/src/$DOMAIN/$ORG || exit 1
cd $APP-$VERSION/src/$DOMAIN/$ORG || exit 1
tar xvf $CWD/$APP-$VERSION.tar.?z* || exit 1
mv $APP-$VERSION $APP || exit 1
cd $APP || exit 1
chown -R root.root .
find . -perm 444 -exec chmod 644 {} \;
find . -perm 777 -exec chmod 755 {} \;
find . -perm 666 -exec chmod 644 {} \;
# Point go to the location of the source tree
export GOPATH="$TMP/$APP-$VERSION"
export GOBIN="$PKG/usr/bin"
go install -a -x ./... || exit 1
# Don't ship .la files:
rm -f $PKG/{,usr/}lib${LIBSUFFIX}/*.la
chown -R root.bin $PKG/usr/bin $PKG/usr/sbin
( 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
find . | xargs file | grep "current ar archive" | grep ELF | cut -f 1 -d : | xargs strip -g 2> /dev/null
)
# Compress and if needed symlink the man pages:
if [ -d $PKG/usr/info ]; then
rm -f $PKG/usr/info/dir
gzip -9 $PKG/usr/info/*
fi
if [ -d $PKG/usr/man ]; then
( cd $PKG/usr/man
for manpagedir in $(find . -type d -name "man*") ; do
( cd $manpagedir
for eachpage in $( find . -type l -maxdepth 1) ; do
ln -s $( readlink $eachpage ).gz $eachpage.gz
rm $eachpage
done
gzip -9 *.?
)
done
)
fi
mkdir -p $PKG/usr/doc/$APP-$VERSION
cp -a LICENSE.md README.md \
$PKG/usr/doc/$APP-$VERSION
mkdir -p $PKG/install
[ -f $CWD/doinst.sh ] && cat $CWD/doinst.sh > $PKG/install/doinst.sh
[ -f $CWD/doinst.sh.gz ] && zcat $CWD/doinst.sh.gz > $PKG/install/doinst.sh
cat $CWD/slack-desc > $PKG/install/slack-desc
# Allow to run as non-root until now:
if [ $(id -u) -ne 0 ]; then
echo "*** Running as non-root, skipping makepkg."
echo "*** Package contents is in $PKG directory."
exit 0
fi
cd $PKG
makepkg -l y -c n $TMP/$APP-$VERSION-$ARCH-${BUILD}${TAG}.txz
# Clean up the extra stuff:
if [ "$1" = "--cleanup" ]; then
rm -rf $TMP/$APP-$VERSION
rm -rf $PKG
fi

19
ap/go-md2man/slack-desc Normal file
View File

@ -0,0 +1,19 @@
# 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 ':' except on otherwise blank lines.
|-----handy-ruler------------------------------------------------------|
go-md2man: go-md2man (utility to generate man pages)
go-md2man:
go-md2man: Generates man pages from markdown
go-md2man:
go-md2man: Site: https://github.com/cpuguy83/go-md2man
go-md2man:
go-md2man:
go-md2man:
go-md2man:
go-md2man:
go-md2man: