summaryrefslogtreecommitdiffstats
path: root/rules/xorg-fonts.make
blob: 1057d3f76e4bcebd23a512b64e780cdd3a28ace9 (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
# -*-makefile-*-
# $Id: template 6655 2007-01-02 12:55:21Z rsc $
#
# Copyright (C) 2007 by Marc Kleine-Budde <mkl@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_XORG_FONTS) += xorg-fonts

#
# Paths and names
#
XORG_FONTS_VERSION	:= 1.0.0
XORG_FONTS		:= xorg-fonts-$(XORG_FONTS_VERSION)
XORG_FONTS_DIR		:= $(BUILDDIR)/$(XORG_FONTS)
XORG_FONTS_DIR_INSTALL	:= $(XORG_FONTS_DIR)-install

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

xorg-fonts_get: $(STATEDIR)/xorg-fonts.get

$(STATEDIR)/xorg-fonts.get:
	@$(call targetinfo, $@)
	@$(call touch, $@)

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

xorg-fonts_extract: $(STATEDIR)/xorg-fonts.extract

$(STATEDIR)/xorg-fonts.extract: $(xorg-fonts_extract_deps_default)
	@$(call targetinfo, $@)
	@$(call touch, $@)

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

xorg-fonts_prepare: $(STATEDIR)/xorg-fonts.prepare

XORG_FONTS_PATH	:=  PATH=$(HOST_PATH)

$(STATEDIR)/xorg-fonts.prepare: $(xorg-fonts_prepare_deps_default)
	@$(call targetinfo, $@)
	@$(call touch, $@)

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

xorg-fonts_compile: $(STATEDIR)/xorg-fonts.compile

$(STATEDIR)/xorg-fonts.compile: $(xorg-fonts_compile_deps_default)
	@$(call targetinfo, $@)
	@$(call touch, $@)

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

xorg-fonts_install: $(STATEDIR)/xorg-fonts.install

$(STATEDIR)/xorg-fonts.install: $(xorg-fonts_install_deps_default)
	@$(call targetinfo, $@)
	@$(call touch, $@)

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

xorg-fonts_targetinstall: $(STATEDIR)/xorg-fonts.targetinstall.post

$(STATEDIR)/xorg-fonts.targetinstall: $(xorg-fonts_targetinstall_deps_default)
	@$(call targetinfo, $@)

	@if test -e $(XORG_FONTS_DIR_INSTALL); then \
		rm -rf $(XORG_FONTS_DIR_INSTALL); \
	fi
	@mkdir -p $(XORG_FONTS_DIR_INSTALL)

	@$(call touch, $@)

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

$(STATEDIR)/xorg-fonts.targetinstall.post: $(STATEDIR)/xorg-fonts.install
	@$(call targetinfo, $@)

	@$(XORG_FONTS_PATH); \
	find $(XORG_FONTS_DIR_INSTALL) -mindepth 1 -type d | while read dir; do \
		echo $$dir;\
		case "$${dir}" in \
			*/[Ee]ncodings)	\
					if test -d "$${dir}/large"; then \
						elarge="-e ./large"; \
					fi; \
					pushd $${dir} > /dev/null; \
					mkfontscale -b -s -l -n -r -p $(XORG_FONTDIR)/encodings -e . $${elarge} $${dir}; \
					popd > /dev/null ;; \
			*/[Ss]peedo)	mkfontdir $${dir} ;; \
			*)		mkfontscale $${dir}; \
					mkfontdir $${dir} ;; \
		esac; \
	done

# FIXME: add fc-cache?

	@$(call install_init, xorg-fonts)
	@$(call install_fixup, xorg-fonts,PACKAGE,xorg-fonts)
	@$(call install_fixup, xorg-fonts,PRIORITY,optional)
	@$(call install_fixup, xorg-fonts,VERSION,$(XORG_FONTS_VERSION))
	@$(call install_fixup, xorg-fonts,SECTION,base)
	@$(call install_fixup, xorg-fonts,AUTHOR,"Robert Schwebel <r.schwebel\@pengutronix.de>")
	@$(call install_fixup, xorg-fonts,DEPENDS,)
	@$(call install_fixup, xorg-fonts,DESCRIPTION,missing)

	@cd $(XORG_FONTS_DIR_INSTALL); \
	find . -type f | while read file; do \
		echo $${file}; \
		$(call install_copy, xorg-fonts, 0, 0, 0644, $$file, $(XORG_FONTDIR)/$$file, n); \
	done

	@$(call install_finish, xorg-fonts)

	@$(call touch, $@)

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

xorg-fonts_clean:
	rm -rf $(STATEDIR)/xorg-fonts.*
	rm -rf $(IMAGEDIR)/xorg-fonts_*
	rm -rf $(XORG_FONTS_DIR)

# vim: syntax=make