--- Makefile.orig 2009-05-29 07:08:08.000000000 +0900 +++ Makefile 2010-10-19 01:39:29.000000000 +0900 @@ -203,12 +203,10 @@ @echo @echo "...Installing launcher icon into GNOME..." @if [ "x$(GNOME_PREFIX)" != "x" ]; then \ - install -d $(GNOME_PREFIX)/share/pixmaps; \ - cp data/images/icon.png $(GNOME_PREFIX)/share/pixmaps/tuxpaint-config.png; \ - chmod 644 $(GNOME_PREFIX)/share/pixmaps/tuxpaint-config.png; \ - install -d $(GNOME_PREFIX)/share/applications; \ - cp src/tuxpaint-config.desktop $(GNOME_PREFIX)/share/applications/; \ - chmod 644 $(GNOME_PREFIX)/share/applications/tuxpaint-config.desktop; \ + install -d $(DESTDIR)$(GNOME_PREFIX)/share/pixmaps; \ + $(BSD_INSTALL_DATA) data/images/icon.png $(DESTDIR)$(GNOME_PREFIX)/share/pixmaps/tuxpaint-config.png; \ + install -d $(DESTDIR)$(GNOME_PREFIX)/share/applications; \ + $(BSD_INSTALL_DATA) src/tuxpaint-config.desktop $(DESTDIR)$(GNOME_PREFIX)/share/applications/; \ fi @@ -218,9 +216,8 @@ @echo @echo "...Installing launcher icon into KDE..." @if [ "x$(KDE_PREFIX)" != "x" ]; then \ - install -d $(KDE_PREFIX)/Preferences/; \ - cp src/tuxpaint-config.desktop $(KDE_PREFIX)/Preferences/; \ - chmod 644 $(KDE_PREFIX)/Preferences/tuxpaint-config.desktop; \ + install -d $(DESTDIR)$(KDE_PREFIX)/Preferences/; \ + $(BSD_INSTALL_DATA) src/tuxpaint-config.desktop $(DESTDIR)$(KDE_PREFIX)/Preferences/; \ fi @@ -242,12 +239,10 @@ install-icon: @echo @echo "...Installing launcher icon graphics..." - @install -d $(ICON_PREFIX) - @cp data/images/icon.png $(ICON_PREFIX)tuxpaint-config.png - @chmod 644 $(ICON_PREFIX)tuxpaint-config.png - @install -d $(X11_ICON_PREFIX) - @cp data/images/icon32x32.xpm $(X11_ICON_PREFIX)tuxpaint-config.xpm - @chmod 644 $(X11_ICON_PREFIX)tuxpaint-config.xpm + @install -d $(DESTDIR)$(ICON_PREFIX) + $(BSD_INSTALL_DATA) data/images/icon.png $(DESTDIR)$(ICON_PREFIX)tuxpaint-config.png + @install -d $(DESTDIR)$(X11_ICON_PREFIX) + $(BSD_INSTALL_DATA) data/images/icon32x32.xpm $(DESTDIR)$(X11_ICON_PREFIX)tuxpaint-config.xpm # Install the program: @@ -255,8 +250,7 @@ install-bin: @echo @echo "...Installing program itself..." - @cp tuxpaint-config $(BIN_PREFIX) - @chmod a+rx,g-w,o-w $(BIN_PREFIX)/tuxpaint-config$(EXE_EXT) + $(BSD_INSTALL_PROGRAM) tuxpaint-config $(DESTDIR)$(BIN_PREFIX) # Install the data (sound, graphics, fonts): @@ -264,9 +258,9 @@ install-data: @echo @echo "...Installing data files..." - @install -d $(DATA_PREFIX) - @cp -R data/* $(DATA_PREFIX) - @chmod -R a+rX,g-w,o-w $(DATA_PREFIX) + @install -d $(DESTDIR)$(DATA_PREFIX) + @install -d $(DESTDIR)$(DATA_PREFIX)/images + $(BSD_INSTALL_DATA) data/images/* $(DESTDIR)$(DATA_PREFIX)/images # Install the text documentation: @@ -275,16 +269,14 @@ @echo @echo "...Installing documentation..." @echo "(English)" - @install -d $(DOC_PREFIX) - @install -d $(DOC_PREFIX)/html - @cp docs/AUTHORS.txt $(DOC_PREFIX) - @cp docs/CHANGES.txt $(DOC_PREFIX) - @cp docs/COPYING.txt $(DOC_PREFIX) - @cp docs/README.txt $(DOC_PREFIX) - @cp docs/html/README.html $(DOC_PREFIX)/html - @cp docs/TODO.txt $(DOC_PREFIX) - @echo "(...Setting permissions)" - @chmod -R a+rx,g-w,o-w $(DOC_PREFIX) + @install -d $(DESTDIR)$(DOC_PREFIX) + @install -d $(DESTDIR)$(DOC_PREFIX)/html + $(BSD_INSTALL_DATA) docs/AUTHORS.txt $(DESTDIR)$(DOC_PREFIX) + $(BSD_INSTALL_DATA) docs/CHANGES.txt $(DESTDIR)$(DOC_PREFIX) + $(BSD_INSTALL_DATA) docs/COPYING.txt $(DESTDIR)$(DOC_PREFIX) + $(BSD_INSTALL_DATA) docs/README.txt $(DESTDIR)$(DOC_PREFIX) + $(BSD_INSTALL_DATA) docs/html/README.html $(DESTDIR)$(DOC_PREFIX)/html + $(BSD_INSTALL_DATA) docs/TODO.txt $(DESTDIR)$(DOC_PREFIX) # Install the man page: @@ -292,11 +284,10 @@ install-man: @echo "...Installing man pages..." # man1 directory... - @install -d $(MAN_PREFIX)/man1/ + @install -d $(DESTDIR)$(MAN_PREFIX)/man1/ # tuxpaint-config.1 - @cp src/tuxpaint-config.1 $(MAN_PREFIX)/man1/ - @gzip -9f $(MAN_PREFIX)/man1/tuxpaint-config.1 - @chmod a+rx,g-w,o-w $(MAN_PREFIX)/man1/tuxpaint-config.1.gz + $(BSD_INSTALL_MAN) src/tuxpaint-config.1 $(DESTDIR)$(MAN_PREFIX)/man1/ + @gzip -9f $(DESTDIR)$(MAN_PREFIX)/man1/tuxpaint-config.1 # Build the program! @@ -337,10 +328,11 @@ POFILES:=$(wildcard src/po/*.po) MOFILES:=$(patsubst src/po/%.po,trans/%.mo,$(POFILES)) -INSTALLED_MOFILES:=$(patsubst trans/%.mo,$(LOCALE_PREFIX)/%/LC_MESSAGES/tuxpaint-config.mo,$(MOFILES)) +INSTALLED_MOFILES:=$(patsubst trans/%.mo,$(DESTDIR)$(LOCALE_PREFIX)/%/LC_MESSAGES/tuxpaint-config.mo,$(MOFILES)) -$(INSTALLED_MOFILES): $(LOCALE_PREFIX)/%/LC_MESSAGES/tuxpaint-config.mo: trans/%.mo - install -D -m 644 $< $@ +$(INSTALLED_MOFILES): $(DESTDIR)$(LOCALE_PREFIX)/%/LC_MESSAGES/tuxpaint-config.mo: trans/%.mo + test -d `dirname $@` || mkdir -p `dirname $@` + $(BSD_INSTALL_DATA) $< $@ .PHONY: uninstall-i18n uninstall-i18n: