michael@47: ## michael@47: ## freeradius.spec -- OpenPKG RPM Package Specification michael@47: ## Copyright (c) 2000-2008 OpenPKG Foundation e.V. michael@47: ## michael@47: ## Permission to use, copy, modify, and distribute this software for michael@47: ## any purpose with or without fee is hereby granted, provided that michael@47: ## the above copyright notice and this permission notice appear in all michael@47: ## copies. michael@47: ## michael@47: ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED michael@47: ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF michael@47: ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. michael@47: ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR michael@47: ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, michael@47: ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT michael@47: ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF michael@47: ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND michael@47: ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, michael@47: ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT michael@47: ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF michael@47: ## SUCH DAMAGE. michael@47: ## michael@47: michael@47: # FIXME: rse: default configuration is a little bit fat michael@47: # FIXME: rse: still not run-time tested michael@47: michael@47: # package information michael@47: Name: freeradius michael@47: Summary: FreeRADIUS Server michael@47: URL: http://www.freeradius.org/ michael@47: Vendor: The FreeRADIUS Server Project michael@47: Packager: OpenPKG Foundation e.V. michael@47: Distribution: OpenPKG Community michael@47: Class: EVAL michael@47: Group: RADIUS michael@47: License: GPL michael@47: Version: 2.1.3 michael@48: Release: 20090106 michael@47: michael@47: # package options michael@47: %option with_mysql no michael@47: %option with_openldap no michael@47: %option with_pgsql no michael@47: %option with_snmp no michael@47: michael@47: # list of sources michael@47: Source0: ftp://ftp.freeradius.org/pub/freeradius/freeradius-server-%{version}.tar.gz michael@47: Source1: rc.freeradius michael@47: Patch0: freeradius.patch michael@47: michael@47: # build information michael@47: Prefix: %{l_prefix} michael@47: BuildRoot: %{l_buildroot} michael@47: BuildPreReq: OpenPKG, openpkg >= 20060823, make, gcc, libtool michael@47: PreReq: OpenPKG, openpkg >= 20060823 michael@47: BuildPreReq: perl, openssl, gdbm, readline michael@47: PreReq: perl, openssl, gdbm, readline michael@47: %if "%{with_mysql}" == "yes" michael@47: BuildPreReq: mysql, zlib michael@47: PreReq: mysql, zlib michael@47: %endif michael@47: %if "%{with_openldap}" == "yes" michael@47: BuildPreReq: openldap michael@47: PreReq: openldap michael@47: %endif michael@47: %if "%{with_pgsql}" == "yes" michael@47: BuildPreReq: postgresql michael@47: PreReq: postgresql michael@47: %endif michael@47: %if "%{with_snmp}" == "yes" michael@47: BuildPreReq: snmp michael@47: PreReq: snmp michael@47: %endif michael@47: AutoReq: no michael@47: AutoReqProv: no michael@47: michael@47: %description michael@47: FreeRADIUS is one of the most modular and featureful RADIUS servers michael@47: available today. It has been written by a team of developers who michael@47: have more than a decade of collective experience in implementing michael@47: and deploying RADIUS software, in software engineering, and in Unix michael@47: package management. michael@47: michael@47: %track michael@47: prog freeradius = { michael@47: version = %{version} michael@47: url = ftp://ftp.freeradius.org/pub/freeradius/ michael@47: regex = freeradius-server-(\d+\.\d+(\.\d+)*)\.tar\.gz michael@47: } michael@47: michael@47: %prep michael@47: %setup -q -n freeradius-server-%{version} michael@47: %patch -p0 michael@47: %if "%{with_openldap}" == "yes" michael@47: %{l_shtool} subst \ michael@47: -e 's;\(LIBS *=.* *-lldap\);\1 -llber -lssl -lcrypto;' \ michael@47: src/modules/rlm_ldap/configure michael@47: %endif michael@47: michael@47: %build michael@47: # configure package michael@47: CC="%{l_cc}" \ michael@47: CFLAGS="-I`pwd`/src/include %{l_cflags -O} %{l_cppflags}" \ michael@47: CPPFLAGS="%{l_cppflags}" \ michael@47: LDFLAGS="%{l_ldflags}" \ michael@47: %if "%{with_openldap}" == "yes" michael@47: LIBS="-llber -lssl -lcrypto -lreadline" \ michael@47: %endif michael@47: ./configure \ michael@47: --prefix=%{l_prefix} \ michael@47: --libdir=%{l_prefix}/lib/freeradius \ michael@47: --mandir=%{l_prefix}/man \ michael@47: --localstatedir=%{l_prefix}/var/freeradius \ michael@47: --datadir=%{l_prefix}/share/freeradius \ michael@47: --sysconfdir=%{l_prefix}/etc \ michael@47: --with-system-libtool \ michael@47: --disable-shared \ michael@47: --enable-static \ michael@47: --with-logdir=%{l_prefix}/var/freeradius \ michael@47: --with-radacctdir=%{l_prefix}/var/freeradius \ michael@47: --with-raddbdir=%{l_prefix}/etc/freeradius \ michael@47: --without-threads \ michael@47: --with-openssl-includes=%{l_prefix}/include/openssl \ michael@47: --with-openssl-libraries=%{l_prefix}/lib/ \ michael@47: --with-rlm_perl \ michael@47: %if "%{with_mysql}" == "yes" || "%{with_pgsql}" == "yes" michael@47: --with-rlm_sql \ michael@47: --with-rlm_sqlippool \ michael@47: %else michael@47: --without-rlm_sql \ michael@47: --without-rlm_sqlippool \ michael@47: %endif michael@47: %if "%{with_mysql}" == "yes" michael@47: --with-rlm_sql_mysql \ michael@47: %else michael@47: --without-rlm_sql_mysql \ michael@47: %endif michael@47: %if "%{with_pgsql}" == "yes" michael@47: --with-rlm_sql_postgresql \ michael@47: %else michael@47: --without-rlm_sql_postgresql \ michael@47: %endif michael@47: --without-rlm_sql_db2 \ michael@47: --without-rlm_sql_firebird \ michael@47: --without-rlm_sql_freetds \ michael@47: --without-rlm_sql_iodbc \ michael@47: --without-rlm_sql_oracle \ michael@47: --without-rlm_sql_sybase \ michael@47: --without-rlm_sql_unixodbc \ michael@47: %if "%{with_openldap}" == "yes" michael@47: --with-rlm-ldap-include-dir=%{l_prefix}/include/ \ michael@47: --with-rlm-ldap-lib-dir=%{l_prefix}/lib/ \ michael@47: %else michael@47: --without-rlm-ldap \ michael@47: %endif michael@47: --without-rlm_eap_ikev2 \ michael@47: --without-rlm_eap_sim \ michael@47: --without-rlm_eap_tls \ michael@47: --without-rlm_eap_peap \ michael@47: --without-rlm_eap_ttls \ michael@47: --without-rlm_eap_tnc \ michael@47: --without-rlm_krb5 \ michael@47: --without-rlm_dbm \ michael@47: --without-rlm_otp \ michael@47: --without-rlm_pam \ michael@47: --without-rlm_python \ michael@47: %if "%{with_snmp}" == "yes" michael@47: --with-snmp \ michael@47: %else michael@47: --without-snmp \ michael@47: %endif michael@47: --enable-strict-dependencies \ michael@47: --with-ltdl-lib=%{l_prefix}/lib \ michael@47: --with-ltdl-include=%{l_prefix}/include \ michael@47: --disable-ltdl-install michael@47: michael@47: # build package michael@47: %{l_make} %{l_mflags} michael@47: michael@47: %install michael@47: # install package michael@47: rm -rf $RPM_BUILD_ROOT michael@47: %{l_shtool} mkdir -f -p -m 755 \ michael@47: $RPM_BUILD_ROOT%{l_prefix}/lib/freeradius michael@47: %{l_make} %{l_mflags} install \ michael@47: R=$RPM_BUILD_ROOT michael@47: michael@47: # strip down installation michael@47: strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true michael@47: rm -rf $RPM_BUILD_ROOT%{l_prefix}/etc/freeradius/certs michael@47: rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/freeradius/*.sample michael@47: rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/freeradius/doc michael@47: rm -f $RPM_BUILD_ROOT%{l_prefix}/sbin/rc.radiusd michael@47: rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/freeradius/*%{version}* michael@47: rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/freeradius/rlm_* michael@47: michael@47: # adjust default configuration michael@47: %{l_shtool} subst \ michael@47: -e 's;^#user = nobody;user = %{l_rusr};' \ michael@47: -e 's;^#group = nobody;group = %{l_rgrp};' \ michael@47: $RPM_BUILD_ROOT%{l_prefix}/etc/freeradius/radiusd.conf michael@47: michael@47: # install run-command script michael@47: %{l_shtool} mkdir -f -p -m 755 \ michael@47: $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d michael@47: %{l_shtool} install -c -m 755 %{l_value -s -a} \ michael@47: %{SOURCE rc.freeradius} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/ michael@47: michael@47: # determine installation files michael@47: %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \ michael@47: %{l_files_std} \ michael@47: '%config %{l_prefix}/etc/freeradius/*' \ michael@47: '%attr(755,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/freeradius' michael@47: michael@47: %files -f files michael@47: michael@47: %clean michael@47: rm -rf $RPM_BUILD_ROOT michael@47: