initial commit of file from CVS for dl on Thu Oct 9 11:42:10 AEDT 2025

This commit is contained in:
Trevor Batley
2025-10-09 11:42:10 +11:00
parent 7e1838da81
commit ff989c1400
11 changed files with 12081 additions and 1 deletions

1
.gitattributes vendored Normal file
View File

@@ -0,0 +1 @@
*.zip filter=lfs diff=lfs merge=lfs -text

3
.gitignore vendored Normal file
View File

@@ -0,0 +1,3 @@
*.rpm
*.log
*spec-20*

21
Makefile Normal file
View File

@@ -0,0 +1,21 @@
# Makefile for source rpm: dl
# $Id: Makefile,v 1.1 2021/04/18 16:00:51 jpp Exp $
NAME := dl
SPECFILE = $(firstword $(wildcard *.spec))
define find-makefile-common
for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done
endef
MAKEFILE_COMMON := $(shell $(find-makefile-common))
ifeq ($(MAKEFILE_COMMON),)
# attept a checkout
define checkout-makefile-common
test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2
endef
MAKEFILE_COMMON := $(shell $(checkout-makefile-common))
endif
include $(MAKEFILE_COMMON)

View File

@@ -1,3 +1,9 @@
# dl
3rd Party (Maintained by Koozali) git repo for dl smecontribs
3rd Party (Maintained by Koozali) git repo for dl smecontribs
## Description
<br />*This description has been generated by an LLM AI system and cannot be relied on to be fully correct.*
*Once it has been checked, then this comment will be deleted*
<br />

1
contriborbase Normal file
View File

@@ -0,0 +1 @@
contribs10

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

BIN
dl-0.18.1.zip (Stored with Git LFS) Normal file

Binary file not shown.

203
dl.spec Normal file
View File

@@ -0,0 +1,203 @@
%define name dl
%define version 0.18.1
%define release 4
%define httpuser apache
%if 0%{?fedora} >= 11 || 0%{?rhel} >= 5
%global useselinux 1
%else
%global useselinux 0
%endif
Summary: Temporary file hosting
Name: %{name}
Version: %{version}
Release: %{release}%{?dist}
License: GPLv2
URL: http://www.thregr.org/~wavexx/software/dl/
Group: Applications/Internet
Source: http://www.thregr.org/~wavexx/software/dl/releases/%{name}-%{version}.zip
Source1: httpd.conf
Source2: logrotate.conf
Patch0: dl-0.18.1-pre0.19changes20210316.patch
Patch1: dl-0.18.1-add-in-help-html.patch
BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}
Requires: php >= 5.3
Requires: php-mbstring
Requires: httpd
Requires: gettext
Requires(post): sqlite
%if %{useselinux}
Requires: %{_sbindir}/semanage
%endif
BuildRequires: php-cli >= 5.3
BuildRequires: php-mbstring
BuildRequires: gettext
BuildRequires: python-docutils
%package cli
Summary: A command line client for dl
Group: Applications/Internet
Requires: python-pycurl
%description
"dl" is a file exchange service that allows you to upload any
file to a web server and generate a unique ticket for others
to download. The ticket is automatically expired according to
the specified rules, so that you don't need to keep track or
cleanup afterward. "dl" also allows you to grant an anonymous,
one-time upload for others to send you a file, without the
requirement of account management.
%description cli
A command-line client to the REST interface of dl
%prep
%setup -q -n %{name}-%{version}
%patch0 -p1
%patch1 -p1
%build
# update locales
pushd ./htdocs/include/scripts
php ./langupd.php
popd
%install
%{__rm} -rf %{buildroot}
%{__mkdir_p} %{buildroot}/%{_datadir}/%{name}/
%{__mkdir_p} %{buildroot}/%{_localstatedir}/lib/%{name}/tmp
%{__mkdir_p} %{buildroot}/%{_localstatedir}/lib/%{name}/data
%{__mkdir_p} %{buildroot}/%{_sysconfdir}/httpd/conf.d/
%{__mkdir_p} %{buildroot}/%{_sysconfdir}/logrotate.d/
%{__mkdir_p} %{buildroot}/%{_bindir}
%{__cp} -pr ./htdocs/* %{buildroot}/%{_datadir}/%{name}/
# Install conf
sed -i -e "s|/var/spool/dl/|/%{_localstatedir}/lib/%{name}|g" \
%{buildroot}/%{_datadir}/%{name}/include/config.php.dist > \
%{buildroot}/%{_sysconfdir}/%{name}.php
%{__rm} -f %{buildroot}/%{_datadir}/%{name}/include/config.php.dist
# Install apache conf
%{__install} -m 0640 %{SOURCE1} %{buildroot}/%{_sysconfdir}/httpd/conf.d/%{name}.conf
# Install logrotate conf
%{__install} -m 0640 %{SOURCE2} %{buildroot}/%{_sysconfdir}/logrotate.d/%{name}
# Install cli
%{__install} -m 0755 client/dl-cli.py %{buildroot}/%{_bindir}/%{name}-cli
%clean
rm -rf %{buildroot}
%post
%if %{useselinux}
(
# New File context
semanage fcontext -a -s system_u -t httpd_sys_script_rw_t -r s0 "%{_localstatedir}/lib/%{name}(/.*)?"
semanage fcontext -a -s system_u -t httpd_var_lib_t -r s0 "%{_sysconfdir}/%{name}.php"
semanage fcontext -a -s system_u -t httpd_sys_script_rw_t -r s0 "%{_localstatedir}/log/%{name}.log"
# files created by app
restorecon -R %{_sysconfdir}/%{name}.php
restorecon -R %{_localstatedir}/lib/%{name}
restorecon -R "%{_localstatedir}/log/%{name}.log"
) &>/dev/null || :
%endif
# Initialize database
if [ ! -e %{_localstatedir}/lib/%{name}/data.sql ]; then
cd %{_localstatedir}/lib/%{name}/
sqlite3 data.sql < %{_datadir}/%{name}/include/scripts/db/sqlite.sql
chown %{httpuser}:%{httpuser} data.sql
fi
# create log file if it doesn't exists
touch %{_localstatedir}/log/%{name}.log
chgrp %{httpuser} %{_localstatedir}/log/%{name}.log
chmod 660 %{_localstatedir}/log/%{name}.log
# Flush existing session on upgrades
%{__rm} -f %{_localstatedir}/lib/%{name}/tmp/sess_*
%postun
%if %{useselinux}
if [ "$1" -eq "0" ]; then
# Remove the File Context
(
semanage fcontext -d "%{_localstatedir}/lib/%{name}(/.*)?"
semanage fcontext -d "%{_sysconfdir}/%{name}.php"
semanage fcontext -d "%{_localstatedir}/log/%{name}.log"
) &>/dev/null || :
fi
%endif
%files
%defattr(-,root,root)
%doc AUTHORS.rst NEWS.rst README.rst RESTAPI.rst THANKS.rst COPYING.txt
#%doc AUTHORS.html NEWS.html README.html RESTAPI.html THANKS.html
%{_datadir}/%{name}
%dir %attr(770,root,%{httpuser}) %{_localstatedir}/lib/%{name}
%dir %attr(770,root,%{httpuser}) %{_localstatedir}/lib/%{name}/data
%dir %attr(770,root,%{httpuser}) %{_localstatedir}/lib/%{name}/tmp
%config(noreplace) %attr(660,root,%{httpuser}) %{_sysconfdir}/%{name}.php
%config(noreplace) %attr(660,root,root) %{_sysconfdir}/httpd/conf.d/%{name}.conf
%config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
%files cli
%defattr(-,root,root)
%{_bindir}/%{name}-cli
%changelog
* Thu Oct 09 2025 BogusDateBot
- Eliminated rpmbuild "bogus date" warnings due to inconsistent weekday,
by assuming the date is correct and changing the weekday.
* Fri Oct 01 2021 Brian Read <brianr@bjsystems.co.uk> 0.18.1-4.sme
- Add in missing help files [SME: 11565]
* Sun Apr 18 2021 Jean-Philippe Pialasse <tests@pialasse.com> 0.18.1-3.sme
- first build for SME10 [SME: 11565]
- patch with git update up to pre 0.19 release as per 20210316
- cvs admin -ko on patch
* Wed Sep 6 2017 Daniel Berteaud <daniel@firewall-services.com> 0.18.1-1
- Update to 0.18.1
* Tue Sep 5 2017 Daniel Berteaud <daniel@firewall-services.com> 0.18-1
- Update to 0.18
- Remove the clamd patch
* Sun May 29 2016 Daniel Berteaud <daniel@firewall-services.com> 0.17.1-2
- Create the data dir and grant httpd user access
* Mon May 9 2016 Daniel Berteaud <daniel@firewall-services.com> 0.17.1-1
- Update to 0.17.1
* Mon Jun 29 2015 Daniel B. <daniel@firewall-services.com> 0.17-1
- Update to 0.17
* Fri Jan 23 2015 Daniel B. <daniel@firewall-services.com> 0.16-1
- Update to 0.16
* Thu Dec 4 2014 Daniel B. <daniel@firewall-services.com> 0.15-1
- Upgrade to 0.15
* Mon Oct 20 2014 Daniel B. <daniel@firewall-services.com> 0.14-1
- Upgrade to 0.14
* Thu Jul 31 2014 Daniel B. <daniel@firewall-services.com> 0.13-1
- Upgrade to 0.13
* Wed Dec 11 2013 Daniel B. <daniel@firewall-services.com> 0.12-1
- upgrade to 0.12
* Fri Nov 22 2013 Daniel B. <daniel@firewall-services.com> 0.11-1
- First package

22
httpd.conf Normal file
View File

@@ -0,0 +1,22 @@
Alias /dl /usr/share/dl
<Directory /usr/share/dl>
Options None
AllowOverride Limit
AddType application/x-httpd-php .php
php_admin_value open_basedir /usr/share/dl:/var/lib/dl:/etc/dl.php:/var/log/dl.log
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 127.0.0.1
</Directory>

8
logrotate.conf Normal file
View File

@@ -0,0 +1,8 @@
/var/log/dl.log {
missingok
weekly
rotate 24
compress
notifempty
copytruncate
}