[packages] lxc: bump to latest git version
[packages.git] / utils / lxc / Makefile
1 #
2 # Copyright (C) 2013 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
10 PKG_NAME:=lxc
11 PKG_VERSION:=2013-09-24
12 PKG_RELEASE=$(PKG_SOURCE_VERSION)
13
14 PKG_SOURCE_PROTO:=git
15 PKG_SOURCE_URL:=git://github.com/lxc/lxc.git
16 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
17 PKG_SOURCE_VERSION:=9d0cda4f22f76d693e2ceef0f77f2ba24227433c
18 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
19
20 PKG_BUILD_PARALLEL:=1
21 PKG_INSTALL:=1
22
23 include $(INCLUDE_DIR)/package.mk
24
25 LXC_APPLETS += \
26         attach cgroup checkpoint console execute freeze info kill monitor \
27         restart start stop unfreeze unshare wait
28
29 LXC_SCRIPTS += \
30         checkconfig clone create destroy ls netstat ps shutdown version
31
32 DEPENDS_APPLETS = +libpthread +libcap +liblxc
33
34 DEPENDS_checkpoint = @BROKEN
35 DEPENDS_clone = @BROKEN
36 DEPENDS_create = @BROKEN
37 DEPENDS_destroy = @BROKEN
38 DEPENDS_restart = @BROKEN
39 DEPENDS_shutdown = +lxc-info +lxc-wait @BROKEN
40
41
42 define Package/lxc/Default
43   SECTION:=utils
44   CATEGORY:=Utilities
45   TITLE:=LXC userspace tools
46   URL:=http://lxc.sourceforge.net/
47   MAINTAINER:=Luka Perkov <luka@openwrt.org>
48 endef
49
50 define Package/lxc
51   $(call Package/lxc/Default)
52   DEPENDS:= \
53         +lxc-common +lxc-hooks +lxc-init +lxc-templates +liblxc \
54         $(foreach u,$(LXC_APPLETS),+lxc-$(u)) $(foreach u,$(LXC_SCRIPTS),+lxc-$(u))
55 endef
56
57 define Package/lxc/description
58  LXC is the userspace control package for Linux Containers, a lightweight
59  virtual system mechanism sometimes described as "chroot on steroids".
60 endef
61
62 define Package/lxc-common
63   $(call Package/lxc/Default)
64   TITLE:=LXC common files
65 endef
66
67 define Package/lxc-hooks
68   $(call Package/lxc/Default)
69   TITLE:=LXC virtual machine hooks
70 endef
71
72 define Package/lxc-init
73   $(call Package/lxc/Default)
74   TITLE:=Utility lxc-init from the LXC userspace tools
75   DEPENDS:= $(DEPENDS_APPLETS)
76 endef
77
78 define Package/lxc-templates
79   $(call Package/lxc/Default)
80   TITLE:=LXC virtual machine templates
81   DEPENDS:= @BROKEN
82 endef
83
84 define Package/liblxc
85   $(call Package/lxc/Default)
86   SECTION:=libs
87   CATEGORY:=Libraries
88   TITLE:=LXC userspace library
89   DEPENDS:= +libpthread +libcap
90 endef
91
92
93 CONFIGURE_ARGS+= \
94         --disable-apparmor \
95         --disable-doc \
96         --disable-examples \
97         --disable-seccomp
98
99 define Build/Configure
100         ( cd $(PKG_BUILD_DIR); ./autogen.sh );
101         $(call Build/Configure/Default)
102 endef
103
104
105 define Build/InstallDev
106         $(INSTALL_DIR) $(1)/usr/include/lxc/
107         $(CP) \
108                 $(PKG_INSTALL_DIR)/usr/include/lxc/* \
109                 $(1)/usr/include/lxc/
110
111         $(INSTALL_DIR) $(1)/usr/lib
112         $(CP) \
113                 $(PKG_INSTALL_DIR)/usr/lib/liblxc.so* \
114                 $(1)/usr/lib/
115
116         $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
117         $(CP) \
118                 $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/lxc.pc \
119                 $(1)/usr/lib/pkgconfig/
120 endef
121
122
123 define Package/lxc/install
124         true
125 endef
126
127 define Package/lxc-common/conffiles
128 /etc/lxc/default.conf
129 /etc/lxc/lxc.conf
130 endef
131
132 define Package/lxc-common/install
133         $(INSTALL_DIR) $(1)/usr/lib/lxc/rootfs
134         $(CP) \
135                 $(PKG_INSTALL_DIR)/usr/lib/lxc/rootfs/README \
136                 $(1)/usr/lib/lxc/rootfs/
137
138         $(INSTALL_DIR) $(1)/usr/share/lxc
139         $(CP) \
140                 $(PKG_INSTALL_DIR)/usr/share/lxc/lxc.functions \
141                 $(1)/usr/share/lxc/
142
143         $(INSTALL_DIR) $(1)/etc/lxc/
144         $(CP) \
145                 $(PKG_INSTALL_DIR)/etc/lxc/default.conf \
146                 $(1)/etc/lxc/
147 endef
148
149 define Package/lxc-init/install
150         $(INSTALL_DIR) $(1)/usr/lib/lxc
151         $(CP) \
152                 $(PKG_INSTALL_DIR)/usr/lib/lxc/lxc-init \
153                 $(1)/usr/lib/lxc/
154 endef
155
156 define Package/lxc-hooks/install
157         $(INSTALL_DIR) $(1)/usr/share/lxc/hooks
158         $(CP) \
159                 $(PKG_INSTALL_DIR)/usr/share/lxc/hooks/mountcgroups \
160                 $(1)/usr/share/lxc/hooks/
161         $(CP) \
162                 $(PKG_INSTALL_DIR)/usr/share/lxc/hooks/mountecryptfsroot \
163                 $(1)/usr/share/lxc/hooks/
164 endef
165
166 define Package/lxc-templates/install
167         $(INSTALL_DIR) $(1)/usr/share/lxc/templates/
168         $(CP) \
169                 $(PKG_INSTALL_DIR)/usr/share/lxc/templates/lxc-* \
170                 $(1)/usr/share/lxc/templates/
171 endef
172
173 define Package/liblxc/install
174         $(INSTALL_DIR) $(1)/usr/lib/
175         $(CP) \
176                 $(PKG_INSTALL_DIR)/usr/lib/liblxc.so* \
177                 $(1)/usr/lib/
178 endef
179
180
181 define GenPlugin
182   define Package/lxc-$(1)
183     $(call Package/lxc/Default)
184     TITLE:=Utility lxc-$(1) from the LXC userspace tools
185     DEPENDS:= +lxc-common $(2) $(DEPENDS_$(1))
186   endef
187
188   define Package/lxc-$(1)/install
189         $(INSTALL_DIR) $$(1)/usr/bin
190         $(INSTALL_BIN) \
191                 $(PKG_INSTALL_DIR)/usr/bin/lxc-$(1) \
192                 $$(1)/usr/bin/
193   endef
194
195   $$(eval $$(call BuildPackage,lxc-$(1)))
196 endef
197
198
199 $(eval $(call BuildPackage,lxc))
200 $(eval $(call BuildPackage,lxc-common))
201 $(eval $(call BuildPackage,lxc-hooks))
202 $(eval $(call BuildPackage,lxc-init))
203 $(eval $(call BuildPackage,lxc-templates))
204 $(eval $(call BuildPackage,liblxc))
205 $(foreach u,$(LXC_APPLETS),$(eval $(call GenPlugin,$(u),$(DEPENDS_APPLETS))))
206 $(foreach u,$(LXC_SCRIPTS),$(eval $(call GenPlugin,$(u))))