-
Notifications
You must be signed in to change notification settings - Fork 111
/
Copy pathMakefile
485 lines (456 loc) · 18.1 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
##############################################################################
#
# Makefile for building Open Hospital release packages.
#
# To list the available targets issue: make help
# The following environment variables can be set before running make:
# -> OH_VERSION: Open Hospital version
#
##############################################################################
SHELL := /bin/bash
.SHELLFLAGS := -eu -o pipefail -c
.ONESHELL: # single recipes are run in one bash session, instead of one per line
.DELETE_ON_ERROR: # delete the target if its recipe failed
##############################################################################
# Open Hospital version
OH_VERSION ?= $(shell git describe --abbrev=0 --tags)
RELEASE_DATE := $(shell date +'%d/%m/%Y')
# software distribution
CLIENT := OpenHospital-$(OH_VERSION)-multiarch-client
WIN32 := OpenHospital-$(OH_VERSION)-windows_i686-portable
WIN64 := OpenHospital-$(OH_VERSION)-windows_x86_64-portable
LINUX32 := OpenHospital-$(OH_VERSION)-linux_i686-portable
LINUX64 := OpenHospital-$(OH_VERSION)-linux_x86_64-portable
FULLDISTRO := OpenHospital-$(OH_VERSION)-x86_64-EXPERIMENTAL
# JAVA and MySQL / MariaDB
# download url
JAVA_URL := https://cdn.azul.com/zulu/bin
#MYSQL_URL := https://downloads.mariadb.com/MariaDB/
MYSQL_URL := https://archive.mariadb.org
# software versions
JRE_32_VER := zulu17.48.15-ca-jre17.0.10
JRE_64_VER := zulu17.48.15-ca-jre17.0.10
MYSQL_WIN32_VER := 10.6.5
MYSQL_WIN64_VER := 10.6.16
MYSQL_LINUX32_VER := 10.5.23
MYSQL_LINUX64_VER := 10.6.16
# help file
TXTFILE := OH-readme.txt
# oh api jar
OH_API_JAR := openhospital-api-0.1.0.jar
# internal variables
JRE_WIN32 := $(JRE_32_VER)-win_i686.zip
JRE_WIN64 := $(JRE_64_VER)-win_x64.zip
JRE_LINUX32 := $(JRE_32_VER)-linux_i686.tar.gz
JRE_LINUX64 := $(JRE_64_VER)-linux_x64.tar.gz
MYSQL_WIN32 := mariadb-$(MYSQL_WIN32_VER)-win32.zip
MYSQL_WIN64 := mariadb-$(MYSQL_WIN64_VER)-winx64.zip
MYSQL_LINUX32 := mariadb-$(MYSQL_LINUX32_VER)-linux-i686.tar.gz
MYSQL_LINUX64 := mariadb-$(MYSQL_LINUX64_VER)-linux-systemd-x86_64.tar.gz
####################################################################
# targets
.PHONY: clean clean-releases clone-all compile-all build-all
####################################################################
# default target -> all
all: clone-all compile-all release-files
####################################################################
help:
@echo -e "----------------------------"
@echo -e "---> Usage: make [target]"
@echo -e ""
@echo -e "Main targets available:"
@echo -e "\tall (default), clean, clone-all, compile-all, build-all, release-files"
@echo -e ""
@echo -e "Clone targets:"
@echo -e "\tclone-[core|gui|ui|api|doc]"
@echo -e ""
@echo -e "Compile targets:"
@echo -e "\tcompile-[core|gui|ui|api|doc]"
@echo -e ""
@echo -e "Build (clone + compile) targets:"
@echo -e "\tbuild-[core|gui|ui|api|doc]"
@echo -e ""
@echo -e "EXPERIMENTAL - Build full distro (full release core+gui+ui+api for Linux and Windows"
@echo -e "\trelease-full-distro"
@echo -e ""
@echo -e "Documentation targets:"
@echo -e "\tcompile-doc, admin-manual, user-manual, readme, release-notes, contributors"
@echo -e ""
@echo -e "OH release-files targets:"
@echo -e "\t$(CLIENT).zip"
@echo -e "\t$(WIN32).zip"
@echo -e "\t$(WIN64).zip"
@echo -e "\t$(LINUX32).tar.gz"
@echo -e "\t$(LINUX64).tar.gz"
@echo -e ""
####################################################################
# Clean targets
clean: clean-repos clean-downloads clean-releases
clean-repos:
rm -rf openhospital-core openhospital-gui openhospital-ui openhospital-api openhospital-doc
clean-downloads:
rm -rf zulu*.zip zulu*.tar.gz mariadb*.zip mariadb*.tar.gz
clean-releases:
rm -rf OpenHospital-$(OH_VERSION)* RELEASE_NOTES RELEASE_NOTES.md CONTRIBUTORS* *.pdf
clean-all:
git clean -xdff
####################################################################
# Clone targets
clone-all: clone-core clone-gui clone-ui clone-api clone-doc
####################################################################
# Compile targets
compile-all: compile-core compile-gui compile-ui compile-api compile-doc
####################################################################
# Build targets
build-all: build-core build-ui build-api build-doc
####################################################################
# Build (clone + compile) targets
build-core: clone-core compile-core
build-gui: clone-gui compile-gui
build-ui: clone-ui compile-ui
build-api: clone-api build-core compile-api
build-doc: clone-doc compile-doc
####################################################################
# Assemble release targets
release-files: $(CLIENT).zip $(WIN32).zip $(WIN64).zip $(LINUX32).tar.gz $(LINUX64).tar.gz $(FULLDISTRO).zip release-contributors
# EXPERIMENTAL - release full distro
release-full-distro: build-core build-ui build-api build-gui build-doc $(FULLDISTRO).zip
####################################################################
# Clone repositories of OH components
clone-core:
if [ -d "openhospital-core" ]; then cd openhospital-core; git checkout -B $(OH_VERSION); git pull;
else
git clone --depth=1 -b $(OH_VERSION) https://github.com/informatici/openhospital-core.git openhospital-core
#git clone https://github.com/informatici/openhospital-core.git openhospital-core
fi
clone-gui:
if [ -d "openhospital-gui" ]; then cd openhospital-gui; git checkout -B $(OH_VERSION); git pull;
else
git clone --depth=1 -b $(OH_VERSION) https://github.com/informatici/openhospital-gui.git openhospital-gui
#git clone https://github.com/informatici/openhospital-gui.git openhospital-gui
fi
clone-ui:
if [ -d "openhospital-ui" ]; then cd openhospital-ui; git checkout -B $(OH_VERSION); git pull;
else
git clone --depth=1 -b $(OH_VERSION) https://github.com/informatici/openhospital-ui.git openhospital-ui
#git clone https://github.com/informatici/openhospital-ui.git openhospital-ui
fi
clone-api:
if [ -d "openhospital-api" ]; then cd openhospital-api; git checkout -B $(OH_VERSION); git pull;
else
git clone --depth=1 -b $(OH_VERSION) https://github.com/informatici/openhospital-api.git openhospital-api
#git clone https://github.com/informatici/openhospital-api.git openhospital-api
fi
clone-doc:
if [ -d "openhospital-doc" ]; then cd openhospital-doc; git checkout -B $(OH_VERSION); git pull;
else
git clone --depth=1 -b $(OH_VERSION) https://github.com/informatici/openhospital-doc.git
fi
####################################################################
# Compile application binaries
# OH Core
compile-core:
pushd openhospital-core
#git checkout $(OH_VERSION) -b $(OH_VERSION)
mvn --quiet -T 1.5C install
popd
# OH GUI
compile-gui:
pushd openhospital-gui
mvn --quiet -T 1.5C install
popd
# Web UI
compile-ui:
pushd openhospital-ui
# show npm version
npm -v
npm install
#npm audit fix
#npx update-browserslist-db@latest
# workaround to replace hardcode URL
sed -i "s/https\:\/\/oh2.open-hospital.org/http:\/\/localhost\:8080/g" ./src/generated/runtime.ts
# workaround to replace default hospital name
sed -i "s/Princeton-Plainsboro\ Teaching\ Hospital/St\.\ Luke\ Hospital\ Angal/g" ./src/components/accessories/appHeader/AppHeader.tsx
sed -i "s/Princeton-Plainsboro\ Teaching\ Hospital/St\.\ Luke\ Hospital\ Angal/g" ./src/components/activities/loginActivity/LoginActivity.tsx
# build
npm run build
popd
# Web API
compile-api:
pushd openhospital-api
mvn --quiet -T 1.5C install
popd
####################################################################
# Generate documentation
compile-doc: admin-manual user-manual readme contributors release-notes
# manuals
admin-manual:
asciidoctor-pdf ./openhospital-doc/doc_admin/AdminManual.adoc -a allow-uri-read -o AdminManual.pdf -v
user-manual:
asciidoctor-pdf ./openhospital-doc/doc_user/UserManual.adoc -o UserManual.pdf -v
readme:
pushd oh-bundle
echo "OH - Open Hospital Client | Portable " > $(TXTFILE)
tail -n+2 OH-README.md >> $(TXTFILE)
sed /\`\`/d -i $(TXTFILE)
popd
####################################################################
# Generate contributors file
contributors:
# OH Core
pushd openhospital-core
# git log --pretty="%aN <%aE>%n%cN <%cE>" | sort | uniq > ../CONTRIBUTORS.tmp
curl -s https://api.github.com/repos/informatici/openhospital-core/contributors?anon=0 | grep -e name -e login > ../CONTRIBUTORS.tmp
popd
# OH GUI
pushd openhospital-gui
# git log --pretty="%aN <%aE>%n%cN <%cE>" | sort | uniq >> ../CONTRIBUTORS.tmp
curl -s https://api.github.com/repos/informatici/openhospital-gui/contributors?anon=0 | grep -e name -e login >> ../CONTRIBUTORS.tmp
popd
# Web UI
pushd openhospital-gui
# git log --pretty="%aN <%aE>%n%cN <%cE>" | sort | uniq >> ../CONTRIBUTORS.tmp
curl -s https://api.github.com/repos/informatici/openhospital-ui/contributors?anon=0 | grep -e name -e login >> ../CONTRIBUTORS.tmp
popd
# Web API
pushd openhospital-api
# git log --pretty="%aN <%aE>%n%cN <%cE>" | sort | uniq >> ../CONTRIBUTORS.tmp
curl -s https://api.github.com/repos/informatici/openhospital-api/contributors?anon=0 | grep -e name -e login >> ../CONTRIBUTORS.tmp
popd
# OH doc
pushd openhospital-doc
# git log --pretty="%aN <%aE>%n%cN <%cE>" | sort | uniq >> ../CONTRIBUTORS.tmp
curl -s https://api.github.com/repos/informatici/openhospital-doc/contributors?anon=0 | grep -e name -e login >> ../CONTRIBUTORS.tmp
popd
# generate final file
# # cat CONTRIBUTORS | sed -e s/^[^@]*//g
# sed -e -e s/^.*\"name\"\:\ \"//g -e s/^.*\:\ \"/@/g -e s/\"\,//g -i CONTRIBUTORS.tmp # working alternative
sed -e s/^.*\"name\"\:\ \"//g -e s/^.*\"login\"\:\ \"/@/g -e s/\"\,//g -i CONTRIBUTORS.tmp
cat ./CONTRIBUTORS.tmp | sort -u > CONTRIBUTORS
####################################################################
# Generate release notes file
release-notes:
# add OH version
pushd openhospital-core
lasttag=$(shell git tag -l --sort=-v:refname | head -1)
secondlasttag=$(shell git tag -l --sort=-v:refname | head -2 | tail -n 1)
popd
cp RELEASE_NOTES_TEMPLATE.md RELEASE_NOTES.md
sed -i "s/VERSION/$(OH_VERSION)/g" RELEASE_NOTES.md
sed -i "s/SECONDLASTTAG/$${secondlasttag//$$'\n'/\\n}/g" RELEASE_NOTES.md
sed -i "s/LASTTAG/$${lasttag//$$'\n'/\\n}/g" RELEASE_NOTES.md
sed -i "s|RELEASE_DATE|$(RELEASE_DATE)|g" RELEASE_NOTES.md
head -6 RELEASE_NOTES.md > RELEASE_NOTES
####################################################################
# Generate final release notes file with cheksums and contributors
release-checksums: release-notes
# add SHA256 checksum section
echo "<details>" >> RELEASE_NOTES.md
echo "<summary> SHA256 release packages checksums (click to expand) </summary>" >> RELEASE_NOTES.md
echo "" >> RELEASE_NOTES.md
echo "\`\`\`" >> RELEASE_NOTES.md
# generate SHA256SUM
sha256sum $(CLIENT).zip | tee -a "RELEASE_NOTES.md"
sha256sum $(WIN32).zip | tee -a "RELEASE_NOTES.md"
sha256sum $(WIN64).zip | tee -a "RELEASE_NOTES.md"
sha256sum $(LINUX32).tar.gz | tee -a "RELEASE_NOTES.md"
sha256sum $(LINUX64).tar.gz | tee -a "RELEASE_NOTES.md"
sha256sum $(FULLDISTRO).zip | tee -a "RELEASE_NOTES.md"
echo "\`\`\`" >> RELEASE_NOTES.md
echo "</details>" >> RELEASE_NOTES.md
echo "" >> RELEASE_NOTES.md
release-contributors: contributors release-notes release-checksums
# add contributors section
echo "<details>" >> RELEASE_NOTES.md
echo "<summary> Contributors (click to expand) </summary>" >> RELEASE_NOTES.md
cat CONTRIBUTORS >> RELEASE_NOTES.md
echo "</details>" >> RELEASE_NOTES.md
echo "" >> RELEASE_NOTES.md
####################################################################
# Create OH release packages
################
# Client package
$(CLIENT).zip:
# create directories and copy files
mkdir -p $(CLIENT)/doc
mkdir -p $(CLIENT)/oh
cp CONTRIBUTORS LICENSE RELEASE_NOTES UPDATING $(CLIENT)
cp -a ./oh-bundle/* $(CLIENT)/
cp -a ./openhospital-gui/target/OpenHospital20/* $(CLIENT)/oh
mv $(CLIENT)/oh/oh.* $(CLIENT)
cp -a ./openhospital-core/sql $(CLIENT)/
cp -f ./openhospital-gui/oh.ico $(CLIENT)/
# remove unnecessary files
rm -f $(CLIENT)/oh/README.md
rm -f $(CLIENT)/ohmac.sh
# copy manuals
cp *.pdf $(CLIENT)/doc
# Set oh folder
sed -i 's/^\$$script\:OH_DIR\=\".\"/\$$script\:OH_DIR\=\"oh\"/g' $(CLIENT)/oh.ps1
sed -i 's/set\ OH_DIR=\".\"/\set\ OH_DIR\=\"oh\"/g' $(CLIENT)/oh.bat
sed -i 's/^\OH_DIR\=\".\"/OH_DIR\=\"oh\"/g' $(CLIENT)/oh.sh
# Set OH mode to CLIENT in startup scripts
sed -i 's/^\#$$script\:OH_MODE\=\"PORTABLE\"/\$$script\:OH_MODE\=\"CLIENT\"/g' $(CLIENT)/oh.ps1
sed -i 's/^\#OH_MODE\=PORTABLE/OH_MODE\=CLIENT/g' $(CLIENT)/oh.sh
# give exec permissions to startup script
chmod 755 $(CLIENT)/oh.sh
# create package
zip -r -q $(CLIENT).zip $(CLIENT)
#######################
# Windows 32bit package
$(WIN32).zip:
# create directories and copy files
mkdir -p $(WIN32)/doc
mkdir -p $(WIN32)/oh
cp CONTRIBUTORS LICENSE RELEASE_NOTES UPDATING $(WIN32)
cp -a ./oh-bundle/* $(WIN32)
cp -a ./openhospital-gui/target/OpenHospital20/* $(WIN32)/oh
mv $(WIN32)/oh/oh.* $(WIN32)
cp -a ./openhospital-core/sql $(WIN32)/
cp -f ./openhospital-gui/oh.ico $(WIN32)/
# remove unnecessary files
rm -f $(WIN32)/oh.sh
rm -f $(WIN32)/ohmac.sh
rm -f $(WIN32)/oh/README.md
# copy manuals
cp *.pdf $(WIN32)/doc
# Set oh folder
sed -i 's/^\$$script\:OH_DIR\=\".\"/\$$script\:OH_DIR\=\"oh\"/g' $(WIN32)/oh.ps1
sed -i 's/set\ OH_DIR=\".\"/\set\ OH_DIR\=\"oh\"/g' $(WIN32)/oh.bat
# download JAVA JRE
wget -q -nc $(JAVA_URL)/$(JRE_WIN32)
# download MariaDB / MySQL
wget -q -nc $(MYSQL_URL)/mariadb-$(MYSQL_WIN32_VER)/win32-packages/$(MYSQL_WIN32)
# create package
unzip -u -q $(JRE_WIN32) -d $(WIN32)
unzip -u -q $(MYSQL_WIN32) -d $(WIN32)
zip -r -q $(WIN32).zip $(WIN32)
#######################
# Windows 64bit package
$(WIN64).zip:
# create directories and copy files
mkdir -p $(WIN64)/doc
mkdir -p $(WIN64)/oh
cp CONTRIBUTORS LICENSE RELEASE_NOTES UPDATING $(WIN64)
cp -a ./oh-bundle/* $(WIN64)
cp -a ./openhospital-gui/target/OpenHospital20/* $(WIN64)/oh
mv $(WIN64)/oh/oh.* $(WIN64)
cp -a ./openhospital-core/sql $(WIN64)/
cp -f ./openhospital-gui/oh.ico $(WIN64)/
# remove unnecessary files
rm -f $(WIN64)/oh.sh
rm -f $(WIN64)/ohmac.sh
rm -f $(WIN64)/oh/README.md
# copy manuals
cp *.pdf $(WIN64)/doc
# Set new root folder
sed -i 's/^\$$script\:OH_DIR\=\".\"/\$$script\:OH_DIR\=\"oh\"/g' $(WIN64)/oh.ps1
sed -i 's/set\ OH_DIR=\".\"/\set\ OH_DIR\=\"oh\"/g' $(WIN64)/oh.bat
# download JAVA JRE
wget -q -nc $(JAVA_URL)/$(JRE_WIN64)
# download MariaDB / MySQL
wget -q -nc $(MYSQL_URL)/mariadb-$(MYSQL_WIN64_VER)/winx64-packages/$(MYSQL_WIN64)
# create package
unzip -u -q $(JRE_WIN64) -d $(WIN64)
unzip -u -q $(MYSQL_WIN64) -d $(WIN64)
zip -r -q $(WIN64).zip $(WIN64)
#######################
# Linux 32bit package
$(LINUX32).tar.gz:
# create directories and copy files
mkdir -p $(LINUX32)/doc
mkdir -p $(LINUX32)/oh
cp CONTRIBUTORS LICENSE RELEASE_NOTES UPDATING $(LINUX32)
cp -a ./oh-bundle/* $(LINUX32)
cp -a ./openhospital-gui/target/OpenHospital20/* $(LINUX32)/oh
mv $(LINUX32)/oh/oh.* $(LINUX32)
cp -a ./openhospital-core/sql $(LINUX32)/
cp -f ./openhospital-gui/oh.ico $(LINUX32)/
# remove unnecessary files
rm -f $(LINUX32)/oh.bat
rm -f $(LINUX32)/oh.ps1
rm -f $(LINUX32)/ohmac.sh
rm -f $(LINUX32)/oh/README.md
# copy manuals
cp *.pdf $(LINUX32)/doc
# Set oh folder
sed -i 's/^\OH_DIR\=\".\"/OH_DIR\=\"oh\"/g' $(LINUX32)/oh.sh
# give exec permissions to startup script
chmod 755 $(LINUX32)/oh.sh
# download JAVA JRE
wget -q -nc $(JAVA_URL)/$(JRE_LINUX32)
# download MariaDB / MySQL
wget -q -nc $(MYSQL_URL)/mariadb-$(MYSQL_LINUX32_VER)/bintar-linux-x86/$(MYSQL_LINUX32)
# create package
tar xz -C $(LINUX32) -f $(JRE_LINUX32)
tar xz -C $(LINUX32) -f $(MYSQL_LINUX32)
tar -czf $(LINUX32).tar.gz $(LINUX32)
#######################
# Linux 64bit package
$(LINUX64).tar.gz:
# create directories and copy files
mkdir -p $(LINUX64)/doc
mkdir -p $(LINUX64)/oh
cp CONTRIBUTORS LICENSE RELEASE_NOTES UPDATING $(LINUX64)
cp -a ./oh-bundle/* $(LINUX64)
cp -a ./openhospital-gui/target/OpenHospital20/* $(LINUX64)/oh
mv $(LINUX64)/oh/oh.* $(LINUX64)
cp -a ./openhospital-core/sql $(LINUX64)/
cp -f ./openhospital-gui/oh.ico $(LINUX64)/
# remove unnecessary files
rm -f $(LINUX64)/oh.bat
rm -f $(LINUX64)/oh.ps1
rm -f $(LINUX64)/ohmac.sh
rm -f $(LINUX64)/oh/README.md
# copy manuals
cp *.pdf $(LINUX64)/doc
# Set oh folder
sed -i 's/^\OH_DIR\=\".\"/OH_DIR\=\"oh\"/g' $(LINUX64)/oh.sh
# give exec permissions to startup script
chmod 755 $(LINUX64)/oh.sh
# download JAVA JRE
wget -q -nc $(JAVA_URL)/$(JRE_LINUX64)
# download MariaDB / MySQL
wget -q -nc $(MYSQL_URL)/mariadb-$(MYSQL_LINUX64_VER)/bintar-linux-systemd-x86_64/$(MYSQL_LINUX64)
# create package
tar xz -C $(LINUX64) -f $(JRE_LINUX64)
tar xz -C $(LINUX64) -f $(MYSQL_LINUX64)
tar -czf $(LINUX64).tar.gz $(LINUX64)
####################################################################
#
# EXPERIMENTAL - full distro with UI+API server
#
####################################################################
$(FULLDISTRO).zip:
# create directories and copy files
mkdir -p $(FULLDISTRO)/doc
mkdir -p $(FULLDISTRO)/oh
cp CONTRIBUTORS LICENSE RELEASE_NOTES UPDATING $(FULLDISTRO)
cp -a ./oh-bundle/* $(FULLDISTRO)
cp -a ./openhospital-gui/target/OpenHospital20/* $(FULLDISTRO)/oh
mv $(FULLDISTRO)/oh/oh.* $(FULLDISTRO)
mv $(FULLDISTRO)/oh/ohmac.* $(FULLDISTRO)
cp -a ./openhospital-core/sql $(FULLDISTRO)/
cp -f ./openhospital-gui/oh.ico $(FULLDISTRO)/
# copy EXTRA files
cp ./oh-extra/oh-api-readme.txt $(FULLDISTRO)/
# copy manuals
cp *.pdf $(FULLDISTRO)/doc
# Set oh folder
sed -i 's/^\$$script\:OH_DIR\=\".\"/\$$script\:OH_DIR\=\"oh\"/g' $(FULLDISTRO)/oh.ps1
sed -i 's/set\ OH_DIR=\".\"/\set\ OH_DIR\=\"oh\"/g' $(FULLDISTRO)/oh.bat
sed -i 's/^\OH_DIR\=\".\"/OH_DIR\=\"oh\"/g' $(FULLDISTRO)/oh.sh
sed -i 's/^\OH_DIR\=\".\"/OH_DIR\=\"oh\"/g' $(FULLDISTRO)/ohmac.sh
# give exec permissions to startup script
chmod 755 $(FULLDISTRO)/oh.sh
# copy API jar
cp -a ./openhospital-api/target/$(OH_API_JAR) $(FULLDISTRO)/oh/bin
# copy API configuration file
cp ./openhospital-api/rsc/application.properties.dist $(FULLDISTRO)/oh/rsc/
# copy API content
cp -a ./openhospital-api/static $(FULLDISTRO)/oh/
# copy UI content
cp -a ./openhospital-ui/build/* $(FULLDISTRO)/oh/static/
# create package
zip -r -q $(FULLDISTRO).zip $(FULLDISTRO)
####################################################################