Makefile 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. #
  2. # Copyright (C) 2006-2011 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. include $(TOPDIR)/rules.mk
  7. include $(INCLUDE_DIR)/kernel.mk
  8. PKG_NAME:=opkg
  9. PKG_REV:=618
  10. PKG_VERSION:=$(PKG_REV)
  11. PKG_RELEASE:=1
  12. PKG_SOURCE_PROTO:=svn
  13. PKG_SOURCE_VERSION:=$(PKG_REV)
  14. PKG_SOURCE_SUBDIR:=opkg-$(PKG_VERSION)
  15. PKG_SOURCE_URL:=http://opkg.googlecode.com/svn/trunk/
  16. PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.gz
  17. PKG_FIXUP:=autoreconf
  18. PKG_REMOVE_FILES = autogen.sh aclocal.m4
  19. include $(INCLUDE_DIR)/package.mk
  20. include $(INCLUDE_DIR)/host-build.mk
  21. define Package/opkg
  22. SECTION:=base
  23. CATEGORY:=Base system
  24. TITLE:=opkg package management system
  25. MAINTAINER:=Jo-Philipp Wich <[email protected]>
  26. URL:=http://wiki.openmoko.org/wiki/Opkg
  27. endef
  28. define Package/opkg/description
  29. Lightweight package management system
  30. opkg is the opkg Package Management System, for handling
  31. installation and removal of packages on a system. It can
  32. recursively follow dependencies and download all packages
  33. necessary to install a particular package.
  34. opkg knows how to install both .ipk and .deb packages.
  35. endef
  36. define Package/opkg/conffiles
  37. /etc/opkg.conf
  38. endef
  39. TARGET_CFLAGS += $(if $(CONFIG_GCC_VERSION_4_3)$(CONFIG_GCC_VERSION_4_4),-Wno-array-bounds)
  40. TARGET_CFLAGS += -ffunction-sections -fdata-sections
  41. EXTRA_CFLAGS += $(TARGET_CPPFLAGS)
  42. CONFIGURE_ARGS += \
  43. --disable-curl \
  44. --disable-gpg \
  45. --with-opkgetcdir=/etc \
  46. --with-opkglockfile=/var/lock/opkg.lock
  47. define Build/Compile
  48. $(MAKE) -C $(PKG_BUILD_DIR) \
  49. CC="$(TARGET_CC)" \
  50. DESTDIR="$(PKG_INSTALL_DIR)" \
  51. HOST_CPU="$(PKGARCH)" \
  52. LDFLAGS="-Wl,--gc-sections" \
  53. all install
  54. endef
  55. define Package/opkg/install
  56. $(INSTALL_DIR) $(1)/usr/lib/opkg
  57. $(INSTALL_DIR) $(1)/bin
  58. $(INSTALL_DIR) $(1)/etc
  59. $(INSTALL_DATA) ./files/opkg.conf $(1)/etc/
  60. $(SED) 's,$$$$S,$(PKGARCH),g' $(1)/etc/opkg.conf
  61. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/opkg-cl $(1)/bin/opkg
  62. endef
  63. define Build/InstallDev
  64. mkdir -p $(1)/usr/include
  65. $(CP) $(PKG_INSTALL_DIR)/usr/include/libopkg $(1)/usr/include/
  66. endef
  67. HOST_CONFIGURE_ARGS+= \
  68. --disable-curl \
  69. --disable-gpg \
  70. --with-opkgetcdir=/etc \
  71. --with-opkglockfile=/tmp/opkg.lock
  72. define Host/Compile
  73. $(MAKE) -C $(HOST_BUILD_DIR) CC="$(HOSTCC)" all
  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))