Makefile 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. #
  2. # Copyright (C) 2006-2015 OpenWrt.org
  3. # Copyright (C) 2016-2017 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. PKG_NAME:=opkg
  10. PKG_RELEASE:=1
  11. PKG_FLAGS:=essential
  12. PKG_SOURCE_PROTO:=git
  13. PKG_SOURCE_URL:=https://git.openwrt.org/project/opkg-lede.git
  14. PKG_SOURCE_DATE:=2021-01-31
  15. PKG_SOURCE_VERSION:=c5dccea956b8be14eabf6ff69b331a3e9ac36749
  16. PKG_MIRROR_HASH:=fdf42d4ecf66ebc1aded54fa29c3eb41a0e08c2c65da56b661ad1cfb275dd548
  17. PKG_LICENSE:=GPL-2.0
  18. PKG_LICENSE_FILES:=COPYING
  19. PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
  20. # Extend depends from version.mk
  21. PKG_CONFIG_DEPENDS += \
  22. CONFIG_SIGNATURE_CHECK \
  23. 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. $(INSTALL_BIN) ./files/20_migrate-feeds $(1)/etc/uci-defaults/
  73. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/opkg-cl $(1)/bin/opkg
  74. ifneq ($(CONFIG_SIGNATURE_CHECK),)
  75. echo "option check_signature" >> $(1)/etc/opkg.conf
  76. endif
  77. $(INSTALL_DIR) $(1)/usr/sbin
  78. $(INSTALL_BIN) ./files/opkg-key $(1)/usr/sbin/
  79. endef
  80. define Host/Install
  81. $(INSTALL_BIN) $(HOST_BUILD_DIR)/src/opkg-cl $(STAGING_DIR_HOST)/bin/opkg
  82. endef
  83. $(eval $(call BuildPackage,opkg))
  84. $(eval $(call HostBuild))