Bug 723845 - macro for generator doesn't seem to work
Summary: macro for generator doesn't seem to work
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: rpm
Version: 19
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Fedora Packaging Toolset Team
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 694496
TreeView+ depends on / blocked
 
Reported: 2011-07-21 11:15 UTC by Marcela Mašláňová
Modified: 2015-02-17 13:49 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-02-17 13:49:12 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Marcela Mašláňová 2011-07-21 11:15:26 UTC
<documentation>
A generator is just an executable that reads file name(s) from stdin and writes out Provides: or Requires: on stdout. This way the generator can be implemented in whatever language is preferred and can use e.g. language specific libraries or tools. Generators get called once for each file with matching attributes. Generators can be declare in the file attributes file by defining the following macros: 
</documentation>

Part of /etc/rpm/macros.perl:
# Perl provides/requeries are generated by external generators.
%global __perl_provides /usr/bin/perl.prov
%global __perl_requires /usr/bin/perl.req

I used for generators from perl-rpm-build-perl-scripts, but rpmbuild is still looking for original perl.{prov,req}, which I removed from computer.

+ cp -pr ChangeLog README /root/rpmbuild/BUILDROOT/perl-IO-Tty-1.10-4.fc16.x86_64/usr/share/doc/perl-IO-Tty-1.10
+ exit 0
error: Couldn't exec /usr/lib/rpm/perl.prov: No such file or directory
error: Couldn't exec /usr/lib/rpm/perl.prov: No such file or directory
error: Couldn't exec /usr/lib/rpm/perl.prov: No such file or directory
Finding  Provides: /bin/sh -c "/bin/grep -v '/usr/share/doc' | /bin/grep -v '/usr/lib64/perl5/vendor_perl/.*\.so$' | while read FILE; do /usr/lib/rpm/rpmdeps -P ${FILE}; done | /bin/sort -u"
error: Couldn't exec /usr/lib/rpm/perl.prov: No such file or directory
error: Couldn't exec /usr/lib/rpm/perl.prov: No such file or directory
error: Couldn't exec /usr/lib/rpm/perl.prov: No such file or directory
Finding  Requires: /bin/sh -c "/bin/grep -v '/usr/share/doc' | while read FILE; do /usr/lib/rpm/rpmdeps -R ${FILE}; done | /bin/sort -u"

Comment 2 Panu Matilainen 2011-08-19 05:15:32 UTC
"%global __perl_provides /usr/bin/perl.prov" is not a valid syntax for macro files (I would've expected rpm to complain about it but apparently it doesn't...), that's only valid for specs and actual macro bodies. Use the macro file syntax and it'll work:

%__perl_provides /usr/bin/perl.prov
%__perl_requires /usr/bin/perl.req

BUT... this is not the way it should be done. I do not want a situation where we have two different sets of perl dependency generators around. This'll only create confusion and wasted efforts looking at which variant happened to be effective for a given package build etc.

If the perl SIG wants to take over the perl dependency generator, you're most welcome to do so! But it should be done in a controlled manner: the stock generators should be split out of rpm-build and then arrange a dependency to pull in your generators, be it direct require on perl-rpm-build-perl-scripts in rpm-build or something else (one possibility is creating generator-provides automatically and depending on those).

Comment 3 Marcela Mašláňová 2011-08-23 12:41:57 UTC
(In reply to comment #2)
> "%global __perl_provides /usr/bin/perl.prov" is not a valid syntax for macro
> files (I would've expected rpm to complain about it but apparently it
> doesn't...), that's only valid for specs and actual macro bodies. Use the macro
> file syntax and it'll work:
> 
> %__perl_provides /usr/bin/perl.prov
> %__perl_requires /usr/bin/perl.req

Thanks.
> 
> BUT... this is not the way it should be done. I do not want a situation where
> we have two different sets of perl dependency generators around. This'll only
> create confusion and wasted efforts looking at which variant happened to be
> effective for a given package build etc.

I agree. I used those macros for testing.
> 
> If the perl SIG wants to take over the perl dependency generator, you're most
> welcome to do so! But it should be done in a controlled manner: the stock
> generators should be split out of rpm-build and then arrange a dependency to
> pull in your generators, be it direct require on perl-rpm-build-perl-scripts in
> rpm-build or something else (one possibility is creating generator-provides
> automatically and depending on those).

This will need more work and cooperation with rpm team. We can also update rules in rpm, but I'm not sure if that's preferred way. I'll send note when we'll be ready.

Comment 4 Marcela Mašláňová 2012-01-19 12:27:58 UTC
I prepared the testing software collection with Perl. I had to rewrite on my computer /usr/lib/rpm/perl.{prov,req} by my own [1], because I need redefine the prefix. Instead of perl(some::thing) I need dsc_perl514_perl(some::thing). 

I guess some other languages (tcl, php,...), which have their own dependency generator will have the same problem.

Would it be possible to change the prefix in some other way? The perl prefix is defined in perl.{prov,req} code, so it will need patch in the rpm anyway.
I'm using:
rpmbuild -ba perl.spec --define 'dsc perl514'
If there was a way to put prefix from define into perl.prov script as an argument, that would be great. Is it something like that possible?

Currently, I'm not sure how can be Perl build for a collection in the koji without any changes in generator. If you need my source rpms, it's located there [2].

[1] http://mmaslano.fedorapeople.org/rpm-scripts/
[2] http://mmaslano.fedorapeople.org/repository/scl_perl_sources/

Comment 5 Panu Matilainen 2012-02-07 09:14:32 UTC
Yup... rpm.org HEAD (ie what will be rpm 4.10) supports alternative namespaces for generated dependencies. See http://rpm.org/ticket/854 for a similar case. What's missing is the support for this in the bundled scripts (which assume they're in control of their own namespaces) and a "protocol" for this so we dont end up with every generator doing it their own slightly different way.

Comment 6 Marcela Mašláňová 2012-02-07 15:05:35 UTC
I can test it on RHEL-6 with provided patch. But where should I add the variable? I see in bug something like "pkgconfigdeps.sh --pkgconfig-executable=/usr/bin/i686-pc-mingw32-pkgconfig --providename='mingw32-pkgconfig'". Should I add call of pkgconfigdeps.sh in specfile? Or I should add rpmbuild -ba perl.spec --providename=dsc_perl ?

I'm afraid all scripts should be fixed anyway. It should be easy if you can define global variable, then bash and perl scripts can use the variable instead of string. I can send a patch for all generators if you can answer my question above. 

Currently, dsc won't be working without change of rpm for php, perl, python, tcl without it on RHEL-6 and lower.

Comment 7 Panu Matilainen 2012-02-28 09:03:36 UTC
Mm, so you'd actually want a global *prefix* for these things, rather than a dependency-type specific alternative namespace (which is what the upstream change does). I guess that'd be a reasonable thing to add for certain types of special cases.

However none of that applies to existing RHEL versions whose dependency generator "engine" is a completely different beast with many things hard-wired at C-level, and the new generator engine is not really backportable as its not 100% compatible.

RHEL issues doesn't belong in Fedora rawhide bugs though... email me in private for that.

Comment 8 Marcela Mašláňová 2012-02-28 15:06:05 UTC
Not sure if the proposed change could help me. More in the email.

Comment 9 Fedora Admin XMLRPC Client 2012-04-13 23:06:48 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 10 Fedora Admin XMLRPC Client 2012-04-13 23:10:26 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 11 Fedora End Of Life 2013-04-03 16:46:26 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 19 development cycle.
Changing version to '19'.

(As we did not run this process for some time, it could affect also pre-Fedora 19 development
cycle bugs. We are very sorry. It will help us with cleanup during Fedora 19 End Of Life. Thank you.)

More information and reason for this action is here:
https://fedoraproject.org/wiki/BugZappers/HouseKeeping/Fedora19

Comment 12 Fedora End Of Life 2015-01-09 16:43:41 UTC
This message is a notice that Fedora 19 is now at end of life. Fedora 
has stopped maintaining and issuing updates for Fedora 19. It is 
Fedora's policy to close all bug reports from releases that are no 
longer maintained. Approximately 4 (four) weeks from now this bug will
be closed as EOL if it remains open with a Fedora 'version' of '19'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 19 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 13 Fedora End Of Life 2015-02-17 13:49:12 UTC
Fedora 19 changed to end-of-life (EOL) status on 2015-01-06. Fedora 19 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


Note You need to log in before you can comment on or make changes to this bug.