From 558132e16aa2e02df94052c1beec247845facfd8 Mon Sep 17 00:00:00 2001 From: Dane Smith Date: Wed, 1 Feb 2012 18:42:22 -0500 Subject: Add bootstrap and some helper scripts for install. --- www-apps/indefero/Manifest | 5 ++++- www-apps/indefero/files/bootstrap.php | 22 +++++++++++++++++++ www-apps/indefero/files/dbsetup.sh | 3 +++ www-apps/indefero/files/postinstall-en-1.2.txt | 29 ++++++++++++++++++++++++++ www-apps/indefero/indefero-1.2.ebuild | 10 +++++++-- 5 files changed, 66 insertions(+), 3 deletions(-) create mode 100644 www-apps/indefero/files/bootstrap.php create mode 100755 www-apps/indefero/files/dbsetup.sh create mode 100644 www-apps/indefero/files/postinstall-en-1.2.txt diff --git a/www-apps/indefero/Manifest b/www-apps/indefero/Manifest index b53d41f..a06be5b 100644 --- a/www-apps/indefero/Manifest +++ b/www-apps/indefero/Manifest @@ -1,4 +1,7 @@ +AUX bootstrap.php 603 RMD160 4cc6da7db1aeaa2f380458a61f67be651a49abc2 SHA1 4b38c6121046403d805298d18cfb20b7ff807ea0 SHA256 c13948fca2e56b98458f95908c84a4162600a5ee81664e317f0557131ff1c7c9 +AUX dbsetup.sh 87 RMD160 e5f34ac19f55e18ffdf0c5bf2c6c15b359d68582 SHA1 4908e2a65d59a17e6bcd56c12b9e8cf28e316e10 SHA256 fb60f9b35d302898105252d26f3b703a8ec163b5d098a46dfe7ef2305faa2163 AUX indefero-gentoo-pluf.diff 529 RMD160 c7e7ea57ee4b7aa362041a98f3c83f968a4cc01c SHA1 05bc152b1daf436f1b88fd6ee7ccb8498f059a42 SHA256 bda6a9135ec58dec74a6b677577904c566e8001b815712c8160a2c6c29cf7c25 +AUX postinstall-en-1.2.txt 1103 RMD160 18a78159dd03dff26cdaf92cd1425dd4d7b553fb SHA1 9f1713919c652e58a89f18f2c6929de35c1ff65c SHA256 1b35ddf836be9d7602a2024e80c3e91d6a1f251b8afe7808c115e260445dcf78 DIST indefero-1.2.zip 954890 RMD160 3d9272e1f95673ec7c0b9522494f70fe4c3c6af4 SHA1 962b7b542b62b5d9a3ffa4072e0c2f37be8dcbd6 SHA256 f67f542f6f253945d4b5ec7a2b81d842a63aa23200adef1cb2dede3d7bd15ef1 -EBUILD indefero-1.2.ebuild 1069 RMD160 067dae059101ff34bab390d0c5456869590ed6ba SHA1 a69b7a465ed02ca5340438bc450d3fd6dbbb9637 SHA256 5f7bfb03e26e6648aaa0f42af28ee7930ab2acdce81871c4301fb6f94be9032c +EBUILD indefero-1.2.ebuild 1235 RMD160 196fdd7df069415013bb9c947ff7cadfa9cd8e3a SHA1 d8a3c12d6148de93243a71b91a2c3dcbac1efa2f SHA256 2b4a281db69115c437ebde76bca0cfd0a99869d53a6267c8382d146390a75826 MISC metadata.xml 252 RMD160 0d6b4d4e9e2fc0a9fc73289b6f3234195a3a1405 SHA1 6d719654a220ceff01851fa059936c79ca6bf9be SHA256 50fba57de1e11a48fbf58020c096095ebf9ec5defa2b5bcda9ed44e5be159d3f diff --git a/www-apps/indefero/files/bootstrap.php b/www-apps/indefero/files/bootstrap.php new file mode 100644 index 0000000..e1ee96f --- /dev/null +++ b/www-apps/indefero/files/bootstrap.php @@ -0,0 +1,22 @@ +/src/IDF/conf/path.php'; +require 'Pluf.php'; + +Pluf::start('//src/IDF/conf/idf.php'); +Pluf_Dispatcher::loadControllers(Pluf::f('idf_views')); + +$user = new Pluf_User(); +$user->first_name = 'Foo'; +$user->last_name = 'Bar'; // Required! +$user->login = 'foobar'; // must be lowercase! +$user->email = 'foo@bar.com'; +$user->password = 'foobarbaz'; // the password is salted/hashed +// in the database, so do not worry :) +$user->administrator = true; +$user->active = true; +$user->create(); +print "Bootstrap ok\n"; +?> + diff --git a/www-apps/indefero/files/dbsetup.sh b/www-apps/indefero/files/dbsetup.sh new file mode 100755 index 0000000..690f490 --- /dev/null +++ b/www-apps/indefero/files/dbsetup.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +php /usr/share/php/pluf/src/migrate.php --conf=src/IDF/conf/idf.php -a -d diff --git a/www-apps/indefero/files/postinstall-en-1.2.txt b/www-apps/indefero/files/postinstall-en-1.2.txt new file mode 100644 index 0000000..3ceb078 --- /dev/null +++ b/www-apps/indefero/files/postinstall-en-1.2.txt @@ -0,0 +1,29 @@ +Setting up Indefero +=================== + +1) First, using your database of choice, set up a database, username, and +passord for Indefero. + +ie: If using mysql: + 1) mysql -u root -h localhost -p + 2) create user ''@'localhost' identified by + ''; + 3) create database ; + 4) grant all on .* to ''@'localhost'; + +2) Depending on where Indefero was installed to (if no USE="vhost" it will be +under /var/www/localhost/htdocs), edit the file /src/IDF/conf/idf.php . Make sure to use the values for the database +that you used in step 1. + +3) To actually create the needed tables for indefero, cd +and run scrips/dbsetup.sh. + +4) Lastly, edit /www/bootstrap.php. Change the places where +it says to point to the install you're using. Then update +it to use a username / password of your choice. Then run php /www/bootstrap.php. +When this is done and you see the success, rm /www/bootstrap.php. + + diff --git a/www-apps/indefero/indefero-1.2.ebuild b/www-apps/indefero/indefero-1.2.ebuild index 5a698a4..20984d6 100644 --- a/www-apps/indefero/indefero-1.2.ebuild +++ b/www-apps/indefero/indefero-1.2.ebuild @@ -23,6 +23,8 @@ S="${WORKDIR}/${PN}" src_prepare(){ #Expect pluf to be installed in the normal location. epatch "${FILESDIR}/${PN}-gentoo-pluf.diff" + cp "${FILESDIR}/dbsetup.sh" scripts/ + cp "${FILESDIR}/bootstrap.php" www/ } src_install(){ @@ -36,7 +38,11 @@ src_install(){ cp -R . "${D}/${MY_HTDOCSDIR}" webapp_configfile "${MY_HTDOCSDIR}/src/IDF/conf/idf.php" - #Write a postinstall doc - #webapp_postinstall_txt en "${FILESDIR}/postinstall-en-${PV}.txt" + webapp_postinst_txt en "${FILESDIR}/postinstall-en-${PV}.txt" webapp_src_install } + +pkg_postinst(){ + elog "The postinstall document contains all of the information" + elog "needed to get ${PN} running." +} -- cgit v1.2.3-65-gdbad