Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 25879 - bug in webapp-apache.eclass
Summary: bug in webapp-apache.eclass
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Unclassified (show other bugs)
Hardware: All Linux
: High major
Assignee: Stuart Herbert (RETIRED)
URL:
Whiteboard:
Keywords:
: 25976 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-08-04 08:51 UTC by Carsten Lohrke (RETIRED)
Modified: 2011-10-30 22:21 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Carsten Lohrke (RETIRED) gentoo-dev 2003-08-04 08:51:46 UTC
the directory for apache-1.x is /etc/apache 
 
Calculating dependencies ...done!
>>> emerge (1 of 1) net-www/phpBB-2.0.5 to /
grep: /etc/apache1/conf/apache1.conf: No such file or directory
>>> md5 src_uri ;-) phpBB-2.0.5.tar.gz
grep: /etc/apache1/conf/apache1.conf: No such file or directory
 * Installing for Apache v1
Caught signal 2
Killed



Reproducible: Always
Steps to Reproduce:
1.
2.
3.
Comment 1 Stuart Herbert (RETIRED) gentoo-dev 2003-08-05 10:02:21 UTC
Hi Carlo, 
 
I've added a fix for this to webapp.eclass v1.6, which should be hitting the rsync 
servers within the hour. 
 
Please test this, and let me know how you get on. 
 
Best regards, 
Stu 
Comment 2 Carsten Lohrke (RETIRED) gentoo-dev 2003-08-05 11:31:41 UTC
thx, works - next small bug:

>>> Merging net-www/phpBB-2.0.5 to /
/usr/sbin/ebuild.sh: line 1: webapp-apache_pkg_preinst: command not found


btw.: I test it only for apache-1. I really don't want to install apache-2, yet.
Comment 3 Carsten Lohrke (RETIRED) gentoo-dev 2003-08-05 11:54:21 UTC
Could you add

webapp-apache_src_compile() {
        #we need to have this empty function ... default compile hangs
	echo "Nothing to compile"
}


EXPORT_FUNCTIONS src_compile 


Ebuilds like phpBB or davedap (not yet in portage) doesn't need to add this function again and again, while others can supersede it.
Comment 4 Carsten Lohrke (RETIRED) gentoo-dev 2003-08-05 12:04:02 UTC
Adding something like 

${HTTPD_ROOT}/${PN_downcase} instead of ${HTTPD_ROOT}/phpbb

in pkg_setup()

it should be possible to move this funtion to the eclass, too. But I'm not sure, if it's good to hide this funtion in an eclass.
Comment 5 Stuart Herbert (RETIRED) gentoo-dev 2003-08-05 15:35:19 UTC
Okay, found that.  Fix is in webapp-apache.eclass v1.7, should be on the rsync  
servers within the hour.  
 
I'm not going to add the src_install() to the eclass, as not all ebuilds have nothing to 
compile. 
 
Best regards,  
Stu  
Comment 6 Jason A. Mobarak (RETIRED) gentoo-dev 2003-08-05 16:12:04 UTC
*** Bug 25976 has been marked as a duplicate of this bug. ***
Comment 7 Carsten Lohrke (RETIRED) gentoo-dev 2003-08-19 14:19:06 UTC
>I'm not going to add the src_install() to the eclass, as not all ebuilds have nothing to compile. 

I really don't understand this, Ebuilds that _not_have_nothing_ to compile can easily override the inherited function.

Maybe I'm a dumb idiot and it is intended, but according to http://www.gentoo.org/doc/en/eclass-howto.xml#doc_chap1 you only get the proper inheritance/export functionality, if the functions you want to export are named eclassname_functionname()

eg. webapp-apache_pkg_setup() instead of webapp-pkg_setup ()

I could add another eclass with two samples to show you if appreciated!?

In my eyes the current eclass implementation is wrong, otherwise enlighten me please. ;-)
Comment 8 Stuart Herbert (RETIRED) gentoo-dev 2003-08-19 14:32:43 UTC
Hi Carlo, 
 
An eclass is just a bash shell script, and any functions defined in the eclass can be 
called from an ebuild, no matter what they are called. 
 
The reason that the functions are *not* called webapp_apache_* is because, in 
future, I may supply another eclass to support the same functionality for different 
webservers. 
 
Think about it.  An ebuild that calls webapp_apache_* explicitly needs modifying 
extensively to support, say, webapp_tux_*.  But, if the functions in the eclass are 
just called webapp_*, then the ebuild only needs to pull in the correct eclass for the 
webserver. 
 
Yes, I'm deliberately subverting the documentated way that eclasses are supposed 
to behave - but that's because, in this case, I believe this way is closer to the spirit 
of why eclasses were invented in the first place. 
 
As to src_compile() ... right now, none of the ebuilds that rely on 
webapp-apache.eclass have anything to compile.  I'd rather add a 
webapp-c.eclass, and a webapp-perl.eclass and so on to provide re-usable 
configuration and compilation functions.  webapp-apache.eclass is all about the 
apache part of installing a webapp; if it was meant to be more general, I'd have 
called it webapp.eclass. 
 
Once GLEP 11 has gone through (see the discussion in the gentoo-dev mailing list 
archives, and http://glep.gentoo.org), the webapp-apache.eclass will probably be 
deprecated anyway. 
 
Best regards, 
Stu 
Comment 9 Carsten Lohrke (RETIRED) gentoo-dev 2003-08-29 17:38:27 UTC
Hi Stuart,

thanks for long answer. I had not time to read the GLEP and the discussions by now, but I'll do it for sure. 

Another one: 

fowners "$HTTPD_USER"."$HTTPD_GROUP" "$HTTPD_ROOT" in
function webapp-determine-htdocsdir ()

If apache had a security problem, it could delete "$HTTPD_ROOT"/*
I'll prefer it, if the directory is owned by root.
Comment 10 Stuart Herbert (RETIRED) gentoo-dev 2003-08-29 17:53:10 UTC
I appreciate the problem, but some web apps need to be able to write to directories 
under $HTTPD_ROOT. 
 
When we roll out the new way of doing webapps, most of the directories *will* be 
owned by root, with only writable ones owned by the webserver.  Hope you don't 
mind, but I'd rather push on with getting the new way of handling webapps done, so 
I've got a long-term solution to port all the existing ebuilds to. 
 
Best regards, 
Stu 
Comment 11 Carsten Lohrke (RETIRED) gentoo-dev 2003-09-25 12:53:58 UTC
Hi Stuart,

hope you don't expected a fast answer. I'd like to see these ownership problem
solved in the rewritten webapp eclass. Read some interesting #gentoo-dev
discussion about it? When will be there? Soon!? If not - could you have a
look at bug #26808? The bug describes a general webapp-apache.eclass/userpriv
problem. Thx! :)
Comment 12 Carsten Lohrke (RETIRED) gentoo-dev 2003-09-25 12:57:57 UTC
Hm, don't mind the first question mark. I rearranged the sentences a little
and lost it somehow. ;)
Comment 13 Torsten Veller (RETIRED) gentoo-dev 2003-11-10 02:12:19 UTC
Another bug in fowners line: Change '.' to ':'
fowners "$HTTPD_USER":"$HTTPD_GROUP" "$HTTPD_ROOT"
Comment 14 Philipp Kern 2003-12-05 10:04:37 UTC
This bug shows up "Status: NEW" to me, however the activity tells me CLOSED.
There is something wrong.
Comment 15 Stuart Herbert (RETIRED) gentoo-dev 2003-12-07 01:00:16 UTC
Hi Phil,

You're right - that shouldn't happen.  I've copied this in to our bug-wrangling team, in the hope that they can look into it, and see what's wrong with our bugzilla database or code.

Thanks,
Stu
Comment 16 SpanKY gentoo-dev 2003-12-07 01:03:49 UTC
this happened in the bugzilla oops from not too long ago