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