summaryrefslogtreecommitdiff
path: root/maradns.spec
blob: e1771edd35899e6965a32edaffefdaa3062d0139 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
Summary:	A (currently) authoritative-only DNS server made with security in mind
Summary(pl):	Tylko autorytatywny (na razie) serwer DNS zrobiony z myślą o bezpieczeństwie
Name:		maradns
Version:	1.1.43
Release:	2
License:	Public Domain
Group:		Networking/Daemons
Source0:	http://www.maradns.org/download/1.1/%{name}-%{version}.tar.bz2
# Source0-md5:	cac028c40b3c2b5519c80481616397fb
Source1:	%{name}.init
Source2:	zoneserver.init
Source3:	mararc
Patch0:		%{name}-default_uid.patch
URL:		http://www.maradns.org/
BuildRequires:	rpmbuild(macros) >= 1.268
Requires(post):	fileutils
Requires(post,preun):	/sbin/chkconfig
Requires(postun):	/usr/sbin/groupdel
Requires(postun):	/usr/sbin/userdel
Requires(pre):	/bin/id
Requires(pre):	/usr/bin/getgid
Requires(pre):	/usr/sbin/groupadd
Requires(pre):	/usr/sbin/groupmod
Requires(pre):	/usr/sbin/useradd
Requires(pre):	/usr/sbin/usermod
Requires:	rc-scripts
Provides:	group(named)
Provides:	nameserver
Provides:	user(named)
Obsoletes:	nameserver
BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)

%description
MaraDNS is (currently) an authoritative-only DNS server made with
security in mind.

%description -l pl
MaraDNS jest (na razie) tylko autorytatywnym serwerem DNS zrobionym z
myślą o bezpieczeństwie.

%package zoneserver
Summary:	Handle zone transfers for MaraDNS
Summary(pl):	Obsługa transferów stref dla MaraDNS
Group:		Networking/Daemons
Requires(post):	fileutils
Requires(post,preun):	/sbin/chkconfig
Requires:	%{name} = %{version}-%{release}
Requires:	rc-scripts

%description zoneserver
zoneserver listens on port 53/tcp and handles dns zone transfers.
zoneserver uses a configuration file, /etc/mararc by default, to
determine various parameters, such as the IP to bind to, who is
allowed to perform zone transfers, etc.

%description zoneserver -l pl
zoneserver słucha na porcie 53/tcp i obsługuje transfery stref DNS.
Używa domyślnie pliku konfiguracyjnego /etc/mararc aby uzyskać
parametry takie jak na jakim adresie ma słuchać, kto może robić
transfery stref itp.

%prep
%setup -q
%patch0 -p1

# kill precompiled x86 objects
rm -f {parse,qual,tcp}/*.o

%build
%{__make} \
	CC="%{__cc}" \
	FLAGS="%{rpmcflags}"

%install
rm -rf $RPM_BUILD_ROOT
install -d $RPM_BUILD_ROOT{%{_sbindir},%{_bindir},%{_mandir}/{,fr/}man{1,5,8}} \
	$RPM_BUILD_ROOT{%{_sysconfdir}/maradns,/etc/rc.d/init.d} \
	$RPM_BUILD_ROOT%{_localstatedir}/log

install server/maradns tcp/zoneserver tcp/getzone $RPM_BUILD_ROOT%{_sbindir}
install tools/askmara $RPM_BUILD_ROOT%{_bindir}
install tools/benchmark $RPM_BUILD_ROOT%{_bindir}
install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/maradns
install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/zoneserver
install %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/mararc
install doc/en/examples/example_csv1 $RPM_BUILD_ROOT%{_sysconfdir}/maradns/db.example.com

> $RPM_BUILD_ROOT%{_localstatedir}/log/maradns
> $RPM_BUILD_ROOT%{_localstatedir}/log/zoneserver

install doc/en/man/*.1 $RPM_BUILD_ROOT%{_mandir}/man1
install doc/en/man/*.5 $RPM_BUILD_ROOT%{_mandir}/man5
install doc/en/man/*.8 $RPM_BUILD_ROOT%{_mandir}/man8
install doc/fr/man/*.1 $RPM_BUILD_ROOT%{_mandir}/fr/man1
install doc/fr/man/*.5 $RPM_BUILD_ROOT%{_mandir}/fr/man5
install doc/fr/man/*.8 $RPM_BUILD_ROOT%{_mandir}/fr/man8

rm -rf doc/*/man

%clean
rm -rf $RPM_BUILD_ROOT

%pre
%groupadd -g 58 named
if [ "`/bin/id -u maradns 2>/dev/null`" = "58" ]; then
	/usr/sbin/usermod -d /tmp -l named maradns
fi
%useradd -u 58 -g 58 -d /tmp -s /bin/false -c "maraDNS user" named

%post
/sbin/chkconfig --add maradns
%service maradns restart
touch %{_localstatedir}/log/maradns
chmod 640 %{_localstatedir}/log/maradns

%postun
if [ "$1" = "0" ]; then
	%userremove named
	%groupremove named
fi

%post zoneserver
/sbin/chkconfig --add zoneserver
%service zoneserver restart
touch %{_localstatedir}/log/zoneserver
chmod 640 %{_localstatedir}/log/zoneserver

%preun
if [ "$1" = "0" ]; then
	%service maradns stop
	/sbin/chkconfig --del maradns
fi

%preun zoneserver
if [ "$1" = "0" ]; then
	%service zoneserver stop
	/sbin/chkconfig --del zoneserver
fi

%files
%defattr(644,root,root,755)
%doc 0QuickStart TODO 00README.FIRST CREDITS CHANGELOG doc/{README,en}
%lang(fr) %doc doc/fr
%attr(754,root,root) /etc/rc.d/init.d/maradns
%attr(755,root,root) %{_sbindir}/getzone
%attr(755,root,root) %{_sbindir}/maradns
%attr(755,root,root) %{_bindir}/*
%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mararc
%dir %{_sysconfdir}/maradns
%attr(640,root,root) %config %verify(not md5 mtime size) %{_sysconfdir}/maradns/db.example.com
%attr(640,root,root) %ghost %{_localstatedir}/log/maradns
%{_mandir}/man1/*
%{_mandir}/man5/*
%{_mandir}/man8/maradns*
%{_mandir}/man8/duende*
%lang(fr) %{_mandir}/fr/man1/*
%lang(fr) %{_mandir}/fr/man5/*
%lang(fr) %{_mandir}/fr/man8/maradns*

%files zoneserver
%defattr(644,root,root,755)
%attr(754,root,root) /etc/rc.d/init.d/zoneserver
%attr(755,root,root) %{_sbindir}/zoneserver
%attr(640,root,root) %ghost %{_localstatedir}/log/zoneserver
%{_mandir}/man8/zoneserver*
%lang(fr) %{_mandir}/fr/man8/zoneserver*