29bde3c7f7595e9bc942ed2bb52008505f28815e
[freeradius.git] / suse / freeradius.spec
1 #
2 # spec file for package freeradius (Version 1.0.3)
3 #
4 # Copyright (c) 2004 SUSE LINUX Products GmbH, Nuernberg, Germany.
5 # This file and all modifications and additions to the pristine
6 # package are under the same license as the package itself.
7 #
8 # Please submit bugfixes or comments via http://www.suse.de/feedback/
9 #
10
11 %define _oracle_support 0
12
13 # neededforbuild  cyrus-sasl-devel db-devel heimdal-devel heimdal-lib mysql-devel mysql-shared openldap2 openldap2-client openldap2-devel openssl openssl-devel pam-devel postgresql postgresql-devel postgresql-libs python python-devel unixODBC unixODBC-devel
14
15 BuildRequires: aaa_base acl attr bash bind-utils bison bzip2 coreutils cpio cpp cracklib cvs cyrus-sasl db devs diffutils e2fsprogs file filesystem fillup findutils flex gawk gdbm-devel glibc glibc-devel glibc-locale gpm grep groff gzip info insserv less libacl libattr libgcc libnscd libselinux libstdc++ libxcrypt libzio m4 make man mktemp module-init-tools ncurses ncurses-devel net-tools netcfg openldap2-client openssl pam pam-modules patch permissions popt procinfo procps psmisc pwdutils rcs readline sed strace syslogd sysvinit tar tcpd texinfo timezone unzip util-linux vim zlib zlib-devel autoconf automake binutils cyrus-sasl-devel db-devel e2fsprogs-devel gcc gdbm gettext heimdal-devel heimdal-lib libtool mysql-devel mysql-shared openldap2 openldap2-devel openssl-devel pam-devel perl postgresql postgresql-devel postgresql-libs python python-devel rpm unixODBC unixODBC-devel
16
17 Name:         freeradius
18 License:      GPL, LGPL
19 Group:        Productivity/Networking/Radius/Servers
20 Provides:     radiusd
21 Conflicts:    radiusd-livingston radiusd-cistron icradius
22 Version:      1.0.2
23 Release:      1.suse
24 URL:          http://www.freeradius.org/
25 Summary:      Very highly Configurable Radius-Server
26 Source0:      %{name}-%{version}.tar.gz
27 %if %suse_version > 800
28 PreReq:       /usr/sbin/useradd /usr/sbin/groupadd
29 PreReq:       %insserv_prereq %fillup_prereq
30 %endif
31 BuildRoot:    %{_tmppath}/%{name}-%{version}-build
32 Autoreqprov:  off
33
34 %description
35 The FreeRADIUS server has a number of features found in other servers,
36 and additional features not found in any other server. Rather than
37 doing a feature by feature comparison, we will simply list the features
38 of the server, and let you decide if they satisfy your needs.
39
40 Support for RFC and VSA Attributes Additional server configuration
41 attributes Selecting a particular configuration Authentication methods
42 Accounting methods
43
44
45
46 Authors:
47 --------
48     Miquel van Smoorenburg <miquels@cistron.nl>
49     Alan DeKok <aland@ox.org>
50     Mike Machado <mike@innercite.com>
51     Alan Curry
52     various other people
53
54 %package oracle
55 BuildRequires: oracle-instantclient-basic oracle-instantclient-devel
56 Group:        Productivity/Networking/Radius/Servers
57 Summary:      FreeRADIUS Oracle database support
58 Requires:     oracle-instantclient-basic
59 Autoreqprov:  off
60
61 %description oracle
62 The FreeRADIUS server has a number of features found in other servers,
63 and additional features not found in any other server. Rather than
64 doing a feature by feature comparison, we will simply list the features
65 of the server, and let you decide if they satisfy your needs.
66
67 Support for RFC and VSA Attributes Additional server configuration
68 attributes Selecting a particular configuration Authentication methods
69
70 %package dialupadmin
71 Group:        Productivity/Networking/Radius/Servers
72 Summary:      FreeRADIUS web interface
73 Requires:     perl-DateManip, php4, apache2-mod_php4
74 Autoreqprov:  off
75
76 %description dialupadmin
77 This is the FreeRADIUS web interface.
78
79
80 %package devel
81 Group:        Development/Libraries/C and C++
82 Summary:      FreeRADIUS Development Files (static libs)
83 Autoreqprov:  off
84
85 %description devel
86 These are the static libraries for the FreeRADIUS package.
87
88
89
90 Authors:
91 --------
92     Miquel van Smoorenburg <miquels@cistron.nl>
93     Alan DeKok <aland@ox.org>
94     Mike Machado <mike@innercite.com>
95     Alan Curry
96     various other people
97
98 %prep
99 %setup
100 rm -rf `find . -name CVS`
101
102 %build
103 CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" ./configure \
104                 --prefix=%{_prefix} \
105                 --sysconfdir=%{_sysconfdir} \
106                 --infodir=%{_infodir} \
107                 --mandir=%{_mandir} \
108                 --libdir=/usr/lib/freeradius \
109                 --localstatedir=/var \
110                 --with-threads \
111                 --with-thread-pool \
112                 --with-snmp \
113                 --with-large-files \
114                 --disable-ltdl-install \
115                 --with-ltdl-lib=/usr/lib \
116                 --with-ltdl-include=/usr/include \
117                 --with-gnu-ld \
118 %if %suse_version <= 920
119                 --enable-heimdal-krb5 \
120                 --with-rlm-krb5-include-dir=/usr/include/heimdal/ \
121 %endif
122                 --with-rlm-krb5-lib-dir=%{_libdir} \
123                 --with-edir \
124 %if %_oracle_support == 1
125                 --with-rlm_sql_oracle \
126                 --with-oracle-lib-dir=/usr/lib/oracle/10.1.0.3/client/lib/ \
127 %else
128                 --without-rlm_sql_oracle \
129 %endif
130                 --enable-strict-dependencies
131 make
132
133 %install
134 [ "$RPM_BUILD_ROOT" != "/" ] && [ -d $RPM_BUILD_ROOT ] && rm -rf \
135 $RPM_BUILD_ROOT
136 mkdir -p $RPM_BUILD_ROOT
137 mkdir -p $RPM_BUILD_ROOT/var/lib/radiusd
138 make install R=$RPM_BUILD_ROOT
139 # modify default configuration
140 RADDB=$RPM_BUILD_ROOT%{_sysconfdir}/raddb
141 perl -i -pe 's/^#user =.*$/user = radiusd/'   $RADDB/radiusd.conf
142 perl -i -pe 's/^#group =.*$/group = radiusd/' $RADDB/radiusd.conf
143 ldconfig -n $RPM_BUILD_ROOT/usr/lib/freeradius
144 # logs
145 touch $RPM_BUILD_ROOT/var/log/radius/radutmp
146 # SuSE
147 install -d     $RPM_BUILD_ROOT/etc/pam.d
148 install -d     $RPM_BUILD_ROOT/etc/logrotate.d
149 %if %suse_version >= 930
150    install -m 644 suse/radiusd-pam $RPM_BUILD_ROOT/etc/pam.d/radiusd
151 %else
152    #install -m 644 suse/radiusd-pam-old $RPM_BUILD_ROOT/etc/pam.d/radiusd
153    install -m 644 suse/radiusd-pam $RPM_BUILD_ROOT/etc/pam.d/radiusd
154 %endif
155 install    -m 644 suse/radiusd-logrotate $RPM_BUILD_ROOT/etc/logrotate.d/radiusd
156 install -d -m 755 $RPM_BUILD_ROOT/etc/init.d
157 install    -m 744 suse/rcradiusd $RPM_BUILD_ROOT/etc/init.d/radiusd
158 #install  -d  -m 744 $RPM_BUILD_ROOT/usr/share/dialup_admin
159 DIALUPADMIN=$RPM_BUILD_ROOT/usr/share/freeradius-dialupadmin
160 cp -R dialup_admin $DIALUPADMIN
161 perl -i -pe 's/^#general_base_dir\:.*$/general_base_dir\: \/usr\/share\/freeradius-dialupadmin/'   $DIALUPADMIN/conf/admin.conf
162 perl -i -pe 's/^#general_radiusd_base_dir\:.*$/general_radiusd_base_dir\: \//'   $DIALUPADMIN/conf/admin.conf
163 perl -i -pe 's/^#general_snmpwalk_command\:.*$/general_snmpwalk_command\: \/usr\/bin\/snmpwalk/'   $DIALUPADMIN/conf/admin.conf
164 perl -i -pe 's/^#general_snmpget_command\:.*$/general_snmpget_command\: \/usr\/bin\/snmpget/'   $DIALUPADMIN/conf/admin.conf
165 ln -sf ../../etc/init.d/radiusd $RPM_BUILD_ROOT/usr/sbin/rcradiusd
166 mv -v doc/README doc/README.doc
167 # remove unneeded stuff
168 rm -rf doc/00-OLD
169 rm -f $RPM_BUILD_ROOT/etc/raddb/experimental.conf $RPM_BUILD_ROOT/usr/sbin/radwatch $RPM_BUILD_ROOT/usr/sbin/rc.radiusd
170 rm -rf $RPM_BUILD_ROOT/usr/share/doc/freeradius*
171
172 %pre
173 /usr/sbin/groupadd -r radiusd 2> /dev/null || :
174 /usr/sbin/useradd -r -g radiusd -s /bin/false -c "Radius daemon" -d \
175                   /var/lib/radiusd radiusd 2> /dev/null || :
176
177 %post
178 %{fillup_and_insserv -s radiusd START_RADIUSD }
179 %if %suse_version > 820
180
181 %preun
182 %stop_on_removal radiusd
183 %endif
184
185 %postun
186 %if %suse_version > 820
187 %restart_on_update radiusd
188 %endif
189 %{insserv_cleanup}
190
191 %clean
192 [ "$RPM_BUILD_ROOT" != "/" ] && [ -d $RPM_BUILD_ROOT ] && rm -rf $RPM_BUILD_ROOT
193
194 %files
195 %defattr(-,root,root)
196 # doc
197 %doc %attr(-,root,root) $RPM_SOURCE_DIR/README.SuSE
198 %doc doc/* LICENSE COPYRIGHT CREDITS README
199 %doc src/modules/rlm_sql/drivers/rlm_sql_*/*.sql
200 %doc scripts/create-users.pl scripts/CA.* scripts/certs.sh
201 %doc scripts/users2mysql.pl scripts/xpextensions
202 %doc scripts/cryptpasswd scripts/exec-program-wait scripts/radiusd2ldif.pl
203 # SUSE support scripts
204 %config /etc/init.d/radiusd
205 %config /etc/pam.d/radiusd
206 %config /etc/logrotate.d/radiusd
207 /usr/sbin/rcradiusd
208 %dir %attr(755,radiusd,radiusd) /var/lib/radiusd
209 # configs
210 %dir /etc/raddb
211 %defattr(-,root,radiusd)
212 %config /etc/raddb/dictionary
213 %config(noreplace) /etc/raddb/acct_users
214 %config(noreplace) /etc/raddb/attrs
215 %attr(640,-,radiusd) %ghost %config(noreplace) /etc/raddb/clients
216 %attr(640,-,radiusd) %config(noreplace) /etc/raddb/clients.conf
217 %config(noreplace) /etc/raddb/hints
218 %config(noreplace) /etc/raddb/huntgroups
219 %config(noreplace) /etc/raddb/ldap.attrmap
220 %attr(640,-,radiusd) %config(noreplace) /etc/raddb/mssql.conf
221 %ghost %config(noreplace) /etc/raddb/naslist
222 %attr(640,-,radiusd) %config(noreplace) /etc/raddb/naspasswd
223 %attr(640,-,radiusd) %ghost %config(noreplace) /etc/raddb/oraclesql.conf
224 %attr(640,-,radiusd) %config(noreplace) /etc/raddb/postgresql.conf
225 %attr(640,-,radiusd) %config(noreplace) /etc/raddb/preproxy_users
226 %attr(640,-,radiusd) %config(noreplace) /etc/raddb/proxy.conf
227 %config(noreplace) /etc/raddb/radiusd.conf
228 %ghost %config(noreplace) /etc/raddb/realms
229 %attr(640,-,radiusd) %config(noreplace) /etc/raddb/snmp.conf
230 %attr(640,-,radiusd) %config(noreplace) /etc/raddb/sql.conf
231 %attr(640,-,radiusd) %config(noreplace) /etc/raddb/users
232 %config(noreplace) /etc/raddb/x99.conf
233 %attr(640,-,radiusd) %config(noreplace) /etc/raddb/x99passwd.sample
234 %attr(640,-,radiusd) %config(noreplace) /etc/raddb/certs
235 %attr(640,-,radiusd) %config(noreplace) /etc/raddb/eap.conf
236 %attr(700,radiusd,radiusd) %dir /var/run/radiusd/
237 # binaries
238 %defattr(-,root,root)
239 /usr/bin/*
240 /usr/sbin/check-radiusd-config
241 /usr/sbin/checkrad
242 /usr/sbin/radiusd
243 # shared libs
244 %attr(755,root,root) %dir /usr/lib/freeradius
245 %attr(755,root,root) /usr/lib/freeradius/*.so*
246 # man-pages
247 %doc %{_mandir}/man1/*
248 %doc %{_mandir}/man5/*
249 %doc %{_mandir}/man8/*
250 # dictionaries
251 %attr(755,root,root) %dir /usr/share/freeradius
252 /usr/share/freeradius/*
253 # logs
254 %attr(700,radiusd,radiusd) %dir /var/log/radius/
255 %attr(700,radiusd,radiusd) %dir /var/log/radius/radacct/
256 %attr(644,radiusd,radiusd) /var/log/radius/radutmp
257
258 %files devel
259 %defattr(-,root,root)
260 /usr/lib/freeradius/*.a
261 %attr(644,root,root) /usr/lib/freeradius/*.la
262
263
264 %if %_oracle_support == 1
265 %files oracle
266 %defattr(-,root,root)
267 %attr(755,root,root) %dir /usr/lib/freeradius
268 %attr(755,root,root) /usr/lib/freeradius/rlm_sql_oracle*.so*
269 %endif
270
271 %files dialupadmin
272 %dir %attr(755,root,root) /usr/share/freeradius-dialupadmin
273 %config /usr/share/freeradius-dialupadmin/conf
274 /usr/share/freeradius-dialupadmin/*
275