Reputation: 1872
I am trying to create a rpm package for a library I wrote in Qt. Here is my spec file:
Name: blabla
Version: 1.3.2
Release: 0.1
License: GPL
Summary: my awsome lib
Url: http://me.home.mrz.net
Group: Core Applictaion
Source: http://svn.me.home.mrz.net/svn/Core/blabla-1.3.2.tar
Vendor: mrz Inc.
BuildArch: x86_64
Packager: mrz
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
%prep
%setup
%build
qmake
%install
make install
%clean
%{?buildroot:%__rm -rf "%{buildroot}"}
%files:
%defattr(-,root,root)
/home/mrz/local/lib/libBlabla.so
/home/mrz/local/lib/libBlabla.so.%{version}
after running
rpmbuild -ba blabla.spec
The rpmbuild finishes normally (exit 0) indicating it worte the src.rpm, say nothing about .rpm file. I can see the blabla-1.3.2-01.src.rpm in SRPMS folder but the RMPS folder is empty, here is some part of the output I get:
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.WwW6ps
+ unmask 022
+ cd /home/mrz/rpmbuild/BUILD
+ rm -rf blabla-1.3.2
+ /usr/bin/gzip -dc /home/mrz/rpmbuild/SOURCES/blabla-1.3.2.tar
+ /bin/tar -xvvf -
.
.
.
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd blabla-1.3.2
+ /bin/chmod -Rf a+rX,u+w,g-w,o-w .
+ exit 0
Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.sNb2WS
+ umask 022
+ cd /home/mrz/rpmbuild/BUILD
+ /bin/rm -rf /home/mrz/rpmbuild/BUILDROOT/blabla-1.3.2-0.1.x86_64
++ dirname /home/mrz/rpmbuild/BUILDROOT/blabla-1.3.2-0.1.x86_64
+ /bin/mkdir -p /home/mrz/rpmbuild/BUILDROOT
+ /bin/mkdir /home/mrz/rpmbuild/BUILDROOT/blabla-1.3.2-0.1.x86_64
+ cd blabla-1.3.2
+ qmake
Project MESSAGE: ******************************************************************
Project MESSAGE: * Building blabla
Project MESSAGE: * project default message
Project MESSAGE: ******************************************************************
.
.
.
+ exit 0
Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.qVk8KW
+ umask 022
+ cd /home/mrz/rpmbuild/BUILD
+ cd blabla-1.3.2
+ make install
cd src/ && /usr/bin/qmake /home/mrz/rpmbuild/BUILD/blabla-1.3.2/src/src.pro -o
Makefile
Project MESSAGE: ******************************************************************
Project MESSAGE: * Building blabla
Project MESSAGE: * project default message
Project MESSAGE: ******************************************************************
cd src/ && make -f Makefile install
make[1]: Entering directory `/home/mrz/rpmbuild/BUILD/blabla-1.3.2/src'
g++ -c -m64 -pipe -O2 -fPIC -Wall -W
.
.
.
+ /usr/lib/rpm/brp-lib64-linux
[email protected]: if you find problems with this script, drop me a note
+ /usr/lib/rpm/brp-compress
+ /usr/lib/rpm/brp-symlink
Checking for unpackaged file(s): /usr/lib/rpm/check-files /home/mrz/rpmbuild/BUILDROOT/blabla-1.3.2-0.1.x86_64
warning: Could not canonicalize hostname: linux-x1rh
Wrote: /home/mrz/rpmbuild/SRPMS/blabla-1.3.2-0.1.src.rpm
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.M4rJDm
+ umask 022
+ cd /home/mrz/rpmbuild/BUILD
+ cd blabla-1.3.2
+ /bin/rm -rf /home/mrz/rpmbuild/BUILDROOT/blabla-1.3.2-0.1.x86_64
+ exit 0
Anyone knows what I'm doing wrong...
Upvotes: 3
Views: 2449
Reputation: 91017
I think you have misunderstood the directory concept during a rpmbuild.
There are 2 important directories: the build area and the build root.
The build area is where the source is extracted to and compiled. On your side, it is /home/mrz/rpmbuild/BUILD
. Here the tar is unpacked and in the so created sub directory, blabla-1.3.2
, the source sits. (This comes from the convention to put one single directory into a tar file, potentially having other subdirectories under it but none next to it.)
The build root is the place where your files will be arranged in a way how they should be at install time. You define that with
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Obviously, this translates to
/home/mrz/rpmbuild/BUILDROOT/blabla-1.3.2-0.1.x86_64
-- I don't know why. ~/.rpmrc
or ~/.rpmmacros
maybe?
More about the build root:
Normally, you tell your install script somehow to install everything below that build root. If it does so, everythin is as you want to and you define your %files
where to find them.
I found Maximum RPM quite helpful, especially this section. Be aware, however, that it is quite outdated - in earlier times, there was no rpmbuild
and you did everything with rpm
. But the basic concepts are the same. Nowadays, rpm
doesn't understand -ba
any longer and you do all building with rpmbuild
.
Upvotes: 3