From: Ralf Jung Date: Wed, 19 Sep 2012 11:14:30 +0000 (+0200) Subject: Install slaves to /usr/lib/osspd: They are not means to be called X-Git-Tag: debian/1.3.2-1~3 X-Git-Url: https://git.ralfj.de/osspd.git/commitdiff_plain/4078626dba9e97b633ec02298a1ed4cab66c68bb Install slaves to /usr/lib/osspd: They are not means to be called --- 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 index 0000000..654ff3b --- /dev/null +++ b/debian/patches/0004-Allow-to-set-slave-installation-path-during-compilat.patch @@ -0,0 +1,77 @@ +From: Ralf Jung +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"); + } diff --git a/debian/patches/series b/debian/patches/series index d0285e9..80e712c 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -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 +0004-Allow-to-set-slave-installation-path-during-compilat.patch diff --git a/debian/rules b/debian/rules index 1548bee..ba13a35 100755 --- a/debian/rules +++ b/debian/rules @@ -1,10 +1,16 @@ #!/usr/bin/make -f +SLAVESDIR=/usr/lib/osspd +UDEVDIR=/lib/udev/rules.d + %: dh $@ --parallel +override_dh_auto_build: + dh_auto_build -- SLAVESDIR=$(SLAVESDIR) UDEVDIR=$(UDEVDIR) + 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: