aboutsummaryrefslogtreecommitdiff
path: root/setup/package.sh
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2018-09-15 11:29:01 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2018-09-15 11:29:01 +1200
commit2fb444df86d56246a8b5cee515eb91490c8dee05 (patch)
treeca1796dfe137184b6381fefeba0f7de4e26d7dd7 /setup/package.sh
parent363ca19cb2ac1b56e3db8f38c89cf61c73806462 (diff)
downloadtrackermap-server-2fb444df86d56246a8b5cee515eb91490c8dee05.tar.gz
trackermap-server-2fb444df86d56246a8b5cee515eb91490c8dee05.tar.bz2
trackermap-server-2fb444df86d56246a8b5cee515eb91490c8dee05.zip
More work on service implementation
Diffstat (limited to 'setup/package.sh')
-rwxr-xr-xsetup/package.sh59
1 files changed, 4 insertions, 55 deletions
diff --git a/setup/package.sh b/setup/package.sh
index 2534a3457..ed897c201 100755
--- a/setup/package.sh
+++ b/setup/package.sh
@@ -23,18 +23,13 @@ check_requirement () {
}
check_requirement "ls ../../ext-6.2.0" "Missing ../../ext-6.2.0 (https://www.sencha.com/legal/GPL/)"
-check_requirement "ls yajsw-*.zip" "Missing yajsw-*.zip (https://sourceforge.net/projects/yajsw/files/)"
check_requirement "ls innosetup-*.exe" "Missing isetup-*.exe (http://www.jrsoftware.org/isdl.php)"
check_requirement "which sencha" "Missing sencha cmd package (https://www.sencha.com/products/extjs/cmd-download/)"
check_requirement "which wine" "Missing wine package"
check_requirement "which innoextract" "Missing innoextract package"
check_requirement "which makeself" "Missing makeself package"
-check_requirement "which dos2unix" "Missing dos2unix package"
prepare () {
- unzip yajsw-*.zip
- mv yajsw-*/ yajsw/
-
../traccar-web/tools/minify.sh
innoextract innosetup-*.exe
@@ -42,50 +37,11 @@ prepare () {
}
cleanup () {
- rm -r yajsw/
-
rm ../traccar-web/web/app.min.js
rm -r app/
}
-copy_wrapper () {
- cp yajsw/$1/setenv* out/$1
- cp yajsw/$1/wrapper* out/$1
- cp yajsw/$1/install* out/$1
- cp yajsw/$1/start* out/$1
- cp yajsw/$1/stop* out/$1
- cp yajsw/$1/uninstall* out/$1
-
- chmod +x out/$1/*
-
- cp yajsw/conf/wrapper.conf.default out/conf
-
- touch out/conf/wrapper.conf
- echo "wrapper.java.command=java" >> out/conf/wrapper.conf
- echo "wrapper.java.app.jar=tracker-server.jar" >> out/conf/wrapper.conf
- echo "wrapper.app.parameter.1=./conf/traccar.xml" >> out/conf/wrapper.conf
- echo "wrapper.java.additional.1=-Dfile.encoding=UTF-8" >> out/conf/wrapper.conf
- echo "wrapper.logfile=logs/wrapper.log.YYYYMMDD" >> out/conf/wrapper.conf
- echo "wrapper.logfile.rollmode=DATE" >> out/conf/wrapper.conf
- echo "wrapper.ntservice.name=traccar" >> out/conf/wrapper.conf
- echo "wrapper.ntservice.displayname=Traccar" >> out/conf/wrapper.conf
- echo "wrapper.ntservice.description=Traccar" >> out/conf/wrapper.conf
- echo "wrapper.daemon.run_level_dir=\${if (new File('/etc/rc0.d').exists()) return '/etc/rcX.d' else return '/etc/init.d/rcX.d'}" >> out/conf/wrapper.conf
-
- cp -r yajsw/lib/* out/lib
- find out/lib -type f -name ReadMe.txt -exec rm -f {} \;
-
- cp yajsw/templates/* out/templates
-
- cp yajsw/wrapper*.jar out
-
- if which xattr &>/dev/null
- then
- xattr -dr com.apple.quarantine out
- fi
-}
-
copy_files () {
cp ../target/tracker-server.jar out
cp ../target/lib/* out/lib
@@ -97,9 +53,8 @@ copy_files () {
}
package_windows () {
- mkdir -p out/{bat,conf,data,lib,logs,web,schema,templates}
+ mkdir -p out/{conf,data,lib,logs,web,schema,templates}
- copy_wrapper "bat"
copy_files
wine app/ISCC.exe traccar.iss
@@ -112,20 +67,15 @@ package_windows () {
}
package_unix () {
- mkdir -p out/{bin,conf,data,lib,logs,web,schema,templates}
-
- copy_wrapper "bin"
- sed -i.bak "1s/.*/#\!\/usr\/bin\/env bash/" out/bin/stopDaemonNoPriv.sh
- rm out/bin/stopDaemonNoPriv.sh.bak
- find out -type f \( -name \*.sh -o -name \*.vm \) -print0 | xargs -0 dos2unix
+ mkdir -p out/{conf,data,lib,logs,web,schema,templates}
copy_files
cp java-test/test.jar out
cp setup.sh out
+ cp other/traccar.service out
makeself --notemp out traccar.run "traccar" ./setup.sh
zip -j traccar-linux-$VERSION.zip traccar.run README.txt
- cp traccar-linux-$VERSION.zip traccar-macos-$VERSION.zip
rm traccar.run
rm -r out
@@ -137,8 +87,7 @@ package_universal () {
copy_files
cp README.txt out
- cp other/traccar.sh out
-
+
cd out
zip -r ../traccar-other-$VERSION.zip *
cd ..