2 # Copyright (C) 2006-2014 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
7 include $(TOPDIR)/rules.mk
8 include $(INCLUDE_DIR)/kernel.mk
9 include $(INCLUDE_DIR)/version.mk
10 include $(INCLUDE_DIR)/feeds.mk
13 PKG_REV:=9c97d5ecd795709c8584e972bfdf3aee3a5b846d
14 PKG_VERSION:=$(PKG_REV)
18 PKG_SOURCE_VERSION:=$(PKG_REV)
19 PKG_SOURCE_SUBDIR:=opkg-$(PKG_VERSION)
20 PKG_SOURCE_URL:=http://git.yoctoproject.org/git/opkg
21 PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.gz
22 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
24 PKG_REMOVE_FILES = autogen.sh aclocal.m4
27 PKG_LICENSE_FILES:=COPYING
29 PKG_CONFIG_DEPENDS := CONFIG_SIGNED_PACKAGES
32 HOST_BUILD_PARALLEL:=1
35 include $(INCLUDE_DIR)/package.mk
36 include $(INCLUDE_DIR)/host-build.mk
38 define Package/opkg/Default
41 TITLE:=opkg package manager
42 MAINTAINER:=Jo-Philipp Wich <xm@subsignal.org>
43 URL:=http://wiki.openmoko.org/wiki/Opkg
46 define Package/opkg/Default/description
47 Lightweight package management system
48 opkg is the opkg Package Management System, for handling
49 installation and removal of packages on a system. It can
50 recursively follow dependencies and download all packages
51 necessary to install a particular package.
53 opkg knows how to install both .ipk and .deb packages.
57 $(call Package/opkg/Default)
61 define Package/opkg/description
62 $(call Package/opkg/Default/description)
65 define Package/opkg/conffiles
70 define Package/opkg-smime
71 $(call Package/opkg/Default)
72 TITLE+= (with S/MIME signature support)
77 define Package/opkg-smime/description
78 $(call Package/opkg/Default/description)
80 This package allows the Package index to be verified with S/MIME.
83 Package/opkg-smime/conffiles = $(Package/opkg/conffiles)
85 TARGET_CFLAGS += $(if $(CONFIG_GCC_VERSION_4_3)$(CONFIG_GCC_VERSION_4_4),-Wno-array-bounds)
86 TARGET_CFLAGS += -ffunction-sections -fdata-sections
87 EXTRA_CFLAGS += $(TARGET_CPPFLAGS)
93 --with-opkgetcdir=/etc \
94 --with-opkglockfile=/var/lock/opkg.lock
96 ifeq ($(BUILD_VARIANT),smime)
97 CONFIGURE_ARGS += --enable-openssl --disable-usign
99 ifndef CONFIG_SIGNED_PACKAGES
100 CONFIGURE_ARGS += --disable-usign
106 DESTDIR="$(PKG_INSTALL_DIR)" \
107 HOST_CPU="$(PKGARCH)" \
108 LDFLAGS="-Wl,--gc-sections" \
110 define Package/opkg/Default/install
111 $(INSTALL_DIR) $(1)/usr/lib/opkg
112 $(INSTALL_DIR) $(1)/bin
113 $(INSTALL_DIR) $(1)/etc
114 $(INSTALL_DATA) ./files/opkg$(2).conf $(1)/etc/opkg.conf
115 $(call FeedSourcesAppend,$(1)/etc/opkg.conf)
116 $(VERSION_SED) $(1)/etc/opkg.conf
117 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/opkg-cl $(1)/bin/opkg
120 define Package/opkg/install
121 $(call Package/opkg/Default/install,$(1),)
122 ifneq ($(CONFIG_SIGNED_PACKAGES),)
123 echo "option check_signature 1" >> $(1)/etc/opkg.conf
126 $(INSTALL_BIN) ./files/opkg-key $(1)/usr/sbin/
129 define Package/opkg-smime/install
130 $(call Package/opkg/Default/install,$(1),-smime)
131 $(INSTALL_DIR) $(1)/etc/ssl/certs
132 $(if $(CONFIG_OPKGSMIME_CERT),$(INSTALL_DATA) $(call qstrip,$(CONFIG_OPKGSMIME_CERT)) $(1)/etc/ssl/certs/opkg.pem,)
135 define Build/InstallDev
136 mkdir -p $(1)/usr/include
137 $(CP) $(PKG_INSTALL_DIR)/usr/include/libopkg $(1)/usr/include/
141 HOST_CONFIGURE_ARGS+= \
145 --with-opkgetcdir=/etc \
146 --with-opkglockfile=/tmp/opkg.lock
149 +$(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) CC="$(HOSTCC)" all
153 $(INSTALL_BIN) $(HOST_BUILD_DIR)/src/opkg-cl $(STAGING_DIR_HOST)/bin/opkg
156 $(eval $(call BuildPackage,opkg))
157 $(eval $(call BuildPackage,opkg-smime))
158 $(eval $(call HostBuild))