Files
rpms/fedora/SPECS/proj6.spec

130 lines
3.2 KiB
RPMSpec
Raw Normal View History

2020-01-06 16:44:27 +01:00
%global proj_version 6.3.0
%global datumgrid_version 1.8
2020-01-11 08:15:44 +01:00
%define realname proj
%define _prefix /usr/local
%define _includedir %{_prefix}/include
%define _datadir %{_prefix}/share
%define _bindir %{_prefix}/bin
%define _libdir %{_prefix}/lib64
%define _mandir %{_datadir}/man
2020-01-06 16:44:27 +01:00
2020-01-11 08:15:44 +01:00
Name: proj6
2020-01-06 16:44:27 +01:00
Version: %{proj_version}
Release: 1%{?dist}
Summary: Cartographic projection software (PROJ.4)
License: MIT
URL: https://proj4.org
2020-01-11 08:15:44 +01:00
Source0: https://download.osgeo.org/%{realname}/%{realname}-%{version}.tar.gz
2020-01-06 16:44:27 +01:00
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}
2020-01-06 16:44:27 +01:00
%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}
2020-01-06 16:44:27 +01:00
%description static
This package contains libproj static library.
%prep
%setup -q -n %{realname}-%{version}
2020-01-06 16:44:27 +01:00
%build
# rebuild due to patch
autoreconf -i
./configure \
--prefix=%{_prefix} \
--libdir=%{_libdir} \
--includedir=%{_includedir} \
--datarootdir=%{_datadir}
2020-01-11 08:15:44 +01:00
2020-01-06 16:44:27 +01:00
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 DESTDIR=%{buildroot}
2020-01-06 16:44:27 +01:00
chmod -x %{buildroot}%{_libdir}/libproj.la
# 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 %{_libdir})
2020-01-06 16:44:27 +01:00
else()
set(PROJ4_LIBRARY_DIRS %{_prefix}/lib)
2020-01-06 16:44:27 +01:00
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}/%{realname} check || ( cat src/test-suite.log; exit 1 )
2020-01-06 16:44:27 +01:00
%files
%doc NEWS AUTHORS COPYING README ChangeLog
%{_bindir}/*
%{_mandir}/man1/*.1*
%{_libdir}/libproj.so.15*
%dir %{_datadir}/%{realname}
%{_datadir}/%{realname}/CH
%{_datadir}/%{realname}/GL27
%{_datadir}/%{realname}/ITRF2000
%{_datadir}/%{realname}/ITRF2008
%{_datadir}/%{realname}/ITRF2014
%{_datadir}/%{realname}/nad.lst
%{_datadir}/%{realname}/nad27
%{_datadir}/%{realname}/nad83
%{_datadir}/%{realname}/null
%{_datadir}/%{realname}/other.extra
%{_datadir}/%{realname}/world
%{_datadir}/%{realname}/projjson.schema.json
%{_datadir}/%{realname}/%{realname}.db
2020-01-06 16:44:27 +01:00
%files devel
%{_mandir}/man3/*.3*
%{_includedir}/*.h
%{_includedir}/%{realname}/*.hpp
2020-01-06 16:44:27 +01:00
%{_libdir}/libproj.so
%{_libdir}/pkgconfig/%{realname}.pc
2020-01-06 16:44:27 +01:00
%{_datadir}/cmake/Modules/FindPROJ4.cmake
%exclude %{_libdir}/libproj.a
%exclude %{_libdir}/libproj.la
%files static
%{_libdir}/libproj.a
%{_libdir}/libproj.la
%changelog
* Sat Jan 11 2020 Daniel Steiner <daniel.steiner@dsteiner.ch>
- New name proj6 and relocation to /usr/local.
2020-01-06 16:44:27 +01:00
* Mon Jan 6 2020 Daniel Steiner <daniel.steiner@dsteiner.ch>
- Initial build