Name: valetudo-helper-httpbridge Version: 2023.08.0 Release: %autorelease Summary: Utility webserver providing file upload functionality License: Apache-2.0 AND BSD-3-Clause AND ISC AND MIT URL: https://github.com/Hypfer/valetudo-helper-httpbridge # Use the GitHub tarball as this isn't in npm Source0: %{url}/archive/%{version}/%{name}-%{version}.tar.gz # Created with nodejs-packaging-bundler Source1: %{name}-%{version}-nm-prod.tgz Source2: %{name}-%{version}-bundled-licenses.txt BuildArch: noarch ExclusiveArch: %{nodejs_arches} noarch Requires: nodejs BuildRequires: nodejs-devel %description valetudo-helper-httpbridge is a small utility webserver providing file upload functionality. It's part of a series of small standalone self-contained single-purpose tools built to make usage and/or installation of Valetudo a bit easier. %prep %autosetup -p1 cp %{SOURCE2} . %build # Setup bundled node modules tar xfz %{SOURCE1} mkdir -p node_modules pushd node_modules ln -s ../node_modules_prod/* . ln -s ../node_modules_prod/.bin . %install mkdir -p %{buildroot}%{nodejs_sitelib}/%{name} cp -pr package.json app.js utils/ %{buildroot}%{nodejs_sitelib}/%{name}/ # Copy over bundled nodejs modules cp -pr node_modules/ node_modules_prod/ %{buildroot}%{nodejs_sitelib}/%{name}/ # Install helper binary mkdir -p %{buildroot}%{_bindir} cat > %{buildroot}%{_bindir}/%{name} <<'EOF' #!/bin/sh exec %{_bindir}/node %{nodejs_sitelib}/%{name}/app.js EOF chmod +x %{buildroot}%{_bindir}/%{name} %check %nodejs_symlink_deps --check %files %doc Readme.md %license LICENSE %{name}-%{version}-bundled-licenses.txt %{nodejs_sitelib}/%{name} %{_bindir}/%{name} %changelog %autochangelog