From 6493df6c5d4761bb2788d13a8b1e33f3ae2681d9 Mon Sep 17 00:00:00 2001 From: rafael2k Date: Tue, 10 Feb 2009 18:38:39 +0000 Subject: lighttpd added git-svn-id: svn+slack://slack.fluxo.info/var/svn/slackbuilds@2104 370017ae-e619-0410-ac65-c121f96126d4 --- net/www/lighttpd/Manifest | 3 + net/www/lighttpd/lighttpd.SlackBuild | 155 +++++++++++++++++++++++++++++++++++ 2 files changed, 158 insertions(+) create mode 100644 net/www/lighttpd/Manifest create mode 100644 net/www/lighttpd/lighttpd.SlackBuild (limited to 'net') diff --git a/net/www/lighttpd/Manifest b/net/www/lighttpd/Manifest new file mode 100644 index 00000000..a43f6685 --- /dev/null +++ b/net/www/lighttpd/Manifest @@ -0,0 +1,3 @@ +DIST lighttpd-1.4.20.tar.gz 827538 MD5 7ce7eefb487682b61d9b06b41864c64a RMD160 222e9c69b61467f9376768f92a5eee3add796020 SHA1 61790c02d9e96c3cb23ffd3907f1caee64c475dd SHA256 32a25ad19372bd5be4510d9347956acb03370fd86cfedded61f423b737b7ddb1 SHA512 7503115b92d3b1f48b4b7f89ee6fd91154dfceaee19eecc40e82ba70f0c545ce93639179b47f8313bd42b7be9c74fb9e905494aa335bd5898ded548f5f740187 +MKBUILD lighttpd.mkbuild 4946 MD5 02cf05005a3c0fbb6b5dca07d27f60c2 RMD160 64c5870c2b56e5cf2a48c6dab17f46fa10439b06 SHA1 d187721d837fedf7392dbf724a68da84d913f8be SHA256 f0e64fa4f89fe5e4c11909baff7ac5485750f37bbf384665f04142316c170d95 SHA512 25c38d310f666151fa5d5b7e0ed310f439c63d38f8bf6addfd8aefd7d2f3f4f43d8b5f4cc52811cb8338d369af87eeb9cbb55c6de1294b7eb4f0375418234b2f +SLACKBUILD lighttpd.SlackBuild 4846 MD5 47db4e996088a5ac64700fe16c4b8094 RMD160 15a4a3b157ac4c7ff27beb0b4187e1fd2f474bf9 SHA1 b8b7ea1e4dc1199c4f7d77336c4cc62c8d30416e SHA256 21e38f22704132ce0894b256c6483826f94e82ff0f106eebc44a6943d996743f SHA512 fbc935fbdcaff0f0dbdee0bf8350dddc1f27ce045e26a76183e1ae58efdf02d62e64817c4fe1f8b1c0cd50b4c9b02fdfbe698a877ab81b542ce366a5438787f3 diff --git a/net/www/lighttpd/lighttpd.SlackBuild b/net/www/lighttpd/lighttpd.SlackBuild new file mode 100644 index 00000000..9f66c6d0 --- /dev/null +++ b/net/www/lighttpd/lighttpd.SlackBuild @@ -0,0 +1,155 @@ +#!/bin/bash +# +# lighttpd.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. +# +# lighttpd.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 lighttpd, by Rafael Diniz +# requires: +# tested: lighttpd-1.4.20 +# model: generic.mkSlackBuild $Rev: 784 $ +# + +# Look for slackbuildrc +if [ -f ~/.slackbuildrc ]; then + source ~/.slackbuildrc +elif [ -f /etc/slackbuildrc ]; then + source /etc/slackbuildrc +fi + +# Set variables +CWD="$(pwd)" +SRC_NAME="lighttpd" +PKG_NAME="lighttpd" +ARCH=${ARCH:=i486} +SRC_VERSION=${VERSION:=1.4.20} +PKG_VERSION="$(echo "$SRC_VERSION" | tr '[[:blank:]-]' '_')" +BUILD=${BUILD:=1rd} +SRC_DIR=${SRC_DIR:=$CWD}/$PKG_NAME +TMP=${TMP:=/tmp} +PKG=${PKG:=$TMP/package-$PKG_NAME} +REPOS=${REPOS:=$TMP} +PREFIX=${PREFIX:=/usr} +PKG_WORK="$TMP/$SRC_NAME" +CONF_OPTIONS=${CONF_OPTIONS:=""} +NUMJOBS=${NUMJOBS:="-j3"} + +# 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.lighttpd.net/download/$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 + +# 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 +) + +# Install documentation +DOCS="NEWS TODO README AUTHORS INSTALL ChangeLog MAINTAINERS COPYING LICENSE SIGNATURE 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-----------------------------------------------------| +lighttpd: lighttpd by Slack.Sarava +lighttpd: +lighttpd: Security, speed, compliance, and flexibility -- all of +lighttpd: these describe lighttpd . +lighttpd: +lighttpd: +lighttpd: Lighttpd is a small memory footprint web-server. +lighttpd: +lighttpd: +lighttpd: http://www.lighttpd.net/ +lighttpd: +EODESC + +# Build the package +cd "$PKG" +makepkg -l y -c n "$REPOS/$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 -- cgit v1.2.3