freeradius/freeradius.spec

changeset 47
120a0b206db9
child 48
e12fbbfbe80e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/freeradius/freeradius.spec	Thu Jan 08 22:04:38 2009 +0100
     1.3 @@ -0,0 +1,219 @@
     1.4 +##
     1.5 +##  freeradius.spec -- OpenPKG RPM Package Specification
     1.6 +##  Copyright (c) 2000-2008 OpenPKG Foundation e.V. <http://openpkg.net/>
     1.7 +##
     1.8 +##  Permission to use, copy, modify, and distribute this software for
     1.9 +##  any purpose with or without fee is hereby granted, provided that
    1.10 +##  the above copyright notice and this permission notice appear in all
    1.11 +##  copies.
    1.12 +##
    1.13 +##  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    1.14 +##  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
    1.15 +##  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
    1.16 +##  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
    1.17 +##  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    1.18 +##  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    1.19 +##  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    1.20 +##  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    1.21 +##  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    1.22 +##  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    1.23 +##  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    1.24 +##  SUCH DAMAGE.
    1.25 +##
    1.26 +
    1.27 +#   FIXME: rse: default configuration is a little bit fat
    1.28 +#   FIXME: rse: still not run-time tested
    1.29 +
    1.30 +#   package information
    1.31 +Name:         freeradius
    1.32 +Summary:      FreeRADIUS Server
    1.33 +URL:          http://www.freeradius.org/
    1.34 +Vendor:       The FreeRADIUS Server Project
    1.35 +Packager:     OpenPKG Foundation e.V.
    1.36 +Distribution: OpenPKG Community
    1.37 +Class:        EVAL
    1.38 +Group:        RADIUS
    1.39 +License:      GPL
    1.40 +Version:      2.1.3
    1.41 +Release:      20081206
    1.42 +
    1.43 +#   package options
    1.44 +%option       with_mysql     no
    1.45 +%option       with_openldap  no
    1.46 +%option       with_pgsql     no
    1.47 +%option       with_snmp      no
    1.48 +
    1.49 +#   list of sources
    1.50 +Source0:      ftp://ftp.freeradius.org/pub/freeradius/freeradius-server-%{version}.tar.gz
    1.51 +Source1:      rc.freeradius
    1.52 +Patch0:       freeradius.patch
    1.53 +
    1.54 +#   build information
    1.55 +Prefix:       %{l_prefix}
    1.56 +BuildRoot:    %{l_buildroot}
    1.57 +BuildPreReq:  OpenPKG, openpkg >= 20060823, make, gcc, libtool
    1.58 +PreReq:       OpenPKG, openpkg >= 20060823
    1.59 +BuildPreReq:  perl, openssl, gdbm, readline
    1.60 +PreReq:       perl, openssl, gdbm, readline
    1.61 +%if "%{with_mysql}" == "yes"
    1.62 +BuildPreReq:  mysql, zlib
    1.63 +PreReq:       mysql, zlib
    1.64 +%endif
    1.65 +%if "%{with_openldap}" == "yes"
    1.66 +BuildPreReq:  openldap
    1.67 +PreReq:       openldap
    1.68 +%endif
    1.69 +%if "%{with_pgsql}" == "yes"
    1.70 +BuildPreReq:  postgresql
    1.71 +PreReq:       postgresql
    1.72 +%endif
    1.73 +%if "%{with_snmp}" == "yes"
    1.74 +BuildPreReq:  snmp
    1.75 +PreReq:       snmp
    1.76 +%endif
    1.77 +AutoReq:      no
    1.78 +AutoReqProv:  no
    1.79 +
    1.80 +%description
    1.81 +    FreeRADIUS is one of the most modular and featureful RADIUS servers
    1.82 +    available today. It has been written by a team of developers who
    1.83 +    have more than a decade of collective experience in implementing
    1.84 +    and deploying RADIUS software, in software engineering, and in Unix
    1.85 +    package management.
    1.86 +
    1.87 +%track
    1.88 +    prog freeradius = {
    1.89 +        version   = %{version}
    1.90 +        url       = ftp://ftp.freeradius.org/pub/freeradius/
    1.91 +        regex     = freeradius-server-(\d+\.\d+(\.\d+)*)\.tar\.gz
    1.92 +    }
    1.93 +
    1.94 +%prep
    1.95 +    %setup -q -n freeradius-server-%{version}
    1.96 +    %patch -p0
    1.97 +%if "%{with_openldap}" == "yes"
    1.98 +    %{l_shtool} subst \
    1.99 +        -e 's;\(LIBS *=.*  *-lldap\);\1 -llber -lssl -lcrypto;' \
   1.100 +        src/modules/rlm_ldap/configure
   1.101 +%endif
   1.102 +
   1.103 +%build
   1.104 +    #   configure package
   1.105 +    CC="%{l_cc}" \
   1.106 +    CFLAGS="-I`pwd`/src/include %{l_cflags -O} %{l_cppflags}" \
   1.107 +    CPPFLAGS="%{l_cppflags}" \
   1.108 +    LDFLAGS="%{l_ldflags}" \
   1.109 +%if "%{with_openldap}" == "yes"
   1.110 +    LIBS="-llber -lssl -lcrypto -lreadline" \
   1.111 +%endif
   1.112 +    ./configure \
   1.113 +        --prefix=%{l_prefix} \
   1.114 +        --libdir=%{l_prefix}/lib/freeradius \
   1.115 +        --mandir=%{l_prefix}/man \
   1.116 +        --localstatedir=%{l_prefix}/var/freeradius \
   1.117 +        --datadir=%{l_prefix}/share/freeradius \
   1.118 +        --sysconfdir=%{l_prefix}/etc \
   1.119 +        --with-system-libtool \
   1.120 +        --disable-shared \
   1.121 +        --enable-static \
   1.122 +        --with-logdir=%{l_prefix}/var/freeradius \
   1.123 +        --with-radacctdir=%{l_prefix}/var/freeradius \
   1.124 +        --with-raddbdir=%{l_prefix}/etc/freeradius \
   1.125 +        --without-threads \
   1.126 +        --with-openssl-includes=%{l_prefix}/include/openssl \
   1.127 +        --with-openssl-libraries=%{l_prefix}/lib/ \
   1.128 +        --with-rlm_perl \
   1.129 +%if "%{with_mysql}" == "yes" || "%{with_pgsql}" == "yes"
   1.130 +        --with-rlm_sql \
   1.131 +        --with-rlm_sqlippool \
   1.132 +%else
   1.133 +        --without-rlm_sql \
   1.134 +        --without-rlm_sqlippool \
   1.135 +%endif
   1.136 +%if "%{with_mysql}" == "yes"
   1.137 +        --with-rlm_sql_mysql \
   1.138 +%else
   1.139 +        --without-rlm_sql_mysql \
   1.140 +%endif
   1.141 +%if "%{with_pgsql}" == "yes"
   1.142 +        --with-rlm_sql_postgresql \
   1.143 +%else
   1.144 +        --without-rlm_sql_postgresql \
   1.145 +%endif
   1.146 +        --without-rlm_sql_db2 \
   1.147 +        --without-rlm_sql_firebird \
   1.148 +        --without-rlm_sql_freetds \
   1.149 +        --without-rlm_sql_iodbc \
   1.150 +        --without-rlm_sql_oracle \
   1.151 +        --without-rlm_sql_sybase \
   1.152 +        --without-rlm_sql_unixodbc \
   1.153 +%if "%{with_openldap}" == "yes"
   1.154 +        --with-rlm-ldap-include-dir=%{l_prefix}/include/ \
   1.155 +        --with-rlm-ldap-lib-dir=%{l_prefix}/lib/ \
   1.156 +%else
   1.157 +        --without-rlm-ldap \
   1.158 +%endif
   1.159 +        --without-rlm_eap_ikev2 \
   1.160 +        --without-rlm_eap_sim \
   1.161 +        --without-rlm_eap_tls \
   1.162 +        --without-rlm_eap_peap \
   1.163 +        --without-rlm_eap_ttls \
   1.164 +        --without-rlm_eap_tnc \
   1.165 +        --without-rlm_krb5 \
   1.166 +        --without-rlm_dbm \
   1.167 +        --without-rlm_otp \
   1.168 +        --without-rlm_pam \
   1.169 +        --without-rlm_python \
   1.170 +%if "%{with_snmp}" == "yes"
   1.171 +        --with-snmp \
   1.172 +%else
   1.173 +        --without-snmp \
   1.174 +%endif
   1.175 +        --enable-strict-dependencies \
   1.176 +        --with-ltdl-lib=%{l_prefix}/lib \
   1.177 +        --with-ltdl-include=%{l_prefix}/include \
   1.178 +        --disable-ltdl-install
   1.179 +
   1.180 +    #   build package
   1.181 +    %{l_make} %{l_mflags}
   1.182 +
   1.183 +%install
   1.184 +    #   install package
   1.185 +    rm -rf $RPM_BUILD_ROOT
   1.186 +    %{l_shtool} mkdir -f -p -m 755 \
   1.187 +        $RPM_BUILD_ROOT%{l_prefix}/lib/freeradius
   1.188 +    %{l_make} %{l_mflags} install \
   1.189 +        R=$RPM_BUILD_ROOT
   1.190 +
   1.191 +    #   strip down installation
   1.192 +    strip  $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
   1.193 +    rm -rf $RPM_BUILD_ROOT%{l_prefix}/etc/freeradius/certs
   1.194 +    rm -f  $RPM_BUILD_ROOT%{l_prefix}/etc/freeradius/*.sample
   1.195 +    rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/freeradius/doc
   1.196 +    rm -f  $RPM_BUILD_ROOT%{l_prefix}/sbin/rc.radiusd
   1.197 +    rm -f  $RPM_BUILD_ROOT%{l_prefix}/lib/freeradius/*%{version}*
   1.198 +    rm -f  $RPM_BUILD_ROOT%{l_prefix}/lib/freeradius/rlm_*
   1.199 +
   1.200 +    #   adjust default configuration
   1.201 +    %{l_shtool} subst \
   1.202 +        -e 's;^#user = nobody;user = %{l_rusr};' \
   1.203 +        -e 's;^#group = nobody;group = %{l_rgrp};' \
   1.204 +        $RPM_BUILD_ROOT%{l_prefix}/etc/freeradius/radiusd.conf
   1.205 +
   1.206 +    #   install run-command script
   1.207 +    %{l_shtool} mkdir -f -p -m 755 \
   1.208 +        $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
   1.209 +    %{l_shtool} install -c -m 755 %{l_value -s -a} \
   1.210 +        %{SOURCE rc.freeradius} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
   1.211 +
   1.212 +    #   determine installation files
   1.213 +    %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
   1.214 +        %{l_files_std} \
   1.215 +        '%config %{l_prefix}/etc/freeradius/*' \
   1.216 +        '%attr(755,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/freeradius'
   1.217 +
   1.218 +%files -f files
   1.219 +
   1.220 +%clean
   1.221 +    rm -rf $RPM_BUILD_ROOT
   1.222 +

mercurial