Added chkconfig enabled init script. Changed apidocs build dependencies.

git-svn-id: http://yate.null.ro/svn/yate/trunk@33 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
paulc 2004-09-06 09:00:42 +00:00
parent 60decefdac
commit 91ea1a2604
2 changed files with 89 additions and 11 deletions

View File

@ -58,10 +58,15 @@ clean:
.PHONY: engine
engine: tables yatepaths.h $(LIBS) $(SLIBS) $(PROGS)
.PHONY: apidocs
apidocs: check-topdir
.PHONY: apidocs-build
apidocs-build: check-topdir
kdoc -d docs/api/ $(INCS)
apidocs: @srcdir@/docs/api/index.html
@srcdir@/docs/api/index.html: @srcdir@/telengine.h @srcdir@/telephony.h
$(MAKE) apidocs-build
.PHONY: strip
strip: all
-strip --strip-debug --discard-locals $(PROGS) $(SLIBS)
@ -70,10 +75,15 @@ strip: all
sex: strip
@echo 'Stripped for you!'
# Let's have a little fun
.PHONY: love
love:
@echo 'Not war?'
.PHONY: war
war:
@echo 'Please make love instead!'
.PHONY: run
run: all
-./run
@ -103,32 +113,32 @@ yatepaths.h:
@echo -en '#define MOD_PATH "$(DESTDIR)$(moddir)"\n#define CFG_PATH "$(DESTDIR)$(confdir)"\n' > $@
.PHONY: everything
everything: all test
everything: all apidocs test
.PHONY: install
install: all
install: all apidocs
@mkdir -p "$(DESTDIR)$(libdir)/" && \
install $(SLIBS) "$(DESTDIR)$(libdir)/" && ldconfig
@mkdir -p "$(DESTDIR)$(bindir)/" && \
install $(PROGS) yate-config "$(DESTDIR)$(bindir)/"
$(MAKE) -C ./modules $@
$(MAKE) -C ./conf.d $@
@mkdir -p "$(DESTDIR)$(mandir)/man8/" && \
for i in $(MAN8) ; do \
install -m 0644 @srcdir@/$$i "$(DESTDIR)$(mandir)/man8/" ; \
done
@mkdir -p "$(DESTDIR)$(libdir)/pkgconfig/" && \
install yate.pc "$(DESTDIR)$(libdir)/pkgconfig/"
@mkdir -p "$(DESTDIR)$(incdir)/" && \
for i in $(INCS) ; do \
install -m 0644 @srcdir@/$$i "$(DESTDIR)$(incdir)/" ; \
done
@mkdir -p "$(DESTDIR)$(mandir)/man8/" && \
for i in $(MAN8) ; do \
install -m 0644 @srcdir@/$$i "$(DESTDIR)$(mandir)/man8/" ; \
done
@mkdir -p "$(DESTDIR)$(docdir)/api/" && \
for i in $(DOCS) ; do \
install -m 0644 @srcdir@/$$i "$(DESTDIR)$(docdir)/" ; \
done ;
install -m 0644 @srcdir@/docs/*.html "$(DESTDIR)$(docdir)/" && \
install -m 0644 @srcdir@/docs/api/*.html "$(DESTDIR)$(docdir)/api/"
$(MAKE) -C ./modules $@
$(MAKE) -C ./conf.d $@
.PHONY: uninstall
uninstall:
@ -206,6 +216,6 @@ libyate.so: $(ENGOBJS) $(LIBS)
.PHONY: help
help:
@echo -e 'Usual make targets:\n\
all engine modules test everything apidocs\n\
all engine modules apidocs test everything\n\
install uninstall\n\
snapshot tarball'

68
yate.init Executable file
View File

@ -0,0 +1,68 @@
#!/bin/sh
#
# yate: Starts the Yet Another Telephony Engine
#
# chkconfig: 345 95 15
# description: Starts and stops YATE used as Telephony Server
#
# processname: yate
# pidfile: /var/run/yate.pid
#
# Extra Yate command line options
OPTS="-vvvvv -l /var/log/yate"
# Source function library.
. /etc/rc.d/init.d/functions
RETVAL=0
start() {
echo -n $"Starting YATE: "
daemon yate -d -p /var/run/yate.pid $OPTS
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/yate
}
stop() {
echo -n $"Stopping YATE: "
killproc yate
RETVAL=$?
echo
if [ $RETVAL -eq 0 ]; then
rm -f /var/lock/subsys/yate
fi
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status yate
RETVAL=$?
;;
restart)
stop
start
;;
condrestart)
if [ -f /var/lock/subsys/yate ]; then
stop
start
fi
;;
reload)
killproc yate -HUP
RETVAL=$?
;;
*)
echo $"Usage: $0 {start|stop|status|restart|condrestart|reload}"
;;
esac
exit $RETVAL