#! /bin/sh /usr/share/dpatch/dpatch-run
## 01_install-target-in-makefile.dpatch by Gurkan Sengun <gurkan@linuks.mine.nu>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Add an install target to the Makefile and fix binary name

@DPATCH@

--- supertransball2-1.5.orig/sources/Makefile
+++ supertransball2-1.5/sources/Makefile
@@ -1,3 +1,4 @@
+TARGET=supertransball2
 OBJS := \
 	auxiliar.o           configuration.o     encoder.o \
 	enemies.o            fonts.o       	 game.o \
@@ -9,16 +10,25 @@
 	state_replay.o       state_replaymanager.o \
 	state_typetext.o     tiles.o             transball.o \
 
-all: stransball2
+all: $(TARGET)
 
 %.o: %.cpp
 	c++ -c -g3 -O3 $< -o $@ `sdl-config --cflags` -I/usr/local/include/SDL
 
 # dynamically linked binary:
-stransball2: $(OBJS)
+$(TARGET): $(OBJS)
 	c++ $^ -o $@ `sdl-config --libs` -lSDL_image -lSDL_mixer -lSDL_sound -lSDL_sound -lSGE -I/usr/local/include/SDL
-	mv ./stransball2 ..
+	mv ./$(TARGET) ..
 
 clean:
-	rm -f stransball2
+	rm -f ../$(TARGET)
 	rm -f *.o
+
+install:
+	install -o root -g games -m 755 ../$(TARGET) $(DESTDIR)/usr/games
+
+install-data:
+	install -o root -g games -m 644 ../demos/* $(DESTDIR)/usr/share/games/supertransball2/demos/
+	install -o root -g games -m 644 ../sound/* $(DESTDIR)/usr/share/games/supertransball2/sound/
+	cp -r ../maps/* $(DESTDIR)/usr/share/games/supertransball2/maps/
+	install -o root -g games -m 644 ../graphics/* $(DESTDIR)/usr/share/games/supertransball2/graphics/
