$OpenBSD: patch-Makefile,v 1.6 2011/04/16 17:53:54 sthen Exp $ --- Makefile.orig Wed Apr 29 07:18:57 2009 +++ Makefile Thu Dec 17 16:33:11 2009 @@ -94,7 +94,7 @@ windows_PREFIX:=/usr/local osx_PREFIX:=/usr/local beos_PREFIX:=/boot/apps/Games/TuxPaint linux_PREFIX:=/usr/local -PREFIX:=$($(OS)_PREFIX) +PREFIX:=${TRUEPREFIX} # Root directory to place files when creating packages. @@ -125,24 +125,20 @@ MAGIC_PREFIX:=$(DESTDIR)$(PREFIX)/lib/tuxpaint/plugins # Docs and man page: DOC_PREFIX:=$(DESTDIR)$(PREFIX)/share/doc/tuxpaint -DEVDOC_PREFIX:=$(DESTDIR)$(PREFIX)/share/doc/tuxpaint-dev -MAN_PREFIX:=$(DESTDIR)$(PREFIX)/share/man -DEVMAN_PREFIX:=$(DESTDIR)$(PREFIX)/share/man +DEVDOC_PREFIX:=$(DESTDIR)$(PREFIX)/share/doc/tuxpaint/tuxpaint-dev +MAN_PREFIX:=$(DESTDIR)$(PREFIX)/man +DEVMAN_PREFIX:=$(DESTDIR)$(PREFIX)/man # 'System-wide' Config file: -ifeq ($(PREFIX),/usr) - CONFDIR:=$(DESTDIR)/etc/tuxpaint -else - CONFDIR:=$(DESTDIR)$(PREFIX)/etc/tuxpaint -endif +CONFDIR=${SYSCONFDIR}/tuxpaint # Icons and launchers: ICON_PREFIX:=$(DESTDIR)$(PREFIX)/share/pixmaps X11_ICON_PREFIX:=$(DESTDIR)$(PREFIX)/X11R6/include/X11/pixmaps -GNOME_PREFIX:=$(shell gnome-config --prefix 2> /dev/null) -KDE_PREFIX:=$(shell kde-config --install apps --expandvars 2> /dev/null) -KDE_ICON_PREFIX:=$(shell kde-config --install icon --expandvars 2> /dev/null) +#GNOME_PREFIX:=$(shell gnome-config --prefix 2> /dev/null) +#KDE_PREFIX:=$(shell kde-config --install apps --expandvars 2> /dev/null) +#KDE_ICON_PREFIX:=$(shell kde-config --install icon --expandvars 2> /dev/null) # Maemo flag MAEMOFLAG:= @@ -202,8 +198,9 @@ endif # The entire set of CFLAGS: #-ffast-math -OPTFLAGS:=-O2 -CFLAGS:=$(CPPFLAGS) $(OPTFLAGS) -W -Wall -fno-common -ffloat-store \ +#OPTFLAGS:=-O2 +CFLAGS:=-I${LOCALBASE}/include \ + $(CPPFLAGS) $(OPTFLAGS) -W -Wall -fno-common -ffloat-store \ $(call comptest,-fvisibility=hidden,) \ -Wcast-align -Wredundant-decls \ -Wbad-function-cast -Wwrite-strings \ @@ -236,19 +233,6 @@ MOUSE_CFLAGS:=-Isrc/$(MOUSEDIR) -D$(CURSOR_SHAPES)_CUR # .PHONY: all all: tuxpaint translations magic-plugins tp-magic-config - @echo - @echo "--------------------------------------------------------------" - @echo - @echo "Done compiling." - @echo - @echo "Now run 'make install' with any options you ran 'make' with." - @echo "to install Tux Paint." - @echo - @echo "You may need superuser ('root') privileges, depending on" - @echo "where you're installing." - @echo "(Depending on your system, you either need to 'su' first," - @echo "or run 'sudo make install'.)" - @echo .PHONY: releaseclean releaseclean: @@ -303,7 +287,10 @@ MOFILES:=$(patsubst src/po/%.po,trans/%.mo,$(POFILES)) INSTALLED_MOFILES:=$(patsubst trans/%.mo,$(LOCALE_PREFIX)/%/LC_MESSAGES/tuxpaint.mo,$(MOFILES)) $(INSTALLED_MOFILES): $(LOCALE_PREFIX)/%/LC_MESSAGES/tuxpaint.mo: trans/%.mo - install -D -m 644 $< $@ + @cd trans ; \ + for i in `ls *.mo` ; do \ + ${BSD_INSTALL_DATA_DIR} $(DESTDIR)$(PREFIX)/share/locale/`basename $$i .mo`/LC_MESSAGES && \ + ${BSD_INSTALL_DATA} $$i $(DESTDIR)$(PREFIX)/share/locale/`basename $$i .mo`/LC_MESSAGES/tuxpaint.mo ; done .PHONY: uninstall-i18n uninstall-i18n: @@ -405,24 +392,7 @@ install: install-bin install-data install-man install- install-magic-plugin-dev \ install-icon install-gettext install-im install-importscript \ install-default-config install-example-stamps \ - install-example-starters \ - $(ARCH_INSTALL) - @echo - @echo "--------------------------------------------------------------" - @echo - @echo "All done! Now (preferably NOT as 'root' superuser)," - @echo "you can type the command 'tuxpaint' to run the program!!!" - @echo - @echo "For more information, see the 'tuxpaint' man page," - @echo "run 'tuxpaint --usage' or see $(DOC_PREFIX)/README.txt" - @echo - @echo "Visit Tux Paint's home page for more information, updates" - @echo "and to learn how you can help out!" - @echo - @echo " http://www.tuxpaint.org/" - @echo - @echo "Enjoy!" - @echo + install-example-starters .PHONY: install-magic-plugins install-magic-plugins: @@ -556,9 +526,8 @@ uninstall: uninstall-i18n install-default-config: @echo @echo "...Installing default config file..." - @install -d $(CONFDIR) - @cp src/tuxpaint.conf $(CONFDIR) - @chmod 644 $(CONFDIR)/tuxpaint.conf + ${BSD_INSTALL_DATA_DIR} $(DESTDIR)$(PREFIX)/share/examples/tuxpaint + ${BSD_INSTALL_DATA} src/tuxpaint.conf $(DESTDIR)$(PREFIX)/share/examples/tuxpaint # Install example stamps @@ -566,7 +535,7 @@ install-default-config: install-example-stamps: @echo @echo "...Installing example stamps..." - @install -d $(DATA_PREFIX)/stamps + ${BSD_INSTALL_DATA_DIR} $(DATA_PREFIX)/stamps @cp -R stamps/* $(DATA_PREFIX)/stamps @chmod -R a+rX,g-w,o-w $(DATA_PREFIX)/stamps @@ -575,7 +544,10 @@ STARTERS:=$(wildcard starters/*.*) INSTALLED_STARTERS:=$(patsubst %,$(DATA_PREFIX)/%,$(STARTERS)) $(INSTALLED_STARTERS): $(DATA_PREFIX)/%: % - install -D -m 644 $< $@ + @cd starters ; \ + ${BSD_INSTALL_DATA_DIR} $(DESTDIR)$(PREFIX)/share/tuxpaint/starters ; \ + for i in `ls *.*` ; do \ + ${BSD_INSTALL_DATA} $$i $(DESTDIR)$(PREFIX)/share/tuxpaint/starters ; done # Install example starters .PHONY: install-example-starters @@ -684,12 +656,9 @@ install-kde-icons: install-icon: @echo @echo "...Installing launcher icon graphics..." - @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 + ${BSD_INSTALL_DATA_DIR} $(ICON_PREFIX) + ${BSD_INSTALL_DATA} data/images/icon.png $(ICON_PREFIX)/tuxpaint.png + ${BSD_INSTALL_DATA} data/images/icon32x32.xpm $(ICON_PREFIX)/tuxpaint.xpm # Install the program: @@ -697,9 +666,8 @@ install-icon: install-bin: @echo @echo "...Installing program itself..." - @install -d $(BIN_PREFIX) - @cp tuxpaint $(BIN_PREFIX) - @chmod a+rx,g-w,o-w $(BIN_PREFIX)/tuxpaint$(EXE_EXT) + ${BSD_INSTALL_DATA_DIR} $(BIN_PREFIX) + ${BSD_INSTALL_PROGRAM} tuxpaint $(BIN_PREFIX) # Install the required Windows DLLs into the 'bdist' directory .PHONY: install-dlls @@ -765,8 +733,7 @@ install-dlls: install-importscript: @echo @echo "...Installing 'tuxpaint-import' script..." - @cp src/tuxpaint-import.sh $(BIN_PREFIX)/tuxpaint-import - @chmod a+rx,g-w,o-w $(BIN_PREFIX)/tuxpaint-import + ${BSD_INSTALL_SCRIPT} src/tuxpaint-import.sh $(BIN_PREFIX)/tuxpaint-import # Install the data (sound, graphics, fonts): @@ -774,12 +741,14 @@ install-importscript: install-data: @echo @echo "...Installing data files..." - @install -d $(DATA_PREFIX) + ${BSD_INSTALL_DATA_DIR} $(DATA_PREFIX) @cp -R data/* $(DATA_PREFIX) @chmod -R a+rX,g-w,o-w $(DATA_PREFIX) + ${BSD_INSTALL_DATA_DIR} $(DESTDIR)$(PREFIX)/share/applications + ${BSD_INSTALL_DATA} src/tuxpaint.desktop $(DESTDIR)$(PREFIX)/share/applications @echo @echo "...Installing fonts..." - @install -d $(DATA_PREFIX)/fonts/locale + ${BSD_INSTALL_DATA_DIR} $(DATA_PREFIX)/fonts/locale @cp -R fonts/locale/* $(DATA_PREFIX)/fonts/locale @chmod -R a+rX,g-w,o-w $(DATA_PREFIX)/fonts/locale @@ -790,7 +759,7 @@ install-data: install-doc: @echo @echo "...Installing documentation..." - @install -d $(DOC_PREFIX) + ${BSD_INSTALL_DATA_DIR} $(DOC_PREFIX) @cp -R docs/* $(DOC_PREFIX) @cp -R magic/magic-docs $(DOC_PREFIX) @chmod -R a=rX,g=rX,u=rwX $(DOC_PREFIX) @@ -802,25 +771,13 @@ install-man: @echo @echo "...Installing man pages..." @# man1 directory... - @install -d $(MAN_PREFIX)/man1 + ${BSD_INSTALL_MAN_DIR} $(MAN_PREFIX)/man1 @# tuxpaint.1 - @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 + ${BSD_INSTALL_MAN} src/manpage/tuxpaint.1 $(MAN_PREFIX)/man1 @# tuxpaint-import.1 - @cp src/manpage/tuxpaint-import.1 $(MAN_PREFIX)/man1/ - @gzip -f $(MAN_PREFIX)/man1/tuxpaint-import.1 - @chmod a+rx,g-w,o-w $(MAN_PREFIX)/man1/tuxpaint-import.1.gz + ${BSD_INSTALL_MAN} src/manpage/tuxpaint-import.1 $(MAN_PREFIX)/man1 @# tp-magic-config.1 - @cp src/manpage/tp-magic-config.1 $(MAN_PREFIX)/man1/ - @gzip -f $(MAN_PREFIX)/man1/tp-magic-config.1 - @chmod a+rx,g-w,o-w $(MAN_PREFIX)/man1/tp-magic-config.1.gz + ${BSD_INSTALL_MAN} src/manpage/tp-magic-config.1 $(MAN_PREFIX)/man1 @@ -834,7 +791,7 @@ tuxpaint: obj/tuxpaint.o obj/i18n.o obj/im.o obj/curso @echo "...Linking Tux Paint..." $(CC) $(CFLAGS) $(DEBUG_FLAGS) $(SDL_CFLAGS) $(FRIBIDI_CFLAGS) $(DEFS) \ -o tuxpaint $^ \ - $(SDL_LIBS) $(SVG_LIB) $(ARCH_LINKS) + $(SDL_LIBS) $(SVG_LIB) $(ARCH_LINKS) $(PAPER_LIB) -lpaper @$(RSRC_CMD) @$(MIMESET_CMD) @@ -997,7 +954,7 @@ linux_PLUGIN_LIBS:= PLUGIN_LIBS:=$($(OS)_PLUGIN_LIBS) #MAGIC_CFLAGS:=-g3 -O2 -fvisibility=hidden -fno-common -W -Wstrict-prototypes -Wmissing-prototypes -Wall $(MAGIC_SDL_CPPFLAGS) -Isrc/ -MAGIC_CFLAGS:=-g3 -O2 -fno-common -W -Wstrict-prototypes -Wmissing-prototypes -Wall $(MAGIC_SDL_CPPFLAGS) -Isrc/ +MAGIC_CFLAGS:=-g3 $(OPTFLAGS) -fno-common -W -Wstrict-prototypes -Wmissing-prototypes -Wall $(MAGIC_SDL_CPPFLAGS) -Isrc/ SHARED_FLAGS:=-shared -fpic MAGIC_C:=$(wildcard magic/src/*.c)