Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 7778

Summary: apcupsd-3.9.9.ebuild - adds USB UPS devices
Product: Gentoo Linux Reporter: Zach Welch (RETIRED) <zwelch>
Component: New packagesAssignee: Zach Welch (RETIRED) <zwelch>
Status: VERIFIED FIXED    
Severity: enhancement    
Priority: Lowest    
Version: 1.2   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: apcupsd-3.9.9.ebuild
apcupsd-3.9.9-add_platform.patch
apcupsd-3.9.9-add_platform_pt2.patch
apcupsd-3.9.9.ebuild
apcupsd-3.9.9-gentoo.patch
apcupsd-3.9.9-postinst.patch
apcupsd-gentoo.tar.gz
apcupsd-3.10.1.ebuild

Description Zach Welch (RETIRED) gentoo-dev 2002-09-10 21:19:09 UTC
I am attaching an ebuild for apcupsd 3.9.9, which includes support for USB UPS
devices.  Using this ebuild, I have successfully setup and connected to my APC
Back-UPS 500, purchased this morning.

There are two small patches to the source to add explicit Gentoo support, though
these are surely incomplete.

This still needs testing, but here it is.
Comment 1 Zach Welch (RETIRED) gentoo-dev 2002-09-10 21:24:59 UTC
Created attachment 3810 [details]
apcupsd-3.9.9.ebuild

New ebuild file
Comment 2 Zach Welch (RETIRED) gentoo-dev 2002-09-10 21:26:26 UTC
Created attachment 3811 [details, diff]
apcupsd-3.9.9-add_platform.patch
Comment 3 Zach Welch (RETIRED) gentoo-dev 2002-09-10 21:27:17 UTC
Created attachment 3812 [details, diff]
apcupsd-3.9.9-add_platform_pt2.patch
Comment 4 Zach Welch (RETIRED) gentoo-dev 2002-09-10 21:46:50 UTC
Ugh, sorry for the flurry of e-mails, but here's my last few comments:

- the above patches go in ..portage/sys-apps/apcupsd(/files)
- i should have merged the patches
- the distribution files are being built, but not used by the install.
- I thought briefly about patching the package to be able to just 'make install'
  - that needs DESTDIR or similar makefile patching, yes?

Let me know.  It seems to build and work for me, but this is my first ebuild.
Comment 5 Zach Welch (RETIRED) gentoo-dev 2002-09-11 06:30:21 UTC
Created attachment 3829 [details]
apcupsd-3.9.9.ebuild

Obsoletes attachment 3810 [details], but I don't have the privs...

Okay, this new ebuild works a lot better.  It requires two new patches:
 - apcupsd-3.9.9-gentoo.patch  -- DESTDIR changes to "make install" work
 - apcupsd-3.9.9-postinst.patch -- fixes notifcation scripts 

I am seriously considering consolidating the notification scripts, so those
changes were not made to the source tree.

If someone says the patch is reasonable, I will pass it on to the package
maintainer for incorporation into a future release.  I have serious doubts
about the halt script handling though, as it seems there have been improvements
to the package's dynamically handling that situation (sed patch power!).
Comment 6 Zach Welch (RETIRED) gentoo-dev 2002-09-11 06:31:31 UTC
Created attachment 3830 [details, diff]
apcupsd-3.9.9-gentoo.patch

obsoletes attachment 3811 [details, diff]
Comment 7 Zach Welch (RETIRED) gentoo-dev 2002-09-11 06:32:35 UTC
Created attachment 3831 [details, diff]
apcupsd-3.9.9-postinst.patch

obsoletes 3812
Comment 8 Zach Welch (RETIRED) gentoo-dev 2002-09-12 17:12:23 UTC
Created attachment 3870 [details]
apcupsd-gentoo.tar.gz

obsoletes all previous patches (still no 'edit attachments' permissions!)

As I went to send of my patch to the developer, I found this new version.  In
merging my old patch, I went ahead and improved the build significantly. 
Testing then showed that 3.10.0 is *not* stable (with my UPS at least), so
ebuilds for both are being provided.  3.9.9 now includes fully workig
powerflute and multimon.cgi support, with the appropriate dependencies.

The ebuilds also include {pre|post}{rm|inst} functions to handle stopping and
starting the daemon, installing and removing runlevel links, and cleaning up
configuration files after all versions have been removed.

I have tested this extensively on my system, and I'll be happy to tweak the
patches or ebuilds if anyone has any problems.
Comment 9 Zach Welch (RETIRED) gentoo-dev 2002-09-15 14:57:46 UTC
status update:

The changes included in the apcupsd-3.10.0-gentoo.patch file have been accepted
by Riccardo Facchetti, the primary apcupsd maintainer.  It would be nice to have
these changes fully reviewed by an experienced ebuilder before he releases
another stable version, and I am willing to intermediate any further changes
that may need to be sent.

Minor ebuild changes:

* I discovered lintool and discovered the ebuilds are missing their RDEPEND env
variable.  The patch should be obvious for whoever pushes this into CVS.

* The current ebuild installs a link to start apcupsd in the boot runlevel. This
does not work as /usr may not be mounted when it is launched.  This can leave
the daemon in a state required root to 'rm /mnt/.init.d/started/apcupsd' in
order to be able to start the daemon later.   Removing the boot runlevel from
the ebuild's 'rc-update add' fixes this, but I think this service should be
started at that time - requiring the binaries to be moved to /sbin.  This may be
appropriate, but I want to hear from others.  For now, tweaking the rc-update
command seems to be the least path of resistance.

Comment 10 Zach Welch (RETIRED) gentoo-dev 2002-10-18 17:50:30 UTC
now that we have testing keywords, I am adding going to add 3.9.9 (and the 
latest 3.10.1 release) to CVS.  apcupsd 3.10.1 includes the patches required 
for 3.9.9 
Comment 11 Zach Welch (RETIRED) gentoo-dev 2002-10-22 17:13:15 UTC
an ebuild for apcupsd 3.10.1 was added to portage.  It requires no additional 
patches, as the original patches posted here were incorporated into the main 
package.  It just works.  :) 
Comment 12 Zach Welch (RETIRED) gentoo-dev 2002-10-22 17:15:41 UTC
Created attachment 4913 [details]
apcupsd-3.10.1.ebuild

Obsoletes all previous attachments.
Comment 13 pasi.valminen 2002-12-17 17:16:20 UTC
Works splendid with 2.4.x series but on my 2.5.47 /etc/init.d/apcupsd just says:

apcupsd FATAL ERROR in linux-usb.c at line 610
Cannot open UPS device

and hangs, not like ctrl+c couldn't kill it but it just waits for something.
Surely this is a kernel bug rather than bug in apcupsd, just wanted to report
since all other usb things work with 2.5.47. 

Great work btw. I'll try on later 2.5.x when I get one working as good as this
2.5.47 does.
Comment 14 Zach Welch (RETIRED) gentoo-dev 2003-03-01 13:37:54 UTC
stable in tree, closed