[packages] Require* calls must now be placed before BuildPackage calls
[openwrt/svn-archive/archive.git] / Xorg / xorg / font / font-misc-misc / Makefile
1 #
2 # Copyright (C) 2007-2009 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 # blogic@openwrt.org
8
9 include $(TOPDIR)/rules.mk
10
11 PKG_BASE_NAME:=font-base
12 PKG_NAME:=font-misc-misc
13 PKG_RELEASE:=1
14 PKG_VERSION:=1.0.0
15 PKG_SOURCE_URL:=http://xorg.freedesktop.org/releases/X11R7.3/src/font
16 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
17
18 include $(INCLUDE_DIR)/package.mk
19
20 define Package/font-misc-misc/Default
21 SECTION:=xorg-fonts
22 CATEGORY:=Xorg
23 SUBMENU:=font
24 endef
25
26 define Package/font-base
27 $(call Package/font-misc-misc/Default)
28 DEPENDS:=+xserver +font-util @DISPLAY_SUPPORT
29 TITLE:=font-base
30 URL:=http://xorg.freedesktop.org/
31 endef
32
33 define Package/font-misc-misc
34 $(call Package/font-misc-misc/Default)
35 DEPENDS:=font-base
36 TITLE:=font-misc-misc
37 URL:=http://xorg.freedesktop.org/
38 endef
39
40
41 CONFIGURE_ARGS_XTRA+=--disable-iso8859-2 --disable-iso8859-3 --disable-iso8859-4 --disable-iso8859-5 --disable-iso8859-7 --disable-iso8859-8 --disable-iso8859-9 --disable-iso8859-10 --disable-iso8859-11 --disable-iso8859-13 --disable-iso8859-14 --disable-iso8859-16 --disable-koi8-r --disable-jisx0201
42
43 define Build/Compile
44 UTIL_DIR="$(STAGING_DIR)/usr/lib/X11/fonts/util/" make -e -C $(PKG_BUILD_DIR)
45 DESTDIR=$(PKG_INSTALL_DIR) $(MAKE) -C $(PKG_BUILD_DIR) $(MAKE_FLAGS) install
46 find $(PKG_INSTALL_DIR) -name fonts.dir | \
47 xargs rm
48 endef
49
50 define Build/Configure
51 (cd $(PKG_BUILD_DIR)/$(CONFIGURE_PATH); \
52 if [ -x $(CONFIGURE_CMD) ]; then \
53 $(CP) $(SCRIPT_DIR)/config.{guess,sub} $(PKG_BUILD_DIR)/ && \
54 $(CONFIGURE_VARS) \
55 $(CONFIGURE_CMD) \
56 $(CONFIGURE_ARGS_XTRA) \
57 $(CONFIGURE_ARGS) ;\
58 fi \
59 )
60 endef
61
62 define Build/InstallDev
63 DESTDIR=$(1) $(MAKE) -C $(PKG_BUILD_DIR)/ $(MAKE_FLAGS) install
64 endef
65
66 define Package/font-base/install
67 $(INSTALL_DIR) $(1)/usr/lib/X11/fonts/misc/
68 $(CP) $(PKG_INSTALL_DIR)/usr/lib/X11/fonts/misc/6x13* $(1)/usr/lib/X11/fonts/misc/
69 $(CP) files/fonts.dir.font-base $(1)/usr/lib/X11/fonts/misc/
70 endef
71
72 define Package/font-misc-misc/install
73 $(INSTALL_DIR) $(1)/usr/lib/X11/fonts/misc/
74 $(CP) $(PKG_INSTALL_DIR)/usr/lib/X11/fonts/misc/* $(1)/usr/lib/X11/fonts/misc/
75 rm $(1)/usr/lib/X11/fonts/misc/6x13*
76 $(CP) files/fonts.dir.font-misc-misc $(1)/usr/lib/X11/fonts/misc/
77 endef
78
79 define Package/font-base/postinst
80 #!/bin/sh
81
82 FILE_NEW=`find $${IPKG_INSTROOT} -name fonts.dir.font-base`
83 FILE_OLD=`dirname $${FILE_NEW}`/fonts.dir
84
85 echo found $${FILE}
86
87 if [ ! -z $${FILE_NEW} ]; then
88 if [ -f $${FILE_OLD} ]; then
89 sed -i "1d" $${FILE_OLD}
90 cat $${FILE_NEW} >> $${FILE_OLD}
91 rm -rf $${FILE_NEW}
92 mv $${FILE_OLD} $${FILE_OLD}.tmp
93 else
94 mv $${FILE_NEW} $${FILE_OLD}.tmp
95 fi
96 (echo `wc -l $${FILE_OLD}.tmp | awk '{print($$1)}'`; cat $${FILE_OLD}.tmp) > $${FILE_OLD}
97 rm $${FILE_OLD}.tmp
98 fi
99 endef
100
101 define Package/font-misc-misc/postinst
102 #!/bin/sh
103
104 FILE_NEW=`find $${IPKG_INSTROOT} -name fonts.dir.font-misc-misc`
105 FILE_OLD=`dirname $${FILE_NEW}`/fonts.dir
106
107 echo found $${FILE}
108
109 if [ ! -z $${FILE_NEW} ]; then
110 if [ -f $${FILE_OLD} ]; then
111 sed -i "1d" $${FILE_OLD}
112 cat $${FILE_NEW} >> $${FILE_OLD}
113 rm -rf $${FILE_NEW}
114 mv $${FILE_OLD} $${FILE_OLD}.tmp
115 else
116 mv $${FILE_NEW} $${FILE_OLD}.tmp
117 fi
118 (echo `wc -l $${FILE_OLD}.tmp | awk '{print($$1)}'`; cat $${FILE_OLD}.tmp) > $${FILE_OLD}
119 rm $${FILE_OLD}.tmp
120 fi
121 endef
122
123 # FIXME: replace with native versions
124 $(eval $(call RequireCommand,mkfontscale, \
125 Please install mkfontscale (usually in xfonts-utils) \
126 ))
127 $(eval $(call RequireCommand,mkfontdir, \
128 Please install mkfontdir (usually in xfonts-utils) \
129 ))
130
131 $(eval $(call BuildPackage,font-misc-misc))
132 $(eval $(call BuildPackage,font-base))
133
134