2 # Copyright (C) 2009-2010 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR
)/rules.mk
9 include $(INCLUDE_DIR
)/kernel.mk
14 PKG_SOURCE_URL
:=http
://compcache.googlecode.com
/files
/
15 PKG_MD5SUM
:=27aec78dc50e34fb800c74e879057743
17 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
).
tar.gz
19 include $(INCLUDE_DIR
)/package.mk
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
/
31 define Package
/compcache
34 DEPENDS
:=+kmod-ramzswap
35 TITLE
:=Compressed ram swap device
36 URL
:=http
://code.google.com
/p
/compcache
/
40 include $(INCLUDE_DIR
)/kernel-defaults.mk
42 LZO
= sub-projects
/compression
/lzo-kmod
43 RZSC
= sub-projects
/rzscontrol
45 BUILDFLAGS
:=-DCONFIG_RAMZSWAP_STATS \
46 -I
$(PKG_BUILD_DIR
)/$(LZO
) \
49 RZSCFLAGS
:=-I
$(PKG_BUILD_DIR
)/$(RZSC
)/..
/include \
50 -I
$(PKG_BUILD_DIR
)/$(RZSC
)/..
/..
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
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
70 define Package
/compcache
/config
71 source
"$(SOURCE)/Config.in"
74 $(eval
$(call BuildPackage
,compcache
))
75 $(eval
$(call KernelPackage
,ramzswap
))