On Suse Linux Enterprise Server 11, I use rpmbuild to install a source rpm:

linux-a21w:/usr/src/packages/SPECS # rpmbuild -v -bi zlib.spec

By default, it installs into /var/tmp/zlib-1.2.7-build directory.In zlib source code directory, execute make installcommand:

linux-a21w:/usr/src/packages/BUILD/zlib-1.2.7 # make install
cp libz.a /usr/local/lib
chmod 644 /usr/local/lib/libz.a
cp libz.so.1.2.7 /usr/local/lib
chmod 755 /usr/local/lib/libz.so.1.2.7
cp zlib.3 /usr/local/share/man/man3
chmod 644 /usr/local/share/man/man3/zlib.3
cp zlib.pc /usr/local/lib/pkgconfig
chmod 644 /usr/local/lib/pkgconfig/zlib.pc
cp zlib.h zconf.h /usr/local/include
chmod 644 /usr/local/include/zlib.h /usr/local/include/zconf.h

Is there any method can pass arguments to rpmbuild command to make the header files and libraries to be installed to specified directories, such ad /usr/local/lib, /usr/local/include, etc?


I think you're getting the point wrong. You want to install in a temp dir to make the RPM. You then install the RPM to get the final destination right.

The temp dir (known as BuildRoot: in your spec file) is just a staging area. you install to here, almost like a chroot area. THen you package your RPM with rpmbuild -bb, to make your RPM, then install as root.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.