Make tvheadend installable.
This commit is contained in:
parent
ce36fae9b2
commit
2cfd5ce48a
4 changed files with 50 additions and 10 deletions
25
Makefile
25
Makefile
|
@ -50,8 +50,31 @@ DLIBS += $(FFMPEG_DLIBS)
|
||||||
SLIBS += $(FFMPEG_SLIBS)
|
SLIBS += $(FFMPEG_SLIBS)
|
||||||
CFLAGS += $(FFMPEG_CFLAGS)
|
CFLAGS += $(FFMPEG_CFLAGS)
|
||||||
|
|
||||||
DLIBS += -lpthread
|
DLIBS += -lpthread -lm -lz
|
||||||
|
|
||||||
include ../build/prog.mk
|
include ../build/prog.mk
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# Install
|
||||||
|
#
|
||||||
|
prefix ?= $(INSTALLPREFIX)
|
||||||
|
INSTBIN= $(prefix)/bin
|
||||||
|
INSTMAN= $(prefix)/share/man1
|
||||||
|
INSTSHARE= $(prefix)/share/hts/tvheadend
|
||||||
|
|
||||||
|
install: ${PROG}
|
||||||
|
mkdir -p $(INSTBIN)
|
||||||
|
cd $(.OBJDIR) && install -s ${PROG} $(INSTBIN)
|
||||||
|
|
||||||
|
mkdir -p $(INSTMAN)
|
||||||
|
cd man && install ${MAN} $(INSTMAN)
|
||||||
|
|
||||||
|
mkdir -p $(INSTSHARE)/docs/html
|
||||||
|
cp docs/html/*.html $(INSTSHARE)/docs/html
|
||||||
|
|
||||||
|
mkdir -p $(INSTSHARE)/docs/docresources
|
||||||
|
cp docs/docresources/*.png $(INSTSHARE)/docs/docresources
|
||||||
|
|
||||||
|
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
|
||||||
|
|
18
main.c
18
main.c
|
@ -54,13 +54,13 @@
|
||||||
#include <libhts/htsparachute.h>
|
#include <libhts/htsparachute.h>
|
||||||
#include <libhts/htssettings.h>
|
#include <libhts/htssettings.h>
|
||||||
|
|
||||||
|
|
||||||
int running;
|
int running;
|
||||||
extern const char *htsversion;
|
extern const char *htsversion;
|
||||||
|
extern const char *htsversion_full;
|
||||||
time_t dispatch_clock;
|
time_t dispatch_clock;
|
||||||
static LIST_HEAD(, gtimer) gtimers;
|
static LIST_HEAD(, gtimer) gtimers;
|
||||||
pthread_mutex_t global_lock;
|
pthread_mutex_t global_lock;
|
||||||
|
const char *contentpath = HTS_INSTALL_PREFIX "/share/hts/tvheadend/";
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -197,7 +197,7 @@ main(int argc, char **argv)
|
||||||
|
|
||||||
signal(SIGPIPE, handle_sigpipe);
|
signal(SIGPIPE, handle_sigpipe);
|
||||||
|
|
||||||
while((c = getopt(argc, argv, "fu:g:s:")) != -1) {
|
while((c = getopt(argc, argv, "fu:g:s:c:")) != -1) {
|
||||||
switch(c) {
|
switch(c) {
|
||||||
case 'f':
|
case 'f':
|
||||||
forkaway = 1;
|
forkaway = 1;
|
||||||
|
@ -211,6 +211,9 @@ main(int argc, char **argv)
|
||||||
case 's':
|
case 's':
|
||||||
settingspath = optarg;
|
settingspath = optarg;
|
||||||
break;
|
break;
|
||||||
|
case 'c':
|
||||||
|
contentpath = optarg;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -319,12 +322,13 @@ main(int argc, char **argv)
|
||||||
|
|
||||||
syslog(LOG_NOTICE, "HTS Tvheadend version %s started, "
|
syslog(LOG_NOTICE, "HTS Tvheadend version %s started, "
|
||||||
"running as pid:%d uid:%d gid:%d, settings located in '%s'",
|
"running as pid:%d uid:%d gid:%d, settings located in '%s'",
|
||||||
htsversion, getpid(), getuid(), getgid(), hts_settings_get_root());
|
htsversion_full,
|
||||||
|
getpid(), getuid(), getgid(), hts_settings_get_root());
|
||||||
|
|
||||||
if(!forkaway)
|
if(!forkaway)
|
||||||
fprintf(stderr, "\nHTS Tvheadend version %s started, "
|
fprintf(stderr, "\nHTS Tvheadend version %s started.\n"
|
||||||
"settings located in '%s'\n",
|
"Settings located in '%s'\n",
|
||||||
htsversion, hts_settings_get_root());
|
htsversion_full, hts_settings_get_root());
|
||||||
|
|
||||||
mainloop();
|
mainloop();
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,10 @@
|
||||||
#include "version.h"
|
#include "version.h"
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
|
#ifdef HTS_RELEASE_TAG
|
||||||
|
const char *htsversion=HTS_RELEASE_TAG;
|
||||||
|
const char *htsversion_full=HTS_RELEASE_TAG " (" HTS_VERSION ")";
|
||||||
|
#else
|
||||||
const char *htsversion=HTS_VERSION;
|
const char *htsversion=HTS_VERSION;
|
||||||
|
const char *htsversion_full=HTS_VERSION;
|
||||||
|
#endif
|
||||||
|
|
|
@ -71,11 +71,17 @@ page_root(http_connection_t *hc, const char *remain, void *opaque)
|
||||||
/**
|
/**
|
||||||
* Static download of a file from the filesystem
|
* Static download of a file from the filesystem
|
||||||
*/
|
*/
|
||||||
|
extern char *contentpath;
|
||||||
|
|
||||||
static int
|
static int
|
||||||
page_static(http_connection_t *hc, const char *remain, void *opaque)
|
page_static(http_connection_t *hc, const char *remain, void *opaque)
|
||||||
{
|
{
|
||||||
int fd;
|
int fd;
|
||||||
const char *rootpath = HTS_BUILD_ROOT "/tvheadend/webui/static";
|
#ifdef HTS_BUILD_ROOT
|
||||||
|
const char *rootpath = HTS_BUILD_ROOT "/tvheadend";
|
||||||
|
#else
|
||||||
|
const char *rootpath = contentpath;
|
||||||
|
#endif
|
||||||
char path[500];
|
char path[500];
|
||||||
struct stat st;
|
struct stat st;
|
||||||
const char *content = NULL, *postfix;
|
const char *content = NULL, *postfix;
|
||||||
|
@ -90,7 +96,7 @@ page_static(http_connection_t *hc, const char *remain, void *opaque)
|
||||||
content = "text/javascript; charset=UTF-8";
|
content = "text/javascript; charset=UTF-8";
|
||||||
}
|
}
|
||||||
|
|
||||||
snprintf(path, sizeof(path), "%s/%s", rootpath, remain);
|
snprintf(path, sizeof(path), "%s/webui/static/%s", rootpath, remain);
|
||||||
|
|
||||||
if((fd = open(path, O_RDONLY)) < 0)
|
if((fd = open(path, O_RDONLY)) < 0)
|
||||||
return 404;
|
return 404;
|
||||||
|
|
Loading…
Add table
Reference in a new issue