First commit
This commit is contained in:
commit
a4977de824
10
createlinks
Normal file
10
createlinks
Normal file
|
@ -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");
|
1
root/etc/e-smith/db/configuration/defaults/dl/status
Normal file
1
root/etc/e-smith/db/configuration/defaults/dl/status
Normal file
|
@ -0,0 +1 @@
|
|||
enabled
|
1
root/etc/e-smith/db/configuration/defaults/dl/type
Normal file
1
root/etc/e-smith/db/configuration/defaults/dl/type
Normal file
|
@ -0,0 +1 @@
|
|||
webapp
|
3
root/etc/e-smith/templates.metadata/etc/dl.php
Normal file
3
root/etc/e-smith/templates.metadata/etc/dl.php
Normal file
|
@ -0,0 +1,3 @@
|
|||
PERMS=0640
|
||||
UID="root"
|
||||
GID="www"
|
14
root/etc/e-smith/templates/etc/dl.php/10Url
Normal file
14
root/etc/e-smith/templates/etc/dl.php/10Url
Normal file
|
@ -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'";
|
||||
}
|
1
root/etc/e-smith/templates/etc/dl.php/15From
Normal file
1
root/etc/e-smith/templates/etc/dl.php/15From
Normal file
|
@ -0,0 +1 @@
|
|||
$fromAddr = "dl <nobody@{$DomainName}>";
|
1
root/etc/e-smith/templates/etc/dl.php/20Spool
Normal file
1
root/etc/e-smith/templates/etc/dl.php/20Spool
Normal file
|
@ -0,0 +1 @@
|
|||
$spoolDir = "/var/lib/dl/";
|
5
root/etc/e-smith/templates/etc/dl.php/25Locale
Normal file
5
root/etc/e-smith/templates/etc/dl.php/25Locale
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
my $local = $sysconfig{'Language'} || 'en_US';
|
||||
$locale = (-e "/usr/share/dl/include/locale/$locale") ? "$locale":'en_US';
|
||||
$OUT .= "\$defLocale = '$locale'";
|
||||
}
|
4
root/etc/e-smith/templates/etc/dl.php/30Defaults
Normal file
4
root/etc/e-smith/templates/etc/dl.php/30Defaults
Normal file
|
@ -0,0 +1,4 @@
|
|||
$defaultTicketTotalDays = 30;
|
||||
$defaultTicketLastDlDays = 7;
|
||||
$defaultTicketMaxDl = 0;
|
||||
$defaultGrantTotalDays = 30;
|
4
root/etc/e-smith/templates/etc/dl.php/35ConfVer
Normal file
4
root/etc/e-smith/templates/etc/dl.php/35ConfVer
Normal file
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
my $ver = `rpm -q --qf %{version} dl`;
|
||||
$OUT .= "\$cfgVersion = '$ver';";
|
||||
}
|
1
root/etc/e-smith/templates/etc/dl.php/40Logs
Normal file
1
root/etc/e-smith/templates/etc/dl.php/40Logs
Normal file
|
@ -0,0 +1 @@
|
|||
$logFile = "dl_ticket";
|
1
root/etc/e-smith/templates/etc/dl.php/45Auth
Normal file
1
root/etc/e-smith/templates/etc/dl.php/45Auth
Normal file
|
@ -0,0 +1 @@
|
|||
$authRealm = "dl";
|
1
root/etc/e-smith/templates/etc/dl.php/50Database
Normal file
1
root/etc/e-smith/templates/etc/dl.php/50Database
Normal file
|
@ -0,0 +1 @@
|
|||
$dsn = "sqlite:$spoolDir/data.sql";
|
58
root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/98Dl
Normal file
58
root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/98Dl
Normal file
|
@ -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";
|
||||
}
|
||||
}
|
46
smeserver-dl.spec
Normal file
46
smeserver-dl.spec
Normal file
|
@ -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…
Reference in New Issue
Block a user