replace lots of manual install commands with INSTALL_* variables
[openwrt/svn-archive/archive.git] / libs / lzo / Makefile
1 #
2 # Copyright (C) 2006 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 # $Id$
8
9 include $(TOPDIR)/rules.mk
10
11 PKG_NAME:=lzo
12 PKG_VERSION:=2.02
13 PKG_RELEASE:=1
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16 PKG_SOURCE_URL:=http://www.oberhumer.com/opensource/lzo/download/
17 PKG_MD5SUM:=6760e5819f4238328709bf93bf10071c
18 PKG_CAT:=zcat
19
20 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
21 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
22
23 include $(INCLUDE_DIR)/package.mk
24
25 define Package/liblzo
26 SECTION:=libs
27 CATEGORY:=Libraries
28 TITLE:=A real-time data compression library
29 URL:=http://www.oberhumer.com/opensource/lzo/
30 endef
31
32 define Build/Configure
33 $(call Build/Configure/Default, \
34 --enable-shared \
35 --enable-static \
36 )
37 endef
38
39 define Build/Compile
40 $(MAKE) -C $(PKG_BUILD_DIR) \
41 CFLAGS_O="$(TARGET_CFLAGS)" \
42 DESTDIR="$(PKG_INSTALL_DIR)" \
43 all install
44 endef
45
46 define Build/InstallDev
47 mkdir -p $(STAGING_DIR)/usr/include
48 $(CP) $(PKG_INSTALL_DIR)/usr/include/lzo $(STAGING_DIR)/usr/include/
49 mkdir -p $(STAGING_DIR)/usr/lib
50 $(CP) $(PKG_INSTALL_DIR)/usr/lib/liblzo2.{a,so*} $(STAGING_DIR)/usr/lib/
51 endef
52
53 define Build/UninstallDev
54 rm -rf \
55 $(STAGING_DIR)/usr/include/lzo* \
56 $(STAGING_DIR)/usr/lib/liblzo2.{a,so*}
57 endef
58
59 define Package/liblzo/install
60 $(INSTALL_DIR) $(1)/usr/lib
61 $(CP) $(PKG_INSTALL_DIR)/usr/lib/liblzo2.so.* $(1)/usr/lib
62 endef
63
64 $(eval $(call BuildPackage,liblzo))