0

I am distributing my RHEL6 rpm from a windows server. I have some information in a configuration file (such as the name and address of the server) that I bundle into a tgz with the rpm. I then have a specific place I want to put the configuration file.

The problem I'm having is that the current working directory when the spec scripts execute seems to be /. Ideally, I'd have a person untar the tgz and then run rpm and the config file is right there. . . but I have no idea where I am because my context gets switched to root.

Is there a way to know where the rpm is getting installed from in the spec scripts? Any other thoughts/comments/jokes about what I'm trying to do?

Coop
  • 189
  • 1
  • 15
  • I realize an alternative approach would be to have the windows server modify the rpm, but there did not seem to exist commercial-friendly libraries for doing that and coding it from scratch seemed out of my timetable. – Coop Feb 12 '14 at 03:26
  • 1
    Why not create a package that contains the configuration and depends on the other package? – Ignacio Vazquez-Abrams Feb 19 '14 at 22:32
  • I may not entirely understand what you suggested, but the problem comes from having the data only available on a server running windows. I generate the rpm ahead of time on a Linux box but it gets bundled with the windows server installer. The windows server then needs to send the rpm down with some configuration files, but windows doesn't know how to rpm. – Coop Feb 20 '14 at 02:04

1 Answers1

0

Try to put pwd command in the scripts, so you will know where you are

Eran Ben-Natan
  • 2,515
  • 2
  • 16
  • 19
  • Unfortunately, that does not work for the scripts post script in my spec file. Regardless of where I run the rpm install command, the pwd always prints out '/' – Coop Feb 13 '14 at 13:10