tazwok rev 513

Updated Makefile. Added tazbb for automating build bot for tank using host crond. Added README.tazbb.
author Christopher Rogers <slaxemulator@gmail.com>
date Sun May 08 22:36:23 2011 +0000 (2011-05-08)
parents 13d187618e7e
children 4d01609b6741
files Makefile examples/README.tazbb examples/tazbb
line diff
     1.1 --- a/Makefile	Sun May 08 12:28:10 2011 +0000
     1.2 +++ b/Makefile	Sun May 08 22:36:23 2011 +0000
     1.3 @@ -2,17 +2,27 @@
     1.4  #
     1.5  PREFIX?=/usr
     1.6  DOCDIR?=/usr/share/doc
     1.7 +CHSCRIPTS?=/usr/lib/slitaz/chroot-scripts
     1.8 +WWWBB?=/usr/share/slitaz/web-bb
     1.9  
    1.10  all:
    1.11  
    1.12  install:
    1.13  	@echo "Installing Tazwok into $(PREFIX)/bin..."
    1.14 -	install -g root -o root -m 0777 tazwok $(PREFIX)/bin
    1.15 -	install -g root -o root -m 0644 examples/tazwok.conf /etc/slitaz
    1.16 -	install -g root -o root -m 0644 examples/config.site /etc
    1.17 +	install -g root -o root -m 0755 tazwok $(PREFIX)/bin
    1.18 +	install -g root -o root -m 0755 examples/tazwok.conf /etc/slitaz
    1.19 +	install -g root -o root -m 0755 examples/config.site /etc
    1.20 +	install -g root -o root -m 0755 examples/tazbb $(PREFIX)/bin
    1.21  	@echo "Installing documentation files..."
    1.22  	install -g root -o root -m 0755 -d $(DOCDIR)/tazwok
    1.23 -	install -g root -o root -m 0644 doc/* $(DOCDIR)/tazwok
    1.24 +	install -g root -o root -m 0755 doc/* $(DOCDIR)/tazwok
    1.25 +	install -g root -o root -m 0755 applications $(PREFIX)/share
    1.26 +	@echo "Installing Chroot scripts..."
    1.27 +	install -g root -o root -m 0755 -d $(CHSCRIPTS)/tazwok
    1.28 +	install -g root -o root -m 0755 chroot-scripts/* $(CHSCRIPTS)/tazwok
    1.29 +	@echo "Installing web files..."
    1.30 +	install -g root -o root -m 0755 -d $(WWWBB)
    1.31 +	install -g root -o root -m 0755 web/* $(WWWBB)
    1.32  
    1.33  uninstall:
    1.34  	rm -f $(PREFIX)/bin/tazwok
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/examples/README.tazbb	Sun May 08 22:36:23 2011 +0000
     2.3 @@ -0,0 +1,9 @@
     2.4 +Tazbb is a wrapper script to automate doing things when using crond
     2.5 +for doing daily builds.
     2.6 +
     2.7 +examples for /var/spool/cron/crontabs/root:
     2.8 +NOTE: you need full path for file you want to execute in chroot
     2.9 +*/2 * * * tazbb /usr/bin/tank-bin
    2.10 +
    2.11 +1 * * * tazbb /usr/bin/gen-iso
    2.12 +
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/examples/tazbb	Sun May 08 22:36:23 2011 +0000
     3.3 @@ -0,0 +1,29 @@
     3.4 +#!/bin/sh
     3.5 +
     3.6 +. /etc/slitaz/slitaz.conf
     3.7 +
     3.8 +LOCAL_REPOSITORY="$SLITAZ_DIR/${undigest:-$SLITAZ_VERSION}"
     3.9 +if [ -f $LOCAL_REPOSITORY/tazchroot.conf ]; then
    3.10 +	. $LOCAL_REPOSITORY/tazchroot.conf
    3.11 +else
    3.12 +	tazwok configure-chroot
    3.13 +	. $LOCAL_REPOSITORY/tazchroot.conf
    3.14 +fi
    3.15 +
    3.16 +if [ -f $LOCAL_REPOSITORY/tazwok.conf ]; then
    3.17 +	. $LOCAL_REPOSITORY/tazwok.conf
    3.18 +else
    3.19 +	. /etc/slitaz/tazwok.conf
    3.20 +fi
    3.21 +
    3.22 +[ -d $chroot_dir ] || create_chroot
    3.23 +
    3.24 +if [ -f $LOCAL_REPOSITORY/chroot${1} -a -x $LOCAL_REPOSITORY/chroot${1} ]; then
    3.25 +	mount_chroot
    3.26 +	chroot $LOCAL_REPOSITORY/chroot $1
    3.27 +	umount_chroot
    3.28 +else
    3.29 +	echo "Make sure to use full path and file is executable in chroot"
    3.30 +	exit 1
    3.31 +fi
    3.32 +