#!/bin/bash # infourl: http://wiki.tinycorelinux.com/Creating+Extensions set -o errexit # or set -e clean() { cd sudo rm -rf $DIRNAME $TMP_PKG } trap clean INT TERM EXIT final () { tce-load -wi squashfs-tools-4.0 cd /tmp mksquashfs $PACKAGE-package $PACKAGE.tcz cd $TMP_PKG mv ../$PACKAGE.tcz . find usr -not -type d > $PACKAGE.tcz.list md5sum $PACKAGE.tcz > $PACKAGE.tcz.md5.txt rm -rf usr cp $PACKAGE.tcz ~/ cp $PACKAGE.tcz.list ~/ cp $PACKAGE.tcz.md5.txt ~/ if [ "$DEP_RLS" != "" ] ; then > ~/$PACKAGE.tcz.dep for dep in $DEP_RLS ; do echo $dep >> ~/$PACKAGE.tcz.dep done fi cat < ~/$PACKAGE.tcz.info Title: $PACKAGE.tcz Description: $PACKAGE Version: $VERSION Author: $AUTHOR Original-site: $HOMEPAGE Copying-policy: GPL Size: $(ls -lah $PACKAGE.tcz | awk '{ print $5}') Extension_by: Daniel N Comments: $PACKAGE for tinycore $ADDITIONAL_INFO ---------- This extension contains: $PACKAGE-$VERSION - $LICENSE - $DOWNLOAD_URL Change-log: ---- Current: $(date +%Y/%m/%d) First version EOF # clean } set_cflags() { export CFLAGS="-march=i486 -mtune=i686 -Os -pipe" export CXXFLAGS="-march=i486 -mtune=i686 -Os -pipe -fno-exceptions -fno-rtti" export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig:/usr/lib/pkgconfig" } prepare_compile(){ DIRNAME=$PACKAGE-$VERSION TMP_PKG=/tmp/$PACKAGE-package CPU_COUNT=$(cat /proc/cpuinfo | grep ^processor | wc -l) MAKE_J_FLAG=-j$(expr $CPU_COUNT + 1) TARFLAGS=xzvf if [ "$(echo $DOWNLOAD_URL | grep bz2$ | wc -l)" -eq "1" ] ; then TARFLAGS=xjvf ; fi } package () { prepare_compile compile_$PACKAGE final }