diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2017-11-02 21:07:25 +0000 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2017-11-02 21:07:25 +0000 |
commit | 27dfd272ae3be15b1017f733682211afa1c7c0f0 (patch) | |
tree | 1fe1c9ed5c5d79c63069bb8d541be075ccc3aac2 /sys-apps/smartmontools | |
parent | d950fa39dbe16d164ed0cb8e3036fd5d0d896a4c (diff) |
gentoo resync : 02.11.2017
Diffstat (limited to 'sys-apps/smartmontools')
-rw-r--r-- | sys-apps/smartmontools/Manifest | 6 | ||||
-rw-r--r-- | sys-apps/smartmontools/files/smartd.systemd | 11 | ||||
-rw-r--r-- | sys-apps/smartmontools/metadata.xml | 2 | ||||
-rw-r--r-- | sys-apps/smartmontools/smartmontools-6.5-r1.ebuild | 148 | ||||
-rw-r--r-- | sys-apps/smartmontools/smartmontools-9999.ebuild | 115 |
5 files changed, 245 insertions, 37 deletions
diff --git a/sys-apps/smartmontools/Manifest b/sys-apps/smartmontools/Manifest index 47e83d39ee81..aacf334322b0 100644 --- a/sys-apps/smartmontools/Manifest +++ b/sys-apps/smartmontools/Manifest @@ -1,12 +1,14 @@ AUX smartd-r1.rc 614 SHA256 acef10e3d963a97c32f525da730eac00be424e7588ab2d7b24ad24dfe032ac88 SHA512 7a46212d2d76b335ac7470b51b44e40b1cdd4814e5db4a8a2f013803bb40ea5072fde64590ffd51754b03a6f80a43e835605a5bb3ac2c23e456633995191ec31 WHIRLPOOL a452c84a5a562c235f7ef633deea976ff414ce4d3132a201e210f91e8181d78c9a89749d54948d07e8d3206d22a9d111a42d59524b4496d257db2988071195d7 AUX smartd.confd 107 SHA256 714cc1b253e1f59b884be89693757fec91ca878c62f37451a49ef6bb72263e85 SHA512 ff45462944f01c0e7cac99443078b253dcbaed4f99ffab85052b12361d9eec4beec81cab334fbede9148b3dd503d5205add32ef4327a788f02a8b1e37f460437 WHIRLPOOL 773405a2cc669f6eaae835bc3a6415151891b91ccf4111147f8b12d9763be26cbf65815879a70cd64ae12a36f59840ffcb15ff7e527479f88d9816130e704e76 +AUX smartd.systemd 258 SHA256 72ef7a3ad0e56a144a19aa2b05a0adb147c76cc95e19ac5eb29e4b155c323a8b SHA512 73c49bca755adf0ff1c6ccd221de0fd2bb7804250968fbcb3799e19c66dacc85a6c7a3e0d1eecea683f57d6a3ff01fbd4b4fc47b0eab5747006f0edc21876a7c WHIRLPOOL 295a9eb8727da9738f926e642f62aa6916f9c80516ec27bca51ce18cc9ead161d9b8db2133261ef8dc97e01d1da6eee14895322792a1199619c1cc46923d8d61 AUX smartmontools-update-drivedb 42 SHA256 53a766a094ef63b925e2c3f8c08322b67c2ab40b1f2b84d414e5de4f6747aca8 SHA512 8ad70fc85ab67b7c32eda95dd37517382c2447862df08b810a54dcdedb1eb8148f3a0e29f402a54adff31d1e88d80d09a258ed9e1e13b597ab2a358ebeda0ce8 WHIRLPOOL 3dd62cd6e26a18c9fe5555a1d3feb2597eea6773c857a2cf559331486fc0ef2ef67a0bcb7d1e03b14631d0c8809daae7688d6e1f83f02e8867b0dc23dfcafb55 DIST smartmontools-6.4.tar.gz 822539 SHA256 eab75600c1eda9c34b13097db71138ab376f3dad8a6a4667fb4d1d081feb7a85 SHA512 366cd55ec668da1ca8a3d9ba79d5bee6e0c59032936b7f2f161f8fbb1c9f869c505d715cc10562b6241f808bb8b534feaf9d9fd752f6cb1593ee893611742adc WHIRLPOOL 72af8a0a4754bd75da9e98a008c64c083579fe27bdbd0655da81c8fe7a258dbc305cafd05f2f21d1954918ab8ff040cf1d54b916a1ce82fb8da64ba2e49b4de0 DIST smartmontools-6.5.tar.gz 855642 SHA256 89e8bb080130bc6ce148573ba5bb91bfe30236b64b1b5bbca26515d4b5c945bc SHA512 dca7a6363ab7280ee4197155025f624c978886dcc94fc47b524f6f849138b62c471e966c0d4bf59c7bba50519dc122264618e5ded80a406863ddd10b43d928d3 WHIRLPOOL 639bb5c847c4e0e0f7156b764140f4382f650826eb3d59db6a712468e944a40788c87bbbe0149b9a4d1480947492b007b5875969e611213409f247ff4383fbd6 EBUILD smartmontools-6.4-r1.ebuild 2534 SHA256 bfe58954437b13cc6fbf2a41cd1955dc67142ad5d86cf047f05ab2103c0c9e39 SHA512 1b0d02e5d4a493cd7926a93c92b3b78951f3580228ca19864113dbb09f12ce936866d50d528bdfb66f94b88b8f99660fa5d7181a81008b4badfaa7ef362a187c WHIRLPOOL 11a73a52a10bf7dedb37d3ff95fe6d69038f67ee25ee561c4fba2b2d44bd6fb958e814a6267a3dd2c709b37a53147a59bbe3e62a6b9129e79e44f61aa7fef9d0 EBUILD smartmontools-6.4.ebuild 1639 SHA256 8a750c037710240049acaf6759199fa9bcc8e2521c8eec155871854c410120c8 SHA512 c9b07c80d4e4355bc2c4ebce895efe35ed70d5a31eab3eb8298c1cc947a42cb1c4bb81d57cb46816619580067aeec246f49bc581a788abb7c912d0ef898f8448 WHIRLPOOL f74cbde502853bffc5c88d8ef14202c908a772bd1e9a6a779f3958282655e5ec049666a75d339647d6f5cd9e3697ca4eaa616bc5462f90588e33ecccb2cc9ecb +EBUILD smartmontools-6.5-r1.ebuild 4043 SHA256 1d843bfd187ad2f8a0c004faa6f91dc7f5c0709e65dc41a42a6420c3c7037f1a SHA512 7bc661356535cf00b2783f4a4bf323eae05c688d3db0ef81e7ccccb8d8aeeff24b2bbfca50b233d96b0f22d2aecf2d39f5bcd53d90b9076424b3c744f48341a5 WHIRLPOOL 7a1733fee7150b8850904ddb7fa0bda3a6905e09f084e5acdff4b0c84072e8bc1811f79c9fcc0a752ac2b84070fa9336475cfde87ef308672aefc8f76755d51e EBUILD smartmontools-6.5.ebuild 2726 SHA256 2a194cd89589b0a1be1be3ffe2ecce9c5740ff0069cb2cd209ccd92da895ee3c SHA512 15871d06fa4d9038ecdbb5d6e669526fd035e09cb43dee4fc9688fa3e9d1e5775ba46eb12c720d638ab5f7c0d808495f66c1fa7e404247f933c5c450411462cf WHIRLPOOL aa0fde02f7f195fddaf74a7a63a45c199b05d94a0c41a51d9d644f7ce7864527b5173e321f9fe0048ed3755716ae82dcca66279832bf8a4eb9c83f8488b7618a -EBUILD smartmontools-9999.ebuild 2726 SHA256 2a194cd89589b0a1be1be3ffe2ecce9c5740ff0069cb2cd209ccd92da895ee3c SHA512 15871d06fa4d9038ecdbb5d6e669526fd035e09cb43dee4fc9688fa3e9d1e5775ba46eb12c720d638ab5f7c0d808495f66c1fa7e404247f933c5c450411462cf WHIRLPOOL aa0fde02f7f195fddaf74a7a63a45c199b05d94a0c41a51d9d644f7ce7864527b5173e321f9fe0048ed3755716ae82dcca66279832bf8a4eb9c83f8488b7618a +EBUILD smartmontools-9999.ebuild 4043 SHA256 1d843bfd187ad2f8a0c004faa6f91dc7f5c0709e65dc41a42a6420c3c7037f1a SHA512 7bc661356535cf00b2783f4a4bf323eae05c688d3db0ef81e7ccccb8d8aeeff24b2bbfca50b233d96b0f22d2aecf2d39f5bcd53d90b9076424b3c744f48341a5 WHIRLPOOL 7a1733fee7150b8850904ddb7fa0bda3a6905e09f084e5acdff4b0c84072e8bc1811f79c9fcc0a752ac2b84070fa9336475cfde87ef308672aefc8f76755d51e MISC ChangeLog 5978 SHA256 ddb411f5922e15aa38c9850ff7b341b4b285fe0052dde1710e85a026d1170a5c SHA512 1a482b6059ce1f49f2d1c468389b520963942e4d8b02e0e883452a024a9b1557ce0d33cdb365f170568ea69a9050f61482656579a5179be3ff0d61c84a039d7f WHIRLPOOL 8113cae9710da5e3a758cca8b8760c4c30aef3ae7f2881a1b9028f1ce15539389f1d50a72c97839fb9ffba15d7df94ab904080e8f47c0412491bacc30001c815 MISC ChangeLog-2015 20152 SHA256 f3ec99b8e802612e8f3dccf301c1f8ce46066fa26b1bf58c1eb34ec4e606fb3e SHA512 3969af254861ddb1bef5c129fc691732356ee56fd5ed29f3a76273593182c90d21239050c7d449560334976ae7d315d06fb25d3f815fe6c98b4ce93771b68d6c WHIRLPOOL 2c7d3763680d2572c2ee8f8f3c5a2da0bf6f602c06deb57d842ceea07f0a695d36ed92829166b4d29c10eb21090e65cc064d297d8f2a537c3a4aab93d0bcff8b -MISC metadata.xml 517 SHA256 9498d60f66b4e752d70f5f34e5bcf2ed20bb9d113310d9f4344049dde7fc6087 SHA512 63c3af11414b2a8ac83351486b600c16dec940d01c07bacfefb762b3acb152f87db3f630772c0ec32cdc4b316ab3a98ed3efbda82d0af5680d76f0b24459ba14 WHIRLPOOL 4a7af5fe7bd02387df2ebd7c34379eff330710a4ffc7beed20953cac8c4ab2cfae4d1283c71bf1f79d1d765e681761b2e1a5ab19557ebb7e84c16aa143429f5c +MISC metadata.xml 718 SHA256 774df2c60538f51bdb39e35b0fddeaed32fa18b0d11efe6a4eb52187d84b57c4 SHA512 a6a07e57bd09402839295ee859481d784445afadb12ffd644c6de3af41a4a763225f63d098c328193123d72cdad3b98e278256bb3e67b104015399def014ee54 WHIRLPOOL e0c7fcd97abb35522e21de6436f621f00f4ae8bbc6137c65f543e25bcda702a89329b6419d954ae59965b3d5dfb048f175746a43cfe6c23af8a95c2733518481 diff --git a/sys-apps/smartmontools/files/smartd.systemd b/sys-apps/smartmontools/files/smartd.systemd new file mode 100644 index 000000000000..bdcbdbbe306a --- /dev/null +++ b/sys-apps/smartmontools/files/smartd.systemd @@ -0,0 +1,11 @@ +[Unit] +Description=Self Monitoring and Reporting Technology (SMART) Daemon +Documentation=man:smartd(8) man:smartd.conf(5) + +[Service] +ExecStart=/usr/sbin/smartd -n +ExecReload=/bin/kill -HUP $MAINPID +StandardOutput=syslog + +[Install] +WantedBy=multi-user.target diff --git a/sys-apps/smartmontools/metadata.xml b/sys-apps/smartmontools/metadata.xml index b35558848001..0ae4667bf8d9 100644 --- a/sys-apps/smartmontools/metadata.xml +++ b/sys-apps/smartmontools/metadata.xml @@ -6,6 +6,8 @@ <name>Gentoo Base System</name> </maintainer> <use> + <flag name="caps">Build against <pkg>sys-libs/libcap-ng</pkg> to allow smartd to drop its privileges.</flag> + <flag name="daemon">Install the monitoring daemon (smartd) and associated scripts.</flag> <flag name="minimal">Do not install the monitoring daemon and associated scripts.</flag> <flag name="update_drivedb">Install a script to update the drivedb file.</flag> </use> diff --git a/sys-apps/smartmontools/smartmontools-6.5-r1.ebuild b/sys-apps/smartmontools/smartmontools-6.5-r1.ebuild new file mode 100644 index 000000000000..499584db4c39 --- /dev/null +++ b/sys-apps/smartmontools/smartmontools-6.5-r1.ebuild @@ -0,0 +1,148 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI="6" + +inherit autotools flag-o-matic systemd +if [[ ${PV} == "9999" ]] ; then + ESVN_REPO_URI="https://svn.code.sf.net/p/smartmontools/code/trunk/smartmontools" + ESVN_PROJECT="smartmontools" + inherit subversion +else + SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz" + KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~x64-macos" +fi + +DESCRIPTION="Tools to monitor storage systems to provide advanced warning of disk degradation" +HOMEPAGE="https://www.smartmontools.org" + +LICENSE="GPL-2" +SLOT="0" +IUSE="caps +daemon selinux static update_drivedb" + +DEPEND=" + caps? ( + static? ( sys-libs/libcap-ng[static-libs] ) + !static? ( sys-libs/libcap-ng ) + ) + kernel_FreeBSD? ( + sys-freebsd/freebsd-lib[usb] + ) + selinux? ( + sys-libs/libselinux + )" +RDEPEND="${DEPEND} + daemon? ( virtual/mailx ) + selinux? ( sec-policy/selinux-smartmon ) + update_drivedb? ( + || ( + net-misc/curl + net-misc/wget + www-client/lynx + dev-vcs/subversion + ) + ) +" + +REQUIRED_USE="( caps? ( daemon ) )" + +src_prepare() { + default + + eautoreconf +} + +src_configure() { + use static && append-ldflags -static + # The build installs /etc/init.d/smartd, but we clobber it + # in our src_install, so no need to manually delete it. + myeconfargs=( + --docdir="${EPREFIX}/usr/share/doc/${PF}" + --with-drivedbdir="${EPREFIX}/var/db/${PN}" #575292 + --with-initscriptdir="${EPREFIX}/etc/init.d" + $(use_with caps libcap-ng) + $(use_with selinux) + --with-systemdsystemunitdir="$(systemd_get_systemunitdir)" + $(use_with update_drivedb update-smart-drivedb) + ) + econf "${myeconfargs[@]}" +} + +src_install() { + local db_path="/var/db/${PN}" + + if use daemon; then + default + + newinitd "${FILESDIR}"/smartd-r1.rc smartd + newconfd "${FILESDIR}"/smartd.confd smartd + systemd_newunit "${FILESDIR}"/smartd.systemd smartd.service + else + dosbin smartctl + doman smartctl.8 + + local DOCS=( AUTHORS ChangeL* COPYING INSTALL NEWS README TODO ) + einstalldocs + fi + + if use update_drivedb ; then + if ! use daemon; then + dosbin "${S}"/update-smart-drivedb + fi + + exeinto /etc/cron.monthly + doexe "${FILESDIR}/${PN}-update-drivedb" + fi + + if use daemon || use update_drivedb; then + keepdir "${db_path}" + + # Install a copy of the initial drivedb.h to /usr/share/${PN} + # so that we can access that file later in pkg_postinst + # even when dealing with binary packages (bug #575292) + insinto /usr/share/${PN} + doins "${S}"/drivedb.h + fi + + # Make sure we never install drivedb.h into the db location + # of the acutal image so we don't record hashes because user + # can modify that file + rm -f "${ED%/}${db_path}/drivedb.h" || die + + # Bug #622072 + find "${ED%/}"/usr/share/doc -type f -exec chmod a-x '{}' \; || die +} + +pkg_postinst() { + if use daemon || use update_drivedb; then + local initial_db_file="${EPREFIX%/}/usr/share/${PN}/drivedb.h" + local db_path="${EPREFIX%/}/var/db/${PN}" + + if [[ ! -f "${db_path}/drivedb.h" ]] ; then + # No initial database found + cp "${initial_db_file}" "${db_path}" || die + einfo "Default drive database which was shipped with this release of ${PN}" + einfo "has been installed to '${db_path}'." + else + ewarn "WARNING: There's already a drive database in '${db_path}'!" + ewarn "Because we cannot determine if this database is untouched" + ewarn "or was modified by the user you have to manually update the" + ewarn "drive database:" + ewarn "" + ewarn "a) Replace '${db_path}/drivedb.h' by the database shipped with this" + ewarn " release which can be found in '${initial_db_file}', i.e." + ewarn "" + ewarn " cp \"${initial_db_file}\" \"${db_path}\"" + ewarn "" + ewarn "b) Run the following command as root:" + ewarn "" + ewarn " /usr/sbin/update-smart-drivedb" + + if ! use update_drivedb ; then + ewarn "" + ewarn "However, 'update-smart-drivedb' requires that you re-emerge ${PN}" + ewarn "with USE='update_drivedb'." + fi + fi + fi +} diff --git a/sys-apps/smartmontools/smartmontools-9999.ebuild b/sys-apps/smartmontools/smartmontools-9999.ebuild index dfe72e1dfdd6..499584db4c39 100644 --- a/sys-apps/smartmontools/smartmontools-9999.ebuild +++ b/sys-apps/smartmontools/smartmontools-9999.ebuild @@ -1,13 +1,13 @@ # Copyright 1999-2017 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -EAPI=5 +EAPI="6" -inherit flag-o-matic systemd +inherit autotools flag-o-matic systemd if [[ ${PV} == "9999" ]] ; then ESVN_REPO_URI="https://svn.code.sf.net/p/smartmontools/code/trunk/smartmontools" ESVN_PROJECT="smartmontools" - inherit subversion autotools + inherit subversion else SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz" KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~x64-macos" @@ -18,29 +18,41 @@ HOMEPAGE="https://www.smartmontools.org" LICENSE="GPL-2" SLOT="0" -IUSE="caps minimal selinux static update_drivedb" +IUSE="caps +daemon selinux static update_drivedb" DEPEND=" caps? ( static? ( sys-libs/libcap-ng[static-libs] ) !static? ( sys-libs/libcap-ng ) ) + kernel_FreeBSD? ( + sys-freebsd/freebsd-lib[usb] + ) selinux? ( sys-libs/libselinux )" RDEPEND="${DEPEND} - !minimal? ( virtual/mailx ) + daemon? ( virtual/mailx ) selinux? ( sec-policy/selinux-smartmon ) + update_drivedb? ( + || ( + net-misc/curl + net-misc/wget + www-client/lynx + dev-vcs/subversion + ) + ) " +REQUIRED_USE="( caps? ( daemon ) )" + src_prepare() { - if [[ ${PV} == "9999" ]] ; then - eautoreconf - fi + default + + eautoreconf } src_configure() { - use minimal && einfo "Skipping the monitoring daemon for minimal build." use static && append-ldflags -static # The build installs /etc/init.d/smartd, but we clobber it # in our src_install, so no need to manually delete it. @@ -50,7 +62,7 @@ src_configure() { --with-initscriptdir="${EPREFIX}/etc/init.d" $(use_with caps libcap-ng) $(use_with selinux) - $(systemd_with_unitdir) + --with-systemdsystemunitdir="$(systemd_get_systemunitdir)" $(use_with update_drivedb update-smart-drivedb) ) econf "${myeconfargs[@]}" @@ -59,45 +71,78 @@ src_configure() { src_install() { local db_path="/var/db/${PN}" - if use minimal ; then - dosbin smartctl - doman smartctl.8 - else + if use daemon; then default + newinitd "${FILESDIR}"/smartd-r1.rc smartd newconfd "${FILESDIR}"/smartd.confd smartd + systemd_newunit "${FILESDIR}"/smartd.systemd smartd.service + else + dosbin smartctl + doman smartctl.8 - keepdir "${db_path}" - if use update_drivedb ; then - # Move drivedb.h file out of PM's sight (bug #575292) - mv "${ED}${db_path}/drivedb.h" "${T}" || die + local DOCS=( AUTHORS ChangeL* COPYING INSTALL NEWS README TODO ) + einstalldocs + fi - exeinto /etc/cron.monthly - doexe "${FILESDIR}/${PN}-update-drivedb" + if use update_drivedb ; then + if ! use daemon; then + dosbin "${S}"/update-smart-drivedb fi + + exeinto /etc/cron.monthly + doexe "${FILESDIR}/${PN}-update-drivedb" fi + + if use daemon || use update_drivedb; then + keepdir "${db_path}" + + # Install a copy of the initial drivedb.h to /usr/share/${PN} + # so that we can access that file later in pkg_postinst + # even when dealing with binary packages (bug #575292) + insinto /usr/share/${PN} + doins "${S}"/drivedb.h + fi + + # Make sure we never install drivedb.h into the db location + # of the acutal image so we don't record hashes because user + # can modify that file + rm -f "${ED%/}${db_path}/drivedb.h" || die + + # Bug #622072 + find "${ED%/}"/usr/share/doc -type f -exec chmod a-x '{}' \; || die } pkg_postinst() { - if ! use minimal ; then - local db_path="/var/db/${PN}" + if use daemon || use update_drivedb; then + local initial_db_file="${EPREFIX%/}/usr/share/${PN}/drivedb.h" + local db_path="${EPREFIX%/}/var/db/${PN}" - if [[ -f "${db_path}/drivedb.h" ]] ; then - ewarn "WARNING! The existing copy of the drive database has been replaced with the version that" - ewarn "was shipped with this release of ${PN}. You may want to update the" - ewarn "database by: " + if [[ ! -f "${db_path}/drivedb.h" ]] ; then + # No initial database found + cp "${initial_db_file}" "${db_path}" || die + einfo "Default drive database which was shipped with this release of ${PN}" + einfo "has been installed to '${db_path}'." + else + ewarn "WARNING: There's already a drive database in '${db_path}'!" + ewarn "Because we cannot determine if this database is untouched" + ewarn "or was modified by the user you have to manually update the" + ewarn "drive database:" + ewarn "" + ewarn "a) Replace '${db_path}/drivedb.h' by the database shipped with this" + ewarn " release which can be found in '${initial_db_file}', i.e." + ewarn "" + ewarn " cp \"${initial_db_file}\" \"${db_path}\"" + ewarn "" + ewarn "b) Run the following command as root:" + ewarn "" + ewarn " /usr/sbin/update-smart-drivedb" if ! use update_drivedb ; then - ewarn "re-merging ${PN} with USE='update_drivedb', then" + ewarn "" + ewarn "However, 'update-smart-drivedb' requires that you re-emerge ${PN}" + ewarn "with USE='update_drivedb'." fi - ewarn "running the following command as root:" - ewarn "" - ewarn "/usr/sbin/update-smart-drivedb" - fi - - if use update_drivedb ; then - # Move drivedb.h to /var/db/${PN} (bug #575292) - mv "${T}"/drivedb.h "${db_path}" || die fi fi } |