rpmbuild errors

Hi everybody

This is my first try at building an rpm package for the release of an application, and there seems to be tricks and traps at every step.

The SPEC file is as follows:


# This is a spec file for the installation of QFLR5
%define _topdir /home/windsoarer/Qt/rpm
%define name QFLR5
%define release 4
%define version 4.04

%define buildroot %{_topdir}/%{name}-%{version}-root
BuildRoot: %{buildroot}
Summary: QFLR5
License: GPL
Name: %{name}
Version: %{version}
Release: %{release}
Source: %{name}-%{version}.tar.gz
Prefix: /usr
Group: Applications/Engineering

%description
QFLR5 is an analysis tool for planes operating at low Reynolds numbers

%prep
%setup -q
%build
/usr/bin/make

%install
make install prefix=$RPM_BUILD_ROOT/usr/

%files
%defattr(-,root,root)
/usr/local/bin/QFLR5

Trying to build in KDE’s Konsole in super-user mode with the command

rpmbuild -v -ba --clean SPECS/QFLR5-4.04.spec

There is the following error if there is a blank line between “%setup -q” and “%build”

+ $'\r'
: command not foundifdh: line 31:

If I remove the blank line, then the next error is

+ $'/usr/bin/make\r'
: No such file or directoryne 27: /usr/bin/make

and yes, make is properly installed on the machine.

Any ideas ???

Thanks,

Andre

Never saw such an error. But it seems you wrote the spec file from a Windows machine and rpmbuild complains about the extra carriage return character in new lines.

Convert it to Unix end of line: Newline - Wikipedia, the free encyclopedia

That was it ! The conversion command


tr -d '\r' < oldfile.spec > newfile.spec

did the trick

Many thanks

Stuck again… To try figure things one at a time, I made a short program called DynaLay, based on the Qt4 libraries.


# This is a test spec file for the installation of DynaLay
%define name DynaLay
%define release 1
%define version 1.00

BuildRoot: %{_tmppath}/%{name}-%{version}-build
Summary: DynaLay
License: GPL
Name: %{name}
Version: %{version}
Release: %{release}
Source: %{name}-%{version}.tar.gz
Prefix: /usr
Group: Applications/Engineering

%description
DynaLay is nothing but a short program for testing installation

%prep

%setup -q
/usr/bin/qmake DynaLay.pro -o Makefile

%build
make

%install
make install    

%clean
rm -rf "$RPM_BUILD_ROOT"

%files
%defattr(-,root,root)
/usr/local/bin/DynaLay

And the error is apparently in the install phase:


Executing(%install): /bin/sh -e /home/windsoarer/Qt/rpmbuild/tmp/rpm-tmp.d6AYeS
+ umask 022
+ cd /home/windsoarer/Qt/rpmbuild/BUILD
+ cd DynaLay-1.00
+ make install
make: Nothing to be done for `install'.
+ /usr/lib/rpm/brp-lib64-linux
sf@suse.de: if you find problems with this script, drop me a note
+ RPM_BUILD_ROOT=/home/windsoarer/Qt/rpmbuild/BUILDROOT/DynaLay-1.00-1.x86_64
+ export RPM_BUILD_ROOT
+ test -x /usr/sbin/Check -a 1000 = 0 -o -x /usr/sbin/Check -a '!' -z /home/windsoarer/Qt/rpmbuild/BUILDROOT/DynaLay-1.00-1.x86_64
+ echo 'I call /usr/sbin/Check...'
I call /usr/sbin/Check...
+ /usr/sbin/Check
Checking permissions and ownerships - using the permissions files
        /tmp/Check.perms.F7663b
setting /home/windsoarer/Qt/rpmbuild/BUILDROOT/DynaLay-1.00-1.x86_64/ to root:root 0755. (wrong owner/group windsoarer:users)
+ /usr/lib/rpm/brp-compress
+ /usr/lib/rpm/brp-symlink
Processing files: DynaLay-1.00-1.x86_64
error: File not found: /home/windsoarer/Qt/rpmbuild/BUILDROOT/DynaLay-1.00-1.x86_64/usr/local/bin/DynaLay


RPM build errors:
    File not found: /home/windsoarer/Qt/rpmbuild/BUILDROOT/DynaLay-1.00-1.x86_64/usr/local/bin/DynaLay

The directory /home/windsoarer/Qt/rpmbuild/BUILDROOT/DynaLay-1.00-1.x86_64 is created, but not

/home/windsoarer/Qt/rpmbuild/BUILDROOT/DynaLay-1.00-1.x86_64/usr/local/bin/DynaLay

Thanks again for any help

Andre

  • make install
    make: Nothing to be done for `install’

That’s a qmake related problem. I don’t know about its syntax, but anybody that could help you will need to see the contents of “DynaLay.pro”.
Are you sure it is supposed to generate an (real) install rule?

Thanks for the hint.

I corrected the install lines, and everything works fine, at last.

Well, almost fine : after one install everything works OK, but afterwards “rpm -e” says the package isn’t there, and “rpm -i” says the opposite!
It is still possible to use the “rpm --force” option to install, but this isn’t satisfactory. Any ideas ?

Thanks,

Andre


>sudo rpm -e /home/windsoarer/Qt/rpmbuild/RPMS/x86_64/DynaLay-1.02-1.x86_64.rpm
error: package /home/windsoarer/Qt/rpmbuild/RPMS/x86_64/DynaLay-1.02-1.x86_64.rpm is not installed
>sudo rpm -i /home/windsoarer/Qt/rpmbuild/RPMS/x86_64/DynaLay-1.02-1.x86_64.rpm
        package DynaLay-1.02-1.x86_64 is already installed


Hi
You only need to use the name of the package from rpm -q dynalay or use
zypper rm command.


Cheers Malcolm °¿° (Linux Counter #276890)
SUSE Linux Enterprise Desktop 11 (x86_64) Kernel 2.6.27.45-0.1-default
up 2 days 21:29, 3 users, load average: 0.04, 0.08, 0.04
GPU GeForce 8600 GTS Silent - CUDA Driver Version: 190.53

Got it, thanks

Andre