Makefile 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. #
  2. # Copyright (C) 2006-2010 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:=576
  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 = libtool
  18. include $(INCLUDE_DIR)/package.mk
  19. include $(INCLUDE_DIR)/host-build.mk
  20. define Package/opkg
  21. SECTION:=base
  22. CATEGORY:=Base system
  23. TITLE:=opkg package management system
  24. MAINTAINER:=Jo-Philipp Wich <[email protected]>
  25. URL:=http://wiki.openmoko.org/wiki/Opkg
  26. endef
  27. define Package/opkg/description
  28. Lightweight package management system
  29. opkg is the opkg Package Management System, for handling
  30. installation and removal of packages on a system. It can
  31. recursively follow dependencies and download all packages
  32. necessary to install a particular package.
  33. opkg knows how to install both .ipk and .deb packages.
  34. endef
  35. define Package/opkg/conffiles
  36. /etc/opkg.conf
  37. endef
  38. TARGET_CFLAGS += $(if $(CONFIG_GCC_VERSION_4_3)$(CONFIG_GCC_VERSION_4_4),-Wno-array-bounds)
  39. EXTRA_CFLAGS += $(TARGET_CPPFLAGS)
  40. CONFIGURE_ARGS += \
  41. --disable-curl \
  42. --disable-gpg \
  43. --with-opkgetcdir=/etc \
  44. --with-opkglockfile=/var/lock/opkg.lock
  45. define Build/Configure
  46. (cd $(PKG_BUILD_DIR); \
  47. autoreconf -v --install || exit 1 \
  48. );
  49. $(call Build/Configure/Default)
  50. endef
  51. define Build/Compile
  52. $(MAKE) -C $(PKG_BUILD_DIR) \
  53. CC="$(TARGET_CC)" \
  54. DESTDIR="$(PKG_INSTALL_DIR)" \
  55. HOST_CPU="$(PKGARCH)" \
  56. all install
  57. endef
  58. define Package/opkg/install
  59. $(INSTALL_DIR) $(1)/usr/lib/opkg
  60. $(INSTALL_DIR) $(1)/bin
  61. $(INSTALL_DIR) $(1)/etc
  62. $(INSTALL_DATA) ./files/opkg.conf $(1)/etc/
  63. $(SED) 's,$$$$S,$(PKGARCH),g' $(1)/etc/opkg.conf
  64. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/opkg-cl $(1)/bin/opkg
  65. endef
  66. define Build/InstallDev
  67. mkdir -p $(1)/usr/include
  68. $(CP) $(PKG_INSTALL_DIR)/usr/include/libopkg $(1)/usr/include/
  69. endef
  70. HOST_BUILD_DEPENDS:=libtool/host
  71. HOST_CONFIGURE_ARGS+= \
  72. --disable-curl \
  73. --disable-gpg \
  74. --with-opkgetcdir=/etc \
  75. --with-opkglockfile=/tmp/opkg.lock
  76. define Host/Configure
  77. (cd $(HOST_BUILD_DIR); autoreconf -v --install || exit 1)
  78. $(call Host/Configure/Default)
  79. endef
  80. define Host/Compile
  81. $(MAKE) -C $(HOST_BUILD_DIR) CC="$(HOSTCC)" all
  82. endef
  83. define Host/Install
  84. $(INSTALL_BIN) $(HOST_BUILD_DIR)/src/opkg-cl $(STAGING_DIR_HOST)/bin/opkg
  85. endef
  86. $(eval $(call BuildPackage,opkg))
  87. $(eval $(call HostBuild))