summaryrefslogtreecommitdiffstats
path: root/rules/portmap.make
blob: d16282d91d7439964d261f3ada5f2507bbd4d41b (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
# -*-makefile-*-
# $Id: portmap.make,v 1.6 2003/09/17 23:43:59 mkl Exp $
#
# (c) 2002 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
#
ifdef PTXCONF_PORTMAP
PACKAGES += portmap
endif

#
# Paths and names 
#
PORTMAP			= portmap_4
PORTMAP_URL		= ftp://ftp.porcupine.org/pub/security/$(PORTMAP).tar.gz
PORTMAP_SOURCE		= $(SRCDIR)/$(PORTMAP).tar.gz
PORTMAP_DIR		= $(BUILDDIR)/$(PORTMAP)

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

portmap_get: $(STATEDIR)/portmap.get

$(STATEDIR)/portmap.get: $(PORTMAP_SOURCE)
	@$(call targetinfo, portmap.get)
	touch $@

$(PORTMAP_SOURCE):
	@$(call targetinfo, $(PORTMAP_SOURCE))
	@$(call get, $(PORTMAP_URL))

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

portmap_extract: $(STATEDIR)/portmap.extract

$(STATEDIR)/portmap.extract: $(STATEDIR)/portmap.get
	@$(call targetinfo, portmap.extract)
	@$(call clean, $(PORTMAP_DIR))
	@$(call extract, $(PORTMAP_SOURCE))
#	apply some fixes
	@$(call disable_sh, $(PORTMAP_DIR)/Makefile, HOSTS_ACCESS)
	@$(call disable_sh, $(PORTMAP_DIR)/Makefile, CHECK_PORT)
	@$(call disable_sh, $(PORTMAP_DIR)/Makefile, AUX)
#	FIXME: uggly, make patch
	perl -i -p -e "s/const/__const/g" $(PORTMAP_DIR)/portmap.c
	touch $@

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

portmap_prepare: $(STATEDIR)/portmap.prepare

portmap_prepare_deps = \
	$(STATEDIR)/virtual-xchain.install \
	$(STATEDIR)/tcpwrapper.install \
	$(STATEDIR)/portmap.extract

$(STATEDIR)/portmap.prepare: $(portmap_prepare_deps)
	@$(call targetinfo, portmap.prepare)
	touch $@

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

portmap_compile: $(STATEDIR)/portmap.compile

PORTMAP_ENV		= $(CROSS_ENV)
PORTMAP_PATH		= PATH=$(CROSS_PATH)
PORTMAP_MAKEVARS	= WRAP_DIR=$(CROSS_LIB_DIR)/lib

$(STATEDIR)/portmap.compile: $(STATEDIR)/portmap.prepare
	@$(call targetinfo, portmap.compile)
	$(PORTMAP_ENV) $(PORTMAP_PATH) \
		make -C $(PORTMAP_DIR) $(PORTMAP_MAKEVARS)
	touch $@

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

portmap_install: $(STATEDIR)/portmap.install

$(STATEDIR)/portmap.install: $(STATEDIR)/portmap.compile
	@$(call targetinfo, portmap.install)
	touch $@

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

portmap_targetinstall: $(STATEDIR)/portmap.targetinstall

$(STATEDIR)/portmap.targetinstall: $(STATEDIR)/portmap.install
	@$(call targetinfo, portmap.targetinstall)
ifdef PTXCONF_PORTMAP_INSTALL_PORTMAPPER
	mkdir -p $(ROOTDIR)/sbin
	install $(PORTMAP_DIR)/portmap $(ROOTDIR)/sbin
	$(CROSSSTRIP) -R .notes -R .comment $(ROOTDIR)/sbin/portmap
endif
	touch $@

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

portmap_clean: 
	rm -rf $(STATEDIR)/portmap.* $(PORTMAP_DIR)

# vim: syntax=make