#!/bin/bash # This file is sourced by buildPkg, not executed. # The above interpreter line is so that editors will colorize the file. SUPPORTED_BUILD_TYPES="static bootstrap" # What portions of build to backup #TT_BACKUP_BUILD="build" #TT_BACKUP_BUILD="install" #TT_BACKUP_BUILD="none" # How to handle static libs #TT_KEEP_STATIC_LIBS="asis" #TT_KEEP_STATIC_LIBS="all" #TT_KEEP_STATIC_LIBS="unique" # Optimization flags CFLAGS="-Os -pipe -w -march=$TT_ARCH -mtune=$TT_ARCH" CXXFLAGS="$CFLAGS" LDFLAGS="-s" #Files to extract (standard formats are automatically checked, so this may not be needed). # The source files should be in src dir #SRC_FILE="mypkg-1.0.tar.bz2" # Dir where files get extracted #SRC_DIR="mypkg-1.0" # Patches in patches/ matching --*.patch.bz2 are automatically applied # Additional doc dirs (these will be automatically compressed) #DOC_DIRS="/opt/mypkg/man" # Config files (install -m config/ $INSTALL_DIR/ CFG_FILE=( file1 file2 file3 ) CFG_DIR=( dir1 dir2 dir3 ) CFG_PERM=( perm1 perm2 perm3 ) # Commands to compile the package. # All operations should be restricted to the build dir compilePkg() { # PKG_CONFIG includes --prefix= for the appropriate build type. i.e. /usr for regular builds and $TT_BOOTSTRAP_PREFIX for bootstrap builds # If you need to add more options to PKG_CONFIG, use addConfigOpt function addConfigopt --libexecdir=/usr/sbin ./configure $PKG_CONFIG || error "Configure failed" make || error "Make failed" : } # Commands to test the package before installing testPkg() { make -k check || printMsg warning "Test failed" : } # Commands to install the pkg. All files should be installed into fake root $INSTALL_DIR installPkg() { make DESTDIR=$INSTALL_DIR install || error "Install failed" : } # Commands to be executed before the package is relocated into its final dest. # Should includes operations such as: ### Removing previously installed files ### Changing ownerships of previously installed files so that the current file can be installed on top preInstallPkg() { rm -rf /opt/pkg : } # Commands to be executed after pkg is relocated into its final dest. postInstallPkg() { installGConfSchemas : }