You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

66 lines
1.8 KiB

  1. #
  2. # Author: Tibor Dudlák
  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:=tang
  9. PKG_VERSION:=11
  10. PKG_RELEASE:=$(AUTORELEASE)
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
  12. PKG_SOURCE_URL:=https://github.com/latchset/$(PKG_NAME)/releases/download/v$(PKG_VERSION)/
  13. PKG_HASH:=ef5d3ae56030f20c290594b9be89ad9ec469dd385676595e1c7a2bfdc3f45d8f
  14. PKG_MAINTAINER:=Tibor Dudlák <tibor.dudlak@gmail.com>
  15. PKG_LICENSE:=GPL-3.0-or-later
  16. PKG_LICENSE_FILES:=COPYING
  17. PKG_INSTALL:=1
  18. include $(INCLUDE_DIR)/package.mk
  19. include $(INCLUDE_DIR)/meson.mk
  20. define Package/tang
  21. SECTION:=utils
  22. TITLE:=tang v$(PKG_VERSION) - daemon for binding data to the presence of a third party
  23. DEPENDS:=+libhttp-parser +xinetd +jose +bash
  24. URL:=https://github.com/latchset/tang
  25. endef
  26. define Package/tang/description
  27. Tang is a small daemon for binding data to the presence of a third party.
  28. endef
  29. define Package/tang/conffiles
  30. /etc/xinetd.d/tangdx
  31. /usr/share/tang/db/
  32. endef
  33. define Package/tang/install
  34. $(INSTALL_DIR) $(1)/usr/bin
  35. $(INSTALL_DIR) $(1)/usr/libexec
  36. $(INSTALL_DIR) $(1)/etc/xinetd.d/
  37. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/tang-show-keys $(1)/usr/bin/
  38. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/libexec/tangd* $(1)/usr/libexec/
  39. $(INSTALL_BIN) ./files/tangdw $(1)/usr/libexec/
  40. $(CP) ./files/tangdx $(1)/etc/xinetd.d/
  41. endef
  42. define Package/tang/postinst
  43. #!/bin/sh
  44. if [ -z "$${IPKG_INSTROOT}" ]; then
  45. mkdir -p /usr/share/tang/db
  46. KEYS=$(find /usr/share/tang/db/ -name "*.jw*" -maxdepth 1 | wc -l)
  47. if [ "${KEYS}" = "0" ]; then # if db is empty generate new key pair
  48. /usr/libexec/tangd-keygen /usr/share/tang/db/
  49. fi
  50. (cat /etc/services | grep -E "tangd.*8888\/tcp") > /dev/null \
  51. || echo -e "tangd\t\t8888/tcp" >> /etc/services
  52. fi
  53. endef
  54. $(eval $(call BuildPackage,tang))