Author: cfinck Date: Wed Feb 11 12:16:09 2009 New Revision: 39556
URL: http://svn.reactos.org/svn/reactos?rev=39556&view=rev Log: - The secret of Colin's RosBE-Unix packaging is now in your hand!
Add a script, which does 50% of the work for building a RosBE-Unix release out of the SVN sources. The only remaining stuff is creating the source packages, which is merely downloading build tools, applying patches and repackaging them. - Fix the return stuff in "RosBE-Builder.sh"
Added: trunk/tools/RosBE/RosBE-Unix/makepackage.sh (with props) Modified: trunk/tools/RosBE/RosBE-Unix/Base-i386/RosBE-Builder.sh
Modified: trunk/tools/RosBE/RosBE-Unix/Base-i386/RosBE-Builder.sh URL: http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Unix/Base-i386/Ro... ============================================================================== --- trunk/tools/RosBE/RosBE-Unix/Base-i386/RosBE-Builder.sh [iso-8859-1] (original) +++ trunk/tools/RosBE/RosBE-Unix/Base-i386/RosBE-Builder.sh [iso-8859-1] Wed Feb 11 12:16:09 2009 @@ -211,7 +211,7 @@ if $createdir; then if ! mkdir -p "$installdir"; then redmsg "Could not create "$installdir", aborted!" - return 1 + exit 1 fi fi fi @@ -219,7 +219,7 @@ # Test if the installation directory is writeable if [ ! -w "$installdir" ]; then redmsg "Installation directory "$installdir" is not writeable, aborted!" - return 1 + exit 1 fi
# @@ -443,6 +443,3 @@ echo " $installdir/RosBE.sh [source directory] [color code] [architecture]" echo echo "All parameters for that script are optional." -echo - -return 0
Added: trunk/tools/RosBE/RosBE-Unix/makepackage.sh URL: http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Unix/makepackage.... ============================================================================== --- trunk/tools/RosBE/RosBE-Unix/makepackage.sh (added) +++ trunk/tools/RosBE/RosBE-Unix/makepackage.sh [iso-8859-1] Wed Feb 11 12:16:09 2009 @@ -1,0 +1,108 @@ +#!/bin/bash +# +# ReactOS Build Environment for Unix-based Operating Systems - Packaging tool for the Base package +# Copyright 2009 Colin Finck mail@colinfinck.de +# +# Released under GNU GPL v2 or any later version. + +# +# Functions +# +check_file() +{ + if ! [ -f "$1" ]; then + echo "File "$1" is required, but does not exist!" + exit 1 + fi +} + + +# The real entry point +cd `dirname $0` + +# +# Prerequisites +# +# Check the parameters +if [ "$2" = "" ]; then + echo "makepackage - Package a RosBE-Unix version" + echo "Syntax: ./makepackage.sh <package> <version>" + echo + echo " package - Package name (i.e. "Base-i386")" + echo " version - Version number of the Build Environment to package (i.e. "1.4")" + exit 1 +fi + +package_name="$1" +package_version="$2" + +# Set the full package name +full_package_name="RosBE-Unix-$package_version" + +case "$package_name" in + "Base-i386") + # Add no suffix + ;; + *) + # Add the package name as the suffix + full_package_name+="-$package_name" + ;; +esac + +# Check if the required directory structure exists +if ! [ -d "../Tools/.svn" ]; then + echo "This script needs to be run in a working copy of the whole "RosBE" tree!" + exit 1 +fi + +# Build the source file list +sources="binutils gcc " +tools="" + +case "$package_name" in + "Base-i386") + sources+="make mingw-runtime nasm w32api" + tools+="cpucount scut" +esac + +# Check if all required files exist +for source in $sources; do + check_file "$package_name/sources/$source.tar.bz2" +done + +# Check if all required tools exist +for tool in $tools; do + check_file "../Tools/$tool.c" +done + +# Check if other needed files exist +check_file "$package_name/README.pdf" + + +# +# The Process +# +# Copy the directory and delete some stuff +cp -R "$package_name" "$full_package_name" + +find "$full_package_name" -type d -name ".svn" | xargs rm -rf +rm "$full_package_name/README.odt" + +# Copy the source packages +for source in $sources; do + echo "Copying $source.tar.bz2..." + cp "$package_name/sources/$source.tar.bz2" "$full_package_name/sources/$source.tar.bz2" +done + +# Copy the shared tools +for tool in $tools; do + echo "Copying $tool.c..." + cp "../Tools/$tool.c" "$full_package_name/tools/$tool.c" +done + +# Finally create a package out of this +echo "Creating the package..." +tar cjf "$full_package_name.tar.bz2" "$full_package_name" + +echo +echo "Done!"
Propchange: trunk/tools/RosBE/RosBE-Unix/makepackage.sh ------------------------------------------------------------------------------ svn:eol-style = native