summaryrefslogtreecommitdiffstats
path: root/obsolete-buildroot/make/vsftpd.mk
blob: 2fa4d1acae6c88cb9a14ccbc14d209ad53f10398 (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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# vsftpd

VSFTPD_VERSION:=1.2.2
VSFTPD_RELEASE:=1

VSFTPD_SOURCE:=vsftpd-$(VSFTPD_VERSION).tar.gz
VSFTPD_SITE:=ftp://vsftpd.beasts.org/users/cevans/
VSFTPD_DIR:=$(BUILD_DIR)/vsftpd-$(VSFTPD_VERSION)
VSFTPD_CAT:=zcat

VSFTPD_PATCH_DIR := $(SOURCE_DIR)/openwrt/patches/vsftpd

VSFTPD_BUILD_DIR := $(BUILD_DIR)/vsftpd_$(VSFTPD_VERSION)-$(VSFTPD_RELEASE)
VSFTPD_IPK_DIR := $(OPENWRT_IPK_DIR)/vsftpd
VSFTPD_IPK := $(VSFTPD_BUILD_DIR)_$(ARCH).ipk


$(DL_DIR)/$(VSFTPD_SOURCE):
	 $(WGET) -P $(DL_DIR) $(VSFTPD_SITE)/$(VSFTPD_SOURCE)


$(VSFTPD_DIR)/.stamp-unpacked: $(DL_DIR)/$(VSFTPD_SOURCE)
	$(VSFTPD_CAT) $(DL_DIR)/$(VSFTPD_SOURCE) | tar -C $(BUILD_DIR) -xvf -

	touch $(VSFTPD_DIR)/.stamp-unpacked


$(VSFTPD_DIR)/.stamp-patched: $(VSFTPD_DIR)/.stamp-unpacked
	$(SOURCE_DIR)/patch-kernel.sh $(VSFTPD_DIR) $(VSFTPD_PATCH_DIR)

	touch  $(VSFTPD_DIR)/.stamp-patched


$(VSFTPD_DIR)/.stamp-built: $(VSFTPD_DIR)/.stamp-patched
	cd $(VSFTPD_DIR) ; \
	$(MAKE) \
	  $(TARGET_CONFIGURE_OPTS) \
	  CFLAGS="$(TARGET_CFLAGS)" \
	 
	touch  $(VSFTPD_DIR)/.stamp-built


$(VSFTPD_BUILD_DIR): $(VSFTPD_DIR)/.stamp-built
	mkdir -p $(VSFTPD_BUILD_DIR)

	install -m0755 -d $(VSFTPD_BUILD_DIR)/usr/sbin
	install -m0755 $(VSFTPD_DIR)/vsftpd $(VSFTPD_BUILD_DIR)/usr/sbin/

	install -m0755 -d $(VSFTPD_BUILD_DIR)/etc
	install -m0644 $(VSFTPD_IPK_DIR)/root/etc/vsftpd.conf $(VSFTPD_BUILD_DIR)/etc/
	install -m0755 -d $(VSFTPD_BUILD_DIR)/etc/init.d
	install -m0755 $(VSFTPD_IPK_DIR)/root/etc/init.d/vsftpd $(VSFTPD_BUILD_DIR)/etc/init.d/

	$(STRIP) $(VSFTPD_BUILD_DIR)/usr/sbin/*


$(VSFTPD_IPK): $(VSFTPD_BUILD_DIR)
	cp -a $(VSFTPD_IPK_DIR)/CONTROL $(VSFTPD_BUILD_DIR)/
	perl -pi -e "s/^Vers.*:.*$$/Version: $(VSFTPD_VERSION)-$(VSFTPD_RELEASE)/" $(VSFTPD_BUILD_DIR)/CONTROL/control
	perl -pi -e "s/^Arch.*:.*$$/Architecture: $(ARCH)/" $(VSFTPD_BUILD_DIR)/CONTROL/control
	cd $(BUILD_DIR); $(IPKG_BUILD) $(VSFTPD_BUILD_DIR)


vsftpd-source: $(DL_DIR)/$(VSFTPD_SOURCE)

vsftpd-ipk: ipkg-utils $(VSFTPD_IPK)

vsftpd-clean:
	rm -rf $(VSFTPD_DIR)
	rm -rf $(VSFTPD_BUILD_DIR)
	rm -rf $(VSFTPD_IPK)