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.

145 lines
4.3 KiB

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