From 0338c870b51ee4a028f2e5082c2461351cc67d1b Mon Sep 17 00:00:00 2001 From: Mario Fetka Date: Thu, 3 May 2012 20:30:27 +0200 Subject: [PATCH] nove to new buildsystem and use upstream package and rename package --- AcTR7EFG.exe.sha1sum | 1 + Adobe-Acrobat-7.0-Std.iso.sha1sum | 1 - CLIENT_DATA/delsub32.ins | 16 ---- CLIENT_DATA/setup32.ins | 65 +++++++++------- CLIENT_DATA/uninstall32.ins | 13 +++- OPSI/control | 2 +- Testing.txt | 28 +++++++ adobe_pdf_logo.jpg.sha1sum | 2 +- build.sh | 124 ------------------------------ builder-product.cfg | 26 +++++++ builder-targets-cb.sh | 25 ++++++ 11 files changed, 130 insertions(+), 173 deletions(-) create mode 100644 AcTR7EFG.exe.sha1sum delete mode 100644 Adobe-Acrobat-7.0-Std.iso.sha1sum create mode 100644 Testing.txt delete mode 100644 build.sh create mode 100644 builder-product.cfg create mode 100644 builder-targets-cb.sh diff --git a/AcTR7EFG.exe.sha1sum b/AcTR7EFG.exe.sha1sum new file mode 100644 index 0000000..3471737 --- /dev/null +++ b/AcTR7EFG.exe.sha1sum @@ -0,0 +1 @@ +4f1ff389ea71f21d624083d65bbe5a74e4760079 /home/mario/.opsi-dist-cache/adobe.acrobat-7-7.0/X86/AcTR7EFG.exe diff --git a/Adobe-Acrobat-7.0-Std.iso.sha1sum b/Adobe-Acrobat-7.0-Std.iso.sha1sum deleted file mode 100644 index d75325d..0000000 --- a/Adobe-Acrobat-7.0-Std.iso.sha1sum +++ /dev/null @@ -1 +0,0 @@ -94b942237312e138294e95835f586eb19eeea50c /usr/portage/distfiles/Adobe-Acrobat-7.0-Std.iso diff --git a/CLIENT_DATA/delsub32.ins b/CLIENT_DATA/delsub32.ins index a660d78..8fbcee5 100644 --- a/CLIENT_DATA/delsub32.ins +++ b/CLIENT_DATA/delsub32.ins @@ -5,15 +5,9 @@ Set $MsiId$ = '{AC76BA86-1033-F400-BA7E-100000000002}' -Set $UninstallProgram$ = $InstallDir$ + "\uninstall.exe" Message "Uninstalling " + $ProductId$ + " ..." -if FileExists($UninstallProgram$) - comment "Uninstall program found, starting uninstall" - Winbatch_uninstall - sub_check_exitcode -endif if not (GetRegistryStringValue32("[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" + $MsiId$ + "] DisplayName") = "") comment "MSI id " + $MsiId$ + " found in registry, starting msiexec to uninstall" Winbatch_uninstall_msi @@ -29,16 +23,6 @@ Registry_uninstall /32Bit comment "Delete program shortcuts" LinkFolder_uninstall -[Winbatch_uninstall] -; Choose one of the following examples as basis for program uninstall -; -; === Nullsoft Scriptable Install System ================================================================ -; "$UninstallProgram$" /S -; -; === Inno Setup ======================================================================================== -; "$UninstallProgram$" /silent /norestart - - [Winbatch_uninstall_msi] msiexec /x $MsiId$ /qb! REBOOT=ReallySuppress diff --git a/CLIENT_DATA/setup32.ins b/CLIENT_DATA/setup32.ins index 7a98264..da439d0 100644 --- a/CLIENT_DATA/setup32.ins +++ b/CLIENT_DATA/setup32.ins @@ -7,7 +7,6 @@ requiredWinstVersion >= "4.10.8.6" DefVar $MsiId$ -DefVar $UninstallProgram$ DefVar $LogDir$ DefVar $ProductId$ DefVar $MinimumSpace$ @@ -19,13 +18,23 @@ DefVar $LicensePool$ 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 - ; ---------------------------------------------------------------- ;$ProductId$ should be the name of the product in opsi ; therefore please: only lower letters, no umlauts, ; no white space use '-' as a seperator -Set $ProductId$ = "adobeacrobat-7" +Set $ProductId$ = "adobe.acrobat-7" Set $MinimumSpace$ = "185 MB" ; the path were we find the product after the installation Set $InstallDir$ = "%ProgramFiles32Dir%\Adobe\Acrobat 7.0" @@ -53,9 +62,21 @@ else Sub_get_licensekey endif - comment "Start setup program" - Winbatch_install - Sub_check_exitcode + comment "Extract Office" + Winbatch_extract + Sub_check_exitcode + + ;comment "Extract Office Updates" + ;Winbatch_update + ;Sub_check_exitcode + + comment "Start setup program" + Winbatch_install + Sub_check_exitcode + + comment "Remove Install Files" + Winbatch_remove + Sub_check_exitcode comment "Copy files" Files_install /32Bit @@ -80,31 +101,19 @@ else endif + +[Winbatch_extract] +$InstallExe$ -nos_ne -nos_o"$LogDir$\AdobeAcrobat7 + +;[Winbatch_update] +;$InstallSp3Exe$ /quiet /extract:$LogDir$\msoffice2007\Updates + [Winbatch_install] -; Choose one of the following examples as basis for your installation -; You can use $LicenseKey$ var to pass a license key to the installer -; -; === Nullsoft Scriptable Install System ================================================================ -; "%ScriptPath%\Setup.exe" /S -; -; === MSI package ======================================================================================= -; You may use the parameter PIDKEY=$Licensekey$ msiexec /i "%ScriptPath%\files\Adobe Acrobat 7.0 Standard\AcroStan.msi" /l* "$LogDir$\$ProductId$.install_log.txt" /qb! ALLUSERS=2 REBOOT=ReallySuppress USERNAME="%HostID%" COMPANYNAME="%HostID%" ISX_SERIALNUMBER="$LicenseKey$" INSTALLDIR="$InstallDir$" -; -; === InstallShield + MSI===================================================================================== -; Attention: The path to the log file should not contain any whitespaces -; "%ScriptPath%\setup.exe" /s /v" /l* $LogDir$\$ProductId$.install_log.txt /qb! ALLUSERS=2 REBOOT=ReallySuppress" -; "%ScriptPath%\setup.exe" /s /v" /qb! ALLUSERS=2 REBOOT=ReallySuppress" -; -; === InstallShield ===================================================================================== -; Create setup.iss answer file by running: setup.exe /r /f1"c:\setup.iss" -; "%ScriptPath%\setup.exe" /s /sms /f1"%ScriptPath%\setup.iss" /f2"$LogDir$\$ProductId$.install_log.txt" -; -; === Inno Setup ======================================================================================== -; http://unattended.sourceforge.net/InnoSetup_Switches_ExitCodes.html -; You may create setup answer file by: setup.exe /SAVEINF="filename" -; You may use an answer file by the parameter /LOADINF="filename" -; "%ScriptPath%\setup.exe" /sp- /silent /norestart + +[Winbatch_remove] +delete -sf "$LogDir$\AdobeAcrobat7\" + [Files_install] ; Example of recursively copying some files into the installation directory: diff --git a/CLIENT_DATA/uninstall32.ins b/CLIENT_DATA/uninstall32.ins index 41b238c..855a79f 100644 --- a/CLIENT_DATA/uninstall32.ins +++ b/CLIENT_DATA/uninstall32.ins @@ -7,7 +7,6 @@ requiredWinstVersion >= "4.10.8.6" DefVar $MsiId$ -DefVar $UninstallProgram$ DefVar $LogDir$ DefVar $ExitCode$ DefVar $ProductId$ @@ -17,10 +16,20 @@ DefVar $LicensePool$ 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 - ; ---------------------------------------------------------------- -Set $ProductId$ = "adobeacrobat-7" +Set $ProductId$ = "adobe.acrobat-7" Set $InstallDir$ = "%ProgramFiles32Dir%\Adobe\Acrobat 7.0" Set $LicenseRequired$ = "true" Set $LicensePool$ = "p_" + $ProductId$ diff --git a/OPSI/control b/OPSI/control index 7f1d4ee..aafb2fe 100644 --- a/OPSI/control +++ b/OPSI/control @@ -5,7 +5,7 @@ incremental: False [Product] type: localboot -id: adobeacrobat-7 +id: adobe.acrobat-7 name: Adobe Acrobat 7 description: Unter Adobe Acrobat wird eine Gruppe von Programmen zusammengefasst, die zum Erstellen, Verwalten, Kommentieren und Verteilen von PDF-Dateien verwendet werden. advice: ADVICE diff --git a/Testing.txt b/Testing.txt new file mode 100644 index 0000000..d6b5e6c --- /dev/null +++ b/Testing.txt @@ -0,0 +1,28 @@ +*** Qualitiymanagement/Testing procedure + +- Product: + - Name: productname + - Version: xxx + - Release: yyyy + +- Environment + - OS: Native windows XP-32Bit installation + - Preinstalled packages: None (also no aio) + - Files used while testing: + File1: http://domain.de/file.ext + +- Testing process: + OPSI-action: + - Installation (without dependencies like AIO/Firefox): ?? + Result: + - File extensions related to program: ?? + - Start menu entry: ?? + - Starting/using program: viewer works, File1 is shown correctly: ?? + + OPSI-action: + - Uninstall + Result: + - File extensions related to program: unrelated: ?? + - Start menu entry: none: ?? + + diff --git a/adobe_pdf_logo.jpg.sha1sum b/adobe_pdf_logo.jpg.sha1sum index 55739af..2ab9630 100644 --- a/adobe_pdf_logo.jpg.sha1sum +++ b/adobe_pdf_logo.jpg.sha1sum @@ -1 +1 @@ -54dec610f9fc4de5d7b3aea4b374a03806a78637 /usr/portage/distfiles/adobe_pdf_logo.jpg +54dec610f9fc4de5d7b3aea4b374a03806a78637 /home/mario/.opsi-dist-cache/adobe.acrobat-7-7.0//adobe_pdf_logo.jpg diff --git a/build.sh b/build.sh deleted file mode 100644 index 4a7f491..0000000 --- a/build.sh +++ /dev/null @@ -1,124 +0,0 @@ -#!/bin/sh -PN="adobeacrobat-7" -VERSION="7.0" -RELEASE="2" -PRIORITY="0" -ADVICE="" -TYPE="restrict" -# all downloads should not have any traling parameters like ?downlaodid=1234 .....(should rewrite in python) -ICON="http://techielobang.com/blog/wp-content/uploads/2010/10/adobe_pdf_logo.jpg" -X86="http://internal.graz.disconnected-by-peer.at/Orig/Adobe/Acrobat/7.0/Adobe-Acrobat-7.0-Std.iso" -#AMD64="http://downloads.sourceforge.net/sevenzip/7z920-x64.msi" -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 -transparent white -background transparent -resize 160x160\> \ - -size 160x160 xc:transparent +swap -gravity center -composite $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 - #cp /usr/portage/distfiles/$X86FILE $OUT/$PN/CLIENT_DATA - mkdir -p $OUT/$PN/CLIENT_DATA/files - 7z x -o$OUT/$PN/CLIENT_DATA/files /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 -O /usr/portage/distfiles/$X86FILE $X86 - plowdown -o /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 -# cp /usr/portage/distfiles/$AMD64FILE $OUT/$PN/CLIENT_DATA -# 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 -sed -e "s!X86FILE!$X86FILE!g" -i $OUT/$PN/CLIENT_DATA/setup32.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..e423eb6 --- /dev/null +++ b/builder-product.cfg @@ -0,0 +1,26 @@ +############################ +# Setup product information +############################ +VENDOR="adobe.com" +PN="adobe.acrobat-7" +VERSION="7.0" +RELEASE="3" +PRIORITY="0" +ADVICE="" + +# TYPE - defines, if the install files are public or restricted. +# Valid value: restricted | public +TYPE="public" + + +DL_FILE[0]="adobe_pdf_logo.jpg" +DL_SOURCE[0]="http://techielobang.com/blog/wp-content/uploads/2010/10/adobe_pdf_logo.jpg" + +DL_FILE[1]="AcTR7EFG.exe" +DL_SOURCE[1]="ftp://ftp.adobe.com/pub/adobe/acrobat/win/7x/7.0/misc/AcTR7EFG.exe" +DL_ARCH[1]="X86" +DL_WINST_NAME[1]=InstallExe + +# File array index for the image showing while installing the program +ICON_DL_INDEX=0 + diff --git a/builder-targets-cb.sh b/builder-targets-cb.sh new file mode 100644 index 0000000..9a3d4a8 --- /dev/null +++ b/builder-targets-cb.sh @@ -0,0 +1,25 @@ +############################################################################## +# 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 cleanup() { + echo "Cleanup" + builder_cleanup +}