Final touches to the buildsystem for installing

This commit is contained in:
Andreas Öman 2008-10-11 07:18:59 +00:00
parent 2cfd5ce48a
commit c791a60b86
3 changed files with 9 additions and 8 deletions

View file

@ -78,3 +78,8 @@ install: ${PROG}
find webui/static/ -type d |grep -v .svn | awk '{print "$(INSTSHARE)/"$$0}' | xargs mkdir -p
find webui/static/ -type f |grep -v .svn | awk '{print $$0 " $(INSTSHARE)/"$$0}' | xargs -n2 cp
uninstall:
rm -f $(INSTBIN)/${PROG}
rm -f $(INSTMAN)/${MAN}
rm -rf $(INSTSHARE)

2
main.c
View file

@ -60,8 +60,8 @@ extern const char *htsversion_full;
time_t dispatch_clock;
static LIST_HEAD(, gtimer) gtimers;
pthread_mutex_t global_lock;
const char *contentpath = HTS_INSTALL_PREFIX "/share/hts/tvheadend/";
const char *contentpath = HTS_CONTENT_PATH "/tvheadend";
static void
handle_sigpipe(int x)

View file

@ -71,17 +71,13 @@ page_root(http_connection_t *hc, const char *remain, void *opaque)
/**
* Static download of a file from the filesystem
*/
extern char *contentpath;
static int
page_static(http_connection_t *hc, const char *remain, void *opaque)
{
extern char *contentpath;
int fd;
#ifdef HTS_BUILD_ROOT
const char *rootpath = HTS_BUILD_ROOT "/tvheadend";
#else
const char *rootpath = contentpath;
#endif
char path[500];
struct stat st;
const char *content = NULL, *postfix;
@ -96,7 +92,7 @@ page_static(http_connection_t *hc, const char *remain, void *opaque)
content = "text/javascript; charset=UTF-8";
}
snprintf(path, sizeof(path), "%s/webui/static/%s", rootpath, remain);
snprintf(path, sizeof(path), "%s/webui/static/%s", contentpath, remain);
if((fd = open(path, O_RDONLY)) < 0)
return 404;