From c4647f6dff51385d7f9038a708ff8e888d374649 Mon Sep 17 00:00:00 2001 From: Orion Poplawski Date: Oct 07 2016 19:29:27 +0000 Subject: Add patch to fix desktop file - Validate desktop and appdata files - Fix script interpreters - Convert files to UTF-8 if needed --- diff --git a/grass-nourl.patch b/grass-nourl.patch new file mode 100644 index 0000000..b6908aa --- /dev/null +++ b/grass-nourl.patch @@ -0,0 +1,9 @@ +diff -up grass-7.0.4/gui/icons/grass.desktop.nourl grass-7.0.4/gui/icons/grass.desktop +--- grass-7.0.4/gui/icons/grass.desktop.nourl 2016-01-11 16:03:21.000000000 -0700 ++++ grass-7.0.4/gui/icons/grass.desktop 2016-10-07 12:58:59.279554938 -0600 +@@ -51,5 +51,4 @@ Categories=Education;Science;Geoscience; + Exec=grass70 + Icon=grass70 + Terminal=true +-URL=https://grass.osgeo.org/ + Keywords=gis;spatial;geospatial;database;remote sensing;hydrology;vector;raster;visualization;maps;wms;wfs;ogc;osgeo; diff --git a/grass.spec b/grass.spec index bf3da9d..0e2a8fd 100644 --- a/grass.spec +++ b/grass.spec @@ -3,7 +3,7 @@ Name: grass Version: 7.0.4 -Release: 2%{?dist} +Release: 3%{?dist} Summary: GRASS GIS - Geographic Resources Analysis Support System Group: Applications/Engineering @@ -11,9 +11,13 @@ License: GPLv2+ URL: https://grass.osgeo.org Source0: https://grass.osgeo.org/%{name}%{shortver}/source/%{name}-%{version}.tar.gz Source2: %{name}-config.h +# Remove URL from .desktop +# https://trac.osgeo.org/grass/ticket/3178#ticket +Patch0: grass-nourl.patch BuildRequires: bison BuildRequires: blas-devel +BuildRequires: desktop-file-utils BuildRequires: fftw-devel BuildRequires: flex BuildRequires: freetype-devel @@ -21,6 +25,7 @@ BuildRequires: gdal-devel BuildRequires: geos-devel BuildRequires: gettext BuildRequires: lapack-devel +BuildRequires: libappstream-glib BuildRequires: liblas-devel => 1.8.0-12 BuildRequires: libpng-devel BuildRequires: libtiff-devel @@ -80,10 +85,15 @@ GRASS GIS development headers %prep %setup -q +%patch0 -p1 -b .nourl # Correct mysql_config query sed -i -e 's/--libmysqld-libs/--libs/g' configure +# Fixup shebangs +find -type f | xargs sed -i -e 's,#!/usr/bin/env python,#!%{__python},' +find -name \*.pl | xargs sed -i -e 's,#!/usr/bin/env perl,#!%{__perl},' + %build # Package is not ready for -Werror=format-security or the C++11 standard CFLAGS="$(echo ${RPM_OPT_FLAGS} | sed -e 's/ -Werror=format-security//')" @@ -147,8 +157,14 @@ do iconv -f iso8859-1 -t utf8 $man > %{buildroot}%{_mandir}/man1/$(basename $man)"%{name}" done +for file in infrastructure.txt ; do + iconv -f ISO-8859-1 -t UTF-8 $file > ${file}.tmp && mv -f ${file}.tmp $file +done + # Make desktop, appdata and icon files available on the system mv %{buildroot}%{_prefix}/%{name}-%{version}/share/* %{buildroot}%{_datadir} +desktop-file-validate %{buildroot}/%{_datadir}/applications/*.desktop +appstream-util validate-relax --nonet %{buildroot}/%{_datadir}/appdata/*.appdata.xml # Correct font path sed -i -e 's|%{buildroot}%{_prefix}/%{name}-%{version}|%{_libdir}/%{name}%{shortver}|' \ @@ -215,6 +231,12 @@ fi %{_includedir}/%{name}/ %changelog +* Fri Oct 7 2016 Orion Poplawski - 7.0.4-3 +- Add patch to fix desktop file +- Validate desktop and appdata files +- Fix script interpreters +- Convert files to UTF-8 if needed + * Wed Sep 21 2016 Orion Poplawski - 7.0.4-2 - Generate rpm macro file for version tracking