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