aboutsummaryrefslogtreecommitdiff
path: root/app/misc/wyrd
diff options
context:
space:
mode:
Diffstat (limited to 'app/misc/wyrd')
-rw-r--r--app/misc/wyrd/Manifest24
-rw-r--r--app/misc/wyrd/slack-required4
-rw-r--r--app/misc/wyrd/wyrd.SlackBuild286
3 files changed, 314 insertions, 0 deletions
diff --git a/app/misc/wyrd/Manifest b/app/misc/wyrd/Manifest
new file mode 100644
index 00000000..aa6ec04a
--- /dev/null
+++ b/app/misc/wyrd/Manifest
@@ -0,0 +1,24 @@
+-----BEGIN PGP SIGNED MESSAGE-----
+Hash: SHA256
+
+DIST wyrd-1.4.4.tar.gz 226757 MD5 a376c05ba614625da06082d850c742c7 RMD160 8478610ab5d071910b638b46f84b119f81826a7b SHA1 86353034316e7d5f061ae2c11f7703912a29fe70 SHA256 154f5cefc86d43077f3c150e5b50a27d33fe7a7e50d7b90f39d16f054f5c570a SHA512 944e76774320d7c0109fdb22c03a2ac100399c2f4bd250c5d8c35eff5a44671b2e7a722c11b59b02bfe3e9b24ab6e3153306139ee379f1017c750b2cc81ccfb7
+MKBUILD wyrd.mkbuild 4865 MD5 634532923f33c7b56328792c8d8a31b6 RMD160 df65da14ee3fd2af8c0782b58479abd431d29f7c SHA1 3132cb65aba720e07ede32322db3b3861a39548d SHA256 2fe7f07c2410d60af02da9094329854b4514a826d9ddcb7fb5ab4be3ee3a9fff SHA512 aff9ba7f34b09616547a4432e118187e87209ff958530b0949981b2c9edd19be49a425ed39a58b46855060b85db26e7896db9f59891a74434913bdba74d99f72
+SLACK-REQUIRED slack-required 75 MD5 cae00dacbcee8463ca1b1bd6fae495bf RMD160 7cf5e067b39c950c572a5137d749a7a0e7443349 SHA1 ee8b2f518d078bc335492c2f2f149cb159ae95ac SHA256 28524767a9ed0a0c641d4e87dd3965ce941663d2f0c0888f1452ed9252a333a6 SHA512 2124432a8c473b81653d40b67b2a258e4507b6453e86ba8e1606be261475b71b940194e6733bf6835c5cb552ed9dfee91fbae8dde8be181341af2c483c26c050
+SLACKBUILD wyrd.SlackBuild 8327 MD5 964c92bcc0d65195e718762fae673750 RMD160 2ad00bf2c263dd260946ad3f8ae1a72357d4bda3 SHA1 ce78f9d39540883398ba77609cd0c2090919b8c1 SHA256 14908d95de71daf54886022e88e02c731765096571650c1380b184362cb69891 SHA512 c05df4d64b997e893fe8394006ac26aa7b4d298f4bbc432110cb902dab65e52e9128448de4b0f9275543197ff8a5f5038f211984fa45d62ec7827a9c4bf64fb4
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v1.4.9 (GNU/Linux)
+
+iQIcBAEBCAAGBQJKZIuGAAoJEEHL93ESzgeiUekQAJUZ937qidb7IUjxXGoYD4R8
+nLfhg2J+H3QHWcf2KSEh0d4ACaCYHO2eIy8MPqjdWhroaGaOAMm0ptzDlP08rmPk
+gXVQ1lDU+rSLxQJomBITCoK9jk1PMZ/eRr4ypjUVoKv/ulWuvuh9xP/Rdr4gBw7Y
+8pn2cmCSxwaoaxnjpaOUUuw7yLJ0RRMZ2sfg5vny2o6UuhP2J8qH59YAVerjtVJt
+XkQgWZbtvsmklRnEmHfZT6rsU6L0GTj28Zni97El1Oe3h288HqN6COm7sr1m+lw6
+LavYlk6XPXvrZxYLVdP5TGWA6wu0GtCniQQX1U5zpsVoxVRdefXWerHD5QIGkiU3
+uv6jkTtPcAMjcsvxGJ/Q7eU3vFAWyBQ1a9uVN1tn16udSOJRFtn8w0oUSVPy5aqg
+V7OrilmvBkMmDT2qmfUqKdcxGq57THs4e2+4Of3cCUrykkbUq08gUfZj4rLFUwbk
+PvWWDi+nzSdkspo+VgR4dVWBZM1c4nDWl4p0Rn7O2+vkrRujcD9zJUElv9ZAk59o
+9WQeU58KL9HcSiKRhJ3ntyNg3K/HzuiHqqrRLm4pGN5ipsX2+razgEWsabivnAbj
+2sYd7+2BjF61zarMCv2oKHEo+BU1lSiRI7GsqwO9sAtwoMG3sT2wvXo1Db08f2Q/
+zv1nGe50lfWophxrhbbk
+=dn3H
+-----END PGP SIGNATURE-----
diff --git a/app/misc/wyrd/slack-required b/app/misc/wyrd/slack-required
new file mode 100644
index 00000000..a0a0ef8f
--- /dev/null
+++ b/app/misc/wyrd/slack-required
@@ -0,0 +1,4 @@
+# Dependency list to wyrd
+#
+# dependency [condition] [version]]
+remind
diff --git a/app/misc/wyrd/wyrd.SlackBuild b/app/misc/wyrd/wyrd.SlackBuild
new file mode 100644
index 00000000..7a7984c7
--- /dev/null
+++ b/app/misc/wyrd/wyrd.SlackBuild
@@ -0,0 +1,286 @@
+#!/bin/bash
+#
+# wyrd.SlackBuild is free software; you can redistribute
+# it and/or modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of the License,
+# or any later version.
+#
+# wyrd.SlackBuild is distributed in the hope that it will
+# be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+# Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+#
+# slackbuild for wyrd, by Silvio Rhatto
+# requires: remind
+# tested: wyrd-1.4.4
+# model: generic.mkSlackBuild $Rev: 805 $
+#
+
+# Look for slackbuildrc
+if [ -f ~/.slackbuildrc ]; then
+ source ~/.slackbuildrc
+elif [ -f /etc/slackbuildrc ]; then
+ source /etc/slackbuildrc
+fi
+
+# Set variables
+CWD="$(pwd)"
+SRC_NAME="wyrd"
+PKG_NAME="wyrd"
+ARCH=${ARCH:=i486}
+SRC_VERSION=${VERSION:=1.4.4}
+PKG_VERSION="$(echo "$SRC_VERSION" | tr '[[:blank:]-]' '_')"
+BUILD=${BUILD:=1rha}
+SRC_DIR=${SRC_DIR:=$CWD}/$PKG_NAME
+TMP=${TMP:=/tmp}
+PKG=${PKG:=$TMP/package-$PKG_NAME}
+REPOS=${REPOS:=$TMP}
+SLACKBUILD_PATH=${SLACKBUILD_PATH:="app/misc/wyrd"}
+PREFIX=${PREFIX:=/usr}
+PKG_WORK="$TMP/$SRC_NAME"
+CONF_OPTIONS=${CONF_OPTIONS:="--sysconfdir=/etc"}
+NUMJOBS=${NUMJOBS:=""}
+
+# Set system libraries' path and optmization flags based on $ARCH
+LIBDIR="$PREFIX/lib"
+
+if [ "$ARCH" = "i386" ]; then
+ SLKCFLAGS="-O2 -march=i386 -mtune=i686"
+elif [ "$ARCH" = "i486" ]; then
+ SLKCFLAGS="-O2 -march=i486 -mtune=i686"
+elif [ "$ARCH" = "i686" ]; then
+ SLKCFLAGS="-O2 -march=i686"
+elif [ "$ARCH" = "s390" ]; then
+ SLKCFLAGS="-O2"
+elif [ "$ARCH" = "x86_64" ]; then
+ SLKCFLAGS="-O2 -fPIC"
+ LIBDIR="$PREFIX/lib64"
+ LDFLAGS="-L/lib64 -L/usr/lib64"
+fi
+
+# Set error codes (used by createpkg)
+ERROR_WGET=31; ERROR_MAKE=32; ERROR_INSTALL=33
+ERROR_MD5=34; ERROR_CONF=35; ERROR_HELP=36
+ERROR_TAR=37; ERROR_MKPKG=38; ERROR_GPG=39
+ERROR_PATCH=40; ERROR_VCS=41; ERROR_MKDIR=42
+ERROR_MANIFEST=43;
+
+# Clean up any leftovers of previous builds
+rm -rf "$PKG_WORK" 2> /dev/null
+rm -rf "$PKG" 2> /dev/null
+
+# Create directories if necessary
+mkdir -p "$SRC_DIR" || exit $ERROR_MKDIR
+mkdir -p "$PKG" || exit $ERROR_MKDIR
+mkdir -p "$REPOS" || exit $ERROR_MKDIR
+mkdir -p "$PKG_WORK" || exit $ERROR_MKDIR
+
+# Dowload source if necessary
+SRC="$SRC_NAME-$VERSION.tar.gz"
+URL="http://pessimization.com/software/wyrd/$SRC"
+
+if [ ! -s "$SRC_DIR/$SRC" ] || ! gunzip -t "$SRC_DIR/$SRC" 2> /dev/null; then
+ wget "$URL" -O "$SRC_DIR/$SRC" || exit $ERROR_WGET
+fi
+
+# Check Manifest file
+if [ -e "$CWD/Manifest" ]; then
+
+ # Manifest signature checking
+ if grep -q -- "-----BEGIN PGP SIGNED MESSAGE-----" $CWD/Manifest; then
+ echo "Checking Manifest signature..."
+ gpg --verify $CWD/Manifest
+ if [ "$?" != "0" ]; then
+ exit $ERROR_MANIFEST
+ fi
+ fi
+
+ MANIFEST_LINES="`grep -E -v "^(MKBUILD|SLACKBUILD)" $CWD/Manifest | wc -l`"
+
+ for ((MANIFEST_COUNT=1; MANIFEST_COUNT <= $MANIFEST_LINES; MANIFEST_COUNT++)); do
+
+ MANIFEST_LINE="`grep -E -v "^(MKBUILD|SLACKBUILD)" $CWD/Manifest | head -n $MANIFEST_COUNT | tail -n 1`"
+ MANIFEST_FILE="`echo $MANIFEST_LINE | awk '{ print $2 }'`"
+ MANIFEST_FILE_TYPE="`echo $MANIFEST_LINE | awk '{ print $1 }'`"
+
+ if [ -e "$SRC_DIR/$MANIFEST_FILE" ]; then
+ MANIFEST_FILE="$SRC_DIR/$MANIFEST_FILE"
+ else
+ MANIFEST_FILE="`find $CWD -name $MANIFEST_FILE`"
+ fi
+
+ if [ ! -e "$MANIFEST_FILE" ] || [ -d "$MANIFEST_FILE" ]; then
+ continue
+ fi
+
+ echo "Checking Manifest for $MANIFEST_FILE_TYPE $MANIFEST_FILE integrity..."
+
+ SIZE_SRC="`wc -c $MANIFEST_FILE | awk '{ print $1 }'`"
+ SIZE_MANIFEST="`echo $MANIFEST_LINE | awk '{ print $3 }'`"
+
+ # Check source code size
+ if [ "$SIZE_SRC" != "$SIZE_MANIFEST" ]; then
+ echo "SIZE Manifest: $SIZE_MANIFEST; SIZE $SRC: $SIZE_SRC"
+ exit $ERROR_MANIFEST
+ else
+ echo "Size match."
+ fi
+
+ # Check source code integrity
+ for ALGO in md5 rmd160 sha1 sha256 sha512; do
+ if [ $ALGO = "rmd160" ]; then
+ ALGO_SRC="`openssl rmd160 $MANIFEST_FILE | awk '{ print $2 }'`"
+ else
+ ALGO_SRC="`"$ALGO"sum $MANIFEST_FILE | awk '{ print $1 }'`"
+ fi
+ ALGO="`echo $ALGO | tr '[:lower:]' '[:upper:]'`"
+ ALGO_MANIFEST=$(echo $MANIFEST_LINE | sed "s/.* $ALGO //" | awk '{ print $1 }')
+ if [ "$ALGO_SRC" != "$ALGO_MANIFEST" ]; then
+ echo "$ALGO Manifest: $ALGO_MANIFEST; $ALGO $SRC: $ALGO_SRC"
+ exit $ERROR_MANIFEST
+ else
+ echo "$ALGO match."
+ fi
+ done
+
+ done
+
+else
+ exit $ERROR_MANIFEST
+fi
+
+# Untar
+cd "$PKG_WORK"
+tar --no-same-owner --no-same-permissions -xvf "$SRC_DIR/$SRC" || exit $ERROR_TAR
+PKG_SRC="$PWD/`ls -l | awk '/^d/ { print $NF }'`"
+cd "$PKG_SRC"
+
+# Configure
+CFLAGS="$SLKCFLAGS" \
+ CXXFLAGS="$SLKCFLAGS" \
+ ./configure \
+ --prefix="$PREFIX" --libdir="$LIBDIR" $CONF_OPTIONS || exit $ERROR_CONF
+
+# Compile
+make $NUMJOBS || exit $ERROR_MAKE
+
+# Install
+make install DESTDIR="$PKG" || exit $ERROR_INSTALL
+
+# Strip binaries
+( 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
+)
+
+# Compress and link manpages
+if [ -d "$PKG/$PREFIX/man" ]; then
+ ( cd "$PKG/$PREFIX/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
+
+# Install documentation
+DOCS="COPYING ChangeLog README"
+mkdir -p "$PKG/usr/doc/$PKG_NAME-$PKG_VERSION" || exit $ERROR_MKDIR
+for doc in $DOCS; do
+ if [ -f "$doc" ]; then
+ cp -a $doc "$PKG/usr/doc/$PKG_NAME-$PKG_VERSION"
+ fi
+done
+
+# Add package description (slack-desc)
+mkdir -p "$PKG/install" || exit $ERROR_MKDIR
+cat << EODESC > "$PKG/install/slack-desc"
+# 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 ':'.
+
+ |-----handy-ruler---------------------------------------------------------|
+wyrd: wyrd
+wyrd:
+wyrd: Wyrd is a text-based front-end to Remind, a sophisticated
+wyrd: calendar and alarm program.
+wyrd:
+wyrd:
+wyrd:
+wyrd:
+wyrd:
+wyrd:
+wyrd:
+EODESC
+
+# Move config files to .new to avoid overwriting any system config
+for config_file in etc/wyrdrc; do
+ mv $PKG/$config_file $PKG/$config_file.new
+done
+
+# Add a post-installation script (doinst.sh)
+mkdir -p "$PKG/install" || exit $ERROR_MKDIR
+cat << EOSCRIPT > "$PKG/install/doinst.sh"
+config() {
+ NEW="\$1"
+ OLD="\$(dirname \$NEW)/\$(basename \$NEW .new)"
+ OLD="\$(dirname \$NEW)/\$(basename \$OLD .sample)"
+ OLD="\$(dirname \$NEW)/\$(basename \$OLD .dist)"
+
+ # If there's no config file by that name, mv it over:
+ if [ ! -r \$OLD ]; then
+ mv \$NEW \$OLD
+ elif [ "\$(cat \$OLD | md5sum)" = "\$(cat \$NEW | md5sum)" ]; then
+ # toss the redundant copy
+ rm \$NEW
+ fi
+ # Otherwise, we leave the .new copy for the admin to consider...
+}
+
+mkgroup() {
+ GROUP="\$1"
+ if ! grep -qe "^\$GROUP:" etc/group; then
+ echo Creating group \$GROUP...
+ chroot . /usr/sbin/groupadd \$GROUP
+ fi
+}
+
+mkuser() {
+ USER="\$1"
+ if [ ! -z "\$2" ]; then
+ GROUP="\$2"
+ else
+ GROUP="\$USER"
+ fi
+ if ! grep -qe "^\$USER:" etc/passwd; then
+ echo Creating user \$USER...
+ chroot . /usr/sbin/useradd \$USER -g \$GROUP
+ fi
+}
+
+config etc/wyrdrc.new
+EOSCRIPT
+
+# Build the package
+cd "$PKG"
+mkdir -p $REPOS/$SLACKBUILD_PATH
+makepkg -l y -c n "$REPOS/$SLACKBUILD_PATH/$PKG_NAME-$PKG_VERSION-$ARCH-$BUILD.tgz" || exit $ERROR_MKPKG
+
+# Delete source and build directories if requested
+if [ "$CLEANUP" == "yes" ] || [ "$1" = "--cleanup" ]; then
+ rm -rf "$PKG_WORK" "$PKG"
+fi