first commit

tags/0.1.0
Daniel Berteaud 11 years ago
commit 1dcb40a8a0
  1. 12
      createlinks
  2. 1
      root/etc/e-smith/db/accounts/defaults/opensondage/type
  3. 1
      root/etc/e-smith/db/configuration/defaults/opensondage/DbName
  4. 1
      root/etc/e-smith/db/configuration/defaults/opensondage/DbUser
  5. 1
      root/etc/e-smith/db/configuration/defaults/opensondage/status
  6. 1
      root/etc/e-smith/db/configuration/defaults/opensondage/type
  7. 27
      root/etc/e-smith/db/configuration/migrate/opensondage-database
  8. 1
      root/etc/e-smith/templates.metadata/etc/e-smith/sql/init/opensondage
  9. 47
      root/etc/e-smith/templates/etc/e-smith/sql/init/opensondage
  10. 40
      root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/98OpenSondage
  11. 1
      root/etc/e-smith/templates/etc/opensondage/variables.php/10Url
  12. 1
      root/etc/e-smith/templates/etc/opensondage/variables.php/15Name
  13. 1
      root/etc/e-smith/templates/etc/opensondage/variables.php/20Email
  14. 5
      root/etc/e-smith/templates/etc/opensondage/variables.php/25Database
  15. 8
      root/etc/e-smith/templates/etc/opensondage/variables.php/30Lang
  16. 3
      root/etc/e-smith/templates/etc/opensondage/variables.php/35Logo
  17. 1
      root/etc/e-smith/templates/etc/opensondage/variables.php/40Rewrite
  18. 1
      root/etc/e-smith/templates/etc/opensondage/variables.php/45Google
  19. 1
      root/etc/e-smith/templates/etc/opensondage/variables.php/50RemoteUser
  20. 3
      root/etc/e-smith/templates/etc/opensondage/variables.php/55Local
  21. 8
      root/etc/e-smith/templates/etc/opensondage/variables.php/60End
  22. 51
      smeserver-opensondage.spec

@ -0,0 +1,12 @@
#!/usr/bin/perl -w
use esmith::Build::CreateLinks qw(:all);
# Templates to expand
templates2events("/etc/e-smith/sql/init/opensondage", qw(bootstrap-console-save webapps-update));
templates2events("/etc/opensondage/variables.php", qw(bootstrap-console-save webapps-update));
# PHP header and footer
safe_symlink("/etc/e-smith/templates-default/template-begin-php", "root/etc/e-smith/templates/etc/opensondage/variables.php/template-begin");
safe_symlink("/etc/e-smith/templates-default/template-end-php", "root/etc/e-smith/templates/etc/opensondage/variables.php/template-end");

@ -0,0 +1,27 @@
{
my $rec = $DB->get('opensondage')
|| $DB->new_record('opensondage', {type => 'webapp'});
my $pw = $rec->prop('DbPassword');
if (not $pw or length($pw) < 57){
use MIME::Base64 qw(encode_base64);
$pw = "not set due to error";
if ( open( RANDOM, "/dev/urandom" ) ){
my $buf;
# 57 bytes is a full line of Base64 coding, and contains
# 456 bits of randomness - given a perfectly random /dev/random
if ( read( RANDOM, $buf, 57 ) != 57 ){
warn("Short read from /dev/random: $!");
}
else{
$pw = encode_base64($buf);
chomp $pw;
}
close RANDOM;
}
else{
warn "Could not open /dev/urandom: $!";
}
$rec->set_prop('DbPassword', $pw);
}
}

@ -0,0 +1,47 @@
{
my $db = $opensondage{'DbName'} || 'opensondage';
my $user = $opensondage{'DbUser'} || 'opensondage';
my $pass = $opensondage{'DbPassword'} || 'secret';
my $dbstruct = `rpm -qd smeserver-opensondage | grep mysql.sql`;
$OUT .= <<"END";
#! /bin/sh
if [ ! -d /var/lib/mysql/$db ]; then
/usr/bin/mysql -e 'create database $db'
/usr/bin/mysql $db < $dbstruct
fi
/usr/bin/mysql <<EOF
USE mysql;
REPLACE INTO user (
host,
user,
password)
VALUES (
'localhost',
'$user',
PASSWORD ('$pass'));
REPLACE INTO db (
host,
db,
user,
select_priv, insert_priv, update_priv, delete_priv,
create_priv, alter_priv, index_priv, drop_priv, create_tmp_table_priv,
grant_priv, lock_tables_priv, references_priv)
VALUES (
'localhost',
'$db',
'$user',
'Y', 'Y', 'Y', 'Y',
'Y', 'Y', 'Y', 'Y', 'Y',
'N', 'Y', 'Y');
FLUSH PRIVILEGES;
EOF
END
}

@ -0,0 +1,40 @@
{
my $access = $opensondage{'access'} || 'private';
my $allow = ($access eq 'public')?'all':"$localAccess $externalSSLAccess";
my $alias = (($opensondage{'AliasOnPrimary'} || 'enabled') eq 'enabled') ?
'Alias /opensondage /usr/share/opensondage' : '';
if ($opensondage{'status'} eq 'enabled'){
$OUT .=<<"END"
# OpenSondage Configuration
$alias
<Directory /usr/share/opensondage>
AllowOverride None
AddType application/x-httpd-php .php
php_admin_value open_basedir /usr/share/opensondage:/etc/opensondage:/usr/share/php
php_admin_flag file_uploads Off
php_admin_flag magic_quotes Off
php_admin_flag magic_quotes_gpc Off
php_admin_value max_execution_time 120
order deny,allow
deny from all
allow from $allow
Satisfy all
<Files ~ "\.(txt|TXT|sql|SQL)$">
Deny from all
</Files>
</Directory>
<Directory ~ "/usr/share/opensondage/(errors|adodb|iCalcreator|locale|php2pdf|scripts)">
Deny from all
</Directory>
END
}
else{
$OUT .= "# OpenSondage is disabled\n";
}
}

@ -0,0 +1 @@
define('STUDS_URL', '{$SystemName.$DomainName}');

@ -0,0 +1 @@
define('NOMAPPLICATION', "{$opensondage{'Name'} || 'OpenSondage'}");

@ -0,0 +1 @@
define('ADRESSEMAILADMIN', 'admin@{$DomainName}');

@ -0,0 +1,5 @@
define('BASE', '{opensondage{'DbName'} || 'opensondage'}');
define('USERBASE', "{opensondage{'DbUser'} || 'opensondage'}");
define('USERPASSWD', '{opensondage{'DbPassword'} || 'secret'}');
define('SERVEURBASE', '');
define('BASE_TYPE', 'mysql');

@ -0,0 +1,8 @@
{
my $lang = 'en_US';
my $syslang = $sysconfig{'Language'} || 'en_US';
if ($syslang =~ m/^(fr_FR|es_ES|de_DE)$/){
$lang = $syslang;
}
$OUT .= "define('LANGUE', '$lang');";
}

@ -0,0 +1,3 @@
define('LOGOBANDEAU', '{$opensondage{'LogoRight'} || 'images/Framadate_logo.png'}');
define('LOGOLETTRE', '{$opensondage{'LogoRight'} || 'images/Framadate_logo.png'}');
define('IMAGE_TITRE', '{$opensondage{'LogoCenter'} || 'images/logo-framadate.png'}');

@ -0,0 +1,3 @@
if (@file_exists('variables.local.php')) \{
include('variables.local.php');
\}

@ -0,0 +1,8 @@
// Studs version
define('STUDS_VERSION', '0.6.7');
// Do not edit the following
$ALLOWED_LANGUAGES = array('fr_FR' => 'french',
'en_GB' => 'english',
'es_ES' => 'spanish',
'de_DE' => 'german' );

@ -0,0 +1,51 @@
%define name smeserver-opensondage
%define version 0.1.0
%define release 1.beta0
Summary: sme server integration of opensondage
Name: %{name}
Version: %{version}
Release: %{release}%{?dist}
License: GNU GPL version 2
URL: https://github.com/leblanc-simon/OpenSondage
Group: SMEserver/addon
Source: %{name}-%{version}.tar.gz
BuildArchitectures: noarch
BuildRequires: e-smith-devtools
BuildRoot: /var/tmp/%{name}-%{version}
Requires: e-smith-base
Requires: opensondage
Requires: smeserver-webapps-common
AutoReqProv: no
%description
smserver integration of opensondage.
OpenSondage is a tool for making polls to schedule meetings or events,
quickly and easily.
%changelog
* Tue Nov 5 2013 Daniel Berteaud <daniel@firewall-services.com> 0.1.0-1.sme
- First release
%prep
%setup
%build
perl ./createlinks
%install
rm -rf $RPM_BUILD_ROOT
(cd root ; find . -depth -print | cpio -dump $RPM_BUILD_ROOT)
rm -f %{name}-%{version}-filelist
/sbin/e-smith/genfilelist $RPM_BUILD_ROOT \
> %{name}-%{version}-filelist
%files -f %{name}-%{version}-filelist
%defattr(-,root,root)
%clean
rm -rf $RPM_BUILD_ROOT
%postun
Loading…
Cancel
Save