diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2011-03-31 12:25:20 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2011-03-31 12:26:10 +0000 |
commit | ea6f37407162790ebc283d23bf7edb2812aea647 (patch) | |
tree | cafc40c381432cc681b080a383821105efbfedbf /testing/pure-ftpd | |
parent | 7faef200060e1a0e2f098a349bf6c1ea9a7dcb5d (diff) | |
download | aports-ea6f37407162790ebc283d23bf7edb2812aea647.tar.bz2 aports-ea6f37407162790ebc283d23bf7edb2812aea647.tar.xz |
testing/pure-ftpd: rename dir and use gentoo init.d scripts
Diffstat (limited to 'testing/pure-ftpd')
-rw-r--r-- | testing/pure-ftpd/APKBUILD | 53 | ||||
-rw-r--r-- | testing/pure-ftpd/pure-ftpd.confd | 93 | ||||
-rw-r--r-- | testing/pure-ftpd/pure-ftpd.initd | 71 |
3 files changed, 217 insertions, 0 deletions
diff --git a/testing/pure-ftpd/APKBUILD b/testing/pure-ftpd/APKBUILD new file mode 100644 index 0000000000..acf12a77da --- /dev/null +++ b/testing/pure-ftpd/APKBUILD @@ -0,0 +1,53 @@ +# Contributor: Douglas Haber <me@douglashaber.com> +# Maintainer: Natanael Copa <ncopa@alpinelinux.org> +pkgname=pure-ftpd +pkgver=1.0.30 +pkgrel=2 +pkgdesc="Pure FTPD FTP daemon" +url="http://pureftpd.org" +arch="all" +license="GPL" +depends= +depends_dev= +makedepends="$depends_dev" +install="" +subpackages="" +source="http://download.pureftpd.org/pub/pure-ftpd/releases/$pkgname-$pkgver.tar.gz + pure-ftpd.initd + pure-ftpd.confd" + +_builddir="src/$pkgname-$pkgver" +prepare() { + local i + cd "$_builddir" + for i in $source; do + case $i in + *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;; + esac + done +} + +build() { + cd "$_builddir" + ./configure --prefix=/usr \ + --without-humor \ + --without-unicode \ + --with-minimal \ + --with-throttling \ + || return 1 + make || return 1 +} + +package() { + cd "$_builddir" + make DESTDIR="$pkgdir" install || return 1 + install -m755 -D ../$pkgname.initd \ + "$pkgdir"/etc/init.d/$pkgname || return 1 + + install -m644 -D ../$pkgname.confd \ + "$pkgdir"/etc/conf.d/$pkgname || return 1 +} + +md5sums="29e2a68e756d09f4aff8f4f76435b020 pure-ftpd-1.0.30.tar.gz +4805788f4aeeb4efee64ddad0b526c3c pure-ftpd.initd +5f1d2a2d353fc00bc39efa0ae6f1955f pure-ftpd.confd" diff --git a/testing/pure-ftpd/pure-ftpd.confd b/testing/pure-ftpd/pure-ftpd.confd new file mode 100644 index 0000000000..f14cb0b19c --- /dev/null +++ b/testing/pure-ftpd/pure-ftpd.confd @@ -0,0 +1,93 @@ +# Config file for /etc/init.d/pure-ftpd +##Comment variables out to disable its features, or change the values in it... ## + +## This variable must be uncommented in order for the server to start ## +#IS_CONFIGURED="yes" + +## FTP Server,Port (separated by comma) ## +## If you prefer host names over IP addresses, it's your choice: +## SERVER="-S ftp.rtchat.com,21" +## IPv6 addresses are supported. +## !!! WARNING !!! +## Using an invalid IP will result in the server not starting, +## but reporting a correct start! +## SERVER="-S 192.168.0.1,21" +## By default binds to all available IPs. +SERVER="-S 21" + +## Number of simultaneous connections in total, and per IP ## +MAX_CONN="-c 30" +MAX_CONN_IP="-C 10" + +## Start daemonized in background ## +DAEMON="-B" + +## Don't allow uploads if the partition is more full then this var ## +DISK_FULL="-k 90%" + +## If your FTP server is behind a NAT box, uncomment this ## +#USE_NAT="-N" + +## Authentication mechanisms (others are 'pam', ...) ## +## Further infos can be found in the README file. +AUTH="-l unix" + +## Change the maximum idle time (in minutes) ## +## If this variable is not defined, it will default to 15 minutes. +#TIMEOUT="-I <timeout>'" + +## Facility used for syslog logging ## +## If this variable is not defined, it will default to the 'ftp' facility. +## Logging can be disabled with '-f none'. +#LOG="-f <facility>" + +## Charset conversion support *experimental* ## +## Only works if USE "charconv" is enabled (only Pure-FTPd >=1.0.21). +## Set the charset of the filesystem. +# CHARCONV="--fscharset <charset>" + +## If you want to process each file uploaded through Pure-FTPd, enter the name +## of the script that should process the files below. +## man pure-uploadscript to learn more about how to write this script. +# UPLOADSCRIPT="/path/to/uploadscript" + +## Misc. Others ## +MISC_OTHER="-A -x -j -R -Z" + +# +# Use these inside $MISC_OTHER +# More can be found on "http://download.pureftpd.org/pub/pure-ftpd/doc/README" +# +# -A [ chroot() everyone, but root ] +# -e [ Only allow anonymous users ] +# -E [ Only allow authenticated users. Anonymous logins are prohibited. ] +# -i [ Disallow upload for anonymous users, whatever directory perms are ] +# -j [ If the home directory of a user doesn't exist, auto-create it ] +# -M [ Allow anonymous users to create directories. ] +# -R [ Disallow users (even non-anonymous ones) usage of the CHMOD command ] +# -x [ In normal operation mode, authenticated users can read/write +# files beginning with a dot ('.'). Anonymous users can't, for security reasons +# (like changing banners or a forgotten .rhosts). When '-x' is used, authenticated +# users can download dot-files, but not overwrite/create them, even if they own +# them. ] +# -X [ This flag is identical to the previous one (writing +# dot-files is prohibited), but in addition, users can't even *read* files and +# directories beginning with a dot (like "cd .ssh"). ] +# -D [ List files beginning with a dot ('.') even when the client doesn't +# append the '-a' option to the list command. A workaround for badly +# configured FTP clients. ] +# -G [ Disallow renaming. ] +# -d [ Send various debugging messages to the syslog. ONLY for DEBUG ] +# -F <fortune file> [ Display a fortune cookie on login. Check the README file ] +# -H [ By default, fully-qualified host names are logged. The '-H' flag avoids host names resolution. ] + + +# Some filesystems don't like accesses being memory mapped. This happens for +# example with ftpwho on JFFS2 filesystems (bug #330563). If you happen to +# have such a filesystem on /var set TMPFS_MOUNT to "true". +TMPFS_MOUNT="false" + +# Special mount options (like nosuid or nodev) for the tmpfs mount can be added +# here. Several options must be separated by comma: "nodev,nosuid" +#TMPFS_OPTS="" + diff --git a/testing/pure-ftpd/pure-ftpd.initd b/testing/pure-ftpd/pure-ftpd.initd new file mode 100644 index 0000000000..768c565efd --- /dev/null +++ b/testing/pure-ftpd/pure-ftpd.initd @@ -0,0 +1,71 @@ +#!/sbin/runscript +# Copyright 1999-2010 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-ftp/pure-ftpd/files/pure-ftpd.rc10,v 1.1 2010/08/19 08:07:13 polynomial-c Exp $ + +ftpd_pidfile="/var/run/pure-ftpd.pid" +script_pidfile="/var/run/pure-uploadscript.pid" +ftpd_rundir="/var/lib/run/pure-ftpd" + +depend() { + need net +} + +checkconfig() { + if [ -z "$IS_CONFIGURED" ] ; then + eerror "You need to setup /etc/conf.d/pure-ftpd first!" + return 1 + fi +} + +start() { + checkconfig || return 1 + + if ${TMPFS_MOUNT:-false} && grep -q tmpfs /proc/filesystems ; then + [ -n "${TMPFS_OPTS}" ] && MOUNT_OPTS="-o ${TMPFS_OPTS}" + einfo "Mounting tmpfs on ${ftpd_rundir}" + mount ${MOUNT_OPTS} -t tmpfs tmpfs ${ftpd_rundir} \ + || eerror "Unable to mount tmpfs" + fi + + # only works with openrc + WAIT="" + if [ -f /etc/init.d/sysfs ]; then + WAIT="--wait 100" + fi + + UPSCRIPT="" + OKNODO="" + if [ -n "$UPLOADSCRIPT" ] ; then + UPSCRIPT="--uploadscript" + OKNODO="--oknodo" + fi + ebegin "Starting Pure-FTPd" + start-stop-daemon --start --quiet --pidfile ${ftpd_pidfile} $OKNODO --exec /usr/sbin/pure-ftpd ${WAIT} -- --pidfile ${ftpd_pidfile} $SERVER $MAX_CONN $MAX_CONN_IP $DAEMON $DISK_FULL $USE_NAT $AUTH $LOG $TIMEOUT $CHARCONV $MISC_OTHER $UPSCRIPT + result=$? + if [ $result -ne 0 ] ; then + eend 1 "Could not launch Pure-FTPd" + else + eend $result + if [ -n "$UPLOADSCRIPT" ] ; then + ebegin "Starting Pure-FTPd upload script" + start-stop-daemon --start --quiet --make-pidfile --pidfile ${script_pidfile} --exec /usr/sbin/pure-uploadscript --background ${WAIT} -- -r $UPLOADSCRIPT + eend $? + fi + fi +} + +stop() { + ebegin "Stopping Pure-FTPd" + start-stop-daemon --stop --retry 20 --quiet --pidfile ${ftpd_pidfile} + eend $? + if [ -n "$UPLOADSCRIPT" ] ; then + ebegin "Stopping Pure-FTPd upload script" + start-stop-daemon --stop --retry 20 --quiet --pidfile ${script_pidfile} + eend $? + fi + + if ${TMPFS_MOUNT:-false} && mount | grep -q ${ftpd_rundir} ; then + umount ${ftpd_rundir} >/dev/null 2>&1 + fi +} |