spec file issue for qt application

So like many others I am new to building RPM packages and am having issues with the spec file I have created. It’s been made using info I’ve gathered from various posts here so it might just be horribly mangled but I’d appreciate some help since I can’t seem to get it to work no matter how many changes I seem to incorporate into it. Thanks.

%define name    obstext
%define is_mandrake %(test -e /etc/mandrake-release && echo 1 || echo 0)
%define is_suse %(test -e /etc/SuSE-release && echo 1 || echo 0)
%define is_fedora %(test -e /etc/fedora-release && echo 1 || echo 0)
%define qmake qmake
%define lrelease lrelease

%if %is_fedora
%define distr %(cat /etc/fedora-release)
%define qmake qmake-qt4
%define lrelease lrelease-qt4
%endif
%if %is_suse
%define distr %(head -1 /etc/SuSE-release)
%endif
%if %is_mandrake
%define distr %(cat /etc/mandrake-release)
%endif

# Basic Information
Name:		delaycut
Summary:	Audio file delay and cut utility
License:	GPLv3
Group:		Applications/Sound
URL:		https://github.com/athomasm/delaycut
Version:	1.4.0.0
Release:	1
Source0:	%{name}-%{version}.tar.gz
Distribution:   %{distr}
Packager:	Adam Thomas-Murphy <patlaborforce@gmail.com>
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

# Dependency Information
BuildRequires:	libqt4-devel >= 4.4.3

%description
delaycut corrects delay and is also able to cut audio files 
coded ac3, eac3, dts, mpa and wav. It is also able to fix 
CRC errors in ac3 and mpa files.

%prep
%setup
%build
qmake -makefile %{name}.pro
qmake
make
%install
make install DESTDIR=$RPM_BUILD_ROOT $INSTALL_TARGET
%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root)
%doc README.txt
%{_bindir}/%{name}
%changelog

And the error I get when trying to build is:

RPM build errors:
File not found: /usr/src/packages/BUILDROOT/delaycut-1.4.0.0-63.1.x86_64/usr/bin/delaycut

Hi
Have a look here for cross-distribution;
http://en.opensuse.org/openSUSE:Build_Service_cross_distribution_howto
No need for all those defines…

Your first stop should be here;
http://en.opensuse.org/Portal:Packaging

The source needs to be the full download path to the gz file.

The License needs to conform to spdx, in your case GPL-3.0

There is no %clean anymore…

Clean it up a bit more from the above information and then post back
the build service link to your project.


Cheers Malcolm °¿° (Linux Counter #276890)
openSUSE 11.4 (x86_64) Kernel 2.6.37.6-0.9-desktop
up 3:22, 3 users, load average: 0.29, 0.11, 0.08
GPU GeForce 8600 GTS Silent - Driver Version: 285.05.09

Having cleaned it up a bit anyway and having included a few things you mention I now have it at:

%if 0%{?suse_version}
%define group Productivity/Multimedia/Sound/Utilities
%define distr %(cat /etc/SuSE-release)
%endif
%if 0%{?fedora}
%define qmake qmake-qt4
%define group Applications/Multimedia
%define distr %(cat /etc/fedora-release)
%endif

# Basic Information
Name:		delaycut
Summary:	Audio file delay and cut utility
License:	GPL-3.0
Group:		%{group}		
URL:		https://github.com/athomasm/delaycut
Version:	1.4.0.0
Release:	1
Source0:	%{name}-%{version}.tar.gz
Distribution:   %{distr}
Packager:	Adam Thomas-Murphy <patlaborforce@gmail.com>
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

# Dependency Information
BuildRequires:	libqt4-devel

%description
delaycut corrects delay and is also able to cut audio files 
coded ac3, eac3, dts, mpa and wav. It is also able to fix 
CRC errors in ac3 and mpa files.

%prep
%setup
%build
qmake-qt4 -makefile %{name}.pro
qmake-qt4
make
%install
make install DESTDIR=$RPM_BUILD_ROOT $INSTALL_TARGET

%changelog
* Tue Nov 15 2011 Adam Thomas-Murphy <patlaborforce@gmail.com>
- Initial Spec File

But now I get

cat: /etc/SuSE-release: No such file or directory
or the same error for the Fedora builds just it’s complaining about /etc/fedora-release not existing. If I remove that it builds fine so should I just not care about filling in the Distribution tag?

Hi
Correct it’s not needed or packager (will cause a warning/error) and
you also need to separate out the changelog into a file called
<specfile_name>.changes


Cheers Malcolm °¿° (Linux Counter #276890)
openSUSE 11.4 (x86_64) Kernel 2.6.37.6-0.9-desktop
up 8:05, 3 users, load average: 0.03, 0.14, 0.12
GPU GeForce 8600 GTS Silent - Driver Version: 285.05.09