source: trunk/dports/devel/akonadi/Portfile @ 118252

Last change on this file since 118252 was 118252, checked in by nicos@…, 5 years ago

akonadi: update to 1.12 (ticket #43065)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 7.7 KB
Line 
1# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
2# $Id: Portfile 118252 2014-03-27 14:21:40Z nicos@macports.org $
3
4PortSystem          1.0
5PortGroup           kde4    1.1
6PortGroup           compiler_blacklist_versions 1.0
7
8name                akonadi
9version             1.12.0
10categories          devel kde kde4
11maintainers         nicos openmaintainer
12license             LGPL-2+
13description         A personal information management storage service.
14long_description    Akonadi is an extensible cross-desktop storage service \
15for PIM data and metadata providing concurrent read, write, and query access.
16platforms           darwin
17homepage            http://community.kde.org/KDE_PIM/Akonadi
18master_sites        kde:stable/${name}/src/
19use_bzip2           yes
20
21checksums           rmd160  bc47b87f8f228d0a8cf8d180d742c65ed1ce4dd0 \
22                    sha256  35243793b73e8028973c101c68ef80a8a54be0fe9aa562c9473e73b4657fea26
23
24depends_lib-append  port:soprano \
25                    port:boost \
26                    port:shared-mime-info
27
28#Older compilers cannot handle c++0x instructions contained in akonadi
29compiler.blacklist  gcc-4.2 llvm-gcc-4.2 apple-gcc-4.2
30compiler.blacklist-append   {clang < 137}
31
32configure.args-append  -DPOSTGRES_PATH=Off
33
34set startup_root ""
35post-destroot {
36    #Create a simple startup item
37    xinstall -d -m 755 ${destroot}${prefix}/Library/LaunchDaemons
38    set plist [open "${destroot}${prefix}/Library/LaunchDaemons/org.macports.akonadi.plist" w 0644]
39
40    puts ${plist} "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
41    puts ${plist} "<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">"
42    puts ${plist} "<plist version=\"1.0\">"
43    puts ${plist} "<dict>"
44    puts ${plist} "<key>Label</key>"
45    puts ${plist} "<string>org.macports.akonadi</string>"
46    puts ${plist} "<key>ProgramArguments</key>"
47    puts ${plist} "<array>"
48    puts ${plist} "<string>${prefix}/bin/akonadiserver-script.sh</string>"
49    puts ${plist} "</array>"
50    puts ${plist} "<key>Disabled</key>"
51    puts ${plist} "<true/>"
52    puts ${plist} "<key>RunAtLoad</key>"
53    puts ${plist} "<true/>"
54    puts ${plist} "</dict>"
55    puts ${plist} "</plist>"
56    close ${plist}
57
58    #Create the script to launch server (needed to set the path, so that
59    #akonadictl can find akonadi_control
60    xinstall -d -m 755 ${destroot}${prefix}/bin
61    set scriptFl [open "${destroot}${prefix}/bin/akonadiserver-script.sh" w 0755]
62    puts ${scriptFl} "#!/bin/sh"
63    puts ${scriptFl} "export PATH=${prefix}/bin:${prefix}/sbin:\$PATH"
64    puts ${scriptFl} "${prefix}/bin/akonadictl start"
65    close ${scriptFl}
66
67    # The startupitem.install keyword does not exist in MacPorts < 2.1.
68    if {![info exists startupitem.install]} {
69        set startupitem.install yes
70    }
71    if { ${startupitem.install} != "no" } {
72        xinstall -d -m 755 ${destroot}${startup_root}/Library/LaunchDaemons
73        ln -s ${prefix}/Library/LaunchDaemons/org.macports.akonadi.plist ${destroot}${startup_root}/Library/LaunchDaemons
74    }
75
76    set docdir ${prefix}/share/doc/${name}
77    xinstall -d ${destroot}${docdir}
78    xinstall -m 0644 -W ${worksrcpath} AUTHORS NEWS README README.sqlite \
79        ${destroot}${docdir}
80}
81
82post-activate {
83    if { ![variant_isset no_root] } {
84        file attributes ${prefix}/Library/LaunchDaemons/org.macports.akonadi.plist -owner root -group wheel
85    }
86}
87
88notes "Applications using akonadi need the akonadi server to be running to function.
89To start the server manually, run
90 akonadictl start &
91Otherwise, an agent to start the server at logon is provided.
92To start it run the following command:
93 launchctl load -w ${startup_root}/Library/LaunchDaemons/org.macports.akonadi.plist"
94
95variant no_root description {Run the akonadi server start as MacPorts install user.} {
96    pre-fetch {
97        if { ${install.user}=="root" || ${install.group}=="wheel" } {
98            ui_error "The akonadi server should not be run as root with no_root variant."
99            error "Please do not use this variant with your MacPorts configuration."
100        }
101    }
102
103    set startup_root  [join [lrange [exec /usr/bin/dscl . -read Users/${install.user} NFSHomeDirectory] 1 end]]
104    # Files are installed into user's startup directory.
105    destroot.violate_mtree  yes
106}
107
108variant mysql5 \
109   conflicts sqlite mysql51 mysql55 mysql56 mariadb percona \
110   description {build with mysql5 port} {
111
112   depends_lib-append      port:qt4-mac-mysql5-plugin
113   depends_run-append      port:mysql5-server
114   configure.args-append   -DDATABASE_BACKEND=MYSQL \
115                           -DMYSQLD_EXECUTABLE=${prefix}/libexec/mysqld
116}
117
118variant mysql51 \
119   conflicts sqlite mysql5 mysql55 mysql56 mariadb percona \
120   description {build with mysql51 port} {
121
122   depends_lib-append      port:qt4-mac-mysql51-plugin
123   depends_run-append      port:mysql51-server
124   configure.args-append   -DDATABASE_BACKEND=MYSQL \
125                           -DMYSQLD_EXECUTABLE=${prefix}/lib/mysql51/bin/mysqld
126}
127
128variant mysql55 \
129   conflicts sqlite mysql5 mysql51 mysql56 mariadb percona \
130   description {build with mysql55 port} {
131
132   depends_lib-append      port:qt4-mac-mysql55-plugin
133   depends_run-append      port:mysql55-server
134   configure.args-append   -DDATABASE_BACKEND=MYSQL \
135                           -DMYSQLD_EXECUTABLE=${prefix}/lib/mysql55/bin/mysqld
136}
137
138variant mysql56 \
139   conflicts sqlite mysql5 mysql51 mysql55 mariadb percona \
140   description {build with mysql56 port} {
141
142   depends_lib-append      port:qt4-mac-mysql56-plugin
143   depends_run-append      port:mysql56-server
144   configure.args-append   -DDATABASE_BACKEND=MYSQL \
145                           -DMYSQLD_EXECUTABLE=${prefix}/lib/mysql55/bin/mysqld
146}
147
148variant mariadb \
149   conflicts sqlite mysql5 mysql51 mysql55 mysql56 percona \
150   description {build with mariadb port} {
151
152   depends_lib-append      port:qt4-mac-mariadb-plugin
153   depends_run-append      port:mariadb-server
154   configure.args-append   -DDATABASE_BACKEND=MYSQL \
155                           -DMYSQLD_EXECUTABLE=${prefix}/lib/mariadb/bin/mysqld
156}
157
158variant percona \
159   conflicts sqlite mysql5 mysql51 mysql55 mysql56 mariadb \
160   description {build with percona port} {
161
162   depends_lib-append      port:qt4-mac-percona-plugin
163   depends_run-append      port:percona-server
164   configure.args-append   -DDATABASE_BACKEND=MYSQL \
165                           -DMYSQLD_EXECUTABLE=${prefix}/lib/percona/bin/mysqld
166}
167
168variant sqlite \
169   conflicts mysql5 mysql51 mysql55 mysql56 mariadb percona \
170   description {Use sqlite backend instead of MySQL} {
171
172   depends_lib-append      port:qt4-mac-sqlite3-plugin         
173   configure.args-append   -DDATABASE_BACKEND=SQLITE \
174                           -DMYSQLD_EXECUTABLE=Off
175}
176
177if {![variant_isset mysql5] && ![variant_isset mysql51] && ![variant_isset mysql55] \
178    && ![variant_isset mysql56] && ![variant_isset mariadb] && ![variant_isset percona] \
179    && ![variant_isset sqlite]} {
180    default_variants +mysql5
181}
182
183post-patch {
184    # fix '#include "utils.h"' -> "src/utils.h" to avoid a conflict
185    # with the 'utils.h' header installed by the cdparanoia port
186    fs-traverse item ${workpath}/${distname} {
187        if {[file isfile ${item}]} {
188            reinplace "/include/s@\\(utils\\.h\\)@src/\\1@g" ${item}
189        }
190    }
191        reinplace "s|/Applications|${applications_dir}|" ${worksrcpath}/CMakeLists.txt
192}
193
194platform darwin 9 {
195    if {[info exists universal_target] && ${universal_target} == "10.4"} {
196# Needed if compiling for 10.4 universal on 10.5
197        post-configure {
198            reinplace "s|#define HAVE_EXECINFO_H 1||" ${workpath}/build/config-akonadi.h
199        }
200    }
201}
202
203livecheck.type      regex
204livecheck.url       http://kde.mirrors.hoobly.com/stable/akonadi/src/
205livecheck.regex     ${name}-(\\d+(\\.\\d+)+)
Note: See TracBrowser for help on using the repository browser.