First commit

tags/smeserver-dl-0.2.1-1
Daniel Berteaud 11 years ago
commit a4977de824
  1. 10
      createlinks
  2. 1
      root/etc/e-smith/db/configuration/defaults/dl/status
  3. 1
      root/etc/e-smith/db/configuration/defaults/dl/type
  4. 3
      root/etc/e-smith/templates.metadata/etc/dl.php
  5. 14
      root/etc/e-smith/templates/etc/dl.php/10Url
  6. 1
      root/etc/e-smith/templates/etc/dl.php/15From
  7. 1
      root/etc/e-smith/templates/etc/dl.php/20Spool
  8. 5
      root/etc/e-smith/templates/etc/dl.php/25Locale
  9. 4
      root/etc/e-smith/templates/etc/dl.php/30Defaults
  10. 4
      root/etc/e-smith/templates/etc/dl.php/35ConfVer
  11. 1
      root/etc/e-smith/templates/etc/dl.php/40Logs
  12. 1
      root/etc/e-smith/templates/etc/dl.php/45Auth
  13. 1
      root/etc/e-smith/templates/etc/dl.php/50Database
  14. 58
      root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/98Dl
  15. 46
      smeserver-dl.spec

@ -0,0 +1,10 @@
#!/usr/bin/perl -w
use esmith::Build::CreateLinks qw(:all);
# Templates to expand
templates2events("/etc/dl.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/dl.php/template-begin");
safe_symlink("/etc/e-smith/templates-default/template-end-php", "root/etc/e-smith/templates/etc/dl.php/template-end");

@ -0,0 +1,3 @@
PERMS=0640
UID="root"
GID="www"

@ -0,0 +1,14 @@
{
use esmith::DomainsDB;
my $d = esmith::DomainsDB->open_ro || die "Couldn't open DomainsDB";
my $vhost = "$SystemName.$DomainName/dl";
foreach ($d->get_all_by_prop(type => 'domain'), $d->get_all_by_prop(type => 'vhost')){
my $root = $_->prop('DocumentRoot') || '';
if ($root eq '/usr/share/dl'){
$vhost = $_->key;
last;
}
}
$OUT .= "\$masterPath = '$vhost'";
}

@ -0,0 +1 @@
$fromAddr = "dl <nobody@{$DomainName}>";

@ -0,0 +1 @@
$spoolDir = "/var/lib/dl/";

@ -0,0 +1,5 @@
{
my $local = $sysconfig{'Language'} || 'en_US';
$locale = (-e "/usr/share/dl/include/locale/$locale") ? "$locale":'en_US';
$OUT .= "\$defLocale = '$locale'";
}

@ -0,0 +1,4 @@
$defaultTicketTotalDays = 30;
$defaultTicketLastDlDays = 7;
$defaultTicketMaxDl = 0;
$defaultGrantTotalDays = 30;

@ -0,0 +1,4 @@
{
my $ver = `rpm -q --qf %{version} dl`;
$OUT .= "\$cfgVersion = '$ver';";
}

@ -0,0 +1 @@
$dsn = "sqlite:$spoolDir/data.sql";

@ -0,0 +1,58 @@
{
my $access = $dl{'access'} || 'private';
my $allow = ($access eq 'public')?'all':"$localAccess $externalSSLAccess";
my $auth = $dl{'Authentication'} || 'http';
my $alias = (($dl{'AliasOnPrimary'} || 'enabled') eq 'enabled') ?
'Alias /dl /usr/share/dl' : '';
my $authuser = '';
my $authadmin = '';
if ($auth eq 'http'){
$auth =<<'EOF';
<FilesMatch "^(admin|rest)\.php">
SSLRequireSSL on
AuthName "dl"
AuthType Basic
AuthExternal pwauth
Require valid-user
</FilesMatch>
EOF
}
if ($dl{'status'} eq 'enabled'){
$OUT .=<<"END"
# dl Configuration
$alias
<Directory /usr/share/dl>
AllowOverride Limit
AddType application/x-httpd-php .php
php_admin_value open_basedir /usr/share/dl:/etc/dl.php:/var/lib/dl
php_admin_flag file_uploads On
php_admin_flag magic_quotes Off
php_admin_flag magic_quotes_gpc Off
php_admin_value upload_max_filesize 1024M
php_admin_value post_max_size 1025M
php_admin_value memory_limit 100M
php_admin_flag output_buffering Off
php_admin_value max_execution_time 0
php_admin_value upload_tmp_dir /var/lib/dl/tmp
php_admin_value session.save_path /var/lib/dl/tmp
php_admin_value session.gc_maxlifetime 86400
order deny,allow
deny from all
allow from $allow
$authuser
</Directory>
<Directory /usr/share/dl/include>
Deny from all
</Directory>
<Directory /usr/share/dl/style/include>
Deny from all
</Directory>
END
}
else{
$OUT .= "# dl is disabled\n";
}
}

@ -0,0 +1,46 @@
%define name smeserver-dl
%define version 0.1.0
%define release 1.beta0
Summary: sme server integration of dl
Name: %{name}
Version: %{version}
Release: %{release}%{?dist}
License: GNU GPL version 2
URL: http://www.thregr.org/~wavexx/software/dl/
Group: SMEserver/addon
Source: %{name}-%{version}.tar.gz
BuildArchitectures: noarch
BuildRequires: e-smith-devtools
BuildRoot: %{_tmppath}/%{name}-%{version}
Requires: e-smith-base
Requires: dl
Requires: smeserver-webapps-common
%description
smserver integration of dl
%changelog
* Mon Nov 18 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