]> git.ipfire.org Git - people/ms/dnsmasq.git/blob - dnsmasq-mdk.spec
import of dnsmasq-2.3.tar.gz
[people/ms/dnsmasq.git] / dnsmasq-mdk.spec
1 ###############################################################################
2 #
3 # General mumbojumbo
4 #
5 ###############################################################################
6
7 Name: dnsmasq
8 Version: 2.3
9 Release: 1
10 Copyright: GPL
11 Group: System Environment/Daemons
12 Vendor: Simon Kelley
13 Packager: Simon Kelley
14 Distribution: Mandrake Linux
15 URL: http://www.thekelleys.org.uk/dnsmasq
16 Source0: %{name}-%{version}.tar.gz
17 Requires: chkconfig
18 BuildRoot: /var/tmp/%{name}-%{version}
19 Summary: A lightweight caching nameserver
20
21 %description
22 Dnsmasq is lightweight, easy to configure DNS forwarder and DHCP server. It
23 is designed to provide DNS and, optionally, DHCP, to a small network. It can
24 serve the names of local machines which are not in the global DNS. The DHCP
25 server integrates with the DNS server and allows machines with DHCP-allocated
26 addresses to appear in the DNS with names configured either in each host or
27 in a central configuration file. Dnsmasq supports static and dynamic DHCP
28 leases and BOOTP for network booting of diskless machines.
29
30
31 ###############################################################################
32 #
33 # Build
34 #
35 ###############################################################################
36
37 %prep
38 %setup -q
39 %build
40 make
41
42
43 ###############################################################################
44 #
45 # Install
46 #
47 ###############################################################################
48
49 %install
50 rm -rf $RPM_BUILD_ROOT
51
52 mkdir -p -m 755 $RPM_BUILD_ROOT/usr/sbin
53 mkdir -p -m 755 $RPM_BUILD_ROOT/etc/rc.d/init.d
54 mkdir -p -m 755 $RPM_BUILD_ROOT/usr/share/man/man8
55
56 cp rpm/dnsmasq.rh $RPM_BUILD_ROOT/etc/rc.d/init.d/dnsmasq
57 strip src/dnsmasq
58 cp src/dnsmasq $RPM_BUILD_ROOT/usr/sbin
59 cp dnsmasq.8 $RPM_BUILD_ROOT/usr/share/man/man8
60 cp dnsmasq.conf.example $RPM_BUILD_ROOT/etc/dnsmasq.conf
61 ###############################################################################
62 #
63 # Clean up
64 #
65 ###############################################################################
66
67 %clean
68 rm -rf $RPM_BUILD_ROOT
69
70
71 ###############################################################################
72 #
73 # Post-install scriptlet
74 #
75 ###############################################################################
76
77 %post
78 /sbin/chkconfig --add dnsmasq
79
80
81 ###############################################################################
82 #
83 # Pre-uninstall scriptlet
84 #
85 # If there's a time when your package needs to have one last look around before
86 # the user erases it, the place to do it is in the %preun script. Anything that
87 # a package needs to do immediately prior to RPM taking any action to erase the
88 # package, can be done here.
89 #
90 ###############################################################################
91
92 %preun
93 if [ $1 = 0 ]; then # execute this only if we are NOT doing an upgrade
94 service dnsmasq stop >/dev/null 2>&1
95 /sbin/chkconfig --del dnsmasq
96 fi
97
98
99 ###############################################################################
100 #
101 # Post-uninstall scriptlet
102 #
103 # The %postun script executes after the package has been removed. It is the
104 # last chance for a package to clean up after itself.
105 #
106 ###############################################################################
107
108 %postun
109 if [ "$1" -ge "1" ]; then
110 service dnsmasq restart >/dev/null 2>&1
111 fi
112
113
114 ###############################################################################
115 #
116 # File list
117 #
118 ###############################################################################
119
120 %files
121 %defattr(-,root,root)
122 %doc CHANGELOG COPYING FAQ doc.html setup.html UPGRADING_to_2.0
123 %attr(0755,root,root) /etc/rc.d/init.d/dnsmasq
124 %attr(0664,root,root) /etc/dnsmasq.conf
125 %config /etc/rc.d/init.d/dnsmasq
126 %config /etc/dnsmasq.conf
127 %attr(0755,root,root) /usr/sbin/dnsmasq
128 %attr(0644,root,root) /usr/share/man/man8/dnsmasq.8.bz2
129
130