opkg: move the build dir to KERNEL_BUILD_DIR, as compilation is target dependent
[openwrt.git] / package / opkg / Makefile
1 #
2 # Copyright (C) 2006-2009 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:=215
12 PKG_VERSION:=$(PKG_REV)
13 PKG_RELEASE:=2
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 include $(INCLUDE_DIR)/package.mk
22
23 define Package/opkg
24 SECTION:=base
25 CATEGORY:=Base system
26 TITLE:=opkg package management system
27 URL:=http://wiki.openmoko.org/wiki/Opkg
28 endef
29
30 define Package/opkg/description
31 Lightweight package management system
32 opkg is the opkg Package Management System, for handling
33 installation and removal of packages on a system. It can
34 recursively follow dependencies and download all packages
35 necessary to install a particular package.
36
37 opkg knows how to install both .ipk and .deb packages.
38 endef
39
40 define Package/opkg/conffiles
41 /etc/opkg.conf
42 endef
43
44 TARGET_CFLAGS += $(FPIC) $(if $(CONFIG_GCC_VERSION_4_3)$(CONFIG_GCC_VERSION_4_4),-Wno-array-bounds)
45 EXTRA_CFLAGS += $(TARGET_CPPFLAGS)
46 EXTRA_LDFLAGS += $(TARGET_LDFLAGS) -Wl,-rpath-link,$(STAGING_DIR)/usr/lib
47
48 CONFIGURE_ARGS += \
49 --disable-curl \
50 --disable-gpg \
51 --with-ipkgetcdir=/etc
52
53 define Build/Configure
54 (cd $(PKG_BUILD_DIR); \
55 autoreconf -v --install || exit 1 \
56 );
57 $(call Build/Configure/Default)
58 endef
59
60 define Build/Compile
61 $(MAKE) -C $(PKG_BUILD_DIR) \
62 CC="$(TARGET_CC)" \
63 DESTDIR="$(PKG_INSTALL_DIR)" \
64 HOST_CPU="$(PKGARCH)" \
65 all install
66 endef
67
68 define Package/opkg/install
69 $(INSTALL_DIR) $(1)/usr/lib/opkg
70 $(INSTALL_DIR) $(1)/bin
71 $(INSTALL_DIR) $(1)/etc
72 $(INSTALL_DATA) ./files/opkg.conf $(1)/etc/
73 $(SED) 's,$$$$S,$(PKGARCH),g' $(1)/etc/opkg.conf
74 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/opkg-cl $(1)/bin/opkg
75 $(INSTALL_DIR) $(1)/usr/lib
76 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libopkg.so.* $(1)/usr/lib/
77 endef
78
79 define Build/InstallDev
80 mkdir -p $(1)/usr/include
81 $(CP) $(PKG_INSTALL_DIR)/usr/include/libopkg $(1)/usr/include/
82 endef
83
84 $(eval $(call BuildPackage,opkg))
This page took 0.041728 seconds and 5 git commands to generate.