Richard Siddall wrote:
I'm packaging up a Perl application that uses mod_perl and HTML::Mason and was wondering if anyone could point me at some information on extending rpm's AutoRequires as I'd like to automatically pull Perl dependencies from at least the HTML::Mason handler file. RPM's standard AutoRequires ignores that file as it has a .pl extension.
This is what I wound up doing as a first pass (sorry about the line wrapping): %prep # Override find-requires/find-provides to supplement Perl requires for # HTML::Mason file handler.pl cat << \EOF > %{name}-req #!/bin/sh tee %{_tmppath}/filelist | %{_rpmlibdir}/rpmdeps --requires | sort -u grep handler.pl %{_tmppath}/filelist \ | xargs %{_rpmlibdir}/perldeps.pl --requires \ | grep -v -E '^perl\((lib|strict|vars)\)$' \ | sort -u EOF %define __find_provides %{_rpmlibdir}/rpmdeps --provides %define __find_requires %{_builddir}/%{name}-%{version}/%{name}-req %{__chmod} +x %{__find_requires} %define _use_internal_dependency_generator 0 To summarize: - You have to define _use_internal_dependency_generator to 0 to turn off the internal dependency generator. I couldn't find any information on expanding the internal dependency generator. - I found a heated discussion between Jeff and people on the RH dev list in which he pointed out that you shouldn't use this method for filtering dependencies. - From that discussion I learned that rpmdeps gives similar results to the internal dependency generator, so I used that instead of the old find_provides and find_requires. - The replacement requires script saves the list of files being processed into a temporary file, then searches it for the HTML::Mason handler file (by file name, yuck) and runs that through a dependency checker. - I'm assuming that there are no significant Provides to be found in the HTML::Mason handler file. While this works well enough for now, I may go back and revisit it. The elegant way to do it is to find the Apache conf files and parse out the PerlModule, PerlRequires, and PerlHandler lines (possibly using Apache::ConfFile?). The conf files may not be in /etc/httpd/conf.d as the RPM might symlink to them. Files referenced in PerlRequires lines need to be run through a Perl dependency checker. PerlHandler lines tell you which module-specific parser has to be run on the files referenced in the enclosing Directory and/or Files directive. PerlModule lines are simple dependencies. (The presence of any mod_perl directives in the Apache conf files indicates that mod_perl is required, but that gets to be a chicken and egg situation: if you didn't know mod_perl was required, why would you run the conf file through a mod_perl dependency checker?) I hope this helps should anyone have to expand dependency checking in the future. Regards, Richard Siddall _______________________________________________ Rpm-list mailing list Rpm-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/rpm-list