bcm53xx: use USB patches sent upstream by Hauke
[15.05/openwrt.git] / package / system / opkg / Makefile
1 #
2 # Copyright (C) 2006-2014 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 include $(INCLUDE_DIR)/feeds.mk
11
12 PKG_NAME:=opkg
13 PKG_REV:=9c97d5ecd795709c8584e972bfdf3aee3a5b846d
14 PKG_VERSION:=$(PKG_REV)
15 PKG_RELEASE:=7
16
17 PKG_SOURCE_PROTO:=git
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)
23 PKG_FIXUP:=autoreconf
24 PKG_REMOVE_FILES = autogen.sh aclocal.m4
25
26 PKG_LICENSE:=GPL-2.0
27 PKG_LICENSE_FILES:=COPYING
28
29 PKG_CONFIG_DEPENDS := CONFIG_SIGNED_PACKAGES
30
31 PKG_BUILD_PARALLEL:=1
32 HOST_BUILD_PARALLEL:=1
33 PKG_INSTALL:=1
34
35 include $(INCLUDE_DIR)/package.mk
36 include $(INCLUDE_DIR)/host-build.mk
37
38 define Package/opkg/Default
39   SECTION:=base
40   CATEGORY:=Base system
41   TITLE:=opkg package manager
42   MAINTAINER:=Jo-Philipp Wich <xm@subsignal.org>
43   URL:=http://wiki.openmoko.org/wiki/Opkg
44 endef
45
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.
52
53   opkg knows how to install both .ipk and .deb packages.
54 endef
55
56 define Package/opkg
57   $(call Package/opkg/Default)
58   VARIANT:=unsigned
59 endef
60
61 define Package/opkg/description
62   $(call Package/opkg/Default/description)
63 endef
64
65 define Package/opkg/conffiles
66 /etc/opkg.conf
67 endef
68
69
70 define Package/opkg-smime
71   $(call Package/opkg/Default)
72   TITLE+= (with S/MIME signature support)
73   DEPENDS+=+libopenssl
74   VARIANT:=smime
75 endef
76
77 define Package/opkg-smime/description
78   $(call Package/opkg/Default/description)
79
80   This package allows the Package index to be verified with S/MIME.
81 endef
82
83 Package/opkg-smime/conffiles = $(Package/opkg/conffiles)
84
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)
88
89 CONFIGURE_ARGS += \
90         --disable-curl \
91         --disable-gpg \
92         --enable-sha256 \
93         --with-opkgetcdir=/etc \
94         --with-opkglockfile=/var/lock/opkg.lock
95
96 ifeq ($(BUILD_VARIANT),smime)
97         CONFIGURE_ARGS += --enable-openssl --disable-usign
98 else
99   ifndef CONFIG_SIGNED_PACKAGES
100     CONFIGURE_ARGS += --disable-usign
101   endif
102 endif
103
104 MAKE_FLAGS = \
105                 CC="$(TARGET_CC)" \
106                 DESTDIR="$(PKG_INSTALL_DIR)" \
107                 HOST_CPU="$(PKGARCH)" \
108                 LDFLAGS="-Wl,--gc-sections" \
109
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   ifneq ($(CONFIG_SIGNED_PACKAGES),)
116         echo "option check_signature 1" >> $(1)/etc/opkg.conf
117   endif
118         $(call FeedSourcesAppend,$(1)/etc/opkg.conf)
119         $(VERSION_SED) $(1)/etc/opkg.conf
120         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/opkg-cl $(1)/bin/opkg
121 endef
122
123 define Package/opkg/install
124         $(call Package/opkg/Default/install,$(1),)
125         mkdir $(1)/usr/sbin
126         $(INSTALL_BIN) ./files/opkg-key $(1)/usr/sbin/
127 endef
128
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,)
133 endef
134
135 define Build/InstallDev
136         mkdir -p $(1)/usr/include
137         $(CP) $(PKG_INSTALL_DIR)/usr/include/libopkg $(1)/usr/include/
138 endef
139
140
141 HOST_CONFIGURE_ARGS+= \
142         --disable-curl \
143         --disable-gpg \
144         --enable-sha256 \
145         --with-opkgetcdir=/etc \
146         --with-opkglockfile=/tmp/opkg.lock
147
148 define Host/Compile
149         +$(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) CC="$(HOSTCC)" all
150 endef
151
152 define Host/Install
153         $(INSTALL_BIN) $(HOST_BUILD_DIR)/src/opkg-cl $(STAGING_DIR_HOST)/bin/opkg
154 endef
155
156 $(eval $(call BuildPackage,opkg))
157 $(eval $(call BuildPackage,opkg-smime))
158 $(eval $(call HostBuild))