Makefile 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. #
  2. # Copyright (C) 2016 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=bsdiff
  9. PKG_VERSION:=4.3
  10. PKG_RELEASE:=2
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  12. PKG_SOURCE_URL:=https://www.daemonology.net/bsdiff/
  13. PKG_HASH:=18821588b2dc5bf159aa37d3bcb7b885d85ffd1e19f23a0c57a58723fea85f48
  14. PKG_MAINTAINER:=Hauke Mehrtens <hauke@hauke-m.de>
  15. HOST_BUILD_DEPENDS:=bzip2/host
  16. PKG_LICENSE:=BSD-2-Clause
  17. PKG_CPE_ID:=cpe:/a:daemonology:bsdiff
  18. include $(INCLUDE_DIR)/host-build.mk
  19. include $(INCLUDE_DIR)/package.mk
  20. define Package/bsdiff
  21. SECTION:=utils
  22. CATEGORY:=Utilities
  23. DEPENDS:=+libbz2
  24. TITLE:=Binary diff tool
  25. URL:=https://www.daemonology.net/bsdiff/
  26. endef
  27. define Package/bspatch
  28. SECTION:=utils
  29. CATEGORY:=Utilities
  30. DEPENDS:=+libbz2
  31. TITLE:=Binary patch tool
  32. URL:=https://www.daemonology.net/bsdiff/
  33. endef
  34. define Build/Compile
  35. $(TARGET_CC) $(TARGET_CFLAGS) $(TARGET_CPPFLAGS) $(TARGET_LDFLAGS) \
  36. -o $(PKG_BUILD_DIR)/bsdiff \
  37. $(PKG_BUILD_DIR)/bsdiff.c -lbz2
  38. $(TARGET_CC) $(TARGET_CFLAGS) $(TARGET_CPPFLAGS) $(TARGET_LDFLAGS) \
  39. -o $(PKG_BUILD_DIR)/bspatch \
  40. $(PKG_BUILD_DIR)/bspatch.c -lbz2
  41. endef
  42. define Package/bsdiff/install
  43. $(INSTALL_DIR) $(1)/usr/bin/
  44. $(INSTALL_BIN) $(PKG_BUILD_DIR)/bsdiff $(1)/usr/bin/bsdiff
  45. endef
  46. define Package/bspatch/install
  47. $(INSTALL_DIR) $(1)/usr/bin/
  48. $(INSTALL_BIN) $(PKG_BUILD_DIR)/bspatch $(1)/usr/bin/bspatch
  49. endef
  50. define Host/Install
  51. $(INSTALL_DIR) $(STAGING_DIR_HOSTPKG)/bin/
  52. $(MAKE) -C $(HOST_BUILD_DIR) PREFIX=$(STAGING_DIR_HOSTPKG)/ install
  53. endef
  54. define Host/Compile
  55. $(HOSTCC) $(HOST_CFLAGS) $(HOST_LDFLAGS) \
  56. -o $(HOST_BUILD_DIR)/bsdiff \
  57. $(HOST_BUILD_DIR)/bsdiff.c -lbz2
  58. endef
  59. define Host/Install
  60. $(INSTALL_BIN) $(HOST_BUILD_DIR)/bsdiff $(STAGING_DIR_HOSTPKG)/bin/
  61. endef
  62. $(eval $(call HostBuild))
  63. $(eval $(call BuildPackage,bsdiff))
  64. $(eval $(call BuildPackage,bspatch))