2 # Copyright (C) 2006-2015 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_MAINTAINER:=Jo-Philipp Wich <jow@openwrt.org>
31 PKG_CONFIG_DEPENDS := CONFIG_SIGNED_PACKAGES
34 HOST_BUILD_PARALLEL:=1
37 include $(INCLUDE_DIR)/package.mk
38 include $(INCLUDE_DIR)/host-build.mk
40 define Package/opkg/Default
43 TITLE:=opkg package manager
44 URL:=http://wiki.openmoko.org/wiki/Opkg
47 define Package/opkg/Default/description
48 Lightweight package management system
49 opkg is the opkg Package Management System, for handling
50 installation and removal of packages on a system. It can
51 recursively follow dependencies and download all packages
52 necessary to install a particular package.
54 opkg knows how to install both .ipk and .deb packages.
58 $(call Package/opkg/Default)
62 define Package/opkg/description
63 $(call Package/opkg/Default/description)
66 define Package/opkg/conffiles
69 /etc/opkg/customfeeds.conf
73 define Package/opkg-smime
74 $(call Package/opkg/Default)
75 TITLE+= (with S/MIME signature support)
76 DEPENDS+=+PACKAGE_opkg-smime:libopenssl
80 define Package/opkg-smime/description
81 $(call Package/opkg/Default/description)
83 This package allows the Package index to be verified with S/MIME.
86 Package/opkg-smime/conffiles = $(Package/opkg/conffiles)
88 TARGET_CFLAGS += -ffunction-sections -fdata-sections
89 EXTRA_CFLAGS += $(TARGET_CPPFLAGS)
95 --with-opkgetcdir=/etc \
96 --with-opkglockfile=/var/lock/opkg.lock
98 ifeq ($(BUILD_VARIANT),smime)
99 CONFIGURE_ARGS += --enable-openssl --disable-usign
101 ifndef CONFIG_SIGNED_PACKAGES
102 CONFIGURE_ARGS += --disable-usign
108 DESTDIR="$(PKG_INSTALL_DIR)" \
109 HOST_CPU="$(PKGARCH)" \
110 LDFLAGS="-Wl,--gc-sections" \
112 define Package/opkg/Default/install
113 $(INSTALL_DIR) $(1)/usr/lib/opkg
114 $(INSTALL_DIR) $(1)/bin
115 $(INSTALL_DIR) $(1)/etc/opkg
116 $(INSTALL_DIR) $(1)/etc/uci-defaults
117 $(INSTALL_DATA) ./files/customfeeds.conf $(1)/etc/opkg/customfeeds.conf
118 $(INSTALL_DATA) ./files/opkg$(2).conf $(1)/etc/opkg.conf
119 $(call FeedSourcesAppend,$(1)/etc/opkg/distfeeds.conf)
120 $(VERSION_SED) $(1)/etc/opkg/distfeeds.conf
121 $(INSTALL_BIN) ./files/20_migrate-feeds $(1)/etc/uci-defaults/
122 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/opkg-cl $(1)/bin/opkg
125 define Package/opkg/install
126 $(call Package/opkg/Default/install,$(1),)
127 ifneq ($(CONFIG_SIGNED_PACKAGES),)
128 echo "option check_signature 1" >> $(1)/etc/opkg.conf
131 $(INSTALL_BIN) ./files/opkg-key $(1)/usr/sbin/
134 define Package/opkg-smime/install
135 $(call Package/opkg/Default/install,$(1),-smime)
136 $(INSTALL_DIR) $(1)/etc/ssl/certs
137 $(if $(CONFIG_OPKGSMIME_CERT),$(INSTALL_DATA) $(call qstrip,$(CONFIG_OPKGSMIME_CERT)) $(1)/etc/ssl/certs/opkg.pem,)
140 define Build/InstallDev
141 mkdir -p $(1)/usr/include
142 $(CP) $(PKG_INSTALL_DIR)/usr/include/libopkg $(1)/usr/include/
146 HOST_CONFIGURE_ARGS+= \
150 --with-opkgetcdir=/etc \
151 --with-opkglockfile=/tmp/opkg.lock
154 +$(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) CC="$(HOSTCC)" all
158 $(INSTALL_BIN) $(HOST_BUILD_DIR)/src/opkg-cl $(STAGING_DIR_HOST)/bin/opkg
161 $(eval $(call BuildPackage,opkg))
162 $(eval $(call BuildPackage,opkg-smime))
163 $(eval $(call HostBuild))