initial import
This commit is contained in:
69
vsftpd/PKGBUILD
Normal file
69
vsftpd/PKGBUILD
Normal file
@@ -0,0 +1,69 @@
|
||||
# Maintainer: Jesus E. <heckyel@riseup.net>
|
||||
|
||||
pkgname=vsftpd
|
||||
pkgver=3.0.3
|
||||
_debver=$pkgver
|
||||
_debrel=12
|
||||
pkgrel=2
|
||||
pkgdesc="Very Secure FTP daemon"
|
||||
url='https://security.appspot.com/vsftpd.html'
|
||||
arch=('i686' 'x86_64')
|
||||
license=('GPL-2')
|
||||
depends=('glibc' 'libressl' 'libcap' 'libnsl' 'libwrap')
|
||||
makedepends=('quilt')
|
||||
optdepends=('logrotate')
|
||||
backup=("etc/vsftpd.conf"
|
||||
"etc/logrotate.d/vsftpd")
|
||||
source=(https://security.appspot.com/downloads/${pkgname}-${pkgver}.tar.gz{,.asc}
|
||||
https://deb.debian.org/debian/pool/main/v/vsftpd/vsftpd_${_debver}-${_debrel}.debian.tar.xz
|
||||
vsftpd-checkconfig.sh
|
||||
vsftpd.initd
|
||||
vsftpd.run)
|
||||
sha512sums=('5a4410a88e72ecf6f60a60a89771bcec300c9f63c2ea83b219bdf65fd9749b9853f9579f7257205b55659aefcd5dab243eba878dbbd4f0ff8532dd6e60884df7'
|
||||
'SKIP'
|
||||
'2842e6841118ad786dc693c79911929ee0f274af6b6bf1b21303bf74717d992d658f2ca6c9367a080eac104af7716bb49664226696ac601fdd7c88b483e1a531'
|
||||
'be34b1c88548dbf443e9178192e1764b90ecc7ae8261324b86854f9739b0e0b1a65a42f626ccfd5bc2068df7c03f08278cdb6fb91c9b0782200153ffac83e718'
|
||||
'3f0b7191834ff5a2d847fe62c99b5e1773182a3dde263003e0fe4a7b3d958bcedd43a81a73354cd118e6d95f26eccfd20c51767e5ede594cc3070e933e6a31b3'
|
||||
'491a54975310ee21bb835e7500d320307b409ab22de1a589b468c93f6ee34dcc45d1f5e912c5c64501cffa0f4e34c4de85db782403d24e847f302fabba1c3281')
|
||||
validpgpkeys=('8660FD3291B184CDBC2F6418AA62EC463C0E751C') # Chris Evans
|
||||
|
||||
prepare() {
|
||||
cd ${pkgname}-${pkgver}
|
||||
if [[ ${pkgver%.*} = ${_debver%.*} ]]; then
|
||||
# Debian patches
|
||||
export QUILT_PATCHES=debian/patches
|
||||
export QUILT_REFRESH_ARGS='-p ab --no-timestamps --no-index'
|
||||
export QUILT_DIFF_ARGS='--no-timestamps'
|
||||
|
||||
mv "$srcdir"/debian .
|
||||
|
||||
quilt push -av
|
||||
fi
|
||||
}
|
||||
|
||||
build() {
|
||||
cd ${pkgname}-${pkgver}
|
||||
make LINK='' CFLAGS="${CFLAGS} ${CPPFLAGS}" LDFLAGS="${LDFLAGS}"
|
||||
}
|
||||
|
||||
package() {
|
||||
cd ${pkgname}-${pkgver}
|
||||
|
||||
install -Dm 755 ${pkgname} -t "${pkgdir}/usr/sbin"
|
||||
install -dm 755 "${pkgdir}/var/empty"
|
||||
|
||||
install -Dm 644 ${pkgname}.conf "${pkgdir}/etc/${pkgname}.conf"
|
||||
install -Dm 644 RedHat/vsftpd.log "${pkgdir}/etc/logrotate.d/${pkgname}"
|
||||
|
||||
install -Dm 644 ${pkgname}.8 -t "${pkgdir}/usr/share/man/man8"
|
||||
install -Dm 644 ${pkgname}.conf.5 -t "${pkgdir}/usr/share/man/man5"
|
||||
install -Dm 644 BENCHMARKS BUGS Changelog FAQ INSTALL README README.ssl REFS \
|
||||
REWARD SPEED TODO TUNING -t "${pkgdir}/usr/share/doc/${pkgname}"
|
||||
|
||||
# services install
|
||||
install -Dm755 "${srcdir}"/${pkgname}-checkconfig.sh -t "${pkgdir}"/usr/libexec/
|
||||
install -Dm755 "${srcdir}"/${pkgname}.initd "${pkgdir}"/etc/init.d/$pkgname
|
||||
install -Dm755 "${srcdir}"/${pkgname}.run "${pkgdir}"/etc/sv/$pkgname/run
|
||||
|
||||
install -Dm644 COPYING -t "${pkgdir}/usr/share/licenses/$pkgname"
|
||||
}
|
||||
29
vsftpd/vsftpd-checkconfig.sh
Normal file
29
vsftpd/vsftpd-checkconfig.sh
Normal file
@@ -0,0 +1,29 @@
|
||||
#!/bin/sh
|
||||
|
||||
VSFTPD_CONF="${VSFTPD_CONF:-/etc/vsftpd.conf}"
|
||||
|
||||
if [ ! -e ${VSFTPD_CONF} ] ; then
|
||||
echo "Please setup ${VSFTPD_CONF} before starting vsftpd" >&2
|
||||
echo "There are sample configurations in /usr/share/doc/vsftpd" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if egrep -iq "^ *background *= *yes" "${VSFTPD_CONF}" ; then
|
||||
echo "${VSFTPD_CONF} must not set background=YES" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
has_ip=false has_ipv6=false ip_error=true
|
||||
egrep -iq "^ *listen *= *yes" "${VSFTPD_CONF}" && has_ip=true
|
||||
egrep -iq "^ *listen_ipv6 *= *yes" "${VSFTPD_CONF}" && has_ipv6=true
|
||||
if ${has_ip} && ! ${has_ipv6} ; then
|
||||
ip_error=false
|
||||
elif ! ${has_ip} && ${has_ipv6} ; then
|
||||
ip_error=false
|
||||
fi
|
||||
if ${ip_error} ; then
|
||||
echo "${VSFTPD_CONF} must contain listen=YES or listen_ipv6=YES" >&2
|
||||
echo "but not both" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
50
vsftpd/vsftpd.initd
Normal file
50
vsftpd/vsftpd.initd
Normal file
@@ -0,0 +1,50 @@
|
||||
#!/sbin/openrc-run
|
||||
# Copyright 1999-2015 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License, v2
|
||||
|
||||
VSFTPD_NAME=${SVCNAME##*.}
|
||||
if [ -n "${VSFTPD_NAME}" -a "${SVCNAME}" != "vsftpd" ]; then
|
||||
VSFTPD_PID="/var/run/vsftpd.${VSFTPD_NAME}.pid"
|
||||
VSFTPD_CONF_DEFAULT="/etc/${VSFTPD_NAME}.conf"
|
||||
else
|
||||
VSFTPD_PID="/var/run/vsftpd.pid"
|
||||
VSFTPD_CONF_DEFAULT="/etc/vsftpd.conf"
|
||||
fi
|
||||
VSFTPD_CONF=${VSFTPD_CONF:-${VSFTPD_CONF_DEFAULT}}
|
||||
VSFTPD_EXEC=${VSFTPD_EXEC:-/usr/sbin/vsftpd}
|
||||
|
||||
depend() {
|
||||
need net
|
||||
use dns logger
|
||||
}
|
||||
|
||||
checkconfig() {
|
||||
VSFTPD_CONF="${VSFTPD_CONF}" \
|
||||
/usr/libexec/vsftpd-checkconfig.sh || return 1
|
||||
}
|
||||
|
||||
start() {
|
||||
checkconfig || return 1
|
||||
ebegin "Starting ${SVCNAME}"
|
||||
start-stop-daemon --start --exec ${VSFTPD_EXEC} \
|
||||
--background --make-pidfile --pidfile "${VSFTPD_PID}" \
|
||||
-- "${VSFTPD_CONF}"
|
||||
eend $?
|
||||
}
|
||||
|
||||
stop() {
|
||||
ebegin "Stopping ${SVCNAME}"
|
||||
local retval=0
|
||||
if [ -f ${VSFTPD_PID} ]; then
|
||||
start-stop-daemon --stop --pidfile ${VSFTPD_PID} || retval=1
|
||||
pkill --full ${VSFTPD_CONF}
|
||||
else
|
||||
ewarn "Couldn't find ${VSFTPD_PID} trying to stop using the config filename ${VSFTPD_CONF}"
|
||||
pgrep --full ${VSFTPD_CONF} > ${VSFTPD_PID}
|
||||
start-stop-daemon --stop --pidfile ${VSFTPD_PID} || retval=1
|
||||
pkill --full ${VSFTPD_CONF}
|
||||
fi
|
||||
eend ${retval}
|
||||
}
|
||||
|
||||
# vim: ts=4
|
||||
2
vsftpd/vsftpd.run
Normal file
2
vsftpd/vsftpd.run
Normal file
@@ -0,0 +1,2 @@
|
||||
#!/bin/sh
|
||||
exec /usr/sbin/vsftpd -obackground=no
|
||||
Reference in New Issue
Block a user