[Xorp-hackers] Xorp RPMs

Ben Greear greearb at candelatech.com
Wed Jul 23 13:53:19 PDT 2008


Pavlin Radoslavov wrote:
> Bruce M Simpson <bms at incunabulum.net> wrote:
> 
>> Ben Greear wrote:
>>> Is there any support for generating Xorp RPMs?  If not, I'll
>>> add something with support for creating the xorp user, xorp group,
>>> and install it all in /usr/local/xorp*
>>>   
>> There's some stuff in contrib/packages/ for Debian, but not RPM -- we'd 
>> be very happy to take it there once you have a diff ready to go.
> 
> It appears there are XORP RPM packages for earlier release, though I
> haven't tried them:
> 
> http://dag.wieers.com/rpm/packages/xorp/
> 
> You might want to coordinate with the author/maintainer of those
> packages so at the end we converge on a single solution.

After some more thinking, I decided to just do a simple install
script.  RPMs seem to prefer working from source and seems like
more overhead than justified for what I need.

Here's a script that adds the xorp user, sets up the groups
correctly, and fixes (hacks) a library linkage so that xorp compiled
on fc5 works on at least fc5 and fc8....

Feel free to use this as you wish.


Firt, the script to package it up after the make_install:

#!/bin/bash
# Script for packaging up a stripped xorp tarball.

make install
cp xorp_install.bash /usr/local/xorp/
chmod a+x /usr/local/xorp/xorp_install.bash

cd /usr/local
if [ "$1_" != "nostrip" ]
then
	find xorp -name "*" -print|xargs strip
fi
tar -cvzf /tmp/xorp.tgz xorp
cd -


And the install script, called xorp_install.bash


#!/bin/bash

# Xorp should be un-tarred in /usr/local
if [ `pwd` != "/usr/local/xorp" ]
     then
     echo "ERROR:  You must un-tar xorp.tgz in /usr/local so that the files are placed in /usr/local/xorp"
     exit 1
fi

# Add xorp user and group
echo "Creating xorp user and adding xorp to xorp and root groups..."
adduser xorp
usermod -a -G xorp xorp
usermod -a -G root xorp

# I compile xorp on FC5, and it has a hard dependency on libpcap.0.9.4 and libcrypto.so.6
# Fake out the link here so that it will start OK.  This works on Ubuntu 8.0.4 & FC8, no idea
# if it will work elsewhere. --Ben
if [ ! -f /usr/lib/libpcap.so.0.9.4 ]
     then
     echo "Attempting to soft-link /usr/lib/libpcap.so.9.4 to a similar library...."
     ln -s /usr/lib/libpcap.so.0.9.* /usr/lib/libpcap.so.0.9.4
fi

# This is required on Ubunto 8.0.4, but no needed on Fedora, so
# commenting this out. --Ben
#if [ ! -f /usr/lib/libcrypto.so.6 ]
#    then
#    echo "Attempting to soft-link /usr/lib/libcrypto.so.6 to a similar library...."
#    ln -s /usr/lib/libcrypto.so.0.9.* /usr/lib/libcrypto.so.6
#fi

echo "Completed installation setup for Xorp, testing library linkage...."

if /usr/local/xorp/bin/xorpsh -h > /dev/null 2>&1
     then
     echo "Seems to work fine..."
else
     echo "ERROR:  xorpsh returned error code.  Please contact support."
fi


Thanks,
Ben


> 
> Pavlin


-- 
Ben Greear <greearb at candelatech.com>
Candela Technologies Inc  http://www.candelatech.com



More information about the Xorp-hackers mailing list