diff options
-rw-r--r-- | www-apps/rpi-monitor/Manifest | 3 | ||||
-rw-r--r-- | www-apps/rpi-monitor/rpi-monitor-2.5.1.ebuild | 161 |
2 files changed, 164 insertions, 0 deletions
diff --git a/www-apps/rpi-monitor/Manifest b/www-apps/rpi-monitor/Manifest index 99d02cd8..5407c75c 100644 --- a/www-apps/rpi-monitor/Manifest +++ b/www-apps/rpi-monitor/Manifest @@ -5,10 +5,13 @@ AUX rpimonitor.confd 112 SHA256 b683366153e78b3f2e3040036315ed4bb6e97f6963dde609 AUX rpimonitor.initd 973 SHA256 d9ae46e6fa0eaef295736fc9bfc9b4c8af000d67bf4b102375c3ba21610e8653 SHA512 e9bab0b0f1fe8cb6425fa3ddef157df28ef3be344927dbff9d216cb57e31c57a7b79181999fa067e69c62364f5eb1a665d21efdbfd82fdf7dc8b1d54c9efbd1d WHIRLPOOL 3714306bc6b33150dd0ecb3128d044099ecaa92ac4c77b33f1289060bd6112671c8ea764715e3aabfbfd9ee962d6beecc20b180bc2b2583856467e75d0f86a2b DIST rpi-monitor-2.2.zip 292550 SHA256 e37f4be434c47a48c22e4db649e7960c9ab2e6c8851187a2628b71225121f25e SHA512 731a229097e7472e357af2b52ebebfeae65f73f91a44b3bb7c09c7ce72ddb55e2cdb1b03a9147094c359330a0e12e1b5ad9c754f2a3ce70e5a7287980643f4cc WHIRLPOOL 153e6e9a33c71255a787fceeb74d6f0c1ca15079682296f4971882781c62bc241a323ce9f1d91fa49cc5d2b4f541ae94b2da844bdc27ba2809cba1ffa02c1e5d DIST rpi-monitor-2.3.zip 292742 SHA256 67b458800d13dae4a1ccc38c11f1164c3438526c61f57ee810e5b9957399307f SHA512 90bfde85aad88425db8ed53a78e1e049ffecbe778ffae2fbc66915fa7e242b11e61a6ae5c6eb2805b326df8a0023d1b1d666f6c1fa21e68b9256c4e13c209fbc WHIRLPOOL 3b31bbf7c30da8111e6b8030f39513524ffe98dd74c95cdd48634229c7c1eb040abf183f5160a408a107c58a088de22aa34cfe37ca5ebe3133db2575a5b6bb56 +DIST rpi-monitor-2.5.1.zip 303264 SHA256 955b9ef9e684207231f7714e7dbb9a10cd60f3572a4c729070a47d51bbe060bd SHA512 7bef8053354a2b4bf986c69969bc210410bb0832b7961941134df850134c1c8933a8b1dc7ebd248c3966605e333967eea94901c33d80493c4859c64193d1406b WHIRLPOOL 09fbbf44648be382f4b2c75b482dc5cdaaaa2ffbf02cc4f5a41d1a9803fdf270191af381745d4d703ac2dd94276d457543099fd05d13bc320ba69239b12092ff DIST rpi-monitor-2.5.zip 302926 SHA256 1f8e2225576faab8e991342bbee7ee4ff4598fd7813a9a5d237c3528690f044d SHA512 f95c535ebf353bc4ec308f8bd620c2521aae544012833e2dd77dd82457e070b5b13e86008225acba700c9e1eca416d8182cf64b6ab964b28e200c195a82df28e WHIRLPOOL 2409475bb52c01f8f726fbe49cd6b4185ffd7fe4150c20500a651460798753c0e4936892049283e921ec54f2542cb3964726e08f467849630cc4d8ecf4452683 DIST rpi-monitor-deb-2.2.zip 2127268 SHA256 04bd659402cda83df2d34fb38efce4db710f1c63ec41e1905cca9d4d3b41f516 SHA512 ed51fec16b0c23fe73c9b733d4cf8f655089d13c408803970a834d1f5c3a71df026814dd2b6d2ea0759e533e154185beca70eb7048468566cef55fb4ac7b6c2f WHIRLPOOL 006bb1f20f1d6e54e73e1f7f8b6eeb85e75219190450dcd16d2104f555f75dc5751034b1f62af7923137da260f730390c2d668860825cd61d4d6548a23f0e1b3 DIST rpi-monitor-deb-2.3.zip 2393064 SHA256 63c0c6cb822c55b693a1741cdca26a316df8508049c741b0b6e8268c655b705d SHA512 88125b79ce6a0e4466c469e8e344a74eddd2aecb9c046c08251da99c90192f9174bfcb722df5ea79a979da44193b76a6b434f5a9af1d8fe2a02e5c38e0e335b8 WHIRLPOOL bb2d05510cf5577762b14dc95537ae359df979327824943d6710b2038c9982cbd67a1f712acec1f6586de9efa36a51dea841a836de4a84d2a6d03304c92dd708 +DIST rpi-monitor-deb-2.5.1.zip 3212356 SHA256 25fdf04f482e401a58762b4ea91e5a7ac248ce20b694ae914b58824667a65128 SHA512 0bec95b6d6ca2188506fc7c1a1b0cd327aec286e3a370659f628e67becdd7d4e5310dfee0e28ab9713350e8f3655dc9910630430658c8d8772891a4e5ca7d6e9 WHIRLPOOL f1299e525f8025d087071abad365b9d0d0ee7a8505ecc9606baf54739ea589aa14246e17ce2803fc58e09c0038fc3968f570ec1bd18372a22cae6983e9421769 DIST rpi-monitor-deb-2.5.zip 2940038 SHA256 8fea9b70de86ca6b1548e0960d31d86ebea8c22ba0aec9683a4ece5ec82cc215 SHA512 4d4dcabaae9533e01f7ae93ed2eaf28e9a86962b30f0ba9d785b8de62f9398e6bddc5619b34d3cd2f1abac7a293bacdb1e28ae0446b1c16dc31bda9891e52024 WHIRLPOOL 5a2c59350ce40a5b7982d425fc41df4901bcf06c457ea9e3e85d18b79739c491b831bfe33cc99fc868edaa2a28030faf82fc19cda40b4b214990bb94a4ec210d EBUILD rpi-monitor-2.2.ebuild 3466 SHA256 acb9997f49bb6662e7fef87d8c1f0f1ceb0ff6a608090a5be9e542475b891587 SHA512 333211f505096f667af8037b1a94aa80635eff5ac668002225ed32ba74cf1b6c3d79842b58b84605d3928f74bfad0ccee791396c48eb9bef1b039bfc7641b3cc WHIRLPOOL 866bb749de15a15ffd437f893306b0d3a722d3266e95357d2eba18ac4cd6c7fc036997faa7e594d860e5c210e43e47cd5b538fbd227caf34c35aecfe77b581b7 EBUILD rpi-monitor-2.3.ebuild 3466 SHA256 acb9997f49bb6662e7fef87d8c1f0f1ceb0ff6a608090a5be9e542475b891587 SHA512 333211f505096f667af8037b1a94aa80635eff5ac668002225ed32ba74cf1b6c3d79842b58b84605d3928f74bfad0ccee791396c48eb9bef1b039bfc7641b3cc WHIRLPOOL 866bb749de15a15ffd437f893306b0d3a722d3266e95357d2eba18ac4cd6c7fc036997faa7e594d860e5c210e43e47cd5b538fbd227caf34c35aecfe77b581b7 +EBUILD rpi-monitor-2.5.1.ebuild 5027 SHA256 2af8e2478a45ef67f3cc52077512fb24ff9d65e597404fa93bbac0a28489e392 SHA512 2a1b1b97f6b7d76f67dbad4f64b9abb789a019cc6db004d8115be3b91ccfee5d268f46bb3ae7c1e34faabf674cbb1329fc1957cb51787cd2c6302f27d264624d WHIRLPOOL ba2f56158a056d223a216d4aeba0f56bff4ce1e1849bc031f3d77d27e2cedf0eb42e9e42d3e86ee8eccb3fd99fd3bb093297712c872e500d8619297b7d86f670 EBUILD rpi-monitor-2.5.ebuild 3490 SHA256 324fa89b0eff1cab5b740f508d58df570c8752aece19d23e04c08c99a8f872bb SHA512 71ffffcccef5ae31262e91651d8097e8d3cf8e66ce6cf88d985d84910ccc0a62c998176aae9994c535a6edff9af4d7a90b432ee3e266fddce42b8922af53ce32 WHIRLPOOL 0ffbe1e867e084fbbac5fc453a50d1c02745a67a588e38cec06491b231e230f8a6ca8336b1e39130ec726473c524832c32d420d5fe284c21260a9d3b3a317321 diff --git a/www-apps/rpi-monitor/rpi-monitor-2.5.1.ebuild b/www-apps/rpi-monitor/rpi-monitor-2.5.1.ebuild new file mode 100644 index 00000000..37acd176 --- /dev/null +++ b/www-apps/rpi-monitor/rpi-monitor-2.5.1.ebuild @@ -0,0 +1,161 @@ +# Copyright (c) 2013 Stuart Shelton <stuart@shelton.me> +# Distributed under the terms of the GNU General Public License v2 + +EAPI="4" + +inherit eutils + +DESCRIPTION="RPi-Monitor - always keep an eye on your Raspberry Pi" +HOMEPAGE="http://rpi-experiences.blogspot.fr" +SRC_URI="https://github.com/XavierBerger/RPi-Monitor/archive/v${PV}.zip -> ${P}.zip + https://github.com/XavierBerger/RPi-Monitor-deb/archive/v${PV}.zip -> ${PN}-deb-${PV}.zip" +RESTRICT="nomirror" + +LICENSE="GPL-3" +SLOT="0" +KEYWORDS="-* arm" +IUSE="httpd tools" + +DEPEND="app-admin/webapp-config" +RDEPEND=" + httpd? ( + virtual/httpd-cgi + ) + !httpd? ( + dev-perl/HTTP-Daemon + ) + net-analyzer/rrdtool[perl] + || ( ( virtual/perl-JSON-PP dev-perl/JSON-Any ) dev-perl/JSON ) + dev-perl/IPC-ShareLite" + +if use httpd; then + inherit webapp + + need_httpd_cgi +fi + +S="${WORKDIR}/RPi-Monitor-${PV}" + +src_prepare() { + epatch "${FILESDIR}"/default.conf-"${PV:0:3}".patch \ + || die "epatch failed" + + # Fix version string... + sed -i \ + -e "s|<b>Version</b>: {DEVELOPMENT} |<b>Version</b>: ${PV} |" \ + rpimonitor/web/js/rpimonitor.js || die "Version correction failed" + + cp "${S}"/../RPi-Monitor-deb-"${PV}"/conf2man.pl . + cp "${S}"/../RPi-Monitor-deb-"${PV}"/help2man.pl . + chmod 755 conf2man.pl help2man.pl + + [[ -x ./help2man.pl && -x conf2man.pl ]] \ + || die "Portage temporary directory must not be mounted 'noexec'" + + cat rpimonitor/rpimonitord.conf rpimonitor/default.conf > rpimonitord.conf + + ./help2man.pl rpimonitor/rpimonitord "${PV}" > rpimonitord.1 + ./conf2man.pl rpimonitord.conf "${PV}" > rpimonitord.conf.5 +} + +src_install() { + use httpd && webapp_src_preinst + + doman rpimonitord.1 rpimonitord.conf.5 + + dodoc README.md + newdoc tools/reverseproxy nginx.conf.example + newdoc rpimonitor/custo.conf custom.conf + dodoc rpimonitor/default.conf + + dosbin rpimonitor/rpimonitord + if use tools; then + exeinto /usr/share/"${PN}"/tools + doexe tools/{addnginxuser.sh,make_ca.sh,make_cert.sh,netTraffic.sh,openssl.cnf} + fi + + newconfd "${FILESDIR}"/rpimonitor.confd rpimonitor + newinitd "${FILESDIR}"/rpimonitor.initd rpimonitor + dodir /etc/rpimonitord.conf.d + insinto /etc/rpimonitord.conf.d + doins rpimonitor/default.conf + + if use httpd; then + # Try to determine the real root directory... + if [[ -n "${vhost_root}" || -r /etc/vhosts/webapp-config ]]; then + if ! [[ -n "${vhost_root}" && -n "${vhost_htdocs_insecure}" ]]; then + # Do this twice, so that variables defined in terms of other + # values are correctly initialised... + source /etc/vhosts/webapp-config + source /etc/vhosts/webapp-config + fi + INSTROOT="${vhost_root}/${vhost_htdocs_insecure}" + else + INSTROOT="${EROOT}/var/www/localhost/htdocs" + fi + + insinto "${MY_HTDOCSDIR}" + doins -r rpimonitor/web/* + dodir "${MY_HTDOCSDIR}"/custom/net_traffic + dodir "${MY_HTDOCSDIR}"/stat + + webapp_serverowned "${MY_HTDOCSDIR}"/custom + webapp_serverowned "${MY_HTDOCSDIR}"/custom/net_traffic + webapp_serverowned "${MY_HTDOCSDIR}"/stat + else + INSTROOT="${EROOT}/usr/share" + + insinto /usr/share/rpi-monitor + doins -r rpimonitor/web/* + diropts -m 0775 -o nobody -g nogroup + + dodir /var/lib/rpi-monitor/custom/net_traffic + dodir /var/lib/rpi-monitor/stat + + dosym ../../../var/lib/rpi-monitor/stat /usr/share/rpi-monitor/stat + dosym ../../../var/lib/rpi-monitor/custom /usr/share/rpi-monitor/custom + fi + + sed -i \ + -e "s|^#daemon.webroot=./web$|daemon.webroot=${INSTROOT/\/\///}/rpi-monitor|" \ + -e "s|^#daemon.user=pi$|daemon.user=nobody|" \ + -e "s|^#daemon.group=pi$|daemon.group=nogroup|" \ + rpimonitor/rpimonitord.conf + insinto /etc/ + doins rpimonitor/rpimonitord.conf + + use httpd && webapp_src_install +} + +pkg_postinst() { + einfo "Edit the file /etc/rpimonitord.conf.d/default.conf to configure RPi-Monitor" + echo + ewarn "If graphs display incorrect data or values are shown as 'NaN' in the" + ewarn "web-interface, especially after configuration changes, try stopping" + ewarn "RPi-Monitor and deleting the affected .rrd files from" + ewarn "/var/lib/rpi-monitor before restarting RPi-Monitor - which should clear" + ewarn "any problems caused by changes in format." + echo + einfo "If network data collected by earlier versions of ${PN} cause anomalous peaks" + einfo "to appear on network graphs, this can be resolved by adjusting the network" + einfo "RRD databases:" + echo + if use httpd; then + # Try to determine the real root directory... + if [[ -n "${vhost_root}" || -r /etc/vhosts/webapp-config ]]; then + if ! [[ -n "${vhost_root}" && -n "${vhost_htdocs_insecure}" ]]; then + # Do this twice, so that variables defined in terms of other + # values are correctly initialised... + source /etc/vhosts/webapp-config + source /etc/vhosts/webapp-config + fi + INSTROOT="${vhost_root}/${vhost_htdocs_insecure}" + else + INSTROOT="${EROOT}/var/www/localhost/htdocs" + fi + else + INSTROOT="${EROOT}/var/lib/rpi-monitor" + fi + einfo "rrdtool tune ${INSTROOT//\/\///}/stat/net_received.rrd -a net_received:0" + einfo "rrdtool tune ${INSTROOT//\/\///}/stat/net_send.rrd -i net_send:0" +} |