2021-02-26 13:39:18 +00:00
|
|
|
%global forgeurl https://github.com/nightscout/cgm-remote-monitor
|
2021-11-02 19:06:39 +00:00
|
|
|
Version: 14.2.4
|
2021-02-26 13:39:18 +00:00
|
|
|
%global tag %version
|
|
|
|
|
|
|
|
%forgemeta
|
|
|
|
|
|
|
|
Name: nightscout
|
|
|
|
Release: 1%{?dist}
|
|
|
|
Summary: CGM in the cloud.
|
|
|
|
|
|
|
|
License: AGPL
|
|
|
|
URL: %forgeurl
|
|
|
|
Source0: %forgesource
|
|
|
|
Source1: nightscout.service
|
|
|
|
|
|
|
|
BuildRequires: nodejs-devel
|
|
|
|
BuildRequires: npm
|
|
|
|
BuildRequires: systemd-rpm-macros
|
|
|
|
|
|
|
|
Requires: nodejs
|
|
|
|
|
|
|
|
%global debug_package %{nil}
|
|
|
|
|
|
|
|
%description
|
|
|
|
Nightscout CGM in the cloud.
|
|
|
|
|
|
|
|
%post
|
|
|
|
%systemd_post nightscout.service
|
2021-02-26 13:47:04 +00:00
|
|
|
if [ "$1" = 1 ]; then
|
|
|
|
pushd %{nodejs_sitelib}/%{name}
|
2021-02-26 13:52:50 +00:00
|
|
|
node bin/generateRandomString.js > %{_sysconfdir}/nightscout/randomString
|
2021-02-26 13:47:04 +00:00
|
|
|
popd
|
|
|
|
fi
|
|
|
|
|
2021-02-26 13:39:18 +00:00
|
|
|
%preun
|
|
|
|
%systemd_preun nightscout.service
|
|
|
|
|
|
|
|
%postun
|
|
|
|
%systemd_postun_with_restart nightscout.service
|
|
|
|
|
|
|
|
%prep
|
|
|
|
%forgesetup
|
|
|
|
|
|
|
|
%build
|
2021-04-06 16:44:08 +00:00
|
|
|
npm install --no-audit --no-fund --omit=dev
|
|
|
|
rm tmp/randomString
|
|
|
|
ln -s %{_sysconfdir}/nightscout/randomString tmp/randomString
|
|
|
|
chmod -R -x+X *
|
2021-02-26 13:39:18 +00:00
|
|
|
|
|
|
|
%install
|
|
|
|
mkdir -p %{buildroot}%{nodejs_sitelib}/%{name}
|
2021-04-06 16:44:08 +00:00
|
|
|
cp -pr \
|
|
|
|
package.json \
|
|
|
|
lib \
|
|
|
|
server.js \
|
|
|
|
bundle \
|
2021-04-06 17:18:23 +00:00
|
|
|
translations \
|
|
|
|
views \
|
|
|
|
bin \
|
|
|
|
static \
|
2021-04-06 17:34:41 +00:00
|
|
|
tmp \
|
2021-04-06 16:44:08 +00:00
|
|
|
%{buildroot}%{nodejs_sitelib}/%{name}
|
|
|
|
cp -pr node_modules %{buildroot}%{nodejs_sitelib}/%{name}
|
2021-02-26 13:39:18 +00:00
|
|
|
|
2021-04-06 17:18:23 +00:00
|
|
|
install -m 644 -D docs/example-template.env %{buildroot}%{_sysconfdir}/nightscout/nightscout-environ
|
|
|
|
install -m 644 -D %{SOURCE1} %{buildroot}%{_unitdir}/nightscout.service
|
2021-02-26 13:39:18 +00:00
|
|
|
|
|
|
|
%files
|
|
|
|
%license LICENSE
|
|
|
|
%doc README.md
|
|
|
|
%{nodejs_sitelib}/%{name}
|
|
|
|
%{_unitdir}/nightscout.service
|
|
|
|
%config(noreplace) %{_sysconfdir}/nightscout
|
|
|
|
|
|
|
|
%changelog
|
|
|
|
* Fri Feb 26 12:10:49 GMT 2021 Alex Manning <git@alex-m.co.uk>
|
|
|
|
-
|