eb2e2d11b947c9e95b402d6dabd79549a6f9a0d2
[openwrt.git] / package / compcache / Makefile
1 #
2 # Copyright (C) 2009-2010 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9 include $(INCLUDE_DIR)/kernel.mk
10
11 PKG_NAME:=compcache
12 PKG_VERSION:=0.6.2
13 PKG_RELEASE:=2
14 PKG_SOURCE_URL:=http://compcache.googlecode.com/files/
15 PKG_MD5SUM:=27aec78dc50e34fb800c74e879057743
16
17 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
18
19 include $(INCLUDE_DIR)/package.mk
20
21 define KernelPackage/ramzswap
22 SUBMENU:=Other modules
23 DEPENDS:=@LINUX_2_6 @BUSYBOX_CONFIG_SWAPONOFF
24 TITLE:=Driver for compressed ram swap device
25 VERSION:=$(LINUX_VERSION)-$(BOARD)-$(LINUX_RELEASE)+$(PKG_RELEASE)
26 FILES:=$(PKG_BUILD_DIR)/ramzswap.$(LINUX_KMOD_SUFFIX) \
27 $(PKG_BUILD_DIR)/sub-projects/compression/lzo-kmod/lzo1x.$(LINUX_KMOD_SUFFIX)
28 URL:=http://code.google.com/p/compcache/
29 endef
30
31 define Package/compcache
32 SECTION:=util
33 CATEGORY:=Utilities
34 DEPENDS:=+kmod-ramzswap
35 TITLE:=Compressed ram swap device
36 URL:=http://code.google.com/p/compcache/
37 MENU:=1
38 endef
39
40 include $(INCLUDE_DIR)/kernel-defaults.mk
41
42 LZO = sub-projects/compression/lzo-kmod
43 RZSC = sub-projects/rzscontrol
44
45 BUILDFLAGS:=-DCONFIG_RAMZSWAP_STATS \
46 -I$(PKG_BUILD_DIR)/$(LZO) \
47 -Wall
48
49 RZSCFLAGS:=-I$(PKG_BUILD_DIR)/$(RZSC)/../include \
50 -I$(PKG_BUILD_DIR)/$(RZSC)/../..
51
52 define Build/Compile
53 $(MAKE) $(KERNEL_MAKEOPTS) EXTRA_CFLAGS="$(BUILDFLAGS)" M="$(PKG_BUILD_DIR)" modules
54 $(TARGET_CC) $(TARGET_CFLAGS) $(RZSCFLAGS) $(PKG_BUILD_DIR)/$(RZSC)/rzscontrol.c -o $(PKG_BUILD_DIR)/rzscontrol
55 endef
56
57 define Package/compcache/install
58 $(INSTALL_DIR) $(1)/etc/config
59 $(INSTALL_DATA) ./files/compcache.config $(1)/etc/config/compcache
60 $(SED) 's,%ENABLED%,$(if $(CONFIG_COMPCACHE_ENABLE),1,0),g' \
61 -e 's,%RAM_REPORTED%,$(call qstrip,$(CONFIG_COMPCACHE_RAM_REPORTED)),g' \
62 -e 's,%BACKUP_DEV%,$(call qstrip,$(CONFIG_COMPCACHE_BACKUP_DEV)),g' \
63 $(1)/etc/config/compcache
64 $(INSTALL_DIR) $(1)/etc/init.d
65 $(INSTALL_BIN) ./files/compcache.init $(1)/etc/init.d/compcache
66 $(INSTALL_DIR) $(1)/sbin
67 $(INSTALL_BIN) $(PKG_BUILD_DIR)/rzscontrol $(1)/sbin/rzscontrol
68 endef
69
70 define Package/compcache/config
71 source "$(SOURCE)/Config.in"
72 endef
73
74 $(eval $(call BuildPackage,compcache))
75 $(eval $(call KernelPackage,ramzswap))
This page took 0.040632 seconds and 3 git commands to generate.