%global proj_version 6.3.0 %global datumgrid_version 1.8 %define realname proj Name: proj6 Version: %{proj_version} Release: 1%{?dist} Summary: Cartographic projection software (PROJ.4) License: MIT URL: https://proj4.org Source0: https://download.osgeo.org/%{realname}/%{realname}-%{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: %{realname}%{?_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: %{realname}-devel%{?_isa} = %{version}-%{release} %description static This package contains libproj static library. %prep %autosetup %build # rebuild due to patch autoreconf -i %configure \ --includedir=%{_includedir}/%{name} \ --datarootdir=%{_datadir}/%{name} 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 %changelog * Mon Jan 6 2020 Daniel Steiner - Initial build