Import package vendor original specs for necessary manipulations.

Thu, 08 Jan 2009 22:04:38 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 08 Jan 2009 22:04:38 +0100
changeset 47
120a0b206db9
parent 46
7a95c2a6c709
child 48
e12fbbfbe80e

Import package vendor original specs for necessary manipulations.

freeradius/freeradius.patch file | annotate | diff | comparison | revisions
freeradius/freeradius.spec file | annotate | diff | comparison | revisions
freeradius/rc.freeradius file | annotate | diff | comparison | revisions
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/freeradius/freeradius.patch	Thu Jan 08 22:04:38 2009 +0100
     1.3 @@ -0,0 +1,46 @@
     1.4 +Index: Make.inc.in
     1.5 +--- Make.inc.in.orig	2008-09-25 10:41:26 +0200
     1.6 ++++ Make.inc.in	2008-09-25 17:56:09 +0200
     1.7 +@@ -15,7 +15,7 @@
     1.8 + docdir		= @docdir@
     1.9 + mandir		= @mandir@
    1.10 + datadir		= @datadir@
    1.11 +-dictdir		= $(datadir)/freeradius
    1.12 ++dictdir		= $(datadir)
    1.13 + logdir		= @logdir@
    1.14 + includedir	= @includedir@
    1.15 + raddbdir	= @raddbdir@
    1.16 +@@ -48,7 +48,7 @@
    1.17 + 
    1.18 + LOGDIR		= ${logdir}
    1.19 + RADDBDIR	= ${raddbdir}
    1.20 +-RUNDIR		= ${localstatedir}/run/radiusd
    1.21 ++RUNDIR		= ${localstatedir}
    1.22 + SBINDIR		= ${sbindir}
    1.23 + RADIR		= ${radacctdir}
    1.24 + LIBRADIUS	= $(top_builddir)/src/lib/$(LIBPREFIX)freeradius-radius.la
    1.25 +Index: raddb/radiusd.conf.in
    1.26 +--- raddb/radiusd.conf.in.orig	2008-09-25 10:41:26 +0200
    1.27 ++++ raddb/radiusd.conf.in	2008-09-25 17:56:09 +0200
    1.28 +@@ -66,7 +66,7 @@
    1.29 + 
    1.30 + #  Location of config and logfiles.
    1.31 + confdir = ${raddbdir}
    1.32 +-run_dir = ${localstatedir}/run/radiusd
    1.33 ++run_dir = ${localstatedir}
    1.34 + 
    1.35 + # Should likely be ${localstatedir}/lib/radiusd
    1.36 + db_dir = ${raddbdir}
    1.37 +Index: src/modules/rlm_sql/drivers/Makefile.in
    1.38 +--- src/modules/rlm_sql/drivers/Makefile.in.orig	2008-09-25 10:41:26 +0200
    1.39 ++++ src/modules/rlm_sql/drivers/Makefile.in	2008-09-25 17:56:09 +0200
    1.40 +@@ -16,7 +16,7 @@
    1.41 + 
    1.42 + common:
    1.43 + 	@[ -d lib/ ] || mkdir lib
    1.44 +-	@for mod in $(SQL_MODULES); do \
    1.45 ++	@for mod in $(SQL_MODULES) NOOP; do \
    1.46 + 		echo "Making $(WHAT_TO_MAKE) in $$mod..."; \
    1.47 +-		$(MAKE) $(MFLAGS) -C $$mod $(WHAT_TO_MAKE) || exit $$?; \
    1.48 ++		[ -d $$mod ] || exit 0; $(MAKE) $(MFLAGS) -C $$mod $(WHAT_TO_MAKE) || exit $$?; \
    1.49 + 	done
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/freeradius/freeradius.spec	Thu Jan 08 22:04:38 2009 +0100
     2.3 @@ -0,0 +1,219 @@
     2.4 +##
     2.5 +##  freeradius.spec -- OpenPKG RPM Package Specification
     2.6 +##  Copyright (c) 2000-2008 OpenPKG Foundation e.V. <http://openpkg.net/>
     2.7 +##
     2.8 +##  Permission to use, copy, modify, and distribute this software for
     2.9 +##  any purpose with or without fee is hereby granted, provided that
    2.10 +##  the above copyright notice and this permission notice appear in all
    2.11 +##  copies.
    2.12 +##
    2.13 +##  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    2.14 +##  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
    2.15 +##  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
    2.16 +##  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
    2.17 +##  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    2.18 +##  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    2.19 +##  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    2.20 +##  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    2.21 +##  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    2.22 +##  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    2.23 +##  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    2.24 +##  SUCH DAMAGE.
    2.25 +##
    2.26 +
    2.27 +#   FIXME: rse: default configuration is a little bit fat
    2.28 +#   FIXME: rse: still not run-time tested
    2.29 +
    2.30 +#   package information
    2.31 +Name:         freeradius
    2.32 +Summary:      FreeRADIUS Server
    2.33 +URL:          http://www.freeradius.org/
    2.34 +Vendor:       The FreeRADIUS Server Project
    2.35 +Packager:     OpenPKG Foundation e.V.
    2.36 +Distribution: OpenPKG Community
    2.37 +Class:        EVAL
    2.38 +Group:        RADIUS
    2.39 +License:      GPL
    2.40 +Version:      2.1.3
    2.41 +Release:      20081206
    2.42 +
    2.43 +#   package options
    2.44 +%option       with_mysql     no
    2.45 +%option       with_openldap  no
    2.46 +%option       with_pgsql     no
    2.47 +%option       with_snmp      no
    2.48 +
    2.49 +#   list of sources
    2.50 +Source0:      ftp://ftp.freeradius.org/pub/freeradius/freeradius-server-%{version}.tar.gz
    2.51 +Source1:      rc.freeradius
    2.52 +Patch0:       freeradius.patch
    2.53 +
    2.54 +#   build information
    2.55 +Prefix:       %{l_prefix}
    2.56 +BuildRoot:    %{l_buildroot}
    2.57 +BuildPreReq:  OpenPKG, openpkg >= 20060823, make, gcc, libtool
    2.58 +PreReq:       OpenPKG, openpkg >= 20060823
    2.59 +BuildPreReq:  perl, openssl, gdbm, readline
    2.60 +PreReq:       perl, openssl, gdbm, readline
    2.61 +%if "%{with_mysql}" == "yes"
    2.62 +BuildPreReq:  mysql, zlib
    2.63 +PreReq:       mysql, zlib
    2.64 +%endif
    2.65 +%if "%{with_openldap}" == "yes"
    2.66 +BuildPreReq:  openldap
    2.67 +PreReq:       openldap
    2.68 +%endif
    2.69 +%if "%{with_pgsql}" == "yes"
    2.70 +BuildPreReq:  postgresql
    2.71 +PreReq:       postgresql
    2.72 +%endif
    2.73 +%if "%{with_snmp}" == "yes"
    2.74 +BuildPreReq:  snmp
    2.75 +PreReq:       snmp
    2.76 +%endif
    2.77 +AutoReq:      no
    2.78 +AutoReqProv:  no
    2.79 +
    2.80 +%description
    2.81 +    FreeRADIUS is one of the most modular and featureful RADIUS servers
    2.82 +    available today. It has been written by a team of developers who
    2.83 +    have more than a decade of collective experience in implementing
    2.84 +    and deploying RADIUS software, in software engineering, and in Unix
    2.85 +    package management.
    2.86 +
    2.87 +%track
    2.88 +    prog freeradius = {
    2.89 +        version   = %{version}
    2.90 +        url       = ftp://ftp.freeradius.org/pub/freeradius/
    2.91 +        regex     = freeradius-server-(\d+\.\d+(\.\d+)*)\.tar\.gz
    2.92 +    }
    2.93 +
    2.94 +%prep
    2.95 +    %setup -q -n freeradius-server-%{version}
    2.96 +    %patch -p0
    2.97 +%if "%{with_openldap}" == "yes"
    2.98 +    %{l_shtool} subst \
    2.99 +        -e 's;\(LIBS *=.*  *-lldap\);\1 -llber -lssl -lcrypto;' \
   2.100 +        src/modules/rlm_ldap/configure
   2.101 +%endif
   2.102 +
   2.103 +%build
   2.104 +    #   configure package
   2.105 +    CC="%{l_cc}" \
   2.106 +    CFLAGS="-I`pwd`/src/include %{l_cflags -O} %{l_cppflags}" \
   2.107 +    CPPFLAGS="%{l_cppflags}" \
   2.108 +    LDFLAGS="%{l_ldflags}" \
   2.109 +%if "%{with_openldap}" == "yes"
   2.110 +    LIBS="-llber -lssl -lcrypto -lreadline" \
   2.111 +%endif
   2.112 +    ./configure \
   2.113 +        --prefix=%{l_prefix} \
   2.114 +        --libdir=%{l_prefix}/lib/freeradius \
   2.115 +        --mandir=%{l_prefix}/man \
   2.116 +        --localstatedir=%{l_prefix}/var/freeradius \
   2.117 +        --datadir=%{l_prefix}/share/freeradius \
   2.118 +        --sysconfdir=%{l_prefix}/etc \
   2.119 +        --with-system-libtool \
   2.120 +        --disable-shared \
   2.121 +        --enable-static \
   2.122 +        --with-logdir=%{l_prefix}/var/freeradius \
   2.123 +        --with-radacctdir=%{l_prefix}/var/freeradius \
   2.124 +        --with-raddbdir=%{l_prefix}/etc/freeradius \
   2.125 +        --without-threads \
   2.126 +        --with-openssl-includes=%{l_prefix}/include/openssl \
   2.127 +        --with-openssl-libraries=%{l_prefix}/lib/ \
   2.128 +        --with-rlm_perl \
   2.129 +%if "%{with_mysql}" == "yes" || "%{with_pgsql}" == "yes"
   2.130 +        --with-rlm_sql \
   2.131 +        --with-rlm_sqlippool \
   2.132 +%else
   2.133 +        --without-rlm_sql \
   2.134 +        --without-rlm_sqlippool \
   2.135 +%endif
   2.136 +%if "%{with_mysql}" == "yes"
   2.137 +        --with-rlm_sql_mysql \
   2.138 +%else
   2.139 +        --without-rlm_sql_mysql \
   2.140 +%endif
   2.141 +%if "%{with_pgsql}" == "yes"
   2.142 +        --with-rlm_sql_postgresql \
   2.143 +%else
   2.144 +        --without-rlm_sql_postgresql \
   2.145 +%endif
   2.146 +        --without-rlm_sql_db2 \
   2.147 +        --without-rlm_sql_firebird \
   2.148 +        --without-rlm_sql_freetds \
   2.149 +        --without-rlm_sql_iodbc \
   2.150 +        --without-rlm_sql_oracle \
   2.151 +        --without-rlm_sql_sybase \
   2.152 +        --without-rlm_sql_unixodbc \
   2.153 +%if "%{with_openldap}" == "yes"
   2.154 +        --with-rlm-ldap-include-dir=%{l_prefix}/include/ \
   2.155 +        --with-rlm-ldap-lib-dir=%{l_prefix}/lib/ \
   2.156 +%else
   2.157 +        --without-rlm-ldap \
   2.158 +%endif
   2.159 +        --without-rlm_eap_ikev2 \
   2.160 +        --without-rlm_eap_sim \
   2.161 +        --without-rlm_eap_tls \
   2.162 +        --without-rlm_eap_peap \
   2.163 +        --without-rlm_eap_ttls \
   2.164 +        --without-rlm_eap_tnc \
   2.165 +        --without-rlm_krb5 \
   2.166 +        --without-rlm_dbm \
   2.167 +        --without-rlm_otp \
   2.168 +        --without-rlm_pam \
   2.169 +        --without-rlm_python \
   2.170 +%if "%{with_snmp}" == "yes"
   2.171 +        --with-snmp \
   2.172 +%else
   2.173 +        --without-snmp \
   2.174 +%endif
   2.175 +        --enable-strict-dependencies \
   2.176 +        --with-ltdl-lib=%{l_prefix}/lib \
   2.177 +        --with-ltdl-include=%{l_prefix}/include \
   2.178 +        --disable-ltdl-install
   2.179 +
   2.180 +    #   build package
   2.181 +    %{l_make} %{l_mflags}
   2.182 +
   2.183 +%install
   2.184 +    #   install package
   2.185 +    rm -rf $RPM_BUILD_ROOT
   2.186 +    %{l_shtool} mkdir -f -p -m 755 \
   2.187 +        $RPM_BUILD_ROOT%{l_prefix}/lib/freeradius
   2.188 +    %{l_make} %{l_mflags} install \
   2.189 +        R=$RPM_BUILD_ROOT
   2.190 +
   2.191 +    #   strip down installation
   2.192 +    strip  $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
   2.193 +    rm -rf $RPM_BUILD_ROOT%{l_prefix}/etc/freeradius/certs
   2.194 +    rm -f  $RPM_BUILD_ROOT%{l_prefix}/etc/freeradius/*.sample
   2.195 +    rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/freeradius/doc
   2.196 +    rm -f  $RPM_BUILD_ROOT%{l_prefix}/sbin/rc.radiusd
   2.197 +    rm -f  $RPM_BUILD_ROOT%{l_prefix}/lib/freeradius/*%{version}*
   2.198 +    rm -f  $RPM_BUILD_ROOT%{l_prefix}/lib/freeradius/rlm_*
   2.199 +
   2.200 +    #   adjust default configuration
   2.201 +    %{l_shtool} subst \
   2.202 +        -e 's;^#user = nobody;user = %{l_rusr};' \
   2.203 +        -e 's;^#group = nobody;group = %{l_rgrp};' \
   2.204 +        $RPM_BUILD_ROOT%{l_prefix}/etc/freeradius/radiusd.conf
   2.205 +
   2.206 +    #   install run-command script
   2.207 +    %{l_shtool} mkdir -f -p -m 755 \
   2.208 +        $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
   2.209 +    %{l_shtool} install -c -m 755 %{l_value -s -a} \
   2.210 +        %{SOURCE rc.freeradius} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
   2.211 +
   2.212 +    #   determine installation files
   2.213 +    %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
   2.214 +        %{l_files_std} \
   2.215 +        '%config %{l_prefix}/etc/freeradius/*' \
   2.216 +        '%attr(755,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/freeradius'
   2.217 +
   2.218 +%files -f files
   2.219 +
   2.220 +%clean
   2.221 +    rm -rf $RPM_BUILD_ROOT
   2.222 +
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/freeradius/rc.freeradius	Thu Jan 08 22:04:38 2009 +0100
     3.3 @@ -0,0 +1,56 @@
     3.4 +#!@l_prefix@/bin/openpkg rc
     3.5 +##
     3.6 +##  rc.freeradius -- Run-Commands
     3.7 +##
     3.8 +
     3.9 +%config
    3.10 +    freeradius_enable="$openpkg_rc_def"
    3.11 +    freeradius_flags=""
    3.12 +    freeradius_log_prolog="true"
    3.13 +    freeradius_log_epilog="true"
    3.14 +    freeradius_log_numfiles="10"
    3.15 +    freeradius_log_minsize="1M"
    3.16 +    freeradius_log_complevel="9"
    3.17 +
    3.18 +%common
    3.19 +    freeradius_logfile="@l_prefix@/var/freeradius/radius.log"
    3.20 +    freeradius_pidfile="@l_prefix@/var/freeradius/radiusd.pid"
    3.21 +    freeradius_signal () {
    3.22 +        [ -f $freeradius_pidfile ] && kill -$1 `cat $freeradius_pidfile`
    3.23 +    }
    3.24 +
    3.25 +%status -u @l_susr@ -o
    3.26 +    freeradius_usable="no"
    3.27 +    freeradius_active="no"
    3.28 +    rcService freeradius enable yes && \
    3.29 +        freeradius_signal 0 && freeradius_active="yes"
    3.30 +    echo "freeradius_enable=\"$freeradius_enable\""
    3.31 +    echo "freeradius_usable=\"$freeradius_usable\""
    3.32 +    echo "freeradius_active=\"$freeradius_active\""
    3.33 +
    3.34 +%start -u @l_susr@
    3.35 +    rcService freeradius enable yes || exit 0
    3.36 +    rcService freeradius active yes && exit 0
    3.37 +    @l_prefix@/sbin/radiusd ${freeradius_flags}
    3.38 +
    3.39 +%stop -u @l_susr@
    3.40 +    rcService freeradius enable yes || exit 0
    3.41 +    rcService freeradius active no  && exit 0
    3.42 +    freeradius_signal TERM
    3.43 +    sleep 2
    3.44 +    rm -f ${freeradius_pidfile} >/dev/null 2>&1 || true
    3.45 +
    3.46 +%restart -u @l_susr@
    3.47 +    rcService freeradius enable yes || exit 0
    3.48 +    rcService freeradius active no  && exit 0
    3.49 +    rc freeradius stop start
    3.50 +
    3.51 +%daily -u @l_susr@
    3.52 +    rcService freeradius enable yes || exit 0
    3.53 +    shtool rotate -f \
    3.54 +        -n ${freeradius_log_numfiles} -s ${freeradius_log_minsize} -d \
    3.55 +        -z ${freeradius_log_complevel} -m 644 -o @l_rusr@ -g @l_rgrp@ \
    3.56 +        -P "${freeradius_log_prolog}" \
    3.57 +        -E "${freeradius_log_epilog} && rc freeradius reload" \
    3.58 +        ${freeradius_logfile}
    3.59 +

mercurial