Summary: | sys-power/apcupsd-3.14.10-r1 needs updates and systemd files | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Billy DeVincentis <billydv1> |
Component: | Current packages | Assignee: | Matthew Marlowe (RETIRED) <mattm> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | base-system, systemd |
Priority: | Normal | Keywords: | EBUILD, PATCH |
Version: | 10.1 | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | |||
Bug Blocks: | 448882 | ||
Attachments: |
ebuild with new features
snmp patch apcupsd.service apcupsd_shutdown patch for revised ebuild |
Created attachment 355448 [details, diff]
snmp patch
Created attachment 355450 [details]
apcupsd.service
Created attachment 355452 [details]
apcupsd_shutdown
Comment on attachment 355446 [details]
ebuild with new features
--- apcupsd-3.14.10-r1.ebuild 2013-03-29 16:56:10.124094194 +0100
+++ - 2013-08-11 13:35:33.743807198 +0200
@@ -38,6 +38,7 @@
src_prepare() {
epatch "${FILESDIR}/${PN}-3.14.9-aliasing.patch"
+ epatch "${FILESDIR}/${PN}-snmp.patch"
}
src_configure() {
@@ -104,6 +105,12 @@
keepdir /var/lock
fowners root:uucp /var/lock
fperms 0775 /var/lock
+
+ ## Insert systemd files
+ insinto /usr/lib/systemd/system
+ doins "${FILESDIR}"/apcupsd.service
+ insinto /usr/lib/systemd/system-shutdown
+ doins "${FILESDIR}"/apcupsd_shutdown
}
pkg_postinst() {
Created attachment 355712 [details]
patch for revised ebuild
(In reply to Billy DeVincentis from comment #5) > Created attachment 355712 [details] > patch for revised ebuild Billy, Please add "systemd" to the top inherit and use "systemd_dounit" instead of insinto and doins. That will only work for /usr/lib/systemd/system but not for shutdown. CCing systemd for their input on the most correct way to handle that. Only way I see now is: insinto $(systemd_get_unitdir)-shutdown doins "${FILESDIR}"/apcupsd_shutdown The 'powerfail' removal sounds like something to do via tmpfiles.d. Is the 'shutdown' part supposed to be called at the far end of shutdown procedure? Folks, Please go ahead and make the changes as I am not real good at ebuild stuff. The service files I pulled from Fedora and they seem to work just fine. (In reply to Billy DeVincentis from comment #8) > Folks, > Please go ahead and make the changes as I am not real good at ebuild > stuff. The service files I pulled from Fedora and they seem to work just > fine. Regarding the shutdown issue, maybe reviewing what other distributions like Mageia or Arch are doing could help :/ +*apcupsd-3.14.10-r2 (31 Aug 2013) + + 31 Aug 2013; Pacho Ramos <pacho@gentoo.org> +apcupsd-3.14.10-r2.ebuild, + +files/apcupsd-tmpfiles.conf, +files/apcupsd.service: + Add unit file (#480298 by Billy DeVincentis) + |
Created attachment 355446 [details] ebuild with new features sys-power/apcupsd-3.14.10-r1 needs updates and systemd files 1- does not compile against new snmp added patch previously in another bug here is the addition in the ebuild src_prepare() { epatch "${FILESDIR}/${PN}-3.14.9-aliasing.patch" epatch "${FILESDIR}/${PN}-snmp.patch" 2- no system d service files, wasn't sure how to add this , here is what I added at bottom of src_install section src_install() { emake DESTDIR="${D}" install || die "installed failed" rm -f "${D}"/etc/init.d/halt insinto /etc/apcupsd newins examples/safe.apccontrol safe.apccontrol dodoc ChangeLog* ReleaseNotes doman doc/*.8 doc/*.5 dohtml -r doc/manual/* rm "${D}"/etc/init.d/apcupsd newinitd "${FILESDIR}/${PN}.init.3" "${PN}" newinitd "${FILESDIR}/${PN}.powerfail.init" "${PN}".powerfail # remove hal settings, we don't really want to have it around still. rm -r "${D}"/usr/share/hal # replace it with our udev rules if we're in Linux if use kernel_linux; then udev_newrules "${FILESDIR}"/apcupsd-udev.rules 60-${PN}.rules fi # Without this it'll crash at startup. When merging in ROOT= this # won't be created by default, so we want to make sure we got it! keepdir /var/lock fowners root:uucp /var/lock fperms 0775 /var/lock ## Insert systemd files insinto /usr/lib/systemd/system doins "${FILESDIR}"/apcupsd.service insinto /usr/lib/systemd/system-shutdown doins "${FILESDIR}"/apcupsd_shutdown } Seems to work am attaching all files and the new ebuild itself