[grass] MOVE SED CALLS BACK TO INSTALL SECTION

Volker Fröhlich volter at fedoraproject.org
Wed Nov 23 15:55:59 UTC 2011


commit 2cf3b766c6f537a98bdade86e2e88329a67a81b5
Author: Volker Fröhlich <volker27 at gmx.at>
Date:   Wed Nov 23 16:55:34 2011 +0100

    MOVE SED CALLS BACK TO INSTALL SECTION

 grass.spec |   69 +++++++++++++++++++++++++++---------------------------------
 1 files changed, 31 insertions(+), 38 deletions(-)
---
diff --git a/grass.spec b/grass.spec
index 7f98036..5525547 100644
--- a/grass.spec
+++ b/grass.spec
@@ -25,7 +25,7 @@
 
 Name:      grass
 Version:   6.4.1
-Release:   4%{?dist}
+Release:   5%{?dist}
 Summary:   GRASS - Geographic Resources Analysis Support System
 Group:     Applications/Engineering
 License:   GPLv2+
@@ -163,43 +163,6 @@ done
 # EOL wrong
 sed -i -e 's|\r||g' gui/icons/%{name}/vdigit/box.xbm
 
-# Correct paths for locales
-# Ignore the GISBASE environment variable for locales
-sed -i 's|gisbase = getenv("GISBASE");|gisbase = "%{_datadir}";|' \
-    lib/gis/locale.c
-
-# Replace GISBASE environment variable with paths that match our locale file layout
-sed -i 's|\$GISBASE/locale|%{_datadir}/locale|' \
-    lib/init/init.sh
-
-sed -i -e 's|os.path.join(os.getenv("GISBASE"), '\''locale'\''|os.path.join('\''%{_datadir}'\'', '\''locale'\''|' \
-    -e 's|os.path.join(os.getenv("GISBASE"), "etc"|os.path.join(\"%{_libdir}/%{name}-%{version}\", "etc"|' \
-    -e 's|self.gisbase  = os.getenv("GISBASE")|self.gisbase = "%{_docdir}/%{name}-%{version}"|' \
-    gui/wxpython/gui_modules/*.py gui/wxpython/*.py gui/wxpython/scripts/vkrige.py lib/python/*.py
-
-# Correct paths for documentation
-# Replace GISBASE environment variable with paths, that match our documentation file layout
-sed -i -e 's|$env(GISBASE)/docs/|%{_docdir}/%{name}-%{version}/docs/|' \
-    lib/init/gis_set.tcl \
-    lib/gis/gui.tcl \
-    visualization/nviz/scripts/nviz2.2_script
-sed -i -e 's|%{name}-%{version}/docs|%{name}-%{version}|g' \
-    -e 's|C_BASE="$GISBASE"|C_BASE=\"%{_docdir}/%{name}-%{version}/docs"|g' \
-    scripts/g.manual/g.manual
-sed -i -e 's|(\"GISBASE\"), \"docs\", \"html\", \"icons\", \"silk\")|(\"GISBASE\"), \"icons\", \"silk\")|g' \
-    gui/wxpython/icons/icon.py
-sed -i -e 's|self.fspath = os.path.join(gisbase|self.fspath = os.path.join("%{_docdir}/%{name}-%{version}\"|' \
-    gui/wxpython/gui_modules/ghelp.py
-sed -i 's|file://$env(GISBASE)|file://%{_docdir}/%{name}-%{version}|' \
-    raster/r.li/r.li.setup/r.li.setup.main
-sed -i 's|GRASS_DOC_BASE=`check_docbase "$GISBASE"`|GRASS_DOC_BASE=%{_docdir}/%{name}-%{version}|' \
-    scripts/g.manual/g.manual
-
-# Exceptional path for files used in the GUI as well
-#TODO: Could include those files in the main package too
-sed -i -e 's|os\.getenv("GISBASE")|\"%{_docdir}/%{name}-libs-%{version}\"|' \
-    gui/wxpython/gui_modules/ghelp.py
-
 
 %build
 # Keep timestamp over install section
@@ -250,6 +213,32 @@ make prefix=%{buildroot}%{_prefix} BINDIR=%{buildroot}%{_bindir} \
 sed -i -e "1,\$s&^GISBASE.*&GISBASE=%{_libdir}/%{name}-%{version}&"  \
     %{buildroot}%{_bindir}/%{name}%{shortversion}
 
+# Sadly, parts of the following can't be done safely in prep,
+# hence they're done here
+# Replace GISBASE environment variable with paths that match our documentation file layout
+sed -i -e 's|$env(GISBASE)/docs/|%{_docdir}/%{name}-%{version}/docs/|' \
+    %{buildroot}%{_prefix}/%{name}-%{version}/etc/gis_set.tcl \
+    %{buildroot}%{_prefix}/%{name}-%{version}/etc/gui.tcl \
+    %{buildroot}%{_prefix}/%{name}-%{version}/etc/nviz2.2/scripts/nviz2.2_script
+sed -i -e 's|C_BASE="$GISBASE"|C_BASE=\"%{_docdir}/%{name}-%{version}/docs"|g' \
+    %{buildroot}%{_prefix}/%{name}-%{version}/scripts/g.manual
+sed -i -e 's|%{name}-%{version}/docs|%{name}-%{version}|g' \
+    %{buildroot}%{_prefix}/%{name}-%{version}/scripts/g.manual
+sed -i -e 's|(\"GISBASE\"), \"docs\", \"html\", \"icons\", \"silk\")|(\"GISBASE\"), \"icons\", \"silk\")|g' \
+    %{buildroot}%{_prefix}/%{name}-%{version}/etc/wxpython/icons/icon.py
+sed -i -e 's|self.fspath = os.path.join(gisbase|self.fspath = os.path.join("%{_docdir}/%{name}-%{version}\"|' \
+    %{buildroot}%{_prefix}/%{name}-%{version}/etc/wxpython/gui_modules/ghelp.py
+sed -i 's|file://$env(GISBASE)|file://%{_docdir}/%{name}-%{version}|' %{buildroot}%{_prefix}/%{name}-%{version}/etc/r.li.setup/r.li.setup.main
+sed -i 's|GRASS_DOC_BASE=`check_docbase "$GISBASE"`|GRASS_DOC_BASE=%{_docdir}/%{name}-%{version}|' %{buildroot}%{_prefix}/%{name}-%{version}/scripts/g.manual
+
+# Exceptional path for files used in the GUI as well
+#TODO: Could include them in the main package too
+sed -i -e 's|os\.getenv("GISBASE")|\"%{_docdir}/%{name}-libs-%{version}\"|' \
+    %{buildroot}%{_prefix}/%{name}-%{version}/etc/wxpython/gui_modules/ghelp.py
+
+#TODO: Quotes and linebreaks in sed calls
+# Replace GISBASE environment variable with paths that match our locale file layout
+sed -i -e 's|os.path.join(os.getenv("GISBASE"), '\''locale'\''|os.path.join('\''%{_datadir}'\'', '\''locale'\''|' -e 's|os.path.join(os.getenv("GISBASE"), "etc"|os.path.join(\"%{_libdir}/%{name}-%{version}\", "etc"|' -e 's|self.gisbase  = os.getenv("GISBASE")|self.gisbase = "%{_docdir}/%{name}-%{version}"|' %{buildroot}%{_prefix}/%{name}-%{version}/etc/wxpython/gui_modules/*.py %{buildroot}%{_prefix}/%{name}-%{version}/etc/wxpython/*.py %{buildroot}%{_prefix}/%{name}-%{version}/etc/wxpython/scripts/vkrige %{buildroot}%{_prefix}/%{name}-%{version}/etc/python/grass/script/*.py
 
 # Make grass headers and libraries available on the system
 mv %{buildroot}%{_prefix}/%{name}-%{version}/lib/ %{buildroot}%{_libdir}
@@ -395,6 +384,10 @@ rm -rf %{buildroot}
 
 
 %changelog
+* Wed Nov 02 2011 Volker Fröhlich <volker27 at gmx.at> - 6.4.1-5
+- Move string substitution back to the install section, because
+  it causes problems otherwise
+
 * Wed Nov 02 2011 Volker Fröhlich <volker27 at gmx.at> - 6.4.1-4
 - Remove encoding from desktop file
 - Remove BR on wxGTK, because wxGTK requires it anyway


More information about the scm-commits mailing list