File iwpmd.spec of Package iwpmd

#
# spec file for package iwpm
#
# Copyright (c) 2016 SUSE LINUX 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/
#


Name:           iwpmd
Summary:        iWarp Port Mapper userspace daemon
License:        GPL-2.0 or BSD-2-Clause
Group:          System/Libraries
Version:        1.0.4
Release:        0
Source0:        http://www.openfabrics.org/downloads/libiwpm-%{version}.tar.gz
Source1:        iwpmd-rpmlintrc
Source2:        COPYING
Patch0:         iwpmd-configure.patch
#
#
BuildRequires:  autoconf
BuildRequires:  automake
BuildRequires:  libtool
BuildRequires:  libnl3-devel
BuildRequires:  pkgconfig(systemd)
BuildRequires:  systemd-rpm-macros
BuildRequires:  systemd
Url:            http://www.openfabrics.org/
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%systemd_requires

%description
Iwpmd provides a userspace service for iWarp drivers to claim
tcp ports through the standard socket interface


%package        devel
Summary:        Development files for accessing the iWarp portmapper
Group:          Development/Libraries/C and C++
Requires:       %{name} = %{version}

%description    devel
Header files to access the iWarp/RDMA port mapper

%prep
%setup -q -n libiwpm-%{version}
%patch0
cp %{S:2} .

%build
[ ! -d m4 ] && mkdir m4
autoreconf -fi
%configure --disable-silent-rules
make %{?_smp_mflags}

%pre
%service_add_pre iwpmd.service

%post
%service_add_post iwpmd.service

%preun
%service_del_preun iwpmd.service

%postun
%service_del_postun iwpmd.service

%install
make DESTDIR=%{buildroot} install
install -Dp -m 0644 iwpmd.service %{buildroot}/%{_unitdir}/iwpmd.service

mkdir -p %{buildroot}%{_sysconfdir}
install -m 0644 iwpmd.conf %{buildroot}%{_sysconfdir}/iwpmd.conf

%files
%defattr(-,root,root,-) 
%{_unitdir}/iwpmd.service
%_bindir/iwpmd
%doc COPYING README
%config %_sysconfdir/iwpmd.conf

%files devel
%defattr(-,root,root)
%_includedir/rdma/iwpm_netlink.h
%_includedir/rdma/iwarp_pm.h

%changelog
openSUSE Build Service is sponsored by