aboutsummaryrefslogtreecommitdiff
path: root/rpkid/portal-gui
diff options
context:
space:
mode:
authorMichael Elkins <melkins@tislabs.com>2013-03-07 18:33:41 +0000
committerMichael Elkins <melkins@tislabs.com>2013-03-07 18:33:41 +0000
commit353e21c13948820776376e724ade98b408603727 (patch)
tree296ab2600d2e646659d5ef9f53bcfd18e71e905f /rpkid/portal-gui
parentb1f54c89953012d98206a566a780f536b5ed6232 (diff)
move installation of most portal-gui scripts to setup.py (see #373)
add script to be invoked by cron to download routeviews data add install-linux target for creating cron jobs for some rpki gui tasks svn path=/trunk/; revision=5119
Diffstat (limited to 'rpkid/portal-gui')
-rw-r--r--rpkid/portal-gui/Makefile.in16
-rwxr-xr-xrpkid/portal-gui/routeviews.sh12
2 files changed, 23 insertions, 5 deletions
diff --git a/rpkid/portal-gui/Makefile.in b/rpkid/portal-gui/Makefile.in
index 7eb2e572..bb5283f2 100644
--- a/rpkid/portal-gui/Makefile.in
+++ b/rpkid/portal-gui/Makefile.in
@@ -43,25 +43,31 @@ edit = sed \
apache.conf: $(srcdir)/apache.conf.in Makefile
$(edit) $@.in > $@
-install: $(BUILD)
- if test -d $(SYSCONFDIR); then :; else ${INSTALL} -d $(SYSCONFDIR); fi
+install: all install-always
+
+install-always:
if test -d $(INSTDIR)/wsgi; then :; else ${INSTALL} -d $(INSTDIR)/wsgi; fi
if test -d $(INSTDIR)/media; then :; else ${INSTALL} -d $(INSTDIR)/media; fi
if test -d $(INSTDIR)/media/css; then :; else ${INSTALL} -d $(INSTDIR)/media/css; fi
if test -d $(INSTDIR)/media/img; then :; else ${INSTALL} -d $(INSTDIR)/media/img; fi
if test -d $(INSTDIR)/media/js; then :; else ${INSTALL} -d $(INSTDIR)/media/js; fi
- ${INSTALL} -m 644 apache.conf $(SYSCONFDIR)/apache.conf
${INSTALL} -m 644 rpki.wsgi $(INSTDIR)/wsgi/rpki.wsgi
- ${INSTALL} -m 644 settings.py ${SYSCONFDIR}
# this would be better handled with "django-admin collectstatic" but makes the install
# process harder for the end user.
${INSTALL} -m 644 $(srcdir)/../rpki/gui/app/static/css/* $(INSTDIR)/media/css
${INSTALL} -m 644 $(srcdir)/../rpki/gui/app/static/js/* $(INSTDIR)/media/js
${INSTALL} -m 644 $(srcdir)/../rpki/gui/app/static/img/* $(INSTDIR)/media/img
+install-linux:
+ t=$$(hexdump -n 1 -e '"%u"' /dev/urandom) && echo "$$(($$t % 60)) 0/2 * * * nobody ${datarootdir}/rpki/routeviews.sh" > ${DESTDIR}/etc/cron.d/rpkigui-routeviews
+ chmod 644 ${DESTDIR}/etc/cron.d/rpkigui-routeviews
+ ln -sf ${DESTDIR}${sbindir}/rpkigui-check-expired /etc/cron.daily/rpkigui-check-expired
+
deinstall uninstall:
rm -rf $(INSTDIR)/media $(INSTDIR)/wsgi
- rm -rf $(SYSCONFDIR)/apache.conf $(SYSCONFDIR)/settings.py $(SYSCONFDIR)/settings.pyc
+
+deinstall-linux:
+ rm -f /etc/cron.d/rpkigui-routeviews /etc/cron.daily/rpkigui-check-expired
test:
@true
diff --git a/rpkid/portal-gui/routeviews.sh b/rpkid/portal-gui/routeviews.sh
new file mode 100755
index 00000000..ad8f40ba
--- /dev/null
+++ b/rpkid/portal-gui/routeviews.sh
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+i=oix-full-snapshot-latest.dat.bz2
+o=/tmp/$i
+
+#curl -s -S -o $o http://archive.routeviews.org/oix-route-views/$i
+# wget is stock in Ubuntu so use that instead of curl
+wget -q -O $o http://archive.routeviews.org/oix-route-views/$i
+
+if [ $? -eq 0 ]; then
+ rpkigui-import-routes -l error $o
+fi