1f129f7210f26e269ebce1cd66eef9c25872e808
[openwrt/svn-archive/archive.git] / net / proftpd / Makefile
1 #
2 # Copyright (C) 2009-2010 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=proftpd
11 PKG_VERSION:=1.3.3d
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
15 PKG_SOURCE_URL:=ftp://ftp.proftpd.org/distrib/source
16 PKG_MD5SUM:=69650e91e05b3a10fa3ac54ee261679b
17
18 PKG_FIXUP:=libtool
19 PKG_INSTALL:=1
20
21 include $(INCLUDE_DIR)/package.mk
22
23 define Package/proftpd
24 SUBMENU:=FTP
25 SECTION:=net
26 CATEGORY:=Network
27 TITLE:=ProFTPD FTP server
28 URL:=http://www.proftpd.org/
29 MAINTAINER:=Cezary Jackiewicz <cezary@eko.one.pl>
30 endef
31
32 define Package/proftpd/conffiles
33 /etc/proftpd.conf
34 endef
35
36 TARGET_CPPFLAGS += \
37 -I$(LINUX_DIR)/include
38
39 MAKE_FLAGS += \
40 INSTALL_USER=$(shell id -u) \
41 INSTALL_GROUP=$(shell id -g)
42
43 CONFIGURE_ARGS += \
44 --disable-cap \
45 --enable-devel \
46
47 define Package/proftpd/install
48 $(INSTALL_DIR) $(1)/etc
49 $(if $(CONFIG_IPV6),,$(SED) 's/^UseIPv6/#UseIPv6/' $(PKG_INSTALL_DIR)/etc/proftpd.conf)
50 $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/proftpd.conf $(1)/etc/
51 $(INSTALL_DIR) $(1)/etc/init.d
52 $(INSTALL_BIN) ./files/proftpd.init $(1)/etc/init.d/proftpd
53 $(INSTALL_DIR) $(1)/usr/bin
54 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ftp{count,top,who} $(1)/usr/bin/
55 $(INSTALL_DIR) $(1)/usr/sbin
56 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/{ftpshut,proftpd} $(1)/usr/sbin/
57 $(CP) $(PKG_INSTALL_DIR)/usr/sbin/in.proftpd $(1)/usr/sbin/
58 endef
59
60 define Package/proftpd/postinst
61 #!/bin/sh
62
63 name=ftp
64 id=55
65 home=/home/$${name}
66 shell=/bin/ash
67
68 # do not change below
69 # # check if we are on real system
70 if [ -z "$${IPKG_INSTROOT}" ]; then
71 # create copies of passwd and group, if we use squashfs
72 rootfs=`mount |awk '/root/ { print $$5 }'`
73 if [ "$$rootfs" = "squashfs" ]; then
74 if [ -h /etc/group ]; then
75 rm /etc/group
76 cp /rom/etc/group /etc/group
77 fi
78 if [ -h /etc/passwd ]; then
79 rm /etc/passwd
80 cp /rom/etc/passwd /etc/passwd
81 fi
82 fi
83 fi
84
85 echo ""
86 if [ -z "$$(grep ^\\$${name}: $${IPKG_INSTROOT}/etc/group)" ]; then
87 echo "adding group $$name to /etc/group"
88 echo "$${name}:x:$${id}:" >> $${IPKG_INSTROOT}/etc/group
89 fi
90
91 if [ -z "$$(grep ^\\$${name}: $${IPKG_INSTROOT}/etc/passwd)" ]; then
92 echo "adding user $$name to /etc/passwd"
93 echo "$${name}:x:$${id}:$${id}:$${name}:$${home}:$${shell}" >> $${IPKG_INSTROOT}/etc/passwd
94 fi
95 endef
96
97 $(eval $(call BuildPackage,proftpd))