Now, the fact that GMT is not FHS compliant is a bad news for a package
maintainer, but, IHMO should not have any consequences for users.
I made a patch (directly in the 'debian' directory) that solves this
problem. it justs move files from /usr/lib/gmt/bin to /usr/bin .
To be very compatible and cautious, I kept /usr/lib/gmt/bin , but it
is now a symlink to /usr/bin.
I had to add a prerm and a postinst because, dpkg won't allow a
directory to suddenly become a symlink.
I did some testing :
1) Run the examples contained in the gmt-examples
package. They were all successful. So it runs with the files in
/usr/bin.
2) package management
Upgrade the package from the actual version, to the patched version : no problem.
installed more than once the patched packaged without deinstalling : no problem
purge the package : no problem
install again : no problem
run lintian : two more diagnostic than with the non patched package :
W: gmt: binary-without-manpage gshhs
W: gmt: binary-without-manpage gshhs_dp
This is simply because the files are now in /usr/bin and lintian
can catch them.
So I really hope that you will give my patch a try.
Christophe Martin.
*** ./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
Good evening,
I hope you realise, that this breaks not only old scripts but also
long years of habits, and you do force users to do things your way.
If things were installed in /usr/bin as they've always been, users
can have their work done either way : 'GMT command' or 'command'
I may add that if you take a look at the example on the GMT site, you gmt.soest. hawaii. edu/gmt/ examples/ ex01/gmt_ example_ 01.html
will see that they do not use "GMT tralala" syntax. for example :
http://
Now, the fact that GMT is not FHS compliant is a bad news for a package
maintainer, but, IHMO should not have any consequences for users.
I made a patch (directly in the 'debian' directory) that solves this
problem. it justs move files from /usr/lib/gmt/bin to /usr/bin .
To be very compatible and cautious, I kept /usr/lib/gmt/bin , but it
is now a symlink to /usr/bin.
I had to add a prerm and a postinst because, dpkg won't allow a
directory to suddenly become a symlink.
I did some testing :
1) Run the examples contained in the gmt-examples
package. They were all successful. So it runs with the files in
/usr/bin.
2) package management without- manpage gshhs without- manpage gshhs_dp
Upgrade the package from the actual version, to the patched version : no problem.
installed more than once the patched packaged without deinstalling : no problem
purge the package : no problem
install again : no problem
run lintian : two more diagnostic than with the non patched package :
W: gmt: binary-
W: gmt: binary-
This is simply because the files are now in /usr/bin and lintian
can catch them.
So I really hope that you will give my patch a try.
Christophe Martin.
*** ./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) /usr/lib/ gmt/bin/ GMT $(DESTDIR)/usr/bin/
! # So: Move it to /usr/bin
! mv $(DESTDIR)
# 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) gmt/bin/ toto. The latter would work since we install a 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 /usr/lib/ gmt/bin/ * $(DESTDIR)/usr/bin/ && \ /usr/lib/ gmt/bin
! # 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/
! # 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/
! mv $(DESTDIR)
! rmdir $(DESTDIR)
# 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