source: trunk/package/compcache/Makefile @ 21441

Last change on this file since 21441 was 21441, checked in by lars, 7 years ago

[package] compcache: Kernel module and userspace daemon in seperate packages.

File size: 2.3 KB
Line 
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
8include $(TOPDIR)/rules.mk
9include $(INCLUDE_DIR)/kernel.mk
10
11PKG_NAME:=compcache
12PKG_VERSION:=0.6.2
13PKG_RELEASE:=$(PKG_VERSION)-1
14PKG_SOURCE_URL:=http://compcache.googlecode.com/files/
15PKG_MD5SUM:=27aec78dc50e34fb800c74e879057743
16
17PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
18
19include $(INCLUDE_DIR)/package.mk
20
21define 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/
29endef
30
31define 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
38endef
39
40include $(INCLUDE_DIR)/kernel-defaults.mk
41
42LZO = sub-projects/compression/lzo-kmod
43RZSC = sub-projects/rzscontrol
44
45BUILDFLAGS:=-DCONFIG_RAMZSWAP_STATS \
46            -I$(PKG_BUILD_DIR)/$(LZO) \
47            -Wall
48
49RZSCFLAGS:=-I$(PKG_BUILD_DIR)/$(RZSC)/../include \
50           -I$(PKG_BUILD_DIR)/$(RZSC)/../..
51
52define 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
55endef
56
57define 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
68endef
69
70define Package/compcache/config
71        source "$(SOURCE)/Config.in"
72endef
73
74$(eval $(call BuildPackage,compcache))
75$(eval $(call KernelPackage,ramzswap))
Note: See TracBrowser for help on using the repository browser.