summaryrefslogtreecommitdiffstats
path: root/rules/host-ipkg-utils.make
blob: 8e354e046f068dea2c9d7367204f09405a88479d (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
# -*-makefile-*-
# $Id: template 2224 2005-01-20 15:19:18Z rsc $
#
# Copyright (C) 2005 by Robert Schwebel
#          
# 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
#
HOST_PACKAGES-$(PTXCONF_HOSTTOOL_IPKG_UTILS) += hosttool-ipkg-utils

#
# Paths and names
#
HOSTTOOL-IPKG-UTILS_VERSION	= 1.7
HOSTTOOL-IPKG-UTILS		= ipkg-utils-$(HOSTTOOL-IPKG-UTILS_VERSION)
HOSTTOOL-IPKG-UTILS_SUFFIX	= tar.gz
HOSTTOOL-IPKG-UTILS_URL		= ftp://ftp.handhelds.org/packages/ipkg-utils/$(HOSTTOOL-IPKG-UTILS).$(HOSTTOOL-IPKG-UTILS_SUFFIX)
HOSTTOOL-IPKG-UTILS_SOURCE	= $(SRCDIR)/$(HOSTTOOL-IPKG-UTILS).$(HOSTTOOL-IPKG-UTILS_SUFFIX)
HOSTTOOL-IPKG-UTILS_DIR		= $(HOST_BUILDDIR)/$(HOSTTOOL-IPKG-UTILS)

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

hosttool-ipkg-utils_get: $(STATEDIR)/hosttool-ipkg-utils.get

hosttool-ipkg-utils_get_deps = $(HOSTTOOL-IPKG-UTILS_SOURCE)

$(STATEDIR)/hosttool-ipkg-utils.get: $(hosttool-ipkg-utils_get_deps)
	@$(call targetinfo, $@)
	@$(call get_patches, $(HOSTTOOL-IPKG-UTILS))
	$(call touch, $@)

$(HOSTTOOL-IPKG-UTILS_SOURCE):
	@$(call targetinfo, $@)
	@$(call get, $(HOSTTOOL-IPKG-UTILS_URL))

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

hosttool-ipkg-utils_extract: $(STATEDIR)/hosttool-ipkg-utils.extract

hosttool-ipkg-utils_extract_deps = $(STATEDIR)/hosttool-ipkg-utils.get

$(STATEDIR)/hosttool-ipkg-utils.extract: $(hosttool-ipkg-utils_extract_deps)
	@$(call targetinfo, $@)
	@$(call clean, $(HOSTTOOL-IPKG-UTILS_DIR))
	@$(call extract, $(HOSTTOOL-IPKG-UTILS_SOURCE), $(HOST_BUILDDIR))
	@$(call patchin, $(HOSTTOOL-IPKG-UTILS))
	perl -i -p -e "s,^PREFIX=(.*),PREFIX=$(PTXCONF_PREFIX),g" \
		$(HOSTTOOL-IPKG-UTILS_DIR)/Makefile
	perl -i -p -e "s,^	python setup.py install,	python setup.py install --prefix=$(PTXCONF_PREFIX),g" \
		$(HOSTTOOL-IPKG-UTILS_DIR)/Makefile
	$(call touch, $@)

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

hosttool-ipkg-utils_prepare: $(STATEDIR)/hosttool-ipkg-utils.prepare

#
# dependencies
#
hosttool-ipkg-utils_prepare_deps = \
	$(STATEDIR)/hosttool-ipkg-utils.extract

HOSTTOOL-IPKG-UTILS_PATH	=  PATH=$(CROSS_PATH)
HOSTTOOL-IPKG-UTILS_ENV 	=  $(CROSS_ENV)

$(STATEDIR)/hosttool-ipkg-utils.prepare: $(hosttool-ipkg-utils_prepare_deps)
	@$(call targetinfo, $@)
	$(call touch, $@)

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

hosttool-ipkg-utils_compile: $(STATEDIR)/hosttool-ipkg-utils.compile

hosttool-ipkg-utils_compile_deps = $(STATEDIR)/hosttool-ipkg-utils.prepare

$(STATEDIR)/hosttool-ipkg-utils.compile: $(hosttool-ipkg-utils_compile_deps)
	@$(call targetinfo, $@)
	cd $(HOSTTOOL-IPKG-UTILS_DIR) && $(HOSTTOOL-IPKG-UTILS_ENV) $(HOSTTOOL-IPKG-UTILS_PATH) make
	$(call touch, $@)

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

hosttool-ipkg-utils_install: $(STATEDIR)/hosttool-ipkg-utils.install

$(STATEDIR)/hosttool-ipkg-utils.install: $(STATEDIR)/hosttool-ipkg-utils.compile
	@$(call targetinfo, $@)
	mkdir -p $(PTXCONF_PREFIX)/bin
	# ipkg.py is forgotten by make install, so we copy it manually
	# FIXME: this should probably be fixed upstream
	cd $(HOSTTOOL-IPKG-UTILS_DIR) && (\
		$(HOSTTOOL-IPKG-UTILS_ENV) $(HOSTTOOL-IPKG-UTILS_PATH) make install;\
		cp -f ipkg.py $(PTXCONF_PREFIX)/bin/;\
	)
	$(call touch, $@)

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

hosttool-ipkg-utils_targetinstall: $(STATEDIR)/hosttool-ipkg-utils.targetinstall

hosttool-ipkg-utils_targetinstall_deps = $(STATEDIR)/hosttool-ipkg-utils.install

$(STATEDIR)/hosttool-ipkg-utils.targetinstall: $(hosttool-ipkg-utils_targetinstall_deps)
	@$(call targetinfo, $@)
	$(call touch, $@)

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

hosttool-ipkg-utils_clean:
	rm -rf $(STATEDIR)/hosttool-ipkg-utils.*
	rm -rf $(HOSTTOOL-IPKG-UTILS_DIR)

# vim: syntax=make