Public domain
Homepage: http://www.encap.org/epkg/
Original download link
cd /usr/src/
wget -c "http://pmoghadam.com/homepage/Pages/Deposit/Source-packages/epkg-2.3.9.tar.gz"
tar zxf epkg-2.3.9.tar.gz
cd epkg-2.3.9
./configure --with-encap-target=/
make && make install
groupadd install
useradd -g install -m -s /bin/bash install
passwd -l install
chown install:install /usr/src /usr/local/encap
chown -R install:install /usr/local/encap
cd /usr/src
wget -c "ftp://ftp.freeradius.org/pub/freeradius/freeradius-server-2.1.9.tar.gz"
tar zxf freeradius-server-2.1.9.tar.gz
cd freeradius-server-2.1.9
./configure && make
R=/usr/local/encap/freeradius-server-2.1.9 make install
mkdir -p /usr/local/encap/freeradius-server-2.1.9/etc/rc.d/
cat > /usr/local/encap/freeradius-server-2.1.9/etc/rc.d/rc.radiusd << EOF
#!/bin/sh
#
# /etc/rc.d/rc.radiusd
#
case "\$1" in
'start')
echo 'Starting radiusd ...'
PID=\$(pgrep '^radiusd\$')
if [ "\$PID" == "" ] ; then
/usr/local/sbin/radiusd
else
echo "radiusd is already running (PID: \$PID) !!!"
fi
;;
'stop')
echo 'Stopping radiusd ...'
killall radiusd
;;
'restart')
echo 'Restarting radiusd ...'
killall radiusd
sleep 2
/usr/local/sbin/radiusd
;;
*)
echo "Usage: \$0 [start|stop|restart]"
;;
esac
EOF
cat > /usr/local/encap/freeradius-server-2.1.9/postinstall << EOF
#!/bin/bash
LINE="if [ -x /etc/rc.d/rc.radiusd ]; then /etc/rc.d/rc.radiusd start; fi"
FILE="/etc/rc.d/rc.local"
if ! grep -q "/etc/rc.d/rc.radiusd" "\$FILE"; then
echo "\$LINE" >> "\$FILE"
fi
ldconfig
EOF
cat > /usr/local/encap/freeradius-server-2.1.9/preremove << EOF
#!/bin/bash
/etc/rc.d/rc.radiusd stop
sed -i -e 's,.*/etc/rc.d/rc.radiusd.*,,' -e '/^$/d' /etc/rc.d/rc.local
ldconfig
EOF
chmod +x /usr/local/encap/freeradius-server-2.1.9/postinstall
chmod +x /usr/local/encap/freeradius-server-2.1.9/preremove
chmod +x /usr/local/encap/freeradius-server-2.1.9/etc/rc.d/rc.radiusd
cd /usr/local/encap
mkencap freeradius-server-2.1.9
epkg freeradius-server-2.1.9-encap-ix86-linux2.6.tar.gz
epkg -r freeradius-server-2.1.9
BY: Pejman Moghadam
TAG: epkg, freeradius, radius, encap
DATE: 2011-05-10 11:59:47