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