$OpenBSD: patch-Makefile,v 1.2 2013/05/15 12:41:30 ajacoutot Exp $
--- Makefile.orig	Thu Feb  9 03:50:01 2012
+++ Makefile	Wed May 15 09:21:54 2013
@@ -16,6 +16,7 @@ include build/version
 .PHONY : all clean realclean cleanicons install install-desktop
 
 INSTALL=install
+MANDIR=$(PREFIX)/man
 
 
 # Convert to Platform specific names
@@ -153,24 +154,33 @@ LINGUAS?=$(TRANSLATIONS)
 #----------------------------------------------------------
 install: $(BINNAME)
 	@echo "    Installing $(INSTALL_DIR)/bin/gogglesmm ..."
-	@$(INSTALL) -m 755 -D src/gogglesmm $(INSTALL_DIR)/bin/gogglesmm
+	@$(BSD_INSTALL_PROGRAM) src/gogglesmm $(INSTALL_DIR)/bin/gogglesmm
 	@echo "    Installing $(INSTALL_DIR)/share/applications/gogglesmm.desktop"
-	@$(INSTALL) -m 644 -D extra/gogglesmm.desktop $(INSTALL_DIR)/share/applications/gogglesmm.desktop
+	@$(BSD_INSTALL_DATA_DIR) $(INSTALL_DIR)/share/applications
+	@$(BSD_INSTALL_DATA) extra/gogglesmm.desktop $(INSTALL_DIR)/share/applications/gogglesmm.desktop
 	@echo "    Installing Icons"
-	$(INSTALL) -m 644 -D icons/gogglesmm_16.png $(INSTALL_DIR)/share/icons/hicolor/16x16/apps/gogglesmm.png
-	$(INSTALL) -m 644 -D extra/gogglesmm_22.png $(INSTALL_DIR)/share/icons/hicolor/22x22/apps/gogglesmm.png
-	$(INSTALL) -m 644 -D extra/gogglesmm_24.png $(INSTALL_DIR)/share/icons/hicolor/24x24/apps/gogglesmm.png
-	$(INSTALL) -m 644 -D icons/gogglesmm_32.png $(INSTALL_DIR)/share/icons/hicolor/32x32/apps/gogglesmm.png
-	$(INSTALL) -m 644 -D extra/gogglesmm_48.png $(INSTALL_DIR)/share/icons/hicolor/48x48/apps/gogglesmm.png
-	$(INSTALL) -m 644 -D extra/gogglesmm.svg $(INSTALL_DIR)/share/icons/hicolor/scalable/apps/gogglesmm.svg
+	@$(BSD_INSTALL_DATA_DIR) $(INSTALL_DIR)/share/icons/hicolor/16x16/apps/
+	@$(BSD_INSTALL_DATA) icons/gogglesmm_16.png $(INSTALL_DIR)/share/icons/hicolor/16x16/apps/gogglesmm.png
+	@$(BSD_INSTALL_DATA_DIR) $(INSTALL_DIR)/share/icons/hicolor/22x22/apps/
+	@$(BSD_INSTALL_DATA) extra/gogglesmm_22.png $(INSTALL_DIR)/share/icons/hicolor/22x22/apps/gogglesmm.png
+	@$(BSD_INSTALL_DATA_DIR) $(INSTALL_DIR)/share/icons/hicolor/24x24/apps/
+	@$(BSD_INSTALL_DATA) extra/gogglesmm_24.png $(INSTALL_DIR)/share/icons/hicolor/24x24/apps/gogglesmm.png
+	@$(BSD_INSTALL_DATA_DIR) $(INSTALL_DIR)/share/icons/hicolor/32x32/apps/
+	@$(BSD_INSTALL_DATA) icons/gogglesmm_32.png $(INSTALL_DIR)/share/icons/hicolor/32x32/apps/gogglesmm.png
+	@$(BSD_INSTALL_DATA_DIR) $(INSTALL_DIR)/share/icons/hicolor/48x48/apps/
+	@$(BSD_INSTALL_DATA) extra/gogglesmm_48.png $(INSTALL_DIR)/share/icons/hicolor/48x48/apps/gogglesmm.png
+	@$(BSD_INSTALL_DATA_DIR) $(INSTALL_DIR)/share/icons/hicolor/scalable/apps/
+	@$(BSD_INSTALL_DATA) extra/gogglesmm.svg $(INSTALL_DIR)/share/icons/hicolor/scalable/apps/gogglesmm.svg
 	@echo "    Installing $(INSTALL_MANDIR)/man1/gogglesmm.1"
-	@$(INSTALL) -m 644 -D extra/gogglesmm.1 $(INSTALL_MANDIR)/man1/gogglesmm.1
+	@$(BSD_INSTALL_MAN_DIR) $(INSTALL_MANDIR)/man1/
+	@$(BSD_INSTALL_MAN) extra/gogglesmm.1 $(INSTALL_MANDIR)/man1/gogglesmm.1
 ifneq (,$(findstring nls,$(OPTIONS)))
 	@echo "    Installing Translations"
 	@linguas='$(filter $(TRANSLATIONS),$(LINGUAS))'; \
 	for tr in $$linguas ; do \
     echo "    Installing $(INSTALL_LOCALEDIR)/$$tr/LC_MESSAGES/gogglesmm.mo" ;\
-  	$(INSTALL) -m 644 -D po/$$tr.mo -T $(INSTALL_LOCALEDIR)/$$tr/LC_MESSAGES/gogglesmm.mo ; \
+	$(BSD_INSTALL_DATA_DIR) $(INSTALL_LOCALEDIR)/$$tr/LC_MESSAGES/ ; \
+	$(BSD_INSTALL_DATA) po/$$tr.mo $(INSTALL_LOCALEDIR)/$$tr/LC_MESSAGES/gogglesmm.mo ; \
 	done;
 endif
 
