*** ./rules.orig Sun Jun 11 02:52:51 2006 --- ./rules Sun Jun 11 02:52:51 2006 *************** *** 70,75 **** # GMT wrapper does not help in /usr/lib/gmt/bin (not in path by default) ! # So: Move it to /usr/bin ! mv $(DESTDIR)/usr/lib/gmt/bin/GMT $(DESTDIR)/usr/bin/ # Move the manpages directory to the right place... --- 70,94 ---- # GMT wrapper does not help in /usr/lib/gmt/bin (not in path by default) ! # Other commands feel better also if installed in /usr/bin, so ! # while we are at it, we move everything to /usr/bin and provide a ! # symlink from /usr/lib/gmt/bin to /usr/bin, so that GMT is still happy. ! # In fact we will create the symlink in postinst because dpkg won't ! # accept to change a directory to a symlink. ! # ! # We also change the GMT wrapper so that it execs /usr/bin/toto instead ! # of /usr/lib/gmt/bin/toto. The latter would work since we install a ! # symlink, but the former is more efficient as it does not read the ! # symlink that, precisely, goes back to /usr/bin ! # ! # We could think, that since we patch the GMT wrapper, the symlink is ! # not really needed any more. ! # But I prefer to keep it, just in case some thing somewhere uses ! # /usr/lib/gmt as a base and assumes that the binary should then be ! # at /usr/lib/gmt/bin. Call this fear, uncertainty, or compatibility or ! # caution. ! # OK, after all these deep thoughts, let's do it : ! sed -e 's,$$/usr/lib/gmt/bin,/usr/bin,' $(DESTDIR)/usr/lib/gmt/bin/GMT >$(DESTDIR)/usr/bin/GMT && chmod 755 $(DESTDIR)/usr/bin/GMT && rm $(DESTDIR)/usr/lib/gmt/bin/GMT ! mv $(DESTDIR)/usr/lib/gmt/bin/* $(DESTDIR)/usr/bin/ && \ ! rmdir $(DESTDIR)/usr/lib/gmt/bin # Move the manpages directory to the right place... *** ./gmt.install.orig Sun Jun 11 02:52:51 2006 --- ./gmt.install Sun Jun 11 02:52:51 2006 *************** *** 1,4 **** usr/bin - usr/lib/gmt/bin usr/lib/gmt/lib usr/include --- 1,3 ---- *** ./gmt.postinst.orig Sun Jun 11 02:52:52 2006 --- ./gmt.postinst Sun Jun 11 02:52:52 2006 *************** *** 0 **** --- 1,23 ---- + #! /bin/sh + + test configure = "$1" || exit 0 + test -L /usr/lib/gmt/bin && exit 0 + rmdir /usr/lib/gmt/bin 2>/dev/null + test -d /usr/lib/gmt/bin && { + cat >&2 <<-! + You did install things of yours in /usr/lib/gmt/bin + You have to remove your files from there in order to complete + the installation of this gmt upgrade. + + After you have removed your files, please run + dpkg --pending --configure + To complete the upgrade. + + After the upgrade is complete, you may put your files there + back. Be warned that /usr/lib/gmt/bin will be a symlink to + /usr/bin . + ! + exit 1 + } + : + ln -s ../../bin /usr/lib/gmt/bin *** ./gmt.prerm.orig Sun Jun 11 02:53:45 2006 --- ./gmt.prerm Sun Jun 11 02:58:43 2006 *************** *** 0 **** --- 1,9 ---- + #! /bin/sh + + test remove = "$1" || exit 0 + test -e /usr/lib/gmt/bin || exit 0 + test -L /usr/lib/gmt/bin && { + rm -f /usr/lib/gmt/bin + exit 0 + } + false