[Rpm-maint] [Patch 3/19] Enable PREREQ
Stanislav Brabec
sbrabec at suse.cz
Fri Feb 9 14:18:23 UTC 2007
James Olin wrote:
> On 2/9/07, Stanislav Brabec <sbrabec at suse.cz> wrote:
> Unfortunately though, I just realized I might be misled, because
> there is no way that I know to deal with autogenerated deps in this
> way.
You are true, but at least partially it is possible.
Yes, it is a overkill, because if dependency graph is not cyclic, this
will never cause any problem.
But if you add call-just-installed-binary scriptlet to a package with
the cyclic dependency with another one, you can easily broke the whole
stuff.
Here is my work-around code:
# Find prerequirements of %{_bindir}/foo
%define my_prereq %{_builddir}/%{?buildsubdir}/%{name}-prereq
cat << EOF > %{my_prereq}
#! /bin/sh
echo "$RPM_BUILD_ROOT%{_bindir}/foo" | %__find_requires "\$@"
EOF
chmod 755 %{my_prereq}
# NOTE: %%__find_prereq is documented, but not implemented (see rpm-4.4.2/build/rpmfc.c).
#%%define __find_prereq %{my_prereq}
# Work around unimplemented %%__find_prereq:
# EDIT_HERE: Add all self-provides to grep -v
PREREQ=$( %{my_prereq} | grep -v ^libfoo | tr '\n' ' ' | sed "s/ *$//" )
PREREQ_MD5=$(echo "$PREREQ" | md5sum | sed "s/ *-//" )
%define new_prereq $(PREREQ)
if test "$PREREQ_MD5" != "%prereq_md5" ; then
echo "Please update PreReq in preamble of this package on actual platform:
======
PreReq: $PREREQ
%%define prereq_md5 $PREREQ_MD5
======"
exit 1
fi
... And please remove %__find_prereq from documentation.
--
Best Regards / S pozdravem,
Stanislav Brabec
software developer
---------------------------------------------------------------------
SUSE LINUX, s. r. o. e-mail: sbrabec at suse.cz
Lihovarská 1060/12 tel: +420 284 028 966
190 00 Praha 9 fax: +420 284 028 951
Czech Republic http://www.suse.cz/
More information about the Rpm-maint
mailing list