APC UPS control system User Manual

Page 202

Advertising
background image

rpmbuild -ba --define "build_rh7 1" apcupsd.spec
rpmbuild --rebuild --define build_rh7 1" apcupsd-x.x.x-x.src.rpm

How do I control whether usb support gets built? By default stan-

dard serial port support will be built and the apcupsd-std package will
be produced. To get the usb package and support either set the

%define usb 0

to

%define usb 1

in the spec file directly or pass it to rpmbuild on the command line:

rpmbuild -ba --define "build_rh7 1" --define "build_usb 1" apcupsd.spec

other defines are used?

The only other define is for the initdir

for the daemon control script.

On RedHat systems this is set to

/etc/rc.d/init.d/. You would only need to edit this if packaging for a
platform with uses a different directory.

I’m getting errors about not having permission when I try to build

the packages. Do I need to be root? No, you do not need to be root
and, in fact, it is better practice to build rpm packages as a non-root
user. Apcupds packages are designed to be built by a regular user
but you must make a few changes on your system to do this. If you
are building on your own system then the simplest method is to add
write permissions for all to the build directory (/usr/src/redhat/). To
accomplish this execute the following command as root:

chmod -R 777 /usr/src/redhat

If you are working on a shared system where you can not use the
method above then you need to recreate the /usr/src/redhat directory
tree with all of it’s subdirectories inside your home directory. Then
create a file named

.rpmmacros

201

Advertising