This should install the rc script properly.
[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 mkdir -p $RPM_BUILD_ROOT/etc/init.d
43 cp admin/icmpdnd "$RPM_BUILD_ROOT/etc/init.d"
44
45 %post
46 # $1 = 0 is remove; $1 = 1 is update
47
48 %postun
49 # $1 = 0 is remove; $1 = 1 is update
50
51 %files
52 %defattr(-,root,root)
53 /lib/libnss_icmp.so
54 /lib/libnss_icmp.la
55 /lib/libnss_icmp.so.2.0.0
56 /lib/libnss_icmp.so.2
57 %config %{_sysconfdir}/nss-icmp.conf
58
59 %attr(4755,root,root) %{_bindir}/idnlookup
60
61 %{_sysconfdir}/init.d/icmpdnd
62 %{_sbindir}/icmpdnd
63
64 %doc AUTHORS ChangeLog COPYING INSTALL NEWS README
65
66 %clean
67 [ "$RPM_BUILD_ROOT" != "/" ] && [ -d "$RPM_BUILD_ROOT" ] && rm -rf "$RPM_BUILD_ROOT"
68