summaryrefslogtreecommitdiff
path: root/extra/bftpd/PKGBUILD
blob: 5d3424581b62feda7a65ff88936b7129f5b02d2d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# $Id: PKGBUILD 123903 2011-05-14 09:54:29Z thomas $
# Maintainer: Thomas Baechler <thomas@archlinux.org>

pkgname=bftpd
pkgver=3.4
pkgrel=1
pkgdesc="Small, easy-to-configure FTP server"
arch=(i686 x86_64 'mips64el')
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
        etc/xinetd.d/bftpd)
source=(http://downloads.sourceforge.net/sourceforge/bftpd/bftpd-$pkgver.tar.gz
        bftpd.rc
        bftpd.logrotate
        bftpd.pam
        bftpd.xinetd)
md5sums=('dcee04b5fad8c918e86c49712424fcdd'
         '56a1bf7738a6db2b2cff89e611f4f11a'
         '853680dad0df39d0b4d2fb43d4be430a'
         '96f82c38f3f540b53f3e5144900acf17'
         'ff70fd962666f4d74749a1c68167a966')

build() {
  cd "${srcdir}"/$pkgname
  # The bftpd author keeps screwing up the release tarballs
  rm -f config.{cache,status}
  ./configure --prefix=/usr --enable-pam --mandir=/usr/share/man
  make
}

package() {
  cd "${srcdir}"/$pkgname
  install -d -m755 "${pkgdir}"/usr/{sbin,share/man/man8}
  install -d -m755 "${pkgdir}"/var/log
  install -D -m644 "${srcdir}"/bftpd.logrotate "${pkgdir}"/etc/logrotate.d/bftpd
  install -D -m755 "${srcdir}"/bftpd.rc "${pkgdir}"/etc/rc.d/bftpd
  make DESTDIR="${pkgdir}" install
  # Remove log file and /var/run from the package
  rm -f "${pkgdir}"/var/log/bftpd.log
  rmdir "${pkgdir}"/var/{run/bftpd,run,log,}
  # Install PAM file
  mkdir -p "${pkgdir}"/etc/pam.d
  cp "${srcdir}"/bftpd.pam "${pkgdir}"/etc/pam.d/bftpd
  # Install xinetd file
  install -D -m644 "${srcdir}"/bftpd.xinetd "${pkgdir}"/etc/xinetd.d/bftpd
  # Fix default in config file
  sed 's|#ROOTDIR="/path/for/anonymous/user"|# bftpd interprets ROOTDIR="%h" (the default), as ROOTDIR="/" for the anonymous user, override it\n  ROOTDIR="/srv/ftp"|' -i "${pkgdir}"/etc/bftpd.conf
}