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

Re: Using custom macro files



Perhaps I'm missing some complexity, but doesn't /etc/rpm/macros fit
your needs? It's part of the default macro path, so specs don't need
modification. And it won't be overwritten by new RPM versions - first
off because it's a config file in /etc, and second because RPM, IIRC,
doesn't install this file anyway.

Todd

On Wed, 29 Jan 2003 19:35:04 -0500
David Walluck <david@anti-microsoft.org> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> 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 recognized.
> 
> 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?
> 
> - -- 
> Sincerely,
> 
> David Walluck
> <david@anti-microsoft.org>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.2.1 (GNU/Linux)
> 
> iD8DBQE+OHM4JB7s/tlHKVIRApP1AJ9C8wEfKa5UxuGHjUOizKKPJVv2gACfatE5
> e+8T0U9K89N5P09V31zIKbA=
> =g+sC
> -----END PGP SIGNATURE-----
> 
> 
> 
> _______________________________________________
> Rpm-list mailing list
> Rpm-list@redhat.com
> https://listman.redhat.com/mailman/listinfo/rpm-list





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