freeradius/freeradius.spec

changeset 770
4238158b03c9
parent 307
937b4de09dc1
equal deleted inserted replaced
3:920fe1e66ee1 4:140e1f11f8a3
19 ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 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 20 ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
21 ## SUCH DAMAGE. 21 ## SUCH DAMAGE.
22 ## 22 ##
23 23
24 # FIXME: rse: default configuration is a little bit fat
25 # FIXME: rse: still not runtime tested
26
24 # package information 27 # package information
25 Name: freeradius 28 Name: freeradius
26 Summary: FreeRADIUS Server 29 Summary: FreeRADIUS Server
27 URL: http://www.freeradius.org/ 30 URL: http://www.freeradius.org/
28 Vendor: The FreeRADIUS Server Project 31 Vendor: The FreeRADIUS Server Project
30 Distribution: OpenPKG Community 33 Distribution: OpenPKG Community
31 Class: EVAL 34 Class: EVAL
32 Group: RADIUS 35 Group: RADIUS
33 License: GPL 36 License: GPL
34 Version: 2.1.10 37 Version: 2.1.10
35 Release: 20100930 38 Release: 20120800
36 39
37 # package options 40 # package options
38 %option with_mysql no 41 %option with_mysql no
39 %option with_openldap no 42 %option with_openldap no
40 %option with_pgsql no 43 %option with_pgsql no
44 Source0: ftp://ftp.freeradius.org/pub/freeradius/freeradius-server-%{version}.tar.gz 47 Source0: ftp://ftp.freeradius.org/pub/freeradius/freeradius-server-%{version}.tar.gz
45 Source1: rc.freeradius 48 Source1: rc.freeradius
46 Patch0: freeradius.patch 49 Patch0: freeradius.patch
47 50
48 # build information 51 # build information
49 Prefix: %{l_prefix} 52 BuildPreReq: OpenPKG, openpkg >= 20100101, make, gcc, libtool
50 BuildRoot: %{l_buildroot} 53 PreReq: OpenPKG, openpkg >= 20100101
51 BuildPreReq: OpenPKG, openpkg >= 20060823, make, gcc, libtool
52 PreReq: OpenPKG, openpkg >= 20060823
53 BuildPreReq: perl, openssl, gdbm, readline 54 BuildPreReq: perl, openssl, gdbm, readline
54 PreReq: perl, openssl, gdbm, readline 55 PreReq: perl, openssl, gdbm, readline
55 %if "%{with_mysql}" == "yes" 56 %if "%{with_mysql}" == "yes"
56 BuildPreReq: mysql, zlib 57 BuildPreReq: mysql, zlib
57 PreReq: mysql, zlib 58 PreReq: mysql, zlib
58 %endif 59 %endif
59 %if "%{with_openldap}" == "yes" 60 %if "%{with_openldap}" == "yes"
60 BuildPreReq: openldap 61 BuildPreReq: openldap, pkgconfig
61 PreReq: openldap 62 PreReq: openldap
62 %endif 63 %endif
63 %if "%{with_pgsql}" == "yes" 64 %if "%{with_pgsql}" == "yes"
64 BuildPreReq: postgresql 65 BuildPreReq: postgresql
65 PreReq: postgresql 66 PreReq: postgresql
66 %endif 67 %endif
67 %if "%{with_snmp}" == "yes" 68 %if "%{with_snmp}" == "yes"
68 BuildPreReq: snmp 69 BuildPreReq: snmp
69 PreReq: snmp 70 PreReq: snmp
70 %endif 71 %endif
71 AutoReq: no
72 AutoReqProv: no
73 72
74 %description 73 %description
75 FreeRADIUS is one of the most modular and featureful RADIUS servers 74 FreeRADIUS is one of the most modular and featureful RADIUS servers
76 available today. It has been written by a team of developers who 75 available today. It has been written by a team of developers who
77 have more than a decade of collective experience in implementing 76 have more than a decade of collective experience in implementing
91 %{l_shtool} subst \ 90 %{l_shtool} subst \
92 -e 's; */usr/\(include/postgresql\);%{l_prefix}/\1;g' \ 91 -e 's; */usr/\(include/postgresql\);%{l_prefix}/\1;g' \
93 -e 's; */usr/local/pgsql/include;;g' \ 92 -e 's; */usr/local/pgsql/include;;g' \
94 -e 's; */usr/include/pgsql;;g' \ 93 -e 's; */usr/include/pgsql;;g' \
95 src/modules/rlm_sql/drivers/rlm_sql_postgresql/configure 94 src/modules/rlm_sql/drivers/rlm_sql_postgresql/configure
96 extlib=''
97 case "%{l_platform -t}" in
98 *-sunos* )
99 extlib='-lsocket -lnsl'
100 ;;
101 esac
102 %if "%{with_openldap}" == "yes"
103 %{l_shtool} subst \
104 -e "s;\(LIBS *=.* *-lldap[_r]*\);\1 -llber -lssl -lcrypto $extlib;g" \
105 -e "s;\(smart_lib *=.* *-lldap[_r]*\);\1 -llber -lssl -lcrypto $extlib;g" \
106 src/modules/rlm_ldap/configure
107 %endif
108 %if "%{with_pgsql}" == "yes"
109 %{l_shtool} subst \
110 -e "s;-lpq;-lpq `%{l_prefix}/bin/pg_config --libs` $extlib;g" \
111 src/modules/rlm_sql/drivers/rlm_sql_postgresql/configure
112 %endif
113 95
114 %build 96 %build
115 # configure package 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
116 CC="%{l_cc}" \ 105 CC="%{l_cc}" \
117 CFLAGS="-I`pwd`/src/include %{l_cflags -O} %{l_cppflags}" \ 106 CFLAGS="-I`pwd`/src/include %{l_cflags -O} %{l_cppflags}" \
118 CPPFLAGS="%{l_cppflags}" \ 107 CPPFLAGS="%{l_cppflags}" \
119 LDFLAGS="%{l_ldflags}" \ 108 LDFLAGS="%{l_ldflags}" \
120 %if "%{with_openldap}" == "yes" 109 %if "%{with_openldap}" == "yes"
121 LIBS="-llber -lssl -lcrypto -lreadline" \ 110 LIBS="$extlib" \
122 %endif 111 %endif
123 ./configure \ 112 ./configure \
124 --prefix=%{l_prefix} \ 113 --prefix=%{l_prefix} \
125 --libdir=%{l_prefix}/lib/freeradius \ 114 --libdir=%{l_prefix}/lib/freeradius \
126 --mandir=%{l_prefix}/man \ 115 --mandir=%{l_prefix}/man \
191 # build package 180 # build package
192 %{l_make} %{l_mflags} 181 %{l_make} %{l_mflags}
193 182
194 %install 183 %install
195 # install package 184 # install package
196 rm -rf $RPM_BUILD_ROOT
197 %{l_shtool} mkdir -f -p -m 755 \ 185 %{l_shtool} mkdir -f -p -m 755 \
198 $RPM_BUILD_ROOT%{l_prefix}/lib/freeradius 186 $RPM_BUILD_ROOT%{l_prefix}/lib/freeradius
199 %{l_make} %{l_mflags} install \ 187 %{l_make} %{l_mflags} install \
200 R=$RPM_BUILD_ROOT 188 R=$RPM_BUILD_ROOT
201 189
227 '%attr(755,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/freeradius' 215 '%attr(755,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/freeradius'
228 216
229 %files -f files 217 %files -f files
230 218
231 %clean 219 %clean
232 rm -rf $RPM_BUILD_ROOT 220
233

mercurial