# HG changeset patch # User Christophe Lincoln # Date 1298560512 -3600 # Node ID aa24adc6fc5ebd95aeb790477458e667feadc5d1 # Parent ab1063270c2da51de073d94673318c18d6958065 slitaz-dev-tools is now a meta package diff -r ab1063270c2d -r aa24adc6fc5e slitaz-dev-tools/receipt --- a/slitaz-dev-tools/receipt Thu Feb 24 16:10:32 2011 +0100 +++ b/slitaz-dev-tools/receipt Thu Feb 24 16:15:12 2011 +0100 @@ -1,18 +1,15 @@ # SliTaz package receipt PACKAGE="slitaz-dev-tools" -VERSION="1.2.1" -CATEGORY="development" -SHORT_DESC="SliTaz developers and build host tools." +VERSION="1.0" +CATEGORY="meta" +SHORT_DESC="SliTaz developers tools meta package." MAINTAINER="pankso@slitaz.org" -DEPENDS="rsync" +DEPENDS="rsync tazdev tazchroot libtaz tazwok mercurial" WEB_SITE="http://www.slitaz.org/" # Rules to gen a SliTaz package suitable for Tazpkg. genpkg_rules() { - mkdir -p $fs/etc/slitaz $fs/usr/bin - cp stuff/tazdev $fs/usr/bin - cp stuff/tazdev.conf $fs/etc/slitaz - chown -R root.root $fs + mkdir -p $fs/usr } diff -r ab1063270c2d -r aa24adc6fc5e slitaz-dev-tools/stuff/README --- a/slitaz-dev-tools/stuff/README Thu Feb 24 16:10:32 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,18 +0,0 @@ -SliTaz developers tools http://www.slitaz.org/ -=============================================================================== - - -SliTaz developers and build host tools. This package provides the tazdev utility -and tinyutils to help maintain the distribution and automate packages compilation. -The package provides 'tazdev' and its default config file: /etc/slitaz/tazdev.conf - - -Website Devel corner: http://www.slitaz.org/en/devel/ -Mercurial repositories: http://hg.slitaz.org/ -SliTaz Laboratories: http://labs.slitaz.org/ -Developers wiki: http://labs.slitaz.org/wiki/distro -Build host: http://tank.slitaz.org/ -Build bot: http://bb.slitaz.org/ - - -=============================================================================== diff -r ab1063270c2d -r aa24adc6fc5e slitaz-dev-tools/stuff/tazdev --- a/slitaz-dev-tools/stuff/tazdev Thu Feb 24 16:10:32 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,356 +0,0 @@ -#!/bin/sh -# Tazdev - SliTaz developers and build host tool. -# System wide config file: /etc/slitaz/tazdev.conf -# -# (c) 2009 SliTaz GNU/Linux - GNU gpl v3 -# -# Authors : Christophe Lincoln (Pankso) -# - -if [ -f /etc/slitaz/tazdev.conf ]; then - . /etc/slitaz/tazdev.conf - if [ -f $PWD/tazdev.conf ]; then - . $PWD/tazdev.conf - fi -else - echo -e "\nNo config file found in /etc/slitaz or the current dir...\n" - exit 0 -fi - -usage() -{ - echo -e "\nSliTaz developers and build host tool\n -\033[1mUsage: \033[0m `basename $0` [command] [user] [stable|cooking|experimental|path] -\033[1mCommands: \033[0m\n - usage Print this short usage and command list. - projects-stats Display statistics about your projects (-ps). - cmplog Log 'tazwok cmp' result (or use tazbb). - update-wok Update Hg wok and copy it to the chroot wok. - update-www Update SliTaz Website repo from Hg. - chroot Mount virtual fs if needed and chroot into the build env. - gen-chroot Generate a chroot using the last cooking base rootfs. - clean-chroot Clean a chroot environment (skip root/ and home/). - purge Remove obsolete packages and obsolete source tarballs. - dry-purge Show obsolete packages and obsolete source tarballs. - push Upload new packages to the main mirror (-p). - dry-push Show what will be uploaded to the mirror. Does nothing (-dp). - pull Download new packages from the main mirror. - dry-pull Show what will be downloaded from the mirror. Does nothing. - relpkg Archive and upload new package/project version.\n" -} - -# Exit if user is not root. -check_root() -{ - if test $(id -u) != 0 ; then - echo -e "\nThis program requires being run as root.\n" - exit 0 - fi -} - -status() -{ - local CHECK=$? - echo -en "\033[70G" - if [ $CHECK = 0 ]; then - echo "Done" - else - echo "Failed" - fi - return $CHECK -} - -get_version() -{ - if [ "$2" = "stable" ]; then - VERSION=stable - SLITAZ=$STABLE - elif [ -n "$2" ]; then - # Undigest - custom ? - VERSION=$2 - SLITAZ=/home/slitaz/$2 - else - VERSION=cooking - SLITAZ=$COOKING - fi - ROOTFS=$SLITAZ/chroot - HG_WOK=$SLITAZ/wok - BUILD_WOK=$SLITAZ/chroot/home/slitaz/wok -} - -check_mirror() -{ - # ping -c 1 $MIRROR - if [ -n "$2" ]; then - USER=$2 - else - USER=$USER - fi - if [ "$2" = "stable" ] || [ "$3" = "stable" ]; then - REMOTE_DIR=$MIRROR_PKGS/stable/ - LOCAL_DIR=$STABLE/packages/ - elif [ "$2" = "experimental" ] || [ "$3" = "experimental" ]; then - REMOTE_DIR=$MIRROR_PKGS/experimental/ - LOCAL_DIR=$EXPERIMENTAL/packages/ - else - REMOTE_DIR=$MIRROR_PKGS/cooking/ - LOCAL_DIR=$COOKING/packages/ - fi -} - -# Mount virtual Kernel file systems and chroot but check that nobody -# else has done mounts -mount_chroot() -{ - if [ ! -d $ROOTFS/proc/1 ]; then - echo -n "Mounting virtual filesystems..." - mount -t proc proc $ROOTFS/proc - mount -t sysfs sysfs $ROOTFS/sys - mount -t devpts devpts $ROOTFS/dev/pts - mount -t tmpfs shm $ROOTFS/dev/shm - status - fi -} - -# Unmount virtual Kernel file systems on exit and ensure we are the last -# user before unmounting ! -umount_chroot() -{ - # Not working. Buggy ps ? - #sleep 6 - ps=$(ps | grep `basename $0` | grep -v grep | wc -l) - if [ "$ps" == "1" ]; then - echo -ne "\Unmounting virtual filesystems..." - umount $ROOTFS/dev/shm - umount $ROOTFS/dev/pts - umount $ROOTFS/sys - umount $ROOTFS/proc - status - else - echo -e "\nProcess: $ps\n" - ps | grep `basename $0` | grep -v grep - echo -e "\nLeaving virtual filesystems unmounted (`pidof tazdev`)...\n" - fi -} - -# Get the last cooking base rootfs, extract and configure. -gen_new_chroot() -{ - echo -e "\nGenerating new chroot in : $ROOTFS" - echo "================================================================================" - mkdir -p $ROOTFS && cd $ROOTFS - wget $DL_URL/boot/cooking/rootfs-base.gz - echo -n "Extracting the rootfs..." - lzma d rootfs-base.gz -so | cpio -id - rm rootfs-base.gz - echo -n "Creating resolv.conf..." - cat /etc/resolv.conf > etc/resolv.conf - status - echo "================================================================================" - echo -e "Ready to chroot. Use 'tazdev chroot [version|path]'" - echo -e "Example: tazdev chroot $ROOTFS\n" -} - -# Remove obsolate slitaz packages -purge_packages() -{ - arg=$1 - TMP_FILE=/tmp/tazdev.$$ - ls $BUILD_WOK | while read pkg; do - [ -f $BUILD_WOK/$pkg/taz/*/receipt ] || continue - EXTRAVERSION="" - . $BUILD_WOK/$pkg/taz/*/receipt - echo $PACKAGE-$VERSION$EXTRAVERSION.tazpkg - done > $TMP_FILE - ls $SLITAZ/chroot/home/slitaz/packages | while read pkg; do - case "$pkg" in - *.tazpkg) - grep -q ^$pkg$ $TMP_FILE && continue - echo Remove $pkg - [ "$arg" == "purge" ] && - rm -f $SLITAZ/chroot/home/slitaz/packages/$pkg ;; - esac - done - rm -f $TMP_FILE -} - -# Remove obsolate source tarballs -purge_sources() -{ - arg=$1 - TMP_FILE=/tmp/tazdev.$$ - ls $BUILD_WOK | while read pkg; do - [ -f $BUILD_WOK/$pkg/receipt ] || continue - TARBALL="" - . $BUILD_WOK/$pkg/receipt - [ -n "$TARBALL" ] && echo $TARBALL - grep SOURCES_REPOSITORY/ $BUILD_WOK/$pkg/receipt | sed \ - -e 's|.*SOURCES_REPOSITORY/\([^ ]*\)\( .*\)$|\1|' \ - -e 's|.*SOURCES_REPOSITORY/\([^ ]*\)$|\1|' | sort | uniq | \ - sed "s|['\"/]||g" | while read file ; do - eval echo $file 2> /dev/null - done - done > $TMP_FILE - ls $SLITAZ/chroot/home/slitaz/src | while read pkg; do - grep -q ^$pkg$ $TMP_FILE && continue - echo Remove $pkg - [ "$arg" == "purge" ] && - rm -f $SLITAZ/chroot/home/slitaz/src/$pkg - done - rm -f $TMP_FILE -} - -case "$1" in - cmplog) - # Log 'tazwok cmp' for the web interface (can be used via a cron job). - check_root - echo -e "Starting 'tazwok cmp' (can be long)...\n" - tazwok cmp | grep ^[A-Z] | tee $CMP_LOG - echo "Date: `date`" >> $CMP_LOG ;; - '-ps'|projects-stats) - echo -e "\nStatistics for: $PROJECTS\n" - echo -n "Project" && echo -ne "\033[24G Size" && echo -ne "\033[38G Revision" - echo -ne "\033[48G Version" && echo -e "\033[64G Files" - echo "================================================================================" - cd $PROJECTS - for proj in * - do - rev="" - echo -n "$proj" - size=`du -sh $proj | awk '{ print $1 }'` - echo -ne "\033[24G $size" - if [ -d $proj/.hg ]; then - cd $proj - rev=`hg head --template '{rev}\n'` - vers=`hg tags | head -n 2 | tail -n 1 | cut -d " " -f 1` - echo -ne "\033[38G $rev" - echo -ne "\033[48G $vers" && cd .. - fi - files=`find $proj -type f | wc -l` - echo -e "\033[64G $files" - done - echo "================================================================================" - echo "" ;; - update-wok) - # Update the Hg wok and copy it to the chroot env. Hg wok is - # copied to the chroot wok to avoid messing with build result - # file and so we can also modify receipt directly without affecting - # the Hg wok. - check_root - get_version $@ - echo "" - echo "Hg wok : $HG_WOK" - echo "Build wok : $BUILD_WOK" - cd $HG_WOK - hg pull && hg update - echo -n "Copying Hg wok to the build wok... " - cp -a $HG_WOK/* $BUILD_WOK - cp -a $HG_WOK/.hg $BUILD_WOK - status && echo "" ;; - update-www) - # Update website from repo. - echo "" - cd $WEBSITE && hg pull && hg update - echo "" ;; - chroot) - # Chroot into a build env. Default to cooking configured in - # tazdev.conf - check_root - get_version $@ - mount_chroot - echo -e "\nChrooting in $ROOTFS...\n" - chroot $ROOTFS /bin/sh --login - umount_chroot - echo -e "Exiting $ROOTFS chroot environment...\n" ;; - gen-chroot) - check_root - get_version $@ - # Dont break another env. - if [ -d $ROOTFS/bin ]; then - echo -e "\nA chroot environment already exists in : $ROOTFS\n" - exit 1 - fi - gen_new_chroot ;; - clean-chroot) - # Keep root/ and /home they may have a build wok, custom scripts, etc. - check_root - if [ -z "$2" ]; then - echo -e "\nPlease specify the path to the chroot environment to clean.\n" - exit 0 - else - ROOTFS=$2 - if [ ! -d "$ROOTFS" ]; then - echo -e "\nWarning : $ROOTFS doesn't exist!\n" - exit 1 - fi - fi - if [ -d $ROOTFS/proc/1 ]; then - echo -e "\nWarning : $ROOTFS/proc mounted!\n" - exit 1 - fi - cd $ROOTFS || exit 1 - echo -e "\nCleaning chroot in: $ROOTFS" - echo "================================================================================" - for i in bin dev etc init lib media mnt proc sbin sys tmp usr var - do - echo -n "Removing: $i (`du -sh $i | awk '{ print $1 }'`)... " - rm -rf $i - status - done - echo "================================================================================" - echo "" ;; - '-p'|push) - check_mirror $@ - rsync -r -t -l -v -z --delete \ - $LOCAL_DIR -e ssh $USER@$MIRROR:$REMOTE_DIR ;; - '-dp'|dry-push) - check_mirror $@ - rsync -r -t -l -v -z --delete --dry-run \ - $LOCAL_DIR -e ssh $USER@$MIRROR:$REMOTE_DIR ;; - pull) - check_mirror $@ - rsync -r -t -l -v -z --delete \ - -e ssh $USER@$MIRROR:$REMOTE_DIR $LOCAL_DIR ;; - dry-pull) - check_mirror $@ - rsync -r -t -l -v -z --delete --dry-run \ - -e ssh $USER@$MIRROR:$REMOTE_DIR $LOCAL_DIR ;; - purge|dry-purge) - check_root - get_version $@ - purge_packages $1 - purge_sources $1 ;; - relpkg) - [ -z "$MIRROR_SOURCES" ] && MIRROR_SOURCES="/var/www/slitaz/mirror/sources" - if [ -z $2 ] || [ -z $3 ]; then - echo -e "\nUsage: $0 relpkg package version\n" - exit 0 - fi - PACKAGE=$2 - VERSION=$3 - echo "" - cd $PROJECTS/$PACKAGE - # Sanity check - if ! grep -q $VERSION$ .hgtags; then - echo "Missing Hg tag for version: $VERSION" - echo -e "You may want to: hg tag $VERSION && hg push\n" - exit 0 - fi - # Archive - echo -n "Creating tarball and md5sum for: $PACKAGE-$VERSION... " - hg archive -t tgz $PACKAGE-$VERSION.tar.gz - md5sum $PACKAGE-$VERSION.tar.gz > $PACKAGE-$VERSION.md5 - echo "Done" - # Upload - echo -n "Do you wish to upload tarball to the mirror [N/y] ? " - read upload - if [ "$upload" = "y" ]; then - echo "Uploading to: $MIRROR/sources/${PACKAGE#slitaz-}" - scp $PACKAGE-$VERSION.tar.gz $PACKAGE-$VERSION.md5 \ - $USER@$MIRROR:$MIRROR_SOURCES/${PACKAGE#slitaz-} - fi ;; - usage|*) - usage ;; -esac - -exit 0 diff -r ab1063270c2d -r aa24adc6fc5e slitaz-dev-tools/stuff/tazdev.conf --- a/slitaz-dev-tools/stuff/tazdev.conf Thu Feb 24 16:10:32 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,20 +0,0 @@ -# tazdev.conf: SliTaz Developers tool configuration file. -# - -# Path to 'tazwok cmp' log file. -CMP_LOG="/var/log/tazwok-cmp.log" - -# Path for the wok, chroot and packages directory of each version. -COOKING="/home/slitaz/cooking" -STABLE="/home/slitaz/stable" -EXPERIMENTAL="/home/slitaz/experimental" - -# Path to the Website repo. -WEBSITE="/home/slitaz/www/website" -PROJECTS="$HOME/Projects" - -# Main mirror to push and download (ISO, rootfs. etc). -MIRROR="mirror.slitaz.org" -DL_URL="http://mirror.switch.ch/ftp/mirror/slitaz" -MIRROR_PKGS="/var/www/slitaz/mirror/packages" -MIRROR_SOURCES="/var/www/slitaz/mirror/sources"