From e4c8931066e689268ea47e13218df0278d155e35 Mon Sep 17 00:00:00 2001 From: Daniel Steiner Date: Mon, 6 Jan 2020 16:44:27 +0100 Subject: [PATCH] OSM packages --- fedora/SPECS/gdal.spec | 149 +++++++++++++++++++++++++++++++++++++++++ fedora/SPECS/proj.spec | 145 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 294 insertions(+) create mode 100644 fedora/SPECS/gdal.spec create mode 100644 fedora/SPECS/proj.spec diff --git a/fedora/SPECS/gdal.spec b/fedora/SPECS/gdal.spec new file mode 100644 index 0000000..4bb621c --- /dev/null +++ b/fedora/SPECS/gdal.spec @@ -0,0 +1,149 @@ +%define build_refman 1 +%define bashcompletiondir %{_sysconfdir}/bash_completion.d + +Name: gdal +Version: 3.0.2 +Release: 1%{?dist} +#define debug_package #{nil} +License: MIT +Group: Applications/System +Summary: GIS file format library +URL: http://www.gdal.org +Source0: %name-%{version}.tar.gz + + +#BuildRequires: armadillo-devel +BuildRequires: freexl-devel +BuildRequires: bash-completion +BuildRequires: libzstd-devel +#BuildRequires: cfitsio-devel +BuildRequires: libjpeg-devel +BuildRequires: libpng-devel +BuildRequires: libtiff-devel +BuildRequires: pcre-devel +BuildRequires: perl-devel +BuildRequires: perl-generators +BuildRequires: openjpeg2-devel +BuildRequires: openjpeg-devel +BuildRequires: perl(ExtUtils::MakeMaker) +BuildRequires: %{_bindir}/pkg-config +BuildRequires: libpq-devel +BuildRequires: proj-devel >= 6.0.2 +%if %{with python2} +BuildRequires: python2-devel +BuildRequires: python2-numpy +%endif +%if %{with python3} +BuildRequires: python3-devel +BuildRequires: python3-numpy +%endif +BuildRequires: sqlite-devel +BuildRequires: swig +%if %{build_refman} +BuildRequires: texlive-latex +BuildRequires: texlive-collection-fontsrecommended +%if 0%{?fedora} +BuildRequires: texlive-collection-langcyrillic +BuildRequires: texlive-collection-langportuguese +%endif +%endif + +%global DONT_REMOVE_RPATH 1 +# don't check for rpath: +%global __arch_install_post /usr/lib/rpm/check-buildroot + +%description +Geospatial Data Abstraction Library (GDAL/OGR) is a cross platform +C++ translator library for raster and vector geospatial data formats. +As a library, it presents a single abstract data model to the calling +application for all supported formats. It also comes with a variety of +useful commandline utilities for data translation and processing. + +It provides the primary data access engine for many applications. +GDAL/OGR is the most widely used geospatial data access library. + + +%package devel +Summary: Development files for the GDAL file format library + +Requires: %{name}-libs = %{version}-%{release} + +%description devel +This package contains development files for GDAL. + + +%package libs +Summary: GDAL file format library + +%description libs +This package contains the GDAL file format library. + + simple service for looking up your IP address. This is the code that powers https://echoip.daniel-steiner.org. + +%prep +%setup -q -n %{name}-%{version} + +%build +%configure \ + --bindir=%{_bindir} \ + --sbindir=%{_sbindir} \ + --includedir=%{_includedir}/%{name} \ + --datadir=%{_datadir}/%{name} +make + +%install +export DONT_REMOVE_RPATH=1 +%make_install +# move bashcompletion file to proper directory: +mv %{buildroot}%{_prefix}/etc %{buildroot}/ + +%clean +[ "%{buildroot}" != "/" ] && [ -d "%{buildroot}" ] && rm -rf %{buildroot} +[ "%{_builddir}" != "/" ] && [ -d "%{_builddir}" ] && rm -rf %{_builddir}/* + +%files +%defattr(-,root,root,-) +%doc MIGRATION_GUIDE.TXT PROVENANCE.TXT +%config %{bashcompletiondir}/* +%{_bindir}/gdallocationinfo +%{_bindir}/gdal_contour +%{_bindir}/gdal_rasterize +%{_bindir}/gdal_translate +%{_bindir}/gdaladdo +%{_bindir}/gdalinfo +%{_bindir}/gdaldem +%{_bindir}/gdalbuildvrt +%{_bindir}/gdaltindex +%{_bindir}/gdalwarp +%{_bindir}/gdal_grid +%{_bindir}/gdalenhance +%{_bindir}/gdalmanage +%{_bindir}/gdalserver +%{_bindir}/gdalsrsinfo +%{_bindir}/gdaltransform +%{_bindir}/nearblack +%{_bindir}/ogr* +%{_bindir}/testepsg +%{_bindir}/gnmanalyse +%{_bindir}/gnmmanage + +%files libs +%doc LICENSE.TXT NEWS PROVENANCE.TXT COMMITTERS +%{_libdir}/libgdal.so.26 +%{_libdir}/libgdal.so.26.* +%{_datadir}/%{name}/* +#TODO: Possibly remove files like .dxf, .dgn, ... +%dir %{_libdir}/%{name}plugins + +%files devel +%{_bindir}/%{name}-config +%{_includedir}/%{name}/*.h +%{_libdir}/*.a +%{_libdir}/*.la +%{_libdir}/*.so +%{_libdir}/pkgconfig/%{name}.pc + +%changelog +* Mon Jan 6 2020 Daniel Steiner +- Initial build + diff --git a/fedora/SPECS/proj.spec b/fedora/SPECS/proj.spec new file mode 100644 index 0000000..2e11712 --- /dev/null +++ b/fedora/SPECS/proj.spec @@ -0,0 +1,145 @@ +%global proj_version 6.3.0 +%global datumgrid_version 1.8 + +Name: proj +Version: %{proj_version} +Release: 1%{?dist} +Summary: Cartographic projection software (PROJ.4) + +License: MIT +URL: https://proj4.org +Source0: https://download.osgeo.org/%{name}/%{name}-%{version}.tar.gz +Source1: https://download.osgeo.org/%{name}/%{name}-datumgrid-%{datumgrid_version}.tar.gz + +BuildRequires: libtool gcc-c++ + +%description +Proj and invproj perform respective forward and inverse transformation of +cartographic data to or from cartesian data with a wide range of selectable +projection functions. + + +%package devel +Summary: Development files for PROJ.4 +Requires: %{name}%{?_isa} = %{version}-%{release} + +%description devel +This package contains libproj and the appropriate header files and man pages. + + +%package static +Summary: Development files for PROJ.4 +Requires: %{name}-devel%{?_isa} = %{version}-%{release} + +%description static +This package contains libproj static library. + + +%package datumgrid +Summary: Additional datum shift grids for PROJ.4 +Version: %{datumgrid_version} +Release: 99%{?dist} +# See README.DATUMGRID +License: CC-BY and Freely Distributable and Ouverte and Public Domain +BuildArch: noarch + +# Renamed; remove after Fedora 31. +Obsoletes: proj-nad < 5.2.0-2 +Provides: proj-nad = %{proj_version}-%{release} + +%description datumgrid +This package contains additional datum shift grids. + + +%prep +%autosetup + +# Prepare datumgrid and file list (in {datadir}/proj and README marked as doc) +mkdir nad +tar xvf %{SOURCE1} -C nad | \ + sed -e 's!^!%{_datadir}/%{name}/!' -e '/README/s!^!%%doc !' > datumgrid.files + + +%build +# rebuild due to patch +autoreconf -i +%configure +sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool +sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool +%make_build + + +%install +%make_install +chmod -x %{buildroot}%{_libdir}/libproj.la +install -p -m 0644 nad/README.DATUMGRID %{buildroot}%{_datadir}/%{name} +for f in $(egrep '^\/usr' datumgrid.files); do + bf=$(basename $f) + install -m 0644 nad/$bf %{buildroot}%{_datadir}/%{name}/$bf +done + +# Install cmake config manually because we use autotools for building +mkdir -p %{buildroot}%{_datadir}/cmake/Modules/ + +cat << EOF > %{buildroot}%{_datadir}/cmake/Modules/FindPROJ4.cmake +set(PROJ4_FOUND 1) +set(PROJ4_INCLUDE_DIRS %{_includedir}) +set(PROJ4_LIBRARIES proj) +if(\${LIB_SUFFIX} MATCHES 64) +set(PROJ4_LIBRARY_DIRS /usr/lib64) +else() +set(PROJ4_LIBRARY_DIRS /usr/lib) +endif() +set(PROJ4_BINARY_DIRS %{_bindir}) +set(PROJ4_VERSION %{proj_version}) +message(STATUS "Found PROJ4: version \${PROJ4_VERSION}") +EOF + + +%check +LD_LIBRARY_PATH=%{buildroot}%{_libdir} \ + make PROJ_LIB=%{buildroot}%{_datadir}/%{name} check || ( cat src/test-suite.log; exit 1 ) + + +%files +%doc NEWS AUTHORS COPYING README ChangeLog +%{_bindir}/* +%{_mandir}/man1/*.1* +%{_libdir}/libproj.so.15* +%dir %{_datadir}/%{name} +%{_datadir}/%{name}/CH +%{_datadir}/%{name}/GL27 +%{_datadir}/%{name}/ITRF2000 +%{_datadir}/%{name}/ITRF2008 +%{_datadir}/%{name}/ITRF2014 +%{_datadir}/%{name}/nad.lst +%{_datadir}/%{name}/nad27 +%{_datadir}/%{name}/nad83 +%{_datadir}/%{name}/null +%{_datadir}/%{name}/other.extra +%{_datadir}/%{name}/world +%{_datadir}/%{name}/projjson.schema.json +%{_datadir}/%{name}/%{name}.db + +%files devel +%{_mandir}/man3/*.3* +%{_includedir}/*.h +%{_includedir}/%{name}/*.hpp +%{_libdir}/libproj.so +%{_libdir}/pkgconfig/%{name}.pc +%{_datadir}/cmake/Modules/FindPROJ4.cmake +%exclude %{_libdir}/libproj.a +%exclude %{_libdir}/libproj.la + +%files static +%{_libdir}/libproj.a +%{_libdir}/libproj.la + +%files datumgrid -f datumgrid.files +%dir %{_datadir}/%{name} + + +%changelog +* Mon Jan 6 2020 Daniel Steiner +- Initial build +