--- Makefile.orig	Sun Jul  1 12:05:57 2007
+++ Makefile	Fri Jul 20 11:52:57 2007
@@ -18,7 +18,6 @@
 
 # Where to install things:
 
-PREFIX=/usr/local
 
 
 # Root directory to place files when creating packages.
@@ -40,7 +39,7 @@
 # Docs and man page:
 
 DOC_PREFIX=$(PKG_ROOT)$(PREFIX)/share/doc/tuxpaint
-MAN_PREFIX=$(PKG_ROOT)$(PREFIX)/share/man
+MAN_PREFIX=$(PKG_ROOT)$(PREFIX)/man
 
 
 # 'System-wide' Config file:
@@ -103,12 +102,8 @@
 SDL_CFLAGS=$(shell sdl-config --cflags) $(SVG_CFLAGS)
 
 
-SVG_LIB=-lrsvg-2 -lcairo
-SVG_CFLAGS=-I/usr/include/librsvg-2/librsvg \
-	-I/usr/include/gtk-2.0 \
-	-I/usr/include/glib-2.0 \
-	-I/usr/lib/glib-2.0/include \
-	-I/usr/include/cairo
+SVG_LIB=`pkg-config --libs librsvg-2.0 cairo`
+SVG_CFLAGS=`pkg-config --cflags librsvg-2.0 cairo`
 
 PAPER_LIB=-lpaper
 
@@ -117,7 +112,7 @@
 
 #-ffast-math
 OPTFLAGS=-O2
-CFLAGS=$(OPTFLAGS) -W -Wall -fno-common -ffloat-store \
+CFLAGS+=$(OPTFLAGS) -W -Wall -fno-common -ffloat-store -I$(LOCALBASE)/include \
 	-Wcast-align -Wredundant-decls \
 	-Wbad-function-cast -Wwrite-strings \
 	-Waggregate-return \
@@ -286,8 +281,7 @@
 install:	install-bin install-data install-man install-doc \
 		install-icon install-gettext install-im install-importscript \
 		install-default-config install-example-stamps \
-		install-example-starters \
-		install-gnome install-kde install-kde-icons
+		install-example-starters
 	@echo
 	@echo "--------------------------------------------------------------"
 	@echo
@@ -479,8 +473,10 @@
 	@echo
 	@echo "...Installing default config file..."
 	@install -d $(CONFDIR)
-	@cp src/tuxpaint.conf $(CONFDIR)
-	@chmod 644 $(CONFDIR)/tuxpaint.conf
+	@cp src/tuxpaint.conf $(CONFDIR)/tuxpaint.conf.sample
+	@chmod 644 $(CONFDIR)/tuxpaint.conf.sample
+	@test -f $(CONFDIR)/tuxpaint.conf || \
+		cp $(CONFDIR)/tuxpaint.conf.sample $(CONFDIR)/tuxpaint.conf
 
 
 # Install example stamps
@@ -608,9 +604,6 @@
 	@install -d $(ICON_PREFIX)
 	@cp data/images/icon.png $(ICON_PREFIX)/tuxpaint.png
 	@chmod 644 $(ICON_PREFIX)/tuxpaint.png
-	@install -d $(X11_ICON_PREFIX)
-	@cp data/images/icon32x32.xpm $(X11_ICON_PREFIX)/tuxpaint.xpm
-	@chmod 644 $(X11_ICON_PREFIX)/tuxpaint.xpm
 
 
 # Install the program:
@@ -693,12 +686,6 @@
 	@cp src/manpage/tuxpaint.1 $(MAN_PREFIX)/man1
 	@gzip -f $(MAN_PREFIX)/man1/tuxpaint.1
 	@chmod a+rx,g-w,o-w $(MAN_PREFIX)/man1/tuxpaint.1.gz
-	@# pl/man1 directory...
-	@install -d $(MAN_PREFIX)/pl/man1/
-	@# tuxpaint-pl.1
-	@cp src/manpage/tuxpaint-pl.1 $(MAN_PREFIX)/pl/man1/tuxpaint.1
-	@gzip -f $(MAN_PREFIX)/pl/man1/tuxpaint.1
-	@chmod a+rx,g-w,o-w $(MAN_PREFIX)/pl/man1/tuxpaint.1.gz
 	@# tuxpaint-import.1
 	@cp src/manpage/tuxpaint-import.1 $(MAN_PREFIX)/man1/
 	@gzip -f $(MAN_PREFIX)/man1/tuxpaint-import.1
@@ -723,7 +710,7 @@
 		$(SDL_LIBS) \
 		$(SVG_LIB) \
 		$(PAPER_LIB) \
-		-lm $(ARCH_LINKS)
+		-lm $(ARCH_LINKS) -lintl -lpng
 	@$(RSRC_CMD)
 	@$(MIMESET_CMD)
 
