Bareos compilation
by Maris-S from LinuxQuestions.org on (#6DEW6)
Hello, all!
I want to test Bareos backup software, but cannot find Slackbuild for latest versions. Did anybody try to compile it on Slackware, any of latest version which is using cmake? I believe 18.2 is version they switched to cmake.
I'm not experienced with package making, but after a lot of researching and trying I finally got working package. Although I have some questions and concerns about compilation. I used outdated Bareos Slackbuild as starting point. For reference I used Bareos official build descriptions from here and here (as documentation suggests), as well as scripts from Arch, Gentoo and Alpine. So far only Bareos 22.1.0 is tested.
As there is no good documentation about how to build Bareos, big problem is cmake defines. Is there any way to see all available defines and their description, something like "./configure --help"?
Most challenging part was cmake compilation warnings which are considered as errors by default. So to workaround this I used cmake options:
Code:-DCMAKE_C_FLAGS:STRING="$SLKCFLAGS -Wno-unused-but-set-variable -Wno-unused-parameter -Wno-return-type" \
-DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS -Wno-unused-parameter" \I can see in scripts from other distros, they do something similar but by patching CMakeList.txt file, like here. Maybe I'm wrong? But is it safe to use this options and ignore warnings? As this is backup software, I do not want to build buggy package. Also it looks weird that many distros have this problem.
Another problem was missing "core/platforms/slackware/CMakeList.txt" file. I created it myself by using file from FreeBSD platform. This is probably more like a bug from Bareos developers, or they just ignoring Slackware. Anyway, I'm not sure if I didn't make any mistake in this file, especially which could rise security issues. This part is used to create init scripts, so should be ok, but who knows...
This Slackbuild is using modified init scripts for versions starting from 21.0.0, since this version PID files should be specified as launch option. I didn't test prior versions though, to check how PID files are handled there. Another unusual thing for me is that init scripts are using included functions file, not sure if it's good idea to leave init scripts like this, or maybe it's better to rebuild them in Slackware way, without any included function file?
About Dependencies. In general all dependencies are being checked during compilation and as I can see all features which doesn't have necessary dependencies/libraries are ignored and not compiled. In other words, if some feature support is required, appropriate dependencies should be installed before compilation. Example - Glusterfs. Problem/question here is about a lot of dependencies regarding Testing, i.e. Selenium or GTest. I assume it's only for code testing purpose, so should be important for developers, not regular usage. Am I right here?
I was not sure if it's safe to use For Loop in doinst.sh file, so I added necessary lines manually, but there are quite a lot of configuration files to deal with, so would be good to find a better way how to manage them.
Yet another question is about package/packages creation in general. I see some distros are making separate packages for different components, like Arch linux. Is it worth trying? At least to separate main components Director, SD, FD, Web Console.
All Slackbuilds are available here. Source code will be downloaded automatically, if it's not in Slackbuild directory:
1) postgresql - available at slackbuilds.org, modified to latest version
2) pam_wrapper - probably not necessary, looks like this is dependency for code testing purposes
3) liburcu - available at slackbuilds.org
4) gperftools - available at slackbuilds.org, modified to latest version
5) glusterfs - available at slackbuilds.org, very outdated though, modified to latest version.
Notes:
liburcu and gperftools are dependencies for glusterfs, not for bareos itself,
glusterfs was not tested itself, used it only as dependency for glusterfs support in bareos.
There is also build output for Bareos (output.log), available in Bareos directory.
I would appreciate any suggestions on how to improve this Slackbuild or make it in more correct way if there are any mistakes.
Thank you all in advance! And sorry for long writing!
I want to test Bareos backup software, but cannot find Slackbuild for latest versions. Did anybody try to compile it on Slackware, any of latest version which is using cmake? I believe 18.2 is version they switched to cmake.
I'm not experienced with package making, but after a lot of researching and trying I finally got working package. Although I have some questions and concerns about compilation. I used outdated Bareos Slackbuild as starting point. For reference I used Bareos official build descriptions from here and here (as documentation suggests), as well as scripts from Arch, Gentoo and Alpine. So far only Bareos 22.1.0 is tested.
As there is no good documentation about how to build Bareos, big problem is cmake defines. Is there any way to see all available defines and their description, something like "./configure --help"?
Most challenging part was cmake compilation warnings which are considered as errors by default. So to workaround this I used cmake options:
Code:-DCMAKE_C_FLAGS:STRING="$SLKCFLAGS -Wno-unused-but-set-variable -Wno-unused-parameter -Wno-return-type" \
-DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS -Wno-unused-parameter" \I can see in scripts from other distros, they do something similar but by patching CMakeList.txt file, like here. Maybe I'm wrong? But is it safe to use this options and ignore warnings? As this is backup software, I do not want to build buggy package. Also it looks weird that many distros have this problem.
Another problem was missing "core/platforms/slackware/CMakeList.txt" file. I created it myself by using file from FreeBSD platform. This is probably more like a bug from Bareos developers, or they just ignoring Slackware. Anyway, I'm not sure if I didn't make any mistake in this file, especially which could rise security issues. This part is used to create init scripts, so should be ok, but who knows...
This Slackbuild is using modified init scripts for versions starting from 21.0.0, since this version PID files should be specified as launch option. I didn't test prior versions though, to check how PID files are handled there. Another unusual thing for me is that init scripts are using included functions file, not sure if it's good idea to leave init scripts like this, or maybe it's better to rebuild them in Slackware way, without any included function file?
About Dependencies. In general all dependencies are being checked during compilation and as I can see all features which doesn't have necessary dependencies/libraries are ignored and not compiled. In other words, if some feature support is required, appropriate dependencies should be installed before compilation. Example - Glusterfs. Problem/question here is about a lot of dependencies regarding Testing, i.e. Selenium or GTest. I assume it's only for code testing purpose, so should be important for developers, not regular usage. Am I right here?
I was not sure if it's safe to use For Loop in doinst.sh file, so I added necessary lines manually, but there are quite a lot of configuration files to deal with, so would be good to find a better way how to manage them.
Yet another question is about package/packages creation in general. I see some distros are making separate packages for different components, like Arch linux. Is it worth trying? At least to separate main components Director, SD, FD, Web Console.
All Slackbuilds are available here. Source code will be downloaded automatically, if it's not in Slackbuild directory:
1) postgresql - available at slackbuilds.org, modified to latest version
2) pam_wrapper - probably not necessary, looks like this is dependency for code testing purposes
3) liburcu - available at slackbuilds.org
4) gperftools - available at slackbuilds.org, modified to latest version
5) glusterfs - available at slackbuilds.org, very outdated though, modified to latest version.
Notes:
liburcu and gperftools are dependencies for glusterfs, not for bareos itself,
glusterfs was not tested itself, used it only as dependency for glusterfs support in bareos.
There is also build output for Bareos (output.log), available in Bareos directory.
I would appreciate any suggestions on how to improve this Slackbuild or make it in more correct way if there are any mistakes.
Thank you all in advance! And sorry for long writing!