From f90b48bd2dcd513da01c5013fb97d1ef1aea5fa1 Mon Sep 17 00:00:00 2001 From: Jamil Bou Kheir Date: Mon, 26 Jul 2021 09:35:36 -0700 Subject: [PATCH] Fix RPM dependencies --- pkg/deb_shared/DEBIAN/postrm | 8 ++------ pkg/rpm_shared/rpmbuild/SPECS/firezone.spec | 4 ++++ pkg/skel/usr/lib/firezone/bin/postrm.sh | 9 +++++++++ 3 files changed, 15 insertions(+), 6 deletions(-) create mode 100755 pkg/skel/usr/lib/firezone/bin/postrm.sh diff --git a/pkg/deb_shared/DEBIAN/postrm b/pkg/deb_shared/DEBIAN/postrm index bbf1f0efc..898d09c5b 100755 --- a/pkg/deb_shared/DEBIAN/postrm +++ b/pkg/deb_shared/DEBIAN/postrm @@ -1,9 +1,5 @@ #!/bin/bash set -e -if [ "$1" = purge ]; then - echo "Refusing to purge /etc/firezone/secret and drop database. This must be done manually." - echo "If you really want to do this, run the following as root:" - echo " su postgres -c 'psql -c \"DROP DATABASE firezone;\"'" - echo " rm -rf /etc/firezone/secret" -fi +# Call the post removal script +. /usr/lib/firezone/bin/postrm.sh diff --git a/pkg/rpm_shared/rpmbuild/SPECS/firezone.spec b/pkg/rpm_shared/rpmbuild/SPECS/firezone.spec index 531f8a955..36357cd84 100644 --- a/pkg/rpm_shared/rpmbuild/SPECS/firezone.spec +++ b/pkg/rpm_shared/rpmbuild/SPECS/firezone.spec @@ -11,6 +11,7 @@ Requires: postgresql-server >= 9.6 Requires: openssl Requires: systemd Requires: iptables +Requires: glibc %description Provides a web-based UI that allows you to configure WireGuard™ VPN tunnels and @@ -19,6 +20,9 @@ set up firewall rules for your devices. %post /usr/lib/firezone/bin/postinst.sh +%postun +/usr/lib/firezone/bin/postrm.sh + %files %config /etc/firezone /lib/systemd/system/firezone.service diff --git a/pkg/skel/usr/lib/firezone/bin/postrm.sh b/pkg/skel/usr/lib/firezone/bin/postrm.sh new file mode 100755 index 000000000..bbf1f0efc --- /dev/null +++ b/pkg/skel/usr/lib/firezone/bin/postrm.sh @@ -0,0 +1,9 @@ +#!/bin/bash +set -e + +if [ "$1" = purge ]; then + echo "Refusing to purge /etc/firezone/secret and drop database. This must be done manually." + echo "If you really want to do this, run the following as root:" + echo " su postgres -c 'psql -c \"DROP DATABASE firezone;\"'" + echo " rm -rf /etc/firezone/secret" +fi