#! /bin/sh # # Copyright (c) 2007,2008 Gianluca Toso # 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. # ----------------------------------------------------------------------------- # # Tiger OSXBuild script # =========================== # By: Gianluca Toso # For: amule 2.2.0 (SVN) # Descr: multiplatform ed2k client # URL: http://www.amule.org/ # Needs: wxWidgets (unicode) only precompiled; # libpng, gd2, gettext, libcryptopp and libgeoip (optional) # from MacPorts or you have to edit some things. # All Universal Binary PRGNAME=aMule-SVN # Release hour of daily preview RH=7 WXDIR="../wxMac-2.8.7/osx-build-noports" GEOIP=${GEOIP:-0} # Exit the script on errors: set -e trap 'echo "$0 FAILED at line ${LINENO}" | tee $PRGNAME-error.log' ERR # Catch unitialized variables: set -u if (( $(/bin/date +%k) < $RH )); then TIMESTAMP=$(/bin/date -r $(($(/bin/date +%s) - 3600*$RH)) +%Y%m%d); else TIMESTAMP=$(/bin/date +%Y%m%d); fi FILE="aMule-CVS-$TIMESTAMP.tar.bz2" URL="http://www.hirnriss.net/files/cvs/$FILE" if ((GEOIP)); then GEOIPCONF='--enable-geoip --with-geoip-headers=/opt/local/include --with-geoip-lib=/opt/local/lib --with-geoip-static' PRGNAME="$PRGNAME-$TIMESTAMP-GeoIP" NSUFFIX="$TIMESTAMP-GeoIP-OSX10.4+-GToso" else GEOIPCONF='' PRGNAME="$PRGNAME-$TIMESTAMP" NSUFFIX="$TIMESTAMP-OSX10.4+-GToso" fi if ! [ -f $FILE ]; then echo "Source $FILE not available yet:" echo "downloading file..." if $(type wget > /dev/null 2>&1); then wget -nv $URL else /usr/bin/curl -RsS -O $URL fi; fi; rm -rf amule-cvs tar xfj $FILE cd amule-cvs CFLAGS="-arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -O2" \ CXXFLAGS="-arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -O2" \ CPPFLAGS="-I/opt/local/include" \ LDFLAGS="-L/opt/local/lib" \ ./configure \ --disable-debug \ --enable-optimize \ --enable-amulecmd \ --enable-webserver \ --enable-cas \ --enable-alcc \ --enable-amule-daemon \ --enable-amule-gui \ $GEOIPCONF \ --with-wxdir=$WXDIR \ --with-crypto-prefix=/opt/local \ --disable-dependency-tracking \ 2>&1 | tee ../$PRGNAME-configure.log make -j2 2>&1 | tee ../$PRGNAME-make.log rm -f aMule.app/Icon unzip ../aMuleGUI_bundle.zip > /dev/null mkdir -p diskimage/Docs/OSXBuild cp -p ../amule-uni.OSXBuild ../mac_packager ../wxMac-uni-noports.sh ../aMuleGUI_bundle.zip ../geoipupdate.sh diskimage/Docs/OSXBuild/ cp -p ../ReadMe.GToso.txt ../LEGGIMI.GToso.txt diskimage/ 2>/dev/null || true ((GEOIP)) && cp -p ../geoipupdate.sh diskimage/ DOZIP=0 DODMG=1 NSUFFIX="$NSUFFIX" ../mac_packager 2>&1 | tee ../$PRGNAME-mac_packager.log mv aMule-SVN-$NSUFFIX.dmg .. cd .. md5 aMule-SVN-$NSUFFIX.dmg > aMule-SVN-$NSUFFIX.dmg.md5