[arch-commits] Commit in vsftpd/trunk (PKGBUILD vsftpd.d)

Guillaume Alaux guillaume at archlinux.org
Sun Jan 9 17:08:56 EST 2011


    Date: Sunday, January 9, 2011 @ 17:08:55
  Author: guillaume
Revision: 105508

Upstream release and PKGBUILD clean-up

Modified:
  vsftpd/trunk/PKGBUILD
  vsftpd/trunk/vsftpd.d

----------+
 PKGBUILD |   42 +++++++++++----------------
 vsftpd.d |   92 +++++++++++++++++++++++++++++++++++++++----------------------
 2 files changed, 78 insertions(+), 56 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2011-01-09 17:55:22 UTC (rev 105507)
+++ PKGBUILD	2011-01-09 22:08:55 UTC (rev 105508)
@@ -3,21 +3,20 @@
 # Contributor: judd <jvinet at zeroflux.org>
 
 pkgname=vsftpd
-pkgver=2.2.2
-pkgrel=3
+pkgver=2.3.2
+pkgrel=1
 pkgdesc="Very Secure FTP daemon"
 arch=('i686' 'x86_64')
 license=('GPL')
 backup=(etc/vsftpd.conf etc/xinetd.d/vsftpd)
 url="http://vsftpd.beasts.org/"
-makedepends=('vim')
-depends=('glibc' 'pam' 'tcp_wrappers' 'openssl' 'libcap')
+depends=('tcp_wrappers' 'openssl')
 install=vsftpd.install
 source=(ftp://vsftpd.beasts.org/users/cevans/vsftpd-$pkgver.tar.gz \
         vsftpd.xinetd vsftpd.d)
-md5sums=('6d6bc136af14c23f8fef6f1a51f55418'
+md5sums=('bad7b117d737a738738836041edc00db'
          'b07fd4609c70063c1d6b20142910c1a6'
-         '5cf6effd8b1603fa809eadf11bd696bd')
+         '60060a6c7db3b3b7baa1561a302e6923')
 
 build() {
   cd ${srcdir}/${pkgname}-${pkgver}
@@ -26,22 +25,17 @@
     -e 's|^#undef VSF_BUILD_TCPWRAPPERS$|#define VSF_BUILD_TCPWRAPPERS|' \
     -e 's|^#undef VSF_BUILD_SSL$|#define VSF_BUILD_SSL|' \
     -i builddefs.h
-  make CFLAGS="${CFLAGS}" || return 1
-  install -D -m755 vsftpd ${pkgdir}/usr/sbin/vsftpd || return 1
-  install -D -m644 vsftpd.conf ${pkgdir}/etc/vsftpd.conf || return 1
-  install -D -m644 vsftpd.8 ${pkgdir}/usr/share/man/man8/vsftpd.8 || return 1
-  install -D -m644 vsftpd.conf.5 ${pkgdir}/usr/share/man/man5/vsftpd.conf.5 || return 1
-  install -D -m644 ../vsftpd.xinetd ${pkgdir}/etc/xinetd.d/vsftpd  || return 1
-  install -D -m755 ../vsftpd.d ${pkgdir}/etc/rc.d/vsftpd || return 1
-  mkdir -p $startdir/pkg/usr/share/empty
-  ex ${pkgdir}/etc/vsftpd.conf <<_EOF
-2
-i
-#
-# Use this to use vsftpd in standalone mode, otherwise it runs through (x)inetd
-#listen=YES
-.
-w
-q
-_EOF
+  make CFLAGS="${CFLAGS}"
 }
+
+package() {
+  cd ${srcdir}/${pkgname}-${pkgver}
+  install -D -m755 vsftpd ${pkgdir}/usr/sbin/vsftpd
+  install -D -m644 vsftpd.conf ${pkgdir}/etc/vsftpd.conf
+  install -D -m644 vsftpd.8 ${pkgdir}/usr/share/man/man8/vsftpd.8
+  install -D -m644 vsftpd.conf.5 ${pkgdir}/usr/share/man/man5/vsftpd.conf.5
+  install -D -m644 ${srcdir}/vsftpd.xinetd ${pkgdir}/etc/xinetd.d/vsftpd
+  install -D -m755 ${srcdir}/vsftpd.d ${pkgdir}/etc/rc.d/vsftpd
+
+  install -d -m755 ${pkgdir}/usr/share/empty
+}

Modified: vsftpd.d
===================================================================
--- vsftpd.d	2011-01-09 17:55:22 UTC (rev 105507)
+++ vsftpd.d	2011-01-09 22:08:55 UTC (rev 105508)
@@ -1,39 +1,67 @@
 #!/bin/bash
 
+daemon_name=vsftpd
+
 . /etc/rc.conf
 . /etc/rc.d/functions
 
-PID=`pidof -o %PPID /usr/sbin/vsftpd`
+get_pid() {
+	pidof -o %PPID $daemon_name
+}
+
 case "$1" in
-	start)
-		stat_busy "Starting vsftpd FTP Daemon"
-		if [ -z "$PID" ]; then 
-			/usr/sbin/vsftpd &
-			if [ $? -gt 0 ]; then
-				stat_fail
-			else
-				add_daemon vsftpd
-				stat_done
-			fi
-		else
-			stat_fail
-		fi
-	;;
-	stop)
-		stat_busy "Stopping vsftpd FTP Daemon"
-		[ ! -z "$PID" ]  && kill $PID &> /dev/null
-		if [ $? -gt 0 ]; then
-			stat_fail
-		else
-			rm_daemon vsftpd
-			stat_done
-		fi
-	;;
-	restart)
-		$0 stop
-		sleep 1
-		$0 start
-	;;
-	*)
-		echo "usage: $0 {start|stop|restart}"  
+  start)
+    stat_busy "Starting $daemon_name daemon"
+
+    PID=$(get_pid)
+    if [ -z "$PID" ]; then
+      [ -f /var/run/$daemon_name.pid ] && rm -f /var/run/$daemon_name.pid
+      # RUN
+      $daemon_name &
+      #
+      if [ $? -gt 0 ]; then
+        stat_fail
+        exit 1
+      else
+        echo $(get_pid) > /var/run/$daemon_name.pid
+        add_daemon $daemon_name
+        stat_done
+      fi
+    else
+      stat_fail
+      exit 1
+    fi
+    ;;
+
+  stop)
+    stat_busy "Stopping $daemon_name daemon"
+    PID=$(get_pid)
+    # KILL
+    [ ! -z "$PID" ] && kill $PID &> /dev/null
+    #
+    if [ $? -gt 0 ]; then
+      stat_fail
+      exit 1
+    else
+      rm -f /var/run/$daemon_name.pid &> /dev/null
+      rm_daemon $daemon_name
+      stat_done
+    fi
+    ;;
+
+  restart)
+    $0 stop
+    sleep 3
+    $0 start
+    ;;
+
+  status)
+    stat_busy "Checking $daemon_name status";
+    ck_status $daemon_name
+    ;;
+
+  *)
+    echo "usage: $0 {start|stop|restart|status}"
 esac
+
+exit 0



More information about the arch-commits mailing list