From 1bd3b3a0766f1fd54112164049f80a1106de931f Mon Sep 17 00:00:00 2001 From: Julien BLACHE Date: Fri, 12 Jun 2009 11:09:58 +0200 Subject: [PATCH] Fix paths and rename the project --- configure.in | 15 +-------------- src/.gitignore | 2 +- src/Makefile.am | 12 +++++++----- src/conffile.c | 2 +- src/conffile.h | 2 ++ src/db.c | 2 +- src/httpd.c | 2 +- src/main.c | 6 +++--- 8 files changed, 17 insertions(+), 26 deletions(-) diff --git a/configure.in b/configure.in index d5ac5b97..9c21970b 100644 --- a/configure.in +++ b/configure.in @@ -2,7 +2,7 @@ dnl Process this file with autoconf to produce a configure script. AC_INIT(config.h.in) AC_CONFIG_HEADER(config.h) -AM_INIT_AUTOMAKE(forked-daapd,0.01-git) +AM_INIT_AUTOMAKE(forked-daapd, 0.10) AC_USE_SYSTEM_EXTENSIONS @@ -40,19 +40,6 @@ AC_CHECK_FUNCS(timegm) AC_CHECK_FUNCS(va_copy) AC_CHECK_FUNCS(__va_copy) -if test "x$prefix" != xNONE -a "x$prefix" != "x/usr"; then - CONFFILE="$prefix/etc/mt-daapd.conf" -else - if test "x$prefix" = "xNONE"; then - CONFFILE="/usr/local/etc/mt-daapd.conf" - else - CONFFILE="/etc/mt-daapd.conf" - fi -fi - - -AC_DEFINE_UNQUOTED(CONFFILE,"${CONFFILE}",Where the config file is) - AC_ARG_ENABLE(flac, AC_HELP_STRING([--enable-flac], [Enable FLAC support]), use_flac=true; CPPFLAGS="${CPPFLAGS} -DFLAC") diff --git a/src/.gitignore b/src/.gitignore index fb03e26e..2c8e1fb4 100644 --- a/src/.gitignore +++ b/src/.gitignore @@ -1,4 +1,4 @@ -mt-daapd +forked-daapd *.tokens *Lexer.[ch] diff --git a/src/Makefile.am b/src/Makefile.am index 95d1b474..67650c65 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,5 +1,5 @@ -sbin_PROGRAMS = mt-daapd +sbin_PROGRAMS = forked-daapd if COND_FLAC FLACSRC=scan-flac.c @@ -21,9 +21,11 @@ ANTLR_SOURCES = \ ANTLR_PRODUCTS = -mt_daapd_CPPFLAGS = -D_GNU_SOURCE @AVAHI_CFLAGS@ @SQLITE3_CFLAGS@ @FFMPEG_CFLAGS@ @CONFUSE_CFLAGS@ @TAGLIB_CFLAGS@ @MINIXML_CFLAGS@ -mt_daapd_LDADD = @AVAHI_LIBS@ @SQLITE3_LIBS@ @FFMPEG_LIBS@ @CONFUSE_LIBS@ @FLAC_LIBS@ @TAGLIB_LIBS@ @LIBEVENT_LIBS@ @LIBAVL_LIBS@ @MINIXML_LIBS@ @ANTLR3C_LIBS@ -mt_daapd_SOURCES = main.c \ +forked_daapd_CPPFLAGS = -D_GNU_SOURCE @AVAHI_CFLAGS@ @SQLITE3_CFLAGS@ @FFMPEG_CFLAGS@ @CONFUSE_CFLAGS@ @TAGLIB_CFLAGS@ @MINIXML_CFLAGS@ \ + -DDATADIR="\"$(pkgdatadir)\"" -DCONFDIR="\"$(sysconfdir)\"" -DSTATEDIR="\"$(localstatedir)\"" + +forked_daapd_LDADD = @AVAHI_LIBS@ @SQLITE3_LIBS@ @FFMPEG_LIBS@ @CONFUSE_LIBS@ @FLAC_LIBS@ @TAGLIB_LIBS@ @LIBEVENT_LIBS@ @LIBAVL_LIBS@ @MINIXML_LIBS@ @ANTLR3C_LIBS@ +forked_daapd_SOURCES = main.c \ db.c db.h \ logger.c logger.h \ conffile.c conffile.h \ @@ -42,7 +44,7 @@ mt_daapd_SOURCES = main.c \ scan-wma.c \ $(FLACSRC) $(MUSEPACKSRC) -nodist_mt_daapd_SOURCES = \ +nodist_forked_daapd_SOURCES = \ $(ANTLR_SOURCES) EXTRA_DIST = \ diff --git a/src/conffile.c b/src/conffile.c index 8cdd4ce6..84d4d3c6 100644 --- a/src/conffile.c +++ b/src/conffile.c @@ -42,7 +42,7 @@ static cfg_opt_t sec_general[] = { CFG_STR("uid", "nobody", CFGF_NONE), CFG_STR("admin_password", NULL, CFGF_NONE), - CFG_STR("logfile", "/var/log/mt-daapd.log", CFGF_NONE), + CFG_STR("logfile", STATEDIR "/log/" PACKAGE ".log", CFGF_NONE), CFG_INT_CB("loglevel", E_LOG, CFGF_NONE, &cb_loglevel), CFG_END() }; diff --git a/src/conffile.h b/src/conffile.h index 6b6d9121..87e28b30 100644 --- a/src/conffile.h +++ b/src/conffile.h @@ -4,6 +4,8 @@ #include +#define CONFFILE CONFDIR "/forked-daapd.conf" + extern cfg_t *cfg; int diff --git a/src/db.c b/src/db.c index f7066189..24bc826d 100644 --- a/src/db.c +++ b/src/db.c @@ -36,7 +36,7 @@ #define STR(x) ((x) ? (x) : "") -#define DB_PATH "/var/cache/mt-daapd/songs3.db" /* FIXME */ +#define DB_PATH STATEDIR "/cache/" PACKAGE "/songs3.db" /* Inotify cookies are uint32_t */ #define INOTIFY_FAKE_COOKIE ((int64_t)1 << 32) diff --git a/src/httpd.c b/src/httpd.c index 73004033..e07ab97c 100644 --- a/src/httpd.c +++ b/src/httpd.c @@ -64,7 +64,7 @@ #define STREAM_CHUNK_SIZE (512 * 1024) -#define WEBFACE_ROOT "/usr/share/mt-daapd/admin-root/" +#define WEBFACE_ROOT DATADIR "/webface/" struct content_type_map { char *ext; diff --git a/src/main.c b/src/main.c index eeb7fd27..89ab49f4 100644 --- a/src/main.c +++ b/src/main.c @@ -55,7 +55,7 @@ #include "mdns_avahi.h" -#define PIDFILE "/var/run/mt-daapd.pid" +#define PIDFILE STATEDIR "/run/" PACKAGE ".pid" struct event_base *evbase_main; static int main_exit; @@ -407,7 +407,7 @@ main(int argc, char **argv) break; case 'v': - fprintf(stdout, "Firefly Media Server: Version %s\n",VERSION); + fprintf(stdout, "Forked Media Server: Version %s\n",VERSION); return EXIT_SUCCESS; break; @@ -455,7 +455,7 @@ main(int argc, char **argv) /* Set up libevent logging callback */ event_set_log_callback(logger_libevent); - DPRINTF(E_LOG, L_MAIN, "Firefly Version %s taking off\n", VERSION); + DPRINTF(E_LOG, L_MAIN, "Forked Media Server Version %s taking off\n", VERSION); /* Initialize ffmpeg */ av_register_all();