diff options
author | Parabola <dev@list.parabolagnulinux.org> | 2011-04-05 14:26:38 +0000 |
---|---|---|
committer | Parabola <dev@list.parabolagnulinux.org> | 2011-04-05 14:26:38 +0000 |
commit | 415856bdd4f48ab4f2732996f0bae58595092bbe (patch) | |
tree | ede2018b591f6dfb477fe9341ba17b9bc000fab9 /extra/bftpd |
Tue Apr 5 14:26:38 UTC 2011
Diffstat (limited to 'extra/bftpd')
-rw-r--r-- | extra/bftpd/PKGBUILD | 39 | ||||
-rw-r--r-- | extra/bftpd/bftpd.install | 11 | ||||
-rw-r--r-- | extra/bftpd/bftpd.logrotate | 5 | ||||
-rw-r--r-- | extra/bftpd/bftpd.pam | 3 | ||||
-rwxr-xr-x | extra/bftpd/bftpd.rc | 44 |
5 files changed, 102 insertions, 0 deletions
diff --git a/extra/bftpd/PKGBUILD b/extra/bftpd/PKGBUILD new file mode 100644 index 000000000..fb9c4aa1a --- /dev/null +++ b/extra/bftpd/PKGBUILD @@ -0,0 +1,39 @@ +# $Id: PKGBUILD 95186 2010-10-16 23:03:07Z thomas $ +# Maintainer: Thomas Baechler <thomas@archlinux.org> + +pkgname=bftpd +pkgver=3.1 +pkgrel=1 +pkgdesc="Small, easy-to-configure FTP server" +arch=(i686 x86_64) +url="http://bftpd.sourceforge.net/" +license=('GPL') +depends=('glibc' 'pam') +install=bftpd.install +backup=(etc/bftpd.conf etc/logrotate.d/bftpd etc/pam.d/bftpd) +source=(http://downloads.sourceforge.net/sourceforge/bftpd/bftpd-$pkgver.tar.gz + bftpd.rc bftpd.logrotate bftpd.pam) +md5sums=('1aeda6f3da2b10dcf5dca1b1d8466c48' + '56a1bf7738a6db2b2cff89e611f4f11a' + '853680dad0df39d0b4d2fb43d4be430a' + '96f82c38f3f540b53f3e5144900acf17') + +build() { + cd ${srcdir}/$pkgname + ./configure --prefix=/usr --enable-pam --mandir=/usr/share/man + make || return 1 +} + +package() { + cd ${srcdir}/$pkgname + install -d -m755 ${pkgdir}/usr/{sbin,share/man/man8} + install -d -m755 ${pkgdir}/var/run/bftpd + install -d -m755 ${pkgdir}/var/log + install -D -m644 ${srcdir}/bftpd.logrotate ${pkgdir}/etc/logrotate.d/bftpd || return 1 + install -D -m755 ${srcdir}/bftpd.rc ${pkgdir}/etc/rc.d/bftpd || return 1 + make DESTDIR=${pkgdir} install || return 1 + rm -f ${pkgdir}/var/log/bftpd.log + rmdir ${pkgdir}/var/log + mkdir -p ${pkgdir}/etc/pam.d + cp ${srcdir}/bftpd.pam ${pkgdir}/etc/pam.d/bftpd || return 1 +} diff --git a/extra/bftpd/bftpd.install b/extra/bftpd/bftpd.install new file mode 100644 index 000000000..25ebfa58b --- /dev/null +++ b/extra/bftpd/bftpd.install @@ -0,0 +1,11 @@ +# arg 1: the new package version +# arg 2: the old package version + +post_install () { + [ ! -f /var/log/bftpd.log ] && touch /var/log/bftpd.log + true +} + +post_upgrade() { + post_install $1 +} diff --git a/extra/bftpd/bftpd.logrotate b/extra/bftpd/bftpd.logrotate new file mode 100644 index 000000000..c0f0b3393 --- /dev/null +++ b/extra/bftpd/bftpd.logrotate @@ -0,0 +1,5 @@ +/var/log/bftpd.log { + missingok + notifempty + delaycompress +} diff --git a/extra/bftpd/bftpd.pam b/extra/bftpd/bftpd.pam new file mode 100644 index 000000000..53724d1f8 --- /dev/null +++ b/extra/bftpd/bftpd.pam @@ -0,0 +1,3 @@ +auth required pam_unix.so +account required pam_unix.so +session required pam_unix.so diff --git a/extra/bftpd/bftpd.rc b/extra/bftpd/bftpd.rc new file mode 100755 index 000000000..2f31cf50c --- /dev/null +++ b/extra/bftpd/bftpd.rc @@ -0,0 +1,44 @@ +#!/bin/bash + +. /etc/rc.conf +. /etc/rc.d/functions + +PIDFILE="/var/run/bftpd.pid" + +case "$1" in + start) + stat_busy "Starting bftpd Server" + PID="$(pidof -o %PPID /usr/sbin/bftpd)" + if [ -z "$PID" ]; then + /usr/sbin/bftpd -d + if [ $? -gt 0 ]; then + stat_fail + else + # wait until it forks + sleep 2 + echo $(pidof -o %PPID /usr/sbin/bftpd) > $PIDFILE + add_daemon bftpd + stat_done + fi + else + stat_fail + fi + ;; + stop) + stat_busy "Stopping bftpd Server" + if [ -f $PIDFILE ] && kill -0 $(cat $PIDFILE); then + kill -15 $(cat $PIDFILE) + rm $PIDFILE + stat_done + else + stat_fail + fi + ;; + restart) + $0 stop + sleep 1 + $0 start + ;; + *) + echo "usage: $0 {start|stop|restart}" +esac |