/
BareosSetVariableDefaults.cmake
575 lines (457 loc) · 10.5 KB
/
BareosSetVariableDefaults.cmake
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
# BAREOS® - Backup Archiving REcovery Open Sourced
#
# Copyright (C) 2017-2019 Bareos GmbH & Co. KG
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of version three of the GNU Affero General Public
# License as published by the Free Software Foundation and included
# in the file LICENSE.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, USA.
# check if variables are set via cmdline else set them to default values
## configure variables
##
## strings - directories
# prefix
IF(NOT DEFINED prefix)
set (prefix ${CMAKE_DEFAULT_PREFIX})
ENDIF()
# libdir
IF(NOT DEFINED libdir)
set(libdir ${CMAKE_INSTALL_FULL_LIBDIR}/${CMAKE_PROJECT_NAME})
ENDIF()
# includedir
IF(NOT DEFINED includedir)
set(includedir ${CMAKE_INSTALL_FULL_INCLUDEDIR}/${CMAKE_PROJECT_NAME})
ENDIF()
# bindir
IF(NOT DEFINED bindir)
set(bindir ${CMAKE_INSTALL_FULL_BINDIR})
MESSAGE(STATUS "set bindir to default ${bindir}")
ENDIF()
# sbindir
IF(NOT DEFINED sbindir)
set(sbindir ${CMAKE_INSTALL_FULL_SBINDIR})
MESSAGE(STATUS "set sbindir to default ${sbindir}")
ENDIF()
# sysconfdir
IF(NOT DEFINED sysconfdir)
set(sysconfdir ${CMAKE_INSTALL_FULL_SYSCONFDIR})
ENDIF()
set(SYSCONFDIR "\"${sysconfdir}\"")
# confdir
IF(NOT DEFINED confdir)
set(confdir "${sysconfdir}/${CMAKE_PROJECT_NAME}")
ENDIF()
# configtemplatedir
IF(NOT DEFINED configtemplatedir)
set(configtemplatedir "${confdir}")
ENDIF()
# mandir
IF(NOT DEFINED mandir)
set(mandir ${CMAKE_INSTALL_FULL_MANDIR})
ENDIF()
# docdir
IF(NOT DEFINED docdir)
SET(docdir default_for_docdir)
ENDIF()
# htmldir
IF(NOT DEFINED htmldir)
SET(htmldir default_for_htmldir)
ENDIF()
# archivedir
IF(NOT DEFINED archivedir)
set(archivedir "/${CMAKE_INSTALL_LOCALSTATEDIR}/lib/${CMAKE_PROJECT_NAME}/storage")
ENDIF()
# backenddir
IF(NOT DEFINED backenddir)
set(backenddir ${CMAKE_INSTALL_FULL_LIBDIR}/${CMAKE_PROJECT_NAME}/backends)
ENDIF()
# scriptdir
IF(NOT DEFINED scriptdir)
set(scriptdir "${CMAKE_INSTALL_PREFIX}/lib/${CMAKE_PROJECT_NAME}/scripts")
ENDIF()
# workingdir
IF(NOT DEFINED workingdir)
set(workingdir "/${CMAKE_INSTALL_LOCALSTATEDIR}/lib/${CMAKE_PROJECT_NAME}")
ENDIF()
set(working_dir "${workingdir}")
# plugindir
IF(NOT DEFINED plugindir)
set(plugindir ${CMAKE_INSTALL_FULL_LIBDIR}/${CMAKE_PROJECT_NAME}/plugins)
ENDIF()
# piddir
IF(NOT DEFINED piddir)
SET(piddir ${workingdir})
ENDIF()
# bsrdir
IF(NOT DEFINED bsrdir)
SET(bsrdir ${workingdir})
ENDIF()
# logdir
IF(NOT DEFINED logdir)
set(logdir "${CMAKE_INSTALL_LOCALSTATEDIR}/log/${CMAKE_PROJECT_NAME}")
ENDIF()
# datarootdir
IF(NOT DEFINED datarootdir)
set(datarootdir "${CMAKE_INSTALL_FULL_DATAROOTDIR}")
ENDIF()
# subsysdir
IF(NOT DEFINED subsysdir)
set(subsysdir "${workingdir}")
ENDIF()
# db_name
IF(NOT DEFINED db_name)
SET(db_name "bareos")
ENDIF()
# db_user
IF(NOT DEFINED db_user)
SET(db_user "bareos")
ENDIF()
# db_password
IF(NOT DEFINED db_password)
SET(db_password "")
ENDIF()
# dir-user
IF(NOT DEFINED dir-user)
SET(dir-user "")
ENDIF()
SET(dir_user "${dir-user}")
# dir-group
IF(NOT DEFINED dir-group)
SET(dir-group "")
ENDIF()
set(dir_group ${dir-group})
# sd-user
IF(NOT DEFINED sd-user)
SET(sd-user "")
ENDIF()
SET(sd_user ${sd-user})
# sd-group
IF(NOT DEFINED sd-group)
SET(sd-group "")
ENDIF()
SET(sd_group ${sd-group})
# fd-user
IF(NOT DEFINED fd-user)
SET(fd-user "")
ENDIF()
SET(fd_user ${fd-user})
# fd-group
IF(NOT DEFINED fd-group)
SET(fd-group "")
ENDIF()
SET(fd_group ${fd-group})
# dir-password
IF(NOT DEFINED dir-password)
SET(dir-password "bareos")
ENDIF()
SET(dir_password ${dir-password})
# fd-password
IF(NOT DEFINED fd-password)
SET(fd-password "")
ENDIF()
SET(fd_password ${fd-password})
# sd-password
IF(NOT DEFINED sd-password)
SET(sd-password "")
ENDIF()
SET(sd_password ${sd-password})
# mon-dir-password
IF(NOT DEFINED mon-dir-password)
SET(mon-dir-password "")
ENDIF()
SET(mon_dir_password ${mon-dir-password})
# mon-fd-password
IF(NOT DEFINED mon-fd-password)
SET(mon-fd-password "")
ENDIF()
SET(mon_fd_password ${mon-fd-password})
# mon-sd-password
IF(NOT DEFINED mon-sd-password)
SET(mon-sd-password "")
ENDIF()
SET(mon_sd_password ${mon-sd-password} )
# basename
IF(NOT DEFINED basename)
SET(basename localhost)
ENDIF()
# hostname
IF(NOT DEFINED hostname)
SET(hostname localhost)
ENDIF()
##########
## rights
##########
# sbin-perm
IF(NOT DEFINED sbin-perm)
SET(sbin-perm 755)
ENDIF()
###########
## bool
###########
# python
IF(NOT DEFINED python)
SET(python ON)
ENDIF()
# lockmgr
IF(NOT DEFINED lockmgr)
SET(lockmgr OFF)
set(LOCKMGR 0)
ENDIF()
# smartalloc
IF(NOT DEFINED smartalloc)
SET(smartalloc ON)
set(SMARTALLOC 1)
ENDIF()
# smartalloc
IF(NOT smartalloc)
SET(smartalloc OFF)
set(SMARTALLOC 0)
ELSE()
SET(smartalloc ON)
set(SMARTALLOC 1)
ENDIF()
# disable-conio
IF(NOT DEFINED disable-conio)
SET(disable-conio ON)
ENDIF()
# readline
IF(NOT DEFINED readline)
SET(readline ON)
ENDIF()
# batch-insert
IF((NOT DEFINED batch-insert) OR (${batch-insert}))
SET(batch-insert ON)
SET(HAVE_POSTGRESQL_BATCH_FILE_INSERT 1)
SET(USE_BATCH_FILE_INSERT 1)
ENDIF()
# dynamic-cats-backends
IF(NOT DEFINED dynamic-cats-backends)
SET(dynamic-cats-backends OFF)
SET(HAVE_DYNAMIC_CATS_BACKENDS 0)
ELSE()
SET(dynamic-cats-backends ON)
SET(HAVE_DYNAMIC_CATS_BACKENDS 1)
ENDIF()
# dynamic-storage-backends
IF(NOT DEFINED dynamic-storage-backends)
# OR (${dynamic-storage-backends}))
SET(dynamic-storage-backends OFF)
SET(HAVE_DYNAMIC_SD_BACKENDS 0)
ELSE()
SET(dynamic-storage-backends ON)
SET(HAVE_DYNAMIC_SD_BACKENDS 1)
ENDIF()
# scsi-crypto
IF(NOT DEFINED scsi-crypto)
SET(scsi-crypto OFF)
ENDIF()
# lmdb
IF(NOT DEFINED lmdb)
SET(lmdb ON)
ENDIF()
# ndmp
IF(NOT DEFINED ndmp)
SET(ndmp ON)
ENDIF()
# ipv6
IF((NOT DEFINED ipv6) OR (${ipv6}))
SET(ipv6 ON)
SET(HAVE_IPV6 1)
ENDIF()
# acl
IF(NOT DEFINED acl)
SET(acl ON)
ENDIF()
# xattr
IF(NOT DEFINED xattr)
SET(xattr ON)
ENDIF()
# build_ndmjob
IF(NOT DEFINED build_ndmjob)
SET(build_ndmjob OFF)
ENDIF()
# bat
IF(NOT DEFINED bat)
SET(bat OFF)
ENDIF()
# traymonitor
IF(NOT DEFINED traymonitor)
SET(HAVE_TRAYMONITOR 0)
ENDIF()
# client-only
IF(NOT DEFINED client-only)
SET(client-only OFF)
SET(build_client_only OFF)
ELSE()
SET(client-only ON)
SET(build_client_only ON)
ENDIF()
# postgresql
IF(NOT DEFINED postgresql)
SET(postgresql OFF)
ENDIF()
# mysql
IF(NOT DEFINED mysql)
SET(mysql OFF)
ENDIF()
# sqlite3
IF(NOT DEFINED sqlite3)
SET(sqlite3 OFF)
ENDIF()
IF(NOT sqlite3)
IF(NOT mysql)
IF(NOT postgresql)
IF(NOT client-only)
MESSAGE(FATAL_ERROR "No database backend was chosen, please choose at least one from \n"
" - postgresql (-Dpostgresql=yes)\n"
" - mysqli (-Dmysql=yes) \n"
" - sqlite3 (-Dsqlite3=yes) \n"
" or select client only build (-Dclient-only=yes) \n"
)
ENDIF()
ENDIF()
ENDIF()
ENDIF()
IF(NOT mysql)
set(MYSQL_INCLUDE_DIR "")
endif()
IF(NOT postgresql)
set(PostgreSQL_INCLUDE_DIR "")
endif()
if(NOT Readline_LIBRARY)
set(Readline_LIBRARY "")
endif()
if(NOT LIBZ_FOUND)
set(ZLIB_LIBRARY "")
endif()
set(db_backends "")
IF(NOT client-only)
if(${sqlite3})
set(HAVE_SQLITE3 1)
list(APPEND db_backends sqlite3)
endif()
if(${postgresql})
set(HAVE_POSTGRESQL 1)
list(APPEND db_backends postgresql)
endif()
if(${mysql})
set(HAVE_MYSQL 1)
list(APPEND db_backends mysql)
endif()
# set first entry as default db backend
LIST(GET db_backends 0 default_db_backend)
endif()
# tcp-wrappers
IF(NOT DEFINED tcp-wrappers)
SET(tcp-wrappers OFF)
ENDIF()
# systemd
IF(NOT DEFINED systemd)
SET(systemd OFF)
ENDIF()
# includes
IF(NOT DEFINED includes)
SET(includes ON)
ENDIF()
# openssl
IF(NOT DEFINED openssl)
SET(openssl ON)
ENDIF()
# ports
IF(NOT DEFINED dir_port)
SET(dir_port "9101")
ENDIF()
IF(NOT DEFINED fd_port)
SET(fd_port "9102")
ENDIF()
IF(NOT DEFINED sd_port)
SET(sd_port "9103")
ENDIF()
IF(DEFINED baseport)
MATH(EXPR dir_port "${baseport}+0")
MATH(EXPR fd_port "${baseport}+1")
MATH(EXPR sd_port "${baseport}+2")
ENDIF()
IF(NOT DEFINED job_email)
SET(job_email "root@localhost")
ENDIF()
IF(NOT DEFINED dump_email)
SET(dump_email "root@localhost")
ENDIF()
IF(NOT DEFINED smtp_host)
SET(smtp_host "root@localhost")
ENDIF()
IF(DEFINED traymonitor)
SET(HAVE_TRAYMONITOR 1)
ENDIF()
IF(DEFINED test-plugin)
SET(HAVE_TEST_PLUGIN 1)
ENDIF()
IF(NOT DEFINED developer)
SET(developer OFF)
ENDIF()
IF(DEFINED dynamic-debian-package-list)
SET(GENERATE_DEBIAN_CONTROL ON)
ELSE()
SET(GENERATE_DEBIAN_CONTROL OFF)
ENDIF()
IF(NOT DEFINED coverage)
set (coverage OFF)
ENDIF()
# do not destroy bareos-config-lib.sh
SET(DB_NAME "@DB_NAME@")
SET(DB_USER "@DB_USER@")
SET(DB_PASS "@DB_PASS@")
SET(DB_VERSION "@DB_VERSION@")
IF (${CMAKE_COMPILER_IS_GNUCC})
SET(HAVE_GCC 1)
ENDIF()
set(lld "\"lld\"")
set(llu "\"llu\"")
SET(HAVE_MYSQL_THREAD_SAFE 1)
SET(HAVE_POSIX_SIGNALS 1)
SET(HAVE_SHA2 1)
SET(HAVE_PQISTHREADSAFE 1)
SET(HAVE_PQ_COPY 1)
SET(PROTOTYPES 1)
SET(RETSIGTYPE void)
SET(SETPGRP_VOID 1)
SET(SSTDC_HEADERS 1)
SET(_LARGEFILE_SOURCE 1)
SET(_LARGE_FILES 1)
SET(_FILE_OFFSET_BITS 64)
SET(HAVE_COMPRESS_BOUND 1)
SET(STDC_HEADERS 1)
SET(HAVE_SQLITE3_THREADSAFE 1)
SET(FSTYPE_MNTENT 1)
SET(PACKAGE_BUGREPORT "\"\"")
SET(PACKAGE_NAME "\"${CMAKE_PROJECT_NAME}\"")
SET(PACKAGE_STRING "\"${CMAKE_PROJECT_NAME} ${BAREOS_NUMERIC_VERSION}\"")
SET(PACKAGE_TARNAME "\"\"" )
SET(PACKAGE_URL "\"\"")
SET(PACKAGE_VERSION "\"${BAREOS_NUMERIC_VERSION}\"")
set(ENABLE_NLS 1)
if(DEFINED ENV{BAREOS_VENDORSUPPORT_STATUS})
add_definitions(-DBAREOS_VENDORSUPPORT_STATUS="$ENV{BAREOS_VENDORSUPPORT_STATUS}")
endif()
if(DEFINED ENV{BAREOS_VENDORSUPPORT_MESSAGE})
add_definitions(-DBAREOS_VENDORSUPPORT_MESSAGE="$ENV{BAREOS_VENDORSUPPORT_MESSAGE}")
endif()
IF(HAVE_WIN32)
IF(NOT DEFINED WINDOWS_VERSION)
SET(WINDOWS_VERSION 0x600)
ENDIF()
IF(NOT DEFINED WINDOWS_BITS)
SET(WINDOWS_BITS 64)
ENDIF()
ENDIF()