]> git.pld-linux.org Git - packages/ifplugd.git/blob - ifplugd.spec
- need to write ifplugd.init script
[packages/ifplugd.git] / ifplugd.spec
1 Summary:        Detect and perform actions when an ethernet cable is (un)plugged
2 Name:           ifplugd
3 Version:        0.16
4 Release:        1
5 Source0:        http://www.stud.uni-hamburg.de/~lennart/projects/ifplugd/ifplugd-0.16.tar.gz
6 # Source0-md5:  56b920b51b05949f8a729e8c3e13ba70
7 Source1:        %{name}.init
8 License:        GPL
9 Group:          Networking
10 URL:            http://www.stud.uni-hamburg.de/users/lennart/projects/ifplugd/
11 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
12 BuildRequires:  libdaemon-devel >= 0.2
13 BuildRequires:  lynx
14
15 %define         _sbindir        /sbin
16
17 %description
18 ifplugd is a Linux daemon which will automatically configure your
19 ethernet device when a cable is plugged in and automatically
20 unconfigure it if the cable is pulled. This is useful on laptops with
21 onboard network adapters, since it will only configure the interface
22 when a cable is really connected.
23
24 %prep
25 %setup -q
26
27 %build
28 %configure
29 %{__make}
30
31 %install
32 rm -rf $RPM_BUILD_ROOT
33 install -d $RPM_BUILD_ROOT/etc/rc.d/init.d
34
35 %{__make} install \
36         DESTDIR=$RPM_BUILD_ROOT
37
38 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
39
40 %clean
41 rm -rf $RPM_BUILD_ROOT
42
43 %post
44 /sbin/chkconfig --add %{name}
45 if [ -f /var/lock/subsys/%{name} ]; then
46         /etc/rc.d/init.d/%{name} restart 1>&2
47 else
48         echo "Run \"/etc/rc.d/init.d/%{name} start\" to start %{name} service."
49 fi
50
51 %preun
52 if [ "$1" = "0" ]; then
53         if [ -f /var/lock/subsys/%{name} ]; then
54                 /etc/rc.d/init.d/%{name} stop 1>&2
55         fi
56         /sbin/chkconfig --del %{name}
57 fi
58
59 %files
60 %defattr(644,root,root,755)
61 %doc doc/README doc/NEWS doc/README.html doc/style.css
62 %{_sbindir}/*
63 %{_mandir}/man?/*
64 %attr(754,root,root) /etc/rc.d/init.d/%{name}
65 %dir %{_sysconfdir}/ifplugd
66 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/ifplugd/ifplugd.conf
67 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/ifplugd/ifplugd.action
68
69 # end of file
This page took 0.061503 seconds and 3 git commands to generate.