tce-load -w -i compiletc squashfs-tools cd /tmp mkdir package mkdir src_package DESTDIR='/tmp/package' wget https://github.com/stedolan/jq/archive/jq-1.5.tar.gz tar xzvf jq-1.5.tar.gz cd jq-jq-1.5/ export CFLAGS="-mtune=generic -Os -pipe" export CXXFLAGS="-mtune=generic -Os -pipe" export LDFLAGS="-Wl,-O1" ./configure --prefix=/usr/local/ make make DESTDIR=/tmp/package install-strip # Create package directory . /etc/init.d/tc-functions PKGDIR=/tmp/`getMajorVer`.x/`getBuild` mkdir -p $PKGDIR/tar.gz $PKGDIR/tcz # Create jq-doc.tcz package cd $DESTDIR mkdir doc for i in usr/local/share/man usr/local/share/doc; do tar cpf - $i | (cd doc && tar xvpf - ) rm -rf $i done rm -fr usr/local/share cd doc tar -czf $PKGDIR/tar.gz/jq-doc.tcz.tar.gz * mksquashfs $DESTDIR/doc $PKGDIR/tcz/jq-doc.tcz -all-root -info find $DESTDIR/doc -not -type d | sed -e "s#^${DESTDIR}/doc##" > $PKGDIR/tcz/jq-doc.tcz.list cd .. && rm -rf doc cd $PKGDIR/tcz md5sum jq-doc.tcz > jq-doc.tcz.md5.txt # Create jq-dev.tcz package cd $DESTDIR mkdir dev for i in usr/local/include/ usr/local/lib/*.la usr/local/lib/*.a ; do tar cpf - $i | (cd dev && tar xvpf - ) rm -rf $i done cd dev tar -czf $PKGDIR/tar.gz/jq-dev.tcz.tar.gz * mksquashfs $DESTDIR/dev $PKGDIR/tcz/jq-dev.tcz -all-root -info find $DESTDIR/dev -not -type d | sed -e "s#^${DESTDIR}/dev##" > $PKGDIR/tcz/jq-dev.tcz.list cd .. && rm -rf dev cd $PKGDIR/tcz md5sum jq-dev.tcz > jq-dev.tcz.md5.txt # Create jq.tcz package cd $DESTDIR strip --strip-all usr/local/bin/* tar -czf $PKGDIR/tar.gz/jq.tcz.tar.gz * mksquashfs $DESTDIR $PKGDIR/tcz/jq.tcz -all-root -info find $DESTDIR -not -type d | sed -e "s#^${DESTDIR}##" > $PKGDIR/tcz/jq.tcz.list cd $PKGDIR/tcz md5sum jq.tcz > jq.tcz.md5.txt # Cleanup cd /tmp rm -rf $DESTDIR rm -rf /tmp/src_package/ rm -fr /tmp/download