summaryrefslogtreecommitdiffstats
path: root/ipcalc/build
diff options
context:
space:
mode:
author Eric Hameleers <alien@slackware.com>2007-09-28 15:06:10 +0000
committer Eric Hameleers <alien@slackware.com>2007-09-28 15:06:10 +0000
commit5f08f91d5ee58244c490ff2b9bd73e023ce6c12f (patch)
tree1752f263b241a3850487f47ebfc7946d88f4db83 /ipcalc/build
parent53e5541890f3971557785b43ef85304ac89e6758 (diff)
downloadasb-5f08f91d5ee58244c490ff2b9bd73e023ce6c12f.tar.gz
asb-5f08f91d5ee58244c490ff2b9bd73e023ce6c12f.tar.xz
Initial revision
Diffstat (limited to 'ipcalc/build')
-rw-r--r--ipcalc/build/ipcalc-0.41_cgi_urls.patch20
-rw-r--r--ipcalc/build/ipcalc-0.41_w3.patch27
-rwxr-xr-xipcalc/build/ipcalc.SlackBuild152
3 files changed, 199 insertions, 0 deletions
diff --git a/ipcalc/build/ipcalc-0.41_cgi_urls.patch b/ipcalc/build/ipcalc-0.41_cgi_urls.patch
new file mode 100644
index 00000000..e59a4e7e
--- /dev/null
+++ b/ipcalc/build/ipcalc-0.41_cgi_urls.patch
@@ -0,0 +1,20 @@
+--- ipcalc-0.41/ipcalc.cgi.orig 2007-09-28 16:49:48.000000000 +0200
++++ ipcalc-0.41/ipcalc.cgi 2007-09-28 17:02:51.000000000 +0200
+@@ -122,7 +122,7 @@
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-15">
+ <title>IP Calculator / IP Subnetting</title>
+- <link rel="shortcut icon" href="http://jodies.de/favicon.ico">
++ <link rel="shortcut icon" href="ipcalc.ico">
+ <script language="JavaScript" type="text/javascript">
+ <!--
+ function setFocus()
+@@ -205,7 +205,7 @@
+ <table border=0 width="100%">
+ <tr>
+ <td valign="top">&nbsp;</td>
+-<td><a href="http://jodies.de/ipcalc"><img src="ipcal03.gif" align=right width=100 height=95 border=0 alt=""></a></td></tr>
++<td><a href="http://jodies.de/ipcalc"><img src="ipcalc.gif" align=right width=100 height=95 border=0 alt=""></a></td></tr>
+ </table>
+ EOF
+ if ($help) {
diff --git a/ipcalc/build/ipcalc-0.41_w3.patch b/ipcalc/build/ipcalc-0.41_w3.patch
new file mode 100644
index 00000000..ad24cbb2
--- /dev/null
+++ b/ipcalc/build/ipcalc-0.41_w3.patch
@@ -0,0 +1,27 @@
+--- ipcalc-0.41/ipcalc.orig 2007-09-28 16:54:20.000000000 +0200
++++ ipcalc-0.41/ipcalc 2007-09-28 16:54:49.000000000 +0200
+@@ -226,15 +226,15 @@
+ print "Supernet\n\n";
+ supernet($network,$mask1,$mask2);
+ }
+- if ($opt_html) {
+- print << 'EOF';
+- <p>
+- <a href="http://validator.w3.org/check/referer"><img border="0"
+- src="http://www.w3.org/Icons/valid-html401"
+- alt="Valid HTML 4.01!" height="31" width="88"></a>
+- </p>
+-EOF
+- }
++# if ($opt_html) {
++# print << 'EOF';
++# <p>
++# <a href="http://validator.w3.org/check/referer"><img border="0"
++# src="http://www.w3.org/Icons/valid-html401"
++# alt="Valid HTML 4.01!" height="31" width="88"></a>
++# </p>
++#EOF
++# }
+ exit;
+
+ }
diff --git a/ipcalc/build/ipcalc.SlackBuild b/ipcalc/build/ipcalc.SlackBuild
new file mode 100755
index 00000000..3717616d
--- /dev/null
+++ b/ipcalc/build/ipcalc.SlackBuild
@@ -0,0 +1,152 @@
+#!/bin/sh
+# $Id$
+# Copyright (c) 2007 Eric Hameleers <alien@slackware.com>
+# All rights reserved.
+#
+# Permission to use, copy, modify, and distribute this software for
+# any purpose with or without fee is hereby granted, provided that
+# the above copyright notice and this permission notice appear in all
+# copies.
+#
+# THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED 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 AUTHORS AND COPYRIGHT HOLDERS AND THEIR
+# CONTRIBUTORS 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.
+# -----------------------------------------------------------------------------
+#
+# Slackware SlackBuild script
+# ===========================
+# By: Eric Hameleers <alien@slackware.com>
+# For: ipcalc
+# Descr: IP calculator
+# URL: http://jodies.de/ipcalc
+# Needs:
+# Changelog:
+# 0.41-1: 28/Sep/2007 by Eric Hameleers <alien@slackware.com>
+# * Initial build.
+#
+# Run 'sh ipcalc.SlackBuild --cleanup' to build a Slackware package.
+# The package (.tgz) plus descriptive .txt file are created in /tmp .
+# Install using 'installpkg'.
+#
+# -----------------------------------------------------------------------------
+
+# Set initial variables:
+
+PRGNAM=ipcalc
+VERSION=${VERSION:-0.41}
+ARCH=${ARCH:-noarch}
+BUILD=${BUILD:-1}
+
+# Where do we look for sources?
+CWD=$(pwd)
+SRCDIR=$(dirname $0)
+[ "${SRCDIR:0:1}" == "." ] && SRCDIR=${CWD}/${SRCDIR}
+
+# Place to build (TMP) package (PKG) and output (OUTPUT) the program:
+TMP=${TMP:-/tmp/build}
+PKG=$TMP/package-$PRGNAM
+OUTPUT=${OUTPUT:-/tmp}
+
+DOCS="changelog ipcalc.cgi $SRCDIR/README.slackware $SRCDIR/ipcalc.ico"
+
+SOURCE="$SRCDIR/${PRGNAM}-${VERSION}.tar.gz"
+SRCURL="http://jodies.de/${PRGNAM}-archive/${PRGNAM}-${VERSION}.tar.gz"
+
+##
+## --- with a little luck, you won't have to edit below this point --- ##
+##
+
+# Exit the script on errors:
+set -e
+trap 'echo "$0 FAILED at line $LINENO!" | tee $OUTPUT/error-${PRGNAM}.log' ERR
+# Catch unitialized variables:
+set -u
+P1=${1:-1}
+
+# Create working directories:
+mkdir -p $TMP/tmp-$PRGNAM # location to build the source
+rm -rf $TMP/tmp-$PRGNAM/* # remove the remnants of previous build
+mkdir -p $PKG # place for the package to be built
+rm -rf $PKG/* # We always erase old package's contents:
+mkdir -p $OUTPUT # place for the package to be saved
+
+# Source file availability:
+if ! [ -f ${SOURCE} ]; then
+ if ! [ "x${SRCURL}" == "x" ]; then
+ # Check if the $SRCDIR is writable at all - if not, download to $OUTPUT
+ [ -w "$SRCDIR" ] || SOURCE="$OUTPUT/$(basename $SOURCE)"
+ echo "Source '$(basename ${SOURCE})' not available yet..."
+ echo "Will download file to $(dirname $SOURCE)"
+ wget -nv --connect-timeout=30 -O "${SOURCE}" "${SRCURL}" || true
+ if [ $? -ne 0 -o ! -s "${SOURCE}" ]; then
+ echo "Downloading '$(basename ${SOURCE})' failed... aborting the build."
+ mv -f "${SOURCE}" "${SOURCE}".FAIL
+ exit 1
+ fi
+ else
+ echo "File '$(basename ${SOURCE})' not available... aborting the build."
+ exit 1
+ fi
+fi
+
+if [ "$P1" == "--download" ]; then
+ echo "Download complete."
+ exit 0
+fi
+
+# --- PACKAGE BUILDING ---
+
+echo "++"
+echo "|| $PRGNAM-$VERSION"
+echo "++"
+
+cd $TMP/tmp-$PRGNAM
+echo "Extracting the source archive(s) for $PRGNAM..."
+tar -xzvf ${SOURCE}
+cd ${PRGNAM}-${VERSION}
+
+# Strip the "valid html" message from HTML output, since this
+# tries downloading an image from w3.org ...
+cat $SRCDIR/ipcalc-${VERSION}_w3.patch | patch -p1 -b -z .w3
+# Change the shortcut icon URL so that it uses a local icon.
+cat $SRCDIR/ipcalc-${VERSION}_cgi_urls.patch |patch -p1 -b -z .url
+
+chown -R root:root .
+chmod -R u+w,go+r-w,a-s .
+
+# Install all the needed stuff to the package dir
+mkdir -p $PKG/usr/bin
+cp ipcalc $PKG/usr/bin
+chmod 755 $PKG/usr/bin/ipcalc
+
+# Add documentation:
+mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
+cp -a $DOCS $PKG/usr/doc/$PRGNAM-$VERSION || true
+chmod -R a-w $PKG/usr/doc/$PRGNAM-$VERSION/*
+
+# Add a package description:
+mkdir -p $PKG/install
+cat $SRCDIR/slack-desc > $PKG/install/slack-desc
+
+# Build the package:
+cd $PKG
+makepkg --linkadd y --chown n $OUTPUT/${PRGNAM}-${VERSION}-${ARCH}-${BUILD}.tgz 2>&1 | tee $OUTPUT/makepkg-${PRGNAM}.log
+cd $OUTPUT
+md5sum ${PRGNAM}-${VERSION}-${ARCH}-${BUILD}.tgz > ${PRGNAM}-${VERSION}-${ARCH}-${BUILD}.tgz.md5
+cd -
+cat $PKG/install/slack-desc | grep "^${PRGNAM}" > $OUTPUT/${PRGNAM}-${VERSION}-${ARCH}-${BUILD}.txt
+
+# Clean up the extra stuff:
+if [ "$P1" = "--cleanup" ]; then
+ rm -rf $TMP/tmp-$PRGNAM
+ rm -rf $PKG
+fi