PDA

View Full Version : rpm BUILD/Packagename is not created


TheBigRed
16th January 2012, 06:36 PM
Hi,

when trying to build a rpm package from the current game speed-dreams,
with the attached rpm spec file, build processs fails with the following error message:

the directory speed-dreams-src-base-2.0.0-rc1-r4420 is not build.

[martin@fc16 ~]$ rpmbuild -ba speed-dreams.spec
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.UqkUYY
+ umask 022
+ cd /home/martin/rpmbuild/BUILD
+ LANG=C
+ export LANG
+ unset DISPLAY
+ cd /home/martin/rpmbuild/BUILD
+ rm -rf speed-dreams-src-base-2.0.0-rc1-r4420
+ /bin/tar -xf -
+ /usr/bin/xz -dc /home/martin/rpmbuild/SOURCES/speed-dreams-src-base-2.0.0-rc1-r4420.tar.xz
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd speed-dreams-src-base-2.0.0-rc1-r4420
/var/tmp/rpm-tmp.UqkUYY: line 42: cd: speed-dreams-src-base-2.0.0-rc1-r4420: No such file or directory
error: Bad exit status from /var/tmp/rpm-tmp.UqkUYY (%prep)

used rpm spec file:

%define _pkgbuilddir %{_builddir}/%{name}_%{version}
%define real_ver rc1-r4420
%define pkg_name speed-dreams-2


Summary: The Open Racing Car Simulator
Name: speed-dreams
Version: 2.0.0
Release: rc1_r4420.5%{?dist}
License: GPLv2+
Group: Amusements/Games
URL: http://speed-dreams.org/
Source0: http://downloads.sourceforge.net/%{name}/%{name}-src-base-%{version}-rc1-r4420.tar.xz
Source1: speed-dreams.desktop

Requires: opengl-games-utils
BuildRequires: cmake
BuildRequires: SDL-devel
BuildRequires: desktop-file-utils
BuildRequires: enet-devel >= 1.2
BuildRequires: freealut-devel >= 1.1.0-10
BuildRequires: freeglut-devel
BuildRequires: libGL-devel
BuildRequires: libjpeg-devel
BuildRequires: libpng-devel
BuildRequires: libXi-devel
BuildRequires: libXmu-devel
BuildRequires: libXrandr-devel
BuildRequires: p7zip
BuildRequires: plib-devel >= 1.8.3

%description
Speed-Dreams is a 3D racing cars simulator using OpenGL. A Fork of TORCS. The goal is to have
programmed robots drivers racing against each others. You can also drive
yourself with either a wheel, keyboard or mouse.

%package robots-base
Summary: The Open Racing Car Simulator additional dirt tracks
Group: Amusements/Games
Requires: speed-dreams

%description robots-base
Speed Dreams is a 3D racing cars simulator using OpenGL. A Fork of TORCS. The goal is to have
programmed robots drivers racing against each others. You can also drive
yourself with either a wheel, keyboard or mouse.

This package contains additional tracks for the game.

%package devel
Summary: The Open Racing Car Simulator additional oval tracks
Group: Amusements/Games
Requires: speed-dreams = %{name}-src-base-%{version}-rc1-r4420

%description devel
Speed Dreams is a 3D racing cars simulator using OpenGL. The goal is to have
programmed robots drivers racing against each others. You can also drive
yourself with either a wheel, keyboard or mouse.

This package contains the development files for the game.

%prep
%setup -q -n %{name}-src-base-%{version}-rc1-r4420

%build
%cmake -DCMAKE_INSTALL_PREFIX:PATH="%{_prefix}" \
-DCMAKE_BUILD_TYPE:STRING=Release \
-DCMAKE_SKIP_RPATH:BOOL=ON \
-DOPTION_DEBUG:STRING=OFF \
-DOPTION_OFFICIAL_ONLY:BOOL=ON
make %{?_smp_mflags}

%install
%{__rm} -rf %{buildroot}
cd %{name}-src-base-%{version}-rc1-r4420-src
%{__make} install DESTDIR=%{buildroot}

# Icon for the desktop file
%{__install} -D -p -m 0644 data/data/icons/icon.png %{buildroot}%{_datadir}/pixmaps/%{name}.png

%{__install} -dm 755 %{buildroot}%{_datadir}/pixmaps
%{__install} -D -p -m 755 data/data/img/*.png %{buildroot}%{_datadir}/pixmaps

%{__install} -dm 755 %{buildroot}%{_datadir}/games/%{name}
%{__install} -D -p -m 755 data/data/icons/icon.* %{buildroot}%{_datadir}/games/%{name}

%{__install} -dm 755 %{buildroot}%{_libdir}/games/%{name}/lib
%{__install} -D -p -m 755 src/modules/simu/simuv2.1/SOLID-2.0/src/libsolid.so %{buildroot}%{_libdir}/games/%{pkg_name}/lib/

desktop-file-install \
--vendor "" \
--dir %{buildroot}%{_datadir}/applications \
%{SOURCE1}

# We need this for proper automatic stripping to take place (still in 1.3.0)
find %{buildroot}%{_libdir}/games/ -name '*.so' | xargs %{__chmod} +x

# remove cmake files
find $RPM_BUILD_ROOT -type f -name "*.cmake" -exec rm -f {} ';'

%files
# Directory default mode of 0755 is MANDATORY, since installed dirs are 0777
%defattr(-,root,root,0755)
%doc %{name}-src-base-%{version}-rc1-r4420-src/COPYING.txt %{name}-src-base-%{version}-rc1-r4420-src/README.txt
%{_datadir}/games/%{pkg_name}/*.txt
%{_libdir}/games/%{pkg_name}/lib/libsolid.so

/usr/games/*
%{_libdir}/games/%{pkg_name}/*

%{_datadir}/pixmaps/*.png
%{_datadir}/games/%{name}/icon.*


%files robots-base
%defattr(-,root,root,-)
# data packages, installs tracks, car models, fonts ...
%{_datadir}/applications/%{name}.desktop
%dir %{_datadir}/games/%{name}/
%{_datadir}/games/%{pkg_name}/*

%files devel
%defattr(-,root,root,-)
%{_includedir}/%{pkg_name}/*


%changelog
* Mon Jan 16 2012 Martin Gansser <linux4martin@gmx.de> 2.0.0-rc1-r4420-5
- new release

* Sat Oct 31 2011 Martin Gansser <linux4martin@gmx.de> 2.0.0-b1-r3937-4
- deactivate DOPTION_DEBUG
- activate SKIP_RPATH

* Sun Oct 16 2011 Mario Blättermann <mariobl@fedoraproject.org> 2.0.0-b1-r3937-3
- Removed unneeded definitions of BuildRoot, clean section
- Corrected URL
- Moved the *.desktop file to a real file as second source
- Removed unneeded BuildRequires

* Fri Oct 14 2011 Martin Gansser <linux4martin@gmx.de> 2.0.0-b1-r3937-2
- copy libsolid.so to SD lib dir

* Mon Oct 4 2011 Martin Gansser <linux4martin@gmx.de> 2.0.0-b1-r3937-1
- new version for Fedora 15

* Thu Jun 24 2010 Martin Gansser <linux4martin@gmx.de> 1.4.0-r2307-2
- initial version for Fedora 13


what is necessary to change in the spec file ?
Thanks

leigh123linux
16th January 2012, 07:01 PM
Is the unpacked directory called speed-dreams-src-base-2.0.0-rc1-r4420 ?

TheBigRed
16th January 2012, 08:20 PM

No directory will be created in BUILD called
speed-dreams-src-base-2.0.0-rc1-r4420 only the files exists there

[martin@fc16 ~]$ ll rpmbuild/BUILD
insgesamt 144
-rw-r--r-- 1 martin martin 50068 15. Jan 16:18 CHANGES.txt
drwxr-xr-x 2 martin martin 4096 15. Jan 18:49 cmake
-rw-r--r-- 1 martin martin 5461 15. Jan 18:48 CMakeLists.txt
-rw-r--r-- 1 martin martin 17994 27. Sep 2010 COPYING.txt
-rw-r--r-- 1 martin martin 22512 15. Jan 16:18 credits.xml
drwxr-xr-x 5 martin martin 4096 16. Jan 21:18 data
drwxr-xr-x 4 martin martin 4096 16. Jan 21:17 doc
-rw-r--r-- 1 martin martin 11377 27. Okt 11:34 INSTALL.txt
-rwxr-xr-x 1 martin martin 1999 12. Jan 2011 README.txt
drwxr-xr-x 10 martin martin 4096 16. Jan 21:18 src
-rw-r--r-- 1 martin martin 6317 27. Sep 07:47 TODO.txt

leigh123linux
16th January 2012, 10:56 PM
Try


%prep
%setup -q -c -n %{name}-src-base-%{version}-rc1-r4420

The -c option is used to direct %setup to create the top-level build directory before unpacking the sources.

TheBigRed
17th January 2012, 07:33 AM
thanks for your help

TheBigRed
18th January 2012, 08:35 PM
Try


%prep
%setup -q -c -n %{name}-src-base-%{version}-rc1-r4420

The -c option is used to direct %setup to create the top-level build directory before unpacking the sources.

I have a futher question, regarding the build process, that fails.

attached you can find the messages
http://www.sendspace.com/file/7nik1s

thanks for your help.

vallimar
19th January 2012, 01:52 PM
%install
%{__rm} -rf %{buildroot}
cd %{name}-src-base-%{version}-rc1-r4420-src

Are you certain that line is needed?

TheBigRed
19th January 2012, 04:54 PM
Thanks vallimar, that was the solution. :)