This should install the rc script properly.
[icmp-dn.git] / admin / icmpdn.spec.in
CommitLineData
388db563
DC
1Name: icmpdn
2Version: @VERSION@
3Release: 1
4Vendor: Fredrik Tolf <fredrik@dolda2000.com>
5License: LGPL for library, GPL for utilities
6Group: System Environment/Libraries
7Summary: ICMP host name utilities
8Source: %name-%version.tar.gz
9URL: http://www.dolda2000.com/~fredrik/icmp-dn/
10BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
11
12%description
13Since the Linux kernel does not support the ICMP host name facilities as
14described in RFC 1788, I wrote a simple implementation in user-space.
15It 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
31CXXFLAGS="$RPM_OPT_FLAGS" CFLAGS="$RPM_OPT_FLAGS" \
32 ./configure \
33 --prefix=%_prefix \
34 --sysconfdir=%_sysconfdir \
35 --libdir=/lib
36make
37
38%install
39[ "$RPM_BUILD_ROOT" != "/" ] && [ -d "$RPM_BUILD_ROOT" ] && rm -rf "$RPM_BUILD_ROOT"
40mkdir $RPM_BUILD_ROOT
41make DESTDIR=$RPM_BUILD_ROOT install
365fce8d 42mkdir -p $RPM_BUILD_ROOT/etc/init.d
7ad5b9c9 43cp admin/icmpdnd "$RPM_BUILD_ROOT/etc/init.d"
388db563
DC
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