Hello!

Recently I have tried to build contrib-pgsql-plugin under Centos7 from your repo
https://github.com/bareos/contrib-pgsql-plugin, and I have faced with
some troubles. Some of them had because of error in Makefile.bareos (sed -i 
's#$(CXX)$(CXXFLAGS)#$(CXX) $(CXXFLAGS)#g' Makefile), some of them because of 
missing header files, and different path in them. Also package should have 
libbareos.so symlink to latest original shared object (in our case this is 
libbareos-15.2.2.so). Here is my specfile based on original: 

%define origname contrib-pgsql-plugin
Name: bareos-pgsql-plugin
Version: 2.2
Release: 1%{?dist}
Summary: PostgreSQL backup plugin for Bareos
Group: System Environment/Daemons
License: AGPLv3
URL: http://www.inteos.pl/
Vendor: Inteos Sp. z o.o.
Distribution: Bacula Inteos Postgresql Plugin
Source0: https://github.com/bareos/contrib-pgsql-plugin/%origname.tar.bz2
Source1: hostconfig.h
Source2: streams.h
Source3: filetypes.h
Source4: mutex_list.h
Source5: output_formatter.h
Source6: host.h
Source7: fd_plugins.h
Source8: fileopts.h

BuildRequires: postgresql-devel
BuildRequires: libtool
BuildRequires: bareos-devel

Requires: bareos-director
Requires: bareos-bconsole

%description
PGSQL Plugin is a Bareos File Daemon plugin wich
perform PostgreSQL database on-line backup and
point-in-time recovery

%prep
%setup -q -n %origname
cp Makefile.bareos Makefile
sed -i 's#/libtool#/usr/bin/libtool#g' Makefile
sed -i 's#g++#/usr/bin/g++#g' Makefile
sed -i 's#$(CXX)$(CXXFLAGS)#$(CXX) $(CXXFLAGS)#g' Makefile
sed -i 's#/usr/lib/bareos#/usr/lib64/bareos#g' Makefile
sed -i 's#/usr/lib/bareos#/usr/lib64/bareos#g' Makefile
sed -i 's#bareos.h#bareos/bareos.h#g' pgsql-fd.c
sed -i 's#bareos.h#bareos/bareos.h#g' keylist.h
sed -i 's#bareos.h#bareos/bareos.h#g' pluglib.c
sed -i 's#bareos.h#bareos/bareos.h#g' pluglib.h
sed -i 's#bareos.h#bareos/bareos.h#g' pgsqllib.c
sed -i 's#bareos.h#bareos/bareos.h#g' pgsqllib.h

sed -i 's#config.h#bareos/config.h#g' pgsqllib.c

sed -i 's#fd_plugins.h#bareos/fd_plugins.h#g' pgsql-fd.c
sed -i 's#fd_plugins.h#bareos/fd_plugins.h#g' pluglib.c
sed -i 's#fd_plugins.h#bareos/fd_plugins.h#g' pluglib.h

sed -i 's#fileopts.h#bareos/fileopts.h#g' pgsql-fd.c
sed -i 's#lib/plugins.h#plugins.h#g' pgsql-fd.c
sed -i 's#lib/lib.h#lib.h#g' /usr/include/bareos/bareos.h

ln -s /usr/lib64/bareos/libbareos-15.2.2.so /usr/lib64/libbareos.so

cp %SOURCE1 /usr/include/bareos/
cp %SOURCE2 /usr/include/bareos/
cp %SOURCE3 /usr/include/bareos/
cp %SOURCE4 /usr/include/bareos/
cp %SOURCE5 /usr/include/bareos/
cp %SOURCE6 /usr/include/bareos/
cp %SOURCE7 /usr/include/bareos/
cp %SOURCE8 /usr/include/bareos/

sed -i 's#lib/plugins.h#bareos/plugins.h#g' /usr/include/bareos/fd_plugins.h

%install
%make_build CFLAGS="%optflags" CXXOPTFLAGS="%optflags"
#make


%files
%config(noreplace) /opt/bacula/etc/pgsql.conf.example
%defattr(755,root,-)
/opt/bacula/bin/pgsql-archlog
/opt/bacula/bin/pgsql-restore
/opt/bacula/plugins/pgsql-fd.so

%changelog
* Fri Apr 24 2013 Radoslaw Korzeniewski <[email protected]>
- Update to version 1.9
- Build for PgSQL 9.x
- add RPM Package

-- 
You received this message because you are subscribed to the Google Groups 
"bareos-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to