Bug 130714 - Should apcupsd use webapp-config if cgi is requested?
Bug#: 130714 Product:  Gentoo Linux Version: 2006.0 Platform: x86
OS/Version: Linux Status: RESOLVED Severity: enhancement Priority: P5
Resolution: FIXED Assigned To: tantive@gentoo.org Reported By: shrdlu@unlimitedmail.org
Component: Applications
URL: 
Summary: Should apcupsd use webapp-config if cgi is requested?
Keywords:  
Status Whiteboard: 
Opened: 2006-04-21 04:32 0000
Description:   Opened: 2006-04-21 04:32 0000
Well, don't know if this is a feature or a bug...currently it puts the cgi
directly in /var/www/apcupsd.

------- Comment #1 From Conrad Kostecki 2006-05-04 07:43:33 0000 -------
Yes!
It should!

------- Comment #2 From Michael Imhof 2006-05-04 11:09:53 0000 -------
Great, so please provide an updated ebuild using webapp-config.

------- Comment #3 From Kevin Daughtridge 2006-05-23 22:17:00 0000 -------
I've prepared an ebuild for 3.12.3 which uses webapp.eclass. It also fixes some
unrelated issues as I described in bug 132157.

Because webapp provides a CGIBINDIR which is most appropriate for apcupsd's
*.cgi, the use of depend.apache and the apache2/lighttpd DEPENDs, USEs, and
.conf files are unnecessary. It doesn't appear, however, that lighttpd is
currently supported by webapp. This would be a regression in that sense--but
the webapp contents could be manually copied into a lighttpd server root.

Other changes: --with-css-dir is no longer available, and I've replaced it with
a manual mv to MY_CGIBINDIR in src_install. Because apcupsd is mostly a system
daemon and doesn't touch htdocs, I've set WEBAPP_MANUAL_SLOT. I dropped the
X*DIR global variables, which don't seem to serve any useful purpose now, and
added --mandir. There's also a note about the CGIs moving from /var/www/apcupsd
into webapp.

------- Comment #4 From Kevin Daughtridge 2006-05-23 22:21:14 0000 -------
Created an attachment (id=87358) [details]
apcupsd-3.12.3.ebuild

This ebuild merges and runs (daemon and CGI) properly for me on x86 with
USE="+cgi +doc +ncurses +nls -snmp +threads +usb +vhosts". Since I'm +vhosts, I
can't speak for the webapp auto-setup.

------- Comment #5 From Etaoin Shrdlu 2006-05-25 04:40:45 0000 -------
(In reply to comment #4)
> Created an attachment (id=87358) [edit] [details]
> apcupsd-3.12.3.ebuild
> 
> This ebuild merges and runs (daemon and CGI) properly for me on x86 with
> USE="+cgi +doc +ncurses +nls -snmp +threads +usb +vhosts". Since I'm +vhosts, I
> can't speak for the webapp auto-setup.

I get this when I try to build it:

# emerge -Dav apcupsd

These are the packages that I would merge, in order:

Calculating dependencies ...done!
[ebuild  N    ] sys-power/apcupsd-3.12.3  +cgi -doc +ncurses +nls -snmp
+threads -usb -vhosts 0 kB [1]

Total size of downloads: 0 kB
Portage overlays:
 [1] /usr/local/portage

Do you want me to merge these packages? [Yes/No] y
>>> emerge (1 of 1) sys-power/apcupsd-3.12.3 to /
>>> md5 files   ;-) apcupsd-3.12.3.ebuild
>>> md5 files   ;-) files/digest-apcupsd-3.12.3
>>> md5 src_uri ;-) apcupsd-3.12.3.tar.gz
 *
 * This ebuild overrides the default SLOT behaviour for webapps
 * If this package installs files into the htdocs dir, this is
 * probably a bug in the ebuild.
 *
>>> Unpacking source...
>>> Unpacking apcupsd-3.12.3.tar.gz to /var/tmp/portage/apcupsd-3.12.3/work

 * Cannot find $EPATCH_SOURCE!  Value for $EPATCH_SOURCE is:
 *
 *   /usr/local/portage/sys-power/apcupsd/files/3.12.3/apcupsd.in.patch
 *   ( apcupsd.in.patch )


!!! ERROR: sys-power/apcupsd-3.12.3 failed.
!!! Function epatch, Line 196, Exitcode 0
!!! Cannot find $EPATCH_SOURCE!
!!! If you need support, post the topmost build error, NOT this status message.

------- Comment #6 From Kevin Daughtridge 2006-05-25 10:55:38 0000 -------
(In reply to comment #5)

Sorry, forgot to mention -- as with previous versions, this ebuild expects the
FILESDIR files to be in files/3.12.3/. Just create that directory and copy the
two patches from files/3.12.2/.

The message about manual SLOTting is from webapp.eclass and unavoidable.

------- Comment #7 From Etaoin Shrdlu 2006-05-26 03:05:06 0000 -------
(In reply to comment #6)
> (In reply to comment #5)
> 
> Sorry, forgot to mention -- as with previous versions, this ebuild expects the
> FILESDIR files to be in files/3.12.3/. Just create that directory and copy the
> two patches from files/3.12.2/.
> 
> The message about manual SLOTting is from webapp.eclass and unavoidable.

Ok, works fine for me. The "+doc" behaves differently from the standard ebuild
also, I had to disable it otherwise it wanted to pull in *a lot* of
dependencies, among which latex2html and ghostscript! Is this the expected
behaviour?

Thanks for now.

------- Comment #8 From Kevin Daughtridge 2006-05-26 12:23:17 0000 -------
(In reply to comment #7)

In previous versions, +doc pulled in the full manual, which was included fully
built in the tarball. In 3.12.*, the manual has been converted from texinfo to
LaTeX, and is only included as its LaTeX source. TeX is, of course, required to
build it, and unfortunately even the PDF won't generate properly without
latex2html.

Other packages have somewhat heavy +doc requirements: those that use doxygen
pull in ghostscript, and gtk-doc needs opensp and openjade. For apcupsd, the
200-some MB of teTeX does seem excessive. On the other hand, the whole purpose
of USE=doc is to allow selective control of this.

Ideally, upstream would distribute the built manual too--it might be worth
asking. As for the ebuild, I suppose it could go either way, but I'd prefer the
choice.

------- Comment #9 From Michael Imhof 2006-06-21 11:30:15 0000 -------
In cvs.
Thanks for your help.