Install slaves to /usr/lib/osspd: They are not means to be called
authorRalf Jung <post@ralfj.de>
Wed, 19 Sep 2012 11:14:30 +0000 (13:14 +0200)
committerRalf Jung <post@ralfj.de>
Wed, 19 Sep 2012 11:23:15 +0000 (13:23 +0200)
debian/patches/0004-Allow-to-set-slave-installation-path-during-compilat.patch [new file with mode: 0644]
debian/patches/series
debian/rules

diff --git a/debian/patches/0004-Allow-to-set-slave-installation-path-during-compilat.patch b/debian/patches/0004-Allow-to-set-slave-installation-path-during-compilat.patch
new file mode 100644 (file)
index 0000000..654ff3b
--- /dev/null
@@ -0,0 +1,77 @@
+From: Ralf Jung <post@ralfj.de>
+Date: Wed, 19 Sep 2012 13:12:58 +0200
+Subject: Allow to set slave installation path during compilation
+
+Forwarded: not-needed
+---
+ Makefile |    8 +++++---
+ osspd.c  |   11 ++---------
+ 2 files changed, 7 insertions(+), 12 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 8d8fe87..236176e 100644
+--- a/Makefile
++++ b/Makefile
+@@ -8,6 +8,7 @@ LDFLAGS := -L. -lossp $(LDFLAGS)
+ prefix := /usr/local
+ DESTDIR :=
+ UDEVDIR := /etc/udev/rules.d
++SLAVESDIR := $(prefix)/sbin
+ ifeq "$(origin OSSPD_CFLAGS)" "undefined"
+ OSSPD_CFLAGS := $(shell pkg-config --cflags fuse)
+@@ -38,8 +39,9 @@ headers := ossp.h ossp-util.h ossp-slave.h
+ all: osspd ossp-padsp ossp-alsap
+ install:
+-      mkdir -p $(DESTDIR)$(prefix)/sbin
+-      install -m755 osspd ossp-padsp ossp-alsap $(DESTDIR)$(prefix)/sbin
++      mkdir -p $(DESTDIR)$(prefix)/sbin $(DESTDIR)$(SLAVESDIR)
++      install -m755 osspd $(DESTDIR)$(prefix)/sbin
++      install -m755 ossp-padsp ossp-alsap $(DESTDIR)$(SLAVESDIR)
+       mkdir -p $(DESTDIR)$(UDEVDIR)
+       install -m644 98-osscuse.rules $(DESTDIR)$(UDEVDIR)
+@@ -50,7 +52,7 @@ libossp.a: ossp.c ossp.h ossp-util.c ossp-util.h ossp-slave.c ossp-slave.h
+       $(AR) rc $@ ossp.o ossp-util.o ossp-slave.o
+ osspd: osspd.c libossp.a $(headers)
+-      $(CC) $(CFLAGS) $(OSSPD_CFLAGS) -o $@ $< $(OSSPD_LDFLAGS) $(LDFLAGS)
++      $(CC) $(CFLAGS) $(OSSPD_CFLAGS) -DSLAVE_DEFAULT_PATH=\"$(SLAVESDIR)\" -o $@ $< $(OSSPD_LDFLAGS) $(LDFLAGS)
+ ossp-padsp: ossp-padsp.c libossp.a $(headers)
+       $(CC) $(CFLAGS) $(OSSP_PADSP_CFLAGS) -o $@ $< $(OSSP_PADSP_LDFLAGS) $(LDFLAGS)
+diff --git a/osspd.c b/osspd.c
+index 1dbe586..b318fc8 100644
+--- a/osspd.c
++++ b/osspd.c
+@@ -2005,7 +2005,7 @@ static const char *usage =
+ "    --max=MAX         maximum number of open streams (default 256)\n"
+ "    --umax=MAX        maximum number of open streams per UID (default --max)\n"
+ "    --exit-on-idle    exit if idle\n"
+-"    --dsp-slave=PATH  DSP slave (default ossp-padsp in the same dir)\n"
++"    --dsp-slave=PATH  DSP slave (default: " SLAVE_DEFAULT_PATH "/ossp-padsp)\n"
+ "    --log=LEVEL       log level (0..6)\n"
+ "    --timestamp       timestamp log messages\n"
+ "    -v                increase verbosity, can be specified multiple times\n"
+@@ -2175,19 +2175,12 @@ int main(int argc, char **argv)
+       if (sigaction(SIGPIPE, &sa, NULL))
+               fatal_e(-errno, "failed to ignore SIGPIPE");
+-      /* determine slave path and check for availability */
+-      ret = readlink("/proc/self/exe", path_buf, PATH_MAX - 1);
+-      if (ret < 0)
+-              fatal_e(-errno, "failed to determine executable path");
+-      path_buf[ret] = '\0';
+-      dir = dirname(path_buf);
+-
+       if (param.dsp_slave_path) {
+               strncpy(dsp_slave_path, param.dsp_slave_path, PATH_MAX - 1);
+               dsp_slave_path[PATH_MAX - 1] = '\0';
+       } else {
+               ret = snprintf(dsp_slave_path, PATH_MAX, "%s/%s",
+-                             dir, "ossp-padsp");
++                             SLAVE_DEFAULT_PATH, "ossp-padsp");
+               if (ret >= PATH_MAX)
+                       fatal("dsp slave pathname too long");
+       }
index d0285e9209ec2066d04b0f1c88e2182935b5782c..80e712c2e11c964bf41a73cd0a574b4a9494e0be 100644 (file)
@@ -1,3 +1,4 @@
 0001-Fix-compilation-with-Werror-format-security.patch
 0002-honor-CPPFLAGS.patch
 0003-PA-recommends-users-not-to-be-in-the-audio-group-so-.patch
 0001-Fix-compilation-with-Werror-format-security.patch
 0002-honor-CPPFLAGS.patch
 0003-PA-recommends-users-not-to-be-in-the-audio-group-so-.patch
+0004-Allow-to-set-slave-installation-path-during-compilat.patch
index 1548beee43ae2d0de85cb9de36b999a4d776cf90..ba13a354129e88d94244b465a99c165752e4c619 100755 (executable)
@@ -1,10 +1,16 @@
 #!/usr/bin/make -f
 
 #!/usr/bin/make -f
 
+SLAVESDIR=/usr/lib/osspd
+UDEVDIR=/lib/udev/rules.d
+
 %:
        dh $@ --parallel
 
 %:
        dh $@ --parallel
 
+override_dh_auto_build:
+       dh_auto_build -- SLAVESDIR=$(SLAVESDIR) UDEVDIR=$(UDEVDIR)
+
 override_dh_auto_install:
 override_dh_auto_install:
-       dh_auto_install -- prefix=/usr UDEVDIR=/lib/udev/rules.d
+       dh_auto_install -- prefix=/usr SLAVESDIR=$(SLAVESDIR) UDEVDIR=$(UDEVDIR)
 
 # Disable tests, they require running the osspd
 override_dh_auto_test:
 
 # Disable tests, they require running the osspd
 override_dh_auto_test: