[
http://jira.codehaus.org/browse/MRPM-36?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=195284#action_195284
]
Brett Okken commented on MRPM-36:
---------------------------------
Make sure you are using 2.0-beta-4.
Take a look at an integration test[1], if that helps.
Here is an excerpt from rpm-1's pom:
<preinstallScriptlet>
<!-- this is the default -->
<program>/bin/sh</program>
<scriptFile>src/main/bin/preinstall.sh</scriptFile>
<fileEncoding>utf-8</fileEncoding>
</preinstallScriptlet>
<postinstallScriptlet>
<scriptFile>src/main/bin/postinstall.sh</scriptFile>
<fileEncoding>utf-8</fileEncoding>
</postinstallScriptlet>
<preremoveScriptlet>
<scriptFile>src/main/bin/preuninstall.sh</scriptFile>
<fileEncoding>utf-8</fileEncoding>
</preremoveScriptlet>
And here is the corresponding entry from the .spec file:
%pre -p /bin/sh
#!/bin/sh
if [ -s "/etc/init.d/myapp" ]
then
/etc/init.d/myapp stop
rm /etc/init.d/myapp
fi
%post
#!/bin/sh
#create soft link script to services directory
ln -s /usr/myusr/app/bin/start.sh /etc/init.d/myapp
chmod 555 /etc/init.d/myapp
%preun
#!/bin/sh
#the argument being passed in indicates how many versions will exist
#during an upgrade, this value will be 1, in which case we do not want to stop
#the service since the new version will be running once this script is called
#during an uninstall, the value will be 0, in which case we do want to stop
#the service and remove the /etc/init.d script.
if [ "$1" = "0" ]
then
if [ -s "/etc/init.d/myapp" ]
then
/etc/init.d/myapp stop
rm /etc/init.d/myapp
fi
fi;
[1] - https://svn.codehaus.org/mojo/trunk/mojo/rpm-maven-plugin/src/it/rpm-1
> Unable to add %prep into rpm spec file
> --------------------------------------
>
> Key: MRPM-36
> URL: http://jira.codehaus.org/browse/MRPM-36
> Project: Mojo RPM Plugin
> Issue Type: Bug
> Affects Versions: 2.0-beta-3
> Reporter: Ron Quartel
> Assignee: Brett Okken
> Fix For: 2.0-beta-4
>
>
> There is support for preinstall, clean, postinstall, preremove and
> postremove scripts, but none for a %prep script.
> To get around this I had to use a dirty hack of putting the prep script in
> the description tag i.e.
> <description>My Description went here.
> %prep
> %define _use_internal_dependency_generator 0
> cat <<EOF > %{_builddir}/mycomp-requires-%{release}
> #!/bin/bash
> exec `rpm --eval '%%{__find_requires}'` | grep -Ev
> 'libICE|libSM|libX|libgdk|libgtk|libgmodule|runscript|libnspr|libodbc|libasound|libjava_crw_demo_g'
> EOF
> %define __find_requires %{_builddir}/mycomp-requires-%{release}
> chmod +x %{__find_requires}
> </description>
> Please can you fix / add support for a prep script?
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email