summaryrefslogtreecommitdiffstats
path: root/rules/portmap.make
blob: 655e6f49593019c121c5603837bc71517a0aa790 (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
# -*-makefile-*-
# $Id$
#
# Copyright (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
#
PACKAGES-$(PTXCONF_PORTMAP) += portmap

#
# Paths and names
#
PORTMAP_VERSION := 5beta
PORTMAP		:= portmap_$(PORTMAP_VERSION)
PORTMAP_SUFFIX	:= tar.gz
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_get_deps_default)
	@$(call targetinfo, $@)
	@$(call touch, $@)

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

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

portmap_extract: $(STATEDIR)/portmap.extract

$(STATEDIR)/portmap.extract: $(portmap_extract_deps_default)
	@$(call targetinfo, $@)
	@$(call clean, $(PORTMAP_DIR))
	@$(call extract, PORTMAP)
	@$(call patchin, PORTMAP)
#
# Attention: TCP-Wrapper will be ignored and not used!
#
#ifndef PTXCONF_TCPWRAPPER
#	sed -ie 's/$$(WRAP_DIR)\/libwrap.a//' $(PORTMAP_DIR)/Makefile
#endif
	@$(call touch, $@)

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

portmap_prepare: $(STATEDIR)/portmap.prepare

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

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

portmap_compile: $(STATEDIR)/portmap.compile

PORTMAP_ENV		= $(CROSS_ENV)
PORTMAP_PATH		= PATH=$(CROSS_PATH)

ifdef PTXCONF_TCPWRAPPER
PORTMAP_MAKEVARS	= WRAP_DIR=$(SYSROOT)/lib
endif

$(STATEDIR)/portmap.compile: $(portmap_compile_deps_default)
	@$(call targetinfo, $@)
	cd $(PORTMAP_DIR) && 						\
		$(PORTMAP_ENV) $(PORTMAP_PATH) make $(PORTMAP_MAKEVARS)
	@$(call touch, $@)

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

portmap_install: $(STATEDIR)/portmap.install

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

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

portmap_targetinstall: $(STATEDIR)/portmap.targetinstall

$(STATEDIR)/portmap.targetinstall: $(portmap_targetinstall_deps_default)
	@$(call targetinfo, $@)

	@$(call install_init, portmap)
	@$(call install_fixup, portmap,PACKAGE,portmap)
	@$(call install_fixup, portmap,PRIORITY,optional)
	@$(call install_fixup, portmap,VERSION,$(PORTMAP_VERSION))
	@$(call install_fixup, portmap,SECTION,base)
	@$(call install_fixup, portmap,AUTHOR,"Juergen Beisert <jbeisert\@netscape.net>")
	@$(call install_fixup, portmap,DEPENDS,)
	@$(call install_fixup, portmap,DESCRIPTION,missing)

ifdef PTXCONF_PORTMAP_INSTALL_PORTMAPPER
	@$(call install_copy, portmap, 0, 0, 0755, $(PORTMAP_DIR)/portmap, \
		/sbin/portmap)
endif

ifdef PTXCONF_PORTMAP_STARTUP_TYPE_STANDALONE
# provide everything for standalone mode
ifdef PTXCONF_ROOTFS_ETC_INITD_PORTMAP_DEFAULT
# install the generic one
	@$(call install_copy, portmap, 0, 0, 0755, \
		$(PTXDIST_TOPDIR)/generic/etc/init.d/portmapd, \
		/etc/init.d/portmapd, n)
endif
ifdef PTXCONF_ROOTFS_ETC_INITD_PORTMAP_USER
# install users one
	@$(call install_copy, portmap, 0, 0, 0755, \
		${PTXDIST_WORKSPACE}/projectroot/etc/init.d/portmapd, \
		/etc/init.d/portmapd, n)
endif
#
# FIXME: Is this packet the right location for the link?
#
ifneq ($(PTXCONF_ROOTFS_ETC_INITD_PORTMAP_LINK),"")
	@$(call install_copy, portmap, 0, 0, 0755, /etc/rc.d)
	@$(call install_link, portmap, ../init.d/portmapd, \
		/etc/rc.d/$(PTXCONF_ROOTFS_ETC_INITD_PORTMAP_LINK))
endif
endif

	@$(call install_finish, portmap)
	@$(call touch, $@)

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

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

# vim: syntax=make