From 255a29b9fbd29f55bbfc242bba96db735a03a1e5 Mon Sep 17 00:00:00 2001 From: Alex Manning Date: Tue, 6 Apr 2021 17:44:08 +0100 Subject: [PATCH] Nightscout now builds --- nightscout/nightscout.service | 1 - nightscout/nightscout.spec | 18 +++++++++++------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/nightscout/nightscout.service b/nightscout/nightscout.service index c941c93..a9cc9d6 100644 --- a/nightscout/nightscout.service +++ b/nightscout/nightscout.service @@ -17,7 +17,6 @@ DevicePolicy=closed ProtectSystem=strict ProtectHome=tmpfs -BindPaths=/home/git ProtectControlGroups=yes ProtectKernelModules=yes ProtectKernelTunables=yes diff --git a/nightscout/nightscout.spec b/nightscout/nightscout.spec index 5b14e76..934c995 100644 --- a/nightscout/nightscout.spec +++ b/nightscout/nightscout.spec @@ -26,11 +26,9 @@ Nightscout CGM in the cloud. %post %systemd_post nightscout.service - if [ "$1" = 1 ]; then pushd %{nodejs_sitelib}/%{name} node bin/generateRandomString.js > %{_sysconfdir}/nightscout/randomString - ln -s %{_sysconfdir}/nightscout/randomString tmp/randomString popd fi @@ -44,16 +42,22 @@ fi %forgesetup %build -npm install --no-audit --no-fund --omit=dev --ignore-scripts -#webpack --mode production --config webpack/webpack.config.js +npm install --no-audit --no-fund --omit=dev +rm tmp/randomString +ln -s %{_sysconfdir}/nightscout/randomString tmp/randomString +chmod -R -x+X * %install mkdir -p %{buildroot}%{nodejs_sitelib}/%{name} -cp -r --no-preserve=mode,ownership * %{buildroot}%{nodejs_sitelib}/%{name} -chmod -R -x %{buildroot}%{nodejs_sitelib}/%{name} +cp -pr \ + package.json \ + lib \ + server.js \ + bundle \ + %{buildroot}%{nodejs_sitelib}/%{name} +cp -pr node_modules %{buildroot}%{nodejs_sitelib}/%{name} install -D docs/example-template.env %{buildroot}%{_sysconfdir}/nightscout/nightscout-environ - install -D %{SOURCE1} %{buildroot}%{_unitdir}/nightscout.service %files