#!/bin/sh ## Advanced.PkgBuild script for: crafty for /usr ## ## Amigo PkgBuild-0.3 - Gilbert Ashley ## Thanks to for help with the flags and wrapper ## ##### ------------Standard Package Variables------------------- # Most source code only needs these 4 variables set. # Set SRC_SUFFIX to ".tar.gz" ".tgz" ".tar.bz2" or ".tbz" BUILD="1" NAME="crafty" VERSION="20.1afx" SRC_SUFFIX=".tar.bz2" #####--------Common Overrides and Options---------------------- # PRE_FIX="/opt/crafty-20.1" # EXTRA_CONFIGS="" EXTRA_FLAGS=" -Wall -pipe -D_REENTRANT -fbranch-probabilities \ -fforce-mem -fomit-frame-pointer -fno-gcse -mpreferred-stack-boundary=2" # DOCLIST="" # GROUP_NAME="" #######----------------Processing------------------------------ # Get functions and read in configuration files source /usr/share/Amigo/PkgBuild/FUNCTIONS ; # This template calls each process individually so you can add # extra instructions between processes, or even leave out steps. pre_process ; find_source ; make_dirs ; unpack_source ; fix_source_perms ; # configure_source ; # compile_source ; # fake_install ; cd $SRC_DIR ; #Make this thing. make \ target=LINUX \ CC="gcc" \ CXX="g++" \ CFLAGS="$STD_FLAGS $EXTRA_FLAGS" \ CXFLAGS="$STD_FLAGS $EXTRA_FLAGS" \ LDFLAGS="-lstdc++" \ opt="-DFUTILITY -DFAST -DINLINE_ASM -DEPD -DLOGDIR=\\\"/var/log/crafty\\\" -DBOOKDIR=\\\"${PRE_FIX}/share/crafty/books\\\" -DRCDIR=\\\"~/\\\" -DPERSDIR=\\\"~/\\\" -DTBDIR=\\\"${PRE_FIX}/share/crafty/TB\\\"" \ crafty-make mkdir -p $PKG_DIR$PRE_FIX/bin cp -a $SRC_DIR/crafty $PKG_DIR$PRE_FIX/bin chown root.root $PKG_DIR$PRE_FIX/bin/crafty chmod 755 $PKG_DIR$PRE_FIX/bin/crafty # putting each users game logs into their $HOME directory would require # altering the sources. Only sane alternative is to put all logs # together under /var, so make the dir globally writable. # This gets repeated by the supplied doinst.sh mkdir -p $PKG_DIR/var/log/crafty chmod 777 $PKG_DIR/var/log/crafty # install the common files mkdir -p $PKG_DIR$PRE_FIX/share/crafty/books cp -a $SRC_DIR/common/*.bin $PKG_DIR$PRE_FIX/share/crafty/books cp -a $SRC_DIR/common/bitmaps $PKG_DIR$PRE_FIX/share/crafty cp -a $SRC_DIR/common/sound $PKG_DIR$PRE_FIX/share/crafty # create the TB directory, just in case mkdir -p $PKG_DIR$PRE_FIX/share/crafty/TB mkdir -p $PKG_DIR$PRE_FIX/man/man1 cp -a $SRC_DIR/doc/crafty.man $PKG_DIR$PRE_FIX/man/man1/crafty.1 mkdir -p $PKG_DIR$PRE_FIX/doc/crafty-20.1 cp $SRC_DIR/doc/crafty.doc.ascii $PKG_DIR$PRE_FIX/doc/crafty-20.1/crafty.txt cp $SRC_DIR/doc/crafty.doc.ps $PKG_DIR$PRE_FIX/doc/crafty-20.1/crafty.ps cp $SRC_DIR/doc/crafty.hlp $PKG_DIR$PRE_FIX/doc/crafty-20.1/crafty.hlp cp $SRC_DIR/doc/tournament.howto $PKG_DIR$PRE_FIX/doc/crafty-20.1 # install an example rc file -copy to ~/.craftyrc to (maybe) use it # I think -DRCDIR=\\\"~/\\\" may not work. cp -a $SRC_DIR/doc/craftyrc.example $PKG_DIR$PRE_FIX/doc/crafty-20.1 cp $CWD/README.Amigo $PKG_DIR$PRE_FIX/doc/crafty-20.1 # create xboard wrapper cat > $PKG_DIR$PRE_FIX/bin/xboard-crafty << __EOF__ #!/bin/bash which xboard 1> /dev/null 2> /dev/null if [ \$?=0 ]; then [ -x ${PRE_FIX}/bin/crafty ] && exec xboard -firstChessProgram "${PRE_FIX}/bin/crafty" -firstDirectory "${PRE_FIX}/share/crafty" & fi exit 0 __EOF__ chmod 755 $PKG_DIR$PRE_FIX/bin/xboard-crafty fix_pkg_perms ; strip_bins ; # create_docs ; compress_man_pages ; make_description ; make_doinst ; make_package ; post_process ; exit 0 ## See the Amigo PkgBuild documentation for help and examples.