# How to add %triggerpostun scriptlet to rpm

**URL:** https://discourse.cmake.org/t/how-to-add-triggerpostun-scriptlet-to-rpm/15864
**Category:** Code
**Tags:** cpack:rpm
**Created:** [October 9, 2026, 6:48pm UTC](https://discourse.cmake.org/t/how-to-add-triggerpostun-scriptlet-to-rpm/15864 "2026-10-09T18:48:15Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![ken](https://discourse.cmake.org/user_avatar/discourse.cmake.org/ken/32/6264_2.png) [@ken](https://discourse.cmake.org/u/ken)
#### Post date: [October 9, 2026, 6:48pm UTC](https://discourse.cmake.org/t/how-to-add-triggerpostun-scriptlet-to-rpm/15864/1 "2026-10-09T18:48:15Z")

</div>

There are CPACK variables to add various scriptlets to an RPM (install, uninstall, trans) but no method I’ve been able to find to add a trigger scriptlet.

I have a use-case that needs to add

```auto
%triggerpostun — old-name
# old-name’s %postun ran with $1==0 and undid setup; redo it.

exit 0

```

How can I do this?
