File rdma.spec of Package rdma
#
# spec file for package rdma
#
# Copyright (c) 2013 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/
#
Summary: Infiniband/iWARP Kernel Module Initializer
Name: rdma
Version: 2.0
Release: 1
License: GPL-2.0+
Group: System Environment/Base
Source0: rdma.conf
Source1: rdma.udev-ipoib-naming.rules
Source6: rdma.service
Source7: rdma.sbin
Source8: rdma.udev-rules
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
%if 0%suse_version < 1310
BuildRequires: systemd
%else
BuildRequires: systemd-rpm-macros
%endif
BuildRequires: udev
Requires: udev >= 095
Provides: ofed = 5.0
Obsoletes: ofed < 5.0
%systemd_requires
%description
User space initialization scripts for the kernel InfiniBand/iWARP drivers
%prep
%build
%install
rm -rf %{buildroot}
install -d %{buildroot}%{_sysconfdir}/%{name}
install -d %{buildroot}/usr/lib/udev/rules.d
install -d %{buildroot}%{_sysconfdir}/sysconfig/network-scripts
install -d %{buildroot}%{_sbindir}
install -d %{buildroot}%{_unitdir}
# Stuff to go into the base package
install -m 0644 %{SOURCE0} %{buildroot}%{_sysconfdir}/%{name}/%{name}.conf
install -m 0644 %{SOURCE1} %{buildroot}/usr/lib/udev/rules.d/70-persistent-ipoib.rules
install -m 0644 %{SOURCE6} %{buildroot}%{_unitdir}/rdma.service
install -m 0755 %{SOURCE7} %{buildroot}%{_sbindir}/rdma-init-kernel
#install -m 0755 %%{SOURCE4} %%{buildroot}%%{_sysconfdir}/sysconfig/network-scripts/ifup-ib
#install -m 0755 %%{SOURCE5} %%{buildroot}%%{_sysconfdir}/sysconfig/network-scripts/ifdown-ib
install -m 0644 %{SOURCE8} %{buildroot}/usr/lib/udev/rules.d/98-rdma.rules
%clean
%pre
%service_add_pre rdma.service
%post
%service_add_post rdma.service
%preun
%service_del_preun rdma.service
%postun
%service_del_postun rdma.service
%files
%defattr(-,root,root,-)
%dir %{_sysconfdir}/%{name}
%config(noreplace) %{_sysconfdir}/%{name}/%{name}.conf
/usr/lib/udev/rules.d/*
%{_unitdir}/%{name}.service
%{_sbindir}/rdma-init-kernel
#%%{_sysconfdir}/sysconfig/network-scripts/*
%changelog