Bug 438043 - Review Request: GMT - Generic Mapping Tools
Review Request: GMT - Generic Mapping Tools
Status: CLOSED NEXTRELEASE
Product: Fedora
Classification: Fedora
Component: Package Review (Show other bugs)
rawhide
All Linux
medium Severity medium
: ---
: ---
Assigned To: Patrice Dumas
Fedora Extras Quality Assurance
:
Depends On: 438039
Blocks: 444625
  Show dependency treegraph
 
Reported: 2008-03-18 15:38 EDT by Orion Poplawski
Modified: 2008-05-20 16:41 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-05-20 16:41:56 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
pertusus: fedora‑review+
kevin: fedora‑cvs+


Attachments (Terms of Use)

  None (edit)
Description Orion Poplawski 2008-03-18 15:38:13 EDT
Spec URL: http://www.cora.nwra.com/~orion/fedora/GMT.spec
SRPM URL: http://www.cora.nwra.com/~orion/fedora/GMT-4.2.1-1.fc8.src.rpm
Description:
GMT is an open source collection of ~60 tools for manipulating geographic and
Cartesian data sets (including filtering, trend fitting, gridding, projecting,
etc.) and producing Encapsulated PostScript File (EPS) illustrations ranging
from simple x-y plots via contour maps to artificially illuminated surfaces
and 3-D perspective views.  GMT supports ~30 map projections and transforma-
tions and comes with support data such as coastlines, rivers, and political
boundaries.

GMT is developed and maintained by Paul Wessel and Walter H. F.  Smith with
help from a global set of volunteers, and is supported by the National
Science Foundation.
Comment 1 Patrice Dumas 2008-03-18 16:54:00 EDT
I did a gmt package too. It is there:

http://www.environnement.ens.fr/perso/dumas/fc-srpms/gmt-4.2.1-1.fc8.src.rpm
http://www.environnement.ens.fr/perso/dumas/fc-srpms/gmt-data-4.2-1.src.rpm

I stuffed all the resolutions in one package.
The version of the data should certainly be 1.9.1 (like you do), it is 
4.2 in my gmt-data package because it was derived from the preceding one.

Also I don't remember why I choosed lower case package name, in any case
it is like mandriva and debian packages.
Comment 2 Orion Poplawski 2008-03-18 22:38:31 EDT
Thanks Patrice.

I don't have a good sense about splitting the data or not.  How many people
would only want one set?  I suppose by today's standards they are not crazy big.
 I think I'll ping the gmt-help list about it, maybe get some more opinions on
how the package should be split up (which is the other area our packages diverge).

Seems like the package name should be uppercase, but it should also provide
"gmt" as well I think.

Comment 3 Orion Poplawski 2008-03-24 18:44:36 EDT
* Mon Mar 24 2008 Orion Poplawski <orion@cora.nwra.com> 4.2.1-2
- Drop -doc sub-package, will have separate -docs package
- Add lower case name provides
- Build Octave files

Spec URL: http://www.cora.nwra.com/~orion/fedora/GMT.spec
SRPM URL: http://www.cora.nwra.com/~orion/fedora/GMT-4.2.1-2.fc8.src.rpm
Comment 4 Patrice Dumas 2008-04-28 18:33:11 EDT
Could it be possible to have the doc package submitted in parallel?

I agree that it is a good idea to have a separate doc package,
to have a noarch package.

You should look at my package for the removal of a non-free
file.

I find the octave patch a bit strange, since it uses matlab 
support. Could it be possible to have it additionally, such that
it can be submitted upstream?

Your octave packaging is not the same than the one proposed at:
http://fedoraproject.org/wiki/PackagingDrafts/Octave
but at that page there are mistakes.

There is no soname in the shared libs. Do you really want to 
ship them? I think it is very wrong.

The octave define at the beginning should be ameliorated, I get,
without octave-devel:
$ rpmbuild -ba GMT.spec 
sh: octave-config: command not found
sh: octave-config: command not found
sh: octave-config: command not found
sh: octave-config: command not found
sh: octave-config: command not found
sh: octave-config: command not found
sh: octave-config: command not found
error: Failed build dependencies:
        octave-devel is needed by GMT-4.2.1-2.i386

I propose to have xgridedit in a separate package, to avoid depending
on the X libs.

less is detected at build time and used in the GMT script at runtime.

There are many config files in %_datadir that cannot be overriden by
the user. They should be in %_sysconfdir and marked %config(noreplace).
The coresponding code in my spec is:

%define gmthome %{_datadir}/GMT
%define gmtconf %{_sysconfdir}/GMT

mkdir -p $RPM_BUILD_ROOT%{gmtconf}/{mgg,dbase,mgd77,conf}
pushd $RPM_BUILD_ROOT%{gmthome}/
# remove unneeded file
rm conf/gmt.conf.orig
# put conf files in %{gmtconf} and do links in %{gmthome}
for file in conf/*.conf mgg/gmtfile_paths dbase/grdraster.info \
    mgd77/mgd77_paths.txt; do
  mv $file $RPM_BUILD_ROOT%{gmtconf}/$file
# absolute links
#  ln -s %{gmtconf}/$file $RPM_BUILD_ROOT%{gmthome}/$file
# relative link
  ln -s ../../../../../%{gmtconf}/$file $RPM_BUILD_ROOT%{gmthome}/$file
done
popd

%dir %{gmtconf}
%dir %{gmtconf}/mgg
%dir %{gmtconf}/dbase
%dir %{gmtconf}/mgd77
%dir %{gmtconf}/conf
%config(noreplace) %{gmtconf}/conf/*.conf
%config(noreplace) %{gmtconf}/mgg/gmtfile_paths
%config(noreplace) %{gmtconf}/dbase/grdraster.info
%config(noreplace) %{gmtconf}/mgd77/mgd77_paths.txt


Also I have a sed substitution to correct the doc path in the GMT
command. The doc path may be different in your package, but you 
could adapt:

-e
's:\${prefix}/www/gmt/gmt_services.html:%{_docdir}/%{name}-%{version}/gmt_services.html:'
src/GMT

I suggest adding INSTALL='install -p' to the make install command to
keep timestamps as much as possible.

Also during install, cp is called as cp -r for installation of data.
I would suggest either substituting cp -r to cp -pr, redoing the install
or doing a patch for the Makefile to keep timestamps. 

I suggest doing in %prep:

chmod a-x src/ps2raster.c src/mgd77/mgd77sniffer.c

pslib is a badly choosed name, it could interfere with other library names.
I did:
# rename the pslib man page
mv $RPM_BUILD_ROOT%{_mandir}/man3/pslib.3 $RPM_BUILD_ROOT%{_mandir}/man3/GMT_pslib.3

The examples should certainly be %doc, even if they are in a separate
package, since they are really %doc, and we don't want them to be
installed if docs are excluded.

The html docs should be in the main package, they are very small.

The src/*/README.* should also be in %doc.

I think that it would be better to have a %dist tag.

I think that the examples should have a
Requires:       %{name} = %{version}-%{release}
such that there cannot be any mismatch which could cause the examples
to fail.

I propose adding to main package
%doc gmt_bench-marks
Comment 5 Orion Poplawski 2008-04-29 13:30:12 EDT
(In reply to comment #4)
> Could it be possible to have the doc package submitted in parallel?

GMT-docs package review is bug 444625

> You should look at my package for the removal of a non-free
> file.

Added.  Upstream has committed to releasing a "free source" version next release.
 
> I find the octave patch a bit strange, since it uses matlab 
> support. Could it be possible to have it additionally, such that
> it can be submitted upstream?

I mentioned it upstream, but I think upstream needs to move to using autotools
(or cmake or similar) in the src/mex directory first to allow for build time
configuration.

> Your octave packaging is not the same than the one proposed at:
> http://fedoraproject.org/wiki/PackagingDrafts/Octave
> but at that page there are mistakes.

Yeah, but this is not a "real" octave package.
  
> There is no soname in the shared libs. Do you really want to 
> ship them? I think it is very wrong.

I've added a patch to use .0 soname.  Thoughts?  I've mentioned the issue
upstream, but it seems a bit above their heads.
 
> The octave define at the beginning should be ameliorated, I get,
> without octave-devel:
> $ rpmbuild -ba GMT.spec 
> sh: octave-config: command not found
> sh: octave-config: command not found
> sh: octave-config: command not found
> sh: octave-config: command not found
> sh: octave-config: command not found
> sh: octave-config: command not found
> sh: octave-config: command not found
> error: Failed build dependencies:
>         octave-devel is needed by GMT-4.2.1-2.i386

Redirected stderr to /dev/null.

> I propose to have xgridedit in a separate package, to avoid depending
> on the X libs.

Okay.

> less is detected at build time and used in the GMT script at runtime.

Fixed
 
> There are many config files in %_datadir that cannot be overriden by
> the user. They should be in %_sysconfdir and marked %config(noreplace).

Added.

> 
> Also I have a sed substitution to correct the doc path in the GMT
> command.

Added.

> I suggest adding INSTALL='install -p' to the make install command to
> keep timestamps as much as possible.

Done.

> Also during install, cp is called as cp -r for installation of data.
> I would suggest either substituting cp -r to cp -pr, redoing the install
> or doing a patch for the Makefile to keep timestamps. 

Added patch

> I suggest doing in %prep:
> 
> chmod a-x src/ps2raster.c src/mgd77/mgd77sniffer.c

Fixed.

> pslib is a badly choosed name, it could interfere with other library names.
> I did:
> # rename the pslib man page
> mv $RPM_BUILD_ROOT%{_mandir}/man3/pslib.3
$RPM_BUILD_ROOT%{_mandir}/man3/GMT_pslib.3

It doesn't conflict at the moment.  Perhaps better to work with upstream to get
it renamed?

> The examples should certainly be %doc, even if they are in a separate
> package, since they are really %doc, and we don't want them to be
> installed if docs are excluded.

Sure.

> The html docs should be in the main package, they are very small.

Done.  I had thought they were duplicates before.

> The src/*/README.* should also be in %doc.
> 
> I think that it would be better to have a %dist tag.

Oversight (from all the other noarch GMT packages).

> I think that the examples should have a
> Requires:       %{name} = %{version}-%{release}
> such that there cannot be any mismatch which could cause the examples
> to fail.

Fixed.

> I propose adding to main package
> %doc gmt_bench-marks

added

Spec URL: http://www.cora.nwra.com/~orion/fedora/GMT.spec
SRPM URL: http://www.cora.nwra.com/~orion/fedora/GMT-4.2.1-3.fc9.src.rpm

* Tue Apr 28 2008 Orion Poplawski <orion@cora.nwra.com> 4.2.1-3
- Remove unfree source
- Split out xgridedit into sub-package
- Add BR and R on less
- Redirect octave-config stderr to /dev/null
- Move config files to /etc/GMT
- Use install -c -p to preserve timestamps
- Use cp -pr to copy share data
- Add sonames to shared libraries
Comment 6 Patrice Dumas 2008-04-29 18:36:44 EDT
(In reply to comment #5)

> > There is no soname in the shared libs. Do you really want to 
> > ship them? I think it is very wrong.
> 
> I've added a patch to use .0 soname.  Thoughts?  I've mentioned the issue
> upstream, but it seems a bit above their heads.

I think that it is a bad idea, I explained why on 'On not shipping shared
libraries when upstream doesn't' (though it is not exactly the same issue,
the same apply)
http://fedoraproject.org/wiki/PatriceDumas
Comment 7 Patrice Dumas 2008-04-29 19:14:36 EDT
I think that you don't need
-e 's:-%{_datadir} :-%{gmthome} :' \
 -e 's:\(shared data.*\)%{_datadir}:\1%{gmthome}:' \
since you have (rightly, in my opinion) set --datadir=%{gmthome}.

Putting the README.* in src seems a bit dangerous to work with
--short-circuit, and also I don't really like putting stuff in 
source packages, that's why I prefer putting them in a
specific directory with a specific name like __distribution_docs.

%doc www/gmt/doc/html
is still in examples too.
Comment 8 Patrice Dumas 2008-05-03 15:22:47 EDT
There is a new upstream release. 

Also I will be a week off for vacations.
Comment 9 Orion Poplawski 2008-05-06 13:40:55 EDT
Thanks for the comments

* Tue May 6 2008 Orion Poplawski <orion@cora.nwra.com> 4.3.0-1
- Update to 4.3.0, drop many upsreamed patches
- Add patch to install octave files in DESTDIR
- Add patch to fix segfaults due to uninitialized memory
- Add patch to fix a possible buffer overflow warning
- Remove duplicate html directory from examples package
- Create __package_docs directory for main package docs

Spec URL: http://www.cora.nwra.com/~orion/fedora/GMT.spec
SRPM URL: http://www.cora.nwra.com/~orion/fedora/GMT-4.3.0-1.fc9.src.rpm
Comment 10 Patrice Dumas 2008-05-12 14:11:14 EDT
ldconfig call should be in %post, not %pre.

There is a \ missing on the find $RPM_BUILD_ROOT/%{gmthome}/examples -name
\*.\*sh | line

Also you could consider removing the .bat files in examples, rpmlint
says:
GMT-examples.i386: W: wrong-file-end-of-line-encoding
/usr/share/GMT/examples/ex03/job03.bat

There are .in files remaining in 
/usr/share/GMT/conf/.gmtdefaults_SI.in
/usr/share/GMT/conf/.gmtdefaults_US.in
/usr/share/GMT/conf/gmt.conf.in
I think they should be removed. You could also consider using the 
timestamps of the .in files to have consistent timestamps across arches
for the files in /etc/GMT/

Also maybe the .gmtdefaults_SI and .gmtdefaults_US could be considered 
as documentation and linked like other config files in /etc/GMT and as
%config.

Another issue revealed by rpmlint is 
GMT-examples.i386: W: doc-file-dependency /usr/share/GMT/examples/ex26/job26.csh
/bin/csh
Maybe the .csh files could be made non executable, and only the 
sh files would be executable?

There is also
GMT-octave.i386: E: script-without-shebang
/usr/share/octave/site/api-v32/m/grdinfo.m
GMT-octave.i386: E: script-without-shebang
/usr/share/octave/site/api-v32/m/grdwrite.m
GMT-octave.i386: E: script-without-shebang
/usr/share/octave/site/api-v32/m/grdread.m
because these files have the execute bit set. You should correct it
if it is wrong.

A last remaining issue is the soname issue. Any comment on that?
Comment 11 Orion Poplawski 2008-05-12 15:55:50 EDT
(In reply to comment #10)
> ldconfig call should be in %post, not %pre.

Gah, fixed.

> There is a \ missing on the find $RPM_BUILD_ROOT/%{gmthome}/examples -name
> \*.\*sh | line

Not needed - the | works.

> Also you could consider removing the .bat files in examples, rpmlint
> says:
> GMT-examples.i386: W: wrong-file-end-of-line-encoding
> /usr/share/GMT/examples/ex03/job03.bat

Removed.

> There are .in files remaining in 
> /usr/share/GMT/conf/.gmtdefaults_SI.in
> /usr/share/GMT/conf/.gmtdefaults_US.in
> /usr/share/GMT/conf/gmt.conf.in
> I think they should be removed. You could also consider using the 
> timestamps of the .in files to have consistent timestamps across arches
> for the files in /etc/GMT/

Removed, but I really don't see the need to fix timestamps.

> Also maybe the .gmtdefaults_SI and .gmtdefaults_US could be considered 
> as documentation and linked like other config files in /etc/GMT and as
> %config.

Done.

> Another issue revealed by rpmlint is 
> GMT-examples.i386: W: doc-file-dependency /usr/share/GMT/examples/ex26/job26.csh
> /bin/csh
> Maybe the .csh files could be made non executable, and only the 
> sh files would be executable?

Done.

> There is also
> GMT-octave.i386: E: script-without-shebang
> /usr/share/octave/site/api-v32/m/grdinfo.m
> GMT-octave.i386: E: script-without-shebang
> /usr/share/octave/site/api-v32/m/grdwrite.m
> GMT-octave.i386: E: script-without-shebang
> /usr/share/octave/site/api-v32/m/grdread.m
> because these files have the execute bit set. You should correct it
> if it is wrong.

Fixed.

> A last remaining issue is the soname issue. Any comment on that?

Upstream now ships with sonames.

* Mon May 12 2008 Orion Poplawski <orion@cora.nwra.com> 4.3.0-2
- Add patch to link libraries properly
- Run ldconfig in %%post, dummy
- Don't ship .bat file
- Don't ship .in files
- Don't make .csh examples executable
- Drop execute bit on .m files

Spec URL: http://www.cora.nwra.com/~orion/fedora/GMT.spec
SRPM URL: http://www.cora.nwra.com/~orion/fedora/GMT-4.3.0-2.fc9.src.rpm

Comment 12 Patrice Dumas 2008-05-12 16:51:24 EDT
* free software, license included
* follow guidelines
* rpmlint warnings are not problematic:
GMT.i386: W: hidden-file-or-dir /etc/GMT/conf/.gmtdefaults_US
GMT.i386: W: hidden-file-or-dir /usr/share/GMT/conf/.gmtdefaults_US
GMT.i386: W: hidden-file-or-dir /usr/share/GMT/conf/.gmtdefaults_SI
GMT.i386: W: hidden-file-or-dir /etc/GMT/conf/.gmtdefaults_SI
GMT-octave.i386: W: no-documentation
GMT-static.i386: W: no-documentation
* match upstream
41a3c25bf74a151e423f6821dcc2fa25  GMT4.3.0_scripts.tar.bz2
a7ce8c0fa2bd85131dfc8b67d8fe8235  GMT4.3.0_share.tar.bz2
2890ee76b44cc32ee41d54eda425b212  GMT4.3.0_src.tar.bz2
362438041a80570db1842524370c76e1  GMT4.3.0_suppl.tar.bz2
* %files section right

APPROVED

The fact that upstream used a soname with the same number than the
release is a bit frightening, and I think you'll have to be very
careful to check what upstream does.
Comment 13 Orion Poplawski 2008-05-12 17:15:06 EDT
New Package CVS Request
=======================
Package Name: GMT
Short Description: Generic Mapping Tools
Owners: orion
Branches: F-9 F-8 F-7 EL-5 EL-4
InitialCC: 
Cvsextras Commits: yes
Comment 14 Kevin Fenzi 2008-05-13 13:04:07 EDT
cvs done.
Comment 15 Orion Poplawski 2008-05-20 16:41:56 EDT
Checked in and built for rawhide.  Working on earlier releases...

Note You need to log in before you can comment on or make changes to this bug.