summaryrefslogtreecommitdiffstats
path: root/rules/dosfstools.make
blob: 244b0a15dde589253fcbccf5988a38e58a2071cf (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
# -*-makefile-*-
# $Id: template 2606 2005-05-10 21:49:41Z rsc $
#
# Copyright (C) 2005 by Steven Scholz <steven.scholz@imc-berlin.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_DOSFSTOOLS) += dosfstools

#
# Paths and names
#
DOSFSTOOLS_VERSION	= 2.11
DOSFSTOOLS		= dosfstools-$(DOSFSTOOLS_VERSION)
DOSFSTOOLS_SUFFIX	= tar.gz
#DOSFSTOOLS_SRC		= dosfstools_$(DOSFSTOOLS_VERSION).orig.$(DOSFSTOOLS_SUFFIX)
#DOSFSTOOLS_URL		= $(PTXCONF_SETUP_DEBMIRROR)/pool/main/d/dosfstools/$(DOSFSTOOLS_SRC)
DOSFSTOOLS_SRC		= $(DOSFSTOOLS).src.$(DOSFSTOOLS_SUFFIX)
DOSFSTOOLS_URL		= ftp://ftp.uni-erlangen.de/pub/Linux/LOCAL/dosfstools/$(DOSFSTOOLS_SRC)
DOSFSTOOLS_SOURCE	= $(SRCDIR)/$(DOSFSTOOLS_SRC)
DOSFSTOOLS_DIR		= $(BUILDDIR)/$(DOSFSTOOLS)

-include $(call package_depfile)

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

dosfstools_get: $(STATEDIR)/dosfstools.get

dosfstools_get_deps = $(DOSFSTOOLS_SOURCE)

$(STATEDIR)/dosfstools.get: $(dosfstools_get_deps)
	@$(call targetinfo, $@)
	@$(call get_patches, $(DOSFSTOOLS))
	@$(call touch, $@)

$(DOSFSTOOLS_SOURCE):
	@$(call targetinfo, $@)
	@$(call get, $(DOSFSTOOLS_URL))

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

dosfstools_extract: $(STATEDIR)/dosfstools.extract

dosfstools_extract_deps = $(STATEDIR)/dosfstools.get

$(STATEDIR)/dosfstools.extract: $(dosfstools_extract_deps)
	@$(call targetinfo, $@)
	@$(call clean, $(DOSFSTOOLS_DIR))
	@$(call extract, $(DOSFSTOOLS_SOURCE))
	@$(call patchin, $(DOSFSTOOLS))
	@$(call touch, $@)

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

dosfstools_prepare: $(STATEDIR)/dosfstools.prepare

#
# dependencies
#
dosfstools_prepare_deps = \
	$(STATEDIR)/dosfstools.extract \
	$(STATEDIR)/virtual-xchain.install

DOSFSTOOLS_PATH	=  PATH=$(CROSS_PATH)
DOSFSTOOLS_ENV 	=  $(CROSS_ENV)

$(STATEDIR)/dosfstools.prepare: $(dosfstools_prepare_deps)
	@$(call targetinfo, $@)
	@$(call touch, $@)

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

dosfstools_compile: $(STATEDIR)/dosfstools.compile

dosfstools_compile_deps = $(STATEDIR)/dosfstools.prepare

$(STATEDIR)/dosfstools.compile: $(dosfstools_compile_deps)
	@$(call targetinfo, $@)
	cd $(DOSFSTOOLS_DIR) && $(DOSFSTOOLS_ENV) $(DOSFSTOOLS_PATH) \
		make CC=$(COMPILER_PREFIX)gcc
	@$(call touch, $@)

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

dosfstools_install: $(STATEDIR)/dosfstools.install

$(STATEDIR)/dosfstools.install: $(STATEDIR)/dosfstools.compile
	@$(call targetinfo, $@)
	# FIXME
	# @$(call install, DOSFSTOOLS)
	#cd $(DOSFSTOOLS_DIR) && $(DOSFSTOOLS_ENV) $(DOSFSTOOLS_PATH) $(MAKE_INSTALL)
	@$(call touch, $@)

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

dosfstools_targetinstall: $(STATEDIR)/dosfstools.targetinstall

dosfstools_targetinstall_deps = $(STATEDIR)/dosfstools.compile

$(STATEDIR)/dosfstools.targetinstall: $(dosfstools_targetinstall_deps)
	@$(call targetinfo, $@)

	@$(call install_init,default)
	@$(call install_fixup,PACKAGE,dosfstools)
	@$(call install_fixup,PRIORITY,optional)
	@$(call install_fixup,VERSION,$(DOSFSTOOLS_VERSION))
	@$(call install_fixup,SECTION,base)
	@$(call install_fixup,AUTHOR,"Steven Scholz <steven.scholz\@imc-berlin.de>")
	@$(call install_fixup,DEPENDS,)
	@$(call install_fixup,DESCRIPTION,missing)

ifdef PTXCONF_DOSFSTOOLS_MKDOSFS
	@$(call install_copy, 0, 0, 0755, $(DOSFSTOOLS_DIR)/mkdosfs/mkdosfs, /sbin/mkdosfs)
ifdef PTXCONF_DOSFSTOOLS_MKDOSFS_MSDOS
	@$(call install_link, mkdosfs, /sbin/mkfs.msdos)
endif
ifdef PTXCONF_DOSFSTOOLS_MKDOSFS_VFAT
	@$(call install_link, mkdosfs, /sbin/mkfs.vfat)
endif
endif
ifdef PTXCONF_DOSFSTOOLS_DOSFSCK
	@$(call install_copy, 0, 0, 0755, $(DOSFSTOOLS_DIR)/dosfsck/dosfsck, /sbin/dosfsck)
endif

	@$(call install_finish)

	@$(call touch, $@)

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

dosfstools_clean:
	rm -rf $(STATEDIR)/dosfstools.*
	rm -rf $(IMAGEDIR)/dosfstools_*
	rm -rf $(DOSFSTOOLS_DIR)

# vim: syntax=make