File osm2pgsql.spec of Package osm2pgsql
#
# spec file for package osm2pgsql
#
# Copyright (c) 2021 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
Name: osm2pgsql
Version: 1.7.2
Release: 0
Summary: A utility for importing OpenStreetMap data into PostgreSQL
License: GPL-2.0-or-later
Group: Productivity/Databases/Tools
URL: https://osm2pgsql.org/
Source0: https://github.com/openstreetmap/osm2pgsql/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz
BuildRequires: cmake
BuildRequires: gcc-c++
BuildRequires: libboost_filesystem-devel >= 1.48
BuildRequires: libboost_system-devel >= 1.48
BuildRequires: libboost_headers-devel >= 1.48
BuildRequires: libosmium-devel >= 2.17.0
BuildRequires: libprotozero-devel
BuildRequires: python3-behave
BuildRequires: pkgconfig
BuildRequires: postgresql-devel
BuildRequires: pkgconfig(RapidJSON)
BuildRequires: pkgconfig(bzip2)
BuildRequires: pkgconfig(expat)
#BuildRequires: pkgconfig(fmt)
BuildRequires: pkgconfig(libprotobuf-c)
BuildRequires: pkgconfig(libxml-2.0)
BuildRequires: pkgconfig(lua)
BuildRequires: pkgconfig(proj)
BuildRequires: pkgconfig(python)
Requires: python3-psycopg2
Requires: python3-pyosmium
%description
It is often used to render OSM data visually using Mapnik, as Mapnik can query
PostgreSQL for map data (Mapnik can read directly from other data source types
including raw osm files directly, but PostgreSQL is the most efficient and most
commonly required by stylesheets). For more information on using osm2pgsql to
render OpenStreetMap data with Mapnik,
see http://wiki.openstreetmap.org/wiki/Mapnik
%prep
%setup -q
%build
%cmake \
-DEXTERNAL_LIBOSMIUM=ON \
-DEXTERNAL_PROTOZERO=ON \
-DEXTERNAL_RAPIDJSON=ON \
-DBUILD_TESTS=OFF
## -DEXTERNAL_FMT=ON
%cmake_build
%install
# rpmlint: wrong-script-interpreter /usr/bin/env python3
find . -type f -exec sed -i -e 's:#!%{_bindir}/env python3:#!%{_bindir}/python3:g' {} +
%cmake_install
%files
%doc AUTHORS CONTRIBUTING.md README.md
%license COPYING
%{_bindir}/%{name}
%{_bindir}/%{name}-replication
%{_mandir}/man1/%{name}.1%{?ext_man}
%{_mandir}/man1/%{name}-replication.1%{?ext_man}
%{_datadir}/%{name}
%changelog