~ubuntu-branches/debian/sid/openchange/sid

« back to all changes in this revision

Viewing changes to mapiproxy/libmapistore/wscript

  • Committer: Package Import Robot
  • Author(s): Jelmer Vernooij
  • Date: 2012-04-12 20:07:57 UTC
  • mfrom: (11 sid)
  • mto: This revision was merged to the branch mainline in revision 12.
  • Revision ID: package-import@ubuntu.com-20120412200757-k933d9trljmxj1l4
Tags: 1:1.0-4
* openchangeserver: Add dependency on openchangeproxy.
* Rebuild against newer version of Samba 4.
* Use dpkg-buildflags.
* Migrate to Git, update Vcs-Git header.
* Switch to debhelper 9.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
from waflib.Task import Task
2
 
from waflib.TaskGen import extension
3
 
import os
4
 
 
5
 
APPNAME = 'mapistore'
6
 
VERSION = '2.0'
7
 
 
8
 
top = '.'
9
 
out = 'build'
10
 
 
11
 
def options(ctx):
12
 
    ctx.load('compiler_c')
13
 
    ctx.add_option('--datadir',type='string',default='',dest='datadir',help='read-only application data')
14
 
 
15
 
def configure(conf):
16
 
    conf.load('compiler_c')
17
 
 
18
 
    conf.env.CPPFLAGS = ['-Wall', '-Werror', '-g3', '-fstrict-aliasing', '-Wp,-D_FORTIFY_SOURCE=2', 
19
 
                         '-Wmissing-prototypes', '-Wstrict-prototypes']
20
 
 
21
 
    prefix = conf.options.prefix
22
 
    conf.env.includedir = os.path.join(prefix, "include")
23
 
    libdir = os.path.join(prefix, "lib")
24
 
    mapistore_path = os.path.join(prefix, 'private/mapistore')
25
 
 
26
 
    def getstr(varname):
27
 
        return getattr(conf.options,varname,'')
28
 
    
29
 
    datadir=getstr('datadir')
30
 
    if not datadir:datadir=os.path.join(prefix,'share')
31
 
    conf.env.datadir = datadir
32
 
 
33
 
    conf.define('MAPISTORE_MAPPING_PATH', mapistore_path)
34
 
    conf.define('MAPISTORE_DBPATH', os.path.join(mapistore_path, "mapistore.ldb"))
35
 
    conf.define('MAPISTORE_LDIF', datadir)
36
 
    conf.define('MAPISTORE_BACKEND_INSTALLDIR', os.path.join(libdir, "mapistore_backends"))
37
 
    conf.define('MAPISTORE_DB_NAMEDPROPS_PATH', os.path.join(mapistore_path, "mapistore_named_properties.ldb"))
38
 
 
39
 
    conf.check_cfg(atleast_pkgconfig_version='0.20')
40
 
 
41
 
    conf.check_cfg(package='ndr',
42
 
                   args=['ndr >= 0.0.1', '--cflags', '--libs'],
43
 
                   uselib_store='NDR',
44
 
                   msg="Checking for 'ndr 0.0.1'")
45
 
 
46
 
    conf.check_cfg(package='tdb',
47
 
                   args=['tdb >= 1.2.9', '--cflags', '--libs'],
48
 
                   uselib_store='TDB',
49
 
                   msg="Checking for 'tdb 1.2.9'")
50
 
 
51
 
    conf.check_cfg(package='talloc',
52
 
                   args=['talloc >= 2.0.5', '--cflags', '--libs'],
53
 
                   uselib_store='TALLOC',
54
 
                   msg="Checking for 'talloc 2.0.5'")
55
 
 
56
 
    conf.check_cfg(package='samba-hostconfig',
57
 
                   args=['--cflags', '--libs'],
58
 
                   uselib_store='SAMBA-HOSTCONFIG',
59
 
                   msg="Checking for 'samba-hostconfig 0.0.1'")
60
 
 
61
 
    conf.check_cfg(package='libocpf',
62
 
                   args=['libocpf >= 0.11', '--cflags', '--libs'],
63
 
                   uselib_store='OCPF',
64
 
                   msg="Checking for 'ocpf 0.11'")
65
 
 
66
 
    conf.check_cfg(package='ldb',
67
 
                   args=['--cflags', '--libs'],
68
 
                   uselib_store='LDB',
69
 
                   msg="Checking for 'ldb 1.0.1'")
70
 
 
71
 
    try:
72
 
        conf.find_program('pidl', var='PIDL')
73
 
    except ctx.errors.ConfigurationError:
74
 
        self.fatal("PIDL compiler not found")
75
 
 
76
 
    print("prefix is " + conf.options.prefix)
77
 
 
78
 
def post(ctx):
79
 
        if ctx.cmd == 'install':
80
 
            ctx.exec_command('/sbin/ldconfig')
81
 
 
82
 
class idl(Task):
83
 
    run_str = '${PIDL} --outputdir=indexing --header --ndr-parser -- ${SRC}'
84
 
    color   = 'BLUE'
85
 
    ext_out = ['.h', '.c']
86
 
 
87
 
@extension('.idl')
88
 
def process_idl(self, node):
89
 
    ndr_node = node.change_ext('.c')
90
 
 
91
 
    try:
92
 
        ndr_node.name.index("ndr_")
93
 
    except ValueError:
94
 
        ndr_node.name = "ndr_" + ndr_node.name
95
 
    h_node = node.change_ext('.h')
96
 
    self.create_task('idl', node, [ndr_node, h_node])
97
 
    self.source.append(ndr_node)
98
 
 
99
 
def build(bld):
100
 
    bld.shlib(
101
 
        features = 'c cshlib',
102
 
        source = [
103
 
            'indexing/mapistore_indexing_db.idl',
104
 
            'mapistore_interface.c',
105
 
            'mapistore_processing.c', 
106
 
            'mapistore_backend.c',
107
 
            'mapistore_backend_defaults.c',
108
 
            'mapistore_backend_public.c', 
109
 
            'mapistore_tdb_wrap.c',
110
 
            'mapistore_ldb_wrap.c',
111
 
            'mapistore_namedprops.c',
112
 
            'mapistore_indexing.c',
113
 
            'database/mapistoredb.c',
114
 
            'database/mapistoredb_conf.c',
115
 
            'database/mapistoredb_namedprops.c',
116
 
            'indexing/mapistore_indexing.c',
117
 
            ],
118
 
        target = 'mapistore',
119
 
        includes     = ['.', '../../', 'build/indexing'],
120
 
        use    = ['NDR', 'LDB', 'TDB', 'TALLOC', 'SAMBA-HOSTCONFIG'])
121
 
 
122
 
    bld.shlib(
123
 
        features        = 'c cshlib',
124
 
        source          = ['backends/mapistore_fsocpf.c'],
125
 
        target          = 'mapistore_fsocpf',
126
 
        includes        = ['.', '../../'],
127
 
        use             = ['mapistore', 'OCPF'])
128
 
 
129
 
    bld.shlib(
130
 
        features        = 'c cshlib',
131
 
        source          = ['backends/mapistore_mstoredb.c'],
132
 
        target          = 'mapistore_mstoredb',
133
 
        includes        = ['.', '../../', 'build/indexing'],
134
 
        use             = ['mapistore', 'LDB'])
135
 
 
136
 
    bld(
137
 
        features='subst',
138
 
        source='libmapistore.pc.in',
139
 
        target='libmapistore.pc',
140
 
        install_path='${LIBDIR}/pkgconfig',
141
 
        PACKAGE_VERSION = VERSION,
142
 
        exec_prefix= bld.options.prefix,
143
 
        datadir = bld.env.datadir,
144
 
        includedir = bld.env.includedir,
145
 
        LIBS = '-ltalloc -ltdb -lsamba-hostconfig')
146
 
 
147
 
 
148
 
    bld.symlink_as('${PREFIX}/lib/libmapistore.so.0', 'libmapistore.so')
149
 
    bld.install_as('${PREFIX}/lib/mapistore_backends/mapistore_mstoredb.so', 'libmapistore_mstoredb.so')
150
 
    bld.install_as('${PREFIX}/lib/mapistore_backends/mapistore_fsocpf.so', 'libmapistore_fsocpf.so')
151
 
    bld.install_files('${PREFIX}/include/mapistore',
152
 
                      ['mapistore.h', 
153
 
                       'mapistore_errors.h',
154
 
                       'mapistore_defs.h', 
155
 
                       'mapistore_backend.h',
156
 
                       'mapistore_common.h'])
157
 
    bld.install_files('${PREFIX}/lib/pkgconfig', 'libmapistore.pc')
158
 
 
159
 
    bld.add_post_fun(post)