Permalink
Browse files

Topo boot scripts cleanup

- there is no more generic boot scripts
- the boot scripts are specialized for each system (FreeBSD, Debian)
- the boot scripts are now located in the pkg subdirectories
- phase 1: freebsd topo* boot scripts

This commit is related to issue #34 and issue #32.
  • Loading branch information...
1 parent 65d629e commit b095179bf84759f3874bbcd5ff1e2cfa381d9540 Charlie Root committed Apr 18, 2012
@@ -44,6 +44,8 @@ RUN_DEPENDS+= pdflatex:${PORTSDIR}/print/teTeX-base \
.endif
.if ${PKGNAMESUFFIX} == "-topo"
+USE_RC_SUBR= topographd toposendd
+SUB_LIST= TCLSH=${TCLSH}
RUN_DEPENDS+= rancid-run:${PORTSDIR}/net-mgmt/rancid \
fping:${PORTSDIR}/net/fping
.endif
@@ -18,14 +18,14 @@
name=topographd
rcvar=topographd_enable
-command_interpreter=%TCLSH%
+command_interpreter=%%TCLSH%%
load_rc_config $name
: ${topographd_enable:=NO}
: ${topographd_flags:=""}
: ${topographd_user:="rancid"}
-command="%NMLIBDIR%/topo/topographd"
+command="%%PREFIX%%/sbin/topographd"
run_rc_command "$1"
@@ -18,14 +18,14 @@
name=toposendd
rcvar=toposendd_enable
-command_interpreter=%TCLSH%
+command_interpreter=%%TCLSH%%
load_rc_config $name
: ${toposendd_enable:=NO}
: ${toposendd_flags:=""}
: ${toposendd_user:="rancid"}
-command="%NMLIBDIR%/topo/toposendd"
+command="%%PREFIX%%/sbin/toposendd"
run_rc_command "$1"
@@ -20,12 +20,18 @@ lib/netmagis/topo/parse-server.tcl
lib/netmagis/topo/sendmail
lib/netmagis/topo/ssidsensors
lib/netmagis/topo/start-rancid
-lib/netmagis/topo/topographd
-lib/netmagis/topo/toposendd
+sbin/topographd
+sbin/toposendd
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/eqvirt/README
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/eqvirt/rtr.eq
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/eqvirt/sw1.eq
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/eqvirt/sw2.eq
@dirrmtry var/netmagis/eqvirt
@dirrmtry var/netmagis/eqgen
@dirrmtry var/netmagis
@dirrmtry var
+%%PORTEXAMPLES%%@dirrm %%EXAMPLESDIR%%/eqvirt
+%%PORTEXAMPLES%%@dirrm %%EXAMPLESDIR%%
@dirrm lib/netmagis/topo
@dirrm lib/netmagis
@exec mkdir -p %D/var/netmagis/eqvirt
View
@@ -8,7 +8,6 @@ build:
install: build
@echo ">>> Making install in `pwd`"
cd src ; make $(DIRS) install
- cd rc ; make $(DIRS) install
cd eqvirt ; make $(DIRS) install
mkdir -p $(DESTDIR)$(NMVARDIR)/eqvirt
mkdir -p $(DESTDIR)$(NMVARDIR)/eqgen
View
@@ -1,14 +0,0 @@
-NINSTALL = ../../ninstall
-
-build:
- @echo ">>> Making build in `pwd`"
-
-install:
- @echo ">>> Making install in `pwd`"
- case `uname -s` in \
- Linux) cd debian ; make $(DIRS) install ;; \
- FreeBSD) cd freebsd ; make $(DIRS) install ;; \
- *) cd generic ; make $(DIRS) install ;; \
- esac
-
-clean:
View
@@ -1,16 +0,0 @@
-NINSTALL = ../../../ninstall
-
-SCRIPTS= \
- topographd \
- toposendd
-
-build:
- @echo ">>> Making build in `pwd`"
-
-install:
- @echo ">>> Making install in `pwd`"
- mkdir -p $(DESTDIR)$(RCDIR)
- $(NINSTALL) -m 0755 -e "s|%NMLIBDIR%|$(NMLIBDIR)|" \
- $(SUBST) $(SCRIPTS) $(DESTDIR)$(RCDIR)
-
-clean:
View
@@ -1,16 +0,0 @@
-NINSTALL = ../../../ninstall
-
-SCRIPTS= \
- topographd.sh \
- toposendd.sh
-
-build:
- @echo ">>> Making build in `pwd`"
-
-install:
- @echo ">>> Making install in `pwd`"
- mkdir -p $(DESTDIR)$(RCDIR)
- $(NINSTALL) -m 0755 -e "s|%NMLIBDIR%|$(NMLIBDIR)|" \
- $(SUBST) $(SCRIPTS) $(DESTDIR)$(RCDIR)
-
-clean:
@@ -1,39 +0,0 @@
-#!/bin/sh
-
-#
-# Start-up script for topographd daemon
-#
-# Historique
-# 2007/07/03 : pda/jean : design
-# 2010/11/05 : pda/jean : copy from old script for the new daemon
-# 2010/12/15 : pda/jean : split for topographd
-#
-
-topographd_program=%NMLIBDIR%/topo/topographd
-
-case "$1" in
- start)
- echo -n ' topographd'
- su rancid -c "$topographd_program"
- ;;
- stop)
- /bin/kill `ps axwww | grep "$topographd_program" | grep -v "grep" | cut -c1-5`
- ;;
- restart)
- echo "Restart topographd"
- /bin/kill `ps axwww | egrep "$topographd_program" | grep -v "grep" | cut -c1-5`
- su rancid -c "$topographd_program"
- ;;
- debug)
- shift
- echo "Reload topographd with level $1"
- /bin/kill `ps axwww | grep $topographd_program | grep -v "grep" | cut -c1-5`
- su rancid -c "$topographd_program -v $1"
- ;;
- *)
- echo "Usage: $0 {start | stop | restart | debug n}"
- exit 1
- ;;
-esac
-
-exit 0
@@ -1,39 +0,0 @@
-#!/bin/sh
-
-#
-# Start-up script for toposendd daemon
-#
-# Historique
-# 2007/07/03 : pda/jean : design
-# 2010/11/05 : pda/jean : copy from old script for the new daemon
-# 2010/12/15 : pda/jean : split for toposendd
-#
-
-toposendd_program=%NMLIBDIR%/topo/toposendd
-
-case "$1" in
- start)
- echo -n ' toposendd'
- su rancid -c "$toposendd_program"
- ;;
- stop)
- /bin/kill `ps axwww | grep "$toposendd_program" | grep -v "grep" | cut -c1-5`
- ;;
- restart)
- echo "Restart toposendd"
- /bin/kill `ps axwww | egrep "$toposendd_program" | grep -v "grep" | cut -c1-5`
- su rancid -c "$toposendd_program"
- ;;
- debug)
- shift
- echo "Reload toposendd with level $1"
- /bin/kill `ps axwww | grep $toposendd_program | grep -v "grep" | cut -c1-5`
- su rancid -c "$toposendd_program -v $1"
- ;;
- *)
- echo "Usage: $0 {start | stop | restart | debug n}"
- exit 1
- ;;
-esac
-
-exit 0
View
@@ -24,11 +24,13 @@ SCRIPTS = \
list-rancid \
list-vlans \
ssidsensors \
- topographd \
- toposendd \
start-rancid \
sendmail
+DAEMONS = \
+ topographd \
+ toposendd
+
LIBS = \
parse-hp.tcl \
parse-cisco.tcl \
@@ -53,6 +55,8 @@ install: $(PROGS) $(SCRIPTS)
install -m 0755 $(PROGS) $(DESTDIR)$(NMLIBDIR)/topo
$(NINSTALL) -m 0755 $(SUBST) $(SCRIPTS) $(DESTDIR)$(NMLIBDIR)/topo
$(NINSTALL) -m 0644 $(SUBST) $(LIBS) $(DESTDIR)$(NMLIBDIR)/topo
+ mkdir -p $(DESTDIR)$(SBINDIR)
+ $(NINSTALL) -m 0755 $(SUBST) $(DAEMONS) $(DESTDIR)$(SBINDIR)
clean:
rm -f *.o $(PROGS) *.core

0 comments on commit b095179

Please sign in to comment.