[Hampshire] Spec file build problem

Top Page

Reply to this message
Author: Damian Brasher
Date:  
To: Hants Lug
Subject: [Hampshire] Spec file build problem
Hi,

I'm building a spec file for a C application, my first so a test run. The
problem I have found is that an install-data-hook directive from the
Makefile.am cases an error after rpmbuild -ba dsi.spec:

make  install-data-hook
make[3]: Entering directory `/home/dbrasher/rpmbuild/BUILD/dsi-1.0.2'
chmod 666
/home/dbrasher/rpmbuild/BUILDROOT/dsi-1.0.2-1.fc10.i386/var/lib/games/dsi/hiscore
...
RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.OCMjcW (%install)


The Makefile.am install-data-hook is:

scoresdir = $(DESTDIR)$(localstatedir)/lib/games/dsi
scores_DATA = hiscore
install-data-hook:
        chmod 666 $(scoresdir)/hiscore



The file and directory /var/lib/games/dsi/hiscore is not actually present in
../BUILDROOT/dsi-1.0.2-1.fc10.i386/ home and usr are present.

I am building from a make dist tar.gz - dsi-1.0.2.tar.gz

The spec file looks like this (I have not expanded %files yet)
NB if I remove the install-data-hook I only get file errors which I
understand...

Name:           dsi
Version:        1.0.2
Release:        1%{?dist}
Summary:        Invading aliens type game


Group:          Applications/Games
License:        GPLv2
URL:            https://sourceforge.net/projects/dspaceinvadors
Source0:
http://downloads.sourceforge.net/project/dspaceinvadors/dsi-lin-src-1.0.2-beta2/dsi-1.0.2.tar.gz
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)


#BuildRequires:
#Requires:

%description
dsi is a simple game of invading aliens. You must stop those aliens from
landing on you. It features: smooth scrolling, high scores, 5 levels, simple
controls, sound effects, strategic game play, and a tiny footprint. The
graphics can be customized out of the box, without requiring any recompiling.
A simple definition file can be customized for coders.

%prep
%setup -q


%build
%configure
make %{?_smp_mflags}

%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root,-)
%doc README COPYING


%changelog
* Tue Apr 13 2010 We fought them off dbrasher@??? 1.0.2-1
- Initial version of the package

If I remove the hook and add all the files to the %file section I still have
these errors:

RPM build errors:
    File not found:
/home/dbrasher/rpmbuild/BUILDROOT/dsi-1.0.2-1.fc10.i386/usr/share/applications/DSI.desktop
    File not found:
/home/dbrasher/rpmbuild/BUILDROOT/dsi-1.0.2-1.fc10.i386/usr/share/pixmaps/alien.png
    File not found:
/home/dbrasher/rpmbuild/BUILDROOT/dsi-1.0.2-1.fc10.i386/var/lib/games/dsi/hiscore



Thanks
Damian


--
w: http://www.diaser.org.uk - Geo-data redundancy long-term archive system
(WAN vault)- beta1
w: http://www.walkingwiththeelephants.co.uk - ebook about small scale OSS
collaborative development
w: http://interlinux.co.uk/wordpress/?p=371 - DSI – invading aliens game

--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.