summaryrefslogtreecommitdiffstats
path: root/rules/proftpd.make
blob: 1f508a2652673c7d3b66ca763e45ff0ee8d4b1c6 (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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
# -*-makefile-*-
# $Id$
#
# Copyright (C) 2002, 2003 by Pengutronix e.K., Hildesheim, Germany
#
# See CREDITS for details about who has contributed to this project.
#
# For further information about the PTXdist project and license conditions
# see the README file.
#

#
# We provide this package
#
PACKAGES-$(PTXCONF_PROFTPD) += proftpd

#
# Paths and names
#
PROFTPD_VERSION		= 1.3.0rc1
PROFTPD			= proftpd-$(PROFTPD_VERSION)
PROFTPD_SUFFIX		= tar.gz
PROFTPD_URL		= ftp://ftp.proftpd.org/distrib/source/proftpd-$(PROFTPD_VERSION).$(PROFTPD_SUFFIX)
PROFTPD_SOURCE		= $(SRCDIR)/$(PROFTPD).$(PROFTPD_SUFFIX)
PROFTPD_DIR		= $(BUILDDIR)/$(PROFTPD)


# ----------------------------------------------------------------------------
# Get
# ----------------------------------------------------------------------------

proftpd_get: $(STATEDIR)/proftpd.get

$(STATEDIR)/proftpd.get: $(proftpd_get_deps_default)
	@$(call targetinfo, $@)
	@$(call touch, $@)

$(PROFTPD_SOURCE):
	@$(call targetinfo, $@)
	@$(call get, PROFTPD)

# ----------------------------------------------------------------------------
# Extract
# ----------------------------------------------------------------------------

proftpd_extract: $(STATEDIR)/proftpd.extract

$(STATEDIR)/proftpd.extract: $(proftpd_extract_deps_default)
	@$(call targetinfo, $@)
	@$(call clean, $(PROFTPD_DIR))
	@$(call extract, PROFTPD)
	@$(call patchin, PROFTPD)
	@$(call touch, $@)

# ----------------------------------------------------------------------------
# Prepare
# ----------------------------------------------------------------------------

proftpd_prepare: $(STATEDIR)/proftpd.prepare

PROFTPD_AUTOCONF	=  $(CROSS_AUTOCONF_USR)
PROFTPD_AUTOCONF	+= --sysconfdir=/etc

PROFTPD_PATH		=  PATH=$(CROSS_PATH)
PROFTPD_ENV		=  $(CROSS_ENV) ac_cv_func_setgrent_void=yes
ifndef NATIVE
PROFTPD_MAKEVARS	=  $(CROSS_ENV_CC)
endif

ifdef PTXCONF_PROFTPD_PAM
PROFTPD_AUTOCONF += --enable-pam
else
PROFTPD_AUTOCONF += --disable-pam
endif
ifdef PTXCONF_PROFTPD_SENDFILE
PROFTPD_AUTOCONF += --enable-sendfile
else
PROFTPD_AUTOCONF += --disable-sendfile
endif
ifdef PTXCONF_PROFTPD_SHADOW
PROFTPD_AUTOCONF += --enable-shadow
else
PROFTPD_AUTOCONF += --disable-shadow
endif
ifdef PTXCONF_PROFTPD_AUTOSHADOW
PROFTPD_AUTOCONF += --enable-autoshadow
else
PROFTPD_AUTOCONF += --disable-autoshadow
endif

proftpd_extract_deps = \
	$(STATEDIR)/virtual-xchain.install \
	$(STATEDIR)/proftpd.extract

$(STATEDIR)/proftpd.prepare: $(proftpd_prepare_deps_default)
	@$(call targetinfo, $@)
	cd $(PROFTPD_DIR) && \
		$(PROFTPD_PATH) $(PROFTPD_ENV) \
		./configure $(PROFTPD_AUTOCONF)
	@$(call touch, $@)

# ----------------------------------------------------------------------------
# Compile
# ----------------------------------------------------------------------------

proftpd_compile: $(STATEDIR)/proftpd.compile

$(STATEDIR)/proftpd.compile: $(proftpd_compile_deps_default)
	@$(call targetinfo, $@)
	cd $(PROFTPD_DIR) && $(PROFTPD_PATH) $(PROFTPD_ENV) make $(PROFTPD_MAKEVARS)
	@$(call touch, $@)

# ----------------------------------------------------------------------------
# Install
# ----------------------------------------------------------------------------

proftpd_install: $(STATEDIR)/proftpd.install

$(STATEDIR)/proftpd.install: $(proftpd_install_deps_default)
	@$(call targetinfo, $@)
	@$(call touch, $@)

# ----------------------------------------------------------------------------
# Target-Install
# ----------------------------------------------------------------------------

proftpd_targetinstall: $(STATEDIR)/proftpd.targetinstall

$(STATEDIR)/proftpd.targetinstall: $(proftpd_targetinstall_deps_default)
	@$(call targetinfo, $@)

	@$(call install_init, proftpd)
	@$(call install_fixup, proftpd,PACKAGE,proftpd)
	@$(call install_fixup, proftpd,PRIORITY,optional)
	@$(call install_fixup, proftpd,VERSION,$(PROFTPD_VERSION))
	@$(call install_fixup, proftpd,SECTION,base)
	@$(call install_fixup, proftpd,AUTHOR,"Robert Schwebel <r.schwebel\@pengutronix.de>")
	@$(call install_fixup, proftpd,DEPENDS,)
	@$(call install_fixup, proftpd,DESCRIPTION,missing)

	@$(call install_copy, proftpd, 0, 0, 0755, \
		$(PROFTPD_DIR)/proftpd, \
		/usr/sbin/proftpd)
	@$(call install_copy, proftpd, 0, 0, 0755, \
		$(PTXDIST_TOPDIR)/generic/etc/init.d/proftpd, \
		/etc/init.d/proftpd, n)

ifdef PTXCONF_PROFTPD_DEFAULTCONFIG
	@$(call install_copy, proftpd, 11, 101, 0644, \
		$(PTXDIST_TOPDIR)/generic/etc/proftpd.conf, \
		/etc/proftpd.conf, n)
endif

	@$(call install_finish, proftpd)

	@$(call touch, $@)

# ----------------------------------------------------------------------------
# Clean
# ----------------------------------------------------------------------------

proftpd_clean:
	rm -rf $(STATEDIR)/proftpd.* $(PROFTPD_DIR)
	rm -rf $(IMAGEDIR)/proftpd_*

# vim: syntax=make