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

Using custom macro files

Hash: SHA1

I am trying to use a custom macro file that I dropped into /etc/rpm.

At first I was modifying the macrofiles line at the bottom of 
/usr/lib/rpm/rpmrc using perl in the %post and %postun section of the rpm 
specfile containing the macro file to be installed, so that my custom macro 
file was appended to that line and thus automatically recognized by rpm. Then 
I realized that when rpm was upgraded, rpmrc would be replaced, and the 
changes would be lost. Thus, the macros in this file would no longer be 

I then tried to create a custom /etc/rpmrc with the macrofiles line being

macrofiles:	%{_libdir}/rpm/rpmrc:/etc/rpm/macros.custom

However, I then learned that it didn't actually read the macrofiles line from 
%{_libdir}/rpm/rpmrc, but instead overrode that value. If I try to pull the 
macrofiles line out of %{_libdir}/rpm/rpmrc into  /etc/rpmrc, the same 
problem having to do with upgrading rpm would occur.

There also seems no way to expand %{macrofiles} to get the system wide values 
to use before appending a custom macro file to it. It also seems that only 
the distribution maintainer has the power to add or remove custom macros by 
issuing an update to the rpm package. Am I wrong here?

The only option I see left is to include the macro file in every rpm spec that 
I produce with

%include /etc/rpm/macros.custom

at the top of each file.

However, rpm expects this file to be in a different format than the files in 
/etc/rpm, e.g. you need to now use %define to define a macro, etc. With the 
differing syntax, I assume I am going to have to rewrite the macros.

What is the best solution for installing a macro file that I want to be able 
to be used system wide without requiring user intervention?

- -- 

David Walluck
Version: GnuPG v1.2.1 (GNU/Linux)


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