Re: Knowing the location of a created binary rpm

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2/16/06, Erez Zilber <erezz@xxxxxxxxxxxx> wrote:
> Hi,
>
> I'm new to rpm development. I was able to build a binary rpm and I saw
> that it was placed in /usr/src/packages/RPMS/i586/.
>
> I'm building the rpm from a makefile and I'd like to copy it to another
> directory after it's created. How can I know the path of the generated rpm?
>
Packages are named (this is their full path):

   %{_rpmdir}/%{_build_name_fmt}

So this little bash script will produce that path if you provided
their name, version, release and arch in that order (NVRA).

   N=$1
   V=$2
   R=$3
   A=$4
   rpm \
       --define "NAME ${N}" \
       --define "VERSION ${V}" \
       --define "RELEASE ${R}" \
       --define "ARCH ${A}" \
       --eval '%{expand:%{_rpmdir}/%{_build_name_fmt}}'

Alternatively, most everywhere the package gets named:

   N-V-R.A.rpm

And they end up under "%{_rpmdir}/A/"

So you can simply get the value of %_rpmdir and and just build the
rest of the path, but the above script can work when the value of
_build_name_fmt has been changed.

Cheers...james

_______________________________________________
Rpm-list mailing list
Rpm-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/rpm-list

[Index of Archives]     [RPM Ecosystem]     [Linux Kernel]     [Red Hat Install]     [PAM]     [Red Hat Watch]     [Red Hat Development]     [Red Hat]     [Gimp]     [Yosemite News]     [IETF Discussion]

  Powered by Linux