QGIS/rpm/qgis.spec.template

350 lines
11 KiB
Plaintext
Raw Normal View History

# vi:syntax=spec
# TODO: Run test suite (see debian/rules)
# Template variables
# - _version
# - _relver
# - _timestamp (optional)
# Force the python interpreter to python3:
# brp-python-bytecompile is unable to identify
# the proper required version of python for
# py files located under /usr/share/qgis/python/plugins
%global __python %{__python3}
%if 0%{?fedora} >= 30
%define grass grass76
%else
%define grass grass74
%endif
%if %{_timestamp} > 0
2018-11-09 10:56:44 +01:00
# Epoch is set only when building packages from master
Epoch: %{_timestamp}
%define combinedversion %{epoch}:%{version}
%define builddate %(date -d @%{_timestamp} '+%a %b %d %Y')
%else
%define combinedversion %{version}
%define builddate %(date '+%a %b %d %Y')
%endif
Name: qgis
Version: %{_version}
Release: %{_relver}%{?dist}
Summary: A user friendly Open Source Geographic Information System
License: GPLv2+
URL: http://www.qgis.org
2017-10-01 23:41:47 +02:00
Source0: http://qgis.org/downloads/%{name}-%{version}.tar.bz2
# Sample configuration files for QGIS server
Source1: %{name}-server-httpd.conf
Source2: %{name}-server-nginx.conf
Source3: %{name}-server-fcgi.socket
Source4: %{name}-server-fcgi.service
Source5: %{name}-server-README.fedora
# MIME definitions
# Based on debian/qgis.xml but excluding already defined or proprietary types
Source6: %{name}-mime.xml
2017-10-01 23:41:47 +02:00
# Fix builds on 64-bit machines
# https://issues.qgis.org/issues/15602
2017-10-01 23:41:47 +02:00
# https://github.com/qgis/QGIS/commit/718581ffb12b723f9a3c0ae01b7ec2d8aed9d4bb.patch
Patch0: %{name}-lib64.patch
# Compiling stuff
2018-11-09 10:56:44 +01:00
BuildRequires: bison
BuildRequires: clang
BuildRequires: cmake
BuildRequires: expat-devel
BuildRequires: flex
BuildRequires: desktop-file-utils
2017-10-01 23:41:47 +02:00
# Geo stuff
2018-11-09 10:56:44 +01:00
BuildRequires: gdal-devel
BuildRequires: gdal-python3
BuildRequires: geos-devel
BuildRequires: gsl-devel
BuildRequires: libspatialite-devel
BuildRequires: proj-devel
BuildRequires: spatialindex-devel
BuildRequires: grass-devel
2017-10-01 23:41:47 +02:00
# Other stuff
BuildRequires: exiv2-devel
2018-11-09 10:56:44 +01:00
BuildRequires: gsl-devel
BuildRequires: libzip-devel
BuildRequires: postgresql-devel
BuildRequires: sqlite-devel
BuildRequires: hdf5-devel
BuildRequires: netcdf-devel
2018-11-09 10:56:44 +01:00
BuildRequires: fcgi-devel
2017-10-01 23:41:47 +02:00
2018-11-08 18:47:11 +01:00
# OpenCL
2018-11-09 10:56:44 +01:00
BuildRequires: opencl-headers
BuildRequires: ocl-icd-devel
2018-11-08 18:47:11 +01:00
2017-10-01 23:41:47 +02:00
# Python stuff
2018-11-09 10:56:44 +01:00
BuildRequires: python3-future
BuildRequires: python3-jinja2
BuildRequires: python3-OWSLib
BuildRequires: python3-psycopg2
BuildRequires: python3-pygments
BuildRequires: python3-PyYAML
BuildRequires: python3-qscintilla-devel
BuildRequires: python3-qscintilla-qt5
BuildRequires: python3-qscintilla-qt5-devel
BuildRequires: python3-qt5-devel
BuildRequires: sip-devel
2017-10-01 23:41:47 +02:00
# Qca stuff
2018-11-09 10:56:44 +01:00
BuildRequires: qca-qt5-devel
BuildRequires: qca-qt5-ossl
BuildRequires: qscintilla-qt5-devel
2017-10-01 23:41:47 +02:00
# Qt5 stuff
2018-11-09 10:56:44 +01:00
BuildRequires: qt5-qtlocation-devel
BuildRequires: qt5-qtsvg-devel
BuildRequires: qt5-qttools-static
BuildRequires: qt5-qtwebkit-devel
BuildRequires: qt5-qtxmlpatterns-devel
BuildRequires: qtkeychain-qt5-devel
BuildRequires: qt5-qtserialport-devel
BuildRequires: qt5-qt3d-devel
2017-10-01 23:41:47 +02:00
# Qwt stuff
2018-11-09 10:56:44 +01:00
BuildRequires: qwt-devel
BuildRequires: qwt-qt5-devel
BuildRequires: qwt-qt5-devel
# GDAL must be explicit. It is required by some raster tools
# like Warp (Reproject) which relies on gdalwarp
Requires: gdal
# Installation of QCA plugins must be explicit
Requires: qca-qt5-ossl
Requires: gpsbabel
Requires: qt5-qtcharts
# We don't want to provide private Python extension libs
2017-10-01 23:41:47 +02:00
%global __provides_exclude_from ^(%{python3_sitearch}|%{_libdir}/%{name}/plugins)/.*\.so(\.%{version})?$
%description
Geographic Information System (GIS) manages, analyzes, and displays
databases of geographic information. QGIS supports shape file
viewing and editing, spatial data storage with PostgreSQL/PostGIS, projection
on-the-fly, map composition, and a number of other features via a plugin
interface. QGIS also supports display of various geo-referenced raster and
Digital Elevation Model (DEM) formats including GeoTIFF, Arc/Info ASCII Grid,
and USGS ASCII DEM.
%package devel
Summary: Development Libraries for the QGIS
Requires: %{name}%{?_isa} = %{combinedversion}-%{release}
%description devel
Development packages for QGIS including the C header files.
%package grass
Summary: GRASS Support Libraries for QGIS
Requires: %{name}%{?_isa} = %{combinedversion}-%{release}
2017-10-01 23:41:47 +02:00
# The plug-in requires more than just the grass-libs.
# This questions the sense of the libs package.
# WARNING: Rebuild QGIS whenever a new version of GRASS is shipped! Even though
# the soname might stay the same, it won't work anymore.
# http://issues.qgis.org/issues/5274
2017-10-01 23:41:47 +02:00
Requires: grass%{?_isa} = %{grass_version}
%description grass
GRASS plugin for QGIS required to interface with the GRASS system.
2017-10-01 23:41:47 +02:00
%package -n python3-qgis
%{?python_provide:%python_provide python3-qgis}
# Remove before F30
Provides: %{name}-python = %{combinedversion}-%{release}
Provides: %{name}-python%{?_isa} = %{combinedversion}-%{release}
2018-11-09 10:56:44 +01:00
Obsoletes: %{name}-python < %{version}-%{release}
Obsoletes: python2-%{name} < %{version}-%{release}
Summary: Python integration and plug-ins for QGIS
Requires: %{name}%{?_isa} = %{combinedversion}-%{release}
2018-11-09 10:56:44 +01:00
Requires: gdal-python3
Requires: python3-future
Requires: python3-jinja2
Requires: python3-OWSLib
Requires: python3-psycopg2
Requires: python3-pygments
Requires: python3-PyYAML
Requires: python3-qscintilla
Requires: python3-qscintilla-qt5
Requires: python3-qt5
%{?_sip_api:Requires: sip-api(%{_sip_api_major}) >= %{_sip_api}}
2017-10-01 23:41:47 +02:00
%description -n python3-qgis
Python integration and plug-ins for QGIS.
%package server
Summary: FCGI-based OGC web map server
Requires: %{name}%{?_isa} = %{combinedversion}-%{release}
2018-11-09 10:56:44 +01:00
Provides: mapserver = %{version}-%{release}
Obsoletes: mapserver < 2.8.1-1
%description server
This FastCGI OGC web map server implements OGC WMS 1.3.0 and 1.1.1.
The services are prepared as regular projects in QGIS. They're rendered using
the QGIS libraries. The server also supports SLD (Styled Layer Descriptor)
for styling. Sample configurations for HTTPD and Nginx are included.
Please refer to %{name}-server-README.fedora for details!
%prep
%setup -q
2017-10-01 23:41:47 +02:00
%patch0 -p0 -b .lib64
# Remove executable permissions from source code files
find . \( -name "*.cpp" -o -name "*.h" \) -type f -perm /111 -execdir chmod -x {} \+
# Readme file for QGIS server configuration HTTPD and Nginx example
install -pm0644 %{SOURCE1} .
install -pm0644 %{SOURCE2} .
install -pm0644 %{SOURCE3} .
install -pm0644 %{SOURCE4} .
install -pm0644 %{SOURCE5} .
gzip ChangeLog
%build
%cmake \
%{_cmake_skip_rpath} \
-D QGIS_LIB_SUBDIR=%{_lib} \
-D QGIS_MANUAL_SUBDIR=/share/man \
-D QGIS_CGIBIN_SUBDIR=%{_libexecdir}/%{name} \
-D WITH_BINDINGS:BOOL=TRUE \
2017-10-01 23:41:47 +02:00
-D WITH_GRASS7:BOOL=TRUE \
-D GRASS_PREFIX7=%{_libdir}/%{grass} \
-D WITH_CUSTOM_WIDGETS:BOOL=TRUE \
-D BINDINGS_GLOBAL_INSTALL:BOOL=TRUE \
-D ENABLE_TESTS:BOOL=FALSE \
2017-10-01 23:41:47 +02:00
-D WITH_QSPATIALITE:BOOL=TRUE \
-D WITH_SERVER:BOOL=TRUE \
-D WITH_3D:BOOL=TRUE \
2018-11-08 18:47:11 +01:00
-D USE_OPENCL:BOOL=TRUE \
.
2017-10-01 23:41:47 +02:00
make %{?_smp_mflags}
%install
# Necessary for the test suite
#export LD_LIBRARY_PATH=%{_builddir}%{name}-%{version}/output/%{_lib}
make install DESTDIR=%{buildroot}
# Install MIME type definitions
install -d %{buildroot}%{_datadir}/mime/packages
install -pm0644 %{SOURCE6} \
%{buildroot}%{_datadir}/mime/packages/%{name}.xml
# See qgis-server-README.fedora
rm -f %{buildroot}%{_libexecdir}/%{name}/wms_metadata.xml
rm -f %{buildroot}%{_libexecdir}/%{name}/admin.sld
# Remove install instructions
2017-10-01 23:41:47 +02:00
rm -f %{buildroot}%{_datadir}/%{name}/doc/INSTALL*
%find_lang %{name} --with-qt
%post
/sbin/ldconfig
touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
touch --no-create %{_datadir}/mime/packages &> /dev/null || :
%postun
/sbin/ldconfig
if [ $1 -eq 0 ] ; then
touch --no-create %{_datadir}/icons/hicolor &>/dev/null
gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
touch --no-create %{_datadir}/mime/packages &> /dev/null || :
update-mime-database %{?fedora:-n} %{_datadir}/mime &> /dev/null || :
fi
%posttrans
gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
update-mime-database %{?fedora:-n} %{_datadir}/mime &> /dev/null || :
%post grass -p /sbin/ldconfig
%postun grass -p /sbin/ldconfig
2017-10-01 23:41:47 +02:00
%post -n python3-qgis -p /sbin/ldconfig
2017-10-01 23:41:47 +02:00
%postun -n python3-qgis -p /sbin/ldconfig
%files -f %{name}.lang
%doc BUGS NEWS Exception_to_GPL_for_Qt.txt ChangeLog.gz
# QGIS shows the following files in the GUI, including the license text
%doc %{_datadir}/%{name}/doc/
%dir %{_datadir}/%{name}/i18n/
%lang(zh-Hans) %{_datadir}/%{name}/i18n/%{name}_zh-Hans.qm
2017-10-01 23:41:47 +02:00
%lang(zh-Hant) %{_datadir}/%{name}/i18n/%{name}_zh-Hant.qm
%{_libdir}/lib%{name}_native.so.*
%{_libdir}/lib%{name}_app.so.*
%{_libdir}/lib%{name}_analysis.so.*
%{_libdir}/lib%{name}_core.so.*
%{_libdir}/lib%{name}_gui.so.*
2017-10-26 18:09:52 +02:00
%{_libdir}/lib%{name}_3d.so.*
%{_libdir}/%{name}/
%{?_qt5_plugindir}/sqldrivers/libqsqlspatialite.so
%{_bindir}/%{name}
%{_mandir}/man1/%{name}.1*
%dir %{_datadir}/%{name}/
%{_datadir}/mime/packages/qgis.xml
%{_datadir}/metainfo/org.qgis.qgis.appdata.xml
2017-10-01 23:41:47 +02:00
%{_datadir}/icons/hicolor/*/apps/*
%{_datadir}/icons/hicolor/*/mimetypes/*
%{_datadir}/applications/*%{name}.desktop
%{_datadir}/%{name}/images/
%{_datadir}/%{name}/resources/
%{_datadir}/%{name}/svg/
2017-10-01 23:41:47 +02:00
%exclude %{_libdir}/libqgisgrass*.so.*
%exclude %{_libdir}/%{name}/plugins/libgrassprovider*.so
%exclude %{_libdir}/%{name}/plugins/libgrassrasterprovider*.so
%exclude %{_libdir}/%{name}/plugins/libgrassplugin*.so
%exclude %{_libdir}/%{name}/server/
%exclude %{_libdir}/%{name}/grass/
%files devel
%{_datadir}/%{name}/FindQGIS.cmake
%{_includedir}/%{name}/
%{_libdir}/lib%{name}*.so
2017-10-01 23:41:47 +02:00
%{?_qt5_plugindir}/designer/libqgis_customwidgets.so*
%files grass
2017-10-01 23:41:47 +02:00
%{_libdir}/lib%{name}grass*.so.*
%{_libdir}/%{name}/plugins/libgrassprovider*.so
%{_libdir}/%{name}/plugins/libgrassrasterprovider*.so
%{_libdir}/%{name}/plugins/libgrassplugin*.so
%{_libdir}/%{name}/grass/
%{_datadir}/%{name}/grass/
2017-10-01 23:41:47 +02:00
%files -n python3-qgis
%{_libdir}/libqgispython.so.*
%{_datadir}/%{name}/python/
2017-10-01 23:41:47 +02:00
%{python3_sitearch}/%{name}/
%{python3_sitearch}/PyQt5/uic/widget-plugins/
%exclude %{python3_sitearch}/%{name}/server/
%exclude %{python3_sitearch}/%{name}/_server.so
%files server
%doc src/server/admin.sld src/server/wms_metadata.xml %{name}-server-README.fedora
%doc %{name}-server-httpd.conf %{name}-server-nginx.conf %{name}-server-fcgi.socket %{name}-server-fcgi.service
2017-10-01 23:41:47 +02:00
%{_libdir}/%{name}/server/
%{_libdir}/lib%{name}_server.so.*
%{_libexecdir}/%{name}/
2017-10-01 23:41:47 +02:00
%{python3_sitearch}/%{name}/server/
%{python3_sitearch}/%{name}/_server.so
%changelog
* %{builddate} Daniele Viganò <daniele@vigano.me> %{_version}-%{_relver}
2017-10-01 23:41:47 +02:00
- Automatic build