File fix_for_rpm.diff of Package ntripcaster
diff -ur ../ntripcaster0.1.5/conf/Makefile.am ./conf/Makefile.am
--- ../ntripcaster0.1.5/conf/Makefile.am 2004-01-22 13:45:46.000000000 +0100
+++ ./conf/Makefile.am 2008-02-29 12:00:54.000000000 +0100
@@ -2,9 +2,6 @@
AUTOMAKE_OPTIONS = foreign
-all:
-
-etcdir = $(NTRIPCASTER_ETCDIR_INST)
etc_DATA = ntripcaster.conf.dist sourcetable.dat.dist
EXTRA_DIST = $(etc_DATA)
diff -ur ../ntripcaster0.1.5/conf/ntripcaster.conf.dist.in ./conf/ntripcaster.conf.dist.in
--- ../ntripcaster0.1.5/conf/ntripcaster.conf.dist.in 2006-03-01 15:54:10.000000000 +0100
+++ ./conf/ntripcaster.conf.dist.in 2008-02-29 12:09:53.000000000 +0100
@@ -34,7 +34,7 @@
######################## Main Server Logfile ##################################
# logfile contains information about connections, warnings, errors etc.
-logdir @NTRIPCASTER_LOGDIR_INST@
+logdir /var/log
logfile ntripcaster.log
############################ Access Control ###################################
diff -ur ../ntripcaster0.1.5/configure.in ./configure.in
--- ../ntripcaster0.1.5/configure.in 2005-04-28 13:59:09.000000000 +0200
+++ ./configure.in 2008-02-29 12:00:54.000000000 +0100
@@ -1,6 +1,5 @@
-
-
-AC_INIT(src/main.c)
+AC_INIT
+AC_CONFIG_SRCDIR([src/main.c])
NTRIPCASTER_MAJOR=0
NTRIPCASTER_MINOR=1
@@ -22,28 +21,30 @@
prefix=$prefix
fi
-NTRIPCASTER_BINDIR=${prefix}/bin
-NTRIPCASTER_ETCDIR_INST=${prefix}/conf
-NTRIPCASTER_LOGDIR_INST=${prefix}/logs
-NTRIPCASTER_ETCDIR=conf
-NTRIPCASTER_LOGDIR=logs
-NTRIPCASTER_SHAREDIR=${prefix}
+if test "$bindir" = ""; then
+ bindir='${prefix}/bin'
+fi
+if test "$etcdir" = ""; then
+ etcdir='${prefix}/conf'
+fi
+if test "$logdir" = ""; then
+ logdir='${prefix}/logs'
+fi
+
+AC_ARG_VAR(logdir,
+ [where to store logfile])
+AC_ARG_VAR(etcdir,
+ [where to store configuration])
-AM_CONFIG_HEADER(config.h)
+AC_CONFIG_HEADERS([config.h])
AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
AC_SUBST(VERSION)
-AC_SUBST(NTRIPCASTER_BINDIR)
-AC_SUBST(NTRIPCASTER_ETCDIR_INST)
-AC_SUBST(NTRIPCASTER_LOGDIR_INST)
-
-AC_DEFINE_UNQUOTED(NTRIPCASTER_ETCDIR, "$NTRIPCASTER_ETCDIR")
-AC_SUBST(NTRIPCASTER_ETCDIR)
-AC_DEFINE_UNQUOTED(NTRIPCASTER_LOGDIR, "$NTRIPCASTER_LOGDIR")
-AC_SUBST(NTRIPCASTER_LOGDIR)
+AC_SUBST(bindir)
+AC_SUBST(etcdir)
+AC_SUBST(logdir)
-AC_ARG_PROGRAM
AC_PROG_RANLIB
AC_PROG_CC
@@ -65,7 +66,7 @@
case $system in
Linux)
LINUX=1
- AC_DEFINE(LINUX)
+ AC_DEFINE([LINUX], 1, [Do we run LINUX?])
AC_MSG_RESULT(Linux)
;;
SunOS)
@@ -74,9 +75,9 @@
SVR4=1
SOLARIS=1
AC_MSG_RESULT(Solaris)
- AC_DEFINE(SYSV)
- AC_DEFINE(SVR4)
- AC_DEFINE(SOLARIS)
+ AC_DEFINE([SYSV],1,[Do we run SystemV?])
+ AC_DEFINE([SVR4],1,[Do we run SVR4?])
+ AC_DEFINE([SOLARIS],1,[Do we run Solaris?])
else
AC_MSG_RESULT(SunOS)
fi
@@ -86,7 +87,7 @@
;;
HP-UX)
hpux=1
- AC_DEFINE(hpux)
+ AC_DEFINE([hpux], 1, [Do we run on HP UNIX?])
AC_MSG_RESULT(HP-UX)
CFLAGS="$CFLAGS -D_HPUX_SOURCE -DHPUX"
if test "$CC" = cc; then
@@ -95,12 +96,12 @@
;;
IRIX)
IRIX=yes
- AC_DEFINE(IRIX)
+ AC_DEFINE([IRIX], 1, [Do we run on IRIX?])
AC_MSG_RESULT(IRIX)
;;
BSD/OS)
__SOMEBSD__=yes
- AC_DEFINE(__SOMEBSD__)
+ AC_DEFINE([__SOMEBSD__], 1, [Do we run on a BSD system?])
AC_MSG_RESULT(BSD/OS)
;;
*BSD*)
@@ -110,10 +111,7 @@
OLDCPPFLAGS=$CPPFLAGS
THREADCPPFLAGS="-pthread"
CPPFLAGS="$OLDCPPFLAGS $THREADCPPFLAGS"
- AC_TRY_COMPILE([#include <pthread.h>],
- [pthread_t thread; ],
- ,
- CPPFLAGS="$OLDCPPFLAGS")
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <pthread.h>]], [[pthread_t thread; ]])],[],[CPPFLAGS="$OLDCPPFLAGS"])
CPPFLAGS=$OLDCPPFLAGS
if test "$CC" = gcc; then
CFLAGS="-pthreads $CFLAGS"
@@ -237,7 +235,7 @@
dnl Do we want libwrap?
AC_MSG_CHECKING(whether to use libwrap)
AC_ARG_WITH(libwrap,
-[ --with-libwrap[=PATH] compile in libwrap (tcp_wrappers) support.],
+[ --with-libwrap[=PATH] compile in libwrap (tcp_wrappers) support.],
[ case "$withval" in
no)
AC_MSG_RESULT(no)
@@ -257,10 +255,7 @@
fi
OLDLIBS="$LIBS"
LIBS="$WRAPLIBS $LIBS"
- AC_TRY_LINK([int allow_severity; int deny_severity; ],
- [hosts_access(); ],
- [],
- [AC_MSG_ERROR(Could not find the $withval library. You must first install tcp_wrappers.)])
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[int allow_severity; int deny_severity; ]], [[hosts_access(); ]])],[],[AC_MSG_ERROR(Could not find the $withval library. You must first install tcp_wrappers.)])
LIBS="$OLDLIBS"
;;
esac ],
@@ -268,7 +263,7 @@
)
if test "$opt_libwrap" = yes; then
-AC_DEFINE(HAVE_LIBWRAP)
+AC_DEFINE([HAVE_LIBWRAP], 1, [Do we have libwrap?])
AC_CHECK_FUNCS(yp_get_default_domain)
@@ -304,7 +299,7 @@
CRYPTLIB=
if test "$opt_crypt" = yes; then
AC_CHECK_LIB(crypt, crypt, CRYPTLIB="-lcrypt",)
- AC_DEFINE(USE_CRYPT)
+ AC_DEFINE([USE_CRYPT], 1, [Can we use libcrypt?])
fi
AC_SUBST(CRYPTLIB)
@@ -312,14 +307,11 @@
THREADLIBS="no"
AC_MSG_CHECKING(for pthread functions in standard libraries)
-AC_TRY_LINK(, [pthread_create();],AC_MSG_RESULT(yes);THREADLIBS="",AC_MSG_RESULT(no))
+AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[pthread_create();]])],[AC_MSG_RESULT(yes);THREADLIBS=""],[AC_MSG_RESULT(no)])
if test "$THREADLIBS" = ""; then
AC_MSG_CHECKING(if that definition really works)
- AC_TRY_RUN([int main() { return !pthread_equal(pthread_self(), pthread_self());}],
- AC_MSG_RESULT(yes);THREADLIBS="",
- AC_MSG_RESULT(no);THREADLIBS="no",
- AC_MSG_RESULT(crosscompiling so no);THREADLIBS="no")
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[int main() { return !pthread_equal(pthread_self(), pthread_self());}]])],[AC_MSG_RESULT(yes);THREADLIBS=""],[AC_MSG_RESULT(no);THREADLIBS="no"],[AC_MSG_RESULT(crosscompiling so no);THREADLIBS="no"])
fi
if test "$THREADLIBS" = "no"; then
@@ -344,40 +336,7 @@
LIBS="$LIBS $THREADLIBS"
CFLAGS="$THREADCPPFLAGS $CPPFLAGS $CFLAGS"
-AC_ARG_WITH(python,
-[ --with-python[=ARG] enable usage of the python interpreter [ARG=yes]])
-
-AC_ARG_WITH(python-includes,
-[ --with-python-includes=DIR Python include files are in DIR])
-AC_ARG_WITH(python-libraries,
-[ --with-python-libraries=DIR Python library file are in DIR])
-
-if test "$with_python_includes"; then
- CPPFLAGS="$CPPFLAGS -I$with_python_includes"
- if test "$with_python" = ""; then
- with_python=yes
- fi
-fi
-
-if test "$with_python_libraries"; then
- LIBS="$LIBS -L$with_python_libraries"
- if test "$with_python" = ""; then
- with_python=yes
- fi
-fi
-
-if test "$with_python"; then
-dnl I can't say for sure what libs we need for python, but this is what my system needs
-AC_CHECK_LIB(dl, dlopen)
- for lib in python python2.0 python1.6 python1.5; do
- AC_CHECK_LIB($lib, Py_Initialize)
- done
-fi
-
-AC_TRY_COMPILE([#include <syslog.h>],
- [int foo = LOG_DAEMON; ],
- ,
- AC_DEFINE(NEED_SYS_SYSLOG_H))
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <syslog.h>]], [[int foo = LOG_DAEMON; ]])],[],[AC_DEFINE([NEED_SYS_SYSLOG_H],1,[Do we need sys/syslog.h?])])
dnl Checks for header files.
AC_HEADER_STDC
@@ -392,20 +351,17 @@
AC_TYPE_SIGNAL
AC_HEADER_TIME
AC_STRUCT_TM
-AC_RETSIGTYPE
+AC_TYPE_SIGNAL
AC_MSG_CHECKING([for unix98 socklen_t])
-AC_TRY_COMPILE([#include <sys/types.h>
- #include <sys/socket.h>],
- [typedef socklen_t int;
- int apan (void) {return 1;}],
- AC_MSG_RESULT(yeah)
- HAVE_SOCKLEN_T=yes,
- AC_MSG_RESULT(nah)
- HAVE_SOCKLEN_T=no)
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
+ #include <sys/socket.h>]], [[socklen_t sockl;
+ int main (void) {return 1;}]])],[AC_MSG_RESULT(yes)
+ HAVE_SOCKLEN_T=yes],[AC_MSG_RESULT(no)
+ HAVE_SOCKLEN_T=no])
if test ${HAVE_SOCKLEN_T} = yes ;then
- AC_DEFINE(HAVE_SOCKLEN_T)
+ AC_DEFINE([HAVE_SOCKLEN_T], 1, [Do we have socklen_t define?])
fi
dnl Checks for library functions.
@@ -415,9 +371,10 @@
AC_CHECK_FUNCS(gettimeofday strstr snprintf vsnprintf rename setpgid basename setsockopt gethostbyname_r gethostbyaddr_r getrlimit setrlimit umask inet_addr inet_aton localtime_r select pthread_attr_setstacksize inet_ntoa mcheck mallinfo mtrace sigaction pthread_sigmask lseek)
AC_MSG_CHECKING(if libm is bundled with some lib we're already linking)
-AC_TRY_LINK(, [sin(1);],AC_MSG_RESULT(yes);LDLAGS="",AC_MSG_RESULT(no);LDFLAGS="-lm")
+AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[sin(1);]])],[AC_MSG_RESULT(yes);LDLAGS=""],[AC_MSG_RESULT(no);LDFLAGS="-lm"])
-AC_OUTPUT([Makefile src/Makefile conf/Makefile conf/ntripcaster.conf.dist])
+AC_CONFIG_FILES([Makefile src/Makefile conf/Makefile conf/ntripcaster.conf.dist])
+AC_OUTPUT
echo "Ok, everything seems ok. Now do 'make'."
echo "You can then run make install to install as you specified"
diff -ur ../ntripcaster0.1.5/Makefile.am ./Makefile.am
--- ../ntripcaster0.1.5/Makefile.am 2004-01-22 13:45:46.000000000 +0100
+++ ./Makefile.am 2008-02-29 12:00:54.000000000 +0100
@@ -5,6 +5,6 @@
SUBDIRS = src conf
install-data-local:
- mkdir -p $(DESTDIR)$(NTRIPCASTER_LOGDIR_INST)
+ mkdir -p $(DESTDIR)$(logdir)
-## EXTRA_DIST =
+EXTRA_DIST = rcscript COPYRIGHT ntripcaster.spec CHANGES
diff -ur ../ntripcaster0.1.5/src/avl.c ./src/avl.c
--- ../ntripcaster0.1.5/src/avl.c 2004-04-22 18:12:30.000000000 +0200
+++ ./src/avl.c 2008-02-29 12:00:54.000000000 +0100
@@ -79,7 +79,7 @@
#include "avl.h"
-#if !PSPP && !__GCC__
+#if !PSPP && !__GCC__ && !defined(__GNUC__)
#define inline
#endif
diff -ur ../ntripcaster0.1.5/src/client.c ./src/client.c
--- ../ntripcaster0.1.5/src/client.c 2005-04-28 13:57:56.000000000 +0200
+++ ./src/client.c 2008-02-29 12:00:54.000000000 +0100
@@ -371,6 +371,7 @@
int nBytes = 1,
nBufferBytes = 0,
fsize = 0;
+ char *sourcetable;
char *time;
time = get_log_time();
@@ -378,7 +379,10 @@
sock_write_line (con->sock, "SOURCETABLE 200 OK");
sock_write_line (con->sock, "Server: NTRIP NtripCaster %s/%s", info.version, info.ntrip_version);
// sock_write_line (con->sock, "Date: %s %s", time, info.timezone);
- ifp = fopen("../conf/sourcetable.dat","r");
+
+ sourcetable = get_icecast_file("sourcetable.dat", conf_file_e, R_OK);
+ ifp = fopen(sourcetable,"r");
+ nfree(sourcetable);
if (ifp != NULL) {
fseek(ifp, 0, SEEK_END);
fsize = (int)ftell(ifp);
diff -ur ../ntripcaster0.1.5/src/Makefile.am ./src/Makefile.am
--- ../ntripcaster0.1.5/src/Makefile.am 2004-01-22 13:45:46.000000000 +0100
+++ ./src/Makefile.am 2008-02-29 12:00:54.000000000 +0100
@@ -1,17 +1,17 @@
## Process this with automake to create Makefile.in
+AM_CPPFLAGS = -DDEFAULT_LOG_DIR="\"$(logdir)\"" \
+ -DDEFAULT_ETC_DIR="\"$(etcdir)\""
+
AUTOMAKE_OPTIONS = foreign
bin_PROGRAMS = ntripcaster
noinst_HEADERS = avl.h client.h definitions.h connection.h \
- ntrip_string.h ntripcaster.h log.h main.h \
+ ntrip_string.h ntripcaster.h log.h main.h \
sock.h source.h threads.h timer.h utility.h
ntripcaster_SOURCES = main.c client.c source.c connection.c log.c \
sock.c threads.c utility.c avl.c timer.c ntrip_string.c
INCLUDES = -D_REENTRANT @WRAPINCLUDES@
-
-bindir=$(NTRIPCASTER_BINDIR)
-
diff -ur ../ntripcaster0.1.5/src/ntripcaster.h ./src/ntripcaster.h
--- ../ntripcaster0.1.5/src/ntripcaster.h 2004-04-29 17:37:57.000000000 +0200
+++ ./src/ntripcaster.h 2008-02-29 12:00:54.000000000 +0100
@@ -87,8 +87,12 @@
#define DEFAULT_ENCODER_PASSWORD "sesam01"
#define DEFAULT_CLIENT_PASSWORD "prettyplease"
#define DEFAULT_LOGFILE "ntripcaster.log"
-#define DEFAULT_LOG_DIR "."
-#define DEFAULT_ETC_DIR "."
+#ifndef DEFAULT_LOG_DIR
+ #define DEFAULT_LOG_DIR "/usr/local/ntripcaster/logs/"
+#endif
+#ifndef DEFAULT_ETC_DIR
+ #define DEFAULT_ETC_DIR "/usr/local/ntripcaster/conf/"
+#endif
#define DEFAULT_CONFIG_FILE "ntripcaster.conf"
#define DEFAULT_STATUSTIME 60
#define DEFAULT_LOCATION "BKG Geodetic Department"
diff -ur ../ntripcaster0.1.5/src/utility.c ./src/utility.c
--- ../ntripcaster0.1.5/src/utility.c 2005-04-07 12:57:09.000000000 +0200
+++ ./src/utility.c 2008-02-29 12:00:54.000000000 +0100
@@ -200,8 +200,8 @@
case source_e:
write_log (LOG_DEFAULT,
- "Kicking source %d [%s] [%s] [%s], connected for %s, %lu bytes transfered. %d sources connected",
- con->id, con_host (con), reason, con->food.source->type == encoder_e ? "encoder" : "relay",
+ "Kicking source %d on mount %s [%s] [%s] [%s], connected for %s, %lu bytes transfered. %d sources connected",
+ con->id, con->food.source->audiocast.mount, con_host (con), reason, con->food.source->type == encoder_e ? "encoder" : "relay",
nice_time (get_time () - con->connect_time, timebuf), con->food.source->stats.read_bytes, info.num_sources - 1);
if (con->food.source->connected == SOURCE_UNUSED)
close_connection (con, NULL);