Change run_dir default from /var/run to /var/run/radiusd.
[freeradius.git] / redhat / freeradius.spec
1 Summary: High-performance and highly configurable RADIUS server
2 URL: http://www.freeradius.org/
3 Name: freeradius
4 Version: 0.5
5 Release: 1
6 License: GPL
7 Group: Networking/Daemons
8 Packager: FreeRADIUS.org
9 Source0: %{name}-%{version}.tar.gz
10 # FIXME: won't be good to include these contrib examples?
11 # Source1: http://www.ping.de/~fdc/radius/radacct-replay
12 # Source2: http://www.ping.de/~fdc/radius/radlast-0.03
13 # Source3: ftp://ftp.freeradius.org/pub/radius/contrib/radwho.cgi
14 Prereq: /sbin/chkconfig
15 BuildPreReq: libtool
16 # FIXME: snmpwalk, snmpget and rusers POSSIBLY needed by checkrad
17 Conflicts: cistron-radius
18 BuildRoot: %{_tmppath}/%{name}-root
19
20 %description
21 The FreeRADIUS Server Project is a high-performance and highly
22 configurable GPL'd RADIUS server. It is somewhat similar to the
23 Livingston 2.0 RADIUS server, but has many more features, and is much
24 more configurable.
25
26 %prep 
27 %setup
28
29 %build
30 CFLAGS="$RPM_OPT_FLAGS" \
31 %configure --prefix=%{_prefix} \
32         --localstatedir=%{_localstatedir} \
33         --sysconfdir=%{_sysconfdir} \
34         --mandir=%{_mandir} \
35         --with-threads \
36         --with-thread-pool \
37         --with-gnu-ld \
38         --disable-ltdl-install
39 make
40
41 %install
42 rm -rf $RPM_BUILD_ROOT
43
44 mkdir -p $RPM_BUILD_ROOT/etc/{logrotate.d,pam.d,rc.d/init.d}
45
46 make install R=$RPM_BUILD_ROOT
47
48 # remove unneeded stuff
49 rm -f $RPM_BUILD_ROOT%{_mandir}/man8/builddbm.8
50 rm -f $RPM_BUILD_ROOT%{_prefix}/sbin/rc.radiusd
51
52 cd redhat
53 install -m 755 rc.radiusd-redhat $RPM_BUILD_ROOT/etc/rc.d/init.d/radiusd
54 install -m 644 radiusd-logrotate $RPM_BUILD_ROOT/etc/logrotate.d/radiusd
55 install -m 644 radiusd-pam       $RPM_BUILD_ROOT/etc/pam.d/radius
56 cd ..
57
58 %preun
59 if [ "$1" = "0" ]; then
60         /sbin/chkconfig --del radiusd
61 fi
62
63 %post
64 if [ "$1" = "0" ]; then
65         /sbin/chkconfig --add radiusd
66 fi
67
68 # Done here to avoid messing up existing installations
69 for i in radius/radutmp radius/radwtmp # radius/radius.log radius/radwatch.log radius/checkrad.log
70 do
71   touch /var/log/$i
72   chown root:root /var/log/$i
73   chmod 600 /var/log/$i
74 done
75
76 %clean
77 rm -rf $RPM_BUILD_ROOT
78
79 %files
80 %defattr(-,root,root)
81 %doc doc/ChangeLog doc/README* todo/ COPYRIGHT INSTALL
82 %config /etc/pam.d/radius
83 %config /etc/logrotate.d/radiusd
84 %config /etc/rc.d/init.d/radiusd
85 %config /etc/raddb/*
86 %{_mandir}/*/*
87 /usr/bin/*
88 /usr/sbin/*
89 /usr/lib/*
90 %attr(0700,root,root) %dir /var/log/radius
91 %attr(0700,root,root) %dir /var/log/radius/radacct
92 %attr(0700,root,root) %dir /var/run/radiusd
93
94 %changelog
95 * Sun May 26 2002 Frank Cusack <frank@google.com>
96 - move /var dirs from %%post to %%files
97
98 * Thu Feb 14 2002 Marko Myllynen
99 - use dir name macros in all configure options
100 - libtool is required only when building the package
101 - misc clean ups
102
103 * Wed Feb 13 2002 Marko Myllynen
104 - use %{_mandir} instead of /usr/man
105 - rename %postin as %post
106 - clean up name/version
107
108 * Fri Jan 18 2002 Frank Cusack <frank@google.com>
109 - remove (noreplace) for /etc/raddb/* (due to rpm bugs)
110
111 * Fri Sep 07 2001 Ivan F. Martinez <ivanfm@ecodigit.com.br>
112 - changes to make compatible with default config file shipped
113 - adjusts log files are on /var/log/radius instead of /var/log
114 - /etc/raddb changed to config(noreplace) to don't override
115 -   user configs
116
117 * Fri Sep 22 2000 Bruno Lopes F. Cabral <bruno@openline.com.br>
118 - spec file clear accordling to the libltdl fix and minor updates
119
120 * Wed Sep 12 2000 Bruno Lopes F. Cabral <bruno@openline.com.br>
121 - Updated to snapshot-12-Sep-00
122
123 * Fri Jun 16 2000 Bruno Lopes F. Cabral <bruno@openline.com.br>
124 - Initial release