# $Id$ CFLAGS = @CFLAGS@ -Wall -Wshadow -Wmissing-prototypes -Wmissing-declarations -Werror-implicit-function-declaration LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ AWK = @AWK@ SORT = @SORT@ PYTHON = @PYTHON@ RRDTOOL = @RRDTOOL@ INSTALL = @INSTALL@ abs_top_srcdir = @abs_top_srcdir@ abs_top_builddir = @abs_top_builddir@ prefix = @prefix@ exec_prefix = @exec_prefix@ datarootdir = @datarootdir@ datadir = @datadir@ localstatedir = @localstatedir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ sysconfdir = @sysconfdir@ abs_builddir = @abs_builddir@ abs_top_srcdir = @abs_top_srcdir@ abs_top_builddir = @abs_top_builddir@ srcdir = @srcdir@ RCYNIC_BIN_RCYNIC = ${DESTDIR}${bindir}/rcynic RCYNIC_CONF_DATA = @RCYNIC_CONF_DATA@ RCYNIC_CONF_FILE = ${DESTDIR}${sysconfdir}/rcynic.conf RCYNIC_CONF_RSYNC = @RSYNC@ RCYNIC_CONF_TA_DIR = ${sysconfdir}/rpki/trust-anchors RCYNIC_CRON_USER = ${RPKI_USER} RCYNIC_DATA_DIR = ${DESTDIR}${RCYNIC_DIR}/data RCYNIC_DIR = @RCYNIC_DIR@ RCYNIC_DIRS = ${RCYNIC_TA_DIR} ${RCYNIC_DATA_DIR} ${RPKIRTR_DIR} ${RPKIRTR_DIR}/sockets RPKI_GECOS = RPKI System Software RPKI_GROUP = @RPKI_GROUP@ RCYNIC_HTML_DIR = @RCYNIC_HTML_DIR@ RCYNIC_INSTALL_TARGETS = @RCYNIC_INSTALL_TARGETS@ RCYNIC_TA_DIR = ${DESTDIR}${sysconfdir}/rpki/trust-anchors RPKI_USER = @RPKI_USER@ RPKIRTR_DIR = ${DESTDIR}${RCYNIC_DIR}/rpki-rtr OBJS = rcynic.o bio_f_linebreak.o all: rcynicng clean: rm -f rcynic ${OBJS} rcynic.o: rcynic.c defstack.h rcynic: ${OBJS} ${CC} ${CFLAGS} -o $@ ${OBJS} ${LDFLAGS} ${LIBS} defstack.h: rcynic.c ${PYTHON} ${abs_top_srcdir}/buildtools/defstack.py rcynic.c >$@.tmp mv $@.tmp $@ tags: TAGS TAGS: rcynic.c defstack.h etags rcynic.c defstack.h test: rcynic if test -r rcynic.conf; \ then \ ./rcynic -j 0 && \ test -r rcynic.xml && \ echo && \ ./rcynic-text rcynic.xml; \ else \ echo No rcynic.conf, skipping test; \ fi uninstall deinstall: @echo Sorry, automated deinstallation of rcynic is not implemented yet distclean: clean if test -r static-rsync/Makefile; then cd static-rsync; ${MAKE} $@; fi rm -f Makefile static-rsync/rsync: @echo "Building static rsync for use in chroot jail" cd static-rsync; ${MAKE} all install: all ${RCYNIC_INSTALL_TARGETS} install-always: \ install-directories install-rcynic install-tals install-postconf: \ install-user-and-group install-directory-ownership install-crontab install-directories: ${RCYNIC_DIRS} ${RCYNIC_DIRS} ${DESTDIR}${bindir} ${DESTDIR}${sysconfdir}: ${INSTALL} -v -d $@ install-directory-ownership: ${RCYNIC_DATA_DIR} ${RPKIRTR_DIR} ${RPKIRTR_DIR}/sockets chown ${RPKI_USER}:${RPKI_GROUP} ${RCYNIC_DATA_DIR} ${RPKIRTR_DIR} ${RPKIRTR_DIR}/sockets install-tals: ${INSTALL} -v -d ${RCYNIC_TA_DIR} ${INSTALL} -v -p -m 444 sample-trust-anchors/*.tal ${RCYNIC_TA_DIR} # We don't install rcynic.conf anymore. Keep this for now as internal documentation, # clean up later. ${RCYNIC_CONF_FILE}: @echo @echo Found no ${RCYNIC_CONF_FILE}, creating basic configuration. @echo You might want to edit this. @echo @echo > $@.tmp '# Basic rcynic configuration file with default trust anchors.' @echo >>$@.tmp '# See documentation for details.' @echo >>$@.tmp '' @echo >>$@.tmp '[rcynic]' @echo >>$@.tmp 'rsync-program = ${RCYNIC_CONF_RSYNC}' @echo >>$@.tmp 'authenticated = ${RCYNIC_CONF_DATA}/authenticated' @echo >>$@.tmp 'unauthenticated = ${RCYNIC_CONF_DATA}/unauthenticated' @echo >>$@.tmp 'xml-summary = ${RCYNIC_CONF_DATA}/rcynic.xml' @echo >>$@.tmp 'jitter = 600' @echo >>$@.tmp 'max-parallel-fetches = 8' @echo >>$@.tmp 'use-syslog = true' @echo >>$@.tmp 'log-level = log_usage_err' @echo >>$@.tmp 'trust-anchor-directory = ${RCYNIC_CONF_TA_DIR}' @chmod 444 $@.tmp @mv -f $@.tmp $@ install-rcynic: ${RCYNIC_BIN_RCYNIC} ${RCYNIC_BIN_RCYNIC}: rcynicng ${INSTALL} -p -m 555 rcynicng $@ .FORCE: install-crontab: .FORCE @if test "X`/usr/bin/crontab -l -u ${RCYNIC_CRON_USER} 2>/dev/null`" != "X"; \ then \ echo "${RCYNIC_CRON_USER} already has a crontab, leaving it alone"; \ else \ echo "Setting up ${RCYNIC_CRON_USER}'s crontab to run rcynic-cron script"; \ ${AWK} -v t=`hexdump -n 2 -e '"%u\n"' /dev/random` '\ BEGIN {printf "MAILTO=root\n%u * * * *\texec ${bindir}/rcynic-cron\n", t % 60}' | \ /usr/bin/crontab -u ${RCYNIC_CRON_USER} -; \ fi # Platform-specific rules below here. @RCYNIC_MAKE_RULES@