summaryrefslogtreecommitdiffstats
path: root/rules/ptrtd.make
blob: bf20ed9d45db078e0258511a285f40e654c52cc0 (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
# -*-makefile-*-
# $Id$
#
# Copyright (C) 2009 by Bjoern Buerger <b.buerger@pengutronix.de>
#
# 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_PTRTD) += ptrtd

#
# Paths and names
#
# We use the updated version from http://jk.fr.eu.org/debian/
# rather than the original from http://www.litech.org/ptrtd/
# although the archive is badly packaged (extracts to a
# different directory name).
#

PTRTD_VERSION		:= 0.5.2
PTRTD_VERSION_SUFFIX    := -1~14
PTRTD			:= ptrtd-$(PTRTD_VERSION)
PTRTD_SUFFIX		:= tar.gz
PTRTD_URL		:= http://jk.fr.eu.org/debian/unstable/ptrtd_$(PTRTD_VERSION)$(PTRTD_VERSION_SUFFIX).$(PTRTD_SUFFIX)
PTRTD_SOURCE		:= $(SRCDIR)/ptrtd_$(PTRTD_VERSION)$(PTRTD_VERSION_SUFFIX).$(PTRTD_SUFFIX)
PTRTD_DIR		:= $(BUILDDIR)/$(PTRTD)
PTRTD_LICENSE      	:= GPLv2

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

$(PTRTD_SOURCE):
	@$(call targetinfo)
	@$(call get, PTRTD)

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

$(STATEDIR)/ptrtd.extract:
	@$(call targetinfo)
	@$(call clean, $(PTRTD_DIR))
	@$(call extract, PTRTD)
	@$(call patchin, PTRTD)
	@$(call touch)

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

PTRTD_PATH	:= PATH=$(CROSS_PATH)
PTRTD_ENV 	:= $(CROSS_ENV)

#
# autoconf
#
PTRTD_AUTOCONF := $(CROSS_AUTOCONF_USR)

$(STATEDIR)/ptrtd.prepare:
	@$(call targetinfo)
	@$(call clean, $(PTRTD_DIR)/config.cache)
	cd $(PTRTD_DIR) && \
		$(PTRTD_PATH) $(PTRTD_ENV) \
		./configure $(PTRTD_AUTOCONF)
	@$(call touch)

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

$(STATEDIR)/ptrtd.compile:
	@$(call targetinfo)
	cd $(PTRTD_DIR) && $(PTRTD_PATH) $(MAKE) $(PARALLELMFLAGS)
	@$(call touch)

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

$(STATEDIR)/ptrtd.install:
	@$(call targetinfo)
	@$(call install, PTRTD)
	@$(call touch)

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

$(STATEDIR)/ptrtd.targetinstall:
	@$(call targetinfo)

	@$(call install_init,  ptrtd)
	@$(call install_fixup, ptrtd,PACKAGE,ptrtd)
	@$(call install_fixup, ptrtd,PRIORITY,optional)
	@$(call install_fixup, ptrtd,VERSION,$(PTRTD_VERSION))
	@$(call install_fixup, ptrtd,SECTION,base)
	@$(call install_fixup, ptrtd,AUTHOR,"Bjoern Buerger <b.buerger@pengutronix.de>")
	@$(call install_fixup, ptrtd,DEPENDS,)
	@$(call install_fixup, ptrtd,DESCRIPTION,Portable Transport Relay Translator Daemon)

	# FIXME: currently, only the daemon is installed,
	#	 add init script, etc.
	@$(call install_copy, ptrtd, 0, 0, 0755, -, /usr/sbin/ptrtd)
	@$(call install_copy, ptrtd, 0, 0, 0755, -, /etc/ptrtd.tsetup)
	@$(call install_replace, ptrtd, /etc/ptrtd.tsetup, /sbin/ip, "/bin/ip")

	@$(call install_finish, ptrtd)

	@$(call touch)

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

ptrtd_clean:
	rm -rf $(STATEDIR)/ptrtd.*
	rm -rf $(PKGDIR)/ptrtd_*
	rm -rf $(PTRTD_DIR)

# vim: syntax=make