aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac2
-rw-r--r--rcynic/Makefile.in25
-rw-r--r--rcynic/rules.darwin.mk30
-rw-r--r--rcynic/rules.freebsd.mk6
-rw-r--r--rcynic/rules.linux.mk36
-rw-r--r--rcynic/rules.unknown.mk2
6 files changed, 99 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index 558e8a8a..4ae1d4e7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -252,6 +252,7 @@ case $enable_rcynic_jail in
use_rcynic_jail=yes
RCYNIC_CONF_FILE='${RCYNIC_DIR}/etc/rcynic.conf'
RCYNIC_TA_DIR='${RCYNIC_DIR}/etc/trust-anchors'
+ RCYNIC_BIN_RCYNIC='${RCYNIC_DIR}/bin/rcynic'
RCYNIC_CONF_RSYNC='/bin/rsync'
RCYNIC_CONF_DATA='/data'
RCYNIC_CONF_TA_DIR='/etc/trust-anchors'
@@ -265,6 +266,7 @@ case $enable_rcynic_jail in
use_rcynic_jail=no
RCYNIC_CONF_FILE='${DESTDIR}${sysconfdir}/rcynic.conf'
RCYNIC_TA_DIR='${DESTDIR}${sysconfdir}/rpki/trust-anchors'
+ RCYNIC_BIN_RCYNIC='${bindir}/rcynic'
RCYNIC_CONF_RSYNC="${RSYNC}"
RCYNIC_CONF_DATA='${RCYNIC_DIR}/data'
RCYNIC_CONF_TA_DIR="${RCYNIC_TA_DIR}"
diff --git a/rcynic/Makefile.in b/rcynic/Makefile.in
index 58522a7f..d8b5ec75 100644
--- a/rcynic/Makefile.in
+++ b/rcynic/Makefile.in
@@ -28,6 +28,7 @@ RCYNIC_DIR = @RCYNIC_DIR@
RCYNIC_JAIL_DIRS = @RCYNIC_JAIL_DIRS@
RCYNIC_CONF_FILE = @RCYNIC_CONF_FILE@
RCYNIC_TA_DIR = @RCYNIC_TA_DIR@
+RCYNIC_BIN_RCYNIC = @RCYNIC_BIN_RCYNIC@
RCYNIC_DATA_DIR = ${RCYNIC_DIR}/data
RCYNIC_RPKI_RTR_DIR = ${RCYNIC_DIR}/rpki-rtr
RCYNIC_DIRS = ${RCYNIC_TA_DIR} ${RCYNIC_JAIL_DIRS} ${RCYNIC_DATA_DIR} ${RCYNIC_RPKI_RTR_DIR}
@@ -152,6 +153,30 @@ ${RCYNIC_CONF_FILE}:
@chmod 444 $@.tmp
@mv $@.tmp $@
+install-rcynic: ${RCYNIC_BIN_RCYNIC}
+
+${RCYNIC_BIN_RCYNIC}: ${BIN}
+ ${INSTALL} -p -m 555 ${BIN} $@
+
+install-static-rsync: ${RCYNIC_DIR}/bin/rsync
+
+${RCYNIC_DIR}/bin/rsync: static-rsync/rsync
+ ${INSTALL} -p -m 555 static-rsync/rsync $@
+
+install-scripts: ${bindir}/rcynic-text ${bindir}/rcynic-html ${bindir}/rcynic-svn ${bindir}/validation_status
+
+${bindir}/rcynic-text: rcynic-text
+ ${INSTALL} -p -m 555 rcynic-text ${bindir}
+
+${bindir}/rcynic-html: rcynic-html
+ ${INSTALL} -p -m 555 rcynic-html ${bindir}
+
+${bindir}/rcynic-svn: rcynic-svn
+ ${INSTALL} -p -m 555 rcynic-svn ${bindir}
+
+${bindir}/validation_status: validation_status
+ ${INSTALL} -p -m 555 validation_status ${bindir}
+
.FORCE:
# Not sure we want this, test it both ways I guess
diff --git a/rcynic/rules.darwin.mk b/rcynic/rules.darwin.mk
index 8f0e87b7..6eebed41 100644
--- a/rcynic/rules.darwin.mk
+++ b/rcynic/rules.darwin.mk
@@ -1,7 +1,7 @@
# $Id$
create-rcynic-user-and-group: .FORCE
- if /usr/bin/dscl . -read "/Groups/${RCYNIC_GROUP}" >/dev/null 2>&1; \
+ @if /usr/bin/dscl . -read "/Groups/${RCYNIC_GROUP}" >/dev/null 2>&1; \
then \
echo "You already have a group \"${RCYNIC_GROUP}\", so I will use it."; \
elif gid="$$(/usr/bin/dscl . -list /Groups PrimaryGroupID | /usr/bin/awk 'BEGIN {gid = 501} $$2 >= gid {gid = 1 + $$2} END {print gid}')" && \
@@ -36,3 +36,31 @@ create-rcynic-user-and-group: .FORCE
echo "Please create it, then try again."; \
exit 1; \
fi
+
+
+install-shared-libraries: .FORCE
+ @echo "Copying required shared libraries"
+ @shared_libraries="${RCYNIC_DIR}/bin/rcynic ${RCYNIC_DIR}/bin/rsync"; \
+ while true; \
+ do \
+ closure="$$(/usr/bin/otool -L $${shared_libraries} | /usr/bin/awk '/:$$/ {next} {print $$1}' | /usr/bin/sort -u)"; \
+ if test "x$$shared_libraries" = "x$$closure";
+ then \
+ break; \
+ else \
+ shared_libraries="$$closure"; \
+ fi; \
+ done; \
+ for shared in /usr/lib/dyld $$shared_libraries; \
+ do \
+ if /bin/test -r "${RCYNIC_DIR}/$${shared}"; \
+ then \
+ echo "You already have a \"${RCYNIC_DIR}/$${shared}\", so I will use it"; \
+ elif /usr/bin/install -m 555 -o root -g wheel -p "$${shared}" "${RCYNIC_DIR}/$${shared}"; \
+ then \
+ echo "Copied $${shared} into ${RCYNIC_DIR}"; \
+ else \
+ echo "Unable to copy $${shared} into ${RCYNIC_DIR}"; \
+ exit 1; \
+ fi; \
+ done
diff --git a/rcynic/rules.freebsd.mk b/rcynic/rules.freebsd.mk
index 3eab4780..a37abac7 100644
--- a/rcynic/rules.freebsd.mk
+++ b/rcynic/rules.freebsd.mk
@@ -23,3 +23,9 @@ create-rcynic-user-and-group: .FORCE
echo "Please create it, then try again."; \
exit 1; \
fi
+
+
+# We use static compilation on FreeBSD, so no need for shared libraries
+
+install-shared-libraries:
+ @true
diff --git a/rcynic/rules.linux.mk b/rcynic/rules.linux.mk
index 3ed5b730..8686bd07 100644
--- a/rcynic/rules.linux.mk
+++ b/rcynic/rules.linux.mk
@@ -25,3 +25,39 @@ create-rcynic-user-and-group: .FORCE
echo "Please create it, then try again."; \
exit 1; \
fi
+
+
+install-shared-libraries: .FORCE
+ @echo "Copying required shared libraries"
+ @if test -d /lib64; then libdir=/lib64; else libdir=/lib; fi; \
+ shared_libraries="${RCYNIC_DIR}/bin/rcynic ${RCYNIC_DIR}/bin/rsync $$(/usr/bin/find $${libdir} -name 'libnss*.so*' -print)"; \
+ while true; \
+ do \
+ closure="$$(/usr/bin/ldd $${shared_libraries} | \
+ ${AWK} ' \
+ { sub(/:$/, "") } \
+ $$0 == "${RCYNIC_DIR}/bin/rcynic" { next } \
+ $$0 == "${RCYNIC_DIR}/bin/rsync" { next } \
+ $$1 ~ /\/ld-linux\.so/ { next } \
+ { for (i = 1; i <= NF; i++) if ($$i ~ /^\//) print $$i } \
+ ' | \
+ ${SORT} -u)"; \
+ if test "X$$shared_libraries" = "X$$closure"; \
+ then \
+ break; \
+ else \
+ shared_libraries="$$closure"; \
+ fi; \
+ done; \
+ if test -f $${libdir}/libresolv.so.2; \
+ then \
+ shared_libraries="$${shared_libraries} $${libdir}/libresolv.so.2";
+ fi; \
+ for shared in $${libdir}/*ld*.so* $$shared_libraries; \
+ do \
+ if test ! -r "${RCYNIC_DIR}/$${shared}"; \
+ then \
+ ${INSTALL} -m 555 -d `dirname "${RCYNIC_DIR}$${shared}"` && \
+ ${INSTALL} -m 555 -p "$${shared}" "${RCYNIC_DIR}$${shared}"; \
+ fi; \
+ done
diff --git a/rcynic/rules.unknown.mk b/rcynic/rules.unknown.mk
index fea2aebc..1ee63a63 100644
--- a/rcynic/rules.unknown.mk
+++ b/rcynic/rules.unknown.mk
@@ -1,4 +1,4 @@
# $Id$
-create-rcynic-user-and-group: .FORCE
+create-rcynic-user-and-group install-shared-libraries: .FORCE
@echo "Don't know how to make $@ on this platform"; exit 1