blogic e91872ae63 split XOrg font base package into 2 files, to reduce size of std installation
git-svn-id: svn://svn.openwrt.org/openwrt/packages@8956 3c298f89-4303-0410-b956-a3cf2f4a3e73
2007-09-22 18:52:10 +00:00

127 lines
3.5 KiB
Makefile

#
# Copyright (C) 2007 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
# blogic@openwrt.org
include $(TOPDIR)/rules.mk
PKG_BASE_NAME:=font-base
PKG_NAME:=font-misc-misc-X11R7.0
PKG_RELEASE:=1
PKG_VERSION:=1.0.0
PKG_SOURCE_URL:=http://xorg.freedesktop.org/releases/X11R7.2/src/font
PKG_SOURCE:=font-misc-misc-X11R7.0-1.0.0.tar.bz2
PKG_BUILD_DIR=$(BUILD_DIR)/Xorg/fonts/font-misc-misc-X11R7.0-1.0.0/
include $(INCLUDE_DIR)/package.mk
define Package/font-misc-misc/Default
SECTION:=xorg-fonts
CATEGORY:=Xorg
SUBMENU:=fonts
endef
define Package/font-base
$(call Package/font-misc-misc/Default)
DEPENDS:=+xorg-server-X11R7.2 +font-util-X11R7.1 @TARGET_x86
TITLE:=font-base
URL:=http://xorg.freedesktop.org/
endef
define Package/font-misc-misc
$(call Package/font-misc-misc/Default)
DEPENDS:=font-base
TITLE:=font-misc-misc
URL:=http://xorg.freedesktop.org/
endef
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
define Build/Compile
UTIL_DIR="$(STAGING_DIR)/usr/lib/X11/fonts/util/" make -e -C $(PKG_BUILD_DIR)
DESTDIR=$(PKG_INSTALL_DIR) $(MAKE) -C $(PKG_BUILD_DIR) $(MAKE_FLAGS) install
find $(PKG_INSTALL_DIR) -name fonts.dir | \
xargs rm
endef
define Build/Configure
(cd $(PKG_BUILD_DIR)/$(CONFIGURE_PATH); \
if [ -x $(CONFIGURE_CMD) ]; then \
$(CP) $(SCRIPT_DIR)/config.{guess,sub} $(PKG_BUILD_DIR)/ && \
$(CONFIGURE_VARS) \
$(CONFIGURE_CMD) \
$(CONFIGURE_ARGS_XTRA) \
$(CONFIGURE_ARGS) ;\
fi \
)
endef
define Build/InstallDev
DESTDIR=$(STAGING_DIR) $(MAKE) -C $(PKG_BUILD_DIR)/ $(MAKE_FLAGS) install
endef
define Package/font-base/install
$(INSTALL_DIR) $(1)/usr/lib/X11/fonts/misc/
$(CP) $(PKG_INSTALL_DIR)/usr/lib/X11/fonts/misc/6x13* $(1)/usr/lib/X11/fonts/misc/
$(CP) files/fonts.dir.font-base $(1)/usr/lib/X11/fonts/misc/
endef
define Package/font-misc-misc/install
$(INSTALL_DIR) $(1)/usr/lib/X11/fonts/misc/
$(CP) $(PKG_INSTALL_DIR)/usr/lib/X11/fonts/misc/* $(1)/usr/lib/X11/fonts/misc/
rm $(1)/usr/lib/X11/fonts/misc/6x13*
$(CP) files/fonts.dir.font-misc-misc $(1)/usr/lib/X11/fonts/misc/
endef
define Package/font-base/postinst
#!/bin/sh
FILE_NEW=`find $${IPKG_INSTROOT} -name fonts.dir.font-base`
FILE_OLD=`dirname $${FILE_NEW}`/fonts.dir
echo found $${FILE}
if [ ! -z $${FILE_NEW} ]; then
if [ -f $${FILE_OLD} ]; then
sed -i "1d" $${FILE_OLD}
cat $${FILE_NEW} >> $${FILE_OLD}
rm -rf $${FILE_NEW}
mv $${FILE_OLD} $${FILE_OLD}.tmp
else
mv $${FILE_NEW} $${FILE_OLD}.tmp
fi
(echo `wc -l $${FILE_OLD}.tmp | awk '{print($$1)}'`; cat $${FILE_OLD}.tmp) > $${FILE_OLD}
rm $${FILE_OLD}.tmp
fi
endef
define Package/font-misc-misc/postinst
#!/bin/sh
FILE_NEW=`find $${IPKG_INSTROOT} -name fonts.dir.font-misc-misc`
FILE_OLD=`dirname $${FILE_NEW}`/fonts.dir
echo found $${FILE}
if [ ! -z $${FILE_NEW} ]; then
if [ -f $${FILE_OLD} ]; then
sed -i "1d" $${FILE_OLD}
cat $${FILE_NEW} >> $${FILE_OLD}
rm -rf $${FILE_NEW}
mv $${FILE_OLD} $${FILE_OLD}.tmp
else
mv $${FILE_NEW} $${FILE_OLD}.tmp
fi
(echo `wc -l $${FILE_OLD}.tmp | awk '{print($$1)}'`; cat $${FILE_OLD}.tmp) > $${FILE_OLD}
rm $${FILE_OLD}.tmp
fi
endef
$(eval $(call BuildPackage,font-misc-misc))
$(eval $(call BuildPackage,font-base))