Control: tag -1 patch

The attached patch allowed me to build xnee.

Regards.
Description: Override overly strict ImageMagick default security policy (#987504)
 This derives a more permissive policy from the system default policy.
 .
 XDG_CONFIG_HOME is only set for invocations of convert instead of
 globally to minimize inadvertent side-effects.
Author: Dennis Filder <d.fil...@web.de>
Last-Update: 2021-07-16
Bug-Debian: https://bugs.debian.org/991068
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -15,6 +15,8 @@
 #	$(MANUALS)
 
 
+POLFILE = "/etc/$(shell convert -version|sed -n '/^Version: /s@Version: ImageMagick \([[:digit:]]\+\)\..*@ImageMagick-\1@p')/policy.xml"
+
 if BUILDDOC
 DOC_DEP=$(GEN_IMAGES_TO_INSTALL) $(MANUALS)
 doc_DATA = $(MANUALS) $(GEN_IMAGES_TO_INSTALL)
@@ -93,18 +95,24 @@
 
 %.png: %.eps
 	@echo "creating PNG"
-	$(CONVERT) -density 144x144 $< $@ 
+	mkdir -p debian/tmp/ImageMagick
+	sed -e '/<policy domain="coder" rights="none" pattern="\(PDF\|PS\)" .>/s@"none"@"read|write"@' "$(POLFILE)" > debian/tmp/ImageMagick/policy.xml
+	XDG_CONFIG_HOME="$(shell pwd)/debian/tmp" $(CONVERT) -density 144x144 $< $@
 	( mv $@ `echo $@ | sed 's,\.png,_big\.png,g'` )
-	$(CONVERT) -density 32x32 $< $@ 
+	XDG_CONFIG_HOME="$(shell pwd)/debian/tmp" $(CONVERT) -density 32x32 $< $@
 	( mv $@ `echo $@ | sed 's,\.png,_small\.png,g'` )
-	$(CONVERT) -density 60x60 $< $@ 
+	XDG_CONFIG_HOME="$(shell pwd)/debian/tmp" $(CONVERT) -density 60x60 $< $@
+	rm -Rf debian/tmp/ImageMagick
 %.jpg: %.eps
 	echo "creating JPG"
-	$(CONVERT) -density 144x144 $< $@ 
+	mkdir -p debian/tmp/ImageMagick
+	sed -e '/<policy domain="coder" rights="none" pattern="\(PDF\|PS\)" .>/s@"none"@"read|write"@' "$(POLFILE)" > debian/tmp/ImageMagick/policy.xml
+	XDG_CONFIG_HOME="$(shell pwd)/debian/tmp" $(CONVERT) -density 144x144 $< $@
 	( mv $@ `echo $@ | sed 's,\.jpg,_big\.jpg,g'` )
-	$(CONVERT) -density 32x32 $< $@ 
+	XDG_CONFIG_HOME="$(shell pwd)/debian/tmp" $(CONVERT) -density 32x32 $< $@
 	( mv $@ `echo $@ | sed 's,\.jpg,_small\.jpg,g'` )
-	$(CONVERT) -density 60x60 $< $@ 
+	XDG_CONFIG_HOME="$(shell pwd)/debian/tmp" $(CONVERT) -density 60x60 $< $@
+	rm -Rf debian/tmp/ImageMagick
 
 
 ${IMG_EPS}: ${IMG_DIA}

Reply via email to