setting package name at install time

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

 



I know it might sound crazy, but I was wondering if there is a way to set the RPM package name at install time.

I figured out that I can set the package name dynamically at build time, by doing this:

%define myprefix %(echo $MY_ENV_VAR)

and then set the package name like this:

Name: %{myprefix}_my_package

But after I build the RPM package file and run "rpm -qip package_file.rpm" it shows the Name evaluated to the value set at build time.

The purpose behind this exercise is to install the same package multiple times with different names on the same server. (The reason the package is being installed multiple times is because the scripts in the RPM package do different things depending on the environment variable, and we don't want to create multiple packages, and we want to avoid using --dbpath.)

Why does it work for RPM built-in macros? For example, if on the build machine my "%_usr" is "/usr" but on install machine my "%_usr" is set to "/opt", how is it that it works?

Your help is appreciated.

-ramin

_______________________________________________
Rpm-list mailing list
Rpm-list@xxxxxxxxxxxxx
http://lists.rpm.org/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