LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 08-01-2023, 07:42 AM   #1
Maris-S
Member
 
Registered: Feb 2010
Location: Latvia
Distribution: Slackware 15.0
Posts: 33

Rep: Reputation: 2
Bareos compilation


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!

Last edited by Maris-S; 08-01-2023 at 07:50 AM.
 
Old 08-02-2023, 03:03 PM   #2
henca
Senior Member
 
Registered: Aug 2007
Location: Linköping, Sweden
Distribution: Slackware
Posts: 1,012

Rep: Reputation: 678Reputation: 678Reputation: 678Reputation: 678Reputation: 678Reputation: 678
I am probably not the best one to respond to this as I have never used bareos myself. However, I find it kind of sad that a good initiative like this doesn't get any response at all so here is my uninitiated attempt to give some feedback:

The best way to get widespread use is probably to contribute your SlackBuild script to slackbuilds.org ( https://slackbuilds.org/guidelines/ ).

Dependencies considered mandatory should be listed in the "REQUIRES" row in the .info file belonging to the SlackBuild script. Optional dependencies should be mentioned in the README.

Also some Slackware startup files include other files, rc.cups calls /etc/init.d/functions. Also, many scripts below /etc/rc.d calls other files where different variables are set.

I don't think it would be any problem to use a for loop in doinst.sh, but maybe you have some reason to think so?

If you would want to split up the software in different packages (maybe some for server and other for clients) you should create one SlackBuild file for each package.

regards Henrik
 
Old 08-03-2023, 04:09 PM   #3
Maris-S
Member
 
Registered: Feb 2010
Location: Latvia
Distribution: Slackware 15.0
Posts: 33

Original Poster
Rep: Reputation: 2
Thanks, Henca for your reply!

Will see if I'll make this package good enough for slackbuilds.org. As I didn't work with bareos before, not so sure if everything works. So far have some problems with mail sending already... Bareos is using it's own client bsmtp, so maybe this is configuration issue.

It's quite hard to understand which dependencies are really necessary, Bareos documentation is not very informative about how to build and about dependencies. That should be more clear during testing of software itself, if some features will not work.

I didn't try to use loop in doinst.sh, mostly was focused on compilation of bareos itself, but I'll try to rebuild this part too.

Splitting Server and Client packages would be quite easy, because there is an option to build client only, but not so easy for different server components (like Director, SD, FD, etc.). By using individual SlackBuild for each package would be kind of redundant compilation, because that would mean to compile everything and take only necessary files for particular package. Compilation is fast, but still... Anyway, that's something to think about later. Splitting of components in different packages would be necessary to install them on different servers for load balancing. For the beginning it will be good enough in single package.

Meanwhile I solved the problem with warnings/errors. It turns out it works when this option is removed:

Code:
-DCMAKE_BUILD_TYPE=Release
No idea why. Slackbuild on github is updated.

Last edited by Maris-S; 08-03-2023 at 04:10 PM.
 
Old 08-03-2023, 05:25 PM   #4
henca
Senior Member
 
Registered: Aug 2007
Location: Linköping, Sweden
Distribution: Slackware
Posts: 1,012

Rep: Reputation: 678Reputation: 678Reputation: 678Reputation: 678Reputation: 678Reputation: 678
Quote:
Originally Posted by Maris-S View Post
Meanwhile I solved the problem with warnings/errors. It turns out it works when this option is removed:

Code:
-DCMAKE_BUILD_TYPE=Release
No idea why. Slackbuild on github is updated.
Looking at the Bareos web site it seems to me as if they are mostly interested in selling commercial subscriptions. Maybe it is intentional that it shouldn't be too easy to build the community edition from source.

regards Henrik
 
Old 08-04-2023, 02:19 AM   #5
Maris-S
Member
 
Registered: Feb 2010
Location: Latvia
Distribution: Slackware 15.0
Posts: 33

Original Poster
Rep: Reputation: 2
It looks so, yes. And this is big disadvantage...
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Get started with Bareos, an open source client-server backup solution LXer Syndicated Linux News 0 05-12-2022 11:36 PM
LXer: How to Setup Bareos Backup Solution on Ubuntu 18.04 LTS LXer Syndicated Linux News 0 04-15-2020 03:26 AM
LXer: FOSS Project Spotlight: Bareos, a Cross-Network, Open-Source Backup Solution LXer Syndicated Linux News 0 05-18-2019 12:44 AM
Compilation of bareos on arm-architecture: Missing MySQL-Header/Libs triztan Programming 0 09-21-2013 04:46 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 03:23 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration