Projects
Multimedia
welle-io
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 6
View file
welle-io.changes
Changed
@@ -1,13 +1,15 @@ ------------------------------------------------------------------- -Fri Sep 13 17:31:51 UTC 2024 - Fridrich Strba <fridrich.strba@bluewin.ch> +Sat Sep 14 11:52:48 UTC 2024 - Fridrich Strba <fridrich.strba@bluewin.ch> -- Build with stdc++17 capable compiler for <filesystem> include +- Added patch: + * base_dir.patch + + implement an option to specify the location of index.html and + index.js files. ------------------------------------------------------------------- -Fri Sep 13 09:38:06 UTC 2024 - Fridrich Strba <fridrich.strba@bluewin.ch> +Fri Sep 13 17:31:51 UTC 2024 - Fridrich Strba <fridrich.strba@bluewin.ch> -- Make the welle-cli start in a directory where are its data - * Allows running web-interface out of the box +- Build with stdc++17 capable compiler for <filesystem> include ------------------------------------------------------------------- Thu Sep 12 17:39:03 UTC 2024 - Fridrich Strba <fridrich.strba@bluewin.ch>
View file
welle-io.spec
Changed
@@ -27,6 +27,7 @@ Group: Productivity/Multimedia/Other URL: https://www.welle.io/ Source0: %{name}-%{version}.tar.xz +Patch0: base_dir.patch BuildRequires: airspy-devel BuildRequires: alsa-devel BuildRequires: cmake @@ -66,6 +67,7 @@ %prep %setup -q +%patch -P 0 -p1 %build %if 0%{?with_gcc} @@ -85,19 +87,6 @@ %install %cmake_install -# move data of web interface to welle-cli subpackage -install -dm 0755 %{buildroot}%{_datadir}/welle-cli -mv %{buildroot}%{_datadir}/welle-io/html %{buildroot}%{_datadir}/welle-cli/html - -# create a launch script to use the web interface data from the right directory -mv %{buildroot}%{_bindir}/welle-cli %{buildroot}%{_bindir}/welle-cli.bin -cat > %{buildroot}%{_bindir}/welle-cli << EOF -#!/bin/sh -(cd %{_datadir}/welle-cli/html && %{_bindir}/welle-cli.bin "\$@") -EOF -chmod +x %{buildroot}%{_bindir}/welle-cli - - %files %license COPYING %{_bindir}/welle-io @@ -109,8 +98,7 @@ %doc README.md AUTHORS THANKS %files -n welle-cli -%{_bindir}/welle-cli* -%{_datadir}/welle-cli +%{_bindir}/welle-cli %{_mandir}/man1/welle-cli.1%{?ext_man} %changelog
View file
base_dir.patch
Added
@@ -0,0 +1,142 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 7dbdc9ca..d0ab53c0 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,4 +1,4 @@ +-cmake_minimum_required(VERSION 3.2) ++cmake_minimum_required(VERSION 3.10) + + project(Welle.Io LANGUAGES C CXX) + +@@ -13,7 +13,7 @@ if(NOT WELLE-IO_VERSION) + endif() + + set(CMAKE_CXX_STANDARD_REQUIRED ON) +-set(CMAKE_CXX_STANDARD 14) ++set(CMAKE_CXX_STANDARD 17) + + option(BUILD_WELLE_IO "Build Welle.io" ON ) + option(BUILD_WELLE_CLI "Build welle-cli" ON ) +@@ -200,8 +200,8 @@ endif() + + if (SOAPYSDR) + find_package(SoapySDR NO_MODULE REQUIRED) +- # Note: SoapySDRConfig.cmake sets C++11 standard so it needs to be reset to C++14 +- set(CMAKE_CXX_STANDARD 14) ++ # Note: SoapySDRConfig.cmake sets C++11 standard so it needs to be reset to C++17 ++ set(CMAKE_CXX_STANDARD 17) + endif() + + include_directories( +diff --git a/src/welle-cli/webradiointerface.cpp b/src/welle-cli/webradiointerface.cpp +index 74c51425..d57ceecc 100644 +--- a/src/welle-cli/webradiointerface.cpp ++++ b/src/welle-cli/webradiointerface.cpp +@@ -24,6 +24,7 @@ + */ + + #include "welle-cli/webradiointerface.h" ++#include <filesystem> + #include <algorithm> + #include <cmath> + #include <complex> +@@ -131,13 +132,15 @@ static bool send_http_response(Socket& s, const string& statuscode, + + WebRadioInterface::WebRadioInterface(CVirtualInput& in, + int port, ++ const string &base_dir, + DecodeSettings ds, + RadioReceiverOptions rro) : + dabparams(1), + input(in), + spectrum_fft_handler(dabparams.T_u), + rro(rro), +- decode_settings(ds) ++ decode_settings(ds), ++ base_dir(base_dir) + { + { + // Ensure that rx always exists when rx_mut is free! +@@ -563,7 +566,17 @@ bool WebRadioInterface::send_file(Socket& s, + const std::string& filename, + const std::string& content_type) + { +- FILE *fd = fopen(filename.c_str(), "r"); ++ std::filesystem::path path_name; ++ if (!base_dir.empty()) ++ { ++ path_name = base_dir; ++ path_name /= filename; ++ } ++ else ++ { ++ path_name = filename; ++ } ++ FILE *fd = fopen(path_name.c_str(), "r"); + if (fd) { + if (not send_http_response(s, http_ok, "", content_type)) { + cerr << "Failed to send file headers" << endl; +diff --git a/src/welle-cli/webradiointerface.h b/src/welle-cli/webradiointerface.h +index f029e48b..81cae0ea 100644 +--- a/src/welle-cli/webradiointerface.h ++++ b/src/welle-cli/webradiointerface.h +@@ -75,6 +75,7 @@ class WebRadioInterface : public RadioControllerInterface { + WebRadioInterface( + CVirtualInput& in, + int port, ++ const std::string& base_dir, + DecodeSettings cs, + RadioReceiverOptions rro); + ~WebRadioInterface(); +@@ -215,4 +216,6 @@ class WebRadioInterface : public RadioControllerInterface { + std::chrono::time_point<std::chrono::steady_clock> time_change; + }; + std::list<ActiveCarouselService> carousel_services_active; ++ ++ std::string base_dir; + }; +diff --git a/src/welle-cli/welle-cli.cpp b/src/welle-cli/welle-cli.cpp +index cf84060e..c02f5106 100644 +--- a/src/welle-cli/welle-cli.cpp ++++ b/src/welle-cli/welle-cli.cpp +@@ -275,6 +275,7 @@ class RadioInterface : public RadioControllerInterface { + struct options_t { + string soapySDRDriverArgs = ""; + string antenna = ""; ++ string base_dir = ""; + int gain = -1; + string channel = "10B"; + string iqsource = ""; +@@ -314,6 +315,7 @@ static void usage() + endl << + "Web server mode:" << endl << + " -w port Enable web server on port <port>." << endl << ++ " -b path Base directory of index.html and index.js files." << endl << + " -C number Number of programmes to decode in a carousel" << endl << + " (to be used with -w, cannot be used with -D)." << endl << + " This is useful if your machine cannot decode all programmes" << endl << +@@ -409,11 +411,14 @@ options_t parse_cmdline(int argc, char **argv) + options.rro.decodeTII = true; + + int opt; +- while ((opt = getopt(argc, argv, "A:c:C:dDf:F:g:hp:O:Ps:Tt:uvw:")) != -1) { ++ while ((opt = getopt(argc, argv, "A:b:c:C:dDf:F:g:hp:O:Ps:Tt:uvw:")) != -1) { + switch (opt) { + case 'A': + options.antenna = optarg; + break; ++ case 'b': ++ options.base_dir = optarg; ++ break; + case 'c': + options.channel = optarg; + break; +@@ -605,7 +610,7 @@ int main(int argc, char **argv) + return 1; + } + +- WebRadioInterface wri(*in, options.web_port, ds, options.rro); ++ WebRadioInterface wri(*in, options.web_port, options.base_dir, ds, options.rro); + wri.serve(); + } + else {
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.