Skip to content

Commit

Permalink
add Slackbuild
Browse files Browse the repository at this point in the history
  • Loading branch information
idnux committed Jan 25, 2018
1 parent 5e440ff commit ead1c4a
Show file tree
Hide file tree
Showing 4 changed files with 152 additions and 0 deletions.
1 change: 1 addition & 0 deletions mythes-id.SlackBuild/README
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Indonesian Thesaurus for LibreOffice/Apache OpenOfice.
129 changes: 129 additions & 0 deletions mythes-id.SlackBuild/mythes-id.SlackBuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
#!/bin/sh

# Slackware build script for mythes-id

# Copyright 2017 Ali Ahmadi <[email protected]>
# # All rights reserved.
#
# Redistribution and use of this script, with or without modification, 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.

# Based on the Arch PKGBUILD

PRGNAM=mythes-id
_PRGNAM=thes-id
VERSION=$(cat $PRGNAM.info | grep "VERSION" | cut -d = -f 2 | sed 's/"//g')
BUILD=${BUILD:-1}
TAG=${TAG:-_idnux}

# Automatically determine the architecture we're building on:
MARCH=$( uname -m )
if [ -z "$ARCH" ]; then
case "$MARCH" in
i?86) export ARCH=i586 ;;
armv7hl) export ARCH=$MARCH ;;
arm*) export ARCH=arm ;;
# Unless $ARCH is already set, use uname -m for all other archs:
*) export ARCH=$MARCH ;;
esac
fi

CWD=$(pwd)
WRK=${WRK:-/tmp/idnux}
PKG=$WRK/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}

unset DOWNLOAD
eval `cat $PRGNAM.info | grep "DOWNLOAD="`
if [ ! -e $(basename $DOWNLOAD) ]; then
echo "Downloading: $DOWNLOAD"
rm -rf $_PRGNAM
git clone $DOWNLOAD
fi

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 $WRK $PKG $OUTPUT
cd $WRK || exit 1
rm -rf $_PRGNAM
cp -r $CWD/$_PRGNAM $WRK || exit 1
cd $_PRGNAM || exit 1
chown -R root:root .
find -L . \
\( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
-exec chmod 755 {} \; -o \
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
-exec chmod 644 {} \;

# Build and install:
make || exit 1
make install DESTDIR=$PKG || exit 1

# Compress and if needed symlink the man pages:
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

# Add a documentation directory. Not all of these files are expected to be
# present, but listing them ensures that documentation that might appear and
# disappear from version to version will not be missed.
mkdir -p $PKG/usr/doc/${PRGNAM}-$VERSION
cp -a \
INSTALL LICENSE README* \
$PKG/usr/doc/${PRGNAM}-$VERSION

# If there's a ChangeLog, installing at least part of the recent history
# is useful, but don't let it get totally out of control:
if [ -r ChangeLog ]; then
DOCSDIR=$(echo $PKG/usr/doc/${PRGNAM}-$VERSION)
cat ChangeLog | head -n 1000 > $DOCSDIR/ChangeLog
touch -r ChangeLog $DOCSDIR/ChangeLog
fi

mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc

cd $PKG
/sbin/makepkg -l n -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-txz}

echo "Cleaning up build directory"
cd $WRK; rm -rf $PRGNAM $PKG
10 changes: 10 additions & 0 deletions mythes-id.SlackBuild/mythes-id.info
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
PRGNAM="mythes-id"
VERSION="1.0.1"
HOMEPAGE="https://idnux.wordpress.com/proyek/mythes-id/"
DOWNLOAD="git://github.com/idnux/thes-id/"
MD5SUM=""
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
REQUIRES=""
MAINTAINER="Ali Ahmadi"
EMAIL="[email protected]"
12 changes: 12 additions & 0 deletions mythes-id.SlackBuild/slack-desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# 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------------------------------------------------------|
mythes-id: mythes-id (Indonesian Thesaurus for LibreOffice/Apache OpenOffice)
mythes-id:
mythes-id: Indonesian Thesaurus for LibreOffice/Apache OpenOffice
mythes-id:

0 comments on commit ead1c4a

Please sign in to comment.