File smbtad.spec of Package smbtad

# spec file for package smbtad
# Copyright (c) 2011 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

# norootforbuild

Name:           smbtad
BuildRequires:  cmake libtalloc-devel
%if 0%{?suse_version}
BuildRecommends:  sqlite3-devel
BuildRecommends:  sqlite3 >= 3.7
BuildRecommends: libiniparser-devel

License:        GPLv3+
Group:          Productivity/Networking/Samba
Version:        1.2.2
Release:        1
Summary:        A collector of smbd share usage data
Source0:        %{name}-%{version}.tar.bz2
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%define INITDIR %{_sysconfdir}/init.d

smbtad is the data receiver of the SMB Traffic Analyzer project.
With SMB Traffic Analyzer statistics about the data flow on a Samba network can be created.
Please see for more information. 

%setup -q

if test ! -e "build"; then
  %{__mkdir} build

pushd build
cmake \
  -DCMAKE_C_FLAGS:STRING="%{optflags}" \
  -DCMAKE_CXX_FLAGS:STRING="%{optflags}" \
  -DSYSCONF_INSTALL_DIR=%{_sysconfdir} \
%if %{_lib} == lib64
%__make %{?jobs:-j%jobs} VERBOSE=1
popd build

pushd build
%if 0%{?suse_version}
make DESTDIR=%{buildroot} install
popd build
mkdir -p %{buildroot}/usr/sbin
ln -s /etc/init.d/smbtad %{buildroot}/usr/sbin/rcsmbtad

%__rm -rf %{buildroot}

%attr(0754,root,root) %config %{INITDIR}/smbtad
%doc dist/smbtad.conf_example