I have noticed that, when building rpm files, that most end up in /usr/src/redhat/RPMS/i386 (building 32bit). Some though, incl one we roll in-house, writes the rpm files to ./i386.... so the file winds up in /usr/src/redhat/i386. I have compared the standard spec file (it's openssl that's giving me the trouble) to ours and I cannot see what could be causing the problem.

Unmolested tarball copied to /usr/src/redhat/SOURCES.

Building with cd /usr/src/redhat; rpmbuild -bb ./SPECS/openssl.spec

Here's my spec file (stripped of the boring build and install-related bits):

%define debug_package %{nil}
%define libmaj 1
%define libmin 0
%define librel 1
%define librev l
Release: 1

Summary: Secure Sockets Layer and cryptography libraries and tools
Name: openssl
Version: %{libmaj}.%{libmin}.%{librel}%{librev}
License: Freely distributable
Group: System Environment/Libraries
Source: %{name}-%{version}.tar.gz
URL: http://www.openssl.org/
Packager: Damien Miller <djm@mindrot.org>
BuildRoot: /var/tmp/%{name}-%{version}-root
AutoReqProv: yes
Provides: libcrypto.so.6 libssl.so.6

blah blah




./Configure --prefix=/usr threads shared linux-elf
LD_LIBRARY_PATH=`pwd` make depend
LD_LIBRARY_PATH=`pwd` make



%defattr(-, root, root)




And the stock spec file can be found here.


There's a RPM variable you can define _topdir to move the default output folder of the BUILD, RPMS, SOURCES, SPECS and SRPMS folders.

There are two ways to define this:

  1. Create .rpmmacros in the your folder and add %_topdir /path

  2. When you call rpmbuild add --define:

    • rpmbuild --define "_topdir /path" -bb $specfile
  • Thanks jas, but that doesn't address the question, which is, what is the difference between the two spec files that would cause one to go to the RPMS/i386 folder and the other not. – Jon Jan 23 '15 at 15:35

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.