aboutsummaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/misc/unison/Manifest24
-rw-r--r--net/misc/unison/slack-required4
-rw-r--r--net/misc/unison/unison.SlackBuild218
3 files changed, 246 insertions, 0 deletions
diff --git a/net/misc/unison/Manifest b/net/misc/unison/Manifest
new file mode 100644
index 00000000..8b0e3b49
--- /dev/null
+++ b/net/misc/unison/Manifest
@@ -0,0 +1,24 @@
+-----BEGIN PGP SIGNED MESSAGE-----
+Hash: SHA256
+
+DIST unison-2.27.149.tar.gz 585319 MD5 b042d21bca3179645486c46d76deffba RMD160 b21205a5d53e455a576bd7afc1443bf2cd1d2a6f SHA1 8de184e0a74eaa9bd17049e94ccf39bbc3fba150 SHA256 398b4d95876fbc71059974705c88459effe7b52f341f1f709e078169bba3bed0 SHA512 2b1cf5895e6ce18cec15fb792d2f5dd640749cf0b205c1ff600ea3fd57be25628ad2195095cd072e2c181a0d164989625574dc955cc138605573930bca7da92c
+MKBUILD unison.mkbuild 5248 MD5 cebea0081ed6121810681385d2b7310e RMD160 d43eb66cf8a845e6ceb6b40538686cf9eaba40aa SHA1 f5b7f9ab5dc5635323f522f113b35a8fbc143484 SHA256 d0922bb1c177336f78be4867840a3545b4059bf0f9821a15fee99db414ece665 SHA512 420ad1faa7c6950fc6c9100c3b12e82ef65854f67eec6e6a6bba0ef1a92f1fdb2f743c27d8918e71676f73069762faf9e10e3707321b3ab73fcc7fd616f80e06
+SLACK-REQUIRED slack-required 76 MD5 64933398fe36ff33c14deaa3305c3f59 RMD160 55d09e41557bf08e93ddedcf4813541e4825403a SHA1 0fb3625f1840b093cd6989355459fa294424d2a9 SHA256 fcda2e348f185f1ee4e0415cafbf142f0b40b68cb34b3b46bf1bdea6b1d1093c SHA512 68c3032b43ef0470d5d7b7d1650fe3c9c312c7d7f2c84ee7c15d13d8875dda286ce220a057b3a807cfbc8627eb35e7bdf491eb318b8427282cea9bbc30b3a98e
+SLACKBUILD unison.SlackBuild 6952 MD5 d486831e4fdaaa64295619b1efad8064 RMD160 a8622ce1e1aa8e506b1366653f22e59a40ec35e1 SHA1 8ebe08d187d70a6d802eb00574fe7330fea12361 SHA256 e956f59f7ac9cfe8d523626655b99923f4d1b2a2efc0259a0380e48bcf34a150 SHA512 30059eb0838bf856010c8e18bbb7d6fff277e3a0d6cd74b02a70e7cc8ba251242280500671ddc4afd1151b85b06e613453511dc60c3d64ddd4ece0f091cbe3c7
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v1.4.9 (GNU/Linux)
+
+iQIcBAEBCAAGBQJKQbG0AAoJEEHL93ESzgeijIAP/jmwmxH/qL1xrjHEgMIAWTK2
+AyjrWiAznpEIZtbIHW64gfdUBxPnFFwXvwIRaw7sMj5Mf+3BBLxC02dsQOr1AvbD
+7Od1h5PQumH1VTlP3p4CwITWb/7Z2/T+94SseO8DDWZlk1XNP+I5Emblg5KVtK+0
+Dx2dKYRsxlLZoaMqhHOp30Up3kUHeZhzAcBiTwrlbh0/feNSjVQWlpA9+NrnVXMy
+lNSYI0V80k37hxK1mhxr7zEe4cQsi1lj+xwF1XND4xshd1B81+s6uCx4XrT5MOI3
+Y5Njn0FFyWhRAemnoDfrlYC8xrJFG2O80RXy0fFreUAu2Q2JuriO2m0clvtx0Zb3
+aq4TK0pBEBIRGyqGSanjUsaIPs1hQxk9S8kW/W6pVOgL42yLE6elLowXuupvADlh
+sHeXSaP4jnj6jP2UVLJC09cI5ZQcvBwc/dk7zGf0CxpyMPXABqEwjBddZUFOX5fY
+ZLA/awIqNWMfeeEUdN8Cpyizc6FNAbcKG0kiY2HMcySnzzDkcWvCFYywMQ5S4scW
+D4SuSRAXwm9ksRwdxG0RzUWWXpj/NMImz+T6lo8zAEcfr/9eJnPewNzEoNbwOfqz
+FrZ3ZsmnLqp89KgC36lM+dCcEcP04XIk+gH2LclXKE9iZAx13+nSqGPcBikpnyZ1
+4trwNWZbEKeh2xYh1qVn
+=S+v4
+-----END PGP SIGNATURE-----
diff --git a/net/misc/unison/slack-required b/net/misc/unison/slack-required
new file mode 100644
index 00000000..bc1d506e
--- /dev/null
+++ b/net/misc/unison/slack-required
@@ -0,0 +1,4 @@
+# Dependency list to unison
+#
+# dependency [condition] [version]]
+ocaml
diff --git a/net/misc/unison/unison.SlackBuild b/net/misc/unison/unison.SlackBuild
new file mode 100644
index 00000000..c2ccb545
--- /dev/null
+++ b/net/misc/unison/unison.SlackBuild
@@ -0,0 +1,218 @@
+#!/bin/bash
+#
+# unison.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.
+#
+# unison.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 unison, by Silvio Rhatto
+# requires: ocaml
+# tested: unison-2.27.149
+# 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="unison"
+PKG_NAME="unison"
+ARCH=${ARCH:=i486}
+SRC_VERSION=${VERSION:=2.27.149}
+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:="net/misc/unison"}
+PREFIX=${PREFIX:=/usr}
+PKG_WORK="$TMP/$SRC_NAME"
+CONF_OPTIONS=${CONF_OPTIONS:=""}
+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://www.seas.upenn.edu/~bcpierce/unison//download/releases/stable/$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"
+
+# Compile
+make $NUMJOBS || exit $ERROR_MAKE
+
+# Install
+mkdir -p $PKG/$PREFIX/bin
+cp unison $PKG/$PREFIX/bin
+
+# 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
+)
+
+# Install documentation
+DOCS="BUGS.txt CONTRIB COPYING NEWS README ROADMAP.txt TAGS TODO.txt"
+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-------------------------------------------------------|
+unison: unison
+unison:
+unison: Unison is a file-synchronization tool for Unix and Windows.
+unison: It allows two replicas of a collection of files and directories
+unison: to be stored on different hosts (or different disks on the same
+unison: host), modified separately, and then brought up to date by
+unison: propagating the changes in each replica to the other.
+unison:
+unison:
+unison:
+unison:
+EODESC
+
+# 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