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