Skip to content
This repository was archived by the owner on Jan 1, 2024. It is now read-only.

Commit ede70fd

Browse files
committed
recompile using options from alpine repo version of apps, scan dependencies with scanelf and add missing ones manually
1 parent f2009b2 commit ede70fd

File tree

3 files changed

+37
-15
lines changed

3 files changed

+37
-15
lines changed

Dockerfile

Lines changed: 35 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DA
1010
ENV HOME="/config"
1111

1212
# copy prebuilds
13-
COPY prebuilds/ /
13+
COPY prebuilds/ /usr/
1414

1515
# install build dependencies
1616
RUN \
@@ -19,7 +19,6 @@ RUN \
1919
automake \
2020
boost-dev \
2121
cmake \
22-
coreutils \
2322
curl-dev \
2423
eudev-dev \
2524
g++ \
@@ -28,7 +27,10 @@ RUN \
2827
libcurl \
2928
libusb-compat-dev \
3029
libusb-dev \
30+
linux-headers \
31+
lua5.2-dev \
3132
make \
33+
mosquitto-dev \
3234
openssl-dev \
3335
pkgconf \
3436
sqlite-dev \
@@ -40,28 +42,48 @@ RUN \
4042
ln -s /tmp/open-zwave /tmp/open-zwave-read-only && \
4143
cd /tmp/open-zwave && \
4244
make && \
45+
make \
46+
instlibdir=usr/lib \
47+
pkgconfigdir="usr/lib/pkgconfig/" \
48+
PREFIX=/usr \
49+
sysconfdir=etc/openzwave \
50+
install && \
4351

4452
# build domoticz
4553
git clone https://github.com/domoticz/domoticz.git /tmp/domoticz && \
4654
cd /tmp/domoticz && \
47-
cmake -USE_STATIC_OPENZWAVE -DCMAKE_BUILD_TYPE=Release . && \
55+
cmake \
56+
-DBUILD_SHARED_LIBS=True \
57+
-DCMAKE_BUILD_TYPE=Release \
58+
-DCMAKE_INSTALL_PREFIX=/var/lib/domoticz \
59+
-DOpenZWave=/usr/lib/libopenzwave.so \
60+
-DUSE_BUILTIN_LUA=OFF \
61+
-DUSE_BUILTIN_MQTT=OFF \
62+
-DUSE_BUILTIN_SQLITE=OFF \
63+
-DUSE_STATIC_LIBSTDCXX=OFF \
64+
-DUSE_STATIC_OPENZWAVE=OFF && \
4865
make && \
4966
make install && \
5067

51-
# cleanup build dependencies
52-
apk del --purge \
53-
build-dependencies && \
68+
# determine runtime packages
69+
RUNTIME_PACKAGES="$( \
70+
scanelf --needed --nobanner /var/lib/domoticz/domoticz \
71+
| awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \
72+
| sort -u \
73+
| xargs -r apk info --installed \
74+
| sort -u \
75+
)" && \
5476

5577
# install runtime dependencies
5678
apk add --no-cache \
57-
libcrypto1.0 \
58-
libcurl \
59-
libssl1.0 \
60-
libstdc++ \
61-
libusb \
62-
libusb-compat \
79+
eudev-libs \
6380
openssl \
64-
zlib && \
81+
$RUNTIME_PACKAGES && \
82+
83+
# cleanup build dependencies
84+
apk del --purge \
85+
build-dependencies && \
86+
6587

6688
# add abc to dialout and cron group trying to fix different GID for dialout group
6789
usermod -a -G 16 abc && \

root/etc/cont-init.d/30-config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ mkdir -p \
66

77
# copy default scripts from install
88
[[ ! -e /config/scripts ]] && \
9-
cp -R /opt/domoticz/scripts /config/
9+
cp -R /var/lib/domoticz/scripts /config/
1010

1111
# generate ssl certificate
1212
if [ ! -e /config/keys/server_cert.pem ]; then

root/etc/services.d/domoticz/run

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/with-contenv bash
22
exec \
3-
s6-setuidgid abc /opt/domoticz/domoticz \
3+
s6-setuidgid abc /var/lib/domoticz/domoticz \
44
-sslwww 1443 \
55
-sslcert /config/keys/server_cert.pem \
66
-userdata /config/ \

0 commit comments

Comments
 (0)