Merge branch 'master' of disconnected-by-peer.at:go-opsi/itwatch

Conflicts:
	builder/README-builder.txt
This commit is contained in:
Daniel Schwager 2012-01-27 09:15:08 +01:00
commit cd982a3534
11 changed files with 394 additions and 392 deletions

View File

@ -0,0 +1,287 @@
// itWatch Endpoint Security - Konfigurationsdatei
// -------------------------------------------------
//
// Zur Verwendung bei einer Installation ohne Benutzerinteraktion
// und/oder Konfiguration ohne Benutzerinteraktion
//
// (c) itWatch GmbH - München 2011
//
// -------------------------------------------------
//
[Configuration]
//
// --------------- Policy festlegen ---------------
//
// POLICY: Gibt an, welche Policy Daten für den Client repliziert und aktiv werden.
// Beachten Sie bitte, dass hier nur der Policy Namen angegeben wird - ohne Zusatz ".dwd".
//
// Beispiel für Verwendung Policy Name "Standard":
// Bitte hier gewünschten Wert eintragen; ein Wert ist gültig
Policy = standard
//
//-------------- Pfad für Erstinstallation und/oder Lokalem Betrieb (Standalone Inst) ------
//
// DEFAULTPOLICYPATH: Gibt an, aus welchem Verzeichnis die im Wert "POLICY" festgelegte Policy
// nach Erstinstallation oder bei lokalem Betrieb (Standalone Inst) gelesen wird.
// Die Policy muss als Datei im DEFAULTPOLICYPATH stehen; verwenden Sie hierzu
// die Funktion "Policy importieren" (mit Berechtigungen) in der itWatch Administration
// nachdem Sie die gewünschten Policy Einstellungen getroffen und die itWatch Berechtigungen (
// eingetellt haben.
// Stellen Sie sicher, dass über die Software Verteilung diese Datei mit ins
// entsprechende Verzeichnis während der Installation kopiert wird.
// Nach unserer Empfehlung sollte das Default Policy Verzeichnis immer lokal
// sein (kein Netzverzeichnis). Wenn Sie das Programmverzeichnis als Default Policy
// Verzeichnis wählen, ist auch sichergestellt, dass der Anwender die Policy Datei
// nicht manipulieren kann.
// Die Verwendung des DEFAULTPOLICYPATH stellt sicher, dass die gewünschte Policy
// sofort nach Reboot der Installation aktiv werden kann.
// Falls der Wert nicht angegeben wird, wird das itWatch Programmverzeichnis
// verwendet.
//
// Beispiele für die Verwendung des Default Policy Verzeichnisses:
// Bitte hier gewünschten Wert eintragen; ein Wert ist gültig
// Abhängig vom verwendeten Betriebssystem den gültigen Pfad auswählen, bzw. entsprechend auskommentieren
// Pfadangabe für x86 Betriebssysteme
DefaultPolicyPath = C:\Programme\itWatch
// Pfadangabe für x64 Betriebssysteme
// DefaultPolicyPath = C:\Program Files (x86)\itWatch
//
// ---------- Replikationstyp festlegen -----------
//
// ReplicationType: Definiert den Replikationstyp.
// REGISTRY = Registry Replikation
// FTP = FTP Replikation
// DIR = Direcory/File Replikation. Server-Angabe wird nicht ausgewertet.
//
// Beispiel für Verwendung Registry Replikation:
// Bitte hier gewünschten Wert eintragen; ein Wert ist gültig
ReplicationType = Registry
//
// --------- Replikationsmodus festlegen -----------
//
// REPLICATION: Definiert den Replikationsmodus.
// Mögliche Werte (und alle Kombinationen daraus):
// BOOT = Replikation erfolgt beim Systemstart zum Bootzeitpunkt
// Auswahl nur möglich für File Replikation;
// beachten Sie bitte, dass auf Netzlaufwerke gewöhnlich zu
// diesem Zeitpunkt nicht zugegriffen werden kann
// LOGON = Replikatin erfolgt bei Benutzeranmeldung
// CYCLE = Zyklisch, "RepCycle" gibt die Zykluszeit an
// Auswahl nicht möglich für FTP Replikation
// USER UNLOCK = Replikation erfolgt beim Entsperren der Arbeitsstation
//
// Beispiel für Replikation bei Benutzeranmeldung:
// Bitte hier gewünschten Wert eintragen; mehrere Werte sind möglich
// Replication = LOGON, CYCLE, USER UNLOCK
Replication = LOGON
//
// -------- Parameter für zyklische Replikation -----
//
// REPCYCLE: Definiert den Replikationszyklus in Minuten für automatische, zyklische Replikation
//
// Beispiel für einen Replikationszyklus von 2 Minuten:
// Bitte hier gewünschten Wert eintragen; ein Wert ist gültig
RepCycle = 2
//
// -------- Parameter für Registry Replikation ------
//
// SERVER: Gibt den Replikationsserver an.
// * als Server konfiguriert den automatischen Modus mit Replikation gegen PDC/BDC.
// Dieser Wert ist nicht erforderlich für Dateireplikation/FTP.
//
// Beispiel für Server=lokaler Rechner (Lokale Installation/Standalone):
// Bitte hier gewünschten Wert eintragen; ein Wert ist gültig
SERVER = .
// Beispiel für Server = itWatchPDC
// Bitte hier gewünschten Wert eintragen und Auskommentierung (//) entfernen; ein Wert ist gültig
// SERVER = itWatchPDC
//
// -------- Parameter für Datei Replikation ------
//
// POLICYDIR: Gibt für DIR- und FTP- Replikation das Quellverzeichnis der Policy Datei an.
// Nicht notwendig für REG Replikation
//
// Beispiel für Quellverzeichnis=lokaler Rechner
// Bitte hier gewünschten Wert eintragen und Auskommentierung (//) entfernen; ein Wert ist gültig
//PolicyDir = .
//
// Beispiel für Quellverzeichnis=Netz
// Bitte hier gewünschten Wert eintragen und Auskommentierung (//) entfernen; ein Wert ist gültig
//PolicyDir = \\servername\policies
//
// --------- Parameter für Replikation von FTP ------
//
// FTPPort: Definiert den FTPPort
//
// Beispiel für FTP Port 21:
// Bitte hier gewünschten Wert eintragen und Auskommentierung (//) entfernen; ein Wert ist gültig
//FTPPort = 21
//
// - - - - - - - - - - - - -
//
// POLICYDIR: Gibt für DIR- und FTP- Replikation das Quellverzeichnis der Policy Datei an.
// Nicht notwendig für REG Replikation
//
// Beispiel für Quellverzeichnis=FTP Dir=Root
// Bitte hier gewünschten Wert eintragen und Auskommentierung (//) entfernen; ein Wert ist gültig
//PolicyDir = .
// Beispiel für Quellverzeichnis=FTP Dir=SubDir
// Bitte hier gewünschten Wert eintragen und Auskommentierung (//) entfernen; ein Wert ist gültig
//PolicyDir = policies
//
// - - - - - - - - - - - - -
//
// FTPACCOUNT: Gibt den Account für eine FTP Replikation an.
// Nicht notwendig für REGISTRY oder DIR Replikation
// Wenn FTP Replikationstyp gewählt ist und diese Angabe fehlt, wird der anonymus FTP Account verwendet.
//
// Beispiel für FTP Account "TU001":
// Bitte hier gewünschten Wert eintragen und Auskommentierung (//) entfernen; ein Wert ist gültig
//FTPACCOUNT = TU001
//
// - - - - - - - - - - - - -
//
// FTPPASSWORD: Gibt das Passwort für den FTP Account an
// Angabe in Klartext erforderlich FTP Replikation
//
// Beispiel für FTP Passwort:
// Bitte hier gewünschten Wert eingeben und Auskommentierung (//) entfernen; ein Wert ist gültig
//FTPASSWORD = TEST
//
// --------- Administrationsserver festlegen ---------------------------
//
// PolicyRepository: Legt fest, wo der Datenbestand (Admin Server) liegt,
// mit dem die itWatch Administration arbeitet.
// Nur erforderlich für die Administrationskomponente.
//
// Beispiel für itWatch wird verbunden mit lokaler Rechner:
// Bitte hier gewünschten Wert (Rechner Name) eingeben. Ein Wert ist gültig.
PolicyRepository = .
// Beispiel für itWatch Administration wird verbunden mit Windows Server "PDCmyDomain":
// Bitte hier gewünschtn Wert eintragen und Auskommentierung (//) entfernen; ein Wert ist gültig
// PolicyRepository = PDCmyDomain
//
// --------- Ereignisbehandlung festlegen ------------------------------
//
// LOGLEVEL: Legt den Detaillierungsgrad der Protokollierung fest.
// Mögliche Werte:
// NONE (oder leer) = keine Meldungen (Stufe 0)
// ERROR = Fehlermeldungen (Stufe 1)
// ERROR, WARNING, INFORMATION = Fehlermeldungen, Warnhinweise und Informationen (Stufe 2)
// DETAILED = vollständige, detaillierte Protokollierung (Stufe 3)
//
// Beispiel für Protokollierung von Fehlermeldungen; Logeinträge der ausgewählten Stufen 0 - 3 werden in
// eine Datei "itWESSLog.csv" geschrieben, die sich in Windows XP im Verzeichnis
// z.B. C:\Dokumente und Einstellungen\All Users\Anwendungsdaten\itWatch\Logs" befindet.
// Dort jeweils in einem Unterverzeichnis mit dem Datum des letzten Starts des Loggings.
// In Microsoft Vista oder windows 7 ist die Datei in %ProgramData%\itWatch\Logs zu finden.
//
// Bitte hier gewünschten Wert vorgeben:
LogLevel = Error
// Beispiel für eine geringe Protokollierung (Stufe 1).
// LogLevel = NONE
// Beispiel für keine Protokollierung (Stufe 0)
// LogLevel = ERROR, WARNING, INFORMATION
// Beispiel für Stufe 2
// LogLevel = DETAILED
// Beispiel für eine sehr umfangreiche Protokollierung (Stufe 3)
//
// -------- DEvCon Konfiguration ---------------------------------------
//
// DEvConService: An-/Abschalten des DEvCon Services für den Client
// Mögliche Werte: ON|OFF
// DEvConService=ON (Aktierung)
// DEvConService=OFF (Deaktivierung)
// Beachten Sie bitte, dass "DEvConService = ON" erforderlich ist, wenn Sie von
// Ereignisfiltern an Ihrer Policy Gebrauch machen wollen, oder die transparente
// Verschlüsselung im Hintergrund aktiviert werden soll
//
// Beispiel für DEvCon Service wird für den Client aktiviert:
// Bitte hier gewünschten Wert angeben; ein Wert ist gültig
DEvConService = ON
// Beispiel für DEvCon Service wird für den Client deaktiviert:
// DEvConService = OFF
//
// ------- Parameter für DEvCon Konfiguration ---------------------------
//
// DEvConServer: Gibt den Namen des Servers an, auf dem das itWatch Management Center (DCView)
// installiert und aktiviert wurde und für diesen Client Ereignisse entgegennehmen
// soll.
// Dieser Client muss dazu in der für ihn gültigen Policy Ereignisfilter
// mit Aktion ausführen "Ereignisse an DEvCon melden" aktiviert haben.
//
// Environmentvariablen werden aufgelöst, wenn als %Variable% angegeben ist.
// Default Einstellung ist '.' für den lokalen Rechner
//
// Dieser Wert muss nur angegeben werden, wenn die Funktion itWatch Management Center
// verwendet wird.
//
// Beispiel für itWatch Management Center liegt auf lokalem Rechner
// Bitte hier gewünschten Wert angeben und Auskommentierung (//) entfernen; ein Wert ist gültig
// DEvConServer = .
// Beispiel für itWatch Management Center liegt auf Rechnername "itWatchPDC"
// Bitte hier gewünschten Wert angeben und Auskommentierung (//) entfernen; ein Wert ist gültig
// DEvConServer = itWatchPDC
//
// - - - - - - - - - - - - -
//
//DEvConBuffer: Gibt die Größe des lokalen Ereignispuffers an. Solange der DEvCon Service die Ereignisse
// nicht an den angegebenen DEvCon Server liefern kann, werden die Ereignisse in diesen
// Puffer geschrieben.
// Defaultwert ist 1000
//
// Beispiel für die Größe des lokalen Ereignispuffers:
// Bitte hier gewünschten Wert angeben; ein Wert ist gültig
DEvConBuffer = 1000
//
// - - - - - - - - - - - - -
//
// DEvConUserID: Gibt an, ob die ID des angemeldeten Benutzers an das itWatch Managmeent Center (DCView)
// übertragen wird
// Mögliche Werte: ON|OFF
// Default ist OFF, keine Übertragung
//
// Beispiel für das Einschalten der Übertragung der ID des angemeldeten Benutzers
// Bitte hier gewünschten Wert angeben; ein Wert ist gültig
DEvConUserID = ON
// Beispiel für das Einschalten der Übertragung der ID des angemeldeten Benutzers
// Bitte hier gewünschten Wert angeben; ein Wert ist gültig
// DEvConUserID = OFF
//
// - - - - - - - - - - - - -
//
// EFXEnabled: Gibt an, ob die transparente Verschlüsselung im Hintergrund aktiv wird.
// Mögliche Werte: ON|OFF
// Default ist OFF, keine Verschlüsselung im Hintergrund
//
// Beispiel für eine aktive Hintergrundverschlüsselung/transparente Verschlüsselung
// Bitte hier gewünschten Wert angeben; ein Wert ist gültig
// EFXEnabled = ON
// Beispiel für eine inaktive Hintergrundverschlüsselung/transparente Verschlüsselung
// Bitte hier gewünschten Wert angeben; ein Wert ist gültig
EFXEnabled = OFF
//
// - - - - - - - - - - - - -
//
// KMSService: An-/Abschalten des Key Management Service
// Mögliche Werte: ON|OFF
//
// Beispiel für KMService wird für den Client aktiviert:
// Bitte hier gewünschten Wert angeben; ein Wert ist gültig
// KMSService = ON
// Beispiel für KMService wird für den Client deaktiviert:
KMSService = OFF
//
// - - - - - - - - - - - - -
//
// KMSServer: Gibt den Namen des Schlüsselverwaltungs-Servers an; auf dem der itWatch KM Server installiert wurde und
// aktiv ist und für diesen Client das Key Management der PDWatch Company Key Verschlüsselung
// verwaltet.
// Default ist "." für LocalMachine
//
// Beispiel für itWatch KM Server = itWatchPDC
// Bitte hier gewünschten Wert eingeben und Auskommentierung (//) entfernen; ein Wert ist gültig
// KMSServer = itWatchPDC
//
// -------------- Ende Konfigurationsdatei --------------------------------------------------------

View File

@ -17,6 +17,9 @@ DefVar $LicenseRequired$
DefVar $LicenseKey$
DefVar $LicensePool$
; Token BUILDER_VARIABLES will be replace by builder.sh
@@BUILDER_VARIABLES@@
Set $LogDir$ = "%SystemDrive%\tmp"
; ----------------------------------------------------------------
@ -75,6 +78,9 @@ else
; comment "Successful Installation"
; endif
comment "Trigger reboot"
ExitWindows /Reboot
endif
[Winbatch_install]
@ -83,8 +89,8 @@ endif
;
; === MSI package =======================================================================================
; You may use the parameter PIDKEY=$Licensekey$
msiexec /i "%ScriptPath%\X86FILE" /l* "$LogDir$\$ProductId$.install_log.txt" /qb! ALLUSERS=2 REBOOT=ReallySuppress CONFIGURATIONPATH="%ScriptPath%\custom\custom.cfg"
;
msiexec /i "%ScriptPath%\itWESS-Client_German.msi" /l* "$LogDir$\$ProductId$.install_log.txt" /qb! ALLUSERS=2 REBOOT=ReallySuppress CONFIGURATIONPATH="%ScriptPath%\custom\custom.cfg"
[Files_install]
; Example of recursively copying some files into the installation directory:

View File

@ -17,6 +17,9 @@ DefVar $LicensePool$
Set $LogDir$ = "%SystemDrive%\tmp"
; Token BUILDER_VARIABLES will be replace by builder.sh
@@BUILDER_VARIABLES@@
; ----------------------------------------------------------------
; - Please edit the following values -
; ----------------------------------------------------------------
@ -35,6 +38,9 @@ Message "Uninstalling " + $ProductId$ + " ..."
if FileExists("%ScriptPath%\delsub32.ins")
comment "Start uninstall sub section"
Sub "%ScriptPath%\delsub32.ins"
comment "Trigger reboot"
ExitWindows /Reboot
endif
if $LicenseRequired$ = "true"

View File

@ -1,18 +0,0 @@
############################
# define methods to overwrite library methods here
# refer to the the builder.sh to check the methods
############################
#builder_read_config_pre() {
# echo "** USER: Cal.ling BEFORE builder__read_confi"
#}
#builder_read_config() {
# echo "** USER: Calling INSTEAD-OF builder_read_config"
#}
#builder__read_confif() {
# echo "** USER: Calling AFTER builder__read_config"
#}

41
builder-product.cfg Normal file
View File

@ -0,0 +1,41 @@
############################
# Setup product information
############################
VENDOR="itwatch.de"
PN="itwatch"
VERSION="4.10.19"
RELEASE="3"
PRIORITY="0"
ADVICE=""
# Status integration, testing, release
STATUS="review"
#################
# Setup url for downloading the binaries
################
# all downloads should not have any traling parameters like ?downlaodid=1234 .....(should rewrite in python)
# You can setup many URL's separated by ";"
# Format: basename ; URL1 ; URL2 ; ...
ICON_FILE_INDEX=0
# Format: basename ; URL1 ; URL2 ; ...
#FILE1="itWESS-Client_German.msi;http://ivyrepos.dtnet.de/v-$PN/itwatch/itwatch/4.10.19/itWESS-Client_German.msi;http://internal.graz.disconnected-by-peer.at/Orig/itWatch/itWESS/HB/4.10.19/itWESS-Client_German.msi"
#FILE2="itWESS-64bit_German.msi;http://ivyrepos.dtnet.de/itwatch/itwatch/4.10.19/itWESS-64bit_German.msi;http://internal.graz.disconnected-by-peer.at/Orig/itWatch/itWESS/HB/4.10.19/itWESS-64bit_German.msi"
FILE[0]="itWatchLogo.jpg"
SOURCE[0]="http://www.itwatch.de/logos/itWatchLogo.jpg"
WINST[0]=IconFile
FILE[1]="itWESS-Client_German.msi"
SOURCE[1]="http://ivyrepos.dtnet.de/v-$PN/itwatch/itwatch/4.10.19/itWESS-Client_German.msi;http://internal.graz.disconnected-by-peer.at/Orig/itWatch/itWESS/HB/4.10.19/itWESS-Client_German.msi"
ARCH[1]="X86"
WINST[1]=itWESS
FILE[2]="itWESS-64bit_German.msi"
SOURCE[2]="http://ivyrepos.dtnet.de/itwatch/itwatch/4.10.19/itWESS-64bit_German.msi;http://internal.graz.disconnected-by-peer.at/Orig/itWatch/itWESS/HB/4.10.19/itWESS-64bit_German.msi"
ARCH[2]="X86_64"
WINST[2]=itWESS64

52
builder-targets-cb.sh Normal file
View File

@ -0,0 +1,52 @@
##############################################################################
# This optional file "builder-targets-cb.sh" will be called by builder.sh
#
# You can overwrite target functions like
# config, prepare, retrieve, create, package, publish, commit, cleanup
# and define callback functions
# cb_package_makeproductfile
#
##############################################################################
#function config() {
# echo "Config"
# 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 cb_package_makeproductfile() {
echo "May add/replace files to the files to $inst_dir"
}
function publish() {
echo "Publish"
builder_publish
}
function commit() {
echo "Commit"
# builder_commit
}
function cleanup() {
echo "Cleanup: output_dir: $output_dir"
# builder_cleanup
}

View File

@ -1,32 +0,0 @@
##############################
# Prerequirements:
# - Setup your environment variable inside the shell, e.g. ~/.bashrc
# export BUILD_LOCAL_CFG=/home/dschwager/work/build_local.cfg
# check the sample build_local.cfg located inside the itwatch project
##############################
# requirements
yum install plowshare
yum install ImageMagick
yum install git
# Define your local, private, individual, not-project dependent build setup
# in the file ~/.builder.cfg OR by using the environment variable BUILD_LOCAL_CFG
# pointing the the configuration.
# export BUILD_LOCAL_CFG=/home/dschwager/work/itwatch/build_local.cfg
# If no files are availble, the default values will be use.
# Start build
builder.sh <path-to-the-project>
builder.sh /home/dschwager/work/itwatch
# Force downloading vendor files
DIST_FORCE_DOWNLOAD=1 builder.sh /home/dschwager/work/itwatch
# Force upload independent of existing OPSI-Package in repository
OPSI_REPOS_FORCE_UPLOAD=1 builder.sh /home/dschwager/work/itwatch
================================================================================

View File

@ -1,41 +0,0 @@
###################################################
# build-default.cfg
# Default values for OPSI builder system
####################################################
##################################
# Global variables
#################################
TMP_DIR=/tmp
##################################
# OPSI repository settings
#################################
# Basedirectory storing OPSI-packages after building
OPSI_REPOS_BASE_DIR=$HOME/.opsi-repository
# Directory- and filename pattern
OPSI_REPOS_PRODUCT_DIR=${OPSI_REPOS_BASE_DIR}/${STATUS}/${VENDOR}/${PN}/${VERSION}-${RELEASE}
# OPSI-package filepattern
OPSI_REPOS_FILE_PATTERN=${PN}_${VERSION}-${RELEASE}.opsi
# Force alway upload to opsi repos
# OPSI_REPOS_FORCE_UPLOAD=1
###############################
# Distribution / Vendor settings
###############################
# Directory downloading/cacheing the artifacts like MSI package or icons from the vendor webside
DIST_CACHE_DIR=$HOME/.opsi-dist-cache/${PN}-${VERSION}
# private dist repository. You can use all variables from release.cfg insde the URL
# this optinal URL will be the FIRST url to check for downloading vendor stuff.
# To copy a local file, the repos should start with file://
DIST_PRIVATE_REPOS=file://$HOME/opsi-dist.private/$VENDOR/$PN/$VERSION
# Force always downloading dist files
# DIST_FORCE_DOWNLOAD=1

View File

@ -1,204 +0,0 @@
#####################
# Call user entry point
####################
call_entry_point() {
# Entry point
type $1 &>/dev/null
if [ $? == 0 ] ; then
$1
fi
}
#####################
# Read config
####################
# read private build configuration
#test -f "$BUILD_LOCAL_CFG" && . $BUILD_LOCAL_CFG
builder_read_config() {
# Check temp dir
test -d ${TMP_DIR}
builder_check_error "temp directory not available: $TMP_DIR"
# Source product release configuration
test -f ${PRODUCT_DIR}/product.cfg
builder_check_error "can't read release configuration: ${PRODUCT_DIR}/product.cfg"
. $PRODUCT_DIR/product.cfg
# set default build configuration and source the user dependent file
. $BASEDIR/build-default.cfg
# Source local build configuration (must be done AFTER sourcing the release.cfg)
test -f $HOME/.builder.cfg && . $HOME/.builder.cfg && echo "Loaded builder configuration: $HOME/.builder.cfg"
test -f "$BUILD_LOCAL_CFG" && . $BUILD_LOCAL_CFG && echo "Loaded builder configuration: $BUILD_LOCAL_CFG"
# Check variables
if [ -z ${OPSI_REPOS_BASE_DIR} ] || [ ! -d ${OPSI_REPOS_BASE_DIR} ] ; then
echo "configuration error: OPSI_REPOS_BASE_DIR directory does not exist: $OPSI_REPOS_BASE_DIR"
exit 2
fi
}
#####################
# Download all dist files from one of the defined URLs.
# and validate the checksum
####################
builder_download_dist_files() {
mkdir -p $DIST_CACHE_DIR
echo "Distribution directory: $DIST_CACHE_DIR"
for f1 in $ICON $FILE1 $FILE2 ; do
basename=`echo $f1 | cut -d ";" -f1`
urls=`echo $f1 | cut -d ";" -f2-`
downloaded=0
# Add private repos to the urls
if [ ! -z ${DIST_PRIVATE_REPOS} ]; then
urls="${DIST_PRIVATE_REPOS}/$basename;$urls"
fi
# check existence of CRC file
if [ ! -e ${PRODUCT_DIR}/${basename}.sha1sum ] ; then
echo "You need to create the checksums with: sha1sum ${DIST_CACHE_DIR}/${basename} > ${PRODUCT_DIR}/${basename}.sha1sum"
exit 1
fi
echo "Downloading $basename"
# check downloading from the defined URLs
for f2 in `echo $urls | sed -e 's/;/\n/g'` ; do
if [ $downloaded == 1 ]; then continue; fi
echo " Info: Downloding from $f2"
# Check, if the URL is a file URL starting with file://
if [ -f ${DIST_CACHE_DIR}/$basename ] && [ -z ${DIST_FORCE_DOWNLOAD} ]; then
echo " Info: File still cached/downloaded. To force a download, set DIST_FORCE_DOWNLOAD=1"
elif [[ $f2 == file://* ]]; then
fileurl=`echo $f2 | sed "s/^file:\/\///"`
cp $fileurl ${DIST_CACHE_DIR}/$basename 2>/dev/null
else
rm -f ${DIST_CACHE_DIR}/$basename
wget --tries=1 -O ${DIST_CACHE_DIR}/$basename --timeout=5 -q --no-verbose $f2
fi
if [ $? == 0 ] ; then
# testing the checksum of the downloaded files
SHA1SUM=`cat ${PRODUCT_DIR}/${basename}.sha1sum | cut -d " " -f1`
CHECKSUM=`sha1sum ${DIST_CACHE_DIR}/$basename | cut -d " " -f1`
if [ "$CHECKSUM" == "$SHA1SUM" ] ; then
downloaded=1
echo " Info: Downloaded successfully"
else
echo " Error: The checksums do not match - try next URL"
fi
else
echo " Warning: Failed to download file - try next URL"
fi
done
echo
# Ups - no URL works
if [ $downloaded != 1 ] ; then
echo " Error: can download the file or checksum wrong (sha1sum ${DIST_CACHE_DIR}/${basename} > ${basename}.sha1sum)"
exit 1;
fi
done
}
#####################
# build opsi package
#####################
builder_package() {
OUT=$(mktemp -d $TMP_DIR/opsi-builder.XXXXXXXXXX) || { echo "Failed to create temp dir"; exit 1; }
# Copy files and convert text files to dos format
mkdir $OUT/$PN
cp -Rv ${PRODUCT_DIR}/OPSI ${PRODUCT_DIR}/CLIENT_DATA $OUT/$PN
find $OUT/$PN/CLIENT_DATA -type f | xargs -n1 -iREP sh -c 'file -i $0 | grep "text/plain" && dos2unix $0' REP
# copy binaries
for f1 in $FILE1 $FILE2 ; do
basename=`echo $f1 | cut -d ";" -f1`
cp ${DIST_CACHE_DIR}/$basename $OUT/$PN/CLIENT_DATA
done
# converting icon file
ICONFILE=`echo $ICON | cut -d ";" -f1`
convert -colorspace rgb ${DIST_CACHE_DIR}/$ICONFILE -transparent white -background transparent -resize 160x160 \
-size 160x160 xc:transparent +swap -gravity center -composite $OUT/$PN/CLIENT_DATA/$PN.png
builder_check_error "converting image"
# replace variables
echo Building OPSI-Package
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" -i $OUT/$PN/CLIENT_DATA/setup32.ins
# Create changelog based on git - if available
if test -d "${PRODUCT_DIR}/.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."
fi
# building package
pushd ${TMP_DIR}
rm -f ${PN}_${VERSION}-${RELEASE}.opsi
opsi-makeproductfile -v $OUT/$PN
builder_check_error "Building OPSI-package"
popd
# cleanup
rm -rf $OUT
}
#####################
# build opsi package
#####################
builder_upload() {
# Upload file to repository
mkdir -p ${OPSI_REPOS_PRODUCT_DIR}
cp -av $TMP_DIR/${PN}_${VERSION}-${RELEASE}.opsi ${OPSI_REPOS_PRODUCT_DIR}/${OPSI_REPOS_FILE_PATTERN}
builder_check_error "Can't upload file $TMP_DIR/${PN}_${VERSION}-${RELEASE}.opsi to ${OPSI_REPOS_PRODUCT_DIR}/${OPSI_REPOS_FILE_PATTERN}"
}
###################
# Commiting changes to repos
###################
builder_commit() {
if test -d ".git"; then
echo
# echo "builder_commit() not implemented yet."
fi
}
###################
# Check error
###################
builder_check_error() {
if [ $? == 1 ] ; then
echo "FATAL: $1"
exit 0
fi
}

View File

@ -1,67 +0,0 @@
#!/bin/bash
#
#
# enabled debug
# set -x
#####################
# Main
####################
builder_main() {
# read config
call_entry_point builder_read_config_pre
builder_read_config
call_entry_point builder_read_config_post
# Check if the package is still build
if [ -z "$OPSI_REPOS_FORCE_UPLOAD" ] && [ -f ${OPSI_REPOS_PRODUCT_DIR}/${OPSI_REPOS_FILE_PATTERN} ] ; then
echo "ERROR: package ${OPSI_REPOS_PRODUCT_DIR}/${OPSI_REPOS_FILE_PATTERN} already generated"
exit 1
fi
# download and process dist files
call_entry_point builder_download_dist_files_pre
builder_download_dist_files
call_entry_point builder_download_dist_files_post
# Start building
call_entry_point builder_package_pre
builder_package
call_entry_point builder_package_post
# Upload to repos
call_entry_point builder_upload_pre
builder_upload
call_entry_point builder_upload_post
# git commit
call_entry_point builder_commit_pre
builder_commit
call_entry_point builder_commit_post
}
# get the 'real' directory this program stored in (resolve symbolic links)
PRG=$(readlink -f $0)
BASEDIR=`dirname "$PRG"`
BASEDIR=`cd "$BASEDIR" && pwd`
# read libraries
. $BASEDIR/builder-lib.sh
# check product directory
PRODUCT_DIR=$1
test -d $PRODUCT_DIR
builder_check_error "no opsi product directory specified: $PRODUCT_DIR"
# source additional, product dependent methods
if [ -f "$PRODUCT_DIR/build-extension.sh" ] ; then
. "$PRODUCT_DIR/build-extension.sh"
fi
# call main
builder_main
# exit
exit 0

View File

@ -1,28 +0,0 @@
############################
# Setup product information
############################
VENDOR="itwatch.de"
PN="itwatch"
VERSION="4.10.19"
RELEASE="1"
PRIORITY="0"
ADVICE=""
# Status integration, testing, release
STATUS="review"
#################
# Setup url for downloading the binaries
################
# all downloads should not have any traling parameters like ?downlaodid=1234 .....(should rewrite in python)
# You can setup many URL's separated by ";"
# Format: basename ; URL1 ; URL2 ; ...
ICON="itWatchLogo.jpg;http://www.itwatch.de/logos/itWatchLogo.jpg"
# Format: basename ; URL1 ; URL2 ; ...
FILE1="itWESS-Client_German.msi;http://ivyrepos.dtnet.de/v-$PN/itwatch/itwatch/4.10.19/itWESS-Client_German.msi;http://internal.graz.disconnected-by-peer.at/Orig/itWatch/itWESS/HB/4.10.19/itWESS-Client_German.msi"
FILE2="itWESS-64bit_German.msi;http://ivyrepos.dtnet.de/itwatch/itwatch/4.10.19/itWESS-64bit_German.msi;http://internal.graz.disconnected-by-peer.at/Orig/itWatch/itWESS/HB/4.10.19/itWESS-64bit_German.msi"