SA Bugzilla – Bug 1075
RPM build puts wrong path in the *.cf files
Last modified: 2002-10-14 18:40:51 UTC
I noticed that the RPM-build process puts the RPM_BUILD_ROOT into all the *.cf files in the comment about where to find the local.cf file. One solution is to add a command to the spamassassin.spec file that will filter out this unwanted build-path prefix from the files.
Created attachment 381 [details] Filter the *.cf files
Subject: Re: [SAdev] New: RPM build puts wrong path in the *.cf files On Mon, Oct 07, 2002 at 11:05:19AM -0700, bugzilla-daemon@hughes-family.org wrote: > I noticed that the RPM-build process puts the RPM_BUILD_ROOT into all the *.cf > files in the comment about where to find the local.cf file. > > One solution is to add a command to the spamassassin.spec file that will filter > out this unwanted build-path prefix from the files. The problem is that build/preprocessor.pm replaces the @@LOCAL_RULES_DIR@@ macro with the setting given to "make". It changes spamassassin, spamd, and the rules files. However, spamassassin and spamd get changed at build time (proper paths), while the rules file get changed at install time which is going into the buildroot path. My solution was to modify Makefile.PL with a patch: - $(PERL) build/preprocessor $(FIXVARS) <rules/$$file >$(DEF_RULES_DIR)/$$file; \ + $(PERL) build/preprocessor $(FIXVARS) <rules/$$file | sed -e "s,Use .*/local.cf,Use /etc/mail/spamassassin/local.cf," >$(DEF_RULES_DIR)/$$file; \ Which is valid in the RPM building process, but not generic enough for a patch to the Makefile.PL file itself. I don't want to kluge in a fix to the spec file (such as the perl command originally posted) since it's a band-aid instead of an actual solution...
I'm gonna fix this one. I think the best solution will be to copy the modified rules to blib and install them from there. Then the rules files will be changed on build time and not install time, too.
actually, prob a better solution is to send in 2 settings for each one: LOCAL_RULES_DIR = what the installed version should expect BUILD_LOCAL_RULES_DIR = what it's being built with then the latter contains RPM_BUILD_DIR as a prefix. this is like what you have to do when installed sw with AFS. does that sound do-able?
Hmmm... two things I noticed: 1. The segmentation fault was the only time two parallel connections to the SQL server were established. 2. In the logmsgs you find the uid of the user (eg. kids007:99). In your case it's always 99...
Eh? How did the last comment end in this bug? I typed it into 1087...?
OK, I've just checked in a potential fix for this to b2_4_0. (can't check it in on HEAD as I've hacked my copy of this extensively and that code's not ready ;) The new system works as follows -- cutting the comments from Makefile.PL: # RPM builders, or people building in their home dirs: # set PREFIX (default = /usr) # set SYSCONFDIR (default = /etc) # set INST_PREFIX (default = [same as PREFIX]) # set INST_SYSCONFDIR (default = [same as SYSCONFDIR]) # # For example, to install in your home dir: # # perl Makefile.PL PREFIX=/home/jm/sausr SYSCONFDIR=/home/jm/saetc # # Or to build a package in /tmp/build, but with its internal paths # referring to /usr and /etc: # # perl Makefile.PL PREFIX=/tmp/build/usr SYSCONFDIR=/tmp/build/etc \ # INST_PREFIX=/usr INST_SYSCONFDIR=/etc I've rewritten the spamassassin.spec to use it, and it seems to work nicely. how does that sound?
*** Bug 1089 has been marked as a duplicate of this bug. ***
Subject: Re: [SAdev] RPM build puts wrong path in the *.cf files Thanks Justin.
marking this one fixed, since we can now use separate build-time and install-time paths to Makefile.PL