Compare commits
28 commits
Author | SHA1 | Date | |
---|---|---|---|
Stephan | 150bac828c | ||
Stephan | 932b659859 | ||
Stephan | 3b9f44a1b8 | ||
Stephan | e9a70c4ff3 | ||
Stephan | 40924e9aba | ||
Stephan | 7560d819f3 | ||
Stephan | 5bedaf71dc | ||
Stephan | 6da954447d | ||
Stephan | ced8107114 | ||
Stephan | 686b8d88f2 | ||
Stephan | f37b2c4756 | ||
Stephan | 78b401d32e | ||
Stephan | 5d8ae58a7a | ||
Stephan | bb2c2cb935 | ||
Stephan | 9ac4b8a855 | ||
Stephan | dee0ddee50 | ||
Stephan | b39261798b | ||
Stephan | 94c592d92c | ||
Stephan | 94f43c5a91 | ||
Stephan | 4e8344d343 | ||
Stephan | 2e4d1a9ca3 | ||
Stephan | 9cb5527f5b | ||
Stephan | 6eb314477b | ||
Stephan | a08d72b21c | ||
Stephan | bd746ecc05 | ||
Stephan | 10b0e57a12 | ||
Stephan | df550c193e | ||
8535cf6016 |
BIN
Build/app/bin/otrdecoder64_72
Normal file
|
@ -362,24 +362,24 @@ if [[ "$page" == "edit" ]]; then
|
|||
# SMARTRENDERING
|
||||
echo '
|
||||
<p>
|
||||
<label>Smartrendering</label>
|
||||
<label>Art zu Schneiden</label>
|
||||
<select name="SMARTRENDERING">'
|
||||
if [[ "$SMARTRENDERING" == "off" ]]; then
|
||||
echo '<option value="off" selected>aus</option>'
|
||||
echo '<option value="off" selected>Cut an Keyframes</option>'
|
||||
else
|
||||
echo '<option value="off">aus</option>'
|
||||
echo '<option value="off">Cut an Keyframes</option>'
|
||||
fi
|
||||
if [[ "$SMARTRENDERING" == "on" ]]; then
|
||||
echo '<option value="on" selected>ein</option>'
|
||||
echo '<option value="on" selected>Smartrendering</option>'
|
||||
else
|
||||
echo '<option value="on">ein</option>'
|
||||
echo '<option value="on">Smartrendering</option>'
|
||||
fi
|
||||
echo '
|
||||
</select>
|
||||
<a class="helpbox" href="#HELP">
|
||||
<img src="images/icon_information_mini@geimist.svg" height="25" width="25"/>
|
||||
<span>Für das Schneiden an Keyframes wird avisplit/avimerge aus Transcode verwendet. Diese Art geht sehr schnell (fast wie das Kopieren der Dateien auf der Festplatte). Der Nachteil ist, dass die Schnittübergänge um mehrere Sekunden ungenau sind und nur avi-Quelldateien scheidbar sind.
|
||||
<br><br>Für das framegenaue Schneiden wird das Programm avcut verwendet. Avcut schneidet im Gegensatz zu avisplit framegenau, allerdings ergeben sich daraus erhöhte Anforderungen an die CPU und RAM (min. installiert: 1GB für HD-Aufnahmen und 500MB für HQ-Aufnahmen). Framegenaue Schnitte sind zeitintensiv.
|
||||
<br><br>Smartrendering: Für das framegenaue Schneiden wird das Programm avcut verwendet. Avcut schneidet im Gegensatz zu avisplit framegenau, allerdings ergeben sich daraus erhöhte Anforderungen an die CPU und RAM (min. installiert: 1GB für HD-Aufnahmen und 500MB für HQ-Aufnahmen). Framegenaue Schnitte sind zeitintensiv.
|
||||
<br><br>ACHTUNG: mit avcut geschnittene Filme werden derzeit sehr asynchron. Die Option der Konvertierung zu MP4 löst das Problem!</span></a>
|
||||
</p>'
|
||||
# WaitOfCutlist
|
||||
|
@ -470,7 +470,7 @@ if [[ "$page" == "edit" ]]; then
|
|||
echo '
|
||||
<a class="helpbox" href="#HELP">
|
||||
<img src="images/icon_information_mini@geimist.svg" height="25" width="25"/>
|
||||
<span>Frameversatz, um Cuts manuell zu justieren (positive Werte verschieben jeden Cut nach hinten, negative nach vorn)<br><br>=> dieser Wert verschiebt den <b>Beginn</b> der gewünschten Filmteile beim framegenauen Schneiden</span></a>
|
||||
<span>Frameversatz, um Cuts manuell zu justieren (positive Werte verschieben jeden Cut nach hinten, negative nach vorn)<br><br>=> dieser Wert verschiebt den <b>Beginn</b> der gewünschten Filmteile beim framegenauen Schneiden<br><br>(greift nur in Verbindung mit Smartrendering)</span></a>
|
||||
</p>'
|
||||
# FrameversatzEndeCut
|
||||
echo '
|
||||
|
@ -484,7 +484,7 @@ if [[ "$page" == "edit" ]]; then
|
|||
echo '
|
||||
<a class="helpbox" href="#HELP">
|
||||
<img src="images/icon_information_mini@geimist.svg" height="25" width="25"/>
|
||||
<span>Frameversatz, um Cuts manuell zu justieren (positive Werte verschieben jeden Cut nach hinten, negative nach vorn)<br><br>=> dieser Wert verschiebt das <b>Ende</b> der gewünschten Filmteile beim framegenauen Schneiden</span></a>
|
||||
<span>Frameversatz, um Cuts manuell zu justieren (positive Werte verschieben jeden Cut nach hinten, negative nach vorn)<br><br>=> dieser Wert verschiebt das <b>Ende</b> der gewünschten Filmteile beim framegenauen Schneiden<br><br>(greift nur in Verbindung mit Smartrendering)</span></a>
|
||||
</p>
|
||||
</fieldset>
|
||||
</p>
|
||||
|
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 21 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2 KiB |
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 50 KiB |
Before Width: | Height: | Size: 3 KiB After Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 5.3 KiB After Width: | Height: | Size: 5.4 KiB |
Before Width: | Height: | Size: 8.1 KiB After Width: | Height: | Size: 8.2 KiB |
Before Width: | Height: | Size: 9.5 KiB After Width: | Height: | Size: 9.6 KiB |
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 39 KiB After Width: | Height: | Size: 50 KiB |
|
@ -2,3 +2,4 @@ s/Qüen/Queen/g
|
|||
s/qüen/queen/g
|
||||
s/Trü/True/g
|
||||
s/trü/true/g
|
||||
s/beqüm/bequem/g
|
||||
|
|
|
@ -8,8 +8,9 @@
|
|||
echo " -----------------------------------"
|
||||
echo -e
|
||||
|
||||
CLIENTVERSION=`get_key_value /var/packages/synOTR/INFO version`
|
||||
DevChannel="Release" # beta [2019-10-16]
|
||||
CLIENTVERSION=$(get_key_value /var/packages/synOTR/INFO version)
|
||||
set -E -o functrace # for function failure()
|
||||
DevChannel="Release" # beta [2023-06-11]
|
||||
|
||||
# ---------------------------------------------------------------------------------
|
||||
# GRUNDKONFIGRUATIONEN / INDIVIDUELLE ANPASSUNGEN / Standardwerte |
|
||||
|
@ -293,6 +294,18 @@
|
|||
#################################################################################################
|
||||
|
||||
|
||||
failure()
|
||||
{
|
||||
# this function show error line
|
||||
# --------------------------------------------------------------
|
||||
# https://unix.stackexchange.com/questions/462156/how-do-i-find-the-line-number-in-bash-when-an-error-occured
|
||||
local lineno=$1
|
||||
local msg=$2
|
||||
echo "Failed at $lineno: $msg"
|
||||
}
|
||||
trap 'failure ${LINENO} "$BASH_COMMAND"' ERR
|
||||
|
||||
|
||||
sec_to_time()
|
||||
{
|
||||
#########################################################################################
|
||||
|
@ -316,7 +329,7 @@ sec_to_time()
|
|||
MovieDB_query()
|
||||
{
|
||||
#########################################################################################
|
||||
# Diese Funktion sucht auf theTVDB.com nach Serieninformationen #
|
||||
# Diese Funktion sucht auf MovieDB.com nach Filminformationen #
|
||||
#########################################################################################
|
||||
|
||||
echo -e
|
||||
|
@ -647,7 +660,12 @@ if [ $decoderactiv = "on" ] && [ ! -z "$filetest" ] ; then
|
|||
echo -n " "; date
|
||||
|
||||
if [ $machinetyp = "x86_64" ]; then
|
||||
otrdecoderLOG=$(otrdecoder64 -q -i "$i" -o "$DECODIR" -e "$OTRuser" -p "$OTRpw" 2>&1)
|
||||
if [ "$(synogetkeyvalue /etc.defaults/VERSION buildnumber)" -ge 60000 ]; then
|
||||
# verwende passenden Decoder ab DSM7.2:
|
||||
otrdecoderLOG=$(otrdecoder64_72 -q -i "$i" -o "$DECODIR" -e "$OTRuser" -p "$OTRpw" 2>&1)
|
||||
else
|
||||
otrdecoderLOG=$(otrdecoder64 -q -i "$i" -o "$DECODIR" -e "$OTRuser" -p "$OTRpw" 2>&1)
|
||||
fi
|
||||
elif [ $machinetyp = "i686" ]; then
|
||||
otrdecoderLOG=$(otrdecoder32 -q -i "$i" -o "$DECODIR" -e "$OTRuser" -p "$OTRpw" 2>&1)
|
||||
elif [ `echo $machinetyp | grep "armv" ` ] ; then
|
||||
|
|
|
@ -1,5 +1,13 @@
|
|||
Release Notes
|
||||
|
||||
4.2.2 (2023-06-11)
|
||||
IMPLEMENTIERUNGEN:
|
||||
- OTR-Decoder (x86_64) für DSM7.2 ergänzt
|
||||
|
||||
4.2.1 (2021-05-11)
|
||||
IMPLEMENTIERUNGEN:
|
||||
- OTR-Decoder (x86_64) aktualisiert
|
||||
|
||||
4.2.0 (RELEASE)
|
||||
IMPLEMENTIERUNGEN:
|
||||
- die I/O-Priorität wurde herabgesetzt (möglicherweise nur auf x86_64 / i386 und ARMv7 ungetestet)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package="synOTR"
|
||||
displayname="synOTR"
|
||||
version="4.2.0"
|
||||
version="4.2.2"
|
||||
thirdparty="yes"
|
||||
description="SynOTR provides a workflow for TV recordings from onlineTVrecorder (OTR / https://onlinetvrecorder.com) for Synology NAS. synOTR performs *decoding *AC3-muxing (BETA) *cutting *MP4 conversion and *renaming (including Series information from www.thetvdb.com and www.otr-serien.de). onlineTVrecorder (OTR) is the free video recorder on the Internet that records almost all broadcasts from around 100 TV stations in Germany, USA, UK and other countries around the clock."
|
||||
description_enu="SynOTR provides a workflow for TV recordings from onlineTVrecorder (OTR / https://onlinetvrecorder.com) for Synology NAS. synOTR performs *decoding *AC3-muxing (BETA) *cutting *MP4 conversion and *renaming (including Series information from www.thetvdb.com and www.otr-serien.de). onlineTVrecorder (OTR) is the free video recorder on the Internet that records almost all broadcasts from around 100 TV stations in Germany, USA, UK and other countries around the clock."
|
||||
|
|
196
build_spk.sh
Executable file → Normal file
|
@ -3,7 +3,7 @@
|
|||
# Scriptaufruf:
|
||||
#----------------------------------------------------------------------------------------
|
||||
# erstellt das SPK aus dem aktuellen master-branch vom Server:
|
||||
# sh ./build_spk.sh
|
||||
# sh ./build_spk.sh
|
||||
#
|
||||
# erstellt das SPK aus dem als Parameter übergebenen Release vom Server:
|
||||
# sh ./build_spk.sh 4.0.7
|
||||
|
@ -11,161 +11,133 @@
|
|||
#----------------------------------------------------------------------------------------
|
||||
# Ordnerstruktur:
|
||||
#----------------------------------------------------------------------------------------
|
||||
# ./[NAME-DES-SPK]/Build --> Arbeitsumgebung (erstellen/editieren/verschieben)
|
||||
# ./[NAME-DES-SPK]/Pack --> Archivordner zum Aufbau des SPK (Startscripte etc.)
|
||||
# ./APP / Build --> Arbeitsumgebung (erstellen/editieren/verschieben)
|
||||
# ./PKG / Pack --> Archivordner zum Aufbau des SPK (Startscripte etc.)
|
||||
#
|
||||
|
||||
set -euo pipefail
|
||||
IFS=$'\n\t'
|
||||
|
||||
build_tmp=$(mktemp -d -t tmp.XXXXXXXXXX)
|
||||
|
||||
function finish {
|
||||
git worktree remove --force "$build_tmp"
|
||||
rm -rf "$build_tmp"
|
||||
}
|
||||
trap finish EXIT
|
||||
|
||||
#######
|
||||
|
||||
project="synOTR"
|
||||
|
||||
skriptuser=`whoami`
|
||||
if [ ${skriptuser} != "root" ]; then
|
||||
echo "Dieses Skript muss von Root ausgeführt werden!"
|
||||
exit 1
|
||||
#######
|
||||
|
||||
if ! [ -x "$(command -v git)" ]; then
|
||||
echo 'Error: git is not installed.' >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! [ -x "$(command -v fakeroot)" ]; then
|
||||
if [ $(whoami) != "root" ]; then
|
||||
echo "WARNUNG: fakeroot ist nicht installiert und du bist auch nicht root!" >&2
|
||||
exit 1
|
||||
else
|
||||
FAKEROOT=""
|
||||
fi
|
||||
else
|
||||
FAKEROOT=$(command -v fakeroot)
|
||||
fi
|
||||
|
||||
# Arbeitsverzeichnis auslesen und hineinwechseln:
|
||||
# ---------------------------------------------------------------------
|
||||
APPDIR=$(cd $(dirname $0);pwd)
|
||||
cd ${APPDIR}
|
||||
# shellcheck disable=SC2086
|
||||
APPDIR=$(cd "$(dirname $0)";pwd)
|
||||
cd "${APPDIR}"
|
||||
|
||||
build_tmp="${APPDIR}/build_tmp"
|
||||
dir=${APPDIR}
|
||||
buildversion=$1
|
||||
git pull # aktualisieren
|
||||
|
||||
buildversion=${1:-latest}
|
||||
taggedversions=$(git tag)
|
||||
|
||||
echo " - INFO: Erstelle den temporären Buildordner und kopiere Sourcen hinein ..."
|
||||
|
||||
git worktree add --force "$build_tmp" "$(git rev-parse --abbrev-ref HEAD)"
|
||||
pushd "$build_tmp"
|
||||
#set_spk_version="latest-$(date +%s)-$(git log -1 --format="%h")"
|
||||
set_spk_version="$(git branch --show-current)_latest_($(date +%Y)-$(date +%m)-$(date +%d)_$(date +%H)-$(date +%M))_$(git log -1 --format="%h")"
|
||||
|
||||
|
||||
if [ -d "./${project}" ] ; then
|
||||
rm -rf "./${project}"
|
||||
fi
|
||||
|
||||
|
||||
|
||||
|
||||
gitpull()
|
||||
{
|
||||
|
||||
gitpath=`which git`
|
||||
if [ -z ${gitpath} ]; then
|
||||
echo "Das Programm git konnte nicht gefunden werden."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Ausführung: Erstellen des SPK
|
||||
echo ""
|
||||
echo "-----------------------------------------------------------------------------------"
|
||||
echo " git holt die aktuelle Version ..."
|
||||
echo "-----------------------------------------------------------------------------------"
|
||||
|
||||
if [ -d "./${project}" ] ; then
|
||||
cd ${project}
|
||||
git pull
|
||||
versions=`git tag`
|
||||
cd ${APPDIR}
|
||||
if echo "$taggedversions" | egrep -q "$buildversion"; then
|
||||
echo "git checkout zu $buildversion"
|
||||
git checkout "$buildversion"
|
||||
set_spk_version="$buildversion"
|
||||
else
|
||||
git clone https://geimist.eu:30443/geimist/${project}.git
|
||||
cd ${project}
|
||||
git pull
|
||||
versions=`git tag`
|
||||
cd ${APPDIR}
|
||||
echo "ACHTUNG: Die gewünschte Version wurde im Repository nicht gefunden!"
|
||||
echo "Die $(git rev-parse --abbrev-ref HEAD)-branch wird verwendet!"
|
||||
fi
|
||||
|
||||
|
||||
#build_version=`cat "${APPDIR}/${project}/Pack/INFO" | grep version | awk -F '"' '{print $2}'`
|
||||
|
||||
# welche Version soll gebaut werden:
|
||||
if [ -z $buildversion ]; then
|
||||
echo "git checkout zu master-branch"
|
||||
cd ${project}
|
||||
git checkout master
|
||||
cd ${APPDIR}
|
||||
set_spk_version="latest_(`date +%Y`-`date +%m`-`date +%d`_`date +%H`-`date +%M`)"
|
||||
# fallback to old app dir
|
||||
if [ -d "$build_tmp"/Build ]; then
|
||||
APP=Build
|
||||
else
|
||||
if echo "$versions" | egrep -q "$buildversion"; then
|
||||
echo "git checkout zu $buildversion"
|
||||
cd ${project}
|
||||
git checkout "$buildversion"
|
||||
set_spk_version="$buildversion"
|
||||
cd ${APPDIR}
|
||||
else
|
||||
echo "ACHTUNG: Die gewünschte Version wurde im Repository nicht gefunden!"
|
||||
echo "Der master-branch wird verwendet!"
|
||||
cd ${project}
|
||||
git checkout master
|
||||
cd ${APPDIR}
|
||||
set_spk_version="latest_(`date +%Y`-`date +%m`-`date +%d`_`date +%H`-`date +%M`)"
|
||||
fi
|
||||
APP=APP
|
||||
fi
|
||||
}
|
||||
|
||||
gitpull
|
||||
|
||||
build_version=$(get_key_value "${APPDIR}/${project}/Pack/INFO" version )
|
||||
# fallback to old pkg dir
|
||||
if [ -d "$build_tmp"/Pack ]; then
|
||||
PKG=Pack
|
||||
else
|
||||
PKG=PKG
|
||||
fi
|
||||
|
||||
build_version=$(grep version "$build_tmp/$PKG/INFO" | awk -F '"' '{print $2}')
|
||||
#set_spk_version=$build_version
|
||||
|
||||
echo " - INFO: Es wird foldende Version geladen und gebaut: $set_spk_version - BUILD-Version (INFO-File): $build_version"
|
||||
|
||||
echo " - INFO: Erstelle den temporären Buildordner und kopiere Sourcen hinein ..."
|
||||
if [ -d "./build_tmp" ] ; then
|
||||
rm -rf "./build_tmp"
|
||||
fi
|
||||
mkdir "${build_tmp}"
|
||||
|
||||
cp -r "${APPDIR}/${project}"/* "${build_tmp}/"
|
||||
|
||||
# Ausführung: Erstellen des SPK
|
||||
echo ""
|
||||
echo "-----------------------------------------------------------------------------------"
|
||||
echo " SPK wird erstellt..."
|
||||
echo "-----------------------------------------------------------------------------------"
|
||||
echo ""
|
||||
echo "-----------------------------------------------------------------------------------"
|
||||
echo " SPK wird erstellt..."
|
||||
echo "-----------------------------------------------------------------------------------"
|
||||
|
||||
# Falls versteckter Ordners /.helptoc vorhanden, diesen nach /helptoc umbenennen
|
||||
if test -d "${build_tmp}/.helptoc"; then
|
||||
echo ""
|
||||
echo " - INFO: Versteckter Ordner /.helptoc wurde lokalisiert und nach /helptoc umbenannt"
|
||||
mv ${build_tmp}/.helptoc ${build_tmp}/helptoc
|
||||
fi
|
||||
if test -d "${build_tmp}/.helptoc"; then
|
||||
echo ""
|
||||
echo " - INFO: Versteckter Ordner /.helptoc wurde lokalisiert und nach /helptoc umbenannt"
|
||||
mv "${build_tmp}/.helptoc" "${build_tmp}/helptoc"
|
||||
fi
|
||||
|
||||
# Rechte anpassen
|
||||
echo ""
|
||||
echo " - INFO: Dateirechte anpassen ..."
|
||||
for i in $(find "${build_tmp}/Pack/" -type f)
|
||||
for i in $(find "${build_tmp}/$APP/" -type f)
|
||||
do
|
||||
# echo "ändere Pack: $i"
|
||||
# echo "ändere $APP: $i"
|
||||
chmod 755 "$i"
|
||||
chown root:root "$i"
|
||||
done
|
||||
|
||||
for i in $(find "${build_tmp}/Build/" -type f)
|
||||
for i in $(find "${build_tmp}/$PKG/" -type f)
|
||||
do
|
||||
# echo "ändere Build: $i"
|
||||
# echo "ändere $PKG: $i"
|
||||
chmod 755 "$i"
|
||||
chown root:root "$i"
|
||||
done
|
||||
|
||||
# Packen und Ablegen der aktuellen Installation in den entsprechenden /Pack - Ordner
|
||||
echo ""
|
||||
echo " - INFO: Das Archiv package.tgz wird erstellt..."
|
||||
|
||||
tar -C ${build_tmp}/Build -czf ${build_tmp}/Pack/package.tgz .
|
||||
|
||||
echo ""
|
||||
echo " - INFO: Das Archiv package.tgz wird erstellt..."
|
||||
|
||||
$FAKEROOT tar -C "${build_tmp}"/"$APP" -czf "${build_tmp}"/"$PKG"/package.tgz .
|
||||
|
||||
# Wechsel in den Ablageort von package.tgz bezüglich Aufbau des SPK's
|
||||
cd ${build_tmp}/Pack
|
||||
cd "${build_tmp}"/"$PKG"
|
||||
|
||||
# Erstellen des eigentlichen SPK's
|
||||
echo ""
|
||||
echo " - INFO: Das SPK wird erstellt..."
|
||||
tar -cf ${project}_$set_spk_version.spk *
|
||||
mv ${project}_$set_spk_version.spk ${APPDIR}
|
||||
|
||||
# Löschen der temporären Daten
|
||||
echo ""
|
||||
echo " - INFO: Der temporäre Ordner wird wieder geschlöscht ..."
|
||||
cd ${APPDIR}
|
||||
if [ -d "./build_tmp" ] ; then
|
||||
rm -rf "./build_tmp"
|
||||
fi
|
||||
echo ""
|
||||
echo " - INFO: Das SPK wird erstellt..."
|
||||
$FAKEROOT tar -cf "${project}"_"$set_spk_version".spk *
|
||||
cp -f "${project}"_"$set_spk_version".spk "${APPDIR}"
|
||||
|
||||
echo ""
|
||||
echo "-----------------------------------------------------------------------------------"
|
||||
|
|
178
build_spk_[v1].sh
Executable file
|
@ -0,0 +1,178 @@
|
|||
#!/bin/bash
|
||||
#----------------------------------------------------------------------------------------
|
||||
# Scriptaufruf:
|
||||
#----------------------------------------------------------------------------------------
|
||||
# erstellt das SPK aus dem aktuellen master-branch vom Server:
|
||||
# sh ./build_spk.sh
|
||||
#
|
||||
# erstellt das SPK aus dem als Parameter übergebenen Release vom Server:
|
||||
# sh ./build_spk.sh 4.0.7
|
||||
#
|
||||
#----------------------------------------------------------------------------------------
|
||||
# Ordnerstruktur:
|
||||
#----------------------------------------------------------------------------------------
|
||||
# ./[NAME-DES-SPK]/Build --> Arbeitsumgebung (erstellen/editieren/verschieben)
|
||||
# ./[NAME-DES-SPK]/Pack --> Archivordner zum Aufbau des SPK (Startscripte etc.)
|
||||
#
|
||||
|
||||
project="synOTR"
|
||||
|
||||
skriptuser=`whoami`
|
||||
if [ ${skriptuser} != "root" ]; then
|
||||
echo "Dieses Skript muss von Root ausgeführt werden!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Arbeitsverzeichnis auslesen und hineinwechseln:
|
||||
# ---------------------------------------------------------------------
|
||||
APPDIR=$(cd $(dirname $0);pwd)
|
||||
cd ${APPDIR}
|
||||
|
||||
build_tmp="${APPDIR}/build_tmp"
|
||||
dir=${APPDIR}
|
||||
buildversion=$1
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if [ -d "./${project}" ] ; then
|
||||
rm -rf "./${project}"
|
||||
fi
|
||||
|
||||
|
||||
|
||||
|
||||
gitpull()
|
||||
{
|
||||
|
||||
gitpath=`which git`
|
||||
if [ -z ${gitpath} ]; then
|
||||
echo "Das Programm git konnte nicht gefunden werden."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Ausführung: Erstellen des SPK
|
||||
echo ""
|
||||
echo "-----------------------------------------------------------------------------------"
|
||||
echo " git holt die aktuelle Version ..."
|
||||
echo "-----------------------------------------------------------------------------------"
|
||||
|
||||
if [ -d "./${project}" ] ; then
|
||||
cd ${project}
|
||||
git pull
|
||||
versions=`git tag`
|
||||
cd ${APPDIR}
|
||||
else
|
||||
git clone https://geimist.eu:30443/geimist/${project}.git
|
||||
cd ${project}
|
||||
git pull
|
||||
versions=`git tag`
|
||||
cd ${APPDIR}
|
||||
fi
|
||||
|
||||
|
||||
#build_version=`cat "${APPDIR}/${project}/Pack/INFO" | grep version | awk -F '"' '{print $2}'`
|
||||
|
||||
# welche Version soll gebaut werden:
|
||||
if [ -z $buildversion ]; then
|
||||
echo "git checkout zu master-branch"
|
||||
cd ${project}
|
||||
git checkout master
|
||||
cd ${APPDIR}
|
||||
set_spk_version="latest_(`date +%Y`-`date +%m`-`date +%d`_`date +%H`-`date +%M`)"
|
||||
else
|
||||
if echo "$versions" | egrep -q "$buildversion"; then
|
||||
echo "git checkout zu $buildversion"
|
||||
cd ${project}
|
||||
git checkout "$buildversion"
|
||||
set_spk_version="$buildversion"
|
||||
cd ${APPDIR}
|
||||
else
|
||||
echo "ACHTUNG: Die gewünschte Version wurde im Repository nicht gefunden!"
|
||||
echo "Der master-branch wird verwendet!"
|
||||
cd ${project}
|
||||
git checkout master
|
||||
cd ${APPDIR}
|
||||
set_spk_version="latest_(`date +%Y`-`date +%m`-`date +%d`_`date +%H`-`date +%M`)"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
gitpull
|
||||
|
||||
build_version=$(get_key_value "${APPDIR}/${project}/Pack/INFO" version )
|
||||
|
||||
|
||||
echo " - INFO: Es wird foldende Version geladen und gebaut: $set_spk_version - BUILD-Version (INFO-File): $build_version"
|
||||
|
||||
echo " - INFO: Erstelle den temporären Buildordner und kopiere Sourcen hinein ..."
|
||||
if [ -d "./build_tmp" ] ; then
|
||||
rm -rf "./build_tmp"
|
||||
fi
|
||||
mkdir "${build_tmp}"
|
||||
|
||||
cp -r "${APPDIR}/${project}"/* "${build_tmp}/"
|
||||
|
||||
# Ausführung: Erstellen des SPK
|
||||
echo ""
|
||||
echo "-----------------------------------------------------------------------------------"
|
||||
echo " SPK wird erstellt..."
|
||||
echo "-----------------------------------------------------------------------------------"
|
||||
|
||||
# Falls versteckter Ordners /.helptoc vorhanden, diesen nach /helptoc umbenennen
|
||||
if test -d "${build_tmp}/.helptoc"; then
|
||||
echo ""
|
||||
echo " - INFO: Versteckter Ordner /.helptoc wurde lokalisiert und nach /helptoc umbenannt"
|
||||
mv ${build_tmp}/.helptoc ${build_tmp}/helptoc
|
||||
fi
|
||||
|
||||
# Rechte anpassen
|
||||
echo ""
|
||||
echo " - INFO: Dateirechte anpassen ..."
|
||||
for i in $(find "${build_tmp}/Pack/" -type f)
|
||||
do
|
||||
# echo "ändere Pack: $i"
|
||||
chmod 755 "$i"
|
||||
chown root:root "$i"
|
||||
done
|
||||
|
||||
for i in $(find "${build_tmp}/Build/" -type f)
|
||||
do
|
||||
# echo "ändere Build: $i"
|
||||
chmod 755 "$i"
|
||||
chown root:root "$i"
|
||||
done
|
||||
|
||||
# Packen und Ablegen der aktuellen Installation in den entsprechenden /Pack - Ordner
|
||||
echo ""
|
||||
echo " - INFO: Das Archiv package.tgz wird erstellt..."
|
||||
|
||||
tar -C ${build_tmp}/Build -czf ${build_tmp}/Pack/package.tgz .
|
||||
|
||||
# Wechsel in den Ablageort von package.tgz bezüglich Aufbau des SPK's
|
||||
cd ${build_tmp}/Pack
|
||||
|
||||
# Erstellen des eigentlichen SPK's
|
||||
echo ""
|
||||
echo " - INFO: Das SPK wird erstellt..."
|
||||
tar -cf ${project}_$set_spk_version.spk *
|
||||
mv ${project}_$set_spk_version.spk ${APPDIR}
|
||||
|
||||
# Löschen der temporären Daten
|
||||
echo ""
|
||||
echo " - INFO: Der temporäre Ordner wird wieder geschlöscht ..."
|
||||
cd ${APPDIR}
|
||||
if [ -d "./build_tmp" ] ; then
|
||||
rm -rf "./build_tmp"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "-----------------------------------------------------------------------------------"
|
||||
echo " Das SPK wurde erstellt und befindet sich unter..."
|
||||
echo "-----------------------------------------------------------------------------------"
|
||||
echo ""
|
||||
echo " ${APPDIR}/${project}_$set_spk_version.spk"
|
||||
echo ""
|
||||
|
||||
exit 0
|