File glchs-makefile_overhaul.patch of Package gimp-lch-selector

Index: Makefile
===================================================================
--- Makefile.orig	2009-12-07 14:45:52.000000000 +0100
+++ Makefile	2009-12-08 13:30:01.713069365 +0100
@@ -1,20 +1,25 @@
 .PHONY: all clean install uninstall
 
+DESTDIR =
+WFLAGS = -ansi -pedantic -Wall -Wextra
+OFLAGS = -O3
+CXXFLAGS = $(WFLAGS) $(OFLAGS) -shared -fPIC -O3
+CXXFLAGS += $$(gimptool-2.0 --cflags) $(RPM_OPT_FLAGS)
+LDFLAGS = $$(gimptool-2.0 --libs)
+PLUGIN_DIR = $$(gimptool-2.0 --gimpplugindir)/modules/
+
 all: libcolor-selector-lch.so
 
 clean:
 	rm -f libcolor-selector-lch.so
 
 install: libcolor-selector-lch.so
-	install libcolor-selector-lch.so $$(gimptool-2.0 --gimpplugindir)/modules/
+	install -d $(DESTDIR)$(PLUGIN_DIR)
+	install -m755 libcolor-selector-lch.so $(DESTDIR)$(PLUGIN_DIR)
 
 uninstall:
-	rm $$(gimptool-2.0 --gimpplugindir)/modules/libcolor-selector-lch.so
+	rm $(DESTDIR)$(PLUGIN_DIR)/libcolor-selector-lch.so
 
 
 libcolor-selector-lch.so: main.cpp selector-lch.hpp color-space.hpp
-	$(CXX) \
-		-ansi -pedantic -Wall -Wextra \
-		-shared -fPIC -O3 \
-		-o libcolor-selector-lch.so main.cpp \
-		$$(gimptool-2.0 --cflags --libs)
+	$(CXX) $(CXXFLAGS) -o libcolor-selector-lch.so main.cpp $(LDFLAGS)