Gentoo Archives: gentoo-commits

From: Patrick McLean <chutzpah@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-apps/smartmontools/
Date: Wed, 02 Mar 2022 01:28:03
Message-Id: 1646184415.40760573687c42d25397d69cd374cd10ebffa821.chutzpah@gentoo
1 commit: 40760573687c42d25397d69cd374cd10ebffa821
2 Author: Patrick McLean <chutzpah <AT> gentoo <DOT> org>
3 AuthorDate: Wed Mar 2 01:26:55 2022 +0000
4 Commit: Patrick McLean <chutzpah <AT> gentoo <DOT> org>
5 CommitDate: Wed Mar 2 01:26:55 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=40760573
7
8 sys-apps/smartmontools: Version bump
9
10 Package-Manager: Portage-3.0.30, Repoman-3.0.3
11 Signed-off-by: Patrick McLean <chutzpah <AT> gentoo.org>
12
13 sys-apps/smartmontools/Manifest | 1 +
14 sys-apps/smartmontools/smartmontools-7.3.ebuild | 153 ++++++++++++++++++++++++
15 2 files changed, 154 insertions(+)
16
17 diff --git a/sys-apps/smartmontools/Manifest b/sys-apps/smartmontools/Manifest
18 index 36fbc466a279..90efc5ddec43 100644
19 --- a/sys-apps/smartmontools/Manifest
20 +++ b/sys-apps/smartmontools/Manifest
21 @@ -1 +1,2 @@
22 DIST smartmontools-7.2.tar.gz 992256 BLAKE2B 9f671656e610404b0ab8b6ec51421b4046c64d16331cff821a8d9dbf34dd6c4be4fa63d3a2eaffe2aa869b09acf5f18b9c9750f76e33423710ef9166212e3a92 SHA512 d7e724295b5d53797b5e4136eea5f5cc278db81e4016ba65142438b8c68c54f85a32c582c147a1590b9bc8f74a58952bcb57b9923dd69d34582530a0985799ea
23 +DIST smartmontools-7.3.tar.gz 1043932 BLAKE2B 119fd4aded487796ffd38050ddf8c7dd69cc6f3950650cb0315846292fd4a6594d949d87c51ed46717d6aaadb332c68f655514d1fde89600d51f3fe36f8df1ca SHA512 08afe8b0a6a39e742160cd4e4c03fc7aff7b1ae8681b906360f0932277dc99e361b7606b2373bdf42425cf9453480a5f4344bc040ebc2fa26a03bd52f02a6ac0
24
25 diff --git a/sys-apps/smartmontools/smartmontools-7.3.ebuild b/sys-apps/smartmontools/smartmontools-7.3.ebuild
26 new file mode 100644
27 index 000000000000..1c0502087af3
28 --- /dev/null
29 +++ b/sys-apps/smartmontools/smartmontools-7.3.ebuild
30 @@ -0,0 +1,153 @@
31 +# Copyright 1999-2022 Gentoo Authors
32 +# Distributed under the terms of the GNU General Public License v2
33 +
34 +EAPI=7
35 +
36 +inherit autotools flag-o-matic systemd
37 +if [[ ${PV} == "9999" ]] ; then
38 + ESVN_REPO_URI="https://svn.code.sf.net/p/smartmontools/code/trunk/smartmontools"
39 + ESVN_PROJECT="smartmontools"
40 + inherit subversion
41 +else
42 + SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
43 + KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~x86-linux ~x64-macos"
44 +fi
45 +
46 +DESCRIPTION="Tools to monitor storage systems to provide advanced warning of disk degradation"
47 +HOMEPAGE="https://www.smartmontools.org"
48 +
49 +LICENSE="GPL-2"
50 +SLOT="0"
51 +IUSE="caps +daemon selinux static systemd +update-drivedb"
52 +
53 +DEPEND="
54 + caps? (
55 + static? ( sys-libs/libcap-ng:=[static-libs] )
56 + !static? ( sys-libs/libcap-ng:= )
57 + )
58 + selinux? (
59 + sys-libs/libselinux:=
60 + )
61 +"
62 +RDEPEND="
63 + ${DEPEND}
64 + daemon? ( virtual/mailx )
65 + selinux? ( sec-policy/selinux-smartmon )
66 + systemd? ( sys-apps/systemd )
67 + update-drivedb? (
68 + app-crypt/gnupg
69 + || (
70 + net-misc/curl
71 + net-misc/wget
72 + www-client/lynx
73 + dev-vcs/subversion
74 + )
75 + )
76 +"
77 +
78 +REQUIRED_USE="(
79 + caps? ( daemon )
80 + static? ( !systemd )
81 +)"
82 +
83 +src_prepare() {
84 + default
85 + eautoreconf
86 +}
87 +
88 +src_configure() {
89 + use static && append-ldflags -static
90 + # The build installs /etc/init.d/smartd, but we clobber it
91 + # in our src_install, so no need to manually delete it.
92 + myeconfargs=(
93 + --with-drivedbdir="${EPREFIX}/var/db/${PN}" #575292
94 + --with-initscriptdir="${EPREFIX}/etc/init.d"
95 + #--with-smartdscriptdir="${EPREFIX}/usr/share/${PN}"
96 + $(use_with caps libcap-ng)
97 + $(use_with selinux)
98 + $(use_with systemd libsystemd)
99 + $(use_with update-drivedb gnupg)
100 + $(use_with update-drivedb update-smart-drivedb)
101 + $(usex systemd "--with-systemdsystemunitdir=$(systemd_get_systemunitdir)" '')
102 + )
103 + econf "${myeconfargs[@]}"
104 +}
105 +
106 +src_install() {
107 + local db_path="/var/db/${PN}"
108 + insopts -m0644 -p # preserve timestamps
109 +
110 + if use daemon; then
111 + default
112 +
113 + newinitd "${FILESDIR}"/smartd-r1.rc smartd
114 + newconfd "${FILESDIR}"/smartd.confd smartd
115 + else
116 + dosbin smartctl
117 + doman smartctl.8
118 +
119 + local DOCS=( AUTHORS ChangeL* COPYING INSTALL NEWS README TODO )
120 + einstalldocs
121 + fi
122 +
123 + if use update-drivedb ; then
124 + if ! use daemon; then
125 + dosbin "${S}"/update-smart-drivedb
126 + fi
127 +
128 + exeinto /etc/cron.monthly
129 + doexe "${FILESDIR}/${PN}-update-drivedb"
130 + fi
131 +
132 + if use daemon || use update-drivedb; then
133 + keepdir "${db_path}"
134 +
135 + # Install a copy of the initial drivedb.h to /usr/share/${PN}
136 + # so that we can access that file later in pkg_postinst
137 + # even when dealing with binary packages (bug #575292)
138 + insinto /usr/share/${PN}
139 + doins "${S}"/drivedb.h
140 + fi
141 +
142 + # Make sure we never install drivedb.h into the db location
143 + # of the acutal image so we don't record hashes because user
144 + # can modify that file
145 + rm -f "${ED}${db_path}/drivedb.h" || die
146 +
147 + # Bug #622072
148 + find "${ED}"/usr/share/doc -type f -exec chmod a-x '{}' \; || die
149 +}
150 +
151 +pkg_postinst() {
152 + if use daemon || use update-drivedb; then
153 + local initial_db_file="${EROOT}/usr/share/${PN}/drivedb.h"
154 + local db_path="${EROOT}/var/db/${PN}"
155 +
156 + if [[ ! -f "${db_path}/drivedb.h" ]] ; then
157 + # No initial database found
158 + cp "${initial_db_file}" "${db_path}" || die
159 + einfo "Default drive database which was shipped with this release of ${PN}"
160 + einfo "has been installed to '${db_path}'."
161 + else
162 + ewarn "WARNING: There's already a drive database in '${db_path}'!"
163 + ewarn "Because we cannot determine if this database is untouched"
164 + ewarn "or was modified by the user you have to manually update the"
165 + ewarn "drive database:"
166 + ewarn ""
167 + ewarn "a) Replace '${db_path}/drivedb.h' by the database shipped with this"
168 + ewarn " release which can be found in '${initial_db_file}', i.e."
169 + ewarn ""
170 + ewarn " cp \"${initial_db_file}\" \"${db_path}\""
171 + ewarn ""
172 + ewarn "b) Run the following command as root:"
173 + ewarn ""
174 + ewarn " /usr/sbin/update-smart-drivedb"
175 +
176 + if ! use update-drivedb ; then
177 + ewarn ""
178 + ewarn "However, 'update-smart-drivedb' requires that you re-emerge ${PN}"
179 + ewarn "with USE='update-drivedb'."
180 + fi
181 + fi
182 + fi
183 +}