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.

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