Re: RPM Spec scriptlets

2022-02-07 Thread Paweł Marciniak
> On Mon, Feb 7, 2022 at 9:57 PM Paweł Marciniak  wrote:
> At first glance, this happens because you apply the scriptlets to the
> wrong package.

"%pre -n python3-%{github_name}"
This is the missing part, thank you Fabio.

> and you should probably also use the macros provided by
> systemd-rpm-macros instead:
Yes I know it was only for testing purposes.
___
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure


Re: RPM Spec scriptlets

2022-02-07 Thread Fabio Valentini
On Mon, Feb 7, 2022 at 9:57 PM Paweł Marciniak  wrote:
>
> Can someone tell me why none of the scriptlets  (%pre, post etc) in the spec 
> file  
> https://download.copr.fedorainfracloud.org/results/sunwire/rpmtest/fedora-35-x86_64/03364007-python-input-remapper/python-input-remapper.spec
>  work?
> After building the package, all scriptlets are missing and rpm -qp --scripts 
> returns nothing.
> Is this a bug in pyproject-rpm-macros?  Am i missing something?
> rpm:
> https://download.copr.fedorainfracloud.org/results/sunwire/rpmtest/fedora-35-x86_64/03364007-python-input-remapper/python3-input-remapper-1.4.0-4.git20220205.fc35.noarch.rpm
> srpm:
> https://download.copr.fedorainfracloud.org/results/sunwire/rpmtest/fedora-35-x86_64/03364007-python-input-remapper/python-input-remapper-1.4.0-4.git20220205.fc35.src.rpm

Hi!

At first glance, this happens because you apply the scriptlets to the
wrong package.

You need to give %pre, %post, etc. the same "package name" argument as
%description and %files, namely the package name that contains the
service files, so "%pre -n python3-%{github_name}" etc.

Also note that enabling systemd services with presets and scriptlets
like these is forbidden for official Fedora packages,
and you should probably also use the macros provided by
systemd-rpm-macros instead:

https://docs.fedoraproject.org/en-US/packaging-guidelines/Scriptlets/#_systemd

Fabio
___
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure