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 DEPENDS:=+uclient-fetch
45 URL:=http://wiki.openmoko.org/wiki/Opkg
48 define Package/opkg/Default/description
49 Lightweight package management system
50 opkg is the opkg Package Management System, for handling
51 installation and removal of packages on a system. It can
52 recursively follow dependencies and download all packages
53 necessary to install a particular package.
55 opkg knows how to install both .ipk and .deb packages.
59 $(call Package/opkg/Default)
63 define Package/opkg/description
64 $(call Package/opkg/Default/description)
67 define Package/opkg/conffiles
70 /etc/opkg/customfeeds.conf
74 define Package/opkg-smime
75 $(call Package/opkg/Default)
76 TITLE+= (with S/MIME signature support)
77 DEPENDS+=+PACKAGE_opkg-smime:libopenssl
81 define Package/opkg-smime/description
82 $(call Package/opkg/Default/description)
84 This package allows the Package index to be verified with S/MIME.
87 Package/opkg-smime/conffiles = $(Package/opkg/conffiles)
89 TARGET_CFLAGS += -ffunction-sections -fdata-sections
90 EXTRA_CFLAGS += $(TARGET_CPPFLAGS)
96 --with-opkgetcdir=/etc \
97 --with-opkglockfile=/var/lock/opkg.lock
99 ifeq ($(BUILD_VARIANT),smime)
100 CONFIGURE_ARGS += --enable-openssl --disable-usign
102 ifndef CONFIG_SIGNED_PACKAGES
103 CONFIGURE_ARGS += --disable-usign
109 DESTDIR="$(PKG_INSTALL_DIR)" \
110 HOST_CPU="$(PKGARCH)" \
111 LDFLAGS="-Wl,--gc-sections" \
113 define Package/opkg/Default/install
114 $(INSTALL_DIR) $(1)/usr/lib/opkg
115 $(INSTALL_DIR) $(1)/bin
116 $(INSTALL_DIR) $(1)/etc/opkg
117 $(INSTALL_DIR) $(1)/etc/uci-defaults
118 $(INSTALL_DATA) ./files/customfeeds.conf $(1)/etc/opkg/customfeeds.conf
119 $(INSTALL_DATA) ./files/opkg$(2).conf $(1)/etc/opkg.conf
120 $(call FeedSourcesAppend,$(1)/etc/opkg/distfeeds.conf)
121 $(VERSION_SED) $(1)/etc/opkg/distfeeds.conf
122 $(INSTALL_BIN) ./files/20_migrate-feeds $(1)/etc/uci-defaults/
123 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/opkg-cl $(1)/bin/opkg
126 define Package/opkg/install
127 $(call Package/opkg/Default/install,$(1),)
128 ifneq ($(CONFIG_SIGNED_PACKAGES),)
129 echo "option check_signature 1" >> $(1)/etc/opkg.conf
132 $(INSTALL_BIN) ./files/opkg-key $(1)/usr/sbin/
135 define Package/opkg-smime/install
136 $(call Package/opkg/Default/install,$(1),-smime)
137 $(INSTALL_DIR) $(1)/etc/ssl/certs
138 $(if $(CONFIG_OPKGSMIME_CERT),$(INSTALL_DATA) $(call qstrip,$(CONFIG_OPKGSMIME_CERT)) $(1)/etc/ssl/certs/opkg.pem,)
141 define Build/InstallDev
142 mkdir -p $(1)/usr/include
143 $(CP) $(PKG_INSTALL_DIR)/usr/include/libopkg $(1)/usr/include/
147 HOST_CONFIGURE_ARGS+= \
151 --with-opkgetcdir=/etc \
152 --with-opkglockfile=/tmp/opkg.lock
155 +$(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) CC="$(HOSTCC)" all
159 $(INSTALL_BIN) $(HOST_BUILD_DIR)/src/opkg-cl $(STAGING_DIR_HOST)/bin/opkg
162 $(eval $(call BuildPackage,opkg))
163 $(eval $(call BuildPackage,opkg-smime))
164 $(eval $(call HostBuild))