I was unable to build apache using --buildpkg such that it works. g2boojum suggested I try it without --buildpkg. That worked. (I had unmerge apache first) I wanted to know the difference, so without unmerging apache first, I emerge --buildpkg apache. When it merged in, this is what I got: --- /etc/apache/conf/apache.conf.default Wed Jun 12 16:24:52 2002 +++ /etc/apache/conf/._cfg0000_apache.conf.default Wed Jun 12 16:28:38 2002 @@ -202,86 +202,6 @@ # # Example: # LoadModule foo_module libexec/mod_foo.so -LoadModule mmap_static_module lib/apache/mod_mmap_static.so -LoadModule vhost_alias_module lib/apache/mod_vhost_alias.so -LoadModule env_module lib/apache/mod_env.so -LoadModule config_log_module lib/apache/mod_log_config.so -LoadModule agent_log_module lib/apache/mod_log_agent.so -LoadModule referer_log_module lib/apache/mod_log_referer.so -LoadModule mime_magic_module lib/apache/mod_mime_magic.so -LoadModule mime_module lib/apache/mod_mime.so -LoadModule negotiation_module lib/apache/mod_negotiation.so -LoadModule status_module lib/apache/mod_status.so -LoadModule info_module lib/apache/mod_info.so -LoadModule includes_module lib/apache/mod_include.so -LoadModule autoindex_module lib/apache/mod_autoindex.so -LoadModule dir_module lib/apache/mod_dir.so -LoadModule cgi_module lib/apache/mod_cgi.so -LoadModule asis_module lib/apache/mod_asis.so -LoadModule imap_module lib/apache/mod_imap.so -LoadModule action_module lib/apache/mod_actions.so ... and ServerAdmin was different This is a very serious bug! Apache *will not run* if built using --buildpkg.
jnelson tells me he used the freakily-fast version. I verified the bug w/ the current version in Portage. One can also obtain this bug by doing an ebuild apache-1.3.24-r2.ebuild package followed by emerge --usepkg apache.
Confirmed that the "bad" file is in the tbz2 generated by --buildpkg.
using ebuild --debug apache-1.3.24-r2.ebuild compile then ebuild --debug apache-1.3.24-r2.ebuild install then diff /etc/apache/conf/apache.conf.default /var/tmp/portage/apachult 3.24-r2/image/etc/apache/conf/apache.conf.default I get just *one* difference, the ServerAdmin line has jnelson@my_hostname instead of root@.. Hmmm... (I can only assume it's grabbing it from the environ, probably $USER, or perhaps $LOGUSER, the only environment variables that have my name in it, despite my being root)
I believe the step that builds apache.conf.default is in the Makefile for apache, in the install-config target. ./src/helpers/install.sh -c -m 644 ./conf/httpd.conf-dist[*] /var/tmp/portage/apache-1.3.24-r2/image//etc/apache/conf/apache.conf.default When I am root via 'su -' (clears environment), then everything seems to work. Hmmm.....
If I use emerge, I get the (bad) behavior. If I use ebuild, after having become root via su (not su -), then 99% of the problems are gone (apache appears to use either USER or LOGUSER from the environ, which su doesn't reset, but su - (of course) does) I suspect that 'su -' + ebuild (package) would result in a "good" tbz2. Why is 'emerge' different than 'ebuild'?
./src/helpers/binbuild.sh: USER=$1 ./src/helpers/binbuild.sh: USER="`src/helpers/buildinfo.sh -n %u@%h%d`" ./src/helpers/binbuild.sh: echo "system and was built by \"$USER\"." && \ ./src/helpers/buildinfo.sh: username="$USER" Aha! We get closer.
Jon the problem is that MY_BUILTINS is not defined inside src_compile. this is because pkg_setup() is not getting run by emerge i suppose. we had this problem before (bad apache .tbz'2) then drobbins ssh'd to my dev box, we discovered pkg_setup() was not correctly done in the portage code. this looks like the exact same bug. it is causing other people to report related, but totally redundant and seemigly weird bugs. to 'quick fix' it, move the lines in pkg_setup() into src_compile and do emerge --buildpkg now. (so basically relocate the pkg_setup() code into src_compile). you'll see that it now works.
Created attachment 1805 [details, diff] changes to apache-1.3.26-r2.ebuild This allows apache to be built successfully with --buildpkg Additionally, it makes the 'add apache uid/gid' stuff to postinst, instead of the pkg_setup. Obviously, pkg_setup won't work with --buildpkg, either.
This *should* be fixed in Portage 2.0.9. Sent jnelson and woodchip a trivial portage fix that should do the trick.
This should be fixed in Portage 2.0.9