diff options
author | Pacho Ramos <pacho@gentoo.org> | 2013-09-28 08:09:07 +0000 |
---|---|---|
committer | Pacho Ramos <pacho@gentoo.org> | 2013-09-28 08:09:07 +0000 |
commit | 70b6fb8624055fa5c2fcb06f7a64f18359a19f00 (patch) | |
tree | 0da5b1ba5332ae6e643928dd6f5088aa97e09387 /app-admin/hddtemp | |
parent | Version bump, fixes #473574 by Dirkjan Ochtman <djc@gentoo.org> (diff) | |
download | historical-70b6fb8624055fa5c2fcb06f7a64f18359a19f00.tar.gz historical-70b6fb8624055fa5c2fcb06f7a64f18359a19f00.tar.bz2 historical-70b6fb8624055fa5c2fcb06f7a64f18359a19f00.zip |
Fix unit file (#485924 by Tilo Prütz)
Package-Manager: portage-2.2.7/cvs/Linux x86_64
Manifest-Sign-Key: 0xA188FBD4
Diffstat (limited to 'app-admin/hddtemp')
-rw-r--r-- | app-admin/hddtemp/ChangeLog | 10 | ||||
-rw-r--r-- | app-admin/hddtemp/Manifest | 24 | ||||
-rw-r--r-- | app-admin/hddtemp/files/hddtemp.service-r1 | 10 | ||||
-rw-r--r-- | app-admin/hddtemp/files/hddtemp.service.conf | 3 | ||||
-rw-r--r-- | app-admin/hddtemp/hddtemp-0.3_beta15-r24.ebuild | 94 | ||||
-rw-r--r-- | app-admin/hddtemp/hddtemp-0.3_beta15-r7.ebuild | 96 |
6 files changed, 221 insertions, 16 deletions
diff --git a/app-admin/hddtemp/ChangeLog b/app-admin/hddtemp/ChangeLog index 9176dcf1917b..c2c54edff4e5 100644 --- a/app-admin/hddtemp/ChangeLog +++ b/app-admin/hddtemp/ChangeLog @@ -1,6 +1,14 @@ # ChangeLog for app-admin/hddtemp # Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/app-admin/hddtemp/ChangeLog,v 1.137 2013/09/06 18:33:17 ago Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-admin/hddtemp/ChangeLog,v 1.138 2013/09/28 08:09:02 pacho Exp $ + +*hddtemp-0.3_beta15-r24 (28 Sep 2013) +*hddtemp-0.3_beta15-r7 (28 Sep 2013) + + 28 Sep 2013; Pacho Ramos <pacho@gentoo.org> +files/hddtemp.service-r1, + +files/hddtemp.service.conf, +hddtemp-0.3_beta15-r24.ebuild, + +hddtemp-0.3_beta15-r7.ebuild: + Fix unit file (#485924 by Tilo Prütz) 06 Sep 2013; Agostino Sarubbo <ago@gentoo.org> hddtemp-0.3_beta15-r6.ebuild: Stable for sparc, wrt bug #480036 diff --git a/app-admin/hddtemp/Manifest b/app-admin/hddtemp/Manifest index ab56cb60d00e..4e34e0df7f4b 100644 --- a/app-admin/hddtemp/Manifest +++ b/app-admin/hddtemp/Manifest @@ -1,5 +1,5 @@ -----BEGIN PGP SIGNED MESSAGE----- -Hash: SHA512 +Hash: SHA256 AUX hddgentoo.db 15101 SHA256 b8402ce5775851cdef3ad71bac58381e6547305476a7dacb24a6860873714c41 SHA512 e42c59daef2f345aaac75102c2546a14f906c7c9a91f1baffd87e556733a3c253c9f9163404fdf0a33a0c7e0bb9c51540799851898349518e26488b456707d86 WHIRLPOOL b2f9d84053b9bbbe397daae24cbabb998b068af39977ed45065651a07bc2c6718d29c8cbeb47a6a30ca768c65ca669bf17d1ba7b0ceb260f6791c85aa87264f6 AUX hddtemp-0.3_beta15-byteswap.patch 1037 SHA256 85eeaff97c96d2f77a93caa3270ee598f756c4eb0da6753e5ee8602fa1a5bdec SHA512 4d37b31129be7f767a416d4b15e3eaf94af297a7d2f4ed57f900fc48775bbb389ca1259c13dd048d670f32fe53f8d0e06c6f1c02485cb95a08d2a80aac4f76a8 WHIRLPOOL e1ce1bfae1964c97aba189158d2ea6e027a1b74fbd392e395d4ea46d69bc2412a2492d3fa1acff6472085bb4af40c88a2dd54a783db7d35b270c61619f09fb2d @@ -11,30 +11,24 @@ AUX hddtemp-0.3_beta15-satacmds.patch 986 SHA256 f3ae8ebd08d598cf9292d08e5fe07f5 AUX hddtemp-conf.d 418 SHA256 8c8878540bb164f46a094eb92d685df0d622dff11ef9534afa188db1ab6b14e2 SHA512 1263854d879fab9a75db9965f5ba07fe1ef77b1f30d3cee5ca0b87a6cfb7856596c160ea29cc3a6d7996ffc5073d2294ca5b0c0019c36757bf4e96f62fe079db WHIRLPOOL 9b207de6cb5d92c4aecf55bbb3a0502330718cc6f52beb91f340ba1a178eecbe2ddfcbe69694d2f7423269440c2836f46863258eadf717a291574794b9c4f2b9 AUX hddtemp-init 545 SHA256 20ce3d0a2c09295402c7c51751d6b8f8184825016db3af53829fac7cff4f509e SHA512 ceab13a24611ca24af55655936d8eff837f44d3f31c8f5a98e62b729ae674fa0f0c835cacb32390c785071ab333760886943e6af74d80d7dae69793c613f7e88 WHIRLPOOL 7b571c82957eeb3d9b02a77e3b1a113961d853ed673cc4d6dac690c66a8a905cd979da0ac845565b1a99f9215f87f16358a0643011d345eb6d4997c034114063 AUX hddtemp.service 283 SHA256 8c7379f3bb88f29cd3a98f57655d336368a0d471edf1df93fb7b9647a67f3f3b SHA512 7a67da016027a96cc3aa18796f6fd499a5ec75de45d33a90cbecd3904a730cd9231337763c1b8c7e322dbeaaf60ec8299dd721ed1d0c68d645f19ca3a0ac8420 WHIRLPOOL 420bc4e87859ecefe531ecf259d7dbecd51ab3ead6ce8a71dbf519855d58ec1466f62554a8e6a09c2dafbf9a78e7c96bf0a1d2d62d72563eda66f8f739ef709d +AUX hddtemp.service-r1 214 SHA256 029e51a7cd34835f22d9133d1e8755fa69ce494fe15fe4b265beae312e4aa9f2 SHA512 2218864bead8a0cc0f99d5125940f397fc1396d2e3f7afaf276c3bae0d6c2b2d23ebc51d3a93d3a492d055c8dcdaf44c56ed289d0343b9e264de48971d9153fd WHIRLPOOL cd09b8955e4697299c4297610b6bdf9ffe84aec37d39c1038cbdcabfe476776ef41e62e989372fd0c1fbeec6e6defc1531023fa195495644f941f260f60c4cc9 +AUX hddtemp.service.conf 88 SHA256 87954446f095607eb10ec281fa0ab93d782e5c19f843ad80f0fb86148d991786 SHA512 dac10db31111623f20580d36b49f2d9b292df39991a4b2590085c08b7a8dbda3903d5dc268d328a71c0bd8d02e781949ab2abde243ae35da8f79bef21aa3fae3 WHIRLPOOL 91374bdfafdb5959b696e119451d73e727e5f12acac90d1a0a68344b5800379e53fd8fa3e716ac2a5177cf2eb671e102ffdec5feed3fc6ba8bff00a89fccbf42 AUX update-hddtemp.db 827 SHA256 696bfaae093464f8b6c65254c3eb086d0113f728f3eaeadf4a6247630742f761 SHA512 6c350ed16bb7289a552bc1591b6a3eaaefb62092b43498608b90aa64f4a84c9cdffc4e439847bffa537341ea9dcdc28dbf1ef9b16de2dafe0ac3416d50af1273 WHIRLPOOL 2818b1eabe9cb0597eeace8a670e640f849de93a173c90cef29a21db75cc5a677eab9f4a6297666a64dba5f6dee68f6eb481e9a69c04df53535ac397c1232b1e DIST hddtemp-0.3-beta15.tar.bz2 256372 SHA256 618541584054093d53be8a2d9e81c97174f30f00af91cb8700a97e442d79ef5b SHA512 7db5a3dff60c59ce147b996ea4f8b6de1abcd34301bb863507b4d4b44e72fdc031078867a7f37161e67e74f6b426a1d856d3081179c678d2a442815bb0faa94d WHIRLPOOL 2ce6a2336737e8cbb409443b874c6767c753fbe4bb700540f9a545e69cd951d3de5743d5b26bcd3a3f8e007b1364273ec85d15da8a00968895def063aaac7705 DIST hddtemp-20080531.db.bz2 5627 SHA256 6a12bb68283c3224bef2ab086ae810b3f6b17b38f8203350acb3a73e21a6dfbd SHA512 cd03cc300aece4f7427fde1b58840643c8e41e6c0ce30b418a62bf44b268f249ef3dc4f5f4bcbc9cc0cfe0346c18d4f1da22451c87efc3d46faebcb81a1fe059 WHIRLPOOL 7443366204127c0831ce78a5dfd3506ff82a6c79a7daf75cc79e6bba6aad0357f7092c03e792e2e4ee31c2b47a8d8a15456e7b2c176d3a1c6b4633486f450666 EBUILD hddtemp-0.3_beta15-r22.ebuild 2518 SHA256 c421d5d6d178e58c2cb73bf08c9111fe1ebb865a000a7c11c877ce300e34270a SHA512 f0e31780690ae0ca2cf23dde2b684d2e324fac8656ea77ea2f4422da2d080e9683d0e381d3a4b53fd53a3635a058ed845291547300f74e84b0289bbb3f75b668 WHIRLPOOL 3bf137f0d81381071167d4f0ff38071ea43018b256baa6423ea6705e7dcef6ca9f440a4a78b333eb820b942eb8a0e6088ef022a75ad236dd7cc968e9f1211ea7 EBUILD hddtemp-0.3_beta15-r23.ebuild 2572 SHA256 84614898deb4057600602906db0eb1ac2baa70137a6a08bd9de80c61a16082df SHA512 8b18da56a9a97abdc77293b4aa8db55c05a5f7eaa3cade19b6bc7652020827179cc34d0fb9f4074ed80dfc4e0288326b26935c4b7b7d682b27c24100db186bb6 WHIRLPOOL 3dc3979a4515f61272b1ab13b53fe6ad3f3ab740908f20f3dd6ad786220847cdfc2b723b8dc4edf647735235c3d5ffe9b5d1db211a06044c4d23c7d3f2c4770c +EBUILD hddtemp-0.3_beta15-r24.ebuild 2651 SHA256 99ede40ee5c8e24b680c2ca58128232b3cdcbd61f2987c33befb394e267d3cd7 SHA512 d1a9c556acce483959a0ffdd777900e75381d5ae95a9ec7e38dce62af65cf494e6450412000f94f0fcf8ad38cc1abc503a2b5b1b36e70ea327e6ee1a119c1f60 WHIRLPOOL 47836fb030e93e6ebf8d1cc90ab96d28206c0e4f36ea99f321465347b80c0a60568f1b46c8314e96d2de38bc37fb0d16f97ef02dd50729a28a2a8f28917fa5c5 EBUILD hddtemp-0.3_beta15-r3.ebuild 2791 SHA256 f1f87f1c69d34d3fc99dff7a005bc27be2708a7804268e72fb24cad3e2078620 SHA512 2e79c5ab9063eff1f8b636ebbb58d40f500d1c25a7b08b4a61ac106cba69544a8b3877ff0c3f5669693f2ce14352c3168f486a6ac2ec2e0026e2efe12325fc90 WHIRLPOOL f02f0edcacb3e4086770f09f7a1ddb0b8d21cf5cfa86a1fcca271dfb320bdf76f5eda6ed35daa456af8ab406bb57f4a3181fd34bf181a28cc610840740fea609 EBUILD hddtemp-0.3_beta15-r5.ebuild 2605 SHA256 efae99f56304d9a729fe4a01a1c01592010005105de0a51f39da6861cdfafc90 SHA512 4edd4aa3d3e4f14cae2c33f75ecc49d37ceafe959d817df874edd6a294b2a456ea32863bbedbf13ae11ae3ac0050a1c4e27eb8d8c15a47d91269369c4ba4d4b5 WHIRLPOOL 0cd343a3451e5cacb76724a33ebb921068fc1d75b23607a512360e5026986c3f4b73c8f469939e6889c6f5e3a1b72348c72f79a263f5cce17f6a85c83b2f164e EBUILD hddtemp-0.3_beta15-r6.ebuild 2648 SHA256 62bfee22cb05ba28dfd2e56f715078d5382c41326774697b70fd66249f19030a SHA512 a9584375acbefc2fcb2d941c408602c7c827693ac714b64448dcec639a3df9471e4e9fbfc9a3fd868794aeccd45efb6a68a8729fcba7348189467ce5aff47256 WHIRLPOOL 9d3a2f9f22f2bf017ee06183ce219d7e2dc727c9cd5f36d5f1bb78d8773120d4a7440889a2bd620428e5351ecf832ed09a66f07e40e57ebb54259e19d8379f9d -MISC ChangeLog 22306 SHA256 763d7b298fe79afd656db96627963dcbe02852914af82b2dcd1fefe399c3f2fe SHA512 fcd7ce822b0bcb559d0fc3dad56799aa3e5124e2aaff42719dd8771b3763dee03749735874d935cafafa0725724245e206dd4cbae77f33e3cbf9cc2a2a863fbe WHIRLPOOL b34b71ee76c15020bca86426bccea5df33cb83b72079a94564e3855ca9cf49e16c3bfc6a9bec52147551b3f6ccf30aadc41c440ff4f38ba9453bf1ac2bec6feb +EBUILD hddtemp-0.3_beta15-r7.ebuild 2738 SHA256 322ce919b7db7bd2392d2625d891fe7f1c65e2cfc5056fd568f3f3ce51344c24 SHA512 961643b3cbc35d2c2a5cf70fd446c0dd518cd5cabac1545c5baa347160cc76196be1eec355e0691870b4f3d213a68ac3c73ada4b69b58b2fcfd476c265783481 WHIRLPOOL 90529ee0db109fb53b1a2614cc086a9e832dd1ecde384bc8424f0987b96b946735c46728bd511e728da4b9ca19c3797176b229b032ffcda730929957886c11b9 +MISC ChangeLog 22595 SHA256 422b0396221a7f2a9bb580ec36e6c947b17824c4773fb16f41aa4cdb686c3ed1 SHA512 faaac17f6298e8e4b9c93c0cac8af8c8c498c69e8bafe789d6d125213c95f81e757651dc9ea1b2a7550879a268ec72ef860138c76cdb81e0d10d729469f73d93 WHIRLPOOL 0d7aa2b486758c324d24e08597252cc2cfa40448d8980a1eeeaac2699b6e46af1da0af55f4b41a7e2d0b4c093a5903b726991868f2f4376d5ef67a5997a9f50a MISC metadata.xml 291 SHA256 19a53a724046c239a0b154490a8f07ee4d54e14942b507120ade8eeed4926a34 SHA512 af63c7441a0645f948bd0f8ffd2c965ee61861ad62c269c6ec95d74d70ae2f2c587542224f27107cf5b2c50c32e6b8227a0ce1100734a2fe2f7311e653da6263 WHIRLPOOL 2eac8c84e8ed85aa6dfa9935af99bd4af9a07389cb513dd952ebbd1e025205332cf6eb4d9303f8e9de1f2ba03922904ee3eaa6a764178fb1ec7e9b3fe3d01fc8 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.20 (GNU/Linux) -iQIcBAEBCgAGBQJSKh8jAAoJELp701BxlEWfmNUP+waGo3oQEPl/JTczNZ421rMP -xMpzxoOMJvu4vK6UloBDxKg4ft/j4CMGjc7mUwmJpdE7VGS5Nn8UuSO++h2I+bGj -UgU+Eopu/8VOQdOJMEz0cg9DxMKs5SI+vEQojWJf+4xrrPdNyNWy4TwyH69p99xG -aaWKPm9T6M3ZMs5FAW/vETz1f2kyQ6HW76oc84n5msfb3ohtSYHrT4I+eU1j+OJB -B25DeisRfmCjwLi8F7hmdI9vAdJTs+rsjl/n7aNf3535uGnSnkRDq7Kas7VAUKdm -ss2VVfjlCCT6DIpijzONyRJE7RsYYc6tgkOcyf6LMS4jXRbroOSu+o1O6xU46Ad2 -sMDozE/G8RQ2iYyTFrqRnobcgw3XtXqYKm5SV9hzFhGdMrtyVFIZPJcH2IgMjFtz -v/Td9DB/UbZFAx97K8oIWIztP0HGTUQJfk3OykVklUZy9OlWTqAshsjCrE4ANlvV -VnF3iCZrIE6wnRfoWE4cZglnGzMHbWpKWcWWUd1Cgdyksuvbmucz0PAEXgk0kY+u -UflCGfdMyN8Jenw61qQ4PG4fFMpKX0cA9tsRwOPBWaYnkPzBOEmI7MiPo/Y002Qh -XNO3iYOGHpOW0TdATwtRHor96rvhztVXARYN3qz6tRE0LTQy+sQaduxUAni8fcSy -vzyCsVB338XI2eLQQ3cE -=9Pk8 +iEYEAREIAAYFAlJGjp8ACgkQCaWpQKGI+9TBIgCeJ+VhkzjNGHQYlchc6PhqitJ+ +33YAn2JMkxPmJTGSyQRx1Ac/0exn1EwS +=RxNz -----END PGP SIGNATURE----- diff --git a/app-admin/hddtemp/files/hddtemp.service-r1 b/app-admin/hddtemp/files/hddtemp.service-r1 new file mode 100644 index 000000000000..8105bfc50cce --- /dev/null +++ b/app-admin/hddtemp/files/hddtemp.service-r1 @@ -0,0 +1,10 @@ +[Unit] +Description=Hard drive temperature monitor daemon +Documentation=man:hddtemp(8) + +[Service] +Type=forking +ExecStart=/usr/sbin/hddtemp -d --listen=127.0.0.1 $HDDTEMP_DRIVES + +[Install] +WantedBy=multi-user.target diff --git a/app-admin/hddtemp/files/hddtemp.service.conf b/app-admin/hddtemp/files/hddtemp.service.conf new file mode 100644 index 000000000000..a2a6c7fbd7f4 --- /dev/null +++ b/app-admin/hddtemp/files/hddtemp.service.conf @@ -0,0 +1,3 @@ +# Set a list of drives to check +[Service] +Environment="HDDTEMP_DRIVES=/dev/sda /dev/sdb"
\ No newline at end of file diff --git a/app-admin/hddtemp/hddtemp-0.3_beta15-r24.ebuild b/app-admin/hddtemp/hddtemp-0.3_beta15-r24.ebuild new file mode 100644 index 000000000000..7446b37a3131 --- /dev/null +++ b/app-admin/hddtemp/hddtemp-0.3_beta15-r24.ebuild @@ -0,0 +1,94 @@ +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/app-admin/hddtemp/hddtemp-0.3_beta15-r24.ebuild,v 1.1 2013/09/28 08:09:02 pacho Exp $ + +EAPI=4 + +inherit eutils autotools systemd + +MY_P=${P/_beta/-beta} +DBV=20080531 + +DESCRIPTION="A simple utility to read the temperature of SMART capable hard drives" +HOMEPAGE="http://savannah.nongnu.org/projects/hddtemp/" +SRC_URI="http://download.savannah.gnu.org/releases/hddtemp/${MY_P}.tar.bz2 mirror://gentoo/hddtemp-${DBV}.db.bz2" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~sparc ~x86" +IUSE="network-cron nls" + +DEPEND="" +RDEPEND="${DEPEND}" + +S="${WORKDIR}/${MY_P}" + +DOCS=(README TODO ChangeLog) + +src_prepare() { + epatch "${FILESDIR}"/${P}-satacmds.patch + epatch "${FILESDIR}"/${P}-byteswap.patch + epatch "${FILESDIR}"/${P}-execinfo.patch + epatch "${FILESDIR}"/${P}-nls.patch + epatch "${FILESDIR}"/${P}-iconv.patch + epatch "${FILESDIR}"/${P}-dontwake.patch + AT_M4DIR="m4" eautoreconf +} + +src_configure() { + local myconf + + myconf="--with-db-path=/usr/share/hddtemp/hddtemp.db" + # disabling nls breaks compiling + use nls || myconf="--disable-nls ${myconf}" + econf ${myconf} +} + +src_install() { + default + + insinto /usr/share/hddtemp + newins "${WORKDIR}/hddtemp-${DBV}.db" hddtemp.db + doins "${FILESDIR}"/hddgentoo.db + + update_db "${D}/usr/share/hddtemp/hddgentoo.db" "${D}/usr/share/hddtemp/hddtemp.db" + newconfd "${FILESDIR}"/hddtemp-conf.d hddtemp + newinitd "${FILESDIR}"/hddtemp-init hddtemp + systemd_newunit "${FILESDIR}"/hddtemp.service-r1 "${PN}.service" + systemd_install_serviced "${FILESDIR}"/hddtemp.service.conf + + dosbin "${FILESDIR}"/update-hddtemp.db + + if use network-cron ; then + exeinto /etc/cron.monthly + echo -e "#!/bin/sh\n/usr/sbin/update-hddtemp.db" > "${T}"/hddtemp.cron + newexe "${T}"/hddtemp.cron update-hddtemp.db + fi +} + +pkg_postinst() { + elog "In order to update your hddtemp database, run:" + elog " update-hddtemp.db" + elog "" + elog "If your hard drive is not recognized by hddtemp, please consider" + elog "submitting your HDD info for inclusion into the Gentoo hddtemp" + elog "database by filing a bug at https://bugs.gentoo.org/" + echo + ewarn "If hddtemp complains but finds your HDD temperature sensor, use the" + ewarn "--quiet option to suppress the warning." +} + +update_db() { + local src=$1 + local dst=$2 + + while read line ; do + if [[ -z $(echo "${line}" | sed -re 's/(^#.*|^\w*$)//') ]]; then + echo "${line}" >> "${dst}" + fi + + id=$(echo "${line}" | grep -o '"[^"]*"') + + grep "${id}" "${dst}" 2>&1 >/dev/null || echo "${line}" >> "${dst}" + done < "${src}" +} diff --git a/app-admin/hddtemp/hddtemp-0.3_beta15-r7.ebuild b/app-admin/hddtemp/hddtemp-0.3_beta15-r7.ebuild new file mode 100644 index 000000000000..d6ca08733bb0 --- /dev/null +++ b/app-admin/hddtemp/hddtemp-0.3_beta15-r7.ebuild @@ -0,0 +1,96 @@ +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/app-admin/hddtemp/hddtemp-0.3_beta15-r7.ebuild,v 1.1 2013/09/28 08:09:02 pacho Exp $ + +inherit eutils autotools systemd + +MY_P=${P/_beta/-beta} +DBV=20080531 + +DESCRIPTION="A simple utility to read the temperature of SMART capable hard drives" +HOMEPAGE="http://savannah.nongnu.org/projects/hddtemp/" +SRC_URI="http://download.savannah.gnu.org/releases/hddtemp/${MY_P}.tar.bz2 mirror://gentoo/hddtemp-${DBV}.db.bz2" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~sparc ~x86" +IUSE="nls" + +DEPEND="" +RDEPEND="${DEPEND}" + +S="${WORKDIR}/${MY_P}" + +src_unpack() { + unpack ${A} + cd "${S}" + epatch "${FILESDIR}"/${P}-satacmds.patch + epatch "${FILESDIR}"/${P}-byteswap.patch + epatch "${FILESDIR}"/${P}-execinfo.patch + epatch "${FILESDIR}"/${P}-nls.patch + epatch "${FILESDIR}"/${P}-iconv.patch + epatch "${FILESDIR}"/${P}-dontwake.patch + AT_M4DIR="m4" eautoreconf +} + +src_compile() { + local myconf + + myconf="--with-db-path=/usr/share/hddtemp/hddtemp.db" + # disabling nls breaks compiling + use nls || myconf="--disable-nls ${myconf}" + econf ${myconf} || die + emake || die +} + +src_install() { + make DESTDIR="${D}" install || die + dodoc README TODO ChangeLog + + insinto /usr/share/hddtemp + newins "${WORKDIR}/hddtemp-${DBV}.db" hddtemp.db + doins "${FILESDIR}"/hddgentoo.db + + update_db "${D}/usr/share/hddtemp/hddgentoo.db" "${D}/usr/share/hddtemp/hddtemp.db" + newconfd "${FILESDIR}"/hddtemp-conf.d hddtemp + newinitd "${FILESDIR}"/hddtemp-init hddtemp + systemd_newunit "${FILESDIR}"/hddtemp.service-r1 "${PN}.service" + systemd_install_serviced "${FILESDIR}"/hddtemp.service.conf +} + +pkg_postinst() { + elog "In order to update your hddtemp database, run:" + elog " emerge --config =${CATEGORY}/${PF}" + elog "" + elog "If your hard drive is not recognized by hddtemp, please consider" + elog "submitting your HDD info for inclusion into the Gentoo hddtemp" + elog "database by filing a bug at https://bugs.gentoo.org/" + echo + ewarn "If hddtemp complains but finds your HDD temperature sensor, use the" + ewarn "--quiet option to suppress the warning." +} + +update_db() { + local src=$1 + local dst=$2 + + while read line ; do + if [[ -z $(echo "${line}" | sed -re 's/(^#.*|^\w*$)//') ]]; then + echo "${line}" >> "${dst}" + fi + + id=$(echo "${line}" | grep -o '"[^"]*"') + + grep "${id}" "${dst}" 2>&1 >/dev/null || echo "${line}" >> "${dst}" + done < "${src}" +} + +pkg_config() { + cd "${ROOT}"/usr/share/hddtemp + + einfo "Trying to download the latest hddtemp.db file" + wget http://www.guzu.net/linux/hddtemp.db -O hddtemp.db \ + || die "failed to download hddtemp.db" + + update_db "hddgentoo.db" "hddtemp.db" +} |