how to create a directory in RPM SPEC file?
To create the directory for our linux driver, the spec file has:
install --directory %{installdir}/linux_driver which works fine and RPM makes the directory <whatever>/linux_driver I also need to create the directory /var/mystuff but I can't figure out how to do that. I tried: install --directory /var install --directory /var/mystuff but (on our build machine, not my development machine) that gets rejected with the message: + install --directory /var install: cannot change permissions of `/var': Operation not permitted I also tried without making /var first, with just the second line alone, like this: install --directory /var/mystuff but that is also rejected. Maybe our build machine doesn't have a /var directory, or maybe it's restricted in some way -- it's not accessible to me, I only get the logs of the build. So how can the spec file tell RPM to make a directory /var/mystuff? Thanks for any clues |
When you're building packages you should be (building as unprivileged user and) confining your work to ${RPM_BUILD_ROOT} and create and place everything there. Next to that most phases accept shell scripting so in the %install phase using 'mkdir ${RPM_BUILD_ROOT}/var' should work too. Make sure you list "/var/mystuff" in %files with the right %attr. If that's not it, please post more details.
|
Quote:
In this realm I'm so ignorant that I need to ask: > Make sure you list "/var/mystuff" in %files with the right %attr. Given that mystuff needs to be a directory (it might already exist, but if not it must be created) what would be the right %attr ? Also, will the install fail if mkdir fails due to the directory already being present? That is, is a test required? thanks again |
Quote:
Quote:
|
Many thanks!
My TODO today: Maximum RPM for bedtime reading. |
NP. Maybe post the .spec file you're working on here? Could be interesting.
|
Quote:
Code:
Summary: litarbo |
No comments, looks pretty neat...
|
All times are GMT -5. The time now is 03:02 PM. |