aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2013-05-28 13:43:28 +0000
committerRob Austein <sra@hactrn.net>2013-05-28 13:43:28 +0000
commitd2d9b64591ad7d50c0a9248229b70b11041c685a (patch)
tree49e28d89b1bf79be0f895b2423005cde6fe78c4b
parent503cbb89134b287fdb027c6b2ed261fba489598f (diff)
Don't stomp rpki.conf when installing from Makefiles. Make
deinstallation of rpki.conf the user's problem except on platforms like Ubuntu where we can tell the difference between upgrade, remove, and purge. See #531. svn path=/trunk/; revision=5336
-rw-r--r--buildtools/freebsd-skeleton/rpki-ca/pkg-deinstall9
-rw-r--r--rpkid/Makefile.in22
2 files changed, 23 insertions, 8 deletions
diff --git a/buildtools/freebsd-skeleton/rpki-ca/pkg-deinstall b/buildtools/freebsd-skeleton/rpki-ca/pkg-deinstall
index fb184390..0e63b94c 100644
--- a/buildtools/freebsd-skeleton/rpki-ca/pkg-deinstall
+++ b/buildtools/freebsd-skeleton/rpki-ca/pkg-deinstall
@@ -37,11 +37,14 @@ DEINSTALL)
/usr/local/libexec/rpkigui-apache-conf-gen --freebsd --remove --verbose
- # Clean up configuration file.
+ # This is where we'd remove rpki.conf if it were identical to
+ # rpki.conf.sample and if we didn't have to worry about things
+ # like SQL passwords. As it is, we always leave rpki.conf for the
+ # user to delete.
- if /usr/bin/cmp -s /usr/local/etc/rpki.conf.sample /usr/local/etc/rpki.conf
+ if test -f /usr/local/etc/rpki.conf
then
- /bin/rm -f /usr/local/etc/rpki.conf
+ echo "Please remove /usr/local/etc/rpki.conf manually if you're really deinstalling."
fi
/bin/rm -f /usr/local/etc/rpki.conf.sample
diff --git a/rpkid/Makefile.in b/rpkid/Makefile.in
index dcc54392..ad412e4e 100644
--- a/rpkid/Makefile.in
+++ b/rpkid/Makefile.in
@@ -220,13 +220,25 @@ install-postconf: \
install-user:
@true
-install-conf: ${DESTDIR}${sysconfdir}/rpki.conf
-
-${DESTDIR}${sysconfdir}/rpki.conf: ${DESTDIR}${sysconfdir}/rpki.conf.sample
- cp -p ${DESTDIR}${sysconfdir}/rpki.conf.sample $@
+# We used to play the FreeBSD game of copying rpki.conf.sample to
+# rpki.conf on install and removing rpki.conf if it's identical to
+# rpki.conf.sample in uninstall, but that turns out to work poorly
+# with generated passwords. So now we copy rpki.conf.sample if and
+# only if rpki.conf does not exist, and we leave removal of rpki.conf
+# for the user to deal with. This in turn leaves us with a different
+# problem of how to upgrade rpki.conf, but at least in the FreeBSD
+# universe we're supposed to leave that problem for the user.
+
+install-conf:
+ if test -f ${DESTDIR}${sysconfdir}/rpki.conf; \
+ then \
+ true; \
+ else \
+ cp -p ${DESTDIR}${sysconfdir}/rpki.conf.sample ${DESTDIR}${sysconfdir}/rpki.conf; \
+ fi
uninstall deinstall::
- if cmp -s ${DESTDIR}${sysconfdir}/rpki.conf ${DESTDIR}${sysconfdir}/rpki.conf.sample; then rm -f ${DESTDIR}${sysconfdir}/rpki.conf; else true; fi
+# if cmp -s ${DESTDIR}${sysconfdir}/rpki.conf ${DESTDIR}${sysconfdir}/rpki.conf.sample; then rm -f ${DESTDIR}${sysconfdir}/rpki.conf; else true; fi
rm -f ${DESTDIR}${sysconfdir}/rpki.conf.sample
install-apache: