Makefile 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. # SPDX-License-Identifier: GPL-2.0-or-later
  2. #
  3. # Copyright (C) 2006-2021 OpenWrt.org
  4. #
  5. include $(TOPDIR)/rules.mk
  6. include $(INCLUDE_DIR)/kernel.mk
  7. PKG_NAME:=opkg
  8. PKG_RELEASE:=2
  9. PKG_FLAGS:=essential
  10. PKG_SOURCE_PROTO:=git
  11. PKG_SOURCE_URL=$(PROJECT_GIT)/opkg-lede.git
  12. PKG_SOURCE_DATE:=2022-02-24
  13. PKG_SOURCE_VERSION:=d038e5b6d155784575f62a66a8bb7e874173e92e
  14. PKG_MIRROR_HASH:=e5ec4ae93f6529f7f0b9acc22a9a63c1b2f27d3b30b4a82041fcd58b9bc7cdf3
  15. PKG_LICENSE:=GPL-2.0
  16. PKG_LICENSE_FILES:=COPYING
  17. PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
  18. # Extend depends from version.mk
  19. PKG_CONFIG_DEPENDS += \
  20. CONFIG_SIGNATURE_CHECK \
  21. CONFIG_TARGET_INIT_PATH
  22. HOST_BUILD_DEPENDS:=libubox/host
  23. PKG_BUILD_FLAGS:=gc-sections
  24. include $(INCLUDE_DIR)/package.mk
  25. include $(INCLUDE_DIR)/host-build.mk
  26. include $(INCLUDE_DIR)/cmake.mk
  27. define Package/opkg
  28. SECTION:=base
  29. CATEGORY:=Base system
  30. TITLE:=opkg package manager
  31. DEPENDS:=+uclient-fetch +libpthread +libubox
  32. URL:=$(PKG_SOURCE_URL)
  33. MENU:=1
  34. endef
  35. define Package/opkg/description
  36. Lightweight package management system
  37. opkg is the opkg Package Management System, for handling
  38. installation and removal of packages on a system. It can
  39. recursively follow dependencies and download all packages
  40. necessary to install a particular package.
  41. opkg knows how to install both .ipk and .deb packages.
  42. endef
  43. define Package/opkg/conffiles
  44. /etc/opkg.conf
  45. /etc/opkg/keys/
  46. /etc/opkg/customfeeds.conf
  47. endef
  48. EXTRA_CFLAGS += $(TARGET_CPPFLAGS)
  49. CMAKE_OPTIONS += \
  50. -DBUILD_TESTS=OFF \
  51. -DHOST_CPU=$(PKGARCH) \
  52. -DPATH_SPEC="$(TARGET_INIT_PATH)" \
  53. -DVERSION="$(PKG_SOURCE_VERSION) ($(PKG_SOURCE_DATE))"
  54. CMAKE_HOST_OPTIONS += \
  55. -DSTATIC_UBOX=ON \
  56. -DBUILD_TESTS=OFF \
  57. -DHOST_CPU=$(PKGARCH) \
  58. -DLOCK_FILE=/tmp/opkg.lock \
  59. -DVERSION="$(PKG_SOURCE_VERSION) ($(PKG_SOURCE_DATE))"
  60. define Package/opkg/install
  61. $(INSTALL_DIR) $(1)/usr/lib/opkg
  62. $(INSTALL_DIR) $(1)/bin
  63. $(INSTALL_DIR) $(1)/etc/opkg
  64. $(INSTALL_DIR) $(1)/etc/uci-defaults
  65. $(INSTALL_DATA) ./files/customfeeds.conf $(1)/etc/opkg/customfeeds.conf
  66. $(INSTALL_DATA) ./files/opkg$(2).conf $(1)/etc/opkg.conf
  67. $(INSTALL_BIN) ./files/20_migrate-feeds $(1)/etc/uci-defaults/
  68. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/opkg-cl $(1)/bin/opkg
  69. ifneq ($(CONFIG_SIGNATURE_CHECK),)
  70. echo "option check_signature" >> $(1)/etc/opkg.conf
  71. endif
  72. $(INSTALL_DIR) $(1)/usr/sbin
  73. $(INSTALL_BIN) ./files/opkg-key $(1)/usr/sbin/
  74. endef
  75. define Host/Install
  76. $(INSTALL_BIN) $(HOST_BUILD_DIR)/src/opkg-cl $(STAGING_DIR_HOST)/bin/opkg
  77. endef
  78. $(eval $(call BuildPackage,opkg))
  79. $(eval $(call HostBuild))