diff --git a/gmt-6.0.0-src.tar.xz b/gmt-6.0.0-src.tar.xz new file mode 100644 index 0000000000000000000000000000000000000000..ceca1f976a1bc95ba208b0b9cb892c2b7fbc68ed Binary files /dev/null and b/gmt-6.0.0-src.tar.xz differ diff --git a/gmt.spec b/gmt.spec new file mode 100644 index 0000000000000000000000000000000000000000..c294e4de6fed33f569a0034a6f84e908dc35eef6 --- /dev/null +++ b/gmt.spec @@ -0,0 +1,193 @@ +%global gmthome %{_datadir}/gmt +%global gmtconf %{_sysconfdir}/gmt +%global gmtdoc %{_docdir}/gmt + +%bcond_with octave +%if %with octave +%{!?octave_api: %global octave_api %(octave-config -p API_VERSION 2>/dev/null || echo 0)} +%global octave_mdir %(octave-config -p LOCALAPIFCNFILEDIR || echo) +%global octave_octdir %(octave-config -p LOCALAPIOCTFILEDIR || echo) +%endif + +%global completion_dir %(pkg-config --variable=completionsdir bash-completion) +%if "%{completion_dir}" == "" +%global completion_dir "/etc/bash_completion.d" +%endif + +# Do not generate provides for plugins +%global __provides_exclude_from ^%{_libdir}/gmt/.*\\.so$ + +Name: GMT +Version: 6.0.0 +Release: 1 +Summary: Generic Mapping Tools + +License: LGPLv3+ +URL: https://www.generic-mapping-tools.org +Source0: https://github.com/GenericMappingTools/gmt/releases/download/%{version}/gmt-%{version}-src.tar.xz + +BuildRequires: cmake gcc bash-completion fftw-devel gdal gdal-devel glib2-devel GraphicsMagick +BuildRequires: libXt-devel libXaw-devel libXmu-devel libXext-devel netcdf-devel openblas-devel +BuildRequires: pcre-devel dcw-gmt gshhg-gmt-nc4 less xdg-utils +%if %with octave +BuildRequires: octave-devel +%endif +# For docs +BuildRequires: python3-sphinx ghostscript + +Requires: gdal GraphicsMagick less dcw-gmt gshhg-gmt-nc4 xdg-utils +Requires: %{name}-common = %{version}-%{release} + +Provides: gmt = %{version}-%{release} + + +%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. + +NOTE: Specific executables that conflict with other Fedora packages have been +removed. These functions can still be accessed via the GMT wrapper script +with: GMT [args] + + +%package common +Summary: Common files for %{name} +Provides: gmt-common = %{version}-%{release} +BuildArch: noarch + +%description common +The %{name}-common package contains common files for GMT (Generic +Mapping Tools) package. + + +%package devel +Summary: Development files for %{name} +Requires: %{name} = %{version}-%{release} +Provides: gmt-devel = %{version}-%{release} +Obsoletes: GMT-static <= 4.5.11 + +%description devel +The %{name}-devel package contains libraries and header files for +developing applications that use %{name}. + + +%package doc +Summary: Documentation for %{name} +Requires: %{name} = %{version}-%{release} +Provides: gmt-doc = %{version}-%{release} +Provides: %{name}-examples = %{version}-%{release} +Obsoletes: %{name}-examples < %{version}-%{release} +BuildArch: noarch + +%description doc +The %{name}-doc package provides the documentation for the GMT (Generic +Mapping Tools) package. + + +%if %with octave +%package octave +Summary: Octave libraries for %{name} +Requires: %{name} = %{version}-%{release} +Requires: octave(api) = %{octave_api} +Provides: gmt-octave = %{version}-%{release} + +%description octave +The %{name}-octave package contains and Octave interface for developing +applications that use %{name}. +%endif + + +%prep +%autosetup -p1 -n gmt-%{version} + + +%build +mkdir build +pushd build || exit 1 +%{cmake} \ + -DGSHHG_ROOT=%{_datadir}/gshhg-gmt-nc4 \ + -DGMT_INSTALL_MODULE_LINKS=off \ + -DGMT_INSTALL_TRADITIONAL_FOLDERNAMES=off \ + -DLICENSE_RESTRICTED=LGPL \ +%if %with octave + -DGMT_OCTAVE=BOOL:ON \ +%endif + -DGMT_OPENMP=BOOL:ON \ + -DGMT_USE_THREADS=BOOL:ON \ + -DBASH_COMPLETION_DIR=%{completion_dir} \ + .. +%make_build + + +%install +%make_install -C build +#Setup configuration files +mkdir -p %{buildroot}%{gmtconf}/{mgg,dbase,mgd77} +pushd %{buildroot}%{gmthome} || exit 1 +# put conf files in %{gmtconf} and do links in %{gmthome} +for file in mgg/gmtfile_paths mgd77/mgd77_paths.txt; do + mv $file %{buildroot}%{gmtconf}/$file + ln -s ../../../../../%{gmtconf}/$file %{buildroot}%{gmthome}/$file +done +popd + +# Configure coastline data location +mkdir -p %{buildroot}%{gmthome}/coast +echo %{_datadir}/gshhg-gmt-nc4 > %{buildroot}%{gmthome}/coast/coastline.conf + +# Don't ship .bat files +find %{buildroot} -name \*.bat -delete + +%post -p /sbin/ldconfig +%postun -p /sbin/ldconfig + + +%files +%license COPYING.LESSERv3 COPYINGv3 LICENSE.TXT +%doc AUTHORS.md CITATION.md CONTRIBUTING.md README.md +%{_bindir}/* +%{_libdir}/*.so.6* +%{_libdir}/gmt/ + + +%files common +%license COPYING.LESSERv3 COPYINGv3 LICENSE.TXT +%doc AUTHORS.md CITATION.md CONTRIBUTING.md README.md +%dir %{gmtconf} +%dir %{gmtconf}/mgg +%dir %{gmtconf}/dbase +%dir %{gmtconf}/mgd77 +%config(noreplace) %{gmtconf}/mgg/gmtfile_paths +%config(noreplace) %{gmtconf}/mgd77/mgd77_paths.txt +%{gmthome}/ +%{completion_dir}/ + + +%files devel +%{_includedir}/* +%{_libdir}/*.so + + +%files doc +%{gmtdoc}/ + + +%if %with octave +%files octave +%{octave_mdir}/*.m +%{octave_octdir}/*.mex +%endif + + +%changelog +* Fri Oct 08 2021 konglidong - 6.0.0-1 +- package init