install-data-hook:
	@test -z "`echo $(SELECTED_MANPAGES)`" || \
	for file in $(SELECTED_MANPAGES); do \
		lang=`echo $$file |  sed -e 's/^[^.]*\.//'`; \
		if test $$lang = 1; then \
			echo " $(mkinstalldirs) $(DESTDIR)$(mandir)/man1" ; \
			$(mkinstalldirs) $(DESTDIR)$(mandir)/man1 ; \
			if test -f $(srcdir)/$$file; then name=$(srcdir)/$$file; \
			else name=$$file; fi; \
			inst=`echo $$file | sed -e "s/\.1//" -e '$(transform)'`.1 ; \
			echo " $(INSTALL_DATA) $$name $(DESTDIR)$(mandir)/man1/$$inst" ; \
			$(INSTALL_DATA) $$name $(DESTDIR)$(mandir)/man1/$$inst ; \
		else \
			locale=`echo $$lang | sed -e 's/\..*//'` ; \
			echo " $(mkinstalldirs) $(DESTDIR)$(mandir)/$$locale/man1" ; \
			$(mkinstalldirs) $(DESTDIR)$(mandir)/$$locale/man1 ; \
			if test -f $(srcdir)/$$file; then name=$(srcdir)/$$file; \
			else name=$$file; fi; \
			inst=`echo $$file | sed -e "s/\.$${locale}\.1//" -e '$(transform)'`.1 ; \
			echo " $(INSTALL_DATA) $$name $(DESTDIR)$(mandir)/$$locale/man1/$$inst" ; \
			$(INSTALL_DATA) $$name $(DESTDIR)$(mandir)/$$locale/man1/$$inst ; \
		fi; \
	done

uninstall-hook:
	@test -z "`echo $(SELECTED_MANPAGES)`" || \
	for file in $(SELECTED_MANPAGES); do \
		lang=`echo $$file |  sed -e 's/^[^.]*\.//'`; \
		if test $$lang = 1; then \
			inst=`echo $$file | sed -e "s/\.1//" -e '$(transform)'`.1 ; \
			rm -f $(DESTDIR)$(mandir)/man1/$$inst ; \
		else \
			locale=`echo $$lang | sed -e 's/\..*//'` ; \
			inst=`echo $$file | sed -e "s/\.$${locale}\.1//" -e '$(transform)'`.1 ; \
			rm -f $(DESTDIR)$(mandir)/$$locale/man1/$$inst ; \
		fi; \
	done
