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.

64 lines
1.7 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:=10
  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:=082f17e031708ab5e2f88c9b767d228bcf92a0d089fdb164d4ae93845cbd2a48
  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/libexec
  35. $(INSTALL_DIR) $(1)/etc/xinetd.d/
  36. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/libexec/tangd* $(1)/usr/libexec/
  37. $(INSTALL_BIN) ./files/tangdw $(1)/usr/libexec/
  38. $(CP) ./files/tangdx $(1)/etc/xinetd.d/
  39. endef
  40. define Package/tang/postinst
  41. #!/bin/sh
  42. if [ -z "$${IPKG_INSTROOT}" ]; then
  43. mkdir -p /usr/share/tang/db
  44. KEYS=$(find /usr/share/tang/db/ -name "*.jw*" -maxdepth 1 | wc -l)
  45. if [ "${KEYS}" = "0" ]; then # if db is empty generate new key pair
  46. /usr/libexec/tangd-keygen /usr/share/tang/db/
  47. fi
  48. (cat /etc/services | grep -E "tangd.*8888\/tcp") > /dev/null \
  49. || echo -e "tangd\t\t8888/tcp" >> /etc/services
  50. fi
  51. endef
  52. $(eval $(call BuildPackage,tang))