aboutsummaryrefslogtreecommitdiffstats
path: root/packaging/rpm
diff options
context:
space:
mode:
Diffstat (limited to 'packaging/rpm')
-rw-r--r--packaging/rpm/meshbay-common.spec14
1 files changed, 14 insertions, 0 deletions
diff --git a/packaging/rpm/meshbay-common.spec b/packaging/rpm/meshbay-common.spec
index 948de9a..147dc17 100644
--- a/packaging/rpm/meshbay-common.spec
+++ b/packaging/rpm/meshbay-common.spec
@@ -17,6 +17,20 @@ Installs to /opt/meshbay-common/venv/.
%install
cp -a %{_staging_root}/* %{buildroot}/
+# Bytecode written at run time into __pycache__ is not the package's, and would
+# keep rpm from removing a directory the new version no longer ships.
+%pre
+if [ "$1" -ge 2 ]; then
+ find /opt/meshbay-common/venv -depth -type d -name __pycache__ \
+ -exec rm -rf {} + 2>/dev/null || true
+fi
+
+%preun
+if [ "$1" -eq 0 ]; then
+ find /opt/meshbay-common/venv -depth -type d -name __pycache__ \
+ -exec rm -rf {} + 2>/dev/null || true
+fi
+
%files
/opt/meshbay-common