Makefile 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. #
  2. # Copyright (C) 2006-2015 OpenWrt.org
  3. # Copyright (C) 2016 LEDE Project
  4. #
  5. # This is free software, licensed under the GNU General Public License v2.
  6. # 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
  11. PKG_NAME:=opkg
  12. PKG_RELEASE:=1
  13. PKG_FLAGS:=essential
  14. PKG_SOURCE_PROTO:=git
  15. PKG_SOURCE_URL:=https://git.openwrt.org/project/opkg-lede.git
  16. PKG_SOURCE_DATE:=2019-01-18
  17. PKG_SOURCE_VERSION:=7708a01a084872bbe4c46f36d2da021fdeb10862
  18. PKG_MIRROR_HASH:=117148ece22e64654264afd869606ef5507edd3dc965ffe000c6b1b1074b3f4a
  19. PKG_LICENSE:=GPL-2.0
  20. PKG_LICENSE_FILES:=COPYING
  21. PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
  22. PKG_FLAGS := nonshared
  23. PKG_CONFIG_DEPENDS := CONFIG_SIGNED_PACKAGES CONFIG_TARGET_INIT_PATH
  24. PKG_BUILD_PARALLEL:=1
  25. HOST_BUILD_PARALLEL:=1
  26. PKG_INSTALL:=1
  27. HOST_BUILD_DEPENDS:=libubox/host
  28. include $(INCLUDE_DIR)/package.mk
  29. include $(INCLUDE_DIR)/host-build.mk
  30. include $(INCLUDE_DIR)/cmake.mk
  31. define Package/opkg
  32. SECTION:=base
  33. CATEGORY:=Base system
  34. TITLE:=opkg package manager
  35. DEPENDS:=+uclient-fetch +libpthread +libubox
  36. URL:=$(PKG_SOURCE_URL)
  37. MENU:=1
  38. endef
  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. opkg knows how to install both .ipk and .deb packages.
  46. endef
  47. define Package/opkg/conffiles
  48. /etc/opkg.conf
  49. /etc/opkg/keys/
  50. /etc/opkg/customfeeds.conf
  51. endef
  52. TARGET_CFLAGS += -ffunction-sections -fdata-sections
  53. EXTRA_CFLAGS += $(TARGET_CPPFLAGS)
  54. CMAKE_OPTIONS += \
  55. -DBUILD_TESTS=OFF \
  56. -DHOST_CPU=$(PKGARCH) \
  57. -DPATH_SPEC="$(TARGET_INIT_PATH)" \
  58. -DVERSION="$(PKG_SOURCE_VERSION) ($(PKG_SOURCE_DATE))"
  59. CMAKE_HOST_OPTIONS += \
  60. -DSTATIC_UBOX=ON \
  61. -DBUILD_TESTS=OFF \
  62. -DHOST_CPU=$(PKGARCH) \
  63. -DLOCK_FILE=/tmp/opkg.lock \
  64. -DVERSION="$(PKG_SOURCE_VERSION) ($(PKG_SOURCE_DATE))"
  65. define Package/opkg/install
  66. $(INSTALL_DIR) $(1)/usr/lib/opkg
  67. $(INSTALL_DIR) $(1)/bin
  68. $(INSTALL_DIR) $(1)/etc/opkg
  69. $(INSTALL_DIR) $(1)/etc/uci-defaults
  70. $(INSTALL_DATA) ./files/customfeeds.conf $(1)/etc/opkg/customfeeds.conf
  71. $(INSTALL_DATA) ./files/opkg$(2).conf $(1)/etc/opkg.conf
  72. $(call FeedSourcesAppend,$(1)/etc/opkg/distfeeds.conf)
  73. $(VERSION_SED) $(1)/etc/opkg/distfeeds.conf
  74. $(INSTALL_BIN) ./files/20_migrate-feeds $(1)/etc/uci-defaults/
  75. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/opkg-cl $(1)/bin/opkg
  76. ifneq ($(CONFIG_SIGNED_PACKAGES),)
  77. echo "option check_signature" >> $(1)/etc/opkg.conf
  78. endif
  79. $(INSTALL_DIR) $(1)/usr/sbin
  80. $(INSTALL_BIN) ./files/opkg-key $(1)/usr/sbin/
  81. endef
  82. define Host/Install
  83. $(INSTALL_BIN) $(HOST_BUILD_DIR)/src/opkg-cl $(STAGING_DIR_HOST)/bin/opkg
  84. endef
  85. $(eval $(call BuildPackage,opkg))
  86. $(eval $(call HostBuild))