Mon, 28 Jan 2013 17:37:18 +0100
Correct socket error reporting improvement with IPv6 portable code,
after helpful recommendation by Saúl Ibarra Corretgé on OSips devlist.
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 runtime 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: 20120800
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, pkgconfig
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 %{l_shtool} subst \
91 -e 's; */usr/\(include/postgresql\);%{l_prefix}/\1;g' \
92 -e 's; */usr/local/pgsql/include;;g' \
93 -e 's; */usr/include/pgsql;;g' \
94 src/modules/rlm_sql/drivers/rlm_sql_postgresql/configure
96 %build
97 # configure package
98 extlib=''
99 %if "%{with_pgsql}" == "yes"
100 extlib="`%{l_prefix}/bin/pg_config --libs`"
101 %endif
102 %if "%{with_openldap}" == "yes"
103 extlib="$extlib `%{l_prefix}/bin/pkg-config --libs openldap`" \
104 %endif
105 CC="%{l_cc}" \
106 CFLAGS="-I`pwd`/src/include %{l_cflags -O} %{l_cppflags}" \
107 CPPFLAGS="%{l_cppflags}" \
108 LDFLAGS="%{l_ldflags}" \
109 %if "%{with_openldap}" == "yes"
110 LIBS="$extlib" \
111 %endif
112 ./configure \
113 --prefix=%{l_prefix} \
114 --libdir=%{l_prefix}/lib/freeradius \
115 --mandir=%{l_prefix}/man \
116 --localstatedir=%{l_prefix}/var/freeradius \
117 --datadir=%{l_prefix}/share/freeradius \
118 --sysconfdir=%{l_prefix}/etc \
119 --with-system-libtool \
120 --disable-shared \
121 --enable-static \
122 --with-logdir=%{l_prefix}/var/freeradius \
123 --with-radacctdir=%{l_prefix}/var/freeradius \
124 --with-raddbdir=%{l_prefix}/etc/freeradius \
125 --with-threads \
126 --with-openssl-includes=%{l_prefix}/include/openssl \
127 --with-openssl-libraries=%{l_prefix}/lib/ \
128 --with-rlm_perl \
129 %if "%{with_mysql}" == "yes" || "%{with_pgsql}" == "yes"
130 --with-rlm_sql \
131 --with-rlm_sqlippool \
132 %else
133 --without-rlm_sql \
134 --without-rlm_sqlippool \
135 %endif
136 %if "%{with_mysql}" == "yes"
137 --with-rlm_sql_mysql \
138 %else
139 --without-rlm_sql_mysql \
140 %endif
141 %if "%{with_pgsql}" == "yes"
142 --with-rlm_sql_postgresql \
143 %else
144 --without-rlm_sql_postgresql \
145 %endif
146 --without-rlm_sql_db2 \
147 --without-rlm_sql_firebird \
148 --without-rlm_sql_freetds \
149 --without-rlm_sql_iodbc \
150 --without-rlm_sql_oracle \
151 --without-rlm_sql_sybase \
152 --without-rlm_sql_unixodbc \
153 %if "%{with_openldap}" == "yes"
154 --with-rlm-ldap-include-dir=%{l_prefix}/include/ \
155 --with-rlm-ldap-lib-dir=%{l_prefix}/lib/ \
156 %else
157 --without-rlm-ldap \
158 %endif
159 --without-rlm_eap_ikev2 \
160 --without-rlm_eap_sim \
161 --without-rlm_eap_tls \
162 --without-rlm_eap_peap \
163 --without-rlm_eap_ttls \
164 --without-rlm_eap_tnc \
165 --without-rlm_krb5 \
166 --without-rlm_dbm \
167 --without-rlm_otp \
168 --without-rlm_pam \
169 --without-rlm_python \
170 %if "%{with_snmp}" == "yes"
171 --with-snmp \
172 %else
173 --without-snmp \
174 %endif
175 --enable-strict-dependencies \
176 --with-ltdl-lib=%{l_prefix}/lib \
177 --with-ltdl-include=%{l_prefix}/include \
178 --disable-ltdl-install
180 # build package
181 %{l_make} %{l_mflags}
183 %install
184 # install package
185 %{l_shtool} mkdir -f -p -m 755 \
186 $RPM_BUILD_ROOT%{l_prefix}/lib/freeradius
187 %{l_make} %{l_mflags} install \
188 R=$RPM_BUILD_ROOT
190 # strip down installation
191 strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
192 rm -rf $RPM_BUILD_ROOT%{l_prefix}/etc/freeradius/certs
193 rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/freeradius/*.sample
194 rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/freeradius/doc
195 rm -f $RPM_BUILD_ROOT%{l_prefix}/sbin/rc.radiusd
196 rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/freeradius/*%{version}*
197 rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/freeradius/rlm_*
199 # adjust default configuration
200 %{l_shtool} subst \
201 -e 's;^#user = nobody;user = %{l_rusr};' \
202 -e 's;^#group = nobody;group = %{l_rgrp};' \
203 $RPM_BUILD_ROOT%{l_prefix}/etc/freeradius/radiusd.conf
205 # install run-command script
206 %{l_shtool} mkdir -f -p -m 755 \
207 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
208 %{l_shtool} install -c -m 755 %{l_value -s -a} \
209 %{SOURCE rc.freeradius} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
211 # determine installation files
212 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
213 %{l_files_std} \
214 '%config %{l_prefix}/etc/freeradius/*' \
215 '%attr(755,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/freeradius'
217 %files -f files
219 %clean