I'm packaging some software that provides interfaces for lots of different libraries and languages. I'd like to split it up into sub-packages for the different components. It would be useful to have a tool that would report a "requires" for each file in the package in order to "sort" them into the different sub-packages.
Any suggestions?
Orion Poplawski wrote:
I'm packaging some software that provides interfaces for lots of different libraries and languages. I'd like to split it up into sub-packages for the different components. It would be useful to have a tool that would report a "requires" for each file in the package in order to "sort" them into the different sub-packages.
If the files in question are binary executables or libraries, ldd should do what you want.
Ian Pilcher wrote:
If the files in question are binary executables or libraries, ldd should do what you want.
Yeah, I was hoping for something a little more ready to go. Does anyone know what script/process is run during the rpmbuild that generates the rpm dependecies, perhaps I can use/modify that...
On Mon, 2005-08-08 at 10:14 -0600, Orion Poplawski wrote:
Ian Pilcher wrote:
If the files in question are binary executables or libraries, ldd should do what you want.
Yeah, I was hoping for something a little more ready to go. Does anyone know what script/process is run during the rpmbuild that generates the rpm dependecies, perhaps I can use/modify that...
That'd be /usr/lib/rpm/find-requires, it takes a list of filenames in stdin and outputs the dependencies, eg [pmatilai@weasel ~]$ echo /usr/bin/telnet | /usr/lib/rpm/find-requires libc.so.6()(64bit) libc.so.6(GLIBC_2.2.5)(64bit) libc.so.6(GLIBC_2.3.4)(64bit) libc.so.6(GLIBC_2.3)(64bit) libncurses.so.5()(64bit) libutil.so.1()(64bit)
..and then you can further process that if you want, with rpmquery or repoquery where appropriate: [pmatilai@weasel ~]$ echo /usr/bin/telnet | /usr/lib/rpm/find-requires| xargs rpm -q --whatprovides|sort -u glibc-2.3.5-10 ncurses-5.4-17
- Panu -
Orion Poplawski wrote:
Yeah, I was hoping for something a little more ready to go. Does anyone know what script/process is run during the rpmbuild that generates the rpm dependecies, perhaps I can use/modify that...
Well, to answer my question, this basically does what I want:
#Requires find $RPM_BUILD_ROOT -type f | while read file do deps=`/usr/lib/rpm/rpmdeps -R $file` if [ -n "$deps" ] then echo -n "$file: " | sed s,$RPM_BUILD_ROOT,, >> ../requires echo $deps >> ../requires fi done
Then with a simple perl script I can invert the list to files show per requirement.
packaging@lists.fedoraproject.org