Update version number, in preparation for 1.1.2 release.
[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: 1.1.2
5 Release: 0
6 License: GPL
7 Group: Networking/Daemons
8 Packager: FreeRADIUS.org
9 Source0: %{name}-%{version}.tar.gz
10 Prereq: /sbin/chkconfig
11 BuildPreReq: libtool
12 # FIXME: snmpwalk, snmpget and rusers POSSIBLY needed by checkrad
13 Provides: radiusd
14 Conflicts: cistron-radius
15 BuildRoot: %{_tmppath}/%{name}-root
16
17 %description
18 The FreeRADIUS Server Project is a high-performance and highly
19 configurable GPL'd RADIUS server. It is somewhat similar to the
20 Livingston 2.0 RADIUS server, but has many more features, and is much
21 more configurable.
22
23 %prep
24 %setup
25
26 %build
27 CFLAGS="$RPM_OPT_FLAGS" \
28 %configure --prefix=%{_prefix} \
29         --localstatedir=%{_localstatedir} \
30         --sysconfdir=%{_sysconfdir} \
31         --mandir=%{_mandir} \
32         --disable-ltdl-install \
33         --with-ltdl-lib=/usr/lib \
34         --with-ltdl-include=/usr/include \
35         --with-large-files --with-udpfromto --with-edir \
36         --with-rlm-sql_postgresql-include-dir=/usr/include/pgsql \
37         --with-rlm-krb5-include-dir=/usr/kerberos/include \
38         --with-rlm-krb5-lib-dir=/usr/kerberos/lib
39 make
40
41 %install
42 [ "$RPM_BUILD_ROOT" != "/" ] && 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 RADDB=$RPM_BUILD_ROOT/etc/raddb
49 # set radiusd as default user/group
50 perl -i -pe 's/^#user =.*$/user = radiusd/' $RADDB/radiusd.conf
51 perl -i -pe 's/^#group =.*$/group = radiusd/' $RADDB/radiusd.conf
52 # shadow password file MUST be defined on Linux
53 perl -i -pe 's/#        shadow =/shadow =/' $RADDB/radiusd.conf
54
55 # remove unneeded stuff
56 rm -f $RPM_BUILD_ROOT%{_mandir}/man8/builddbm.8
57 rm -f $RPM_BUILD_ROOT%{_prefix}/sbin/rc.radiusd
58
59 cd redhat
60 install -m 755 rc.radiusd-redhat $RPM_BUILD_ROOT/etc/rc.d/init.d/radiusd
61 install -m 644 radiusd-logrotate $RPM_BUILD_ROOT/etc/logrotate.d/radiusd
62 install -m 644 radiusd-pam       $RPM_BUILD_ROOT/etc/pam.d/radius
63 cd ..
64
65 %pre
66 /usr/sbin/useradd -c "radiusd user" -r -s /bin/false -u 95 -d / radiusd 2>/dev/null || :
67
68 %preun
69 if [ "$1" = "0" ]; then
70         /sbin/service radiusd stop > /dev/null 2>&1
71         /sbin/chkconfig --del radiusd
72 fi
73
74 %post
75 /sbin/ldconfig
76 /sbin/chkconfig --add radiusd
77
78 # Done here to avoid messing up existing installations
79 for i in radius/radutmp radius/radwtmp radius/radius.log # radius/radwatch.log radius/checkrad.log
80 do
81         touch /var/log/$i
82         chown radiusd:radiusd /var/log/$i
83         chmod 600 /var/log/$i
84 done
85
86 %postun
87 if [ "$1" -ge "1" ]; then
88         /sbin/service radiusd condrestart >/dev/null 2>&1
89 fi
90 if [ $1 = 0 ]; then
91         /usr/sbin/userdel radiusd > /dev/null 2>&1 || :
92 fi
93 /sbin/ldconfig
94
95 %clean
96 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
97
98 %files
99 %defattr(-,root,root)
100 %doc doc/ChangeLog doc/README* todo/ COPYRIGHT INSTALL
101 %config /etc/pam.d/radius
102 %config /etc/logrotate.d/radiusd
103 %config /etc/rc.d/init.d/radiusd
104 %config (noreplace) /etc/raddb/*
105 %{_bindir}/*
106 %{_datadir}/%{name}
107 %{_libdir}/*
108 %{_mandir}/*/*
109 %{_sbindir}/*
110 %attr(0700,radiusd,radiusd) %dir /var/log/radius
111 %attr(0700,radiusd,radiusd) %dir /var/log/radius/radacct
112 %attr(0700,radiusd,radiusd) %dir /var/run/radiusd
113
114 %changelog
115 * Thu Dec 15 2004 Alan DeKok
116 - update for 1.1.0
117
118 * Mon May 31 2004 Paul Hampson
119 - update for 1.0.0 release
120
121 * Fri May 23 2003 Marko Myllynen
122 - update for 0.9
123
124 * Wed Sep  4 2002 Marko Myllynen
125 - fix libtool issues for good
126
127 * Thu Aug 22 2002 Marko Myllynen
128 - update for 0.7/0.8
129
130 * Tue Jun 18 2002 Marko Myllynen
131 - run as radiusd user instead of root
132 - added some options for configure
133
134 * Thu Jun  6 2002 Marko Myllynen
135 - set noreplace for non-dictionary files in /etc/raddb
136
137 * Sun May 26 2002 Frank Cusack <frank@google.com>
138 - move /var dirs from %%post to %%files
139
140 * Thu Feb 14 2002 Marko Myllynen
141 - use dir name macros in all configure options
142 - libtool is required only when building the package
143 - misc clean ups
144
145 * Wed Feb 13 2002 Marko Myllynen
146 - use %%{_mandir} instead of /usr/man
147 - rename %%postin as %%post
148 - clean up name/version
149
150 * Fri Jan 18 2002 Frank Cusack <frank@google.com>
151 - remove (noreplace) for /etc/raddb/* (due to rpm bugs)
152
153 * Fri Sep 07 2001 Ivan F. Martinez <ivanfm@ecodigit.com.br>
154 - changes to make compatible with default config file shipped
155 - adjusts log files are on /var/log/radius instead of /var/log
156 - /etc/raddb changed to config(noreplace) to don't override
157 -   user configs
158
159 * Fri Sep 22 2000 Bruno Lopes F. Cabral <bruno@openline.com.br>
160 - spec file clear accordling to the libltdl fix and minor updates
161
162 * Wed Sep 12 2000 Bruno Lopes F. Cabral <bruno@openline.com.br>
163 - Updated to snapshot-12-Sep-00
164
165 * Fri Jun 16 2000 Bruno Lopes F. Cabral <bruno@openline.com.br>
166 - Initial release