Nginx 1.5.x

Kreiranje Slackware paketa

Moderator: Urednik

Post Reply

Administrator
Administrator
offline
User avatar

Posts: 3451
Joined: 01 Apr 2012, 13:50
Location: Mlečni put

Post Napisano: 09 Sep 2013, 14:00


Na SBo se može naći verzija 1.4.1, na slacky.eu je verzija 1.4.2. Obe su verzije dobre za stabilnu verziju Slacka ali za -current je neophodna novija verzija. Razlog je noviji perl paket koji je u current-u 5.18 a u stabilnoj verziji Slacka 5.16.

Zbog ovoga sam napravio novi paket Nginx 1.5.4. Neophodna su testiranja da bi bio siguran da paket radi kako treba. Ja sam instalirao kod mene a svi koji su voljni mogu da provere da li sam dobro napravio paket.

Zbog neophodnih izmena u određenim fajlovima, pakujem ceo nginx direktorijum sa izvornim kodom, slackbuild skriptom i ostalim fajlovima.

SlackBuild skripta je preuzeta sa SBo i blago je izmenjena. Podrazumevani vlasnik je nobody i grupa je nobody, kao što i treba da bude.

Code: Select all

#!/bin/sh

# Slackware build script for nginx

# Copyright 2008 Cherife Li <cherife-#-dotimes.com>
# Copyright 2011 Diogo Leal <diogo@diogoleal.com>
# Copyright 2012-13 Francisco Ambrozio <sbo@franciscoambrozio.com>
# 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.

# Special thanks to Thomas Morper for some configuration adjustments tips

PRGNAM=nginx
VERSION=${VERSION:-1.5.4}
BUILD=${BUILD:-1}
TAG=${TAG:-_stereo}

if [ -z "$ARCH" ]; then
  case "$( uname -m )" in
    i?86) ARCH=i486 ;;
    arm*) ARCH=arm ;;
       *) ARCH=$( uname -m ) ;;
  esac
fi

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

USE_SPDY=${USE_SPDY:-no}

eval $(perl '-V:installvendorlib')

if [ "$ARCH" = "i486" ]; then
   SLKCFLAGS="-O2 -march=i486 -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=""
   LIBDIRSUFFIX=""
fi

set -e

rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION
tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
cd $PRGNAM-$VERSION
chown -R root:root .
find . \
 \( -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 {} \;

if [ "$USE_SPDY" == "yes" ]; then
    SPDY_MOD=" --with-http_spdy_module "
else
    SPDY_MOD=""
fi

CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
./configure \
  --prefix=/usr \
  --sbin-path=/usr/sbin/nginx \
  --conf-path=/etc/nginx/nginx.conf \
  --pid-path=/var/run/nginx.pid \
  --lock-path=/var/lock/nginx \
  --user=${NGINXUSER:=nobody} \
  --group=${NGINXGROUP:=nogroup} \
  --error-log-path=/var/log/nginx/error.log \
  --http-log-path=/var/log/nginx/access.log \
  --with-ipv6 \
  --with-select_module \
  --with-poll_module \
  --with-http_ssl_module \
  --with-http_realip_module \
  --with-http_addition_module \
  --with-http_xslt_module \
  --with-http_sub_module \
  --with-http_dav_module \
  --with-http_flv_module \
  --with-http_gzip_static_module \
  --with-http_random_index_module \
  --with-http_secure_link_module \
  --with-http_stub_status_module \
  --with-http_perl_module \
  $SPDY_MOD \
  --with-perl_modules_path=$installvendorlib \
  --without-mail_pop3_module \
  --without-mail_imap_module \
  --without-mail_smtp_module

make
make install DESTDIR=$PKG

find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | \
  grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
find $PKG -name perllocal.pod -o -name ".packlist" -o -name "*.bs" | \
  xargs rm -f 2> /dev/null
find $PKG -perm 444 -exec chmod 0644 {} \;
find $PKG -perm 555 -exec chmod 0755 {} \;

# Remove some other empty and/or unnecessary directories from the package
eval $(perl '-V:archlib')
rm -rf $PKG/$archlib $PKG/usr/html $PKG/var

# Add an init script
mkdir -p $PKG/etc/rc.d
cat $CWD/rc.nginx > $PKG/etc/rc.d/rc.nginx.new

mkdir -p $PKG/etc/logrotate.d
sed -e "s,@USER@,$NGINXUSER," -e "s,@GROUP@,$NGINXGROUP," $CWD/nginx.logrotate \
  > $PKG/etc/logrotate.d/nginx.new

# Don't clobber config files
for file in fastcgi_params fastcgi.conf mime.types nginx.conf \
            koi-utf koi-win scgi_params uwsgi_params win-utf ; do
            mv $PKG/etc/nginx/$file $PKG/etc/nginx/$file.new ;
done

# Create the log dir and set the permissions
mkdir -p $PKG/var/log/nginx
chown $NGINXUSER $PKG/var/log/nginx
chmod 750 $PKG/var/log/nginx

mkdir -p $PKG/usr/doc/nginx-$VERSION
cp -a CHANGES* LICENSE README $PKG/usr/doc/nginx-$VERSION
cat $CWD/nginx.SlackBuild > $PKG/usr/doc/nginx-$VERSION/nginx.SlackBuild

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

cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-txz}
nginx-1.5.4-i486-1_stereo.txz
gotov paket za testiranje na -currentu
(360.53 KiB) Downloaded 409 times
nginx-1.5.4-stereo.tar.bz2
ceo direktorijum sa svim neophodnim fajlovima
(764.89 KiB) Downloaded 421 times
Use the source, Luke
SSZ irc kanal
Spread the Word, “CHOOSE SLACK! and Don’t look back.”


Post Reply

Who is online

Users browsing this forum: No registered users and 16 guests