commit 1dcb40a8a031a893cefcac6e05486bbc938c22a6 Author: Daniel Berteaud Date: Tue Nov 5 16:14:47 2013 +0100 first commit diff --git a/createlinks b/createlinks new file mode 100644 index 0000000..7164e8b --- /dev/null +++ b/createlinks @@ -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"); + diff --git a/root/etc/e-smith/db/accounts/defaults/opensondage/type b/root/etc/e-smith/db/accounts/defaults/opensondage/type new file mode 100644 index 0000000..96cdd3b --- /dev/null +++ b/root/etc/e-smith/db/accounts/defaults/opensondage/type @@ -0,0 +1 @@ +url diff --git a/root/etc/e-smith/db/configuration/defaults/opensondage/DbName b/root/etc/e-smith/db/configuration/defaults/opensondage/DbName new file mode 100644 index 0000000..9b4622c --- /dev/null +++ b/root/etc/e-smith/db/configuration/defaults/opensondage/DbName @@ -0,0 +1 @@ +opensondage diff --git a/root/etc/e-smith/db/configuration/defaults/opensondage/DbUser b/root/etc/e-smith/db/configuration/defaults/opensondage/DbUser new file mode 100644 index 0000000..9b4622c --- /dev/null +++ b/root/etc/e-smith/db/configuration/defaults/opensondage/DbUser @@ -0,0 +1 @@ +opensondage diff --git a/root/etc/e-smith/db/configuration/defaults/opensondage/status b/root/etc/e-smith/db/configuration/defaults/opensondage/status new file mode 100644 index 0000000..86981e6 --- /dev/null +++ b/root/etc/e-smith/db/configuration/defaults/opensondage/status @@ -0,0 +1 @@ +enabled diff --git a/root/etc/e-smith/db/configuration/defaults/opensondage/type b/root/etc/e-smith/db/configuration/defaults/opensondage/type new file mode 100644 index 0000000..1b93c9e --- /dev/null +++ b/root/etc/e-smith/db/configuration/defaults/opensondage/type @@ -0,0 +1 @@ +webapp diff --git a/root/etc/e-smith/db/configuration/migrate/opensondage-database b/root/etc/e-smith/db/configuration/migrate/opensondage-database new file mode 100644 index 0000000..0214965 --- /dev/null +++ b/root/etc/e-smith/db/configuration/migrate/opensondage-database @@ -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); + } +} diff --git a/root/etc/e-smith/templates.metadata/etc/e-smith/sql/init/opensondage b/root/etc/e-smith/templates.metadata/etc/e-smith/sql/init/opensondage new file mode 100644 index 0000000..940dcf3 --- /dev/null +++ b/root/etc/e-smith/templates.metadata/etc/e-smith/sql/init/opensondage @@ -0,0 +1 @@ +PERMS=0750 diff --git a/root/etc/e-smith/templates/etc/e-smith/sql/init/opensondage b/root/etc/e-smith/templates/etc/e-smith/sql/init/opensondage new file mode 100644 index 0000000..81f22e7 --- /dev/null +++ b/root/etc/e-smith/templates/etc/e-smith/sql/init/opensondage @@ -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 < + 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 + + Deny from all + + + + Deny from all + + +END +} +else{ + $OUT .= "# OpenSondage is disabled\n"; +} +} diff --git a/root/etc/e-smith/templates/etc/opensondage/variables.php/10Url b/root/etc/e-smith/templates/etc/opensondage/variables.php/10Url new file mode 100644 index 0000000..719b65f --- /dev/null +++ b/root/etc/e-smith/templates/etc/opensondage/variables.php/10Url @@ -0,0 +1 @@ +define('STUDS_URL', '{$SystemName.$DomainName}'); diff --git a/root/etc/e-smith/templates/etc/opensondage/variables.php/15Name b/root/etc/e-smith/templates/etc/opensondage/variables.php/15Name new file mode 100644 index 0000000..b30393a --- /dev/null +++ b/root/etc/e-smith/templates/etc/opensondage/variables.php/15Name @@ -0,0 +1 @@ +define('NOMAPPLICATION', "{$opensondage{'Name'} || 'OpenSondage'}"); diff --git a/root/etc/e-smith/templates/etc/opensondage/variables.php/20Email b/root/etc/e-smith/templates/etc/opensondage/variables.php/20Email new file mode 100644 index 0000000..a8c757b --- /dev/null +++ b/root/etc/e-smith/templates/etc/opensondage/variables.php/20Email @@ -0,0 +1 @@ +define('ADRESSEMAILADMIN', 'admin@{$DomainName}'); diff --git a/root/etc/e-smith/templates/etc/opensondage/variables.php/25Database b/root/etc/e-smith/templates/etc/opensondage/variables.php/25Database new file mode 100644 index 0000000..8b27cde --- /dev/null +++ b/root/etc/e-smith/templates/etc/opensondage/variables.php/25Database @@ -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'); diff --git a/root/etc/e-smith/templates/etc/opensondage/variables.php/30Lang b/root/etc/e-smith/templates/etc/opensondage/variables.php/30Lang new file mode 100644 index 0000000..0b73e8e --- /dev/null +++ b/root/etc/e-smith/templates/etc/opensondage/variables.php/30Lang @@ -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');"; +} diff --git a/root/etc/e-smith/templates/etc/opensondage/variables.php/35Logo b/root/etc/e-smith/templates/etc/opensondage/variables.php/35Logo new file mode 100644 index 0000000..abb9c80 --- /dev/null +++ b/root/etc/e-smith/templates/etc/opensondage/variables.php/35Logo @@ -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'}'); diff --git a/root/etc/e-smith/templates/etc/opensondage/variables.php/40Rewrite b/root/etc/e-smith/templates/etc/opensondage/variables.php/40Rewrite new file mode 100644 index 0000000..b848521 --- /dev/null +++ b/root/etc/e-smith/templates/etc/opensondage/variables.php/40Rewrite @@ -0,0 +1 @@ +define('URL_PROPRE', false); diff --git a/root/etc/e-smith/templates/etc/opensondage/variables.php/45Google b/root/etc/e-smith/templates/etc/opensondage/variables.php/45Google new file mode 100644 index 0000000..5e46454 --- /dev/null +++ b/root/etc/e-smith/templates/etc/opensondage/variables.php/45Google @@ -0,0 +1 @@ +define('GOOGLE_ANALYTICS_ID', false); diff --git a/root/etc/e-smith/templates/etc/opensondage/variables.php/50RemoteUser b/root/etc/e-smith/templates/etc/opensondage/variables.php/50RemoteUser new file mode 100644 index 0000000..ab035b4 --- /dev/null +++ b/root/etc/e-smith/templates/etc/opensondage/variables.php/50RemoteUser @@ -0,0 +1 @@ +define('USE_REMOTE_USER', true); diff --git a/root/etc/e-smith/templates/etc/opensondage/variables.php/55Local b/root/etc/e-smith/templates/etc/opensondage/variables.php/55Local new file mode 100644 index 0000000..0672165 --- /dev/null +++ b/root/etc/e-smith/templates/etc/opensondage/variables.php/55Local @@ -0,0 +1,3 @@ +if (@file_exists('variables.local.php')) \{ + include('variables.local.php'); +\} diff --git a/root/etc/e-smith/templates/etc/opensondage/variables.php/60End b/root/etc/e-smith/templates/etc/opensondage/variables.php/60End new file mode 100644 index 0000000..f64584d --- /dev/null +++ b/root/etc/e-smith/templates/etc/opensondage/variables.php/60End @@ -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' ); diff --git a/smeserver-opensondage.spec b/smeserver-opensondage.spec new file mode 100644 index 0000000..df93d67 --- /dev/null +++ b/smeserver-opensondage.spec @@ -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 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 +