Skip to content

Commit 7205709

Browse files
committed
Add pre and postun to clean the cookbook
1 parent 34691a9 commit 7205709

File tree

1 file changed

+21
-5
lines changed

1 file changed

+21
-5
lines changed

packaging/rpm/cookbook-rb-proxy.spec

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ chmod -R 0755 %{buildroot}/var/chef/cookbooks/rb-proxy
2323
install -D -m 0644 README.md %{buildroot}/var/chef/cookbooks/rb-proxy/README.md
2424

2525
%pre
26+
if [ -d /var/chef/cookbooks/rb-proxy ]; then
27+
rm -rf /var/chef/cookbooks/rb-proxy
28+
fi
2629

2730
%post
2831
case "$1" in
@@ -36,6 +39,12 @@ case "$1" in
3639
;;
3740
esac
3841

42+
%postun
43+
# Deletes directory when uninstall the package
44+
if [ "$1" = 0 ] && [ -d /var/chef/cookbooks/rb-proxy ]; then
45+
rm -rf /var/chef/cookbooks/rb-proxy
46+
fi
47+
3948
%files
4049
%defattr(0755,root,root)
4150
/var/chef/cookbooks/rb-proxy
@@ -45,13 +54,20 @@ esac
4554
%doc
4655

4756
%changelog
48-
* Thu Jan 18 2024 Miguel Negrón <[email protected]> - 0.1.2-1
57+
* Thu Oct 10 2024 Miguel Negrón <[email protected]>
58+
- Add pre and postun
59+
60+
* Thu Jan 18 2024 Miguel Negrón <[email protected]>
4961
- Add journalctld configuration
50-
* Thu Dec 14 2023 Miguel Álvarez <[email protected]> - 0.1.1
62+
63+
* Thu Dec 14 2023 Miguel Álvarez <[email protected]>
5164
- Add cgroups
52-
* Fri Dec 01 2023 David Vanhoucke <[email protected]> - 0.1.0
65+
66+
* Fri Dec 01 2023 David Vanhoucke <[email protected]>
5367
- Add selinux
54-
* Wed Feb 01 2023 Luis Blanco <[email protected]> - 0.0.8
68+
69+
* Wed Feb 01 2023 Luis Blanco <[email protected]>
5570
- Freeradius integration
56-
* Tue Mar 22 2022 Miguel Negron <[email protected]> - 0.0.1
71+
72+
* Tue Mar 22 2022 Miguel Negron <[email protected]>
5773
- Initial release of proxy

0 commit comments

Comments
 (0)