From 8dfa22692077c307d7cf7e422e1d9afc24fd7ab5 Mon Sep 17 00:00:00 2001 From: "[CST] Bas" Date: Fri, 25 Jan 2013 10:33:40 +0800 Subject: [PATCH 1/7] neutrino: fix file locations. use the predetermined CONFIGDIR instead of hardcoding paths. --- src/driver/framebuffer.cpp | 2 +- src/eitd/SIlanguage.cpp | 2 +- src/eitd/edvbstring.cpp | 2 +- src/eitd/sectionsd.cpp | 4 ++-- src/eitd/xmlutil.cpp | 4 ++-- src/gui/keybind_setup.cpp | 2 +- src/gui/osdlang_setup.cpp | 2 +- src/gui/settings_manager.cpp | 2 +- src/gui/start_wizard.cpp | 2 +- src/nhttpd/tuxboxapi/coolstream/controlapi.cpp | 4 ++-- src/nhttpd/tuxboxapi/dbox/controlapi.cpp | 4 ++-- src/system/localize.cpp | 2 +- 12 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/driver/framebuffer.cpp b/src/driver/framebuffer.cpp index 253d335d1..f989516be 100644 --- a/src/driver/framebuffer.cpp +++ b/src/driver/framebuffer.cpp @@ -1569,7 +1569,7 @@ void CFrameBuffer::Clear() //never used void CFrameBuffer::showFrame(const std::string & filename) { - std::string varpath = "/var/tuxbox/config/neutrino/icons/"; + std::string varpath = CONFIGDIR "/neutrino/icons/"; if(!access((varpath + filename).c_str(), F_OK)) videoDecoder->ShowPicture((varpath + filename).c_str()); else diff --git a/src/eitd/SIlanguage.cpp b/src/eitd/SIlanguage.cpp index e6ec07ae8..44db9a74d 100644 --- a/src/eitd/SIlanguage.cpp +++ b/src/eitd/SIlanguage.cpp @@ -32,7 +32,7 @@ #include "SIlanguage.hpp" -#define LANGUAGEFILE "/var/tuxbox/config/epglanguages.conf" +#define LANGUAGEFILE CONFIGDIR "/epglanguages.conf" std::vector SIlanguage::languages; pthread_mutex_t SIlanguage::languages_lock = PTHREAD_MUTEX_INITIALIZER; diff --git a/src/eitd/edvbstring.cpp b/src/eitd/edvbstring.cpp index 24882425e..010c3eaa3 100644 --- a/src/eitd/edvbstring.cpp +++ b/src/eitd/edvbstring.cpp @@ -17,7 +17,7 @@ std::set TransponderUseTwoCharMapping; int readEncodingFile() { - FILE *f = fopen("/var/tuxbox/config/encoding.conf", "rt"); + FILE *f = fopen(CONFIGDIR "/encoding.conf", "rt"); if (f) { CountryCodeDefaultMapping.clear(); TransponderDefaultMapping.clear(); diff --git a/src/eitd/sectionsd.cpp b/src/eitd/sectionsd.cpp index 137cbf1e1..8ff854ed4 100644 --- a/src/eitd/sectionsd.cpp +++ b/src/eitd/sectionsd.cpp @@ -92,7 +92,7 @@ static bool messaging_zap_detected = false; /*static*/ bool dvb_time_update = false; //NTP-Config -#define CONF_FILE "/var/tuxbox/config/neutrino.conf" +#define CONF_FILE CONFIGDIR "/neutrino.conf" #ifdef USE_BB_NTPD const std::string ntp_system_cmd_prefix = "/sbin/ntpd -q -p "; @@ -1629,7 +1629,7 @@ void CEitThread::beforeSleep() messaging_zap_detected = false; unlockMessaging(); if(notify_complete) - system("/var/tuxbox/config/epgdone.sh"); + system(CONFIGDIR "/epgdone.sh"); } /********************************************************************************/ diff --git a/src/eitd/xmlutil.cpp b/src/eitd/xmlutil.cpp index b700011f3..424dc38ed 100644 --- a/src/eitd/xmlutil.cpp +++ b/src/eitd/xmlutil.cpp @@ -47,8 +47,8 @@ extern bool reader_ready; extern pthread_rwlock_t eventsLock; extern bool dvb_time_update; -std::string epg_filter_dir = "/var/tuxbox/config/zapit/epgfilter.xml"; -std::string dvbtime_filter_dir = "/var/tuxbox/config/zapit/dvbtimefilter.xml"; +std::string epg_filter_dir = CONFIGDIR "/zapit/epgfilter.xml"; +std::string dvbtime_filter_dir = CONFIGDIR "/zapit/dvbtimefilter.xml"; bool epg_filter_is_whitelist = false; bool epg_filter_except_current_next = false; diff --git a/src/gui/keybind_setup.cpp b/src/gui/keybind_setup.cpp index 478602188..376452cb2 100644 --- a/src/gui/keybind_setup.cpp +++ b/src/gui/keybind_setup.cpp @@ -91,7 +91,7 @@ int CKeybindSetup::exec(CMenuTarget* parent, const std::string &actionKey) CFileFilter fileFilter; fileFilter.addFilter("conf"); fileBrowser.Filter = &fileFilter; - if (fileBrowser.exec("/var/tuxbox/config") == true) { + if (fileBrowser.exec(CONFIGDIR "") == true) { CNeutrinoApp::getInstance()->loadKeys(fileBrowser.getSelectedFile()->Name.c_str()); printf("[neutrino keybind_setup] new keys: %s\n", fileBrowser.getSelectedFile()->Name.c_str()); } diff --git a/src/gui/osdlang_setup.cpp b/src/gui/osdlang_setup.cpp index 7aec3d37d..0266b79dc 100644 --- a/src/gui/osdlang_setup.cpp +++ b/src/gui/osdlang_setup.cpp @@ -163,7 +163,7 @@ void COsdLangSetup::showLanguageSetup(CMenuWidget *osdl_setup) struct dirent **namelist; int n; // printf("scanning locale dir now....(perhaps)\n"); - char *pfad[] = {(char *) DATADIR "/neutrino/locale",(char *) "/var/tuxbox/config/locale"}; + char *pfad[] = {(char *) DATADIR "/neutrino/locale",(char *) CONFIGDIR "/locale"}; osdl_setup->addIntroItems(); diff --git a/src/gui/settings_manager.cpp b/src/gui/settings_manager.cpp index 9bb4f3c60..c001f18a0 100644 --- a/src/gui/settings_manager.cpp +++ b/src/gui/settings_manager.cpp @@ -71,7 +71,7 @@ int CSettingsManager::exec(CMenuTarget* parent, const std::string &actionKey) { fileFilter.addFilter("conf"); fileBrowser.Filter = &fileFilter; - if (fileBrowser.exec("/var/tuxbox/config") == true) + if (fileBrowser.exec(CONFIGDIR "") == true) { CNeutrinoApp::getInstance()->loadSetup(fileBrowser.getSelectedFile()->Name.c_str()); CColorSetupNotifier *colorSetupNotifier = new CColorSetupNotifier; diff --git a/src/gui/start_wizard.cpp b/src/gui/start_wizard.cpp index 25b21e0c3..bd78c0a6d 100644 --- a/src/gui/start_wizard.cpp +++ b/src/gui/start_wizard.cpp @@ -101,7 +101,7 @@ int CStartUpWizard::exec(CMenuTarget* parent, const string & /*actionKey*/) } bool init_settings = false; if (CFEManager::getInstance()->haveSat()) - init_settings = file_exists("/var/tuxbox/config/initial/"); + init_settings = file_exists(CONFIGDIR "/initial/"); if(init_settings && (res != menu_return::RETURN_EXIT_ALL)) { diff --git a/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp b/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp index f212fab5f..c416e4cfc 100644 --- a/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp @@ -514,14 +514,14 @@ void CControlAPI::GetTimeCGI(CyhookHandler *hh) // send services.xml void CControlAPI::GetServicesxmlCGI(CyhookHandler *hh) { - hh->SendFile("/var/tuxbox/config/zapit/services.xml"); + hh->SendFile(CONFIGDIR "/zapit/services.xml"); } //----------------------------------------------------------------------------- // send bouquets.xml void CControlAPI::GetBouquetsxmlCGI(CyhookHandler *hh) { - hh->SendFile("/var/tuxbox/config/zapit/bouquets.xml"); + hh->SendFile(CONFIGDIR "/zapit/bouquets.xml"); } //----------------------------------------------------------------------------- diff --git a/src/nhttpd/tuxboxapi/dbox/controlapi.cpp b/src/nhttpd/tuxboxapi/dbox/controlapi.cpp index 9b39fbce9..af2dd1b62 100644 --- a/src/nhttpd/tuxboxapi/dbox/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/dbox/controlapi.cpp @@ -524,14 +524,14 @@ void CControlAPI::SettingsCGI(CyhookHandler *hh) // send services.xml void CControlAPI::GetServicesxmlCGI(CyhookHandler *hh) { - hh->SendFile("/var/tuxbox/config/zapit/services.xml"); + hh->SendFile(CONFIGDIR "/zapit/services.xml"); } //----------------------------------------------------------------------------- // send bouquets.xml void CControlAPI::GetBouquetsxmlCGI(CyhookHandler *hh) { - hh->SendFile("/var/tuxbox/config/zapit/bouquets.xml"); + hh->SendFile(CONFIGDIR "/zapit/bouquets.xml"); } //----------------------------------------------------------------------------- diff --git a/src/system/localize.cpp b/src/system/localize.cpp index bed4a433a..21558ad7f 100644 --- a/src/system/localize.cpp +++ b/src/system/localize.cpp @@ -111,7 +111,7 @@ CLocaleManager::~CLocaleManager() delete[] defaultData; } -const char * path[2] = {"/var/tuxbox/config/locale/", DATADIR "/neutrino/locale/"}; +const char * path[2] = {CONFIGDIR "/locale/", DATADIR "/neutrino/locale/"}; CLocaleManager::loadLocale_ret_t CLocaleManager::loadLocale(const char * const locale, bool asdefault) { From 8e8b65e9d2e1fbbbff24e0f1aa6020d065be3ac8 Mon Sep 17 00:00:00 2001 From: "[CST] Bas" Date: Tue, 29 Jan 2013 01:06:26 +0800 Subject: [PATCH 2/7] neutrino: add predefined config for nhttpd. --- src/nhttpd/nhttpd.conf.in | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 src/nhttpd/nhttpd.conf.in diff --git a/src/nhttpd/nhttpd.conf.in b/src/nhttpd/nhttpd.conf.in new file mode 100644 index 000000000..978af8a1c --- /dev/null +++ b/src/nhttpd/nhttpd.conf.in @@ -0,0 +1,23 @@ +Language.directory=languages +Language.selected=Deutsch +Tuxbox.LogosURL=@TARGET_ICONSDIR@/logo +WebsiteMain.directory= @TARGET_PRIVATE_HTTPDDIR@ +WebsiteMain.override_directory=@TARGET_PUBLIC_HTTPDDIR@ +WebsiteMain.port=80 +WebsiteMain.hosted_directory=/var/hosted +configfile.version=4 +mod_auth.authenticate=false +mod_auth.no_auth_client= +mod_auth.password=coolstream +mod_auth.username=root +mod_cache.cache_directory=/tmp/.cache +mod_sendfile.mime_types=htm:text/html,html:text/html,xml:text/xml,txt:text/plain,jpg:image/jpeg,jpeg:image/jpeg,gif:image/gif,png:image/png,bmp:image/bmp,css:text/css,js:text/plain,img:application/octet-stream,ico:image/x-icon,m3u:application/octet-stream,tar:application/octet-stream,gz:text/x-gzip,ts:application/octet-stream +mod_weblog.log_format= +mod_weblog.logfile=/tmp/yhttpd.log +server.chroot= +server.group_name= +server.log.loglevel=0 +server.no_keep-alive_ips= +server.user_name= +webserver.threading=false +webserver.websites=WebsiteMain From fb81654ef2d2214610d0ec495392cca191ad1984 Mon Sep 17 00:00:00 2001 From: "[CST] Bas" Date: Tue, 29 Jan 2013 01:10:07 +0800 Subject: [PATCH 3/7] neutrino: make default language english. --- src/nhttpd/nhttpd.conf.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nhttpd/nhttpd.conf.in b/src/nhttpd/nhttpd.conf.in index 978af8a1c..78182c8c4 100644 --- a/src/nhttpd/nhttpd.conf.in +++ b/src/nhttpd/nhttpd.conf.in @@ -1,5 +1,5 @@ Language.directory=languages -Language.selected=Deutsch +Language.selected=English Tuxbox.LogosURL=@TARGET_ICONSDIR@/logo WebsiteMain.directory= @TARGET_PRIVATE_HTTPDDIR@ WebsiteMain.override_directory=@TARGET_PUBLIC_HTTPDDIR@ From 9055caf32bc92f56d3fac9602eeff55f81b245dc Mon Sep 17 00:00:00 2001 From: "[CST] Bas" Date: Tue, 29 Jan 2013 01:17:23 +0800 Subject: [PATCH 4/7] neutrino: remove space from nhttpd.conf.in. --- src/nhttpd/nhttpd.conf.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nhttpd/nhttpd.conf.in b/src/nhttpd/nhttpd.conf.in index 78182c8c4..a4d74e924 100644 --- a/src/nhttpd/nhttpd.conf.in +++ b/src/nhttpd/nhttpd.conf.in @@ -1,7 +1,7 @@ Language.directory=languages Language.selected=English Tuxbox.LogosURL=@TARGET_ICONSDIR@/logo -WebsiteMain.directory= @TARGET_PRIVATE_HTTPDDIR@ +WebsiteMain.directory=@TARGET_PRIVATE_HTTPDDIR@ WebsiteMain.override_directory=@TARGET_PUBLIC_HTTPDDIR@ WebsiteMain.port=80 WebsiteMain.hosted_directory=/var/hosted From ee169288a59653fa712d683e916bfbd6ee7e2bd2 Mon Sep 17 00:00:00 2001 From: "[CST] Bas" Date: Tue, 29 Jan 2013 01:18:38 +0800 Subject: [PATCH 5/7] neutrino: add multiple paths so they can be configured and not be hard-coded in multiple files. --- acinclude.m4 | 45 +++++++++++++++++++++++++++--------------- configure.ac | 8 ++++++++ src/nhttpd/nhttpd.conf | 23 --------------------- 3 files changed, 37 insertions(+), 39 deletions(-) delete mode 100644 src/nhttpd/nhttpd.conf diff --git a/acinclude.m4 b/acinclude.m4 index 08a8c1e41..163824de4 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -11,7 +11,7 @@ AC_ARG_WITH(target, AC_ARG_WITH(targetprefix, [ --with-targetprefix=PATH prefix relative to target root (only applicable in cdk mode)], - [targetprefix="$withval"],[targetprefix="NONE"]) + [TARGET_PREFIX="$withval"],[TARGET_PREFIX="NONE"]) AC_ARG_WITH(debug, [ --without-debug disable debugging code], @@ -21,6 +21,7 @@ if test "$DEBUG" = "yes"; then DEBUG_CFLAGS="-g3 -ggdb" AC_DEFINE(DEBUG,1,[Enable debug messages]) fi + AC_ARG_ENABLE(tmsdk, AS_HELP_STRING(--enable-tmsdk, compile inside sdk), ,[enable_tmsdk=no]) @@ -38,7 +39,7 @@ if test "$TARGET" = "native"; then if test "$prefix" = "NONE"; then prefix=/usr/local fi - targetprefix=$prefix + TARGET_PREFIX=$prefix elif test "$TARGET" = "cdk"; then AC_MSG_RESULT(cdk) @@ -50,13 +51,14 @@ elif test "$TARGET" = "cdk"; then CXXFLAGS="-Wall -Os -mcpu=823 -pipe $DEBUG_CFLAGS" fi if test "$prefix" = "NONE"; then - AC_MSG_ERROR(invalid prefix, you need to specify one in cdk mode) + AC_MSG_ERROR([invalid prefix, you need to specify one in cdk mode]) fi - if test "$targetprefix" != "NONE"; then - AC_DEFINE_UNQUOTED(TARGETPREFIX, "${targetprefix}",[The targets prefix]) + if test "$TARGET_PREFIX" != "NONE"; then + AC_DEFINE_UNQUOTED(TARGET_PREFIX, "$TARGET_PREFIX",[The targets prefix]) fi - if test "$targetprefix" = "NONE"; then - targetprefix="" + if test "$TARGET_PREFIX" = "NONE"; then + AC_MSG_ERROR([invalid targetprefix, you need to specify one in cdk mode]) + TARGET_PREFIX="" fi if test "$host_alias" = ""; then cross_compiling=yes @@ -80,7 +82,7 @@ AC_DEFUN([TUXBOX_APPS_DIRECTORY_ONE],[ AC_ARG_WITH($1,[ $6$7 [[PREFIX$4$5]]],[ _$2=$withval if test "$TARGET" = "cdk"; then - $2=`eval echo "${targetprefix}$withval"` + $2=`eval echo "$TARGET_PREFIX$withval"` else $2=$withval fi @@ -95,7 +97,6 @@ AC_ARG_WITH($1,[ $6$7 [[PREFIX$4$5]]],[ TARGET_$2=$_$2 ]) -dnl automake <= 1.6 don't support this dnl AC_SUBST($2) AC_DEFINE_UNQUOTED($2,"$_$2",$7) AC_SUBST(TARGET_$2) @@ -109,10 +110,10 @@ if test "$TARGET" = "cdk"; then sysconfdir="\${prefix}/etc" localstatedir="\${prefix}/var" libdir="\${prefix}/lib" - targetdatadir="\${targetprefix}/share" - targetsysconfdir="\${targetprefix}/etc" - targetlocalstatedir="\${targetprefix}/var" - targetlibdir="\${targetprefix}/lib" + targetdatadir="\${TARGET_PREFIX}/share" + targetsysconfdir="\${TARGET_PREFIX}/etc" + targetlocalstatedir="\${TARGET_PREFIX}/var" + targetlibdir="\${TARGET_PREFIX}/lib" fi TUXBOX_APPS_DIRECTORY_ONE(configdir,CONFIGDIR,localstatedir,/var,/tuxbox/config, @@ -136,8 +137,17 @@ TUXBOX_APPS_DIRECTORY_ONE(plugindir,PLUGINDIR,libdir,/lib,/tuxbox/plugins, TUXBOX_APPS_DIRECTORY_ONE(ucodedir,UCODEDIR,localstatedir,/var,/tuxbox/ucodes, [--with-ucodedir=PATH ],[where to find the ucodes]) -TUXBOX_APPS_DIRECTORY_ONE(themesdir,THEMESDIR,datadir,/share,/tuxbox/neutrino/themes, +TUXBOX_APPS_DIRECTORY_ONE(themesdir,THEMESDIR,datadir,/share/tuxbox, /neutrino/themes, [--with-themesdir=PATH ],[where to find the themes (don't change)]) + +TUXBOX_APPS_DIRECTORY_ONE(iconsdir,ICONSDIR,datadir,/share/tuxbox, /neutrino/icons, + [--with-iconssdir=PATH ],[where to find the icons (don't change)]) + +TUXBOX_APPS_DIRECTORY_ONE(private_httpddir,PRIVATE_HTTPDDIR,datadir,/share,/tuxbox/neutrino/httpd, + [--with-private_httpddir=PATH ],[where to find the the private httpd files]) + +TUXBOX_APPS_DIRECTORY_ONE(public_httpddir,PUBLIC_HTTPDDIR,localstatedir,/var,/httpd, + [--with-public_httpddir=PATH ],[where to find the the public httpd files]) ]) dnl automake <= 1.6 needs this specifications @@ -149,6 +159,9 @@ AC_SUBST(LIBDIR) AC_SUBST(PLUGINDIR) AC_SUBST(UCODEDIR) AC_SUBST(THEMESDIR) +AC_SUBST(ICONSDIR) +AC_SUBST(PRIVATE_HTTPDDIR) +AC_SUBST(PUBLIC_HTTPDDIR) dnl end workaround AC_DEFUN([TUXBOX_APPS_ENDIAN],[ @@ -231,8 +244,8 @@ if test "$$1_CONFIG" != "no"; then $1_CFLAGS=$($$1_CONFIG --cflags) $1_LIBS=$($$1_CONFIG --libs) else - $1_CFLAGS=$($$1_CONFIG --prefix=$targetprefix --cflags) - $1_LIBS=$($$1_CONFIG --prefix=$targetprefix --libs) + $1_CFLAGS=$($$1_CONFIG --prefix=$TARGET_PREFIX --cflags) + $1_LIBS=$($$1_CONFIG --prefix=$TARGET_PREFIX --libs) fi fi fi diff --git a/configure.ac b/configure.ac index d71a7885d..94eee787a 100644 --- a/configure.ac +++ b/configure.ac @@ -122,15 +122,22 @@ AC_ARG_ENABLE(cleanup, [ --enable-cleanup enable cleanup on exit], [AC_DEFINE(EXIT_CLEANUP,1,[enable cleanup on exit])]) +if test "$BOXTYPE" = "coolstream"; then +if test "$BOXMODEL" = "nevis"; then if test -e ${srcdir}/lib/libcoolstream/nevis_ir.h; then AC_DEFINE(HAVE_COOLSTREAM_NEVIS_IR_H,1,[Define to 1 if you have the header file.]) fi +fi + +if test "$BOXMODEL" = "apollo"; then if test -e ${srcdir}/lib/libcoolstream2/cs_ir_generic.h; then AC_DEFINE(HAVE_COOLSTREAM_CS_IR_GENERIC_H,1,[Define to 1 if you have the header file.]) fi if test -e ${srcdir}/lib/libcoolstream2/cs_frontpanel.h; then AC_DEFINE(HAVE_COOLSTREAM_CS_FRONTPANEL_H,1,[Define to 1 if you have the header file.]) fi +fi +fi # # Check for libtdservicedb - the new one - for testing only @@ -179,6 +186,7 @@ src/nhttpd/tuxboxapi/Makefile src/nhttpd/tuxboxapi/coolstream/Makefile src/nhttpd/yhttpd_core/Makefile src/nhttpd/yhttpd_mods/Makefile +src/nhttpd/nhttpd.conf src/Makefile src/daemonc/Makefile src/driver/pictureviewer/Makefile diff --git a/src/nhttpd/nhttpd.conf b/src/nhttpd/nhttpd.conf deleted file mode 100644 index de955798e..000000000 --- a/src/nhttpd/nhttpd.conf +++ /dev/null @@ -1,23 +0,0 @@ -Language.directory=languages -Language.selected=Deutsch -Tuxbox.LogosURL=/usr/share/tuxbox/neutrino/icons/logo -WebsiteMain.directory=/share/tuxbox/neutrino/httpd -WebsiteMain.override_directory=/var/httpd -WebsiteMain.port=80 -WebsiteMain.hosted_directory=/var/hosted -configfile.version=4 -mod_auth.authenticate=false -mod_auth.no_auth_client= -mod_auth.password=coolstream -mod_auth.username=root -mod_cache.cache_directory=/tmp/.cache -mod_sendfile.mime_types=htm:text/html,html:text/html,xml:text/xml,txt:text/plain,jpg:image/jpeg,jpeg:image/jpeg,gif:image/gif,png:image/png,bmp:image/bmp,css:text/css,js:text/plain,img:application/octet-stream,ico:image/x-icon,m3u:application/octet-stream,tar:application/octet-stream,gz:text/x-gzip,ts:application/octet-stream -mod_weblog.log_format= -mod_weblog.logfile=/tmp/yhhtpd.log -server.chroot= -server.group_name= -server.log.loglevel=0 -server.no_keep-alive_ips= -server.user_name= -webserver.threading=false -webserver.websites=WebsiteMain From d1046fd8a5f193275fba8a05070889df650a3cff Mon Sep 17 00:00:00 2001 From: "[CST] Bas" Date: Tue, 29 Jan 2013 01:20:28 +0800 Subject: [PATCH 6/7] neutrino make nhttpd depend on neutrino's config. --- src/nhttpd/Makefile.am | 5 +++++ src/nhttpd/yconfig.h | 21 ++++++++++----------- src/nhttpd/yhttpd_core/Makefile.am | 1 + src/nhttpd/yhttpd_mods/Makefile.am | 1 + 4 files changed, 17 insertions(+), 11 deletions(-) diff --git a/src/nhttpd/Makefile.am b/src/nhttpd/Makefile.am index c78ebbbf8..1e1ea948d 100644 --- a/src/nhttpd/Makefile.am +++ b/src/nhttpd/Makefile.am @@ -18,5 +18,10 @@ INCLUDES = \ -I$(top_srcdir)/lib/connection \ @FREETYPE_CFLAGS@ + noinst_LIBRARIES = libnhttpd.a libnhttpd_a_SOURCES = yhttpd.cpp + +libnhttpd_adir = @CONFIGDIR@ +libnhttpd_a_DATA = nhttpd.conf +EXTRA_DIST = nhttpd.conf nhttpd.conf.in \ No newline at end of file diff --git a/src/nhttpd/yconfig.h b/src/nhttpd/yconfig.h index 3912dc04c..cc6a0170e 100644 --- a/src/nhttpd/yconfig.h +++ b/src/nhttpd/yconfig.h @@ -7,6 +7,9 @@ #ifndef __yconfig_h__ #define __yconfig_h__ +#ifdef HAVE_CONFIG_H +#include +#endif // c++ #include #include @@ -101,30 +104,26 @@ #define HTTPD_DEFAULT_LANGUAGE "English" #define AUTHUSER "root" -#ifndef TARGETPREFIX -#define TARGETPREFIX "" -#endif - -#define HTTPD_CONFIGDIR TARGETPREFIX"/var/tuxbox/config" +#define HTTPD_CONFIGDIR CONFIGDIR #define HTTPD_CONFIGFILE HTTPD_CONFIGDIR"/nhttpd.conf" #define YWEB_CONFIGFILE HTTPD_CONFIGDIR"/Y-Web.conf" -#define PUBLICDOCUMENTROOT TARGETPREFIX"/var/httpd" -#define NEUTRINO_CONFIGFILE TARGETPREFIX"/var/tuxbox/config/neutrino.conf" +#define PUBLICDOCUMENTROOT PUBLIC_HTTPDDIR +#define NEUTRINO_CONFIGFILE CONFIGDIR"/neutrino.conf" #define HOSTEDDOCUMENTROOT "/mnt/hosted" #define EXTRASDOCUMENTROOT "/mnt/hosted/extras" #define EXTRASDOCUMENTURL "/hosted/extras" -#define ZAPITXMLPATH TARGETPREFIX"/var/tuxbox/config/zapit" -#define TUXBOX_LOGOS_URL TARGETPREFIX"/usr/share/neutrino/icons/logos" +#define ZAPITXMLPATH CONFIGDIR"/zapit" +#define TUXBOX_LOGOS_URL ICONSDIR"/logo" // switch for Box differences #ifdef CONFIG_SYSTEM_TUXBOX #define AUTHPASSWORD "dbox2" -#define PRIVATEDOCUMENTROOT TARGETPREFIX"/share/tuxbox/neutrino/httpd-y" +#define PRIVATEDOCUMENTROOT DATADIR"/httpd-y" #endif #ifdef CONFIG_SYSTEM_TUXBOX_COOLSTREAM #define AUTHPASSWORD "coolstream" -#define PRIVATEDOCUMENTROOT TARGETPREFIX"/share/tuxbox/neutrino/httpd" +#define PRIVATEDOCUMENTROOT PRIVATE_HTTPDDIR #undef Y_CONFIG_BUILD_AS_DAEMON // No Daemon #endif //----------------------------------------------------------------------------- diff --git a/src/nhttpd/yhttpd_core/Makefile.am b/src/nhttpd/yhttpd_core/Makefile.am index ec562ae50..cc760e315 100644 --- a/src/nhttpd/yhttpd_core/Makefile.am +++ b/src/nhttpd/yhttpd_core/Makefile.am @@ -1,5 +1,6 @@ INCLUDES = \ -I$(srcdir) \ + -I$(top_srcdir) \ -I$(top_srcdir)/lib \ -I$(top_srcdir)/src/zapit/include \ -I$(top_srcdir)/src \ diff --git a/src/nhttpd/yhttpd_mods/Makefile.am b/src/nhttpd/yhttpd_mods/Makefile.am index 74d213c4f..95f936555 100644 --- a/src/nhttpd/yhttpd_mods/Makefile.am +++ b/src/nhttpd/yhttpd_mods/Makefile.am @@ -1,4 +1,5 @@ INCLUDES = \ + -I$(top_srcdir) \ -I$(top_srcdir)/lib \ -I$(top_srcdir)/src/zapit/include \ -I$(top_srcdir)/src \ From 1babe685297b82d99da0191da02e3e13b3a8d044 Mon Sep 17 00:00:00 2001 From: "[CST] Bas" Date: Tue, 29 Jan 2013 01:20:55 +0800 Subject: [PATCH 7/7] neutrino: fix file location. --- src/eitd/SIlanguage.cpp | 6 +++++- src/eitd/SIlanguage.hpp | 2 -- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/eitd/SIlanguage.cpp b/src/eitd/SIlanguage.cpp index 44db9a74d..6cc261251 100644 --- a/src/eitd/SIlanguage.cpp +++ b/src/eitd/SIlanguage.cpp @@ -22,6 +22,10 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * */ +#ifdef HAVE_CONFIG_H +#include +#endif + #include #include #include @@ -32,7 +36,7 @@ #include "SIlanguage.hpp" -#define LANGUAGEFILE CONFIGDIR "/epglanguages.conf" +static const char LANGUAGEFILE[] = CONFIGDIR "/epglanguages.conf"; std::vector SIlanguage::languages; pthread_mutex_t SIlanguage::languages_lock = PTHREAD_MUTEX_INITIALIZER; diff --git a/src/eitd/SIlanguage.hpp b/src/eitd/SIlanguage.hpp index 133aec0fc..7f80d3a76 100644 --- a/src/eitd/SIlanguage.hpp +++ b/src/eitd/SIlanguage.hpp @@ -29,8 +29,6 @@ #include -#define LANGUAGEFILE "/var/tuxbox/config/epglanguages.conf" - class SIlanguage { public: static void filter(const std::map& s, int max, std::string& retval);