This is very easily done using tools built by others. Simply compile the program using the standard drill using this Slackbuild. Install the package and modify the apcupsd config file to match the cable/communication settings to the device. You can also make an entry in /etc/rc.d/rc.local to start the service automatically at boot up, and you're good to go. Well, at least, it worked for me. I hope it works for you!
Here's the output from the command line utility: