I have the source rpm package of cfengine 3.2.4. Now I want to change the workdir /var/lib/cfengine/work to /var/cfengine, like it’s in version 3.5.2. Finally I want to build it to have an installable rpm package.
I think I have to edit only the spec file, where I found the following lines:
assuming you have the source RPM “installed”, you’ll find the spec in /usr/src/packages/SPECS - modify it to your needs and use “rpmbuild -ba ” to build source & binary file.
Thank you! After additional changes of the spec file, I was able to build it without errors.
The installation of the just created package stores the files under /var/cfengine. Then I tried to bootstrap cfengine but it seems the paths are hard coded (/var/lib/cfengine). I don’t know but can that be?
→ This host is:
→ Operating System Type is linux
→ Operating System Release is 2.6.16.60-0.103.1-default
→ Architecture = x86_64
→ Internal soft-class is linux
→ No previous policy has been cached on this host
→ Assuming the policy distribution point at: :/var/cfengine/masterfiles
→ Attempting to initiate promised autonomous services…
cf-promises needs to be installed in /var/lib/cfengine/work/bin for pre-validation of full configuration
No public/private key pair found
!! Authentication dialogue with failed
Proposed executable file “$(sys.cf_key)” doesn’t exist
$(sys.cf_key) promises to be executable but isn’t
I: Made in version ‘not specified’ of ‘/var/lib/cfengine/work/inputs/failsafe.cf’ near line 18
R: This autonomous node assumes the role of voluntary client
R: !! Failed to pull policy from policy server
R: !! Did not start the scheduler
Proposed executable file “$(sys.cf_key)” doesn’t exist
$(sys.cf_key) promises to be executable but isn’t
I: Made in version ‘not specified’ of ‘/var/lib/cfengine/work/inputs/failsafe.cf’ near line 18
Proposed executable file “$(sys.cf_key)” doesn’t exist
$(sys.cf_key) promises to be executable but isn’t
I: Made in version ‘not specified’ of ‘/var/lib/cfengine/work/inputs/failsafe.cf’ near line 18
!! Bootstrapping failed, no input file at /var/lib/cfengine/work/inputs/promises.cf after bootstrap[/FONT]
but it seems the paths are hard coded (/var/lib/cfengine). I don’t know but can that be?
anything can be - have you "grep"ed for the directory name within your sources? If it’s not within any variable set by the spec file nor the “configure” defaults, it would have to be somewhere (and somehow, i.e. not necessarily as a single string) in the source code.
My first guess would be some “configure” default, though.
Have you considered creating /var/cfengine as a symbolic link to /var/lib/cfengine? It doesn’t change the workdir, but it makes the files available via the path var/cfengine. Reconfiguring is better, but evidently not as simple as you hoped so maybe a symlink would work instead. It depends why you are trying to change the workdir.
You could add a line in to the spec file that creates the symbolic link and leave everything else alone. Or forget about rebuilding the rpm entirely and manually create the symlink. It seems neater to have the symlink belong to the package though.