This should fix installation of the icmpdnd rc script.
[icmp-dn.git] / admin / icmpdn.spec.in
1 Name:           icmpdn
2 Version:        @VERSION@
3 Release:        1
4 Vendor:         Fredrik Tolf <fredrik@dolda2000.com>
5 License:        LGPL for library, GPL for utilities
6 Group:          System Environment/Libraries
7 Summary:        ICMP host name utilities
8 Source:         %name-%version.tar.gz
9 URL:            http://www.dolda2000.com/~fredrik/icmp-dn/
10 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
11
12 %description
13 Since the Linux kernel does not support the ICMP host name facilities as
14 described in RFC 1788, I wrote a simple implementation in user-space.
15 It comprises three parts:
16
17     * icmpdnd – The ICMP Domain Name daemon, which listens to ICMP
18       domain name requests and replies to them.
19
20     * idnlookup – A user utility to query a host for its host name over
21       ICMP. Like ping and all other utilities that use ICMP, it needs to
22       be installed SUID root.
23
24     * libnss_icmp.so.2 – A glibc NSS module, which uses idnlookup to
25       perform queries for the gethostbyaddr function.
26
27 %prep
28 %setup
29
30 %build
31 CXXFLAGS="$RPM_OPT_FLAGS" CFLAGS="$RPM_OPT_FLAGS"       \
32         ./configure                     \
33         --prefix=%_prefix               \
34         --sysconfdir=%_sysconfdir       \
35         --libdir=/lib
36 make
37
38 %install
39 [ "$RPM_BUILD_ROOT" != "/" ] && [ -d "$RPM_BUILD_ROOT" ] && rm -rf "$RPM_BUILD_ROOT"
40 mkdir $RPM_BUILD_ROOT
41 make DESTDIR=$RPM_BUILD_ROOT install
42 cp admin/icmpdnd "$RPM_BUILD_ROOT/etc/init.d"
43
44 %post
45 # $1 = 0 is remove; $1 = 1 is update
46
47 %postun
48 # $1 = 0 is remove; $1 = 1 is update
49
50 %files
51 %defattr(-,root,root)
52 /lib/libnss_icmp.so
53 /lib/libnss_icmp.la
54 /lib/libnss_icmp.so.2.0.0
55 /lib/libnss_icmp.so.2
56 %config %{_sysconfdir}/nss-icmp.conf
57
58 %attr(4755,root,root) %{_bindir}/idnlookup
59
60 %{_sysconfdir}/init.d/icmpdnd
61 %{_sbindir}/icmpdnd
62
63 %doc AUTHORS ChangeLog COPYING INSTALL NEWS README
64
65 %clean
66 [ "$RPM_BUILD_ROOT" != "/" ] && [ -d "$RPM_BUILD_ROOT" ] && rm -rf "$RPM_BUILD_ROOT"
67