Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 7778 - apcupsd-3.9.9.ebuild - adds USB UPS devices
Summary: apcupsd-3.9.9.ebuild - adds USB UPS devices
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: Lowest enhancement (vote)
Assignee: Zach Welch (RETIRED)
Depends on:
Reported: 2002-09-10 21:19 UTC by Zach Welch (RETIRED)
Modified: 2003-03-01 13:37 UTC (History)
0 users

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

apcupsd-3.9.9.ebuild (apcupsd-3.9.9.ebuild,1.49 KB, text/plain)
2002-09-10 21:24 UTC, Zach Welch (RETIRED)
apcupsd-3.9.9-add_platform.patch (apcupsd-3.9.9-add_platform.patch,2.08 KB, patch)
2002-09-10 21:26 UTC, Zach Welch (RETIRED)
Details | Diff
apcupsd-3.9.9-add_platform_pt2.patch (apcupsd-3.9.9-add_platform_pt2.patch,677 bytes, patch)
2002-09-10 21:27 UTC, Zach Welch (RETIRED)
Details | Diff
apcupsd-3.9.9.ebuild (apcupsd-3.9.9.ebuild,1.41 KB, text/plain)
2002-09-11 06:30 UTC, Zach Welch (RETIRED)
apcupsd-3.9.9-gentoo.patch (apcupsd-3.9.9-gentoo.patch,17.16 KB, patch)
2002-09-11 06:31 UTC, Zach Welch (RETIRED)
Details | Diff
apcupsd-3.9.9-postinst.patch (apcupsd-3.9.9-postinst.patch,3.63 KB, patch)
2002-09-11 06:32 UTC, Zach Welch (RETIRED)
Details | Diff
apcupsd-gentoo.tar.gz (apcupsd-gentoo.tar.gz,7.14 KB, application/octet-stream)
2002-09-12 17:12 UTC, Zach Welch (RETIRED)
apcupsd-3.10.1.ebuild (apcupsd-3.10.1.ebuild,1.87 KB, text/plain)
2002-10-22 17:15 UTC, Zach Welch (RETIRED)

Note You need to log in before you can comment on or make changes to this bug.
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]

New ebuild file
Comment 2 Zach Welch (RETIRED) gentoo-dev 2002-09-10 21:26:26 UTC
Created attachment 3811 [details, diff]
Comment 3 Zach Welch (RETIRED) gentoo-dev 2002-09-10 21:27:17 UTC
Created attachment 3812 [details, diff]
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]

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]

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

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

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]

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