2 # Copyright (C) 2009-2010 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR)/rules.mk
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
15 PKG_SOURCE_URL:=ftp://ftp.proftpd.org/distrib/source
16 PKG_MD5SUM:=3951244f1940f0a40e8af142a9cf67fe
21 include $(INCLUDE_DIR)/package.mk
23 define Package/proftpd
27 TITLE:=ProFTPD FTP server
28 URL:=http://www.proftpd.org/
31 define Package/proftpd/conffiles
36 -I$(LINUX_DIR)/include
39 INSTALL_USER=$(shell id -u) \
40 INSTALL_GROUP=$(shell id -g)
46 define Package/proftpd/install
47 $(INSTALL_DIR) $(1)/etc
48 $(if $(CONFIG_IPV6),,$(SED) 's/^UseIPv6/#UseIPv6/' $(PKG_INSTALL_DIR)/etc/proftpd.conf)
49 $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/proftpd.conf $(1)/etc/
50 $(INSTALL_DIR) $(1)/etc/init.d
51 $(INSTALL_BIN) ./files/proftpd.init $(1)/etc/init.d/proftpd
52 $(INSTALL_DIR) $(1)/usr/bin
53 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ftp{count,top,who} $(1)/usr/bin/
54 $(INSTALL_DIR) $(1)/usr/sbin
55 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/{ftpshut,proftpd} $(1)/usr/sbin/
56 $(CP) $(PKG_INSTALL_DIR)/usr/sbin/in.proftpd $(1)/usr/sbin/
59 define Package/proftpd/postinst
68 # # check if we are on real system
69 if [ -z "$${IPKG_INSTROOT}" ]; then
70 # create copies of passwd and group, if we use squashfs
71 rootfs=`mount |awk '/root/ { print $$5 }'`
72 if [ "$$rootfs" = "squashfs" ]; then
73 if [ -h /etc/group ]; then
75 cp /rom/etc/group /etc/group
77 if [ -h /etc/passwd ]; then
79 cp /rom/etc/passwd /etc/passwd
85 if [ -z "$$(grep ^\\$${name}: $${IPKG_INSTROOT}/etc/group)" ]; then
86 echo "adding group $$name to /etc/group"
87 echo "$${name}:x:$${id}:" >> $${IPKG_INSTROOT}/etc/group
90 if [ -z "$$(grep ^\\$${name}: $${IPKG_INSTROOT}/etc/passwd)" ]; then
91 echo "adding user $$name to /etc/passwd"
92 echo "$${name}:x:$${id}:$${id}:$${name}:$${home}:$${shell}" >> $${IPKG_INSTROOT}/etc/passwd
96 $(eval $(call BuildPackage,proftpd))