1fcd196cf522169f2d5427bca72daba32f139cf4
[openwrt/staging/chunkeey.git] / package / opkg / Makefile
1 #
2 # Copyright (C) 2006-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 include $(TOPDIR)/rules.mk
8 include $(INCLUDE_DIR)/kernel.mk
9
10 PKG_NAME:=opkg
11 PKG_REV:=563
12 PKG_VERSION:=$(PKG_REV)
13 PKG_RELEASE:=3
14
15 PKG_SOURCE_PROTO:=svn
16 PKG_SOURCE_VERSION:=$(PKG_REV)
17 PKG_SOURCE_SUBDIR:=opkg-$(PKG_VERSION)
18 PKG_SOURCE_URL:=http://opkg.googlecode.com/svn/trunk/
19 PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.gz
20 PKG_FIXUP = libtool
21
22 include $(INCLUDE_DIR)/package.mk
23 include $(INCLUDE_DIR)/host-build.mk
24
25 define Package/opkg
26 SECTION:=base
27 CATEGORY:=Base system
28 TITLE:=opkg package management system
29 MAINTAINER:=Jo-Philipp Wich <xm@subsignal.org>
30 URL:=http://wiki.openmoko.org/wiki/Opkg
31 endef
32
33 define Package/opkg/description
34 Lightweight package management system
35 opkg is the opkg Package Management System, for handling
36 installation and removal of packages on a system. It can
37 recursively follow dependencies and download all packages
38 necessary to install a particular package.
39
40 opkg knows how to install both .ipk and .deb packages.
41 endef
42
43 define Package/opkg/conffiles
44 /etc/opkg.conf
45 endef
46
47 TARGET_CFLAGS += $(if $(CONFIG_GCC_VERSION_4_3)$(CONFIG_GCC_VERSION_4_4),-Wno-array-bounds)
48 EXTRA_CFLAGS += $(TARGET_CPPFLAGS)
49
50 CONFIGURE_ARGS += \
51 --disable-curl \
52 --disable-gpg \
53 --with-opkgetcdir=/etc \
54 --with-opkglockfile=/var/lock/opkg.lock
55
56 define Build/Configure
57 (cd $(PKG_BUILD_DIR); \
58 autoreconf -v --install || exit 1 \
59 );
60 $(call Build/Configure/Default)
61 endef
62
63 define Build/Compile
64 $(MAKE) -C $(PKG_BUILD_DIR) \
65 CC="$(TARGET_CC)" \
66 DESTDIR="$(PKG_INSTALL_DIR)" \
67 HOST_CPU="$(PKGARCH)" \
68 all install
69 endef
70
71 define Package/opkg/install
72 $(INSTALL_DIR) $(1)/usr/lib/opkg
73 $(INSTALL_DIR) $(1)/bin
74 $(INSTALL_DIR) $(1)/etc
75 $(INSTALL_DATA) ./files/opkg.conf $(1)/etc/
76 $(SED) 's,$$$$S,$(PKGARCH),g' $(1)/etc/opkg.conf
77 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/opkg-cl $(1)/bin/opkg
78 endef
79
80 define Build/InstallDev
81 mkdir -p $(1)/usr/include
82 $(CP) $(PKG_INSTALL_DIR)/usr/include/libopkg $(1)/usr/include/
83 endef
84
85
86 HOST_BUILD_DEPENDS:=libtool/host
87
88 HOST_CONFIGURE_ARGS+= \
89 --disable-curl \
90 --disable-gpg \
91 --with-opkgetcdir=/etc \
92 --with-opkglockfile=/tmp/opkg.lock
93
94 define Host/Configure
95 (cd $(HOST_BUILD_DIR); autoreconf -v --install || exit 1)
96 $(call Host/Configure/Default)
97 endef
98
99 define Host/Compile
100 $(MAKE) -C $(HOST_BUILD_DIR) CC="$(HOSTCC)" all
101 endef
102
103 define Host/Install
104 $(INSTALL_BIN) $(HOST_BUILD_DIR)/src/opkg-cl $(STAGING_DIR_HOST)/bin/opkg
105 endef
106
107 $(eval $(call BuildPackage,opkg))
108 $(eval $(call HostBuild))