Compiling bareos from source using cmake

1,992 views
Skip to first unread message

Greg

unread,
Mar 18, 2018, 5:43:59 PM3/18/18
to bareos-users
Hi,
This is my first post, so bear with me.

I am NOT a programmer but I want to compile bareos client only (file daemon) onto my firewall which is called ipfire as it has a bacula client that works with bareos but this was upgraded and now it is not compatible anymore.

I have downloaded the bareos source files and I cannot find any documentation on how to compile from source. I did find documentation that said to run ./configure and then run make etc but these instructions seem old.

I think the new source is supposed to compiled using cmake (which I have never heard of until today)

I have read about cmake and how easy it is supposed to be, which is probably true if you use it everyday and know how it all works.

I just want to be able to compile the client and its is not easy for someone with zero experience with cmake or compiling. Is there anyone out there that knows how to do this and have instructions on how to compile the client only?

Thanks


Jörg Steffens

unread,
Mar 19, 2018, 7:23:43 AM3/19/18
to bareos...@googlegroups.com
Hi Greg,

you are right. Bareos has switched from autoconf (configure, ...) to
cmake in master, and this is not yet documented in the developer
documentation.

The best way to get the settings used by the Bareos project itself is to
look into the package building files, e.g.
https://github.com/bareos/bareos/blob/master/platforms/packaging/bareos.spec
or https://github.com/bareos/bareos/blob/master/debian/rules

In bareos.spec you see that we use following command to compile Bareos:

# create temporary file in this subdirectory
CMAKE_BUILDDIR=cmake-build

mkdir ${CMAKE_BUILDDIR}
pushd ${CMAKE_BUILDDIR}

cmake .. \
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DCMAKE_INSTALL_PREFIX:PATH=/usr \
-DCMAKE_INSTALL_LIBDIR:PATH=/usr/lib \
-DINCLUDE_INSTALL_DIR:PATH=/usr/include \
-DLIB_INSTALL_DIR:PATH=/usr/lib \
-DSYSCONF_INSTALL_DIR:PATH=/etc \
-DSHARE_INSTALL_PREFIX:PATH=/usr/share \
-DBUILD_SHARED_LIBS:BOOL=ON \
-Dprefix=%{_prefix}\
-Dlibdir=%{library_dir} \
-Dsbindir=%{_sbindir} \
-Dsbin-perm=755 \
-Dsysconfdir=%{_sysconfdir} \
-Dconfdir=%{_sysconfdir}/bareos \
-Dmandir=%{_mandir} \
-Ddocdir=%{_docdir}/%{name} \
-Dhtmldir=%{_docdir}/%{name}/html \
-Darchivedir=/var/lib/%{name}/storage \
-Dbackenddir=%{backend_dir} \
-Dscriptdir=%{script_dir} \
-Dworking-dir=%{working_dir} \
-Dplugindir=%{plugin_dir} \
-Dpid-dir=%{pid_dir} \
-Dbsrdir=%{bsr_dir} \
-Dlogdir=/var/log/bareos \
-Dsubsys-dir=%{_subsysdir} \
-Dpython=yes \
-Dsmartalloc=yes \
-Ddisable-conio=yes \
-Dreadline=yes \
-Dbatch-insert=yes \
-Ddynamic-cats-backends=yes \
-Ddynamic-storage-backends=yes \
-Dscsi-crypto=yes \
-Dlmdb=yes \
-Dndmp=yes \
-Dipv6=yes \
-Dacl=yes \
-Dxattr=yes \
-Dtraymonitor=yes \
-Dpostgresql=yes \
-Dmysql=yes \
-Dsqlite3=yes \
-Dtcp-wrappers=yes \
-Ddir-user=%{director_daemon_user} \
-Ddir-group=%{daemon_group} \
-Dsd-user=%{storage_daemon_user} \
-Dsd-group=%{storage_daemon_group} \
-Dfd-user=%{file_daemon_user} \
-Dfd-group=%{daemon_group} \
-Ddir-password="XXX_REPLACE_WITH_DIRECTOR_PASSWORD_XXX" \
-Dfd-password="XXX_REPLACE_WITH_CLIENT_PASSWORD_XXX" \
-Dsd-password="XXX_REPLACE_WITH_STORAGE_PASSWORD_XXX" \
-Dmon-dir-password="XXX_REPLACE_WITH_DIRECTOR_MONITOR_PASSWORD_XXX" \
-Dmon-fd-password="XXX_REPLACE_WITH_CLIENT_MONITOR_PASSWORD_XXX" \
-Dmon-sd-password="XXX_REPLACE_WITH_STORAGE_MONITOR_PASSWORD_XXX" \
-Dopenssl=yes \
-Dbasename="XXX_REPLACE_WITH_LOCAL_HOSTNAME_XXX" \
-Dhostname="XXX_REPLACE_WITH_LOCAL_HOSTNAME_XXX" \
-Dsystemd=yes \
-Dincludes=yes

make DESTDIR=%{buildroot}

All the ${...} defines are set the the RPM build system and must be
adapted to your environment (or removed to take the default).

However, as you plan to use this system in production I would recommend
to use the latest stable release (17.2.x) or branch (bareos-17.2)
instead of master. And 17.2 as well as all predecessors still use autoconf.

regards,
Jörg
--
Jörg Steffens joerg.s...@bareos.com
Bareos GmbH & Co. KG Phone: +49 221 630693-91
http://www.bareos.com Fax: +49 221 630693-10

Sitz der Gesellschaft: Köln | Amtsgericht Köln: HRA 29646
Komplementär: Bareos Verwaltungs-GmbH
Geschäftsführer:
S. Dühr, M. Außendorf, Jörg Steffens, P. Storz

raspLover

unread,
Dec 4, 2023, 10:34:30 AM12/4/23
to bareos-users
Hi,

i'm no compiling expert.
is there a step by step to build the filedaemon on the raspberry pi?

regards

Jörg Steffens

unread,
Dec 4, 2023, 11:26:27 AM12/4/23
to bareos...@googlegroups.com
On 04.12.23 at 16:34 wrote raspLover:
> Hi,
>
> i'm no compiling expert.
> is there a step by step to build the filedaemon on the raspberry pi?

For Raspberry Pi OS, so Debian based, right?

Than you can easily build the Debian packages:

# get the source
git clone https://github.com/bareos/bareos.git
cd bareos/

# check build requirement.
# You have to manually install the missing packages.
dpkg-checkbuilddeps

# create debian/changelog file
NOW=$(LANG=C date -R -u)
cmake -P write_version_files.cmake
BAREOS_VERSION=$(cmake -P get_version.cmake | sed -e 's/-- //')
printf "bareos (%s) unstable; urgency=low\n\n * dummy\n\n -- nobody
<nob...@example.com> %s\n\n" "${BAREOS_VERSION}" "${NOW}" | tee
debian/changelog

# build the packages
fakeroot debian/rules binary

# resulting packages will be in the parent directory
cd ..
ls *.deb

--
Jörg Steffens joerg.s...@bareos.com
Bareos GmbH & Co. KG Phone: +49 221 630693-91
https://www.bareos.com Fax: +49 221 630693-10

Sitz der Gesellschaft: Köln | Amtsgericht Köln: HRA 29646
Komplementär: Bareos Verwaltungs-GmbH
Geschäftsführer: Stephan Dühr, Jörg Steffens, Philipp Storz


raspLover

unread,
Dec 5, 2023, 7:53:36 AM12/5/23
to bareos-users
that worked like a charm!
Thank you very much!

i head much tests that where not working, does it mean something? Backup is running well.

13% tests passed, 96 tests failed out of 110

Total Test time (real) = 480.41 sec

The following tests did not run:
          1 - webui:admin-client_link_on_dashboard (Disabled)
          2 - webui:admin-client_disabling (Disabled)
          3 - webui:admin-rerun_job (Disabled)
          4 - webui:admin-restore (Disabled)
          5 - webui:admin-run_configured_job (Disabled)
          6 - webui:admin-run_default_job (Disabled)
          7 - webui:readonly-client_disabling (Disabled)
          8 - webui:readonly-rerun_job (Disabled)
          9 - webui:readonly-restore (Disabled)
         10 - webui:readonly-run_configured_job (Disabled)
         11 - webui:readonly-run_default_job (Disabled)
         12 - system:acl (Disabled)
         14 - system:autochanger (Disabled)
         43 - system:bconsole-pam (Disabled)
         44 - system:block-size (Disabled)
         46 - system:catalog (Disabled)
         54 - system:chflags (Disabled)
         68 - system:dbcopy-mysql-postgresql (Disabled)
         70 - system:droplet-s3 (Disabled)
         78 - system:gfapi-fd (Disabled)
         79 - system:glusterfs-backend (Disabled)
         81 - system:messages (Disabled)
         86 - system:ndmp (Disabled)
         94 - system:py2plug-dir (Disabled)
         95 - system:py3plug-dir (Disabled)
         96 - system:py2plug-fd-contrib-bareos_tasks_mysql (Disabled)
         97 - system:py3plug-fd-contrib-bareos_tasks_mysql (Disabled)
         98 - system:py2plug-fd-ldap (Disabled)
         99 - system:py2plug-fd-libcloud (Disabled)
        100 - system:py3plug-fd-libcloud (Disabled)
        101 - system:py2plug-fd-local-fileset-restoreobject (Disabled)
        102 - system:py3plug-fd-local-fileset-restoreobject (Disabled)
        103 - system:py2plug-fd-mariabackup (Disabled)
        104 - system:py3plug-fd-mariabackup (Disabled)
        105 - system:py2plug-fd-ovirt (Disabled)
        106 - system:py3plug-fd-ovirt (Disabled)
        107 - system:py2plug-fd-percona-xtrabackup (Disabled)
        108 - system:py3plug-fd-percona-xtrabackup (Disabled)
        109 - system:py2plug-fd-vmware (Disabled)
        110 - system:py3plug-fd-vmware (Disabled)
        111 - system:py2plug-sd (Disabled)
        112 - system:py3plug-sd (Disabled)
        113 - system:py2plug-fd-local-fileset-basic (Disabled)
        114 - system:py3plug-fd-local-fileset-basic (Disabled)
        115 - system:py3plug-fd-basic (Disabled)
        116 - system:py3plug-fd-contrib-mysql_dump (Disabled)
        117 - system:python-bareos (Disabled)
        118 - system:python-pam (Disabled)
        128 - system:restapi (Disabled)
        147 - system:stresstest (Disabled)
        161 - system:xattr (Disabled)

The following tests FAILED:
         13 - system:always-incremental-consolidate (Failed)
         15 - system:autoxflate:setup (Failed)
         16 - system:autoxflate:copy-to-local (Not Run)
         17 - system:autoxflate:copy-to-offsite (Not Run)
         18 - system:autoxflate:create-backup (Not Run)
         19 - system:autoxflate:replication-local (Not Run)
         20 - system:autoxflate:replication-offsite (Not Run)
         22 - system:bareos-basic:setup (Failed)
         23 - system:bareos-basic:bcopy-autoxflate (Not Run)
         24 - system:bareos-basic:bextract-autoxflate (Not Run)
         25 - system:bareos-basic:bls-autoxflate (Not Run)
         26 - system:bareos-basic:bscan-autoxflate (Not Run)
         27 - system:bareos-basic:filesettext-is-updated (Not Run)
         28 - system:bareos-basic:hardlinks (Not Run)
         29 - system:bareos-basic:rerun-jobs (Not Run)
         30 - system:bareos-basic:run-non-existing-jobid (Not Run)
         31 - system:bareos-basic:simple-backup-and-restore (Not Run)
         32 - system:bareos-basic:status-subscriptions (Not Run)
         33 - system:bareos-basic:test-make-catalog-backup (Not Run)
         34 - system:bareos-basic:very-long-job-names (Not Run)
         35 - system:bareos-basic:volume-recycling (Not Run)
         37 - system:bareos-acl (Failed)
         38 - system:bconsole-basic:setup (Failed)
         39 - system:bconsole-basic:autocompletion (Not Run)
         40 - system:bconsole-basic:dotjobstatus (Not Run)
         41 - system:bconsole-basic:status-client (Not Run)
         45 - system:bscan-bextract-bls-bcopy (Failed)
         47 - system:checkpoints:setup (Failed)
         48 - system:checkpoints:checkpoints-and-spooling (Not Run)
         49 - system:checkpoints:checkpoints-on-cancel (Not Run)
         50 - system:checkpoints:checkpoints-on-kill (Not Run)
         51 - system:checkpoints:checkpoints-on-stop (Not Run)
         52 - system:checkpoints:checkpoints-regular-backup (Not Run)
         55 - system:client-initiated (Failed)
         56 - system:commandline-options (Failed)
         57 - system:config-dump (Failed)
         58 - system:config-syntax-crash (Failed)
         59 - system:copy-migrate:setup (Failed)
         60 - system:copy-migrate:01-backup (Not Run)
         61 - system:copy-migrate:02-copy (Not Run)
         62 - system:copy-migrate:03-impossible-copy (Not Run)
         63 - system:copy-migrate:04-bscan (Not Run)
         64 - system:copy-migrate:05-migrate (Not Run)
         66 - system:copy-archive-job (Failed)
         67 - system:copy-remote-bscan (Failed)
         71 - system:encrypt-signature-no-tls (Failed)
         72 - system:encrypt-signature-tls-cert (Failed)
         73 - system:fileset-multiple-blocks:setup (Failed)
         74 - system:fileset-multiple-blocks:include-blocks (Not Run)
         75 - system:fileset-multiple-blocks:options-blocks (Not Run)
         77 - system:filesets (Failed)
         80 - system:list-backups (Failed)
         82 - system:multiplied-device (Failed)
         83 - system:multiple-clients:setup (Failed)
         84 - system:multiple-clients:consolidate-client (Not Run)
         87 - system:notls (Failed)
         88 - system:parallel-jobs:setup (Failed)
         89 - system:parallel-jobs:parallel-jobs (Not Run)
         90 - system:parallel-jobs:reservation-order (Not Run)
         92 - system:passive (Failed)
         93 - system:pruning (Failed)
        119 - system:quota-softquota (Failed)
        120 - system:reload:setup (Failed)
        121 - system:reload:add-client (Not Run)
        122 - system:reload:add-duplicate-job (Not Run)
        123 - system:reload:add-empty-job (Not Run)
        124 - system:reload:add-second-director (Not Run)
        125 - system:reload:add-uncommented-string (Not Run)
        126 - system:reload:unchanged-config (Not Run)
        129 - system:restore:setup (Failed)
        130 - system:restore:archive-full-restore (Not Run)
        131 - system:restore:archive-restore-dir (Not Run)
        132 - system:restore:archive-restore-file (Not Run)
        133 - system:restore:check-hints (Not Run)
        134 - system:restore:create-backup (Not Run)
        135 - system:restore:full-restore (Not Run)
        136 - system:restore:restore-dir (Not Run)
        137 - system:restore:restore-file (Not Run)
        138 - system:restore:restore-old-archive (Not Run)
        140 - system:scheduler:setup (Failed)
        141 - system:scheduler:reschedule (Not Run)
        142 - system:scheduler:scheduler-backup (Not Run)
        143 - system:scheduler:scheduler-status-copy-job (Not Run)
        145 - system:sparse-file (Failed)
        146 - system:spool (Failed)
        149 - system:tlsrestricted (Failed)
        150 - system:truncate-command (Failed)
        151 - system:upgrade-database (Failed)
        152 - system:virtualfull-basic (Failed)
        153 - system:virtualfull-bscan (Failed)
        154 - system:virtualfull-deletedfiles:setup (Failed)
        155 - system:virtualfull-deletedfiles:01-full-backup (Not Run)
        156 - system:virtualfull-deletedfiles:02-incremental-backup (Not Run)
        157 - system:virtualfull-deletedfiles:03-incremental-backup (Not Run)
        158 - system:virtualfull-deletedfiles:04-incremental-backup (Not Run)
        159 - system:virtualfull-deletedfiles:05-consolidate (Not Run)

Jörg Steffens

unread,
Dec 5, 2023, 10:31:02 AM12/5/23
to bareos...@googlegroups.com
On 05.12.23 at 13:53 wrote raspLover:
> that worked like a charm!

Great.

> Thank you very much!
>
> i head much tests that where not working, does it mean something? Backup
> is running well.

In our test environment, there are no failing tests. New code first gots
integrated, when all tests succeeded. I guess, it is a problem in your
build/test-environment, especially the tests need a running postgresql
database with "full" access of the build user, see
https://docs.bareos.org/DeveloperGuide/BuildAndTestBareos/systemtests.html#systemtests

You can either ignore this or adapt your either adapt your build
envirnoment accordingly or disable the testing by setting:
export DEB_BUILD_OPTIONS="nocheck"

Regards,
Jörg
> <tel:+49%20221%2063069391>
> https://www.bareos.com <https://www.bareos.com> Fax: +49 221
> 630693-10 <tel:+49%20221%2063069310>
>
> Sitz der Gesellschaft: Köln | Amtsgericht Köln: HRA 29646
> Komplementär: Bareos Verwaltungs-GmbH
> Geschäftsführer: Stephan Dühr, Jörg Steffens, Philipp Storz
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "bareos-users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to bareos-users...@googlegroups.com
> <mailto:bareos-users...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/bareos-users/534d841f-244e-42c9-96f8-5fdcfc5f9a7dn%40googlegroups.com <https://groups.google.com/d/msgid/bareos-users/534d841f-244e-42c9-96f8-5fdcfc5f9a7dn%40googlegroups.com?utm_medium=email&utm_source=footer>.
Message has been deleted

Wijnand van der Giessen

unread,
Feb 14, 2025, 4:20:42 AMFeb 14
to bareos-users
Hello another not very experienced coder here who wants to try to compile bareos. I've done it a few times for the major versions 20, 21 and 22 with a process that I collected from online which comes down to

get development resources in place, get the source to local machine, check requirements and build packages.

the command for build packages is:

fakeroot debian/rules binary


I wanted to do this for bareos v24 but it is failing with the following message

CMake Warning at cmake/BareosCpmPackages.cmake:27 (message):
  Detected FETCHCONTENT_FULLY_DISCONNECTED is set.
  As this will break fetching, only local packages will be considered!
Call Stack (most recent call first):
 CMakeLists.txt:198 (include)


CMake Error at cmake/CPM.cmake:728 (message):
 CPM: CLI11 not found via find_package(CLI11 2.1.2)
Call Stack (most recent call first):
 cmake/BareosCpmPackages.cmake:38 (CPMAddPackage)
 CMakeLists.txt:198 (include)


And a few more other packages it can't find.

I did some digging and now understand that cmake downloads these packages from github during the process. For some reason when I run the command cmake it does do that and fully compiles the sources but I get no packages (which I understand) this is all done on the same machine so I do not understand why my original command (fakeroot debian/rules binary) is not able to pick up the resources.

Did some digging around the FETCHCONTENT_FULLY_DISCONNECTED but can't really find how I can overcome that issue.

Also tried various other things but all seem to fail so far.

Hopefully someone can explain what I need to do to be able to compile the source code and end up with packages that I can use on a few raspberry pi systems. Thank you in advance.

Andreas Haase

unread,
Feb 14, 2025, 4:37:46 AMFeb 14
to Wijnand van der Giessen, bareos-users
Hello,


Am 11.02.2025 um 13:15 schrieb Wijnand van der Giessen <gies...@gmail.com>:

CMake Error at cmake/CPM.cmake:728 (message):
 CPM: CLI11 not found via find_package(CLI11 2.1.2)
Call Stack (most recent call first):
 cmake/BareosCpmPackages.cmake:38 (CPMAddPackage)
 CMakeLists.txt:198 (include)


And a few more other packages it can't find.

Try the following before starting the compile run:

apt-get install libcl11-dev

If that works or changes the error message, then there are missing some build deps in the control file.

Regards,
Andreas

Andreas Haase

unread,
Feb 14, 2025, 4:39:06 AMFeb 14
to Wijnand van der Giessen, bareos-users


Am 14.02.2025 um 10:37 schrieb Andreas Haase <andrea...@community4you.de>:

Try the following before starting the compile run:

apt-get install libcl11-dev

libcli11-dev is the correct package name, sorry for the typo.

Regards,
Andreas

Wijnand van der Giessen

unread,
Feb 14, 2025, 5:59:58 AMFeb 14
to bareos-users
Thank you Andreas, that was indeed the issue which I found out yesterday. I now got my packages for v24 for raspberry pi so I'm happy.

I got misled by cmake working and automatically downloading from the internet, AI got me into that direction. Strange though is that  dpkg-checkbuilddeps command didn't show anything missing.



Andreas Rogge

unread,
Feb 18, 2025, 10:24:23 AMFeb 18
to bareos...@googlegroups.com
Am 14.02.25 um 11:59 schrieb Wijnand van der Giessen:
> I now got my packages for v24 for raspberry pi so I'm happy.

Do you need the "full set" or is the FD sufficient?

We have ARM-Packages for the Universal Client.
So if you're interested, you could try the repository at
https://download.bareos.org/current/ULC_deb_OpenSSL_3.0/

The package is called "bareos-universal-client" and it is basically a
distribution-agnostic filedaemon.

Best Regards,
Andreas
--
Andreas Rogge andrea...@bareos.com
Bareos GmbH & Co. KG Phone: +49 221-630693-86
http://www.bareos.com
Reply all
Reply to author
Forward
0 new messages