Description: Move language plugins to a different directory.
 In order to prevent conflicts and to ease packaging (otherwise you have to
 use a dh_install line in debian/rules for every package and an additional
 -X n libradare2), move the installation of the plugins to a harmless
 directory where it can be safely ignored by libradare2 and installed by
 radare2-plugins.
 This is Debian-only.
Author: David Martínez Moreno <ender@debian.org>
Forwarded: not-needed
Last-Update: 2013-12-30

--- a/libr/Makefile
+++ b/libr/Makefile
@@ -119,11 +119,15 @@
 	  echo " ${LFX}/$$a"; ${INSTALL_DATA} $$a ${LFX} ; done
 	# plugins
 	@${INSTALL_DIR} ${LFX}/radare2/${VERSION}
-	@for a in `find */p -perm -u+x -type f | grep -v exe | grep -v dll | grep ${EXT_SO}`; \
+	@for a in `find */p -perm -u+x -type f | grep -v exe | grep -v dll | grep -v lang/p/ | grep ${EXT_SO}`; \
 	  do echo " ${LFX}/radare2/${VERSION}/$$a"; \
 	${INSTALL_DATA} $$a ${LFX}/radare2/${VERSION} ; done
-	@echo "lang/p/radare.* ${DESTDIR}/${PFX}/${LIBDIR}/radare2/${VERSION}"
-	${INSTALL_DATA} lang/p/radare.* ${LFX}/radare2/${VERSION}
+	mkdir -p ${LFX}/r2-plugins/${VERSION}
+	@for a in `find lang/p -perm -u+x -type f | grep -v exe | grep -v dll | grep ${EXT_SO}`; \
+		do echo " Diverting language plugins in Debian packaging: ${LFX}/r2-plugins/${VERSION}/$$a"; \
+	${INSTALL_DATA} $$a ${LFX}/r2-plugins/${VERSION} ; done
+	@echo "lang/p/radare.* ${LFX}/r2-plugins/${VERSION}"
+	${INSTALL_DATA} lang/p/radare.* ${LFX}/r2-plugins/${VERSION}
 	cd ${LFX}/radare2 ; ln -fs ${VERSION} last
 
 deinstall uninstall:
