From 149bb6a0a652c2e2c91a3fdcdaf816cefbf48ce9 Mon Sep 17 00:00:00 2001 From: Ron Pedde Date: Sat, 25 Mar 2006 23:19:21 +0000 Subject: [PATCH] adjust config file paths for prefix --- configure.in | 3 ++- contrib/Makefile.am | 19 ++++++++++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/configure.in b/configure.in index 30840a4b..7a09078b 100644 --- a/configure.in +++ b/configure.in @@ -103,7 +103,7 @@ fi dnl Darwin's stupid cpp preprocessor.... echo Host type is $host -CPPFLAGS="$CPPFLAGS -DHOST='\"$host\"'" +CPPFLAGS="$CPPFLAGS -DHOST='\"$host\"' -DPREFIX=$prefix" dnl dnl The apple mDNS stuff wants these compile flags. @@ -130,6 +130,7 @@ case $host in AM_CONDITIONAL(COND_REND_POSIX,false);; esac + dnl Checks for libraries. AC_ARG_WITH(static-libs, [--with-static-libs[[=DIR]] use static libs in DIR],[ diff --git a/contrib/Makefile.am b/contrib/Makefile.am index 61b64be9..5f9ae4fa 100644 --- a/contrib/Makefile.am +++ b/contrib/Makefile.am @@ -1,6 +1,23 @@ # $Id$ # -EXTRA_DIST = README mt-daapd.spec mt-daapd.conf mt-daapd.playlist mt-daapd mt-daapd-gentoo mt-daapd-ssc.sh mt-daapd-ssc.pl +EXTRA_DIST = README mt-daapd.spec mt-daapd.conf.templ mt-daapd.playlist mt-daapd mt-daapd-gentoo mt-daapd-ssc.sh mt-daapd-ssc.pl mt-daapd-ssc.pl mt-daapd-ssc.sh + +BUILT_SOURCES = mt-daapd.conf +sysconf_DATA = mt-daapd.conf +bin_SCRIPTS=mt-daapd-ssc.sh + +dbdir="/var/cache/mt-daapd" + +mt-daapd.conf: mt-daapd.conf.templ + if [ "$(prefix)" == "/usr" ]; then \ + sed -e s,[@]prefix[@],$(prefix),g -e s,[@]dbdir[@],/var/cache/mt-daapd,g $< >$@; \ + else \ + sed -e s,[@]prefix[@],$(prefix),g -e s,[@]dbdir[@],$(prefix)/var/cache/mt-daapd,g $< >$@; \ + fi + + + +