File ifplugd.spec of Package ifplugd

# spec file for package ifplugd (Version 0.28)
# 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

# norootforbuild

Name:           ifplugd
BuildRequires:  gcc-c++ libdaemon-devel lynx pkgconfig
Version:        0.28
Release:        219
Summary:        Daemon Activating Network Interfaces on Cable Plug
License:        GPLv2+
Group:          Productivity/Networking/Other
Source:         %{name}-%{version}.tar.gz
Source1:        README.initscript
Patch:          ifplugd.dif
Patch1:         ifplugd-0.28.dif
Patch2:         ifplugd.action.diff
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

ifplugd is a lightweight Linux daemon that configures the network
automatically when a cable is plugged in and unconfigures it when the
cable is pulled. It is primarily intended for use with laptops. It
relies on the distribution's native network configuration subsystem, so
is not very intrusive.

    Lennard Poettering <mzvscyhtq (at) 0pointer (dot) de>

%setup -q
%patch -p1
# %setup -n %{name}-%{version} -T -D -a 1
cp %{S:1} .

export CFLAGS="$RPM_OPT_FLAGS -D__KERNEL_STRICT_NAMES -fno-strict-aliasing"
%configure --sbindir=/sbin --disable-xmltoman --disable-subversion 
%{__make} %{?_smp_mflags}

#will not work, can not combine "doc /" and "doc [^/]" ...
#mkdir -p $RPM_BUILD_ROOT/usr/share/doc/packages/ifplugd/
#mv $RPM_BUILD_ROOT/etc/init.d/ifplugd $RPM_BUILD_DIR/%{name}-%{version}/doc/ifplugd.init
rm -fv $RPM_BUILD_ROOT/etc/init.d/ifplugd


%defattr (-,root,root)
%doc conf/ifplugd.init README.initscript
%doc %{_mandir}/man5/ifplugd.conf.5.gz
%doc %{_mandir}/man8/ifplugd.8.gz
%doc %{_mandir}/man8/ifplugstatus.8.gz
%config %{_sysconfdir}/ifplugd