Category reorganization
[openwrt/svn-archive/archive.git] / XOrg / font / common.mk
1 #
2 # Copyright (C) 2007 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 PKG_SOURCE_URL:=http://xorg.freedesktop.org/releases/X11R7.2/src/font
10
11 _CATEGORY:=fonts
12 _DEPEND+="+xorg-server-X11R7.2 +font-util-X11R7.1"
13 include ../../common.mk
14
15 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
16
17 define Build/Compile
18 UTIL_DIR="$(STAGING_DIR)/usr/lib/X11/fonts/util/" make -e -C $(PKG_BUILD_DIR)
19 DESTDIR=$(PKG_INSTALL_DIR) $(MAKE) -C $(PKG_BUILD_DIR) $(MAKE_FLAGS) install
20 find $(PKG_INSTALL_DIR) -name fonts.dir | \
21 xargs -i -t \
22 sed -i '1d' {}
23 find $(PKG_INSTALL_DIR) -name fonts.dir | \
24 xargs -i -t \
25 mv {} {}.$(PKG_NAME)
26 endef
27
28 define Build/Configure
29 (cd $(PKG_BUILD_DIR)/$(CONFIGURE_PATH); \
30 if [ -x $(CONFIGURE_CMD) ]; then \
31 $(CP) $(SCRIPT_DIR)/config.{guess,sub} $(PKG_BUILD_DIR)/ && \
32 $(CONFIGURE_VARS) \
33 $(CONFIGURE_CMD) \
34 $(CONFIGURE_ARGS_XTRA) \
35 $(CONFIGURE_ARGS) ;\
36 fi \
37 )
38 endef
39
40 define Package/${PKG_NAME}/install
41 $(INSTALL_DIR) $(1)/usr/lib/
42 $(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib/
43 endef
44
45 define Package/${PKG_NAME}/postinst
46 #!/bin/sh
47
48 FILE_NEW=`find $${IPKG_INSTROOT} -name fonts.dir.${PKG_NAME}`
49 FILE_OLD=`dirname $${FILE_NEW}`/fonts.dir
50
51 echo found $${FILE}
52
53 if [ ! -z $${FILE_NEW} ]; then
54 if [ -f $${FILE_OLD} ]; then
55 sed -i "1d" $${FILE_OLD}
56 cat $${FILE_NEW} >> $${FILE_OLD}
57 rm -rf $${FILE_NEW}
58 mv $${FILE_OLD} $${FILE_OLD}.tmp
59 else
60 mv $${FILE_NEW} $${FILE_OLD}.tmp
61 fi
62 (echo `wc -l $${FILE_OLD}.tmp | awk '{print($$1)}'`; cat $${FILE_OLD}.tmp) > $${FILE_OLD}
63 rm $${FILE_OLD}.tmp
64 fi
65 endef