summaryrefslogtreecommitdiffstats
path: root/rules/joe.make
blob: 3645bd4872ce83d651e7fe235cf79fb9fdcf79d1 (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
# $Id: template 2516 2005-04-25 10:29:55Z rsc $
#
# Copyright (C) 2005 by Oscar Peredo
#          
# 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_JOE) += joe

#
# Paths and names
#
JOE_VERSION	= 3.2
JOE		= joe-$(JOE_VERSION)
JOE_SUFFIX	= tar.gz
JOE_URL		= $(PTXCONF_SETUP_SFMIRROR)/joe-editor/$(JOE).$(JOE_SUFFIX)
JOE_SOURCE	= $(SRCDIR)/$(JOE).$(JOE_SUFFIX)
JOE_DIR		= $(BUILDDIR)/$(JOE)

-include $(call package_depfile)

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

joe_get: $(STATEDIR)/joe.get

joe_get_deps = $(JOE_SOURCE)

$(STATEDIR)/joe.get: $(joe_get_deps)
	@$(call targetinfo, $@)
	@$(call get_patches, $(JOE))
	@$(call touch, $@)

$(JOE_SOURCE):
	@$(call targetinfo, $@)
	@$(call get, $(JOE_URL))

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

joe_extract: $(STATEDIR)/joe.extract

joe_extract_deps = $(STATEDIR)/joe.get

$(STATEDIR)/joe.extract: $(joe_extract_deps)
	@$(call targetinfo, $@)
	@$(call clean, $(JOE_DIR))
	@$(call extract, $(JOE_SOURCE))
	@$(call patchin, $(JOE))
	@$(call touch, $@)

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

joe_prepare: $(STATEDIR)/joe.prepare

#
# dependencies
#
joe_prepare_deps =  $(STATEDIR)/joe.extract
joe_prepare_deps += $(STATEDIR)/virtual-xchain.install

JOE_PATH	=  PATH=$(CROSS_PATH)
JOE_ENV 	=  $(CROSS_ENV)

#
# autoconf
#
JOE_AUTOCONF =  $(CROSS_AUTOCONF_USR)
# FIXME
JOE_AUTOCONF += --prefix=/

$(STATEDIR)/joe.prepare: $(joe_prepare_deps)
	@$(call targetinfo, $@)
	@$(call clean, $(JOE_DIR)/config.cache)
	cd $(JOE_DIR) && \
		$(JOE_PATH) $(JOE_ENV) \
		./configure $(JOE_AUTOCONF)
	@$(call touch, $@)

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

joe_compile: $(STATEDIR)/joe.compile

joe_compile_deps = $(STATEDIR)/joe.prepare

$(STATEDIR)/joe.compile: $(joe_compile_deps)
	@$(call targetinfo, $@)
	cd $(JOE_DIR) && $(JOE_ENV) $(JOE_PATH) make
	@$(call touch, $@)

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

joe_install: $(STATEDIR)/joe.install

$(STATEDIR)/joe.install: $(STATEDIR)/joe.compile
	@$(call targetinfo, $@)
	#@$(call install, JOE)
	@$(call touch, $@)

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

joe_targetinstall: $(STATEDIR)/joe.targetinstall

joe_targetinstall_deps = $(STATEDIR)/joe.compile

$(STATEDIR)/joe.targetinstall: $(joe_targetinstall_deps)
	@$(call targetinfo, $@)

	@$(call install_init,default)
	@$(call install_fixup,PACKAGE,joe)
	@$(call install_fixup,PRIORITY,optional)
	@$(call install_fixup,VERSION,$(JOE_VERSION))
	@$(call install_fixup,SECTION,base)
	@$(call install_fixup,AUTHOR,"Oscar Peredo <oscar\@exis.cl>")
	@$(call install_fixup,DEPENDS,)
	@$(call install_fixup,DESCRIPTION,missing)

	@$(call install_copy, 0, 0, 0755, $(JOE_DIR)/joe, /bin/joe)
	@$(call install_copy, 0, 0, 0755, $(JOE_DIR)/termidx, /bin/termidx)
	@$(call install_copy, 0, 0, 0755, /etc/joe) 
	@$(call install_copy, 0, 0, 0644, $(JOE_DIR)/joerc, /etc/joe/joerc,n)
	@$(call install_copy, 0, 0, 0755, /etc/joe/syntax)

	@for file in $(JOE_DIR)/syntax/*.jsf; do \
		destination=`basename $$file`; \
		echo "dst=$$destination"; \
		$(call install_copy, 0, 0, 0644, $$file, /etc/joe/syntax/$$destination, n); \
	done

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

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

joe_clean:
	rm -rf $(STATEDIR)/joe.*
	rm -rf $(IMAGEDIR)/joe_*
	rm -rf $(JOE_DIR)

# vim: syntax=make