0

This is my first attempt at building an RPM and I'm finding it a bit confusing, not really getting the different variables at all yet, so would appreciate any advice on the below..

I have the following spec file:

BuildRoot       : /home/dm40477/rpmbuild/BUILD

%description
Package to deploy PROD Support scripts


%prep

zcat ~/rpmbuild/SOURCES/ITRS.tar.gz | tar -xvf -

%install
RPM_INSTALL_PREFIX=/var/opt

%files
%defattr(0622,muser,muser)
/ITRS/bin/SXS
/ITRS/bin/SXSRT
/ITRS/etc/SXS
/ITRS/etc/SXSRT

%changelog

It creates the rpm file ok, but when I go to install it on target server, it installs in /bin and /etc

The source file is gziped tar file in the below dir structure which I would like to keep except install it in the folder /var/opt

/ITRS/bin/SXS
/ITRS/bin/SXSRT
/ITRS/etc/SXS
/ITRS/etc/SXSRT
  1. How can I set the install path in the spec file?
  2. Do I need to make the dirs to keep the structure, or will it automatically keep that structure?

Any hel appreciated.

Thanks

D

user983597
  • 103
  • 5

2 Answers2

0
RPM_INSTALL_PREFIX=/var/opt

sets a variable, RPM_INSTALL_PREFIX, to /var/opt

/ITRS/bin/SXS
/ITRS/bin/SXSRT
/ITRS/etc/SXS
/ITRS/etc/SXSRT

doesn't reference that variable.

Edwin Buck
  • 69,361
  • 7
  • 100
  • 138
  • It shouldn't refer to RPM_INSTALL_PREFIX though, I think its meant to refer to the files in the build folder - this section is just to show a list of the files which should be contained in the build – user983597 Sep 06 '12 at 14:03
0

BuildRoot : /home/dm40477/rpmbuild/BUILD is ignored now.

try this...

make a file in your homedirectory called .rpmmacros with content like this...

%_topdir /home/builder/rpmbuild

make sure to use fakeroot to do your building.

cd to /home/builder/rpmbuild and run your rpmbuild command.

Chad Prey
  • 147
  • 2
  • 4