Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

using RPM macro scriptlets / BuildRequires #117

Open
bryanlarsen opened this issue Jul 15, 2024 · 2 comments
Open

using RPM macro scriptlets / BuildRequires #117

bryanlarsen opened this issue Jul 15, 2024 · 2 comments

Comments

@bryanlarsen
Copy link

I'm trying and failing to follow the instructions on https://docs.fedoraproject.org/en-US/packaging-guidelines/Scriptlets/#Systemd .

Here's what I have:

post_install_script_flags = 0b011 # enable macros
post_install_script = "%systemd_post foo.service"

which results in:

/var/tmp/rpm-tmp.G9cgiK: line 3: syntax error near unexpected token `&&'
/var/tmp/rpm-tmp.G9cgiK: line 3: `if  && ; then '

Perhaps the problem is that I'm missing BuildRequires: systemd-rpm-macros, but there doesn't appear to be a way to add this with cargo-generate-rpm?

@korbel
Copy link

korbel commented Sep 5, 2024

You get the error because you enabled both the macro expansion and the queryformat expansion. Use only the 0b001 flag instead.

When you expand the macro (try rpm --eval '%systemd_post foo.service' in terminal to see the expanded value) you get square brackets in it which then get expanded as a queryformat.

@cat-in-136
Copy link
Owner

@bryanlarsen I believe that korbel's answer resolved the issue. Could you please try it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants