Sat, 19 Feb 2011 00:04:57 +0100
Resynchronize with current vendor original spec.
Remove patched SUN_LEN replacement, taken over by author.
1 ##
2 ## freeradius.spec -- OpenPKG RPM Package Specification
3 ## Copyright (c) 2000-2010 OpenPKG Foundation e.V. <http://openpkg.net/>
4 ##
5 ## Permission to use, copy, modify, and distribute this software for
6 ## any purpose with or without fee is hereby granted, provided that
7 ## the above copyright notice and this permission notice appear in all
8 ## copies.
9 ##
10 ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
11 ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
12 ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
13 ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
14 ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
15 ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
16 ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
17 ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
18 ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
19 ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
20 ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
21 ## SUCH DAMAGE.
22 ##
24 # FIXME: rse: default configuration is a little bit fat
25 # FIXME: rse: still not run-time tested
27 # package information
28 Name: freeradius
29 Summary: FreeRADIUS Server
30 URL: http://www.freeradius.org/
31 Vendor: The FreeRADIUS Server Project
32 Packager: OpenPKG Foundation e.V.
33 Distribution: OpenPKG Community
34 Class: EVAL
35 Group: RADIUS
36 License: GPL
37 Version: 2.1.10
38 Release: 20100929
40 # package options
41 %option with_mysql no
42 %option with_openldap no
43 %option with_pgsql no
44 %option with_snmp no
46 # list of sources
47 Source0: ftp://ftp.freeradius.org/pub/freeradius/freeradius-server-%{version}.tar.gz
48 Source1: rc.freeradius
49 Patch0: freeradius.patch
51 # build information
52 BuildPreReq: OpenPKG, openpkg >= 20100101, make, gcc, libtool
53 PreReq: OpenPKG, openpkg >= 20100101
54 BuildPreReq: perl, openssl, gdbm, readline
55 PreReq: perl, openssl, gdbm, readline
56 %if "%{with_mysql}" == "yes"
57 BuildPreReq: mysql, zlib
58 PreReq: mysql, zlib
59 %endif
60 %if "%{with_openldap}" == "yes"
61 BuildPreReq: openldap
62 PreReq: openldap
63 %endif
64 %if "%{with_pgsql}" == "yes"
65 BuildPreReq: postgresql
66 PreReq: postgresql
67 %endif
68 %if "%{with_snmp}" == "yes"
69 BuildPreReq: snmp
70 PreReq: snmp
71 %endif
73 %description
74 FreeRADIUS is one of the most modular and featureful RADIUS servers
75 available today. It has been written by a team of developers who
76 have more than a decade of collective experience in implementing
77 and deploying RADIUS software, in software engineering, and in Unix
78 package management.
80 %track
81 prog freeradius = {
82 version = %{version}
83 url = ftp://ftp.freeradius.org/pub/freeradius/
84 regex = freeradius-server-(\d+\.\d+(\.\d+)*)\.tar\.gz
85 }
87 %prep
88 %setup -q -n freeradius-server-%{version}
89 %patch -p0
90 %if "%{with_openldap}" == "yes"
91 %{l_shtool} subst \
92 -e 's;\(LIBS *=.* *-lldap\);\1 -llber -lssl -lcrypto;' \
93 src/modules/rlm_ldap/configure
94 %endif
96 %build
97 # configure package
98 CC="%{l_cc}" \
99 CFLAGS="-I`pwd`/src/include %{l_cflags -O} %{l_cppflags}" \
100 CPPFLAGS="%{l_cppflags}" \
101 LDFLAGS="%{l_ldflags}" \
102 %if "%{with_openldap}" == "yes"
103 LIBS="-llber -lssl -lcrypto -lreadline" \
104 %endif
105 ./configure \
106 --prefix=%{l_prefix} \
107 --libdir=%{l_prefix}/lib/freeradius \
108 --mandir=%{l_prefix}/man \
109 --localstatedir=%{l_prefix}/var/freeradius \
110 --datadir=%{l_prefix}/share/freeradius \
111 --sysconfdir=%{l_prefix}/etc \
112 --with-system-libtool \
113 --disable-shared \
114 --enable-static \
115 --with-logdir=%{l_prefix}/var/freeradius \
116 --with-radacctdir=%{l_prefix}/var/freeradius \
117 --with-raddbdir=%{l_prefix}/etc/freeradius \
118 --with-threads \
119 --with-openssl-includes=%{l_prefix}/include/openssl \
120 --with-openssl-libraries=%{l_prefix}/lib/ \
121 --with-rlm_perl \
122 %if "%{with_mysql}" == "yes" || "%{with_pgsql}" == "yes"
123 --with-rlm_sql \
124 --with-rlm_sqlippool \
125 %else
126 --without-rlm_sql \
127 --without-rlm_sqlippool \
128 %endif
129 %if "%{with_mysql}" == "yes"
130 --with-rlm_sql_mysql \
131 %else
132 --without-rlm_sql_mysql \
133 %endif
134 %if "%{with_pgsql}" == "yes"
135 --with-rlm_sql_postgresql \
136 %else
137 --without-rlm_sql_postgresql \
138 %endif
139 --without-rlm_sql_db2 \
140 --without-rlm_sql_firebird \
141 --without-rlm_sql_freetds \
142 --without-rlm_sql_iodbc \
143 --without-rlm_sql_oracle \
144 --without-rlm_sql_sybase \
145 --without-rlm_sql_unixodbc \
146 %if "%{with_openldap}" == "yes"
147 --with-rlm-ldap-include-dir=%{l_prefix}/include/ \
148 --with-rlm-ldap-lib-dir=%{l_prefix}/lib/ \
149 %else
150 --without-rlm-ldap \
151 %endif
152 --without-rlm_eap_ikev2 \
153 --without-rlm_eap_sim \
154 --without-rlm_eap_tls \
155 --without-rlm_eap_peap \
156 --without-rlm_eap_ttls \
157 --without-rlm_eap_tnc \
158 --without-rlm_krb5 \
159 --without-rlm_dbm \
160 --without-rlm_otp \
161 --without-rlm_pam \
162 --without-rlm_python \
163 %if "%{with_snmp}" == "yes"
164 --with-snmp \
165 %else
166 --without-snmp \
167 %endif
168 --enable-strict-dependencies \
169 --with-ltdl-lib=%{l_prefix}/lib \
170 --with-ltdl-include=%{l_prefix}/include \
171 --disable-ltdl-install
173 # build package
174 %{l_make} %{l_mflags}
176 %install
177 # install package
178 %{l_shtool} mkdir -f -p -m 755 \
179 $RPM_BUILD_ROOT%{l_prefix}/lib/freeradius
180 %{l_make} %{l_mflags} install \
181 R=$RPM_BUILD_ROOT
183 # strip down installation
184 strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
185 rm -rf $RPM_BUILD_ROOT%{l_prefix}/etc/freeradius/certs
186 rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/freeradius/*.sample
187 rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/freeradius/doc
188 rm -f $RPM_BUILD_ROOT%{l_prefix}/sbin/rc.radiusd
189 rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/freeradius/*%{version}*
190 rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/freeradius/rlm_*
192 # adjust default configuration
193 %{l_shtool} subst \
194 -e 's;^#user = nobody;user = %{l_rusr};' \
195 -e 's;^#group = nobody;group = %{l_rgrp};' \
196 $RPM_BUILD_ROOT%{l_prefix}/etc/freeradius/radiusd.conf
198 # install run-command script
199 %{l_shtool} mkdir -f -p -m 755 \
200 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
201 %{l_shtool} install -c -m 755 %{l_value -s -a} \
202 %{SOURCE rc.freeradius} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
204 # determine installation files
205 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
206 %{l_files_std} \
207 '%config %{l_prefix}/etc/freeradius/*' \
208 '%attr(755,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/freeradius'
210 %files -f files
212 %clean