1 ################################################################################
3 # opensync.cygclass - functions for building OpenSync plugin packages
5 # Part of cygport - Cygwin packaging application
6 # Copyright (C) 2006-2020 Cygport authors
7 # Provided by the Cygwin project <https://cygwin.com/>
9 # cygport is free software: you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation, either version 3 of the License, or
12 # (at your option) any later version.
14 # cygport is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU General Public License for more details.
19 # You should have received a copy of the GNU General Public License
20 # along with cygport. If not, see <https://www.gnu.org/licenses/>.
22 ################################################################################
24 #****ih* Cygclasses/opensync.cygclass
28 # OpenSync is a Personal Information Management (PIM) data syncronization
29 # framework which supports various PIM sources through plugins.
31 # This cygclass builds plugins for the new OpenSync 0.4x series, beginning
32 # with 0.39. Previous versions are no longer supported.
36 # cmake, libopensync-devel, pkg-config
41 OPENSYNC_PLUGIN=${PN/libopensync*-plugin-}
43 DESCRIPTION="OpenSync ${OPENSYNC_PLUGIN} plugin"
45 #****io* opensync.cygclass/HOMEPAGE (opensync)
47 HOMEPAGE="http://www.opensync.org/wiki/"
50 #****io* opensync.cygclass/SRC_URI (opensync)
52 # Download location for the OpenSync plugin source package.
54 SRC_URI="http://www.opensync.org/download/releases/${PV}/libopensync-plugin-${OPENSYNC_PLUGIN}-${PV}.tar.bz2"
56 SRC_DIR="libopensync-plugin-${OPENSYNC_PLUGIN}-${PV}"
60 0.2*|0.3*) error "opensync.cygclass: minimum supported version is 0.39" ;;
61 *) error "opensync.cygclass: unknown or unsupported version: ${PV}" ;;
64 check_prog_req pkg-config
66 #****id* opensync.cygclass/OPENSYNC_VERSION
68 # Version of the currently installed OpenSync library.
70 OPENSYNC_VERSION=$(pkg-config --modversion libopensync1)
72 #****id* opensync.cygclass/OPENSYNC_CONFIGDIR
74 # Installation directory for OpenSync default configuration files.
76 OPENSYNC_CONFIGDIR=$(pkg-config --variable=configdir libopensync1)
78 #****id* opensync.cygclass/OPENSYNC_PLUGINDIR
80 # Installation directory for OpenSync C/C++ plugins.
82 OPENSYNC_PLUGINDIR=$(pkg-config --variable=plugindir libopensync1)
84 #****id* opensync.cygclass/OPENSYNC_PYTHON_PLUGINDIR
86 # Installation directory for OpenSync Python plugins.
88 OPENSYNC_PYTHON_PLUGINDIR=${OPENSYNC_PLUGINDIR%/*}/python-plugins
90 #****iC* opensync.cygclass/opensync_plugin_compile
92 # opensync_plugin_compile [OPTIONS]
94 # Configures and compiles the OpenSync plugin package. Options, if any, are
95 # passed as flags to cygcmake.
97 opensync_plugin_compile() {
98 if [ ${PV} != ${OPENSYNC_VERSION} ]
100 error "${P} requires libopensync-devel-${PV}"
107 #****iI* opensync.cygclass/opensync_doconfig
109 # opensync_doconfig FILE [FILE2] ...
111 # Installs OpenSync configuration files into OPENSYNC_CONFIGDIR.
113 opensync_doconfig() {
114 insinto ${OPENSYNC_CONFIGDIR}
118 #****iI* opensync.cygclass/opensync_doplugin
120 # opensync_doplugin PLUGIN [PLUGIN2] ...
122 # Installs OpenSync plugins into OPENSYNC_PLUGINDIR or OPENSYNC_PYTHON_PLUGINDIR.
124 opensync_doplugin() {
131 exeinto ${OPENSYNC_PYTHON_PLUGINDIR} ;;
133 exeinto ${OPENSYNC_PLUGINDIR} ;;
135 error "opensync_doplugin: unknown plugin extension ${plugin##*.}"
142 #****io* opensync.cygclass/src_compile (opensync)
146 opensync_plugin_compile
150 readonly -f opensync_plugin_compile opensync_doconfig opensync_doplugin