Need help with spec file.

Whats wrong with this spec file?
I am using for this project only qt4 and make it with qmake.
obstext-0.1.spec:

%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

Summary: test programm
Name: %{name}
License: GPLv3
URL: http://example.com
Version: 0.1
Release: 1
Group: Amusements/Teaching/Other
Source: %{name}-%{version}.tar.gz
Packager: Test test
Distribution: %{distr}
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  libqt4-devel >= 4.4.3

%description
This is a test description
%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
%{_bindir}/%{name}

%changelog
* Tue Sep 8 2008 Test Test
- Second Release

obstext.pro


QT       += xml

TARGET = obstext
TEMPLATE = app


SOURCES += main.cpp\
        mainwindow.cpp

HEADERS  += mainwindow.h

FORMS    += mainwindow.ui

command : osc build openSUSE_11.1 i586 obstext-0.1.spec
.build.log

Memory limit set to 1375712KB
Using BUILD_ROOT=/var/tmp/build-root
Using BUILD_ARCH=i586:i486:i386


linux-193z started "build obstext-0.1.spec" at Sun Mar 15 13:26:25 CET 2009.


processing specfile /home/paul/build/home:metaxy/obstext/obstext-0.1.spec...
running changelog2spec --target rpm --file /home/paul/build/home:metaxy/obstext/obstext-0.1.spec
init_buildsystem --rpmlist /tmp/rpmlist.9eZEV5 /home/paul/build/home:metaxy/obstext/obstext-0.1.spec ...
reordering...cycle: liblcms1 -> lcms
  breaking dependency liblcms1 -> lcms
cycle: libqt4-qt3support -> libqt4-x11
  breaking dependency libqt4-x11 -> libqt4-qt3support
done
keeping filesystem-11.1-2.3
.......
keeping libqt4-devel-4.4.3-4.6
removing nis flags from /var/tmp/build-root/etc/nsswitch.conf...
now finalizing build dir...
/lib/dbus-1/dbus-daemon-launch-helper: unknown group messagebus
Checking permissions and ownerships - using the permissions files
	/tmp/Check.perms.2v2ryt
setting /etc/shadow to root:shadow 0640. (wrong owner/group root:root permissions 0644)
setting /usr/src/packages/SOURCES/ to root:root 0755. (wrong owner/group abuild:abuild)
setting /usr/src/packages/BUILD/ to root:root 0755. (wrong owner/group abuild:abuild)
setting /usr/src/packages/RPMS/ to root:root 0755. (wrong owner/group abuild:abuild)
setting /usr/src/packages/RPMS/i386/ to root:root 0755. (wrong owner/group abuild:abuild)
setting /usr/src/packages/RPMS/i686/ to root:root 0755. (wrong owner/group abuild:abuild)
setting /usr/src/packages/RPMS/noarch/ to root:root 0755. (wrong owner/group abuild:abuild)
setting /usr/src/packages/SPECS/ to root:root 0755. (wrong owner/group abuild:abuild)
setting /usr/src/packages/SRPMS/ to root:root 0755. (wrong owner/group abuild:abuild)
Starting SuSEconfig, the SuSE Configuration Tool...
Running in full featured mode.
Reading /etc/sysconfig and updating the system...
Executing /sbin/conf.d/SuSEconfig.glib2...
Executing /sbin/conf.d/SuSEconfig.groff...
Executing /sbin/conf.d/SuSEconfig.permissions...
/lib/dbus-1/dbus-daemon-launch-helper: unknown group messagebus
Finished.
cp: omitting directory `/home/paul/build/home:metaxy/obstext/obstext-0.1'
-----------------------------------------------------------------
I have the following modifications for obstext-0.1.spec:
53c53
< - Second Release
\ No newline at end of file
---
> - Second Release
-----------------------------------------------------------------
----- building obstext-0.1.spec (user abuild)
-----------------------------------------------------------------
-----------------------------------------------------------------
+ exec rpmbuild -ba --define '_srcdefattr (-,root,root)' /usr/src/packages/SOURCES/obstext-0.1.spec
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.97354
+ umask 022
+ cd /usr/src/packages/BUILD
+ cd /usr/src/packages/BUILD
+ rm -rf obstext-0.1
+ /usr/bin/gzip -dc /usr/src/packages/SOURCES/obstext-0.1.tar.gz
+ tar -xvvf -
drwxr-xr-x 1003/100          0 2009-03-15 12:25 obstext-0.1/
-rw-r--r-- 1003/100       5963 2009-03-14 19:06 obstext-0.1/obstext.pro.user
-rw-r--r-- 1003/100        739 2009-03-14 19:05 obstext-0.1/mainwindow.ui
-rw-r--r-- 1003/100        220 2009-03-14 19:05 obstext-0.1/mainwindow.cpp
-rw-r--r-- 1003/100        305 2009-03-15 12:25 obstext-0.1/obstext.pro
-rw-r--r-- 1003/100        302 2009-03-14 19:05 obstext-0.1/mainwindow.h
-rw-r--r-- 1003/100        177 2009-03-14 19:05 obstext-0.1/main.cpp
-rw-r--r-- 1003/100        324 2009-03-15 12:25 obstext-0.1/obstext.pro~
-rw-r--r-- 1003/100          2 2009-03-14 19:32 obstext-0.1/README
+ STATUS=0
+ '' 0 -ne 0 ']'
+ cd obstext-0.1
++ /usr/bin/id -u
+ '' 399 = 0 ']'
++ /usr/bin/id -u
+ '' 399 = 0 ']'
+ /bin/chmod -Rf a+rX,u+w,g-w,o-w .
+ exit 0
Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.97354
+ umask 022
+ cd /usr/src/packages/BUILD
+ /bin/rm -rf /var/tmp/obstext-0.1-build
++ dirname /var/tmp/obstext-0.1-build
+ /bin/mkdir -p /var/tmp
+ /bin/mkdir /var/tmp/obstext-0.1-build
+ cd obstext-0.1
+ qmake -makefile obstext.pro
+ qmake
+ make
/usr/bin/uic mainwindow.ui -o ui_mainwindow.h
g++ -c -pipe -O2 -march=i586 -mtune=i686 -fmessage-length=0 -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -g -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_XML_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I../../../../share/qt4/mkspecs/default -I. -I../../../../include/QtCore -I../../../../include/QtCore -I../../../../include/QtGui -I../../../../include/QtGui -I../../../../include/QtXml -I../../../../include/QtXml -I../../../../include -I. -I. -o main.o main.cpp
g++ -c -pipe -O2 -march=i586 -mtune=i686 -fmessage-length=0 -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -g -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_XML_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I../../../../share/qt4/mkspecs/default -I. -I../../../../include/QtCore -I../../../../include/QtCore -I../../../../include/QtGui -I../../../../include/QtGui -I../../../../include/QtXml -I../../../../include/QtXml -I../../../../include -I. -I. -o mainwindow.o mainwindow.cpp
/usr/bin/moc -DQT_NO_DEBUG -DQT_XML_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I../../../../share/qt4/mkspecs/default -I. -I../../../../include/QtCore -I../../../../include/QtCore -I../../../../include/QtGui -I../../../../include/QtGui -I../../../../include/QtXml -I../../../../include/QtXml -I../../../../include -I. -I. mainwindow.h -o moc_mainwindow.cpp
g++ -c -pipe -O2 -march=i586 -mtune=i686 -fmessage-length=0 -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -g -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_XML_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I../../../../share/qt4/mkspecs/default -I. -I../../../../include/QtCore -I../../../../include/QtCore -I../../../../include/QtGui -I../../../../include/QtGui -I../../../../include/QtXml -I../../../../include/QtXml -I../../../../include -I. -I. -o moc_mainwindow.o moc_mainwindow.cpp
g++  -o obstext main.o mainwindow.o moc_mainwindow.o    -L/usr/lib -lQtXml -L/usr/lib -pthread -pthread -lQtGui -L/usr/X11R6/lib -pthread -lpng -lSM -lICE -pthread -pthread -lXi -lXrender -lXrandr -lXfixes -lXcursor -lXinerama -lfreetype -lfontconfig -lXext -lX11 -lQtCore -lz -lm -pthread -lgthread-2.0 -lrt -lglib-2.0 -ldl -lpthread
+ exit 0
Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.68174
+ umask 022
+ cd /usr/src/packages/BUILD
+ cd obstext-0.1
+ make install DESTDIR=/var/tmp/obstext-0.1-build
make: Nothing to be done for `install'.
+ RPM_BUILD_ROOT=/var/tmp/obstext-0.1-build
+ export RPM_BUILD_ROOT
+ test -x /usr/sbin/Check -a 399 = 0 -o -x /usr/sbin/Check -a '!' -z /var/tmp/obstext-0.1-build
+ 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.QaN0xs
setting /var/tmp/obstext-0.1-build/ to root:root 0755. (wrong owner/group abuild:abuild)
+ /usr/lib/rpm/brp-compress
+ /usr/lib/rpm/brp-strip-debug
+ /usr/lib/rpm/brp-check-la
+ /usr/lib/rpm/brp-symlink
+ /usr/lib/rpm/brp-desktop
WARNING: '/usr/lib/rpm/brp-desktop.data/suse-screensavers.menu' does not exist
WARNING: '/usr/lib/rpm/brp-desktop.data/preferences-gnome.menu' does not exist
WARNING: '/usr/lib/rpm/brp-desktop.data/applications-kmenuedit.menu' does not exist
+ /usr/lib/rpm/brp-rpath
+ /usr/lib/rpm/brp-pie
+ /usr/lib/rpm/brp-rootfs
+ /usr/lib/rpm/brp-tcl
+ /usr/lib/rpm/brp-check-python
+ /usr/lib/rpm/brp-check-bytecode-version
+ /usr/lib/rpm/brp-boot-scripts
+ /usr/lib/rpm/brp-hook
Processing files: obstext-0.1-1
error: File not found: /var/tmp/obstext-0.1-build/usr/bin/obstext
Executing(%doc): /bin/sh -e /var/tmp/rpm-tmp.11719
+ umask 022
+ cd /usr/src/packages/BUILD
+ cd obstext-0.1
+ DOCDIR=/var/tmp/obstext-0.1-build/usr/share/doc/packages/obstext
+ export DOCDIR
+ rm -rf /var/tmp/obstext-0.1-build/usr/share/doc/packages/obstext
+ /bin/mkdir -p /var/tmp/obstext-0.1-build/usr/share/doc/packages/obstext
+ cp -pr README /var/tmp/obstext-0.1-build/usr/share/doc/packages/obstext
+ exit 0
Checking for unpackaged file(s): /usr/lib/rpm/check-files /var/tmp/obstext-0.1-build
Checking for unpackaged file(s): /usr/lib/rpm/check-files /var/tmp/obstext-0.1-build


RPM build errors:
    File not found: /var/tmp/obstext-0.1-build/usr/bin/obstext

+ make install DESTDIR=/var/tmp/obstext-0.1-build
make: Nothing to be done for `install'.

This looks like that your qmake project file installs nothing and this results to the error that the executable cannot be found in the bin dir. As a solution you can copy the binary with custom commands in the install section of the spec file to the bin dir instead of using make install or you can modify your qmake project file according to Qt 4.3: qmake Variable Reference.

Hope this helps

thank you , now it works