On Fri, 3 Jul 2009, Juergen Daubert wrote:
-# move devel files from $(libdir) to $(usrlibexecdir) if needed +# move lib from $(usrlibexecdir) to $(libdir) if needed install-data-hook: - rm $(DESTDIR)$(libdir)/$(lib_LTLIBRARIES) if test "$(usrlibexecdir)" != "$(libdir)"; then \ - mkdir -p $(DESTDIR)$(usrlibexecdir); \ - mv $(DESTDIR)$(libdir)/libblkid.a $(DESTDIR)$(usrlibexecdir)/; \ - so_img_name=$$(readlink $(DESTDIR)$(libdir)/libblkid.so); \ - rm $(DESTDIR)$(libdir)/libblkid.so; \ + mkdir -p $(DESTDIR)$(libdir); \ + so_img_name=$$(readlink $(DESTDIR)$(usrlibexecdir)/libblkid.so); \ so_img_rel_target=$$(echo $(usrlibexecdir) | sed 's,\(^/\|\)[^/][^/]*,..,g'); \ - ln -sf $$so_img_rel_target$(libdir)/$$so_img_name \ - $(DESTDIR)$(usrlibexecdir)/libblkid.so; \ + ln -sf $$so_img_rel_target$(libdir)/$$so_img_name $(DESTDIR)$(usrlibexecdir)/libblkid.so; \ + mv $(DESTDIR)$(usrlibexecdir)/libblkid.so.* $(DESTDIR)$(libdir); \ fi
Two objections: (1) This belongs to install-exec-hook instead of install-data-hook because *_LTLIBRARIES are installed as part of install-exec. (2) You probably should use $(LN_S) instead of 'ln -sf' and create symlinks from within the target directory (too many things can go wrong otherwise). The Automake manual recommends something like: (cd $(DESTDIR)$(usrlibexecdir) && \ rm -f libblkid.so && \ $(LN_S) $$so_img_rel_target$(libdir)/$$so_img_name libblkid.so) && \ mv $(DESTDIR)$(usrlibexecdir)/libblkid.so.* $(DESTDIR)$(libdir); \ The use of CMD && CMD should propagate errors. Regards Peter -- To unsubscribe from this list: send the line "unsubscribe util-linux-ng" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html