Cleaned up script generation and got rid of the atrocious gen_script.sh

This commit is contained in:
Tom Hacohen 2013-04-19 17:02:54 +01:00
parent 85432f9a10
commit 892497273a
5 changed files with 21 additions and 36 deletions

1
.gitignore vendored
View File

@ -44,6 +44,5 @@ coverage
INSTALL
src/bin/client
src/bin/clouseaud
src/scripts/clouseau
src/bin/clouseau_client
src/scripts/clouseau_start

View File

@ -1,16 +1,11 @@
MAINTAINERCLEANFILES = Makefile.in
EXTRA_DIST = gen_script.sh
clouseau_start: clouseau_start.in
$(AM_V_GEN) $(SED) -e "s|\@libdir\@|$(libdir)|" $(srcdir)/clouseau_start.in > $(builddir)/clouseau_start
uninstall-local:
rm -f $(DESTDIR)$(bindir)/clouseau
rm -f $(DESTDIR)$(bindir)/clouseau_start
bin_SCRIPTS = clouseau clouseau_start
clean-local:
rm -f clouseau
rm -f clouseau_start
CLEAN_FILES = clouseau_start
install-exec-local:
$(srcdir)/gen_script.sh $(libdir)/clouseau
$(INSTALL) clouseau_start $(DESTDIR)$(bindir)
$(INSTALL) clouseau $(DESTDIR)$(bindir)
# FIXME: I'm not even sure .in files should be included here.
EXTRA_DIST = clouseau_start.in

8
src/scripts/clouseau Normal file
View File

@ -0,0 +1,8 @@
#!/bin/sh
clouseau_client &
if [ $# -gt 0 ]
then
# Start clouseau daemon (will start single instance), then run app
clouseau_start "$@"
fi

View File

@ -0,0 +1,7 @@
#!/bin/sh
if [ $# -lt 1 ]
then
echo "Usage: clouseau_start <executable> [executable parameters]"
else
LD_PRELOAD="@libdir@/clouseau/libclouseau_preload.so" "$@"
fi

View File

@ -1,24 +0,0 @@
#!/bin/sh
cat <<-ENDOFMESSAGE>clouseau_start
#!/bin/sh
if [ \$# -lt 1 ]
then
echo "Usage: clouseau_start <executable> [executable parameters]"
else
LD_PRELOAD="$1/libclouseau_preload.so" "\$@"
fi
ENDOFMESSAGE
cat <<-ENDOFMESSAGE>clouseau
#!/bin/sh
clouseau_client &
if [ \$# -gt 0 ]
then
# Start clouseau daemon (will start single instance), then run app
clouseau_start "\$@"
fi
ENDOFMESSAGE
chmod +x clouseau
chmod +x clouseau_start