rpms/tong/devel tong-chdir.patch, NONE, 1.1 tong-icon.png, NONE, 1.1 tong.desktop, NONE, 1.1 tong.spec, NONE, 1.1 .cvsignore, 1.1, 1.2 sources, 1.1, 1.2

Michael Thomas (wart) fedora-extras-commits at redhat.com
Thu Feb 23 18:18:55 UTC 2006


Author: wart

Update of /cvs/extras/rpms/tong/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv32036/devel

Modified Files:
	.cvsignore sources 
Added Files:
	tong-chdir.patch tong-icon.png tong.desktop tong.spec 
Log Message:
auto-import tong-1.0-6 on branch devel from tong-1.0-6.src.rpm

tong-chdir.patch:

--- NEW FILE tong-chdir.patch ---
--- ../tong-1.0/tong.cpp	2004-12-23 18:24:16.000000000 -0800
+++ ./tong.cpp	2006-02-22 23:16:35.000000000 -0800
@@ -31,6 +31,7 @@
 #include <stdlib.h>
 #include <stdarg.h>
 #include <time.h>
+#include <unistd.h>
 
 #include "SDL.h"
 #include "SDL_mixer.h"
@@ -115,6 +116,10 @@
   Paddle *paddle;
   Ball *ball;
 
+  if (chdir(GAME_DATA_DIR)) {
+      perror("Could not change to game data directory (attempting to use current dir)");
+  }
+
   if(SDL_Init(SDL_INIT_AUDIO
 	      |SDL_INIT_VIDEO
 	      |SDL_INIT_TIMER
--- ../tong-1.0/Makefile	2004-12-23 11:31:27.000000000 -0800
+++ ./Makefile	2006-02-22 17:09:30.000000000 -0800
@@ -5,6 +5,7 @@
 SDL_LDFLAGS := $(shell sdl-config --libs)
 MIXER_FLAGS := -lSDL_mixer -lpthread
 IMG_FLAGS := -lSDL_image
+GAME_DATA_DIR := .
 CC=g++ -O3 -Wall #-ggdb3 
 SOURCES = tetris.cpp pong.cpp text.cpp option.cpp media.cpp
 #these sources need to be linked to the SDL libs so may have special flag settings
@@ -22,7 +23,7 @@
 	$(CC) $(SDL_CFLAGS) -c -o $@ $<
 
 tong.o: $(SDL_SOURCES)
-	$(CC) $(SDL_CFLAGS) -c -o $@ $<
+	$(CC) -DGAME_DATA_DIR=\"$(GAME_DATA_DIR)\" $(SDL_CFLAGS) -c -o $@ $<
 
 # clean out the mess
 clean:


--- NEW FILE tong.desktop ---
[Desktop Entry]
Encoding=UTF-8
Name=Tong
GenericName=Tong
Comment=A mixture of two popular games
Exec=tong
Icon=tong-icon.png
Terminal=false
Type=Application
Categories=Application;Game;
Version=1.0


--- NEW FILE tong.spec ---
Name:           tong
Version:        1.0
Release:        6%{?dist}
Summary:        A mixture of two classic games

Group:          Amusements/Games
License:        GPL
URL:            http://www.nongnu.org/tong
Source0:        http://www.nongnu.org/tong/tong-1.0.tar.gz
Source1:        tong-icon.png
Source2:        tong.desktop
Patch0:		tong-chdir.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildRequires:  desktop-file-utils
BuildRequires:  SDL_image-devel SDL_mixer-devel
Requires:	tong-data

%description
TONG is the result of intermixing two classic games, capitalizing on the
essential qualities of each and adding new twists of its own to make an
explosive chemical reaction out of it all.

%package data
Summary:	Data files for the Tong game
Group:          Amusements/Games
%description data
Data files for the Tong game.


%prep
%setup -q
%patch0 -b .orig

%build
make CC="%{__cxx} $RPM_OPT_FLAGS" GAME_DATA_DIR=%{_datadir}/tong %{?_smp_mflags}


%install
rm -rf $RPM_BUILD_ROOT

# Unfortunately, the Makefile does not contain an install: target so we
# have to install the files ourselves.
mkdir -p $RPM_BUILD_ROOT%{_bindir}

install -pD tong $RPM_BUILD_ROOT%{_bindir}/tong

for i in media/* ; do
    install -pD $i $RPM_BUILD_ROOT%{_datadir}/tong/$i
done

desktop-file-install --vendor fedora                            \
        --dir ${RPM_BUILD_ROOT}%{_datadir}/applications         \
        --add-category X-Fedora                                 \
        %{SOURCE2}
mkdir -p $RPM_BUILD_ROOT/%{_datadir}/icons/hicolor/32x32/apps/
install -p -m 644 %{SOURCE1} $RPM_BUILD_ROOT/%{_datadir}/icons/hicolor/32x32/apps/

%clean
rm -rf $RPM_BUILD_ROOT

%post
touch --no-create %{_datadir}/icons/hicolor || :
if [ -x %{_bindir}/gtk-update-icon-cache ]; then
   %{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :
fi

%postun
touch --no-create %{_datadir}/icons/hicolor || :
if [ -x %{_bindir}/gtk-update-icon-cache ]; then
   %{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :
fi


%files
%defattr(-,root,root,-)
%{_bindir}/tong
%{_datadir}/applications/*.desktop
%{_datadir}/icons/hicolor/32x32/apps/tong-icon.png
%doc COPYING CREDITS making-of.txt

%files data
%defattr(-,root,root,-)
%{_datadir}/tong

%changelog
* Thu Feb 23 2006 Wart <wart at kobold.org> - 1.0-6
- Remove unused tong.sh source
- Consistent use of RPM_OPT_FLAGS

* Wed Feb 22 2006 Wart <wart at kobold.org> - 1.0-5
- Add RPM_OPT_FLAGS to compile line.

* Wed Feb 22 2006 Wart <wart at kobold.org> - 1.0-4
- Refined the installation hacks to use %_datadir

* Sat Feb 18 2006 Jason L Tibbitts III <tibbs at math.uh.edu> - 1.0-3
- Some hacks for a saner installation.

* Tue Feb 7 2006 <wart at kobold.org> - 1.0-2
- Remove potentially trademarked words from the summary and description.
- Added desktop icon

* Fri Jul 22 2005 <wart at kobold.org> - 1.0-1
- Initial package for Fedora.


Index: .cvsignore
===================================================================
RCS file: /cvs/extras/rpms/tong/devel/.cvsignore,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- .cvsignore	23 Feb 2006 17:59:48 -0000	1.1
+++ .cvsignore	23 Feb 2006 18:18:54 -0000	1.2
@@ -0,0 +1 @@
+tong-1.0.tar.gz


Index: sources
===================================================================
RCS file: /cvs/extras/rpms/tong/devel/sources,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- sources	23 Feb 2006 17:59:48 -0000	1.1
+++ sources	23 Feb 2006 18:18:54 -0000	1.2
@@ -0,0 +1 @@
+9f358a012639de1a5a8d3e0b323438de  tong-1.0.tar.gz




More information about the fedora-extras-commits mailing list