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

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

akonadi: upgrade to 1.12.1
make variant mysql5 obsolete (replaced by mysql51)
make mariadb55 default variant
rename mariadb and percona variants with numbers (ticket #43431)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 7.6 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 119433 2014-04-25 12:47:30Z nicos@macports.org $
3
4PortSystem          1.0
5PortGroup           kde4    1.1
6PortGroup           compiler_blacklist_versions 1.0
7
8name                akonadi
9version             1.12.1
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  6e486f4a39948af6f470b652bf3223de75af5e53 \
22                    sha256  a073228fda8bdbcf836af32d4b4c44dcbe58a3eac6da4e5a286b42ace9d83145
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 requires mysql51 description {Legacy compatibility variant} {}
109
110variant mysql51 \
111   conflicts sqlite mysql55 mysql56 mariadb55 percona55 \
112   description {build with mysql51 port} {
113
114   depends_lib-append      port:qt4-mac-mysql51-plugin
115   depends_run-append      port:mysql51-server
116   configure.args-append   -DDATABASE_BACKEND=MYSQL \
117                           -DMYSQLD_EXECUTABLE=${prefix}/lib/mysql51/bin/mysqld
118}
119
120variant mysql55 \
121   conflicts sqlite mysql51 mysql56 mariadb55 percona55 \
122   description {build with mysql55 port} {
123
124   depends_lib-append      port:qt4-mac-mysql55-plugin
125   depends_run-append      port:mysql55-server
126   configure.args-append   -DDATABASE_BACKEND=MYSQL \
127                           -DMYSQLD_EXECUTABLE=${prefix}/lib/mysql55/bin/mysqld
128}
129
130variant mysql56 \
131   conflicts sqlite mysql51 mysql55 mariadb55 percona55 \
132   description {build with mysql56 port} {
133
134   depends_lib-append      port:qt4-mac-mysql56-plugin
135   depends_run-append      port:mysql56-server
136   configure.args-append   -DDATABASE_BACKEND=MYSQL \
137                           -DMYSQLD_EXECUTABLE=${prefix}/lib/mysql55/bin/mysqld
138}
139
140variant mariadb requires mariadb55 description {Legacy compatibility variant} {}
141
142variant mariadb55 \
143   conflicts sqlite mysql51 mysql55 mysql56 percona55 \
144   description {build with mariadb port} {
145
146   depends_lib-append      port:qt4-mac-mariadb-plugin
147   depends_run-append      port:mariadb-server
148   configure.args-append   -DDATABASE_BACKEND=MYSQL \
149                           -DMYSQLD_EXECUTABLE=${prefix}/lib/mariadb/bin/mysqld
150}
151
152variant percona requires percona55 description {Legacy compatibility variant} {}
153
154variant percona55 \
155   conflicts sqlite mysql51 mysql55 mysql56 mariadb55 \
156   description {build with percona55 port} {
157
158   depends_lib-append      port:qt4-mac-percona-plugin
159   depends_run-append      port:percona-server
160   configure.args-append   -DDATABASE_BACKEND=MYSQL \
161                           -DMYSQLD_EXECUTABLE=${prefix}/lib/percona/bin/mysqld
162}
163
164variant sqlite \
165   conflicts mysql51 mysql55 mysql56 mariadb55 percona55 \
166   description {Use sqlite backend instead of MySQL} {
167
168   depends_lib-append      port:qt4-mac-sqlite3-plugin         
169   configure.args-append   -DDATABASE_BACKEND=SQLITE \
170                           -DMYSQLD_EXECUTABLE=Off
171}
172
173if {![variant_isset mysql5] && ![variant_isset mysql51] && ![variant_isset mysql55] \
174    && ![variant_isset mysql56] && ![variant_isset mariadb55] && ![variant_isset percona55] \
175    && ![variant_isset sqlite]} {
176    default_variants +mariadb55
177}
178
179post-patch {
180    # fix '#include "utils.h"' -> "src/utils.h" to avoid a conflict
181    # with the 'utils.h' header installed by the cdparanoia port
182    fs-traverse item ${workpath}/${distname} {
183        if {[file isfile ${item}]} {
184            reinplace "/include/s@\\(utils\\.h\\)@src/\\1@g" ${item}
185        }
186    }
187        reinplace "s|/Applications|${applications_dir}|" ${worksrcpath}/CMakeLists.txt
188}
189
190platform darwin 9 {
191    if {[info exists universal_target] && ${universal_target} == "10.4"} {
192# Needed if compiling for 10.4 universal on 10.5
193        post-configure {
194            reinplace "s|#define HAVE_EXECINFO_H 1||" ${workpath}/build/config-akonadi.h
195        }
196    }
197}
198
199livecheck.type      regex
200livecheck.url       http://kde.mirrors.hoobly.com/stable/akonadi/src/
201livecheck.regex     ${name}-(\\d+(\\.\\d+)+)
Note: See TracBrowser for help on using the repository browser.