Makefile 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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. 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. EXTRA_CFLAGS += $(TARGET_CPPFLAGS)
  41. CONFIGURE_ARGS += \
  42. --disable-curl \
  43. --disable-gpg \
  44. --with-opkgetcdir=/etc \
  45. --with-opkglockfile=/var/lock/opkg.lock
  46. define Build/Compile
  47. $(MAKE) -C $(PKG_BUILD_DIR) \
  48. CC="$(TARGET_CC)" \
  49. DESTDIR="$(PKG_INSTALL_DIR)" \
  50. HOST_CPU="$(PKGARCH)" \
  51. all install
  52. endef
  53. define Package/opkg/install
  54. $(INSTALL_DIR) $(1)/usr/lib/opkg
  55. $(INSTALL_DIR) $(1)/bin
  56. $(INSTALL_DIR) $(1)/etc
  57. $(INSTALL_DATA) ./files/opkg.conf $(1)/etc/
  58. $(SED) 's,$$$$S,$(PKGARCH),g' $(1)/etc/opkg.conf
  59. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/opkg-cl $(1)/bin/opkg
  60. endef
  61. define Build/InstallDev
  62. mkdir -p $(1)/usr/include
  63. $(CP) $(PKG_INSTALL_DIR)/usr/include/libopkg $(1)/usr/include/
  64. endef
  65. HOST_CONFIGURE_ARGS+= \
  66. --disable-curl \
  67. --disable-gpg \
  68. --with-opkgetcdir=/etc \
  69. --with-opkglockfile=/tmp/opkg.lock
  70. define Host/Compile
  71. $(MAKE) -C $(HOST_BUILD_DIR) CC="$(HOSTCC)" all
  72. endef
  73. define Host/Install
  74. $(INSTALL_BIN) $(HOST_BUILD_DIR)/src/opkg-cl $(STAGING_DIR_HOST)/bin/opkg
  75. endef
  76. $(eval $(call BuildPackage,opkg))
  77. $(eval $(call HostBuild))