Bug 7932 - opencpn = A concise ChartPlotter and Navigation software
Summary: opencpn = A concise ChartPlotter and Navigation software
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: New RPM package request (show other bugs)
Version: Cauldron
Hardware: All Linux
Priority: Normal enhancement
Target Milestone: ---
Assignee: Philippe Didier
QA Contact:
URL: http://opencpn.org/ocpn/
Whiteboard:
Keywords:
Depends on: 5761
Blocks:
  Show dependency treegraph
 
Reported: 2012-10-30 01:44 CET by Philippe Didier
Modified: 2013-02-01 02:35 CET (History)
1 user (show)

See Also:
Source RPM:
CVE:
Status comment:


Attachments
spec file for OpenCPN (1.79 KB, text/x-rpm-spec)
2012-10-30 01:44 CET, Philippe Didier
Details
spec file for opencpn (1.79 KB, text/x-rpm-spec)
2012-10-30 22:28 CET, Philippe Didier
Details
little modifications to the previous spec file (1.49 KB, patch)
2012-12-04 00:40 CET, Philippe Didier
Details | Diff
patch to get more standard desktop file (264 bytes, patch)
2012-12-04 02:35 CET, Philippe Didier
Details | Diff
little modifications to the previous spec file (1.56 KB, patch)
2012-12-04 02:36 CET, Philippe Didier
Details | Diff
little modifications to the previous spec file (1.62 KB, patch)
2012-12-04 03:43 CET, Philippe Didier
Details | Diff
advice for packagers (729 bytes, text/plain)
2012-12-04 21:41 CET, Philippe Didier
Details
cumulated modifications to the initial spec file (2.03 KB, patch)
2012-12-04 22:00 CET, Philippe Didier
Details | Diff
a spec file including the logbook plugin (3.02 KB, text/plain)
2012-12-04 22:48 CET, Philippe Didier
Details
a script to download the git source and compress it (913 bytes, text/plain)
2012-12-04 22:49 CET, Philippe Didier
Details
cumulated modifications to the initial spec file (without log book plugin) (1.98 KB, text/plain)
2012-12-06 12:18 CET, Philippe Didier
Details
a script to download the git source and compress it (757 bytes, text/plain)
2012-12-06 12:19 CET, Philippe Didier
Details
a spec file including the logbook plugin (3.02 KB, text/plain)
2012-12-06 12:21 CET, Philippe Didier
Details
a spec file including the logbook plugin splitted two rpms (4.06 KB, text/plain)
2012-12-07 03:06 CET, Philippe Didier
Details
renamed advice for packagers (729 bytes, text/plain)
2012-12-07 19:14 CET, Philippe Didier
Details
corrected spec file, bringing the logbook plugin, splitted in two rpms (4.20 KB, text/plain)
2012-12-07 19:21 CET, Philippe Didier
Details

Description Philippe Didier 2012-10-30 01:44:38 CET
Created attachment 3013 [details]
spec file for OpenCPN

OpenCPN 1.3.6 was provided by Mandriva 2010.1...
built upon a spec file that I proposed and that Funda Wang improved.

it's perhaps the only GPL navigation software for linux we can use ship-borne !

It can display raster charts (BSB) or non crypted vector charts (free S57 or CM93-ED2-2002, or CM93-rev-2009 for their happy owners).... for crypted vector charts (S63) it can only work on Windows (the keys work only on one Windows System....)

NB for Free software integrists : there is absolutely not any GPL useable marine navigation chart... (like openstreetmap for car GPS system)
Nevertheless some free (as beer) S57 vector charts exist from NOAA (National Oceanic and Atmospheric Administration of the USA) and from some other countries. 


This software as been actively developed since version 1.3.6
A new version 3.0.2 exists since july 2012.

It now needs not any patch, nor added desktop file... so the spec file is quite simple...
A previous version (3.0.0) seemed to have problem with tinyxml-devel packages from some distributions and opencpn needed to use its own bundled headers...
It seems OK with Mageia2 ... feel free to modify the commented line in BuildRequires for Cauldron if needed.

The libgpsd library provided by Mageia2 is the one needed to build and use OpenCPN...

I just add it to be improved by a real packager..

NB I built a package, tested the software with raster or vector charts on my computer...
Maybe some BuildRequires are missing (lot of devel packages are already installed on my Mageia2 ... )
Maybe some Requires miss too

NB the source file takes a long time to be downloaded from the URL provided
in the spec file... you may use the Git repository if you know what to do...
Comment 1 Philippe Didier 2012-10-30 02:06:56 CET
Post scriptum
on sourceforge  http://sourceforge.net/projects/opencpn/files/opencpn/3.0.2/
we can only get deb packages or mac dmg packages or windowsinstaller for the last version 3.0.2... don't know why the source is not downloadable here !!!

the stable source file may be downloaded from here (it's not a beta!!!)
http://opencpn.org/ocpn/downloads/beta/OpenCPN-3.0.2-Source.tar.gz

You may use too
git clone -b stable https://github.com/OpenCPN/OpenCPN.git

URL: (none) => http://opencpn.org/ocpn/

Comment 2 Philippe Didier 2012-10-30 22:28:29 CET
Created attachment 3018 [details]
spec file for opencpn

typo corrected :
 BuildRequires : libfreetype6-devel 
instead of simply freetype-devel

Attachment 3013 is obsolete: 0 => 1

Comment 3 Barry Jackson 2012-12-03 23:05:53 CET
Hi Philippe
/OT changes pushed OK in ardour3 thanks.

OK this builds in Cauldron, both arch, however can you please look at the following in the spec:-
1. The .desktop file fails to validate (desktop-file-validate to check)
2. The package name should not be repeated in the Summary (although it may in the description)
3. Define a tarname 'OpenCPN' and use it to replace any strings.

4. These are OK
BuildRequires:	pkgconfig(libgps)
BuildRequires:	pkgconfig(gtk+-2.0)
BuildRequires:	pkgconfig(gl)
BuildRequires:	pkgconfig(glu)
BuildRequires:	pkgconfig(zlib)
BuildRequires:	pkgconfig(freetype2)

There is no issue with tinyxml so you can remove the comments.

Attach a patch and I'll commit it.

CC: (none) => zen25000
Assignee: bugsquad => philippedidier

Comment 4 Barry Jackson 2012-12-03 23:11:34 CET
Oh, I forgot, gpsd-clients
                         ^
Comment 5 Philippe Didier 2012-12-04 00:40:53 CET
Created attachment 3189 [details]
little modifications to the previous spec file

Hi Barry !

Here some modifications to the previous spec file

modified BR (using pkgconfig)
added BR gettext
corrected typo in Requires gpsd-clients

NB
I did run desktop-file-validate and got no warning for Mageia2 ?!
Comment 6 Barry Jackson 2012-12-04 01:09:32 CET
[baz@jackodesktop applications]$ desktop-file-validate opencpn.desktop
opencpn.desktop: hint: value "Education;Science;Geography;" for key "Categories" in group "Desktop Entry" contains more than one main category; application might appear more than once in the application menu

Better to do it this way as version is already defined:
%define tarname OpenCPN
...
Source0: http://%{name}.org/ocpn/downloads/beta/%{tarname}-%{version}.tar.gz
...
%setup -q -n %{tarname}-%{version}-Source

:)
Comment 7 Philippe Didier 2012-12-04 02:35:13 CET
Created attachment 3190 [details]
patch to get more standard desktop file
Comment 8 Philippe Didier 2012-12-04 02:36:00 CET
Created attachment 3191 [details]
little modifications to the previous spec file

Attachment 3189 is obsolete: 0 => 1

Comment 9 Philippe Didier 2012-12-04 03:30:42 CET
I would just a comment for Mageia packagers (I don't know where to write it so that it's read by anybody wanting to update OpenCPN):

ONLY PACKAGE A STABLE VERSION OF OpenCPN
NEVER PROVIDE AN ALPHA OR A BETA OR A RC VERSION .

This software is used to navigate, SAFELY, on the sea, with official charts...

If anybody wants to use a beta, he must know the risks it implies !!! 

Providing a beta version on cauldron is not a good idea : if Mageia3 appears before the next stable version of OpenCPN is published... Mageia3 users will use an unstable version of this software : it may be dangerous !

It's better to wait and provide the next stable version as an update (jumping over the alpha, beta and rc releases)

People wanting to test the beta release must know how to build their own rpm !!! and use it carefully !
Comment 10 Philippe Didier 2012-12-04 03:32:17 CET
Sorry for the typo : I meant

I would just add a comment for Mageia packagers ../..
Comment 11 Philippe Didier 2012-12-04 03:43:00 CET
Created attachment 3192 [details]
little modifications to the previous spec file

Adding an advice that it is not a beta version !

Attachment 3191 is obsolete: 0 => 1

Comment 12 Barry Jackson 2012-12-04 13:03:23 CET
This is Cauldron and one would not expect a serious user to be running Cauldron. Also, once in a stable release then only bug-fix updates are allowed, no new versions. A problem could occur if a bets was in Cauldron when it became stable, so I think on balance it is better to add a warning so no pre-release versions get into the distro.

The best approach IMO would be to simply add your warning as README_packaging.txt as Source1 and then put a note at the top of the spec something like:
## NOTE Please read README_packaging.txt before updating this package.

then remove the 'this is stable...' comment as unnecessary.

If you are using %{tarname} in Source0 then you should also use %{name} see my previous post. ;)

I don't think ChartPlotter is a word, maybe 'Chart Plotter' ?

$ desktop-file-validate opencpn.desktop 
opencpn.desktop: hint: value item "Geography" in key "Categories" in group "Desktop Entry" can be extended with another category among the following categories: Education, or Science
opencpn.desktop: hint: value "Geography;" for key "Categories" in group "Desktop Entry" does not contain a registered main category; application might only show up in a "catch-all" section of the application menu

See:-
http://standards.freedesktop.org/menu-spec/menu-spec-1.0.html#category-registry
Comment 13 Barry Jackson 2012-12-04 13:19:57 CET
I forgot to add - please use desktop-file-install in the spec to make the adjustment to the desktop file rather than a patch:-
https://wiki.mageia.org/en/Packaging_guidelines#desktop-file-install_usage
Comment 14 Philippe Didier 2012-12-04 21:41:21 CET
Created attachment 3193 [details]
advice for packagers
Comment 15 Philippe Didier 2012-12-04 22:00:51 CET
Created attachment 3194 [details]
cumulated modifications to the initial spec file

Hi Barry !

I hope it's not far from being OK now

I will provide an other spec file for this software :
There's a useful plugin including a log book inside OpenCPN, 
this plugin must be built at the same time as OpenCPN.

I don't know if it is better to provide an  OpenCPN rpm  with this plugin bundled... it would be a little tricky to split it into two rpms :
a naked OpenCPN.rpm 
and a OpenCPN-logbook_plugin.rpm

Nevertheless, there's a little problem with this plugin...
A user needs to have an easy access to 2 zip files to adapt its GUI (each user has a his own .opencpn directory where some files are installed, extracted from the zip files)
these zip are provided by the logbook source tar but I don't know where to install them, informing the user where they are

besides this, the source needs a magic script  mk_git_tar

Attachment 3190 is obsolete: 0 => 1
Attachment 3192 is obsolete: 0 => 1

Comment 16 Philippe Didier 2012-12-04 22:48:26 CET
Created attachment 3195 [details]
a spec file including the logbook plugin

Here is the spec file including the logbook
Comment 17 Philippe Didier 2012-12-04 22:49:47 CET
Created attachment 3196 [details]
a script to download the git source and compress it
Comment 18 Philippe Didier 2012-12-04 22:50:30 CET
(In reply to comment #17)
> Created attachment 3196 [details]
> a script to download the git source and compress it

it's for the logbook plugin !
Comment 19 Barry Jackson 2012-12-05 01:07:48 CET
Been busy I see ;)

1. You remove Education then add it back - why?
All you need to do is remove Science:

 desktop-file-install  \
 --dir=%{buildroot}%{_datadir}/applications \
 --remove-category='Science' \
  %{buildroot}%{_datadir}/applications/%{name}.desktop

2. No you can't do this:-
gzip -dc ~/rpm/SOURCES/LogbookKonni_pi.tar.gz | tar -xvf -
Use:-
gzip -dc %{SOURCE1} | tar -xvf -

Which makes me think you are not using bm for build testing?
# urpmi bm
cd opencpn
bm -l

3. You left Option instructions in the script header from my other script which are not in that version - it needs cleaning.

4. Yes %{_datadir}/%{name}/ sounds as good a place as any for those files. They don't contain any pre-built binaries do they?

It builds in Cauldron - not had chance to test yet. Looking good ;)

PS Maybe add both example git download commands to the script header.
Comment 20 Philippe Didier 2012-12-06 12:18:00 CET
Created attachment 3200 [details]
cumulated modifications to the initial spec file (without log book plugin)

Attachment 3194 is obsolete: 0 => 1

Comment 21 Philippe Didier 2012-12-06 12:19:25 CET
Created attachment 3201 [details]
a script to download the git source and compress it

Attachment 3196 is obsolete: 0 => 1

Comment 22 Philippe Didier 2012-12-06 12:21:42 CET
Created attachment 3202 [details]
a spec file including the logbook plugin

Attachment 3195 is obsolete: 0 => 1

Comment 23 Barry Jackson 2012-12-06 12:25:21 CET
Is there any chance that anyone would want this without the plugin? 
If there is then it would make sense to add the plugin as a sub-package so that it can be installed as required.
Comment 24 Philippe Didier 2012-12-06 12:42:52 CET
Mid air collision : I re save the changes

(In reply to comment #19)
> Been busy I see ;)
> 
> 1. You remove Education then add it back - why?
> All you need to do is remove Science:
> 
>  desktop-file-install  \
>  --dir=%{buildroot}%{_datadir}/applications \
>  --remove-category='Science' \
>   %{buildroot}%{_datadir}/applications/%{name}.desktop
> 
I thought the order of the categories was important...
I corrected this in the spec file

> 2. No you can't do this:-
> gzip -dc ~/rpm/SOURCES/LogbookKonni_pi.tar.gz | tar -xvf -
> Use:-
> gzip -dc %{SOURCE1} | tar -xvf -
> 
corrected in the spec file

> Which makes me think you are not using bm for build testing?
> # urpmi bm
> cd opencpn
> bm -l
> 
Indeed I always used to use rpmbuild -ba inside SPECS directory 

> 3. You left Option instructions in the script header from my other script which
> are not in that version - it needs cleaning.
> 
corrected in the mk_git_tar provided

> 4. Yes %{_datadir}/%{name}/ sounds as good a place as any for those files. They
> don't contain any pre-built binaries do they?
> 
They contain only templates or images or html files.

I added some lines in the summary to tell where to find them : didn't find a way to automatically search for them in the right directory when configuring the log book... 
Is there a better way to inform the user ?


> It builds in Cauldron - not had chance to test yet. Looking good ;)
To really test it you need 
- a connected GPS (but your boat  will placed be in the town where you live :-( nevertheless it will able to center the display on this place)
- marine charts (I don't think the marine charts will cover this town ;-) but you can drag to display the zone that they concern)
Comment 25 Philippe Didier 2012-12-06 12:49:46 CET
(In reply to comment #23)
> Is there any chance that anyone would want this without the plugin? 
Perhaps : this plugin is not absolutely necessary

> If there is then it would make sense to add the plugin as a sub-package so that
> it can be installed as required.
I thought about this...
something like opencpn-logbook-plugin.rpm, requiring opencpn to be installed
and proposed as an optional require for opencpn

It would need a very detailed %files part in the spec file
Comment 26 Barry Jackson 2012-12-06 13:01:45 CET
Something like:

%package logbook-plugin

Summary:	A logbook plugin for %{tarname}
Group:		Geography
Requires:	%{name} = %{version}-%{release}

%description logbook-plugin
Konni's logbook plugin for %{tarname}
NB : the LogbookKonni_Layouts.zip LogbookKonni_Other.zip may be downloaded from 
https://github.com/nohal/logbookkonni_pi/blob/master/LogbookKonni_Layouts.zip
https://github.com/nohal/logbookkonni_pi/blob/master/LogbookKonni_Other.zip

%files logbook-plugin
%{_datadir}\.....

Please try to use IRC when you can to save cluttering bugzilla any more than necessary ;) I keep looking but you are never there :\
Comment 27 Philippe Didier 2012-12-07 03:06:48 CET
Created attachment 3206 [details]
a spec file including the logbook plugin splitted two rpms

Hi Barry

Here it is !
I splited it in two rpms
- 1 opencpn.rpm quite the same as the one created with 3200 attachment
- 2 opencpn-logbook-plugin.rpm

It's perhaps not respecting the canonical way to write a spec... but it works : everything is in the right rpm ! nothing missing.

I have weird free hours !!! It may be difficult to meet on IRC (maybe we may use personal e.mail addresses)
Comment 28 Barry Jackson 2012-12-07 11:30:06 CET
Nice!

Just a few points I noticed

1. The url in description is bad - page missing.
2. You don't need "-n %{name}-" for sub package, just "%package logbook-plugin"
"%description logbook-plugin" etc. as %{name} is implied.
3. You can replace your %prep section with:
%prep
%setup -q -a 1 -n %{tarname}-%{version}-Source
mv LogbookKonni_pi -t plugins/

There may be a way to avoid needing the mv, but I don't know it.

4. Readme_packaging.txt should be README_packaging.txt as in line 1.

5. You re-included BuildRequires: pkgconfig(freetype2) is it needed? I built it OK without, and it pulls in lib64freetype6-devel.

Nearly there ;)
Comment 29 Philippe Didier 2012-12-07 19:13:10 CET
(In reply to comment #28)
Hi Barry !

> Nice!
> 
> Just a few points I noticed
> 
> 1. The url in description is bad - page missing.
they changed the address, I corrected it

> 2. You don't need "-n %{name}-" for sub package, just "%package logbook-plugin"
> "%description logbook-plugin" etc. as %{name} is implied.
I thought it was better :
when surfing on the repository tree it's easier to find related rpms if they are sorted with alphabetic order
when using MCC too 
I prefer explicit and clear names than implicit relations (it wouldn't be easy to find gimp plugins for instance if gimp was not included in their rpm name)

> 3. You can replace your %prep section with:
> %prep
> %setup -q -a 1 -n %{tarname}-%{version}-Source
> mv LogbookKonni_pi -t plugins/
> 
> There may be a way to avoid needing the mv, but I don't know it.
> 
This doesn't work... even with mv LogbookKonni_pi.tar.gz
 (=> file not found, in the log)

> 4. Readme_packaging.txt should be README_packaging.txt as in line 1.
> 
Corrected

> 5. You re-included BuildRequires: pkgconfig(freetype2) is it needed? I built it
> OK without, and it pulls in lib64freetype6-devel.
perhaps BR pkgconfig(freetype2) is implied by something else (can't imagine what..)
I know that the presence of libfreetype.so is checked in the beginning of the building process and thought it needed to be explicitely required (I have not a real buildsystem to verify)
If it's useless, I remove it ...

> 
> Nearly there ;)

Quite now :-)

If it's OK I will request a new package : Bristol that existed for Mandriva 2010.1 : I cooperated with Frank Kober to provide it !
Comment 30 Philippe Didier 2012-12-07 19:14:41 CET
Created attachment 3210 [details]
renamed advice for packagers

Attachment 3193 is obsolete: 0 => 1

Comment 31 Philippe Didier 2012-12-07 19:21:42 CET
Created attachment 3211 [details]
corrected spec file, bringing the logbook plugin, splitted in two rpms

Attachment 3206 is obsolete: 0 => 1

Comment 32 Barry Jackson 2012-12-07 20:30:28 CET
> > 2. You don't need "-n %{name}-" for sub package, just "%package logbook-plugin"
> > "%description logbook-plugin" etc. as %{name} is implied.
> I thought it was better :
> when surfing on the repository tree it's easier to find related rpms if they
> are sorted with alphabetic order
> when using MCC too 
> I prefer explicit and clear names than implicit relations (it wouldn't be easy
> to find gimp plugins for instance if gimp was not included in their rpm name)
> 
You misunderstand.
This does not affect the package naming in any way - only the spec.
%package foo == %package -n %{name}-foo  :)

> > 3. You can replace your %prep section with:
> > %prep
> > %setup -q -a 1 -n %{tarname}-%{version}-Source
> > mv LogbookKonni_pi -t plugins/
> > 
> > There may be a way to avoid needing the mv, but I don't know it.
> > 
> This doesn't work... 

Oh yes it does.

You didn't read (or copy/paste what I put).

> 
> If it's OK I will request a new package : Bristol that existed for Mandriva
> 2010.1 : I cooperated with Frank Kober to provide it !

OK, but slow down - let's finish this first.

There are some more issues to fix:

1. You added a new description line. Lines in description have a maximum length limit of 80 chars.
2. Don't put Version or Release or License in sub-packages - I thought we had a bug in rpmbuild when I produced a different sub-package release!
3. Shorten those long cp lines by splitting to make reading easier.

OK you just appeared on IRC
:)
Philippe Didier 2012-12-22 15:23:16 CET

Depends on: (none) => 5761

Philippe Didier 2012-12-22 15:23:40 CET

Summary: package request opencpn = A concise ChartPlotter and Navigation software => opencpn = A concise ChartPlotter and Navigation software

Comment 33 Philippe Didier 2013-02-01 02:35:16 CET
Opencpn is now in Cauldron and will be provided in Mageia3

Status: NEW => RESOLVED
Resolution: (none) => FIXED


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