Gentoo Archives: gentoo-commits

From: Lars Wendler <polynomial-c@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-apps/smartmontools/, sys-apps/smartmontools/files/
Date: Fri, 03 May 2019 16:12:27
Message-Id: 1556899939.287b41990dfc178eea5b5ba31227a08073941e9e.polynomial-c@gentoo
1 commit: 287b41990dfc178eea5b5ba31227a08073941e9e
2 Author: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
3 AuthorDate: Fri May 3 16:12:04 2019 +0000
4 Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
5 CommitDate: Fri May 3 16:12:19 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=287b4199
7
8 sys-apps/smartmontools: Removed old.
9
10 Package-Manager: Portage-2.3.66, Repoman-2.3.12
11 Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>
12
13 sys-apps/smartmontools/Manifest | 1 -
14 .../smartmontools-6.6-fix-build-on-musl.patch | 13 --
15 .../smartmontools-6.6-set-broadcast-nsid.patch | 104 --------------
16 sys-apps/smartmontools/smartmontools-6.6-r1.ebuild | 155 ---------------------
17 sys-apps/smartmontools/smartmontools-6.6.ebuild | 152 --------------------
18 sys-apps/smartmontools/smartmontools-7.0.ebuild | 151 --------------------
19 6 files changed, 576 deletions(-)
20
21 diff --git a/sys-apps/smartmontools/Manifest b/sys-apps/smartmontools/Manifest
22 index a076447dcc8..2d1eba91aa0 100644
23 --- a/sys-apps/smartmontools/Manifest
24 +++ b/sys-apps/smartmontools/Manifest
25 @@ -1,2 +1 @@
26 -DIST smartmontools-6.6.tar.gz 903847 BLAKE2B 6c18884cf763c146abceed47587de0e77cd434673df6a17e4527d160f06a5a8762e6ae490fc5ed13a33f819ba23c1924b49dd13620f4a51e6a40dac20a217523 SHA512 64bb533dac29f62ddd662a16a12c97df1af9cbac9ac526ce7af0b3bff9da49cf265a2030d91a7160452b56a67e80d7f34c9b4e45bbb320114f55695e2cb5cfaf
27 DIST smartmontools-7.0.tar.gz 944925 BLAKE2B 41b3894efa05471bf358fca4ba87a765e3a54df68c9a617804a9e0853752c57b68fdbaa9d55fa1462a8fa7de1d6cb5630c66929dfe521be38b180944cb80acc9 SHA512 96e18a201182579f699d541539ce393e7bc2191e027cfdf7f87455a63da3a14451574f8fe391232047ac941ace453a017193d0a4987a4edb8f7ed9d5007f0512
28
29 diff --git a/sys-apps/smartmontools/files/smartmontools-6.6-fix-build-on-musl.patch b/sys-apps/smartmontools/files/smartmontools-6.6-fix-build-on-musl.patch
30 deleted file mode 100644
31 index 2cd36e0dce5..00000000000
32 --- a/sys-apps/smartmontools/files/smartmontools-6.6-fix-build-on-musl.patch
33 +++ /dev/null
34 @@ -1,13 +0,0 @@
35 -Bug: https://bugs.gentoo.org/644586
36 -
37 -Upstream fix: https://www.smartmontools.org/changeset/4603
38 -
39 ---- smartmontools-6.6/os_linux.cpp
40 -+++ smartmontools-6.6/os_linux.cpp
41 -@@ -3177,5 +3177,5 @@
42 - char path[128];
43 - snprintf(path, sizeof(path), "/sys/block/%s/device", name);
44 -- char * syshostpath = canonicalize_file_name(path);
45 -+ char * syshostpath = realpath(name, (char *)0);
46 - if (!syshostpath)
47 - return false;
48
49 diff --git a/sys-apps/smartmontools/files/smartmontools-6.6-set-broadcast-nsid.patch b/sys-apps/smartmontools/files/smartmontools-6.6-set-broadcast-nsid.patch
50 deleted file mode 100644
51 index e65504d43c6..00000000000
52 --- a/sys-apps/smartmontools/files/smartmontools-6.6-set-broadcast-nsid.patch
53 +++ /dev/null
54 @@ -1,104 +0,0 @@
55 -fix from upstream
56 -
57 -https://www.smartmontools.org/changeset?new=4671@/&old=4670@/
58 -
59 -Index: trunk/smartmontools-6.6/ChangeLog
60 -===================================================================
61 - 2017-12-27 Douglas Gilbert <dgilbert@××××××××.com>
62 -
63 -+ nvmecmds.cpp: according to NVMe 1.3a spec, the SMART/
64 -+ health information log page is global and should take
65 -+ the global nsid (all ff_s). It also says the Error
66 -+ info lpage is "global. Broke WD Black PCIe (NVMe)
67 -+ SSD but worked on Intel SSDs. Fix; could break others.
68 -+
69 -+2017-12-27 Douglas Gilbert <dgilbert@××××××××.com>
70 -+
71 - os_freebsd.cpp: on error was setting set_nvme_err() to 1,
72 - not the actual NVMe status value; fix.
73 -
74 -Index: trunk/smartmontools-6.6/nvmecmds.cpp
75 -===================================================================
76 -diff --git smartmontools-6.6/nvmecmds.cpp smartmontools-6.6/nvmecmds.cpp
77 ---- smartmontools-6.6/nvmecmds.cpp (revision 4670)
78 -+++ smartmontools-6.6/nvmecmds.cpp (revision 4671)
79 -@@ -196,7 +196,8 @@
80 - }
81 -
82 - // Read NVMe log page with identifier LID.
83 --bool nvme_read_log_page(nvme_device * device, unsigned char lid, void * data, unsigned size)
84 -+bool nvme_read_log_page(nvme_device * device, unsigned char lid, void * data,
85 -+ unsigned size, bool broadcast_nsid)
86 - {
87 - if (!(4 <= size && size <= 0x4000 && (size % 4) == 0))
88 - throw std::logic_error("nvme_read_log_page(): invalid size");
89 -@@ -204,7 +205,7 @@
90 - memset(data, 0, size);
91 - nvme_cmd_in in;
92 - in.set_data_in(nvme_admin_get_log_page, data, size);
93 -- in.nsid = device->get_nsid();
94 -+ in.nsid = broadcast_nsid ? 0xffffffff : device->get_nsid();
95 - in.cdw10 = lid | (((size / 4) - 1) << 16);
96 -
97 - return nvme_pass_through(device, in);
98 -@@ -213,7 +214,7 @@
99 - // Read NVMe Error Information Log.
100 - bool nvme_read_error_log(nvme_device * device, nvme_error_log_page * error_log, unsigned num_entries)
101 - {
102 -- if (!nvme_read_log_page(device, 0x01, error_log, num_entries * sizeof(*error_log)))
103 -+ if (!nvme_read_log_page(device, 0x01, error_log, num_entries * sizeof(*error_log), true))
104 - return false;
105 -
106 - if (isbigendian()) {
107 -@@ -234,7 +235,7 @@
108 - // Read NVMe SMART/Health Information log.
109 - bool nvme_read_smart_log(nvme_device * device, nvme_smart_log & smart_log)
110 - {
111 -- if (!nvme_read_log_page(device, 0x02, &smart_log, sizeof(smart_log)))
112 -+ if (!nvme_read_log_page(device, 0x02, &smart_log, sizeof(smart_log), true))
113 - return false;
114 -
115 - if (isbigendian()) {
116 -Index: trunk/smartmontools-6.6/nvmecmds.h
117 -===================================================================
118 -diff --git smartmontools-6.6/nvmecmds.h smartmontools-6.6/nvmecmds.h
119 ---- smartmontools-6.6/nvmecmds.h (revision 4670)
120 -+++ smartmontools-6.6/nvmecmds.h (revision 4671)
121 -@@ -248,7 +248,8 @@
122 - bool nvme_read_id_ns(nvme_device * device, unsigned nsid, smartmontools::nvme_id_ns & id_ns);
123 -
124 - // Read NVMe log page with identifier LID.
125 --bool nvme_read_log_page(nvme_device * device, unsigned char lid, void * data, unsigned size);
126 -+bool nvme_read_log_page(nvme_device * device, unsigned char lid, void * data,
127 -+ unsigned size, bool broadcast_nsid);
128 -
129 - // Read NVMe Error Information Log.
130 - bool nvme_read_error_log(nvme_device * device, smartmontools::nvme_error_log_page * error_log,
131 -Index: trunk/smartmontools-6.6/nvmeprint.cpp
132 -===================================================================
133 -diff --git smartmontools-6.6/nvmeprint.cpp smartmontools-6.6/nvmeprint.cpp
134 ---- smartmontools-6.6/nvmeprint.cpp (revision 4670)
135 -+++ smartmontools-6.6/nvmeprint.cpp (revision 4671)
136 -@@ -473,9 +473,21 @@
137 - if (options.log_page_size) {
138 - // Align size to dword boundary
139 - unsigned size = ((options.log_page_size + 4-1) / 4) * 4;
140 -+ bool broadcast_nsid;
141 - raw_buffer log_buf(size);
142 -
143 -- if (!nvme_read_log_page(device, options.log_page, log_buf.data(), size)) {
144 -+ switch (options.log_page) {
145 -+ case 1:
146 -+ case 2:
147 -+ case 3:
148 -+ broadcast_nsid = true;
149 -+ break;
150 -+ default:
151 -+ broadcast_nsid = false;
152 -+ break;
153 -+ }
154 -+ if (!nvme_read_log_page(device, options.log_page, log_buf.data(),
155 -+ size, broadcast_nsid)) {
156 - pout("Read NVMe Log 0x%02x failed: %s\n\n", options.log_page, device->get_errmsg());
157 - return retval | FAILSMART;
158 - }
159
160 diff --git a/sys-apps/smartmontools/smartmontools-6.6-r1.ebuild b/sys-apps/smartmontools/smartmontools-6.6-r1.ebuild
161 deleted file mode 100644
162 index f0c381ba6cb..00000000000
163 --- a/sys-apps/smartmontools/smartmontools-6.6-r1.ebuild
164 +++ /dev/null
165 @@ -1,155 +0,0 @@
166 -# Copyright 1999-2018 Gentoo Foundation
167 -# Distributed under the terms of the GNU General Public License v2
168 -
169 -EAPI="6"
170 -
171 -inherit autotools flag-o-matic systemd
172 -if [[ ${PV} == "9999" ]] ; then
173 - ESVN_REPO_URI="https://svn.code.sf.net/p/smartmontools/code/trunk/smartmontools"
174 - ESVN_PROJECT="smartmontools"
175 - inherit subversion
176 -else
177 - SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
178 - KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux ~x64-macos"
179 -fi
180 -
181 -DESCRIPTION="Tools to monitor storage systems to provide advanced warning of disk degradation"
182 -HOMEPAGE="https://www.smartmontools.org"
183 -
184 -LICENSE="GPL-2"
185 -SLOT="0"
186 -IUSE="caps +daemon selinux static update_drivedb"
187 -
188 -DEPEND="
189 - caps? (
190 - static? ( sys-libs/libcap-ng[static-libs] )
191 - !static? ( sys-libs/libcap-ng )
192 - )
193 - kernel_FreeBSD? (
194 - sys-freebsd/freebsd-lib[usb]
195 - )
196 - selinux? (
197 - sys-libs/libselinux
198 - )"
199 -RDEPEND="${DEPEND}
200 - daemon? ( virtual/mailx )
201 - selinux? ( sec-policy/selinux-smartmon )
202 - update_drivedb? (
203 - app-crypt/gnupg
204 - || (
205 - net-misc/curl
206 - net-misc/wget
207 - www-client/lynx
208 - dev-vcs/subversion
209 - )
210 - )
211 -"
212 -
213 -REQUIRED_USE="( caps? ( daemon ) )"
214 -
215 -PATCHES=(
216 - "${FILESDIR}"/${P}-fix-build-on-musl.patch
217 - "${FILESDIR}"/${P}-set-broadcast-nsid.patch
218 -)
219 -
220 -src_prepare() {
221 - default
222 -
223 - eautoreconf
224 -}
225 -
226 -src_configure() {
227 - use static && append-ldflags -static
228 - # The build installs /etc/init.d/smartd, but we clobber it
229 - # in our src_install, so no need to manually delete it.
230 - myeconfargs=(
231 - --docdir="${EPREFIX}/usr/share/doc/${PF}"
232 - --with-drivedbdir="${EPREFIX}/var/db/${PN}" #575292
233 - --with-initscriptdir="${EPREFIX}/etc/init.d"
234 - $(use_with caps libcap-ng)
235 - $(use_with selinux)
236 - --with-systemdsystemunitdir="$(systemd_get_systemunitdir)"
237 - $(use_with update_drivedb gnupg)
238 - $(use_with update_drivedb update-smart-drivedb)
239 - )
240 - econf "${myeconfargs[@]}"
241 -}
242 -
243 -src_install() {
244 - local db_path="/var/db/${PN}"
245 -
246 - if use daemon; then
247 - default
248 -
249 - newinitd "${FILESDIR}"/smartd-r1.rc smartd
250 - newconfd "${FILESDIR}"/smartd.confd smartd
251 - systemd_newunit "${FILESDIR}"/smartd.systemd smartd.service
252 - else
253 - dosbin smartctl
254 - doman smartctl.8
255 -
256 - local DOCS=( AUTHORS ChangeL* COPYING INSTALL NEWS README TODO )
257 - einstalldocs
258 - fi
259 -
260 - if use update_drivedb ; then
261 - if ! use daemon; then
262 - dosbin "${S}"/update-smart-drivedb
263 - fi
264 -
265 - exeinto /etc/cron.monthly
266 - doexe "${FILESDIR}/${PN}-update-drivedb"
267 - fi
268 -
269 - if use daemon || use update_drivedb; then
270 - keepdir "${db_path}"
271 -
272 - # Install a copy of the initial drivedb.h to /usr/share/${PN}
273 - # so that we can access that file later in pkg_postinst
274 - # even when dealing with binary packages (bug #575292)
275 - insinto /usr/share/${PN}
276 - doins "${S}"/drivedb.h
277 - fi
278 -
279 - # Make sure we never install drivedb.h into the db location
280 - # of the acutal image so we don't record hashes because user
281 - # can modify that file
282 - rm -f "${ED%/}${db_path}/drivedb.h" || die
283 -
284 - # Bug #622072
285 - find "${ED%/}"/usr/share/doc -type f -exec chmod a-x '{}' \; || die
286 -}
287 -
288 -pkg_postinst() {
289 - if use daemon || use update_drivedb; then
290 - local initial_db_file="${EPREFIX%/}/usr/share/${PN}/drivedb.h"
291 - local db_path="${EPREFIX%/}/var/db/${PN}"
292 -
293 - if [[ ! -f "${db_path}/drivedb.h" ]] ; then
294 - # No initial database found
295 - cp "${initial_db_file}" "${db_path}" || die
296 - einfo "Default drive database which was shipped with this release of ${PN}"
297 - einfo "has been installed to '${db_path}'."
298 - else
299 - ewarn "WARNING: There's already a drive database in '${db_path}'!"
300 - ewarn "Because we cannot determine if this database is untouched"
301 - ewarn "or was modified by the user you have to manually update the"
302 - ewarn "drive database:"
303 - ewarn ""
304 - ewarn "a) Replace '${db_path}/drivedb.h' by the database shipped with this"
305 - ewarn " release which can be found in '${initial_db_file}', i.e."
306 - ewarn ""
307 - ewarn " cp \"${initial_db_file}\" \"${db_path}\""
308 - ewarn ""
309 - ewarn "b) Run the following command as root:"
310 - ewarn ""
311 - ewarn " /usr/sbin/update-smart-drivedb"
312 -
313 - if ! use update_drivedb ; then
314 - ewarn ""
315 - ewarn "However, 'update-smart-drivedb' requires that you re-emerge ${PN}"
316 - ewarn "with USE='update_drivedb'."
317 - fi
318 - fi
319 - fi
320 -}
321
322 diff --git a/sys-apps/smartmontools/smartmontools-6.6.ebuild b/sys-apps/smartmontools/smartmontools-6.6.ebuild
323 deleted file mode 100644
324 index 1661efefba1..00000000000
325 --- a/sys-apps/smartmontools/smartmontools-6.6.ebuild
326 +++ /dev/null
327 @@ -1,152 +0,0 @@
328 -# Copyright 1999-2018 Gentoo Foundation
329 -# Distributed under the terms of the GNU General Public License v2
330 -
331 -EAPI=6
332 -
333 -inherit autotools flag-o-matic systemd
334 -if [[ ${PV} == "9999" ]] ; then
335 - ESVN_REPO_URI="https://svn.code.sf.net/p/smartmontools/code/trunk/smartmontools"
336 - ESVN_PROJECT="smartmontools"
337 - inherit subversion
338 -else
339 - SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
340 - KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~mips ppc ppc64 sparc x86 ~x86-fbsd ~amd64-linux ~x86-linux ~x64-macos"
341 -fi
342 -
343 -DESCRIPTION="Tools to monitor storage systems to provide advanced warning of disk degradation"
344 -HOMEPAGE="https://www.smartmontools.org"
345 -
346 -LICENSE="GPL-2"
347 -SLOT="0"
348 -IUSE="caps +daemon selinux static update_drivedb"
349 -
350 -DEPEND="
351 - caps? (
352 - static? ( sys-libs/libcap-ng[static-libs] )
353 - !static? ( sys-libs/libcap-ng )
354 - )
355 - kernel_FreeBSD? (
356 - sys-freebsd/freebsd-lib[usb]
357 - )
358 - selinux? (
359 - sys-libs/libselinux
360 - )"
361 -RDEPEND="${DEPEND}
362 - daemon? ( virtual/mailx )
363 - selinux? ( sec-policy/selinux-smartmon )
364 - update_drivedb? (
365 - app-crypt/gnupg
366 - || (
367 - net-misc/curl
368 - net-misc/wget
369 - www-client/lynx
370 - dev-vcs/subversion
371 - )
372 - )
373 -"
374 -
375 -REQUIRED_USE="( caps? ( daemon ) )"
376 -
377 -PATCHES=( "${FILESDIR}"/${P}-fix-build-on-musl.patch )
378 -
379 -src_prepare() {
380 - default
381 -
382 - eautoreconf
383 -}
384 -
385 -src_configure() {
386 - use static && append-ldflags -static
387 - # The build installs /etc/init.d/smartd, but we clobber it
388 - # in our src_install, so no need to manually delete it.
389 - myeconfargs=(
390 - --docdir="${EPREFIX}/usr/share/doc/${PF}"
391 - --with-drivedbdir="${EPREFIX}/var/db/${PN}" #575292
392 - --with-initscriptdir="${EPREFIX}/etc/init.d"
393 - $(use_with caps libcap-ng)
394 - $(use_with selinux)
395 - --with-systemdsystemunitdir="$(systemd_get_systemunitdir)"
396 - $(use_with update_drivedb gnupg)
397 - $(use_with update_drivedb update-smart-drivedb)
398 - )
399 - econf "${myeconfargs[@]}"
400 -}
401 -
402 -src_install() {
403 - local db_path="/var/db/${PN}"
404 -
405 - if use daemon; then
406 - default
407 -
408 - newinitd "${FILESDIR}"/smartd-r1.rc smartd
409 - newconfd "${FILESDIR}"/smartd.confd smartd
410 - systemd_newunit "${FILESDIR}"/smartd.systemd smartd.service
411 - else
412 - dosbin smartctl
413 - doman smartctl.8
414 -
415 - local DOCS=( AUTHORS ChangeL* COPYING INSTALL NEWS README TODO )
416 - einstalldocs
417 - fi
418 -
419 - if use update_drivedb ; then
420 - if ! use daemon; then
421 - dosbin "${S}"/update-smart-drivedb
422 - fi
423 -
424 - exeinto /etc/cron.monthly
425 - doexe "${FILESDIR}/${PN}-update-drivedb"
426 - fi
427 -
428 - if use daemon || use update_drivedb; then
429 - keepdir "${db_path}"
430 -
431 - # Install a copy of the initial drivedb.h to /usr/share/${PN}
432 - # so that we can access that file later in pkg_postinst
433 - # even when dealing with binary packages (bug #575292)
434 - insinto /usr/share/${PN}
435 - doins "${S}"/drivedb.h
436 - fi
437 -
438 - # Make sure we never install drivedb.h into the db location
439 - # of the acutal image so we don't record hashes because user
440 - # can modify that file
441 - rm -f "${ED%/}${db_path}/drivedb.h" || die
442 -
443 - # Bug #622072
444 - find "${ED%/}"/usr/share/doc -type f -exec chmod a-x '{}' \; || die
445 -}
446 -
447 -pkg_postinst() {
448 - if use daemon || use update_drivedb; then
449 - local initial_db_file="${EPREFIX%/}/usr/share/${PN}/drivedb.h"
450 - local db_path="${EPREFIX%/}/var/db/${PN}"
451 -
452 - if [[ ! -f "${db_path}/drivedb.h" ]] ; then
453 - # No initial database found
454 - cp "${initial_db_file}" "${db_path}" || die
455 - einfo "Default drive database which was shipped with this release of ${PN}"
456 - einfo "has been installed to '${db_path}'."
457 - else
458 - ewarn "WARNING: There's already a drive database in '${db_path}'!"
459 - ewarn "Because we cannot determine if this database is untouched"
460 - ewarn "or was modified by the user you have to manually update the"
461 - ewarn "drive database:"
462 - ewarn ""
463 - ewarn "a) Replace '${db_path}/drivedb.h' by the database shipped with this"
464 - ewarn " release which can be found in '${initial_db_file}', i.e."
465 - ewarn ""
466 - ewarn " cp \"${initial_db_file}\" \"${db_path}\""
467 - ewarn ""
468 - ewarn "b) Run the following command as root:"
469 - ewarn ""
470 - ewarn " /usr/sbin/update-smart-drivedb"
471 -
472 - if ! use update_drivedb ; then
473 - ewarn ""
474 - ewarn "However, 'update-smart-drivedb' requires that you re-emerge ${PN}"
475 - ewarn "with USE='update_drivedb'."
476 - fi
477 - fi
478 - fi
479 -}
480
481 diff --git a/sys-apps/smartmontools/smartmontools-7.0.ebuild b/sys-apps/smartmontools/smartmontools-7.0.ebuild
482 deleted file mode 100644
483 index 46b1cf2cff3..00000000000
484 --- a/sys-apps/smartmontools/smartmontools-7.0.ebuild
485 +++ /dev/null
486 @@ -1,151 +0,0 @@
487 -# Copyright 1999-2018 Gentoo Authors
488 -# Distributed under the terms of the GNU General Public License v2
489 -
490 -EAPI="6"
491 -
492 -inherit autotools flag-o-matic systemd
493 -if [[ ${PV} == "9999" ]] ; then
494 - ESVN_REPO_URI="https://svn.code.sf.net/p/smartmontools/code/trunk/smartmontools"
495 - ESVN_PROJECT="smartmontools"
496 - inherit subversion
497 -else
498 - SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
499 - KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux ~x64-macos"
500 -fi
501 -
502 -DESCRIPTION="Tools to monitor storage systems to provide advanced warning of disk degradation"
503 -HOMEPAGE="https://www.smartmontools.org"
504 -
505 -LICENSE="GPL-2"
506 -SLOT="0"
507 -IUSE="caps +daemon selinux static systemd update_drivedb"
508 -
509 -DEPEND="
510 - caps? (
511 - static? ( sys-libs/libcap-ng[static-libs] )
512 - !static? ( sys-libs/libcap-ng )
513 - )
514 - kernel_FreeBSD? (
515 - sys-freebsd/freebsd-lib[usb]
516 - )
517 - selinux? (
518 - sys-libs/libselinux
519 - )"
520 -RDEPEND="${DEPEND}
521 - daemon? ( virtual/mailx )
522 - selinux? ( sec-policy/selinux-smartmon )
523 - systemd? ( sys-apps/systemd )
524 - update_drivedb? (
525 - app-crypt/gnupg
526 - || (
527 - net-misc/curl
528 - net-misc/wget
529 - www-client/lynx
530 - dev-vcs/subversion
531 - )
532 - )
533 -"
534 -
535 -REQUIRED_USE="( caps? ( daemon ) )"
536 -
537 -src_prepare() {
538 - default
539 - eautoreconf
540 -}
541 -
542 -src_configure() {
543 - use static && append-ldflags -static
544 - # The build installs /etc/init.d/smartd, but we clobber it
545 - # in our src_install, so no need to manually delete it.
546 - myeconfargs=(
547 - --with-drivedbdir="${EPREFIX}/var/db/${PN}" #575292
548 - --with-initscriptdir="${EPREFIX}/etc/init.d"
549 - #--with-smartdscriptdir="${EPREFIX}/usr/share/${PN}"
550 - $(use_with caps libcap-ng)
551 - $(use_with selinux)
552 - $(use_with systemd libsystemd)
553 - $(use_with update_drivedb gnupg)
554 - $(use_with update_drivedb update-smart-drivedb)
555 - $(usex systemd "--with-systemdsystemunitdir=$(systemd_get_systemunitdir)" '')
556 - )
557 - econf "${myeconfargs[@]}"
558 -}
559 -
560 -src_install() {
561 - local db_path="/var/db/${PN}"
562 -
563 - if use daemon; then
564 - default
565 -
566 - newinitd "${FILESDIR}"/smartd-r1.rc smartd
567 - newconfd "${FILESDIR}"/smartd.confd smartd
568 - systemd_newunit "${FILESDIR}"/smartd.systemd smartd.service
569 - else
570 - dosbin smartctl
571 - doman smartctl.8
572 -
573 - local DOCS=( AUTHORS ChangeL* COPYING INSTALL NEWS README TODO )
574 - einstalldocs
575 - fi
576 -
577 - if use update_drivedb ; then
578 - if ! use daemon; then
579 - dosbin "${S}"/update-smart-drivedb
580 - fi
581 -
582 - exeinto /etc/cron.monthly
583 - doexe "${FILESDIR}/${PN}-update-drivedb"
584 - fi
585 -
586 - if use daemon || use update_drivedb; then
587 - keepdir "${db_path}"
588 -
589 - # Install a copy of the initial drivedb.h to /usr/share/${PN}
590 - # so that we can access that file later in pkg_postinst
591 - # even when dealing with binary packages (bug #575292)
592 - insinto /usr/share/${PN}
593 - doins "${S}"/drivedb.h
594 - fi
595 -
596 - # Make sure we never install drivedb.h into the db location
597 - # of the acutal image so we don't record hashes because user
598 - # can modify that file
599 - rm -f "${ED%/}${db_path}/drivedb.h" || die
600 -
601 - # Bug #622072
602 - find "${ED%/}"/usr/share/doc -type f -exec chmod a-x '{}' \; || die
603 -}
604 -
605 -pkg_postinst() {
606 - if use daemon || use update_drivedb; then
607 - local initial_db_file="${EPREFIX%/}/usr/share/${PN}/drivedb.h"
608 - local db_path="${EPREFIX%/}/var/db/${PN}"
609 -
610 - if [[ ! -f "${db_path}/drivedb.h" ]] ; then
611 - # No initial database found
612 - cp "${initial_db_file}" "${db_path}" || die
613 - einfo "Default drive database which was shipped with this release of ${PN}"
614 - einfo "has been installed to '${db_path}'."
615 - else
616 - ewarn "WARNING: There's already a drive database in '${db_path}'!"
617 - ewarn "Because we cannot determine if this database is untouched"
618 - ewarn "or was modified by the user you have to manually update the"
619 - ewarn "drive database:"
620 - ewarn ""
621 - ewarn "a) Replace '${db_path}/drivedb.h' by the database shipped with this"
622 - ewarn " release which can be found in '${initial_db_file}', i.e."
623 - ewarn ""
624 - ewarn " cp \"${initial_db_file}\" \"${db_path}\""
625 - ewarn ""
626 - ewarn "b) Run the following command as root:"
627 - ewarn ""
628 - ewarn " /usr/sbin/update-smart-drivedb"
629 -
630 - if ! use update_drivedb ; then
631 - ewarn ""
632 - ewarn "However, 'update-smart-drivedb' requires that you re-emerge ${PN}"
633 - ewarn "with USE='update_drivedb'."
634 - fi
635 - fi
636 - fi
637 -}