Makefile 2.4 KB

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