InstallDev should be using (1) and not (STAGING_DIR)
[packages.git] / XOrg / font / font-misc-cyrillic / Makefile
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 include $(TOPDIR)/rules.mk
9
10 PKG_BASE_NAME:=font
11 PKG_NAME:=font-misc-cyrillic
12 PKG_RELEASE:=1
13 PKG_VERSION:=X11R7.0-1.0.0
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
15 PKG_BUILD_DIR=$(BUILD_DIR)/Xorg/$(_CATEGORY)/${PKG_NAME}-$(PKG_VERSION)/
16 PKG_SOURCE_URL:=http://xorg.freedesktop.org/releases/X11R7.2/src/font
17
18 include $(INCLUDE_DIR)/package.mk
19
20 define Package/font-misc-cyrillic
21   SECTION:=xorg-font
22   CATEGORY:=Xorg
23   SUBMENU:=font
24   DEPENDS:= +xorg-server +font-util @TARGET_x86
25   TITLE:=font-misc-cyrillic
26   URL:=http://xorg.freedesktop.org/
27 endef
28
29 define Build/InstallDev
30         DESTDIR=$(1) $(MAKE) -C $(PKG_BUILD_DIR) $(MAKE_FLAGS) install
31 endef
32
33 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
34
35 define Build/Compile
36         UTIL_DIR="$(STAGING_DIR)/usr/lib/X11/fonts/util/" make -e -C $(PKG_BUILD_DIR)
37         DESTDIR=$(PKG_INSTALL_DIR) $(MAKE) -C $(PKG_BUILD_DIR) $(MAKE_FLAGS) install
38         find $(PKG_INSTALL_DIR) -name fonts.dir | \
39                 xargs -i -t \
40                         sed -i '1d' {} 
41         find $(PKG_INSTALL_DIR) -name fonts.dir | \
42                 xargs -i -t \
43                         mv {} {}.font-misc-cyrillic
44 endef
45
46 define Build/Configure
47         (cd $(PKG_BUILD_DIR)/$(CONFIGURE_PATH); \
48         if [ -x $(CONFIGURE_CMD) ]; then \
49                 $(CP) $(SCRIPT_DIR)/config.{guess,sub} $(PKG_BUILD_DIR)/ && \
50                         $(CONFIGURE_VARS) \
51                         $(CONFIGURE_CMD) \
52                         $(CONFIGURE_ARGS_XTRA) \
53                         $(CONFIGURE_ARGS) ;\
54         fi \
55         )
56 endef
57
58 define Package/font-misc-cyrillic/install
59         $(INSTALL_DIR) $(1)/usr/lib/
60         $(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib/
61 endef
62
63 define Package/font-misc-cyrillic/postinst
64 #!/bin/sh
65
66 FILE_NEW=`find $${IPKG_INSTROOT} -name fonts.dir.font-misc-cyrillic`
67 FILE_OLD=`dirname $${FILE_NEW}`/fonts.dir
68
69 echo found $${FILE}
70
71 if [ ! -z $${FILE_NEW} ]; then
72         if [ -f $${FILE_OLD} ]; then
73                 sed -i "1d" $${FILE_OLD}
74                 cat $${FILE_NEW} >> $${FILE_OLD}
75                 rm -rf $${FILE_NEW}
76                 mv $${FILE_OLD} $${FILE_OLD}.tmp
77         else
78                 mv $${FILE_NEW} $${FILE_OLD}.tmp
79         fi
80         (echo `wc -l $${FILE_OLD}.tmp | awk '{print($$1)}'`; cat $${FILE_OLD}.tmp) > $${FILE_OLD}
81         rm $${FILE_OLD}.tmp
82 fi
83 endef
84
85 ifeq (font-misc-cyrillic,font-util)
86 define Build/Compile
87         $(MAKE) -C $(PKG_BUILD_DIR)/ 
88 endef
89 endif
90
91 $(eval $(call BuildPackage,font-misc-cyrillic))
92