diff --git a/CLIENT_DATA/setup.ins b/CLIENT_DATA/setup.ins index 6ed4321..838ab84 100644 --- a/CLIENT_DATA/setup.ins +++ b/CLIENT_DATA/setup.ins @@ -28,6 +28,16 @@ set $INST_architecture$ = GetProductProperty("install_architecture","system spec Set $LogDir$ = "%SystemDrive%\tmp" +; The token BUILDER_VARIABLES will be replaced by opsi-builder.sh +; and adds the following variables: +; from builder-product.cfg : all variables definded by attribute WINST[index] +; from builder-product.cfg : VENDOR PN VERSION RELEASE PRIORITY ADVICE TYPE +; from opsi-builder.cfg : CREATOR_TAG CREATOR_NAME CREATOR_EMAIL +; auto generated winst-variables +; $IconFile$: path to product picture +; +@@BUILDER_VARIABLES@@ + ; ---------------------------------------------------------------- ; - Please edit the following values - ; ---------------------------------------------------------------- @@ -96,7 +106,7 @@ endif ; You can use $LicenseKey$ var to pass a license key to the installer ; ; === Nullsoft Scriptable Install System ================================================================ -"%ScriptPath%\x86\svcpack\aio-runtimes.exe" +"$Install32Exe$" [Files_install_32] ; Example of recursively copying some files into the installation directory: @@ -108,7 +118,7 @@ endif ; You can use $LicenseKey$ var to pass a license key to the installer ; ; === MSI package ======================================================================================= -"%ScriptPath%\amd64\aio-runtimes.exe" +"$Install64Exe$" [Files_install_64] ; Example of recursively copying some files into the installation directory: diff --git a/build.sh b/build.sh deleted file mode 100644 index c37a997..0000000 --- a/build.sh +++ /dev/null @@ -1,123 +0,0 @@ -#!/bin/sh -PN="aio" -VERSIONX86="1.7.1" -VERSIONAMD64="1.3.3" -VERSION="$VERSIONX86.$VERSIONAMD64" -RELEASE="1" -PRIORITY="0" -ADVICE="Version Nr. x86 $VERSIONX86 amd64 $VERSIONAMD64" -TYPE="public" -# all downloads should not have any traling parameters like ?downlaodid=1234 .....(should rewrite in python) -ICON="http://pics.computerbase.de/1/1713.png" -X86="http://ftp.computerbase.de/dl-758/Z5ywZjCugcLFUDGjpr47Jg/1327355219/AiO-Runtimes-x86-v1.7.1.7z" -AMD64="http://ftp.computerbase.de/dl-758/19n9dWPmhZY7jKDZLqG1AA/1327355271/AiO-Runtimes-x64-v1.3.3.7z" -ICONFILE=${ICON##*/} -X86FILE=${X86##*/} -AMD64FILE=${AMD64##*/} - - if [ -e /var/tmp/opsi/upload/$TYPE/${PN}_${VERSION}-${RELEASE}.opsi ] - then - echo "package ${PN}_${VERSION}-${RELEASE}.opsi already generated" - exit 1 - fi - -OUT=$(mktemp -d /tmp/output.XXXXXXXXXX) || { echo "Failed to create temp dir"; exit 1; } -mkdir $OUT/$PN -cp -Rv OPSI CLIENT_DATA $OUT/$PN -unix2dos $OUT/$PN/CLIENT_DATA/* - - if [ -e /usr/portage/distfiles/$ICONFILE ] - then - if [ -e $ICONFILE.sha1sum ] - then - SHA1SUM=`cat $ICONFILE.sha1sum` - CHECKSUM=`sha1sum /usr/portage/distfiles/$ICONFILE` - if [ "$CHECKSUM" = "$SHA1SUM" ] - then - convert -colorspace rgb /usr/portage/distfiles/$ICONFILE -resize 160x -gravity center -crop 160x160+0+0 +repage $OUT/$PN/CLIENT_DATA/$PN.png - else - echo "The checksums do not match." - exit 1 - fi - else - echo "You need to create the checksums with: sha1sum /usr/portage/distfiles/$ICONFILE > $ICONFILE.sha1sum" - exit 1 - fi - else - echo "Downloading file" - wget -P /usr/portage/distfiles/ $ICON - exit 1 - fi - - if [ -e /usr/portage/distfiles/$X86FILE ] - then - if [ -e $X86FILE.sha1sum ] - then - SHA1SUM=`cat $X86FILE.sha1sum` - CHECKSUM=`sha1sum /usr/portage/distfiles/$X86FILE` - if [ "$CHECKSUM" = "$SHA1SUM" ] - then - mkdir -p $OUT/$PN/CLIENT_DATA/x86 - 7z x -o$OUT/$PN/CLIENT_DATA/x86 /usr/portage/distfiles/$X86FILE - else - echo "The checksums do not match." - exit 1 - fi - else - echo "You need to create the checksums with: sha1sum /usr/portage/distfiles/$X86FILE > $X86FILE.sha1sum" - exit 1 - fi - else - echo "Downloading file" - wget -P /usr/portage/distfiles/ $X86 - exit 1 - fi - - if [ -e /usr/portage/distfiles/$AMD64FILE ] - then - if [ -e $AMD64FILE.sha1sum ] - then - SHA1SUM=`cat $AMD64FILE.sha1sum` - CHECKSUM=`sha1sum /usr/portage/distfiles/$AMD64FILE` - if [ "$CHECKSUM" = "$SHA1SUM" ] - then - mkdir -p $OUT/$PN/CLIENT_DATA/amd64 - 7z x -o$OUT/$PN/CLIENT_DATA/amd64 /usr/portage/distfiles/$AMD64FILE - else - echo "The checksums do not match." - exit 1 - fi - else - echo "You need to create the checksums with: sha1sum /usr/portage/distfiles/$AMD64FILE > $AMD64FILE.sha1sum" - exit 1 - fi - else - echo "Downloading file" - wget -P /usr/portage/distfiles/ $AMD64 - exit 1 - fi - -sed -e "s!VERSION!$VERSION!g" -e "s!RELEASE!$RELEASE!g" -e "s!PRIORITY!$PRIORITY!g" -e "s!ADVICE!$ADVICE!g" -i $OUT/$PN/OPSI/control -sed -e "s!X86FILE!$X86FILE!g" -e "s!AMD64FILE!$AMD64FILE!g" -i $OUT/$PN/CLIENT_DATA/setup.ins - -if test -d ".git"; then - git log --date-order --date=short | \ - sed -e '/^commit.*$/d' | \ - awk '/^Author/ {sub(/\\$/,""); getline t; print $0 t; next}; 1' | \ - sed -e 's/^Author: //g' | \ - sed -e 's/>Date: \([0-9]*-[0-9]*-[0-9]*\)/>\t\1/g' | \ - sed -e 's/^\(.*\) \(\)\t\(.*\)/\3 \1 \2/g' > $OUT/$PN/OPSI/changelog.txt -else - echo "No git repository present." - exit 1 -fi - -pushd $OUT -opsi-makeproductfile -v $OUT/$PN -popd - -mkdir -p /var/tmp/opsi/upload/$TYPE/ -cp -afv $OUT/*.opsi /var/tmp/opsi/upload/$TYPE/ - -rm -rf $OUT - diff --git a/builder-product.cfg b/builder-product.cfg new file mode 100644 index 0000000..482888f --- /dev/null +++ b/builder-product.cfg @@ -0,0 +1,104 @@ +############################ +# Setup product information +############################ +VENDOR="sereby.org" +PN="aio" +VERSION_X86="1.7.1" +VERSION_X64="1.3.3" +VERSION="$VERSION_X86.$VERSION_X64" +RELEASE="1" +PRIORITY="0" +ADVICE="" + +# TYPE - defines, if the install files are public or restricted. +# Valid value: restrict | public +TYPE="public" + +# EXTRACTWITH - defines the used programm for decompression +# Valid values: 7zip | unzip +# Default value: 7zip +# This Value is only usefull in combinnation with Variable INSTALL[INDEX] +EXTRACTWITH="7zip" + +# Begin Not Implemented --- +# DOWNLOADWITH - defines the used programm for download +# Valid values: wget | plowdown +# Default value: wget +# DOWNLOADWITH="wget" +# End Not Implemented --- + + +################# +# File object array +################ +# +# To build the opsi-packet, some files are needed. The files are defined by a file object. +# A file object contains different attributes. All attributes (FILE, SOURCE, ..) are binded together +# using a file index. +# +# - Filename +# Filename used inside the builder and opsi package +# This parameter is mandatory. +# FILE[index]="cool-stuff.exe" +# +# - Source URL +# The source URL to download the file from. Multiple URLs are separted by a ";" +# The $DIST_PRIVATE_REPOS variable will be added as the first URL automatically +# Therefore, you download the non-public programs to your local/privagte repository. +# You can use variable like $PN or $Version inside the URLs +# This parameter is mandatory +# SOURCE[index]="http://cool-stuff.de/download/cool-stuff_1.001.exe;http://mirro5.cool-stuff.at/$PN_$VERSION.exe" +# +# - Architecture +# Definition of the architecture to separate different files. This will be used in +# the file structure inside the opsi-package. Also, you can use it in your repos-URL's +# or filenames (OPSI_REPOS_FILE_PATTERN, OPSI_REPOS_PRODUCT_DIR) to structure the repos. +# If it's a file for all architecture, the variable have not to be set. +# This parameter is optional, default value: , +# Valid values: , "X86", "X86_64" +# ARCH[index]="X86" +# +# - WINST Variabels: +# You can access the file (included in the opsi-package) using WINST script language. +# The target "package" will replace all occurence of the string "@@BUILDER_VARIABLES@@" +# by pairs of "DefVar/Set"-commands, if the WINST attribute is set. Default value: +# This parameter is ptional, default value: , +# WINST[index]=itWESS +# +################# +# Optional Array Elements +################ +# +# - INSTALL Variabels: +# If you specify the INSTALL Array Element Builder expects that the specified FILE is a +# compressed archive and extract it. +# INSTALL[index]="libreoffice34.msi" +# +# - EXTRACTTO Variabels: +# This Variable only works in combination with INSTALL and forces the extraction +# to be done into the specified directory. +# This will result in the files to be extracted to ARCH/EXTRACTTO. +# This feature is mostly needed if a package includes more setup programms that are nemed the +# same. This way you place the setups into diffent dirs +# EXTRACTTO[index]="office" +# + +FILE[0]="1713.png" +SOURCE[0]="http://pics.computerbase.de/1/1713.png" +WINST[0]=IconFile + +FILE[1]="AiO-Runtimes-x86-v1.7.1.7z" +SOURCE[1]="http://ftp.computerbase.de/dl-758/weJMhoTGCTbFI5mzRnMlAg/1327825564/AiO-Runtimes-x86-v1.7.1.7z" +ARCH[1]="X86" +WINST[1]=Install32Exe +INSTALL[1]="svcpack\aio-runtimes.exe" + +FILE[2]="AiO-Runtimes-x64-v1.3.3.7z" +SOURCE[2]="http://ftp.computerbase.de/dl-758/bEO61bckV1TVTjJaCZApLg/1327825611/AiO-Runtimes-x64-v1.3.3.7z" +ARCH[2]="X86_64" +WINST[2]=Install64Exe +INSTALL[2]="aio-runtimes.exe" + +# File array index for the image showing while installing the program +ICON_FILE_INDEX=0 + diff --git a/builder-targets-cb.sh b/builder-targets-cb.sh new file mode 100644 index 0000000..639eff1 --- /dev/null +++ b/builder-targets-cb.sh @@ -0,0 +1,60 @@ +############################################################################## +# This optional file "builder-targets-cb.sh" will be called by builder.sh +# +# The targets will be called from thde opsi-builder using the following +# order: config, prepare, retrieve, create, package, publish, commit, cleanup +# You can overwrite the target functions in builder-targets-cb.sh +# +# You can define callback functions. The functions are called from +# opsi-builder within processing a target +# cb_package_makeproductfile +# +# You can use every variable defined in any configuration file or by +# the defined builder script itself. Also, calling the predefined +# targets builder_ is possible. +# +# Abstract: +# target order: config, prepare, retrieve, create, package, publish, commit, cleanup +# callbacks: +# +############################################################################## + +#function config() { +# echo "Config - doing some commands before calling the builder_config" +# builder_config +# echo "Config - doing some commands after calling the builder_config" +#} + +#function prepare() { +# echo "Prepare" +# builder_prepare +#} + +function retrieve() { + echo "Retrieve" + builder_retrieve +} + +function create() { + echo "Create" + builder_create +} + +function package() { + echo "Package" + builder_package +} + +function publish() { + echo "Publish" + builder_publish +} + +function commit() { + echo "Commit" + # builder_commit +} +function cleanup() { + echo "Cleanup: output_dir: $output_dir" + # builder_cleanup +}