ff1c9ceca3f8878ff28a490752886b4eb978796b
[freeradius.git] / suse / freeradius.spec
1 #
2 # spec file for package freeradius (Version 1.1.0)
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 # 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
12
13 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
14
15 Name:         freeradius
16 License:      GPL, LGPL
17 Group:        Productivity/Networking/Radius/Servers
18 Provides:     radiusd
19 Conflicts:    radiusd-livingston radiusd-cistron icradius
20 Version:      1.1.0
21 Release:      1.suse
22 URL:          http://www.freeradius.org/
23 Summary:      Very highly Configurable Radius-Server
24 Source0:      %{name}-%{version}.tar.gz
25 %if %suse_version > 800
26 PreReq:       /usr/sbin/useradd /usr/sbin/groupadd
27 PreReq:       %insserv_prereq %fillup_prereq
28 %endif
29 BuildRoot:    %{_tmppath}/%{name}-%{version}-build
30
31 %description
32 The FreeRADIUS server has a number of features found in other servers,
33 and additional features not found in any other server. Rather than
34 doing a feature by feature comparison, we will simply list the features
35 of the server, and let you decide if they satisfy your needs.
36
37 Support for RFC and VSA Attributes Additional server configuration
38 attributes Selecting a particular configuration Authentication methods
39 Accounting methods
40
41
42
43 Authors:
44 --------
45     Miquel van Smoorenburg <miquels@cistron.nl>
46     Alan DeKok <aland@ox.org>
47     Mike Machado <mike@innercite.com>
48     Alan Curry
49     various other people
50
51 %package devel
52 Group:        Development/Libraries/C and C++
53 Summary:      FreeRADIUS Development Files (static libs)
54
55 %description devel
56 These are the static libraries for the FreeRADIUS package.
57
58
59
60 Authors:
61 --------
62     Miquel van Smoorenburg <miquels@cistron.nl>
63     Alan DeKok <aland@ox.org>
64     Mike Machado <mike@innercite.com>
65     Alan Curry
66     various other people
67
68 %prep
69 %setup
70 rm -rf `find . -name CVS`
71
72 %build
73 CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" ./configure \
74                 --prefix=%{_prefix} \
75                 --sysconfdir=%{_sysconfdir} \
76                 --infodir=%{_infodir} \
77                 --mandir=%{_mandir} \
78                 --libdir=/usr/lib/freeradius \
79                 --localstatedir=/var \
80                 --with-threads \
81                 --with-thread-pool \
82                 --with-snmp \
83                 --with-large-files \
84                 --disable-ltdl-install \
85                 --with-ltdl-lib=/usr/lib \
86                 --with-ltdl-include=/usr/include \
87                 --with-gnu-ld \
88                 --enable-heimdal-krb5 \
89                 --with-rlm-krb5-include-dir=/usr/include/heimdal/ \
90                 --with-rlm-krb5-lib-dir=%{_libdir} \
91                 --enable-strict-dependencies
92 make
93
94 %install
95 [ "$RPM_BUILD_ROOT" != "/" ] && [ -d $RPM_BUILD_ROOT ] && rm -rf \
96 $RPM_BUILD_ROOT
97 mkdir -p $RPM_BUILD_ROOT
98 mkdir -p $RPM_BUILD_ROOT/var/lib/radiusd
99 make install R=$RPM_BUILD_ROOT
100 # modify default configuration
101 RADDB=$RPM_BUILD_ROOT%{_sysconfdir}/raddb
102 perl -i -pe 's/^#user =.*$/user = radiusd/'   $RADDB/radiusd.conf
103 perl -i -pe 's/^#group =.*$/group = radiusd/' $RADDB/radiusd.conf
104 ldconfig -n $RPM_BUILD_ROOT/usr/lib/freeradius
105 # logs
106 touch $RPM_BUILD_ROOT/var/log/radius/radutmp
107 # SuSE
108 install -d     $RPM_BUILD_ROOT/etc/pam.d
109 install -d     $RPM_BUILD_ROOT/etc/logrotate.d
110 install -m 644 suse/radiusd-pam $RPM_BUILD_ROOT/etc/pam.d/radiusd
111 install -m 644 suse/radiusd-logrotate $RPM_BUILD_ROOT/etc/logrotate.d/radiusd
112 install -d -m 755 $RPM_BUILD_ROOT/etc/init.d
113 install    -m 744 suse/rcradiusd $RPM_BUILD_ROOT/etc/init.d/radiusd
114 ln -sf ../../etc/init.d/radiusd $RPM_BUILD_ROOT/usr/sbin/rcradiusd
115 mv -v doc/README doc/README.doc
116 # remove unneeded stuff
117 rm -rf doc/00-OLD
118 rm -f $RPM_BUILD_ROOT/etc/raddb/experimental.conf $RPM_BUILD_ROOT/usr/sbin/radwatch $RPM_BUILD_ROOT/usr/sbin/rc.radiusd
119 rm -rf $RPM_BUILD_ROOT/usr/share/doc/freeradius*
120
121 %pre
122 /usr/sbin/groupadd -r radiusd 2> /dev/null || :
123 /usr/sbin/useradd -r -g radiusd -s /bin/false -c "Radius daemon" -d \
124                   /var/lib/radiusd radiusd 2> /dev/null || :
125
126 %post
127 %{fillup_and_insserv -s radiusd START_RADIUSD }
128 %if %suse_version > 820
129
130 %preun
131 %stop_on_removal radiusd
132 %endif
133
134 %postun
135 %if %suse_version > 820
136 %restart_on_update radiusd
137 %endif
138 %{insserv_cleanup}
139
140 %clean
141 [ "$RPM_BUILD_ROOT" != "/" ] && [ -d $RPM_BUILD_ROOT ] && rm -rf $RPM_BUILD_ROOT
142
143 %files
144 %defattr(-,root,root)
145 # doc
146 %doc %attr(-,root,root) $RPM_SOURCE_DIR/README.SuSE
147 %doc doc/* LICENSE COPYRIGHT CREDITS README
148 %doc src/modules/rlm_sql/drivers/rlm_sql_*/*.sql
149 %doc scripts/create-users.pl scripts/CA.* scripts/certs.sh
150 %doc scripts/users2mysql.pl scripts/xpextensions
151 %doc scripts/cryptpasswd scripts/exec-program-wait scripts/radiusd2ldif.pl
152 %doc dialup_admin
153 # SuSE
154 %config /etc/init.d/radiusd
155 %config /etc/pam.d/radiusd
156 %config /etc/logrotate.d/radiusd
157 /usr/sbin/rcradiusd
158 %dir %attr(755,radiusd,radiusd) /var/lib/radiusd
159 # configs
160 %dir /etc/raddb
161 %defattr(-,root,radiusd)
162 %config /etc/raddb/dictionary
163 %config(noreplace) /etc/raddb/acct_users
164 %config(noreplace) /etc/raddb/attrs
165 %attr(640,-,radiusd) %ghost %config(noreplace) /etc/raddb/clients
166 %attr(640,-,radiusd) %config(noreplace) /etc/raddb/clients.conf
167 %config(noreplace) /etc/raddb/hints
168 %config(noreplace) /etc/raddb/huntgroups
169 %config(noreplace) /etc/raddb/ldap.attrmap
170 %attr(640,-,radiusd) %config(noreplace) /etc/raddb/mssql.conf
171 %ghost %config(noreplace) /etc/raddb/naslist
172 %attr(640,-,radiusd) %config(noreplace) /etc/raddb/naspasswd
173 %attr(640,-,radiusd) %ghost %config(noreplace) /etc/raddb/oraclesql.conf
174 %attr(640,-,radiusd) %config(noreplace) /etc/raddb/postgresql.conf
175 %attr(640,-,radiusd) %config(noreplace) /etc/raddb/preproxy_users
176 %attr(640,-,radiusd) %config(noreplace) /etc/raddb/proxy.conf
177 %config(noreplace) /etc/raddb/radiusd.conf
178 %ghost %config(noreplace) /etc/raddb/realms
179 %attr(640,-,radiusd) %config(noreplace) /etc/raddb/snmp.conf
180 %attr(640,-,radiusd) %config(noreplace) /etc/raddb/sql.conf
181 %attr(640,-,radiusd) %config(noreplace) /etc/raddb/users
182 %config(noreplace) /etc/raddb/x99.conf
183 %attr(640,-,radiusd) %config(noreplace) /etc/raddb/x99passwd.sample
184 %attr(640,-,radiusd) %config(noreplace) /etc/raddb/certs
185 %attr(640,-,radiusd) %config(noreplace) /etc/raddb/eap.conf
186 %attr(700,radiusd,radiusd) %dir /var/run/radiusd/
187 # binaries
188 %defattr(-,root,root)
189 /usr/bin/*
190 /usr/sbin/check-radiusd-config
191 /usr/sbin/checkrad
192 /usr/sbin/radiusd
193 # shared libs
194 %attr(755,root,root) %dir /usr/lib/freeradius
195 %attr(755,root,root) /usr/lib/freeradius/*.so*
196 %attr(644,root,root) /usr/lib/freeradius/*.la
197 # man-pages
198 %doc %{_mandir}/man1/*
199 %doc %{_mandir}/man5/*
200 %doc %{_mandir}/man8/*
201 # dictionaries
202 %attr(755,root,root) %dir /usr/share/freeradius
203 /usr/share/freeradius/*
204 # logs
205 %attr(700,radiusd,radiusd) %dir /var/log/radius/
206 %attr(700,radiusd,radiusd) %dir /var/log/radius/radacct/
207 %attr(644,radiusd,radiusd) /var/log/radius/radutmp
208
209 %files devel
210 %defattr(-,root,root)
211 /usr/lib/freeradius/*.a
212