File: meson.build

package info (click to toggle)
phodav 3.0-10
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 652 kB
  • sloc: ansic: 4,956; sh: 117; makefile: 9
file content (66 lines) | stat: -rw-r--r-- 1,766 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
systemd_systemunitdir = get_option('systemdsystemunitdir')
if systemd_systemunitdir == ''
  systemd = dependency('systemd', required : false)
  if systemd.found()
    systemd_systemunitdir = systemd.get_pkgconfig_variable('systemdsystemunitdir')
  endif
endif
if systemd_systemunitdir != ''
  install_data(
    'spice-webdavd.service',
    install_dir : systemd_systemunitdir
  )
endif

udev_rulesdir = get_option('udevrulesdir')
if udev_rulesdir == ''
  udev = dependency('udev', required : false)
  if udev.found()
    udev_rulesdir = '@0@/@1@'.format(udev.get_pkgconfig_variable('udevdir'), 'rules.d')
  endif
endif
if udev_rulesdir != ''
  install_data(
    '70-spice-webdavd.rules',
    install_dir : udev_rulesdir
  )
endif

buildid = get_option('build-id')
version = proj_version.split('.')
maj = version[0].to_int()
min = version[1].split('-')[0].to_int()
mic = 0
if version.length() > 2
  mic = version[2].split('-')[0].to_int()
endif
win_version = '@0@.@1@.@2@'.format(maj, min, mic * 256 + buildid)

if buildid != 0
  buildid = '-@0@'.format(buildid)
else
  buildid = ''
endif

wixl_arch = 'x86'
if host_machine.cpu_family() == 'x86_64'
  wixl_arch = 'x64'
endif

if host_machine.system() == 'windows'
  foreach out : [ 'chezdav.wxs', 'spice-webdavd.wxs', 'make-msi.sh' ]
    configure_file(
      input : '@0@.in'.format(out),
      output : out,
      install : false,
      configuration : {
                        'BUILDID' : buildid,
                        'VERSION' : proj_version,
                        'WINDOWS_PRODUCTVERSION' : win_version,
                        'WIXL_ARCH' : wixl_arch,
                        'top_srcdir' : meson.source_root(),
                        'prefix' : prefix,
                      }
    )
  endforeach
endif