]> git.pld-linux.org Git - packages/gpsbabel.git/blob - gpsbabel.spec
4801a2b86491f27a226a65bd68c16565ebbbca79
[packages/gpsbabel.git] / gpsbabel.spec
1 #
2 # Conditional build:
3 %bcond_without  qt5             # build Qt5 GUI
4 #
5 %define         qtver           5.11.1
6 %define         fver    %(echo %{version} | tr . _)
7
8 # disable qt5 on x32 until qt5-qtwebengine builds
9 # (python segfaults as of 20181212)
10 %ifarch x32
11 %undefine with_qt5
12 %endif
13
14 Summary:        GPSBabel - convert GPS waypoint, route and track data
15 Summary(pl.UTF-8):      GPSBabel - konwertowanie danych GPS: waypointów, tras i śladów
16 Name:           gpsbabel
17 Version:        1.5.4
18 Release:        3
19 License:        GPL v2+
20 Group:          Applications/Engineering
21 # Source0Download via POST form at https://www.gpsbabel.org/download.html#downloading
22 # version=1.5.4
23 # token=$(curl -s http://www.gpsbabel.org/download.html | sed -rne 's/.*gpsbabel-'$version'\.tar\.gz.*token.*value="([^"]+)".*/\1/p' | head -n1)
24 # curl -F "token=$token" -F "dl=gpsbabel-$version.tar.gz" http://www.gpsbabel.org/plan9.php -o gpsbabel-$version.tar.gz
25 Source0:        https://github.com/gpsbabel/gpsbabel/archive/%{name}_%{fver}.tar.gz
26 # Source0-md5:  0f2d422dbae82f939564cf8305a4654c
27 Source1:        %{name}.desktop
28 Source2:        %{name}.png
29 Patch0:         %{name}-auto.patch
30 Patch1:         use-system-shapelib.patch
31 Patch2:         gmapbase.patch
32 Patch3:         %{name}-link.patch
33 Patch4:         qt.patch
34 Patch5:         privacy.patch
35 Patch6:         %{name}-shapelib-shapefil-h-location.patch
36 Patch7:         %{name}-system-minizip.patch
37 URL:            http://www.gpsbabel.org/
38 BuildRequires:  autoconf >= 2.59
39 BuildRequires:  automake
40 BuildRequires:  docbook-style-xsl
41 BuildRequires:  expat-devel >= 1.95
42 #BuildRequires: libusb-compat-devel >= 0.1
43 BuildRequires:  libxslt-progs
44 BuildRequires:  minizip-devel
45 BuildRequires:  rpmbuild(macros) >= 1.600
46 BuildRequires:  shapelib-devel
47 BuildRequires:  zlib-devel
48 BuildRequires:  Qt5Core-devel >= %{qtver}
49 %if %{with qt5}
50 BuildRequires:  Qt5Gui-devel >= %{qtver}
51 BuildRequires:  Qt5Network-devel >= %{qtver}
52 BuildRequires:  Qt5WebEngine-devel >= %{qtver}
53 BuildRequires:  Qt5Xml-devel >= %{qtver}
54 BuildRequires:  desktop-file-utils
55 BuildRequires:  qt5-build >= %{qtver}
56 BuildRequires:  qt5-linguist >= %{qtver}
57 BuildRequires:  qt5-qmake >= %{qtver}
58 %endif
59 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
60
61 %define         translationdir  %{_datadir}/qt5/translations
62
63 %description
64 Converts GPS waypoint, route and track data from one format type to
65 another.
66
67 %description -l pl.UTF-8
68 GPSBabel konwertuje dane GPS: waypointy, trasy i ślady z jednego
69 formatu na drugi.
70
71 %package gui
72 Summary:        Qt GUI interface for GPSBabel
73 Summary(pl.UTF-8):      Graficzny interfejs Qt do programu GPSBabel
74 Group:          Applications/Engineering
75 Requires:       %{name} = %{version}-%{release}
76
77 %description gui
78 Qt GUI interface for GPSBabel.
79
80 %description gui -l pl.UTF-8
81 Graficzny interfejs Qt do programu GPSBabel.
82
83 %prep
84 %setup -q -n %{name}-%{name}_%{fver}
85 %patch0 -p1
86 %patch1 -p1
87 %patch2 -p1
88 %patch3 -p1
89 %patch4 -p1
90 %patch5 -p1
91 %patch6 -p1
92 %patch7 -p1
93
94 # Use system shapelib instead of bundled partial shapelib
95 mv shapelib{,.bundled}
96
97 %build
98 %{__aclocal}
99 %{__autoconf}
100 %configure \
101         --with-zlib=system \
102         --with-libminizip=system \
103         --with-doc=./manual
104 %{__make}
105
106 %{__perl} xmldoc/makedoc
107 %{__make} gpsbabel.html
108
109 %if %{with qt5}
110 cd gui
111 qmake-qt5
112 lrelease-qt5 *.ts
113 %{__make}
114 %endif
115
116 %install
117 rm -rf $RPM_BUILD_ROOT
118 install -d $RPM_BUILD_ROOT%{_bindir}
119 %{__make} install \
120         DESTDIR=$RPM_BUILD_ROOT
121
122 %if %{with qt5}
123 install -d $RPM_BUILD_ROOT
124 install -d $RPM_BUILD_ROOT{%{_bindir},%{_datadir}/%{name},%{translationdir}}
125 install -p gui/objects/gpsbabelfe-bin $RPM_BUILD_ROOT%{_bindir}
126 install -p gui/gpsbabel*_*.qm $RPM_BUILD_ROOT%{translationdir}
127 cp -p gui/gmapbase.html $RPM_BUILD_ROOT%{_datadir}/%{name}
128
129 desktop-file-install \
130         --dir $RPM_BUILD_ROOT%{_desktopdir} \
131         %{SOURCE1}
132
133 install -d $RPM_BUILD_ROOT%{_iconsdir}/hicolor/256x256/apps
134 cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_iconsdir}/hicolor/256x256/apps
135
136 #%find_lang %{name} --with-qt --all-name
137 # TODO: patch find lang
138 cat <<EOF > %{name}.lang
139 %lang(de) %{translationdir}/gpsbabel_de.qm
140 %lang(es) %{translationdir}/gpsbabel_es.qm
141 %lang(fr) %{translationdir}/gpsbabel_fr.qm
142 %lang(hu) %{translationdir}/gpsbabel_hu.qm
143 %lang(it) %{translationdir}/gpsbabel_it.qm
144 %lang(de) %{translationdir}/gpsbabelfe_de.qm
145 %lang(es) %{translationdir}/gpsbabelfe_es.qm
146 %lang(fr) %{translationdir}/gpsbabelfe_fr.qm
147 %lang(hu) %{translationdir}/gpsbabelfe_hu.qm
148 %lang(it) %{translationdir}/gpsbabelfe_it.qm
149 %lang(ru) %{translationdir}/gpsbabelfe_ru.qm
150 EOF
151
152 %endif
153
154 %clean
155 rm -rf $RPM_BUILD_ROOT
156
157 %files
158 %defattr(644,root,root,755)
159 %doc AUTHORS README* gpsbabel.html
160 %attr(755,root,root) %{_bindir}/gpsbabel
161
162 %if %{with qt5}
163 %files gui -f %{name}.lang
164 %defattr(644,root,root,755)
165 %doc gui/{AUTHORS,README*,TODO}
166 %attr(755,root,root) %{_bindir}/gpsbabelfe-bin
167 %{_desktopdir}/gpsbabel.desktop
168 %{_iconsdir}/hicolor/*/apps/gpsbabel.png
169 %dir %{_datadir}/%{name}
170 %{_datadir}/%{name}/gmapbase.html
171 %endif
This page took 0.185346 seconds and 2 git commands to generate.