0

I'm working in ClearOS5.3, with rpm 4.4 installed. I'm using rpm to distribute a module I created, however the %post script in my spec file isn't executed when I install the package.

I'm using the command rpmbuild -ba mypackage.spec to build the rpm, and the command rpm -ivh mypackage-version-release.rpm to install the package.

Installation is performed manually (not using make) in the %install script. All the files seem to be installed in the correct places, however none of the install scripts run (specifically %post and %preun, in the case of my package). Testing with other install scripts (%pre) showed those sections didn't work either.

From what I can tell based on installing the package in debug mode, the %pretrans and %posttrans scripts are run. Additionally, when building the package, it recognizes the the install scripts and lists their dependencies (/bin/sh).

Does anyone have an idea as to why these install scripts might not be running and have suggestions to fix the issue?

  • I'm afraid that it's difficult to provide a specific answer to a generally-worded question. In any case, you might want to put an echo statement at the start of your RPM's %pre and %post sections as a simple way to debug. – nohup Jul 26 '12 at 23:10
  • Please post your `spec` or the relevant sections. Maybe add to the beginning of each something like `touch /tmp/pre_has_run.$$` to see if it is a syntax error. Have you tried `rpm -Uvvh pkg.rpm` ? – Aaron D. Marasco Jul 27 '12 at 01:02
  • I tried using echo statements to debug the scripts, however upon asking the ClearOS support team the issue has been solved. Apparently it has to do with the "package successor" issue in rpm (http://www.rpm.org/wiki/Problems/Upgrade) and to avoid this issue ClearOS changed the naming convention for packages from "cc-" to "app-". As such, script handling was changed for packages starting with "cc-". renaming my package from "cc-bmbackup" to "app-bmbackup" solved the issue. – user1555331 Jul 27 '12 at 16:08

0 Answers0