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.

146 lines
4.4 KiB

  1. #
  2. # Copyright (C) 2008-2017 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. #
  6. include $(TOPDIR)/rules.mk
  7. PKG_NAME:=radicale
  8. PKG_VERSION:=1.1.6
  9. PKG_RELEASE:=2
  10. PKG_MAINTAINER:=
  11. PKG_LICENSE:=GPL-3.0
  12. PKG_LICENSE_FILES:=COPYING
  13. PKG_SOURCE_PROTO:=git
  14. PKG_SOURCE_URL=https://github.com/Kozea/Radicale
  15. PKG_SOURCE_VERSION:=7568ec39f09a753217fb2d525c5f8db64f4d98f4
  16. PKG_MIRROR_HASH:=73de51e296479f860d4d8cd383a6aa34e8c702d9fca63b0499c7fcc2e794e6df
  17. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
  18. PKG_SOURCE_SUBDIR=$(PKG_NAME)-$(PKG_VERSION)
  19. include $(INCLUDE_DIR)/package.mk
  20. include ../../lang/python/python-package.mk
  21. include ../../lang/python/python3-package.mk
  22. # no default dependencies
  23. PKG_DEFAULT_DEPENDS:=
  24. define Package/radicale/Default
  25. SECTION:=net
  26. CATEGORY:=Network
  27. SUBMENU:=Web Servers/Proxies
  28. URL:=http://radicale.org/
  29. TITLE:=Radicale CalDAV/CardDAV server
  30. PKGARCH:=all
  31. USERID:=radicale=5232:radicale=5232
  32. endef
  33. define Package/radicale-py2
  34. $(call Package/radicale/Default)
  35. TITLE+= (Python 2)
  36. VARIANT:=2
  37. DEPENDS:=+python-logging +python-openssl +python-xml +python-codecs
  38. endef
  39. define Package/radicale-py3
  40. $(call Package/radicale/Default)
  41. TITLE+= (Python 3)
  42. VARIANT:=3
  43. DEPENDS:=+python3-logging +python3-openssl +python3-xml +python3-codecs +python3-email
  44. endef
  45. # shown in LuCI package description
  46. define Package/radicale-py2/description
  47. Radicale CalDAV/CardDAV server (Python 2) - Homepage: http://radicale.org/
  48. endef
  49. define Package/radicale-py3/description
  50. Radicale CalDAV/CardDAV server (Python 3) - Homepage: http://radicale.org/
  51. endef
  52. # shown in make menuconfig <Help>
  53. define Package/radicale-py2/config
  54. help
  55. The Radicale Project is a CalDAV (calendar) and CardDAV (contact) server.
  56. It aims to be a light solution, easy to use, easy to install, easy to configure.
  57. As a consequence, it requires few software dependances and is pre-configured to work out-of-the-box.
  58. !!! Will install and use Python $(VARIANT) !!!
  59. .
  60. Version : $(PKG_VERSION)
  61. Homepage: http://radicale.org/
  62. endef
  63. Package/radicale-py3/config = $(Package/radicale-py2/config)
  64. define Package/radicale-py2/conffiles
  65. /etc/config/radicale
  66. /etc/radicale/users
  67. /etc/radicale/rights
  68. endef
  69. Package/radicale-py3/conffiles = $(Package/radicale-py2/conffiles)
  70. define Build/Configure
  71. # nothing to configure
  72. endef
  73. define Build/Compile
  74. # nothing to compile
  75. endef
  76. define Package/radicale-py2/preinst
  77. #!/bin/sh
  78. [ -n "$${IPKG_INSTROOT}" ] && exit 0 # if run within buildroot exit
  79. # stop service if PKG_UPGRADE
  80. [ "$${PKG_UPGRADE}" = "1" ] && /etc/init.d/radicale stop >/dev/null 2>&1
  81. exit 0 # suppress errors from stop command
  82. endef
  83. define Package/radicale-py3/preinst
  84. $(call Package/radicale-py2/preinst)
  85. endef
  86. define Package/radicale/inst_all
  87. $(INSTALL_DIR) $(1)/etc/init.d
  88. $(INSTALL_BIN) ./files/radicale.init $(1)/etc/init.d/radicale
  89. $(INSTALL_DIR) $(1)/etc/hotplug.d/iface
  90. $(INSTALL_BIN) ./files/radicale.hotplug $(1)/etc/hotplug.d/iface/80-radicale
  91. $(INSTALL_DIR) $(1)/etc/config
  92. $(INSTALL_CONF) ./files/radicale.config $(1)/etc/config/radicale
  93. $(INSTALL_DIR) $(1)/lib/upgrade/keep.d
  94. $(INSTALL_DATA) ./files/radicale.upgrade $(1)/lib/upgrade/keep.d/radicale
  95. $(INSTALL_DIR) $(1)/etc/radicale/ssl
  96. $(INSTALL_DATA) ./files/config.template $(1)/etc/radicale/config.template
  97. $(INSTALL_DATA) ./files/logging.template $(1)/etc/radicale/logging.template
  98. $(INSTALL_DATA) ./files/radicale.users $(1)/etc/radicale/users
  99. $(INSTALL_DATA) ./files/radicale.rights $(1)/etc/radicale/rights
  100. $(INSTALL_DIR) $(1)/usr/bin
  101. $(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/radicale $(1)/usr/bin/
  102. endef
  103. define Package/radicale-py2/install
  104. $(call Package/radicale/inst_all, $(1))
  105. $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)/radicale
  106. $(CP) $(PKG_BUILD_DIR)/radicale/* $(1)$(PYTHON_PKG_DIR)/radicale
  107. endef
  108. define Package/radicale-py3/install
  109. $(call Package/radicale/inst_all, $(1))
  110. $(INSTALL_DIR) $(1)$(PYTHON3_PKG_DIR)/radicale
  111. $(CP) $(PKG_BUILD_DIR)/radicale/* $(1)$(PYTHON3_PKG_DIR)/radicale
  112. endef
  113. define Package/radicale-py2/postinst
  114. #!/bin/sh
  115. # patch /usr/bin/radicale force run using python2
  116. /bin/sed -i 's/python/python2/' $${IPKG_INSTROOT}/usr/bin/radicale
  117. endef
  118. define Package/radicale-py3/postinst
  119. #!/bin/sh
  120. # patch /usr/bin/radicale force run using python3
  121. /bin/sed -i 's/python/python3/' $${IPKG_INSTROOT}/usr/bin/radicale
  122. endef
  123. $(eval $(call BuildPackage,radicale-py2))
  124. $(eval $(call BuildPackage,radicale-py3))