#!/bin/bash #****h* llxdev-creator # NAME # llxdev-creator # FUNCTION # # INPUTS # # RESULT # # AUTHOR # Angel Berlanas Vicente # CREATION DATE # 23/02/09 10:59:25 CEST # REQUIRES # # # VERSION # 1.0 #**** #****v* llxdev-creator/CONF_FILE # NAME # CONF_FILE # FUNCTION # Source standar configuration for suite # SOURCE #**** CONF_FILE="/etc/lliurex/llxdev.conf" #****v* llxdev-creator/LIB_FILE # NAME # LIB_FILE # FUNCTION # Source Common functions # SOURCE #**** LIB_FILE="/usr/share/lliurex-non-essential-tools/common.sh" #****v* llxdev-creator/FILE_TO_STANDARDS_BUILDS # NAME # FILE_TO_STANDARDS_BUILDS # FUNCTION # Template file to build a standar file configuration # SOURCE #**** FILE_TO_STANDARDS_BUILDS="/usr/share/lliurex-non-essential-tools/standard-build.conf" # Extract Values #****v* llxdev-creator/PACKAGE_NAME # NAME # PACKAGE_NAME # FUNCTION # Name of package # SOURCE #**** PACKAGE_NAME=$(basename $(pwd)) #****v* llxdev-creator/PACKAGE_VERSION # NAME # # FUNCTION # # SOURCE#**** #**** PACKAGE_VERSION="0.1" #****v* llxdev-creator/PACKAGE_DISTRIBUTION # NAME # PACKAGE_DISTRIBUTION # FUNCTION # Default distributor for the custom package # SOURCE #**** PACKAGE_DISTRIBUTION=$(lsb_release -d -s | sed -n "s%.*\([[:digit:]]\{2\}\)\.\([[:digit:]]\{2\}\)%llx\1\2%p") [ -e "$LIB_FILE" -a -e "$CONF_FILE" ] || exit 1 . "$LIB_FILE" . "$CONF_FILE" #****f* llxdev-creator/show_usage # FUNCTION # Show the usage of the llxdev-creator # INPUTS # #**** show_usage(){ echo "llxdev-creator [ populate | build ]" exit 1 } #****f* llxdev-creator/do_debian_tree # FUNCTION # Build a standard debian package hierarchy in the current directory # INPUTS # #**** do_debian_tree(){ mkdir -p debian dch --create --package $PACKAGE_NAME -v $PACKAGE_VERSION --force-distribution $PACKAGE_DISTRIBUTION Initial Release } #****f* llxdev-creator/get_ingredients # FUNCTION # # INPUTS # #**** get_ingredients(){ . custom-build.conf 2 } # # Test parameters # [ $# -eq 1 ] || show_usage ACTION="$1" # MAIN case $ACTION in populate) echo " * Populating Template... created in ./custom-build.conf" sed -e "s%_@_PACKAGE_NAME_@_%$PACKAGE_NAME%;s%_@_PACKAGE_VERSION_@_%$PACKAGE_VERSION%;s%_@_PACKAGE_DISTRIBUTION_@_%$PACKAGE_DISTRIBUTION%" $FILE_TO_STANDARDS_BUILDS > custom-build.conf ;; build) get_ingredients ;; esac #