summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRoland Reichwein <mail@reichwein.it>2025-01-19 16:22:55 +0100
committerRoland Reichwein <mail@reichwein.it>2025-01-19 16:22:55 +0100
commit926be3b8db12d9105a49f8a9a5f695f12d7aea12 (patch)
treeae6dd7c14e880833790f68e525e9ca0fd03f4ea0
parent321eaa65109a6ab18344901dfc4dd8cc4b82367d (diff)
Debian package
-rw-r--r--MIDIPlayer.cpp2
-rw-r--r--Makefile15
-rw-r--r--debian/README.Debian5
-rw-r--r--debian/changelog5
-rw-r--r--debian/compat1
-rw-r--r--debian/control24
-rw-r--r--debian/copyright4
-rw-r--r--debian/midiplay.service2
-rwxr-xr-xdebian/rules4
-rw-r--r--debian/source/format1
-rwxr-xr-xmidiplay3
11 files changed, 61 insertions, 5 deletions
diff --git a/MIDIPlayer.cpp b/MIDIPlayer.cpp
index 061b8f6..e160d33 100644
--- a/MIDIPlayer.cpp
+++ b/MIDIPlayer.cpp
@@ -44,7 +44,7 @@ void MIDIPlayer::start()
if (m_child.valid() && m_child.running()) {
stop();
} else {
- m_child = bp::child(fmt::format("/home/ernie/code/midiplay/aplaymidi-mp -c -p{} \"{}\"", m_client, m_file).c_str());//, bp::std_out > bp::null);
+ m_child = bp::child(fmt::format("aplaymidi-mp -c -p{} \"{}\"", m_client, m_file).c_str());//, bp::std_out > bp::null);
if (!m_child.valid() || !m_child.running()) {
throw std::runtime_error("aplaymidi not started");
}
diff --git a/Makefile b/Makefile
index 2665ec8..c04d4c3 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-TARGET=midiplay
+TARGET=midiplay-fcgi
SRCS=\
midiplay.cpp \
@@ -9,16 +9,20 @@ OBJS=$(SRCS:.cpp=.o)
CXX=clang++
CXXFLAGS=-Wall -g -O2 -fPIC -std=c++20
+# workaround for Debian dh_dwz:
+CXXFLAGS+=-gdwarf-4
CXXLIBS=-lfcgi -lreichwein -lfmt -lasound
CC=clang
CFLAGS=-Wall -g -O2 -fPIC
+# workaround for Debian dh_dwz:
+CFLAGS+=-gdwarf-4
CLIBS=-lasound
all: $(TARGET) aplaymidi-mp
run-fcgi:
- spawn-fcgi -a 127.0.0.1 -p 9090 -n -- ./midiplay
+ spawn-fcgi -a 127.0.0.1 -p 9090 -n -- ./midiplay-fcgi
%.o: %.cpp
$(CXX) $(CXXFLAGS) -o $@ -c $^
@@ -32,5 +36,12 @@ aplaymidi-mp.o: aplaymidi-mp.c
aplaymidi-mp: aplaymidi-mp.o
$(CC) $(CFLAGS) -o $@ $^ $(CLIBS)
+install:
+ mkdir -p $(DESTDIR)/usr/bin
+ cp midiplay $(DESTDIR)/usr/bin
+ cp aplaymidi-mp $(DESTDIR)/usr/bin
+ mkdir -p $(DESTDIR)/usr/lib/midiplay
+ cp $(TARGET) $(DESTDIR)/usr/lib/midiplay
+
clean:
-rm -rf *.o $(TARGET) aplaymidi-mp
diff --git a/debian/README.Debian b/debian/README.Debian
new file mode 100644
index 0000000..54311ff
--- /dev/null
+++ b/debian/README.Debian
@@ -0,0 +1,5 @@
+MIDIPLAY in Debian
+==================
+
+Debian package of midiplay - a hardware-software solution for MIDI and/or audio player
+including clock, web interface
diff --git a/debian/changelog b/debian/changelog
new file mode 100644
index 0000000..515baf5
--- /dev/null
+++ b/debian/changelog
@@ -0,0 +1,5 @@
+midiplay (1.0) unstable; urgency=medium
+
+ * Initial release.
+
+ -- Roland Reichwein <mail@reichwein.it> Sun, 05 Jan 2025 12:18:45 +0100
diff --git a/debian/compat b/debian/compat
new file mode 100644
index 0000000..48082f7
--- /dev/null
+++ b/debian/compat
@@ -0,0 +1 @@
+12
diff --git a/debian/control b/debian/control
index 7f46012..60a9369 100644
--- a/debian/control
+++ b/debian/control
@@ -1,2 +1,24 @@
-Build-Depends: libfmt-dev, libboost-dev, libfcgi-dev, libreichwein-dev, libasound2-dev
+Source: midiplay
+Section: sound
+Priority: optional
+Maintainer: Roland Reichwein <mail@reichwein.it>
+Build-Depends: debhelper, clang, libfmt-dev, libboost-dev, libfcgi-dev, libreichwein-dev, libasound2-dev
Depends: nginx, alsa-utils, spawn-fcgi
+Standards-Version: 4.5.0
+Homepage: http://www.reichwein.it/midiplay/
+
+Package: midiplay
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Homepage: http://www.reichwein.it/midiplay/
+Description: Software system for MIDIPLAY
+ MIDIPLAY is a combined hardware-software solution to generate an MIDI
+ and/or audio output.
+ .
+ Features:
+ - Web interface via FCGI, providing start/stop and song choice
+ - Generates clock
+ .
+ Supported Hardware platforms:
+ - Raspberry Pi 3 B+
+ - Raspberry Pi 4 B
diff --git a/debian/copyright b/debian/copyright
new file mode 100644
index 0000000..689d2b3
--- /dev/null
+++ b/debian/copyright
@@ -0,0 +1,4 @@
+Author: Roland Reichwein <mail@reichwein.it>, 2020-2023
+
+Both upstream source code and Debian packaging is available
+under the conditions of CC0 1.0 Universal
diff --git a/debian/midiplay.service b/debian/midiplay.service
index 0b36218..76ec401 100644
--- a/debian/midiplay.service
+++ b/debian/midiplay.service
@@ -5,7 +5,7 @@ After=network.target
[Service]
Type=simple
# Restart=always
-ExecStart=sh -c "cd /home/ernie/code/midiplay && make run-fcgi"
+ExecStart=midiplay
# Restart once a week, maybe certificates have changed
Restart=always
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..2d33f6a
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,4 @@
+#!/usr/bin/make -f
+
+%:
+ dh $@
diff --git a/debian/source/format b/debian/source/format
new file mode 100644
index 0000000..89ae9db
--- /dev/null
+++ b/debian/source/format
@@ -0,0 +1 @@
+3.0 (native)
diff --git a/midiplay b/midiplay
new file mode 100755
index 0000000..4da7dda
--- /dev/null
+++ b/midiplay
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+spawn-fcgi -a 127.0.0.1 -p 9090 -n -- /usr/bin/midiplay-fcgi