gradle-ospackage-plugin icon indicating copy to clipboard operation
gradle-ospackage-plugin copied to clipboard

rpm macros

Open gilday opened this issue 10 years ago • 5 comments

I'm building an RPM which installs a daemon in systemd. Fedora documentation strongly recommends using spec file macros to properly handle install and uninstalling systemd managed services.

From reading other issues, I gather that the underlying library, redline-rpm, does not build an intermediate spec file; therefore, one cannot expect to use spec file macros with this plugin. Is that right, or am I missing something?

gilday avatar Oct 23 '15 13:10 gilday

@gilday Did you ever figure this out? I am on the same boat... Trying to follow systemd guidelines for installing a service using the systemd RPM macros. (http://0pointer.de/public/systemd-man/daemon.html)

alexbrand avatar Mar 05 '16 17:03 alexbrand

@alexbrand no, i have not figured out how to do this. I am invoking systemctl directly instead of using the macros as a workaround https://github.com/gilday/how-to-microservice/blob/master/build.gradle#L82

gilday avatar Mar 24 '16 02:03 gilday

Hello,

While working with the nebula rpm plugin for gradle I have found a difficult issue and I cannot locate the exact location as to where this is happening or how to escape it. Please help.

In the ospackage for nebula I am using:

preInstall(""" echo %_macros_variable_here """

When I go to install the rpm --define '_macros_variable_here hereIam' I see output %_macros_variable_here

Where I am looking for the actual value of the variable (where ever it is defined...command line, ~/.rpmmacro, ...)

The actual issue with when the spec file is created the % turns into %%. I have looked through nebula and I cannot find where it is being replace or how it is turning into %%. I have tried % and \% and %% in order to escape the sign, without avail.

To work around this I have been manually running: rpmrebuild --package --notest-install -e example.rpm editing the %pre macros to remove the extra % and then saving the new rpm.

This new rpm will handle the defined macros properly. Do you have any idea 1) how the the extra percent sign is being inserted or 2) how to properly get only one % inserted in the generated spec file?

kevin-j-smith avatar Feb 27 '17 20:02 kevin-j-smith

Any chance of getting a maintainer to answer this?

But I can see how hard this would be to support. AFAICT, macros are build-time dependencies, and including them would break the

All the plugins are pure-java and don't require any local native binaries.

promise

nfirvine avatar Sep 11 '17 22:09 nfirvine

This ospackage plugin does not use rpmbuild nor spec files and has no links/references to the macros in question. It generates the rpm using pure java via the redline library.

oesolutions avatar May 13 '22 19:05 oesolutions