diff options
author | Eric Hameleers <alien@slackware.com> | 2005-08-18 19:36:05 +0000 |
---|---|---|
committer | Eric Hameleers <alien@slackware.com> | 2005-08-18 19:36:05 +0000 |
commit | 1404120301b7013f565b0e8f3867646e9a13975f (patch) | |
tree | a8f1a8adef685dce0b4ff422ee872e87b2c39f18 /freenx | |
parent | 81ae0ea0729596a81e4e7b62310f699fbeca6093 (diff) | |
download | asb-1404120301b7013f565b0e8f3867646e9a13975f.tar.gz asb-1404120301b7013f565b0e8f3867646e9a13975f.tar.xz |
Initial revision
Diffstat (limited to 'freenx')
-rwxr-xr-x | freenx/build/nx.SlackBuild | 256 |
1 files changed, 256 insertions, 0 deletions
diff --git a/freenx/build/nx.SlackBuild b/freenx/build/nx.SlackBuild new file mode 100755 index 00000000..a53c0f46 --- /dev/null +++ b/freenx/build/nx.SlackBuild @@ -0,0 +1,256 @@ +#!/bin/sh +# +# ----------------------------------------------------------------------------- +# +# Slackware SlackBuild script +# =========================== +# By: Eric Hameleers <alien@sox.homeip.net> +# For: nx +# URL: http://www.nomachine.com/ +# Needs: +# Changelog: +# 1.5.0-1: 14/Aug/2005 by Eric Hameleers <alien@sox.homeip.net> +# * Initial build. +# +# Run 'sh SlackBuild --cleanup' to build a Slackware package. +# The package (.tgz) plus descriptive .txt file are created in /tmp . +# Install using 'installpkg'. +# +# ----------------------------------------------------------------------------- + +# --- INIT --- +# Set initial variables: +CWD=`pwd` +if [ "$TMP" = "" ]; then + TMP=/tmp +fi + +PRGNAM=nx +VERSION=1.5.0 +ARCH=${ARCH:-i486} +BUILD=1 + +if [ "$ARCH" = "i386" ]; then + SLKCFLAGS="-O2 -march=i386 -mcpu=i686" +elif [ "$ARCH" = "i486" ]; then + SLKCFLAGS="-O2 -march=i486 -mcpu=i686" +elif [ "$ARCH" = "s390" ]; then + SLKCFLAGS="-O2" +elif [ "$ARCH" = "s390x" ]; then + SLKCFLAGS="-O2" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" +fi + +PKG=$TMP/package-$PRGNAM + +if [ ! -d $TMP/tmp-$PRGNAM ]; then + mkdir -p $TMP/tmp-$PRGNAM # location to build the source +fi +if [ ! -d $PKG ]; then + mkdir -p $PKG # place for the package to be built +fi + +SOURCE[0]=nxproxy-1.5.0-9.tar.gz +SOURCE[1]=nxcomp-1.5.0-65.tar.gz +SOURCE[2]=nxcompext-1.5.0-16.tar.gz +SOURCE[3]=nx-X11-1.5.0-15.tar.gz +SOURCE[4]=nxagent-1.5.0-87.tar.gz +SOURCE[5]=nxviewer-1.5.0-14.tar.gz +SOURCE[6]=nxdesktop-1.5.0-59.tar.gz +SOURCE[7]=nxscripts-1.5.0-11.tar.gz +SOURCE[9]=nxagent +SOURCE[10]=docs.tar.bz2 + +PATCH[0]=NX.diff + + +# --- PACKAGE BUILDING --- + +echo "++" +echo "|| $PRGNAM-$VERSION" +echo "++" + +rm -rf $PKG/* + +cd $PKG + +# Explode the package framework: +if [ -f $CWD/_$PRGNAM.tar.gz ]; then + explodepkg $CWD/_$PRGNAM.tar.gz +fi + +cd $TMP/tmp-$PRGNAM + + +# --- TARBALL EXTRACTION,PATCH,MODIFY --- + +echo "Extracting the program tarballs for $PRGNAM..." +for (( i = 0; i < 8; i++ )) ; do + if file ${CWD}/${SOURCE[$i]} | grep -q ": gzip "; then + tar -zxvf ${CWD}/${SOURCE[$i]} + else + tar -jxvf ${CWD}/${SOURCE[$i]} + fi +done + +patch -p0 < $CWD/${PATCH[0]} + + +chown -R root.root * +find . -perm 777 -exec chmod 755 {} \; + + +# --- BUILDING --- + +echo Building ... + +ln -s rdesktop.1 nxdesktop/doc/nxdesktop.1 + +cat <<-EOF >> nx-X11/config/cf/host.def + #ifdef i386Architecture + #undef DefaultGcc2i386Opt + #define DefaultGcc2i386Opt $SLKCFLAGS -fno-strict-aliasing + #endif + #ifdef MipsArchitecture + #undef DefaultGcc2MipsOpt + #define DefaultGcc2MipsOpt $SLKCFLAGS -fno-strict-aliasing + #endif + #ifdef s390xArchitecture + #undef OptimizedCDebugFlags + #define OptimizedCDebugFlags $SLKCFLAGS -fno-strict-aliasing + #endif + EOF + + +export CFLAGS="$SLKCFLAGS" +export CXXFLAGS="$SLKCFLAGS" +sed -i -e "s|CXXFLAGS=.-O.*|CXXFLAGS=$CXXFLAGS|" */configure + +CONFIGURE="./configure --prefix=/usr --localstatedir=/var --sysconfdir=/etc" + +# build Compression Library and Proxy +for i in nxcomp nxproxy; do + (cd $i; $CONFIGURE; make) +done +# build X11 Support Libraries and Agents +(cd nx-X11; make World) +# build Extended Compression Library +(cd nxcompext; $CONFIGURE; make) +# build RFB Agent +(cd nxviewer; xmkmf -a + cp -a /usr/X11R6/lib/libXp.so* ../nx-X11/exports/lib/ + make 2> /dev/null +) +# build RDP Agent +if [ "$ARCH" = "i386" -o "$ARCH" = "i486" -o "$ARCH" = "x86_64" ]; then + (cd nxdesktop + ./configure --prefix=/usr --sharedir=/usr/share/NX + make + ) +fi + +# +# Install all the needed stuff to the package dir +# +mkdir -p $PKG/usr/bin +mkdir -p $PKG/usr/lib/NX/lib +mkdir -p $PKG/usr/man/man1 + +# install X11 Support Libraries and Agents +cp -a nx-X11/lib/X11/libX11.so.* \ + nx-X11/lib/Xext/libXext.so.* \ + nx-X11/lib/Xrender/libXrender.so.* \ + $PKG/usr/lib/NX/lib/ +cp -a nx-X11/programs/Xserver/nxagent $PKG/usr/lib/NX/ +chmod 755 $PKG/usr/lib/NX/nxagent +cp -a $CWD/${SOURCE[9]} $PKG/usr/bin/ + +# install Compression Libraries and Proxy +cp -a nxcomp/libXcomp.so.* $PKG/usr/lib/NX/lib/ +cp -a nxcompext/libXcompext.so.* $PKG/usr/lib/NX/lib/ +cp -a nxproxy/nxproxy $PKG/usr/lib/NX/ +chmod 755 $PKG/usr/lib/NX/nxproxy +ln -snf nxagent $PKG/usr/bin/nxproxy + +# install RFB Agent +( cd nxviewer + make install DESTDIR=$PKG + mv $PKG/usr/X11R6/bin/nxviewer $PKG/usr/lib/NX/ + ln -snf nxagent $PKG/usr/bin/nxviewer + chmod 755 $PKG/usr/bin/nxviewer + mv $PKG/usr/X11R6/bin/nxpasswd $PKG/usr/bin/ +) + +rmdir $PKG/usr/X11R6/bin +rmdir $PKG/usr/X11R6 + +# install RDP Agent +if [ "$ARCH" = "i386" -o "$ARCH" = "i486" -o "$ARCH" = "x86_64" ]; then + (cd nxdesktop + make install DESTDIR=$PKG + mv $PKG/usr/bin/nxdesktop $PKG/usr/lib/NX/ + ln -snf nxagent $PKG/usr/bin/nxdesktop + chmod 755 $PKG/usr/bin/nxdesktop + ) +fi + +# --- DOCUMENTATION --- + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION + +# install scripts +cp -a nxscripts $PKG/usr/doc/$PRGNAM-$VERSION + +# documentation and license +tar -jxvf $CWD/${SOURCE[10]} -C $PKG/usr/doc/$PRGNAM-$VERSION +cp nxcomp/LICENSE $PKG/usr/doc/$PRGNAM-$VERSION +cp nxcomp/README $PKG/usr/doc/$PRGNAM-$VERSION/README.nxcomp +cp nxdesktop/README $PKG/usr/doc/$PRGNAM-$VERSION/README.nxdesktop +cp -a nxdesktop/doc $PKG/usr/doc/$PRGNAM-$VERSION/nxdesktop + +chmod -R a-w $PKG/usr/doc/$PRGNAM-$VERSION/* + +# Compress the man page(s) +gzip -9f $PKG/usr/man/*/* + +# 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 +) + + +# --- OWNERSHIP, RIGHTS --- + +chmod -R o-w $PKG +chown root:bin $PKG/usr/bin/* $PKG/usr/sbin/* $PKG/bin/* $PKG/sbin/* \ + $PKG/usr/X11R6/bin/* $PKG/opt/kde/bin/* 2>/dev/null + + +# --- PACKAGE DESCRIPTION --- + +mkdir -p $PKG/install +cat $CWD/${PRGNAM}.slack-desc > $PKG/install/slack-desc +if [ -f $CWD/doinst.sh ]; then + cat $CWD/doinst.sh > $PKG/install/doinst.sh +fi + + +# --- BUILDING --- + +# Build the package: +cd $PKG +makepkg --linkadd y --chown n $TMP/${PRGNAM}-${VERSION}-${ARCH}-${BUILD}.tgz \ + 2>&1 | tee $CWD/makepkg-${PRGNAM}.log +(cd $TMP && md5sum ${PRGNAM}-${VERSION}-${ARCH}-${BUILD}.tgz > ${PRGNAM}-${VERSION}-${ARCH}-${BUILD}.tgz.md5) +cat $CWD/${PRGNAM}.slack-desc | grep "^${PRGNAM}" > $TMP/${PRGNAM}-${VERSION}-${ARCH}-${BUILD}.txt + + +# --- CLEANUP --- + +# Clean up the extra stuff: +if [ "$1" = "--cleanup" ]; then + rm -rf $TMP/tmp-$PRGNAM + rm -rf $PKG +fi |