File csync.spec of Package csync

#
# spec file for package csync (Version 0.44.0)
#
# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

# norootforbuild


Name:           csync
BuildRequires:  cmake doxygen gcc-c++ libiniparser-devel liblog4c-devel
BuildRequires:  libsmbclient-devel libssh-devel
%if 0%{?suse_version}
BuildRequires:  sqlite3-devel
%else
BuildRequires:  sqlite-devel
%endif
License:        GPL-2.0+
Group:          Productivity/Networking/Other
Version:        0.44.0
Release:        1
Summary:        A user level bidirectional client only file synchronizer
Url:            http://www.csync.org/
Source0:        %{name}-%{version}.tar.bz2
Source1:        baselibs.conf
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
csync is an implementation of a file synchronizer which provides the
feature of roaming home directories for Linux clients. csync makes use
of libsmbclient in Samba/Windows environments.

%package -n libcsync0
License:        GPL-2.0+
Summary:        A user level bidirectional client only file synchronizer
Group:          System/Libraries
%if 0%{?suse_version} > 1030
Recommends:     libcsync-plugin-smb
Recommends:     libcsync-plugin-sftp
%endif

%description -n libcsync0
csync is an implementation of a file synchronizer which provides the
feature of roaming home directories for Linux clients. csync makes use
of libsmbclient in Samba/Windows environments.

%package -n libcsync-plugin-smb
License:        GPL-2.0+
Summary:        SMB plugin for csync
Group:          System/Libraries
Requires:       libcsync0 = %{version}

%description -n libcsync-plugin-smb
This plug-in allows applications using csync to synchronize with a
Samba or Windows server.

%package -n libcsync-plugin-sftp
License:        GPL-2.0+
Summary:        A user level bidirectional client only file synchronizer
Group:          Productivity/Networking/Other
Requires:       libcsync0 = %{version}

%description -n libcsync-plugin-sftp
csync is an implementation of a file synchronizer which provides the
feature of roaming home directories for Linux clients. csync makes use
of libsmbclient in Samba/Windows environments.

%package -n libcsync-devel
License:        GPL-2.0+
Summary:        Development files for csync
Group:          Development/Libraries/C and C++
Requires:       libcsync0 = %{version}

%description -n libcsync-devel
The libcsync-devel package contains the static libraries and header
files needed for development with csync.

%package -n libcsync-devel-doc
License:        GPL-2.0+
Summary:        Developer documentation for csync
Group:          Development/Languages/C and C++

%description -n libcsync-devel-doc
The libcsync-devel-doc package provides documentation for csync
development.

%package -n libcsync-doc
License:        GPL-2.0+
Summary:        User documentation for csync
Group:          Development/Languages/C and C++

%description -n libcsync-doc
The libcsync-doc package provides user documentation for csync.

%prep
%setup -q

%build
if test ! -e "build"; then
  %{__mkdir} build
fi
pushd build
cmake \
  -DCMAKE_C_FLAGS:STRING="%{optflags}" \
  -DCMAKE_CXX_FLAGS:STRING="%{optflags}" \
  -DCMAKE_SKIP_RPATH=ON \
  -DCMAKE_BUILD_TYPE=RelWithDebInfo \
  -DCMAKE_INSTALL_PREFIX=%{_prefix} \
  -DSYSCONF_INSTALL_DIR=%{_sysconfdir} \
%if %{_lib} == lib64
  -DLIB_SUFFIX=64 \
%endif
  %{_builddir}/%{name}-%{version}
%__make %{?jobs:-j%jobs} VERBOSE=1
%__make doc
popd build

%install
pushd build
%if 0%{?suse_version}
%makeinstall
%else
make DESTDIR=%{buildroot} install
%endif
popd build

%post -n libcsync0
/sbin/ldconfig

%postun -n libcsync0
/sbin/ldconfig

%clean
%__rm -rf %{buildroot}

%files
%defattr(-,root,root)
%{_bindir}/csync
%{_mandir}/man?/csync.*

%files -n libcsync0
%defattr(-,root,root)
%doc AUTHORS COPYING INSTALL README
%dir %{_sysconfdir}/csync
%config(noreplace) %{_sysconfdir}/csync/csync.conf
%config(noreplace) %{_sysconfdir}/csync/csync_exclude.conf
%config(noreplace) %{_sysconfdir}/csync/csync_log.conf
%{_libdir}/libcsync.so.*
%dir %{_libdir}/csync-0

%files -n libcsync-plugin-smb
%defattr(-,root,root)
%{_libdir}/csync-0/csync_smb.so

%files -n libcsync-plugin-sftp
%defattr(-,root,root)
%{_libdir}/csync-0/csync_sftp.so

%files -n libcsync-devel
%defattr(-,root,root)
%{_includedir}/csync
%{_libdir}/libcsync.so

%files -n libcsync-devel-doc
%defattr(-,root,root)
%doc build/doc/html

%files -n libcsync-doc
%defattr(-,root,root)
%{_datadir}/doc/csync

%changelog
openSUSE Build Service is sponsored by