From b410524e3d4b0191e7d245d31ad1727b7c637a15 Mon Sep 17 00:00:00 2001 From: Johannes Schwab Date: Tue, 23 Sep 2014 17:55:02 +0200 Subject: [PATCH] Add html install scripts --- net-p2p/twister/Manifest | 4 +- net-p2p/twister/files/twister-html-install | 59 +++++++++++++++++++ net-p2p/twister/files/twister-html-update | 27 +++++++++ net-p2p/twister/twister-0.9.25_beta-r1.ebuild | 18 +++++- 4 files changed, 105 insertions(+), 3 deletions(-) create mode 100755 net-p2p/twister/files/twister-html-install create mode 100755 net-p2p/twister/files/twister-html-update diff --git a/net-p2p/twister/Manifest b/net-p2p/twister/Manifest index d714e36..0ab71e0 100644 --- a/net-p2p/twister/Manifest +++ b/net-p2p/twister/Manifest @@ -1,3 +1,5 @@ +AUX twister-html-install 1387 SHA256 08cb517c61072bd1dde02e54386728bfb10301cd3d96926e9a74aa0a98cff47c SHA512 500c7c7c99d8f31006829729ce36a7fdcfdc99f009830b5f64b2e1a7c1eee8223eff4166f0831f3fb7768d90fdfbb169b6ddd13f2ed595bcefcfb6a2fccf5f8b WHIRLPOOL 8131acef33ee4fff1f8189633b5ee98b568690945826280d70a4bc18c4156b2d51e3bbb8835552aa86f08c60c2df714ade01b25f840ff5a3eb16073346779676 +AUX twister-html-update 398 SHA256 6627875c8820fcd401c975d451880808a35d0496ca0f12343a33e9bf90d34026 SHA512 e5613a3c774e9350be5b8fa2aadc4cb8c57e8addd97304a92184871a1f6ad35fc9e833c75c57515b7071a704277cb870fd401fa7eaed0f8d28376bb6917e8614 WHIRLPOOL ee8ad3451c50c011eff36ba1e16cf0eb8b2e46ee50d5a454ac318816f54f0d581a91a2404a9a36946be647378577702a8098f0c70283093f4d87fd6706a2e3aa DIST 201328d62a55681eb53013ea9f48338114e72cb7.tar.gz 6282388 SHA256 e7943d0293df439ab9a14c24f00d43fb6d3728efd771703b8689281cd4d46ba0 SHA512 b454f00efc4b526902c2284ea60b465a496f5482ed48c0d5f8bbc68de8b719323ee2a2aaac94722b7d548b04e5d268a79f41bf2a1f3737be675868686186fbc9 WHIRLPOOL 0c52c90be48b2c5a61dbd1d057cee207fcd5981bb0a71ea4bda93fd7484438ccacc54a298653b06218ec717ae0977136d5eeb49d8f95d00904d5d7ba37b31aa4 DIST 3b0633fad454505b5a1b5d7e3914f6fdb6b0bbbf.tar.gz 6283926 SHA256 eaab0493b02196986a8ffd375a72e67911d4dc5f016a2c499ed2bd515c99ab8e SHA512 deb72236125adee9088df5f9c8d510bf4d7992018362824d572da539585376896db01f3d6b80a32574867b0247844f7279f616436b56b612f5c10328bf74666e WHIRLPOOL 73f8d74866e3ab43dd3e7ca75f6f4841578edb274659f9ccdc91e1bf19706ef5962044c4e624ea1fa261baa6cd92fb277488113b07e9cb65e05545cee8e49cf1 DIST c7e35d86a2e600452427f16f01ccadb955ed8864.tar.gz 6282382 SHA256 a283ee78b0925b20ee89d8e00ef44f35623b97165ecc7a2120dbbaff8bfe479f SHA512 c9ade464aab713ae378160341444710042e7e5a658e485223fbfa33d766d59a4a6c0c4b094e2a9980504fd54c050915be37e04d5a9aa4283189240136a18a8bc WHIRLPOOL 9fc430f39c11f4ecd39071842a18d70074ebf8c7d539857e9e8bab099d895bbeb62c6ca8eddd493f182b79958bf9929b8e3314d49ba16f47e542d9dad1ba4b59 @@ -5,6 +7,6 @@ DIST v0.9.22.tar.gz 6272250 SHA256 6e48d2fdb94d6e9a4991f82b4e00a3da91907ac06c929 EBUILD twister-0.9.22_beta.ebuild 566 SHA256 5d35d8da02b8efb4a10781878a3c036e6dad28ea192686bf4ec63893cb4150f5 SHA512 3cdd875e743854326a542d04f16a9acd4f952cb1b7ff7565c7cc956b733d8fec66f093b50fb26521757a8ea385eb300485a048ede9c67bbfdf7ea4f199e108c2 WHIRLPOOL 232aa9b422868e51a0e03a51b728bc3d69534a00d223407cf3b0aa84af0603534f09d397e13f1dd89fd9e54da09d0e06577f7bafa19a09c7d119d6ff84ed9191 EBUILD twister-0.9.23_beta.ebuild 596 SHA256 876b5d1fbc5a5a6b64f88856dbbe966bf59989a3d0401953f4206a860300602b SHA512 15bd247ddfc8b44df149d6953d206b7bda97db82ac27770223d73a1854db9a636b8e1f89df86b7b7dda8636de9ea793f17edf8f17c7dd9d91f995cfa3479ad87 WHIRLPOOL ac0faeffaafb34c9a4d4ea0e1e6a4d93ba00a80252e1b8811a104f3337c294d8579421c976030e50de460876d05e8770178e9e24bf3a5a69857ffb9188e26b25 EBUILD twister-0.9.24_beta.ebuild 596 SHA256 c416ede7cf4d4c4efe6b272779be72f13c6cd5b5665863e271642bb2ab5cb925 SHA512 7df7bbc3e1fd65cc1e5dcf3fbe9ee1f0883bb3d3453d7058699b967f0360a3bacb0834668a2847d80667fc4057ca0b83ad5b711e158caf06519cd52603c51d55 WHIRLPOOL 42f1d1f298d9408e318693e98345e143113e8c93406b6e8d9bb7ac7ff8bc3359a0aa9ee03fb10036329d3fa846beb1766d4f8b9fb957aff2f1b2b6be585c17c7 -EBUILD twister-0.9.25_beta-r1.ebuild 596 SHA256 65c2a425720fbf2093d182b7e3e930e09352af70bf3cd8b84596ae93cea98dc9 SHA512 b9058068824ca6cdc186bca2a4fa6bfa0c71c1d0b64a4ac3566675c6673493f0301ed51500176da8e6731d92b57aff4fc095e0130016991c7361e2dc9562d03b WHIRLPOOL 1ee2857ea65abb0e1d94c03bffc2439ddef63a8a4ccd1254c9d013a2bf09f04fc508291a74bd0c535ca3d97e14be35988b71026b341af865ac5597cbdfb435e9 +EBUILD twister-0.9.25_beta-r1.ebuild 999 SHA256 d563a2e6f977d4d5a8302a231b478d1751c68d78cfcaf82fac4abe15e496d336 SHA512 650f192cc787d4b919a417935b5ff2dc9af80a88ccf581a7084d2fe6946670db95c29dfdf143b184f6988dacee199572ef98386db4253984119a646c5b5ae096 WHIRLPOOL 68821c965a66c756af1c3c35a6cb6c4a51b6ab5408750bbcaf2cdb6d372814c6a1c18a3627ffae11fceaa5cdc021f3990f865576455289b3d8570135e69f08dc EBUILD twister-0.9.25_beta.ebuild 596 SHA256 65c2a425720fbf2093d182b7e3e930e09352af70bf3cd8b84596ae93cea98dc9 SHA512 b9058068824ca6cdc186bca2a4fa6bfa0c71c1d0b64a4ac3566675c6673493f0301ed51500176da8e6731d92b57aff4fc095e0130016991c7361e2dc9562d03b WHIRLPOOL 1ee2857ea65abb0e1d94c03bffc2439ddef63a8a4ccd1254c9d013a2bf09f04fc508291a74bd0c535ca3d97e14be35988b71026b341af865ac5597cbdfb435e9 MISC metadata.xml 233 SHA256 64eef535474fbc710fadceed478a7cbee7054993e2b41afc8a624e26040aa9de SHA512 35143a73e1054a65d6ce2adf66b8d3b520dca3aeefe540dcbeee509319378e760c3bc6d42a9ae3829422368e5802737264909af52a910a4e4158b0bcfa253d1c WHIRLPOOL 2a0321f1c2f54853fce3a1c1c0a60738674217fb621411bcd62cfa25e427cef1ccb375ce25595af117a1dc4e1f85150df88321fc8af78a019bf09deeb395e60b diff --git a/net-p2p/twister/files/twister-html-install b/net-p2p/twister/files/twister-html-install new file mode 100755 index 0000000..cd8a273 --- /dev/null +++ b/net-p2p/twister/files/twister-html-install @@ -0,0 +1,59 @@ +#! /bin/sh + +if [[ ${EUID} -eq 0 ]] +then + echo "Don't run this as root!" + exit 1 +fi + +twisterFolder=${HOME}/.twister + +error() { + echo "" + echo "An error occured." + echo "Pleace report this at" + echo "https://github.com/ddorian1/gentoo-twister-overlay/issues" + exit 0 +} + +if test -e ${twisterFolder} +then + echo "" + echo "\"${twisterFolder}\" already exists." + echo "If you want to update twister's HTML files," + echo "please run twister-html-update." + echo "Else, remove \"${twisterFolder}\"" + echo "AFTER BACKING UP YOUR PRIVATE KEYS" + echo "and run \"$0\" again." + exit 1 +fi + +echo "Creating folder ${twisterFolder}..." +echo "" + +mkdir ${twisterFolder} || error +cd ${twisterFolder} || error + +echo "Geting HTML files..." +echo "" + +git clone https://github.com/miguelfreitas/twister-html.git ./html || error + +echo "" +echo "Creating config file..." +echo -e "rpcuser=user\nrpcpassword=pwd" > ./twister.conf || error +chmod 600 ./twister.conf || error + +echo "" +echo "Twister-HTML was set up successfully!" +echo "You can now run twister with" +echo "\"twisterd -rpcuser=user -rpcpassword=pwd -rpcallowip=127.0.0.1\"," +echo "open http://127.0.0.1:28332/index.html" +echo "in your favorit webbrowser and" +echo "log in with username \"user\" and password \"pwd\"." +echo "" +echo "Pleace remember to run twister-html-update" +echo "from time to time to keep twister's HTML files" +echo "up to date." + +exit 0 diff --git a/net-p2p/twister/files/twister-html-update b/net-p2p/twister/files/twister-html-update new file mode 100755 index 0000000..9ca416b --- /dev/null +++ b/net-p2p/twister/files/twister-html-update @@ -0,0 +1,27 @@ +#! /bin/sh + +if [[ ${EUID} -eq 0 ]] +then + echo "Don't run this as root!" + exit 1 +fi + +twisterHtmlFolder=${HOME}/.twister/html + +if ! test -d ${twisterHtmlFolder} +then + echo "" + echo "\"${twisterHtmlFolder}\" does not exists." + echo "If you haven't done so already," + echo "please run twister-html-install." + exit 1 +fi + +cd ${twisterHtmlFolder} + +echo "Updating HTML files..." +echo "" + +git pull + +exit $? diff --git a/net-p2p/twister/twister-0.9.25_beta-r1.ebuild b/net-p2p/twister/twister-0.9.25_beta-r1.ebuild index bc29901..09e9f37 100644 --- a/net-p2p/twister/twister-0.9.25_beta-r1.ebuild +++ b/net-p2p/twister/twister-0.9.25_beta-r1.ebuild @@ -30,6 +30,20 @@ src_compile() { } src_install() { - mkdir -p "${D}usr/bin/" - cp "${S}/twisterd" "${D}usr/bin/twisterd" + dodir "/usr/bin/" + + exeinto "/usr/bin" + doexe "${S}/twisterd" + doexe "${FILESDIR}/twister-html-install" + doexe "${FILESDIR}/twister-html-update" + + dodoc "${S}/README.md" +} + +pkg_postinst() { + elog "Befor running twister, each user must set up twister's HTML files" + elog "in ~/.twister/html and the configs in ~/.twister/twister.conf." + elog "You can do this by running twister-html-install." + elog "" + elog "To keep the HTML files up to date, run twister-html-update." }