svn commit: r263806 - in user/des/fbce: . db
Dag-Erling Smørgrav
des at FreeBSD.org
Thu Mar 27 08:48:20 UTC 2014
Author: des
Date: Thu Mar 27 08:48:19 2014
New Revision: 263806
URL: http://svnweb.freebsd.org/changeset/base/263806
Log:
Clean up and document
Modified:
user/des/fbce/Makefile.PL
user/des/fbce/README
user/des/fbce/db/notes
user/des/fbce/db/update.sh
Modified: user/des/fbce/Makefile.PL
==============================================================================
--- user/des/fbce/Makefile.PL Thu Mar 27 08:47:50 2014 (r263805)
+++ user/des/fbce/Makefile.PL Thu Mar 27 08:48:19 2014 (r263806)
@@ -1,22 +1,35 @@
-#!/usr/bin/env perl
-# IMPORTANT: if you delete this file your app will not work as
-# expected. You have been warned.
+#!/usr/bin/perl
+#
+# $FreeBSD$
+#
+
use inc::Module::Install;
-use Module::Install::Catalyst; # Complain loudly if you don't have
- # Catalyst::Devel installed or haven't said
- # 'make dist' to create a standalone tarball.
+use Module::Install::Catalyst;
name 'FBCE';
all_from 'lib/FBCE.pm';
-requires 'Catalyst::Runtime' => '5.80024';
+requires 'Catalyst::Action::RenderView';
+requires 'Catalyst::Authentication::Store::DBIx::Class';
+requires 'Catalyst::Model::DBIC::Schema';
+requires 'Catalyst::Plugin::Authentication';
+requires 'Catalyst::Plugin::ConfigLoader';
requires 'Catalyst::Plugin::ConfigLoader';
+requires 'Config::General';
+requires 'Catalyst::Plugin::DateTime';
+requires 'MooseX::Types::DateTime::MoreCoercions';
+requires 'Catalyst::Plugin::Session';
+requires 'Catalyst::Plugin::Session::State::Cookie';
+requires 'Catalyst::Plugin::Session::Store::FastMmap';
requires 'Catalyst::Plugin::Static::Simple';
-requires 'Catalyst::Action::RenderView';
+requires 'Catalyst::Plugin::Static::Simple';
+requires 'Catalyst::Runtime' => '5.90053';
+requires 'Catalyst::View::TT';
+requires 'Crypt::SaltedHash';
+requires 'Text::WikiFormat';
+
requires 'Moose';
requires 'namespace::autoclean';
-requires 'Config::General'; # This should reflect the config file format you've chosen
- # See Catalyst::Plugin::ConfigLoader for supported formats
test_requires 'Test::More' => '0.88';
catalyst;
Modified: user/des/fbce/README
==============================================================================
--- user/des/fbce/README Thu Mar 27 08:47:50 2014 (r263805)
+++ user/des/fbce/README Thu Mar 27 08:48:19 2014 (r263806)
@@ -1 +1,27 @@
-Run script/fbce_server.pl to test the application.
+This is the FreeBSD Core team election system.
+
+It is written in Perl, using the Catalyst MVC framework and the
+DBIx::Class ORM.
+
+You will need to install the following packages to run FBCE:
+
+pkg install \
+ p5-Catalyst-Runtime \
+ p5-Catalyst-Model-DBIC-Schema \
+ p5-Catalyst-Plugin-ConfigLoader \
+ p5-Catalyst-Plugin-DateTime \
+ p5-Catalyst-Plugin-Authentication \
+ p5-Catalyst-Authentication-Store-DBIx-Class \
+ p5-Catalyst-Plugin-Session \
+ p5-Catalyst-Plugin-Session-State-Cookie \
+ p5-Catalyst-Plugin-Session-Store-FastMmap \
+ p5-Catalyst-Plugin-Static-Simple \
+ p5-Catalyst-View-TT \
+ p5-MooseX-Types-DateTime-MoreCoercions \
+ p5-Crypt-SaltedHash \
+ p5-Text-WikiFormat
+
+In addition, you will need a database (PostgreSQL recommended) and the
+corresponding DBD module (p5-DBD-Pg). See db/notes for information on
+how to create and populate the database.
+
Modified: user/des/fbce/db/notes
==============================================================================
--- user/des/fbce/db/notes Thu Mar 27 08:47:50 2014 (r263805)
+++ user/des/fbce/db/notes Thu Mar 27 08:48:19 2014 (r263806)
@@ -1,8 +1,15 @@
+#!/bin/sh
+#
+# These are instructions for creating and populating the FBCE
+# database. Note that although this is a syntactically correct shell
+# script, it will not (or at least should not) run unmodified.
+#
# $FreeBSD$
+#
# Initialize PostgreSQL
-sudo /usr/local/etc/rc.d/postgresql initdb
-sudo /usr/local/etc/rc.d/postgresql start
+sudo service postgresql initdb
+sudo service postgresql start
# Create a superuser for myself
sudo -u pgsql createuser -s des
@@ -12,10 +19,17 @@ createuser -S -D -R fbce
createdb -E utf8 -O fbce fbce
# Create the schema
-psql -f db/fbce.sql fbce fbce
+psql -f db/fbce.sql fbce fbce
# Regenerate the DBIC schema
-./db/update.sh
+#
+# Note that this will not overwrite lib/FBCE/Model/FBCE.pm, but
+# instead create lib/FBCE/Model/FBCE.pm.new. You may replace the old
+# file with the new, but you should remove the connect_info and place
+# it in fbce_local.conf instead (copy the <Model::FBCE> section from
+# fbce.conf and insert the correct host, user and password).
+#
+./db/update.sh fbce
# One-liner to set a user's password
perl -Ilib -MFBCE -e 'FBCE->model("FBCE::Person")->find({ login => "kenneth36" })->set_password("altinn")'
Modified: user/des/fbce/db/update.sh
==============================================================================
--- user/des/fbce/db/update.sh Thu Mar 27 08:47:50 2014 (r263805)
+++ user/des/fbce/db/update.sh Thu Mar 27 08:48:19 2014 (r263806)
@@ -3,6 +3,13 @@
# $FreeBSD$
#
+user=$1
+password=$2
+
cd $(dirname $(realpath $0))
-../script/fbce_create.pl model FBCE DBIC::Schema FBCE::Schema
+../script/fbce_create.pl model FBCE DBIC::Schema FBCE::Schema \
+ create=static \
+ overwrite_modifications=1 \
+ "dbi:Pg:dbname=fbce" "${user:-fbce}" "$password" \
+ pg_enable_utf8=1
More information about the svn-src-user
mailing list