diff --git a/utils/cronjobs_osgeo_lxd/cron_grass_current_stable_build_binaries.sh b/utils/cronjobs_osgeo_lxd/cron_grass_current_stable_build_binaries.sh index 5c789f0c4d..f42d04caeb 100755 --- a/utils/cronjobs_osgeo_lxd/cron_grass_current_stable_build_binaries.sh +++ b/utils/cronjobs_osgeo_lxd/cron_grass_current_stable_build_binaries.sh @@ -1,6 +1,6 @@ #!/bin/sh -# script to build GRASS GIS new current binaries + addons + progman from the `releasebranch_8_4` binaries +# script to build GRASS GIS new current binaries + addons + progman from the `releasebranch_8_4` branch # (c) 2002-2024, GPL 2+ Markus Neteler # # GRASS GIS github, https://github.com/OSGeo/grass @@ -15,7 +15,7 @@ # - generates the user 8 HTML manuals # - injects DuckDuckGo search field -# Preparations, on server: +# Preparations, on server (neteler@grasslxd:$): # - Install PROJ incl Datum shift grids # - Install GDAL # - Install apt-get install texlive-latex-extra python3-sphinxcontrib.apidoc @@ -31,7 +31,9 @@ # ln -s /var/www/code_and_data/grass84 . # ################################# -PATH=/home/neteler/binaries/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/local/bin +# variables for build environment (grass.osgeo.org specific) +MAINDIR=/home/neteler +PATH=$MAINDIR/bin:/bin:/usr/bin:/usr/local/bin GMAJOR=8 GMINOR=4 @@ -40,7 +42,6 @@ DOTVERSION=$GMAJOR.$GMINOR VERSION=$GMAJOR$GMINOR GVERSION=$GMAJOR -################### # fail early set -e @@ -49,9 +50,7 @@ CFLAGSSTRING='-O2' CFLAGSSTRING='-Werror-implicit-function-declaration -fno-common' LDFLAGSSTRING='-s' -#define several paths if required: - -MAINDIR=/home/neteler +# define GRASS GIS build related paths: # where to find the GRASS sources (git clone): SOURCE=$MAINDIR/src/ BRANCH=releasebranch_${GMAJOR}_$GMINOR @@ -78,18 +77,17 @@ halt_on_error() exit 1 } +# function to configure for compilation configure_grass() { -# which package? -# --with-mysql --with-mysql-includes=/usr/include/mysql --with-mysql-libs=/usr/lib/mysql \ - -# cleanup +# cleanup from previous run rm -f config_$GMAJOR.$GMINOR.git_log.txt # reset i18N POT files to git, just to be sure git checkout locale/templates/*.pot +# configure for compilation CFLAGS=$CFLAGSSTRING LDFLAGS=$LDFLAGSSTRING ./configure \ --with-cxx \ --with-sqlite \ @@ -104,6 +102,7 @@ CFLAGS=$CFLAGSSTRING LDFLAGS=$LDFLAGSSTRING ./configure \ --with-pdal \ --with-fftw \ --with-nls \ + --with-libsvm \ --with-blas --with-blas-includes=/usr/include/atlas/ \ --with-lapack --with-lapack-includes=/usr/include/atlas/ \ --with-zstd \ @@ -114,12 +113,12 @@ CFLAGS=$CFLAGSSTRING LDFLAGS=$LDFLAGSSTRING ./configure \ fi } -######## update from git: +# be sure the directories are there mkdir -p $TARGETDIR cd $GRASSBUILDDIR/ -# clean up +# clean up from previous run touch include/Make/Platform.make $MYMAKE distclean > /dev/null 2>&1 @@ -128,31 +127,30 @@ git status | grep '.rst' | xargs rm -f rm -rf lib/python/docs/_build/ lib/python/docs/_templates/layout.html rm -f config_${DOTVERSION}.git_log.txt ChangeLog -# be sure to be on branch +# be sure to be on the right branch git checkout $BRANCH echo "git update..." git fetch --all --prune && git checkout $BRANCH && git pull --rebase || halt_on_error "git update error!" git status -# for the contributors list in CMS +# for the "contributors list" in old CMSMS (still needed for hugo?) cp -f *.csv $TARGETMAIN/uploads/grass/ -#configure +# configure for compilation echo "configuring" configure_grass || (echo "$0: an error occurred" ; exit 1) pwd ARCH=`cat include/Make/Platform.make | grep ^ARCH | cut -d'=' -f2 | xargs` -######## now GRASS is prepared #################### - -#### next compile GRASS: +######## now GRASS GIS source code is prepared #################### +#### next compile GRASS, takes a while $MYMAKE echo "GRASS $VERSION compilation done" -# now GRASS is prepared ############################################ +######## now GRASS GIS binaries are prepared #################### #### create module overview (https://trac.osgeo.org/grass/ticket/1203) #sh utils/module_synopsis.sh @@ -175,9 +173,11 @@ rm -f $TARGETHTMLDIR/*.* cp -rp dist.$ARCH/docs/html/* $TARGETHTMLDIR/ echo "Copied pygrass progman to http://grass.osgeo.org/grass${VERSION}/manuals/libpython/" +# search to be improved with mkdocs or similar; for now we use DuckDuckGo echo "Injecting DuckDuckGo search field into manual main page..." (cd $TARGETHTMLDIR/ ; sed -i -e "s++<\!\-\- injected in cron_grass8_relbranch_build_binaries.sh \-\->
+g" index.html) +# copy important files to web space cp -p AUTHORS CHANGES CITING CITATION.cff COPYING GPL.TXT INSTALL.md REQUIREMENTS.md $TARGETDIR/ # clean wxGUI sphinx manual etc @@ -233,19 +233,19 @@ cat i18n_stats.txt | grep lib > i18n_stats_libs.txt cat i18n_stats.txt | grep wxpy > i18n_stats_wxpy.txt cd $GRASSBUILDDIR -# package the package +# package the GRASS GIS package $MYMAKE bindist if [ $? -ne 0 ] ; then halt_on_error "make bindist." fi -#report system: +# report system: echo "System: $ARCH, compiled with:" > grass-$DOTVERSION\_$ARCH\_bin.txt ## echo "Including precompiled $GDALVERSION library for r.in.gdal" >> grass-$DOTVERSION\_$ARCH\_bin.txt gcc -v 2>&1 | grep -v Reading >> grass-$DOTVERSION\_$ARCH\_bin.txt -# clean old version off +# clean old version from previous run rm -f $TARGETDIR/grass-$DOTVERSION\_$ARCH\_bin.txt rm -f $TARGETDIR/grass-${DOTVERSION}*.tar.gz rm -f $TARGETDIR/grass-${DOTVERSION}*install.sh @@ -273,7 +273,7 @@ cd $GRASSBUILDDIR # compile addons # update addon repo (addon repo has been cloned twice on the server to -# separate grass7 and grass8 addon compilation) +# have separate grass7 and grass8 addon compilation) (cd ~/src/grass$GMAJOR-addons/; git checkout grass$GMAJOR; git pull origin grass$GMAJOR) # compile addons cd $GRASSBUILDDIR @@ -298,6 +298,7 @@ for dir in `find ~/.grass$GMAJOR/addons -maxdepth 1 -type d`; do fi done sh ~/cronjobs/grass-addons-index.sh $GMAJOR $GMINOR $GPATCH $TARGETHTMLDIR/addons/ +# copy over hamburger menu assets cp $TARGETHTMLDIR/grass_logo.png \ $TARGETHTMLDIR/hamburger_menu.svg \ $TARGETHTMLDIR/hamburger_menu_close.svg \ @@ -305,7 +306,7 @@ cp $TARGETHTMLDIR/grass_logo.png \ $TARGETHTMLDIR/addons/ chmod -R a+r,g+w $TARGETHTMLDIR 2> /dev/null -# cp logs from ~/.grass$GMAJOR/addons/logs/ +# copy over logs from ~/.grass$GMAJOR/addons/logs/ mkdir -p $TARGETMAIN/addons/grass$GMAJOR/logs/ cp -p ~/.grass$GMAJOR/addons/logs/* $TARGETMAIN/addons/grass$GMAJOR/logs/ diff --git a/utils/cronjobs_osgeo_lxd/cron_grass_current_stable_src_snapshot.sh b/utils/cronjobs_osgeo_lxd/cron_grass_current_stable_src_snapshot.sh index 1724c0410a..6d020d54d1 100755 --- a/utils/cronjobs_osgeo_lxd/cron_grass_current_stable_src_snapshot.sh +++ b/utils/cronjobs_osgeo_lxd/cron_grass_current_stable_src_snapshot.sh @@ -5,12 +5,22 @@ # # GRASS GIS github, https://github.com/OSGeo/grass # -## prep -# git clone https://github.com/OSGeo/grass.git main +################################################################### +# how it works: +# - it updates locally the GRASS source code from github server +# - packages the source code tarball +# +# Preparations, on server (neteler@grasslxd:$): +# mkdir -p ~/src +# cd ~/src +# git clone https://github.com/OSGeo/grass.git release_branch_8_4 # ################################################################### - +# variables for packaging environment (grass.osgeo.org specific) MAINDIR=/home/neteler +PATH=$MAINDIR/bin:/bin:/usr/bin:/usr/local/bin + +# https://github.com/OSGeo/grass/tags GMAJOR=8 GMINOR=4 GVERSION=$GMAJOR.$GMINOR.git @@ -50,7 +60,7 @@ mkdir -p $TARGETDIR cd $SOURCE/$BRANCH/ date -# clean up +# clean up from previous run touch include/Make/Platform.make $MYMAKE distclean > /dev/null 2>&1 rm -f grass-$GMAJOR.*-install.sh grass-$GMAJOR.*.tar.gz grass-$GMAJOR.*_bin.txt @@ -73,27 +83,27 @@ git merge origin/$BRANCH git status -#generate changelog +# generate changelog touch include/Make/Platform.make # workaround for https://trac.osgeo.org/grass/ticket/3853 make changelog rm -f include/Make/Platform.make -# go to parent for packaging +# go to parent directory for packaging cd .. date -#package it (we rename the directory to have the date inside the package): +# package it (we rename the directory to have the date inside the package): DATE=`date '+_%Y_%m_%d'` mv $BRANCH $PACKAGENAME\src_snapshot$DATE # exclude version control system directories (the flag order matters!) $TAR cfz $PACKAGENAME\src_snapshot$DATE.tar.gz --exclude-vcs $PACKAGENAME\src_snapshot$DATE mv $PACKAGENAME\src_snapshot$DATE $BRANCH -#remove old snapshot: +# remove old snapshot: rm -f $TARGETDIR/$PACKAGENAME\src_snapshot* rm -f $TARGETDIR/ChangeLog.gz -#publish the new one: +# publish the new one: cd $BRANCH/ cp -p ChangeLog AUTHORS CHANGES CITING CITATION.cff COPYING GPL.TXT INSTALL.md REQUIREMENTS.md $TARGETDIR @@ -102,9 +112,9 @@ gzip $TARGETDIR/ChangeLog cp $PACKAGENAME\src_snapshot$DATE.tar.gz $TARGETDIR rm -f $PACKAGENAME\src_snapshot$DATE.tar.gz chmod a+r,g+w $TARGETDIR/* 2> /dev/null -#chgrp grass $TARGETDIR/* 2> /dev/null +# chgrp grass $TARGETDIR/* 2> /dev/null -# link for convenience: +# "latest" link for convenience: (cd $TARGETDIR ; rm -f $PACKAGENAME\src_snapshot_latest.tar.gz ; ln -s $PACKAGENAME\src_snapshot$DATE.tar.gz $PACKAGENAME\src_snapshot_latest.tar.gz) echo "Written to: $TARGETDIR diff --git a/utils/cronjobs_osgeo_lxd/cron_grass_legacy_build_binaries.sh b/utils/cronjobs_osgeo_lxd/cron_grass_legacy_build_binaries.sh index d305516a40..94cdd7ca1a 100755 --- a/utils/cronjobs_osgeo_lxd/cron_grass_legacy_build_binaries.sh +++ b/utils/cronjobs_osgeo_lxd/cron_grass_legacy_build_binaries.sh @@ -1,18 +1,10 @@ #!/bin/sh # script to build GRASS GIS legacy binaries + addons from the `releasebranch_7_8` branch -# (c) GPL 2+ Markus Neteler -# 2008-2024 +# (c) 2008-2024, GPL 2+ Markus Neteler # # GRASS GIS github, https://github.com/OSGeo/grass # -## prep, on neteler@grasslxd:$ -# mkdir -p ~/src -# cd ~/src -# # G76 G78 -> G76 unused -# for i in 6 8 ; do git clone https://github.com/OSGeo/grass.git releasebranch_7_$i ; done -# for i in 6 8 ; do (cd releasebranch_7_$i ; git checkout releasebranch_7_$i ) ; done -# ################################################################### # how it works: # - it updates locally the GRASS source code from github server @@ -22,16 +14,28 @@ # - generates the pyGRASS 7 HTML manual # - generates the user 7 HTML manuals # - injects DuckDuckGo search field -# - injects "G8 is the new version" box into core and addon manual pages +# - injects "G8.x is the new version" box into core and addon manual pages # - injects canonical URL -# Preparations, on server: +# Preparations, on server (neteler@grasslxd:$): # - Install PROJ # - Install GDAL # - Install apt-get install texlive-latex-extra python3-sphinxcontrib.apidoc -# - Clone source from github +# - Clone source from github: +# mkdir -p ~/src ; cd ~/src +# git clone https://github.com/OSGeo/grass.git releasebranch_7_8 +# cd releasebranch_7_8 +# git checkout releasebranch_7_8 +# - Prepare target directories: +# cd /var/www/code_and_data/ +# mkdir grass78 +# cd /var/www/html/ +# ln -s /var/www/code_and_data/grass78 . +# ################################# -PATH=/home/neteler/binaries/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/local/bin +# variables for build environment (grass.osgeo.org specific) +MAINDIR=/home/neteler +PATH=$MAINDIR/bin:/bin:/usr/bin:/usr/local/bin # https://github.com/OSGeo/grass/tags GMAJOR=7 @@ -45,7 +49,6 @@ DOTVERSION=$GMAJOR.$GMINOR VERSION=$GMAJOR$GMINOR GVERSION=$GMAJOR -################### # fail early set -e @@ -54,9 +57,7 @@ CFLAGSSTRING='-O2' CFLAGSSTRING='-Werror-implicit-function-declaration -fno-common' LDFLAGSSTRING='-s' -#define several paths if required: - -MAINDIR=/home/neteler +# define GRASS GIS build related paths: # where to find the GRASS sources (git clone): SOURCE=$MAINDIR/src/ BRANCH=releasebranch_${GMAJOR}_$GMINOR @@ -64,6 +65,7 @@ GRASSBUILDDIR=$SOURCE/$BRANCH TARGETMAIN=/var/www/code_and_data TARGETDIR=$TARGETMAIN/grass${VERSION}/binary/linux/snapshot TARGETHTMLDIR=$TARGETMAIN/grass${VERSION}/manuals/ + # progman not built for older dev versions or old stable, only for preview #TARGETPROGMAN=$TARGETMAIN/programming${GVERSION} @@ -82,18 +84,16 @@ halt_on_error() exit 1 } +# function to configure for compilation configure_grass() { - -# which package? -# --with-mysql --with-mysql-includes=/usr/include/mysql --with-mysql-libs=/usr/lib/mysql \ - -# cleanup +# cleanup from previous run rm -f config_$GMAJOR.$GMINOR.git_log.txt # reset i18N POT files to git, just to be sure git checkout locale/templates/*.pot +# configure for compilation CFLAGS=$CFLAGSSTRING LDFLAGS=$LDFLAGSSTRING ./configure \ --with-cxx \ --with-sqlite \ @@ -118,45 +118,41 @@ CFLAGS=$CFLAGSSTRING LDFLAGS=$LDFLAGSSTRING ./configure \ fi } -######## update from git: - +# be sure the directories are there mkdir -p $TARGETDIR cd $GRASSBUILDDIR/ -# clean up +# clean up from previous run touch include/Make/Platform.make $MYMAKE distclean > /dev/null 2>&1 - # cleanup leftover garbage git status | grep '.rst' | xargs rm -f rm -rf lib/python/docs/_build/ lib/python/docs/_templates/layout.html rm -f config_${DOTVERSION}.git_log.txt ChangeLog -# be sure to be on branch +# be sure to be on the right branch git checkout $BRANCH echo "git update..." git fetch --all --prune && git checkout $BRANCH && git pull --rebase || halt_on_error "git update error!" git status -# for the contributors list in CMS +# for the "contributors list" in old CMSMS (still needed for hugo?) cp -f *.csv $TARGETMAIN/uploads/grass/ -#configure +# configure for compilation echo "configuring" configure_grass || (echo "$0: an error occurred" ; exit 1) pwd ARCH=`cat include/Make/Platform.make | grep ^ARCH | cut -d'=' -f2 | xargs` -######## now GRASS is prepared #################### - -#### next compile GRASS: +######## now GRASS GIS source code is prepared #################### +#### next compile GRASS, takes a while $MYMAKE - echo "GRASS $VERSION compilation done" -# now GRASS is prepared ############################################ +######## now GRASS GIS binaries are prepared #################### #### create module overview (https://trac.osgeo.org/grass/ticket/1203) #sh utils/module_synopsis.sh @@ -170,7 +166,7 @@ $MYMAKE sphinxdoclib echo "Copy over the manual + pygrass HTML pages:" mkdir -p $TARGETHTMLDIR mkdir -p $TARGETHTMLDIR/addons # indeed only relevant the very first compile time -# don't destroy the addons +# don't destroy the addons during update \mv $TARGETHTMLDIR/addons /tmp rm -f $TARGETHTMLDIR/*.* (cd $TARGETHTMLDIR ; rm -rf barscales colortables icons northarrows) @@ -179,16 +175,19 @@ rm -f $TARGETHTMLDIR/*.* cp -rp dist.$ARCH/docs/html/* $TARGETHTMLDIR/ echo "Copied pygrass progman to http://grass.osgeo.org/grass${VERSION}/manuals/libpython/" -cp -p AUTHORS CHANGES CITING COPYING GPL.TXT INSTALL REQUIREMENTS.html $TARGETDIR/ - +# search to be improved with mkdocs or similar; for now we use DuckDuckGo echo "Injecting DuckDuckGo search field into manual main page..." (cd $TARGETHTMLDIR/ ; sed -i -e "s++<\!\-\- injected in cron_grass7_relbranch_build_binaries.sh \-\->
+g" index.html) +# copy important files to web space +cp -p AUTHORS CHANGES CITING COPYING GPL.TXT INSTALL REQUIREMENTS.html $TARGETDIR/ + # clean wxGUI sphinx manual etc (cd $GRASSBUILDDIR/ ; $MYMAKE cleansphinx) ############ -# generate doxygen programmers's G8 manual -> only in GRASS GIS 8 versions +# generate doxygen programmers's G8 manual +## -> no, only in GRASS GIS 8 versions ##### generate i18N stats for HTML page path: # note: the gettext POT files are managed in git and OSGeo Weblate @@ -211,19 +210,19 @@ cat i18n_stats.txt | grep lib > i18n_stats_libs.txt cat i18n_stats.txt | grep wxpy > i18n_stats_wxpy.txt cd $GRASSBUILDDIR -# package the package +# package the GRASS GIS package $MYMAKE bindist if [ $? -ne 0 ] ; then halt_on_error "make bindist." fi -#report system: +# report system: echo "System: $ARCH, compiled with:" > grass-$DOTVERSION\_$ARCH\_bin.txt ## echo "Including precompiled $GDALVERSION library for r.in.gdal" >> grass-$DOTVERSION\_$ARCH\_bin.txt gcc -v 2>&1 | grep -v Reading >> grass-$DOTVERSION\_$ARCH\_bin.txt -# clean old version off +# clean old version from previous run rm -f $TARGETDIR/grass-$DOTVERSION\_$ARCH\_bin.txt rm -f $TARGETDIR/grass-${DOTVERSION}*.tar.gz rm -f $TARGETDIR/grass-${DOTVERSION}*install.sh @@ -251,7 +250,7 @@ cd $GRASSBUILDDIR # compile addons # update addon repo (addon repo has been cloned twice on the server to -# separate grass7 and grass8 addon compilation) +# have separate grass7 and grass8 addon compilation) (cd ~/src/grass$GMAJOR-addons/; git checkout grass$GMAJOR; git pull origin grass$GMAJOR) # compile addons cd $GRASSBUILDDIR @@ -278,11 +277,7 @@ done sh ~/cronjobs/grass-addons-index.sh $GMAJOR $GMINOR $GPATCH $TARGETHTMLDIR/addons/ chmod -R a+r,g+w $TARGETHTMLDIR 2> /dev/null -# inject G8.x new version hint in a red box: into index.html and all addon manual pages -(cd $TARGETHTMLDIR/addons/ ; sed -i -e "s: Addons Manual pages: Addons Manual pages

Note\: This addon documentation is for an older version of GRASS GIS that will be discontinued soon. You should upgrade your GRASS GIS installation, and read the current addon manual page.

:g" index.html) -(cd $TARGETHTMLDIR/addons/ ; for myfile in `ls *.html` ; do sed -i -e "s:
:

Note\: This addon document is for an older version of GRASS GIS that will be discontinued soon. You should upgrade your GRASS GIS installation, and read the current addon manual page.

:g" $myfile ; done) - -# cp logs from ~/.grass$GMAJOR/addons/logs/ +# copy over logs from ~/.grass$GMAJOR/addons/logs/ mkdir -p $TARGETMAIN/addons/grass$GMAJOR/logs/ cp -p ~/.grass$GMAJOR/addons/logs/* $TARGETMAIN/addons/grass$GMAJOR/logs/ @@ -299,17 +294,29 @@ python3 $GRASSBUILDDIR/man/build_keywords.py $TARGETHTMLDIR/ $TARGETHTMLDIR/addo unset ARCH ARCH_DISTDIR GISBASE VERSION_NUMBER ############################################ -# core manual pages +# Inject hint to new current version hint in a red box into each manual page +# - cd into folder of HTML manual pages +# - run sed to replace an existing HTML string in the upper part of the HTML file +# with itself + the red box pointing to the respective stable version manual page +# --> do this for core manual pages, addons, libpython +## +# for core manual pages echo "Injecting G8.x new current version hint in a red box into MAN pages..." # inject G8.x current stable version hint in a red box: -(cd $TARGETHTMLDIR/ ; for myfile in `ls *.html` ; do sed -i -e "s:
:

Note\: This document is for an older version of GRASS GIS that will be discontinued soon. You should upgrade, and read the current manual page.

:g" $myfile ; done) +(cd $TARGETHTMLDIR/ ; for myfile in `grep -L 'document is for an older version of GRASS GIS' *.html` ; do sed -i -e "s:
:

Note\: This document is for an older version of GRASS GIS that will be discontinued soon. You should upgrade, and read the current manual page.

:g" $myfile ; done) +# also for addons, separately for landing page and addons +(cd $TARGETHTMLDIR/addons/ ; sed -i -e "s:
:

Note\: This document is for an older version of GRASS GIS that will be discontinued soon. You should upgrade, and read the current addon manual page.

:g" index.html) +(cd $TARGETHTMLDIR/addons/ ; for myfile in `grep -L 'document is for an older version of GRASS GIS' *.html` ; do sed -i -e "s:
:

Note\: This document is for an older version of GRASS GIS that will be discontinued soon. You should upgrade, and read the current manual page.

:g" $myfile ; done) # also for Python -(cd $TARGETHTMLDIR/libpython/ ; for myfile in `ls *.html` ; do sed -i -e "s:
:

Note\: This document is for an older version of GRASS GIS that will be discontinued soon. You should upgrade, and read the current Python manual page.

:g" $myfile ; done) -# (addons are done above) +(cd $TARGETHTMLDIR/libpython/ ; for myfile in `grep -L 'document is for an older version of GRASS GIS' *.html` ; do sed -i -e "s:^
:

Note\: This document is for an older version of GRASS GIS that will be discontinued soon. You should upgrade, and read the current Python manual page.

:g" $myfile ; done) # SEO: inject canonical link into all (old) manual pages to point to latest stable (avoid "duplicate content" SEO punishment) # see https://developers.google.com/search/docs/crawling-indexing/consolidate-duplicate-urls -# canonical: once again after addon manual (re)creation, only where missing +# - cd into folder of HTML manual pages +# - run sed to replace an existing HTML header string in the upper part of the HTML file +# with itself + canonical link of stable version +# --> do this for core manual pages, addons, libpython +## (cd $TARGETHTMLDIR/ ; for myfile in `grep -L 'link rel="canonical"' *.html` ; do sed -i -e "s::\n:g" $myfile ; done) (cd $TARGETHTMLDIR/addons/ ; for myfile in `grep -L 'link rel="canonical"' *.html` ; do sed -i -e "s::\n:g" $myfile ; done) (cd $TARGETHTMLDIR/libpython/ ; for myfile in `grep -L 'link rel="canonical"' *.html` ; do sed -i -e "s::\n:g" $myfile ; done) @@ -331,5 +338,6 @@ echo "Finished GRASS $VERSION $ARCH compilation." echo "Written to: $TARGETDIR" echo "Copied HTML ${GVERSION} manual to https://grass.osgeo.org/grass${VERSION}/manuals/" echo "Copied pygrass progman ${GVERSION} to https://grass.osgeo.org/grass${VERSION}/manuals/libpython/" +echo "Copied Addons ${GVERSION} to https://grass.osgeo.org/grass${VERSION}/manuals/addons/" exit 0 diff --git a/utils/cronjobs_osgeo_lxd/cron_grass_legacy_src_snapshot.sh b/utils/cronjobs_osgeo_lxd/cron_grass_legacy_src_snapshot.sh index 73d8b02fba..8ab2386d81 100755 --- a/utils/cronjobs_osgeo_lxd/cron_grass_legacy_src_snapshot.sh +++ b/utils/cronjobs_osgeo_lxd/cron_grass_legacy_src_snapshot.sh @@ -1,20 +1,27 @@ #!/bin/sh # script to build GRASS GIS legacy source package from the `releasebranch_7_8` branch -# (c) GPL 2+ Markus Neteler -# Markus Neteler 2002-2023 +# (c) 2002-2024, GPL 2+ Markus Neteler # # GRASS GIS github, https://github.com/OSGeo/grass # -## prep, neteler@osgeo6:$ -# mkdir -p ~/src -# cd ~/src -# for i in 2 4 6 ; do git clone ​https://github.com/OSGeo/grass.git releasebranch_7_$i ; done -# for i in 2 4 6 ; do (cd releasebranch_7_$i ; git checkout releasebranch_7_$i ) ; done +################################################################### +# how it works: +# - it updates locally the GRASS source code from github server +# - packages the source code tarball +# +# Preparations, on server (neteler@grasslxd:$): +# mkdir -p ~/src +# cd ~/src +# for i in 2 4 6 ; do git clone ​https://github.com/OSGeo/grass.git releasebranch_7_$i ; done +# for i in 2 4 6 ; do (cd releasebranch_7_$i ; git checkout releasebranch_7_$i ) ; done # ################################################################### - +# variables for packaging environment (grass.osgeo.org specific) MAINDIR=/home/neteler +PATH=$MAINDIR/bin:/bin:/usr/bin:/usr/local/bin + +# https://github.com/OSGeo/grass/tags GMAJOR=7 GMINOR=8 GVERSION=$GMAJOR.$GMINOR.git @@ -54,7 +61,7 @@ mkdir -p $TARGETDIR cd $SOURCE/$BRANCH/ date -# clean up +# clean up from previous run touch include/Make/Platform.make $MYMAKE distclean > /dev/null 2>&1 rm -f grass-$GMAJOR.*-install.sh grass-$GMAJOR.*.tar.gz grass-$GMAJOR.*_bin.txt @@ -64,7 +71,7 @@ git status | grep '.rst' | xargs rm -f rm -rf lib/python/docs/_build/ lib/python/docs/_templates/layout.html rm -f config_*.git_log.txt ChangeLog -# be sure to be on branch +# be sure to be on the right branch git checkout $BRANCH echo "git update..." @@ -74,27 +81,27 @@ git merge origin/$BRANCH git status -#generate changelog +# generate changelog touch include/Make/Platform.make # workaround for https://trac.osgeo.org/grass/ticket/3853 make changelog rm -f include/Make/Platform.make -# go to parent for packaging +# go to parent directory for packaging cd .. date -#package it (we rename the directory to have the date inside the package): +# package it (we rename the directory to have the date inside the package): DATE=`date '+_%Y_%m_%d'` mv $BRANCH $PACKAGENAME\src_snapshot$DATE # exclude version control system directories (the flag order matters!) $TAR cfz $PACKAGENAME\src_snapshot$DATE.tar.gz --exclude-vcs $PACKAGENAME\src_snapshot$DATE mv $PACKAGENAME\src_snapshot$DATE $BRANCH -#remove old snapshot: +# remove old snapshot: rm -f $TARGETDIR/$PACKAGENAME\src_snapshot* rm -f $TARGETDIR/ChangeLog.gz -#publish the new one: +# publish the new one: cd $BRANCH/ cp -p ChangeLog AUTHORS CHANGES CITING COPYING GPL.TXT INSTALL REQUIREMENTS.html $TARGETDIR @@ -103,9 +110,9 @@ gzip $TARGETDIR/ChangeLog cp $PACKAGENAME\src_snapshot$DATE.tar.gz $TARGETDIR rm -f $PACKAGENAME\src_snapshot$DATE.tar.gz chmod a+r,g+w $TARGETDIR/* 2> /dev/null -#chgrp grass $TARGETDIR/* 2> /dev/null +# chgrp grass $TARGETDIR/* 2> /dev/null -# link for convenience: +# "latest" link for convenience: (cd $TARGETDIR ; rm -f $PACKAGENAME\src_snapshot_latest.tar.gz ; ln -s $PACKAGENAME\src_snapshot$DATE.tar.gz $PACKAGENAME\src_snapshot_latest.tar.gz) echo "Written to: $TARGETDIR diff --git a/utils/cronjobs_osgeo_lxd/cron_grass_old_build_binaries.sh b/utils/cronjobs_osgeo_lxd/cron_grass_old_build_binaries.sh index deab81ca93..10b965a2c0 100755 --- a/utils/cronjobs_osgeo_lxd/cron_grass_old_build_binaries.sh +++ b/utils/cronjobs_osgeo_lxd/cron_grass_old_build_binaries.sh @@ -1,6 +1,6 @@ #!/bin/sh -# script to build GRASS GIS old current binaries + addons from the `releasebranch_8_3` binaries +# script to build GRASS GIS old current binaries + addons from the `releasebranch_8_3` branch # (c) 2002-2024, GPL 2+ Markus Neteler # # GRASS GIS github, https://github.com/OSGeo/grass @@ -17,7 +17,7 @@ # - injects "G8.x is the new version" box into core and addon manual pages # - injects canonical URL -# Preparations, on server: +# Preparations, on server (neteler@grasslxd:$): # - Install PROJ incl Datum shift grids # - Install GDAL # - Install apt-get install texlive-latex-extra python3-sphinxcontrib.apidoc @@ -33,7 +33,9 @@ # ln -s /var/www/code_and_data/grass83 . # ################################# -PATH=/home/neteler/binaries/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/local/bin +# variables for build environment (grass.osgeo.org specific) +MAINDIR=/home/neteler +PATH=$MAINDIR/bin:/bin:/usr/bin:/usr/local/bin # https://github.com/OSGeo/grass/tags GMAJOR=8 @@ -47,7 +49,6 @@ DOTVERSION=$GMAJOR.$GMINOR VERSION=$GMAJOR$GMINOR GVERSION=$GMAJOR -################### # fail early set -e @@ -56,9 +57,7 @@ CFLAGSSTRING='-O2' CFLAGSSTRING='-Werror-implicit-function-declaration -fno-common' LDFLAGSSTRING='-s' -#define several paths if required: - -MAINDIR=/home/neteler +# define GRASS GIS build related paths: # where to find the GRASS sources (git clone): SOURCE=$MAINDIR/src/ BRANCH=releasebranch_${GMAJOR}_$GMINOR @@ -85,18 +84,17 @@ halt_on_error() exit 1 } +# function to configure for compilation configure_grass() { -# which package? -# --with-mysql --with-mysql-includes=/usr/include/mysql --with-mysql-libs=/usr/lib/mysql \ - -# cleanup +# cleanup from previous run rm -f config_$GMAJOR.$GMINOR.git_log.txt # reset i18N POT files to git, just to be sure git checkout locale/templates/*.pot +# configure for compilation CFLAGS=$CFLAGSSTRING LDFLAGS=$LDFLAGSSTRING ./configure \ --with-cxx \ --with-sqlite \ @@ -121,12 +119,11 @@ CFLAGS=$CFLAGSSTRING LDFLAGS=$LDFLAGSSTRING ./configure \ fi } -######## update from git: - +# be sure the directories are there mkdir -p $TARGETDIR cd $GRASSBUILDDIR/ -# clean up +# clean up from previous run touch include/Make/Platform.make $MYMAKE distclean > /dev/null 2>&1 @@ -135,31 +132,30 @@ git status | grep '.rst' | xargs rm -f rm -rf lib/python/docs/_build/ lib/python/docs/_templates/layout.html rm -f config_${DOTVERSION}.git_log.txt ChangeLog -# be sure to be on branch +# be sure to be on the right branch git checkout $BRANCH echo "git update..." git fetch --all --prune && git checkout $BRANCH && git pull --rebase || halt_on_error "git update error!" git status -# for the contributors list in CMS +# for the "contributors list" in old CMSMS (still needed for hugo?) cp -f *.csv $TARGETMAIN/uploads/grass/ -#configure +# configure for compilation echo "configuring" configure_grass || (echo "$0: an error occurred" ; exit 1) pwd ARCH=`cat include/Make/Platform.make | grep ^ARCH | cut -d'=' -f2 | xargs` -######## now GRASS is prepared #################### - -#### next compile GRASS: +######## now GRASS GIS source code is prepared #################### +#### next compile GRASS, takes a while $MYMAKE echo "GRASS $VERSION compilation done" -# now GRASS is prepared ############################################ +######## now GRASS GIS binaries are prepared #################### #### create module overview (https://trac.osgeo.org/grass/ticket/1203) #sh utils/module_synopsis.sh @@ -173,7 +169,7 @@ $MYMAKE sphinxdoclib echo "Copy over the manual + pygrass HTML pages:" mkdir -p $TARGETHTMLDIR mkdir -p $TARGETHTMLDIR/addons # indeed only relevant the very first compile time -# don't destroy the addons +# don't destroy the addons during update \mv $TARGETHTMLDIR/addons /tmp rm -f $TARGETHTMLDIR/*.* (cd $TARGETHTMLDIR ; rm -rf barscales colortables icons northarrows) @@ -182,9 +178,11 @@ rm -f $TARGETHTMLDIR/*.* cp -rp dist.$ARCH/docs/html/* $TARGETHTMLDIR/ echo "Copied pygrass progman to http://grass.osgeo.org/grass${VERSION}/manuals/libpython/" +# search to be improved with mkdocs or similar; for now we use DuckDuckGo echo "Injecting DuckDuckGo search field into manual main page..." (cd $TARGETHTMLDIR/ ; sed -i -e "s+
+
<\!\-\- injected in cron_grass8_relbranch_build_binaries.sh \-\->
+g" index.html) +# copy important files to web space cp -p AUTHORS CHANGES CITING CITATION.cff COPYING GPL.TXT INSTALL.md REQUIREMENTS.md $TARGETDIR/ # clean wxGUI sphinx manual etc @@ -240,19 +238,19 @@ cat i18n_stats.txt | grep lib > i18n_stats_libs.txt cat i18n_stats.txt | grep wxpy > i18n_stats_wxpy.txt cd $GRASSBUILDDIR -# package the package +# package the GRASS GIS package $MYMAKE bindist if [ $? -ne 0 ] ; then halt_on_error "make bindist." fi -#report system: +# report system: echo "System: $ARCH, compiled with:" > grass-$DOTVERSION\_$ARCH\_bin.txt ## echo "Including precompiled $GDALVERSION library for r.in.gdal" >> grass-$DOTVERSION\_$ARCH\_bin.txt gcc -v 2>&1 | grep -v Reading >> grass-$DOTVERSION\_$ARCH\_bin.txt -# clean old version off +# clean old version from previous run rm -f $TARGETDIR/grass-$DOTVERSION\_$ARCH\_bin.txt rm -f $TARGETDIR/grass-${DOTVERSION}*.tar.gz rm -f $TARGETDIR/grass-${DOTVERSION}*install.sh @@ -280,7 +278,7 @@ cd $GRASSBUILDDIR # compile addons # update addon repo (addon repo has been cloned twice on the server to -# separate grass7 and grass8 addon compilation) +# have separate grass7 and grass8 addon compilation) (cd ~/src/grass$GMAJOR-addons/; git checkout grass$GMAJOR; git pull origin grass$GMAJOR) # compile addons cd $GRASSBUILDDIR @@ -305,6 +303,7 @@ for dir in `find ~/.grass$GMAJOR/addons -maxdepth 1 -type d`; do fi done sh ~/cronjobs/grass-addons-index.sh $GMAJOR $GMINOR $GPATCH $TARGETHTMLDIR/addons/ +# copy over hamburger menu assets cp $TARGETHTMLDIR/grass_logo.png \ $TARGETHTMLDIR/hamburger_menu.svg \ $TARGETHTMLDIR/hamburger_menu_close.svg \ @@ -312,7 +311,7 @@ cp $TARGETHTMLDIR/grass_logo.png \ $TARGETHTMLDIR/addons/ chmod -R a+r,g+w $TARGETHTMLDIR 2> /dev/null -# cp logs from ~/.grass$GMAJOR/addons/logs/ +# copy over logs from ~/.grass$GMAJOR/addons/logs/ mkdir -p $TARGETMAIN/addons/grass$GMAJOR/logs/ cp -p ~/.grass$GMAJOR/addons/logs/* $TARGETMAIN/addons/grass$GMAJOR/logs/ @@ -329,19 +328,28 @@ python3 $GRASSBUILDDIR/man/build_keywords.py $TARGETMAIN/grass$GMAJOR$GMINOR/man unset ARCH ARCH_DISTDIR GISBASE VERSION_NUMBER ############################################ - +# Inject hint to new current version hint in a red box into each manual page +# - cd into folder of HTML manual pages +# - run sed to replace an existing HTML string in the upper part of the HTML file +# with itself + the red box pointing to the respective stable version manual page +# --> do this for core manual pages, addons, libpython +## +# for core manual pages echo "Injecting G8.x new current version hint in a red box into MAN pages..." # inject G8.x current stable version hint in a red box: -(cd $TARGETHTMLDIR/ ; for myfile in `ls *.html` ; do sed -i -e "s:
:

Note\: This document is for an older version of GRASS GIS that will be discontinued soon. You should upgrade, and read the current manual page.

:g" $myfile ; done) +(cd $TARGETHTMLDIR/ ; for myfile in `grep -L 'document is for an older version of GRASS GIS' *.html` ; do sed -i -e "s:
:

Note\: This document is for an older version of GRASS GIS that will be discontinued soon. You should upgrade, and read the current manual page.

:g" $myfile ; done) # also for addons, separately for landing page and addons (cd $TARGETHTMLDIR/addons/ ; sed -i -e "s:
:

Note\: This document is for an older version of GRASS GIS that will be discontinued soon. You should upgrade, and read the current addon manual page.

:g" index.html) -(cd $TARGETHTMLDIR/addons/ ; for myfile in `ls *.html` ; do sed -i -e "s:
:

Note\: This document is for an older version of GRASS GIS that will be discontinued soon. You should upgrade, and read the current manual page.

:g" $myfile ; done) +(cd $TARGETHTMLDIR/addons/ ; for myfile in `grep -L 'document is for an older version of GRASS GIS' *.html` ; do sed -i -e "s:
:

Note\: This document is for an older version of GRASS GIS that will be discontinued soon. You should upgrade, and read the current manual page.

:g" $myfile ; done) # also for Python -(cd $TARGETHTMLDIR/libpython/ ; for myfile in `ls *.html` ; do sed -i -e "s:
:

Note\: This document is for an older version of GRASS GIS that will be discontinued soon. You should upgrade, and read the current Python manual page.

:g" $myfile ; done) +(cd $TARGETHTMLDIR/libpython/ ; for myfile in `grep -L 'document is for an older version of GRASS GIS' *.html` ; do sed -i -e "s:^
:

Note\: This document is for an older version of GRASS GIS that will be discontinued soon. You should upgrade, and read the current Python manual page.

:g" $myfile ; done) # SEO: inject canonical link into all (old) manual pages to point to latest stable (avoid "duplicate content" SEO punishment) # see https://developers.google.com/search/docs/crawling-indexing/consolidate-duplicate-urls -# canonical: once again after addon manual (re)creation, only where missing +# - cd into folder of HTML manual pages +# - run sed to replace an existing HTML header string in the upper part of the HTML file +# with itself + canonical link of stable version +# --> do this for core manual pages, addons, libpython (cd $TARGETHTMLDIR/ ; for myfile in `grep -L 'link rel="canonical"' *.html` ; do sed -i -e "s::\n:g" $myfile ; done) (cd $TARGETHTMLDIR/addons/ ; for myfile in `grep -L 'link rel="canonical"' *.html` ; do sed -i -e "s::\n:g" $myfile ; done) (cd $TARGETHTMLDIR/libpython/ ; for myfile in `grep -L 'link rel="canonical"' *.html` ; do sed -i -e "s::\n:g" $myfile ; done) diff --git a/utils/cronjobs_osgeo_lxd/cron_grass_old_src_snapshot.sh b/utils/cronjobs_osgeo_lxd/cron_grass_old_src_snapshot.sh index d6581d77b7..a70871c787 100755 --- a/utils/cronjobs_osgeo_lxd/cron_grass_old_src_snapshot.sh +++ b/utils/cronjobs_osgeo_lxd/cron_grass_old_src_snapshot.sh @@ -5,12 +5,22 @@ # # GRASS GIS github, https://github.com/OSGeo/grass # -## prep -# git clone https://github.com/OSGeo/grass.git release_branch_8_2 +################################################################### +# how it works: +# - it updates locally the GRASS source code from github server +# - packages the source code tarball +# +# Preparations, on server (neteler@grasslxd:$): +# mkdir -p ~/src +# cd ~/src +# git clone https://github.com/OSGeo/grass.git release_branch_8_3 # ################################################################### - +# variables for packaging environment (grass.osgeo.org specific) MAINDIR=/home/neteler +PATH=$MAINDIR/bin:/bin:/usr/bin:/usr/local/bin + +# https://github.com/OSGeo/grass/tags GMAJOR=8 GMINOR=3 GVERSION=$GMAJOR.$GMINOR.git @@ -50,7 +60,7 @@ mkdir -p $TARGETDIR cd $SOURCE/$BRANCH/ date -# clean up +# clean up from previous run touch include/Make/Platform.make $MYMAKE distclean > /dev/null 2>&1 rm -f grass-$GMAJOR.*-install.sh grass-$GMAJOR.*.tar.gz grass-$GMAJOR.*_bin.txt @@ -58,7 +68,7 @@ rm -f grass-$GMAJOR.*-install.sh grass-$GMAJOR.*.tar.gz grass-$GMAJOR.*_bin.txt # cleanup leftover garbage git status | grep '.rst' | xargs rm -f rm -rf lib/python/docs/_build/ lib/python/docs/_templates/layout.html -srm -f config_*.git_log.txt ChangeLog +rm -f config_*.git_log.txt ChangeLog # reset i18N POT files to git, just to be sure git checkout locale/templates/*.pot @@ -73,27 +83,27 @@ git merge origin/$BRANCH git status -#generate changelog +# generate changelog touch include/Make/Platform.make # workaround for https://trac.osgeo.org/grass/ticket/3853 make changelog rm -f include/Make/Platform.make -# go to parent for packaging +# go to parent directory for packaging cd .. date -#package it (we rename the directory to have the date inside the package): +# package it (we rename the directory to have the date inside the package): DATE=`date '+_%Y_%m_%d'` mv $BRANCH $PACKAGENAME\src_snapshot$DATE # exclude version control system directories (the flag order matters!) $TAR cfz $PACKAGENAME\src_snapshot$DATE.tar.gz --exclude-vcs $PACKAGENAME\src_snapshot$DATE mv $PACKAGENAME\src_snapshot$DATE $BRANCH -#remove old snapshot: +# remove old snapshot: rm -f $TARGETDIR/$PACKAGENAME\src_snapshot* rm -f $TARGETDIR/ChangeLog.gz -#publish the new one: +# publish the new one: cd $BRANCH/ cp -p ChangeLog AUTHORS CHANGES CITING CITATION.cff COPYING GPL.TXT INSTALL.md REQUIREMENTS.html $TARGETDIR @@ -102,9 +112,9 @@ gzip $TARGETDIR/ChangeLog cp $PACKAGENAME\src_snapshot$DATE.tar.gz $TARGETDIR rm -f $PACKAGENAME\src_snapshot$DATE.tar.gz chmod a+r,g+w $TARGETDIR/* 2> /dev/null -#chgrp grass $TARGETDIR/* 2> /dev/null +# chgrp grass $TARGETDIR/* 2> /dev/null -# link for convenience: +# "latest" link for convenience: (cd $TARGETDIR ; rm -f $PACKAGENAME\src_snapshot_latest.tar.gz ; ln -s $PACKAGENAME\src_snapshot$DATE.tar.gz $PACKAGENAME\src_snapshot_latest.tar.gz) echo "Written to: $TARGETDIR diff --git a/utils/cronjobs_osgeo_lxd/cron_grass_preview_build_binaries.sh b/utils/cronjobs_osgeo_lxd/cron_grass_preview_build_binaries.sh index 8760762cac..fe290bcab2 100755 --- a/utils/cronjobs_osgeo_lxd/cron_grass_preview_build_binaries.sh +++ b/utils/cronjobs_osgeo_lxd/cron_grass_preview_build_binaries.sh @@ -1,6 +1,6 @@ #!/bin/sh -# script to build GRASS GIS preview binaries + addons from the `main` +# script to build GRASS GIS preview binaries + addons from the `main` branch # (c) 2002-2024, GPL 2+ Markus Neteler # # GRASS GIS github, https://github.com/OSGeo/grass @@ -16,7 +16,7 @@ # - generates the user 8 HTML manuals # - injects DuckDuckGo search field -# Preparations, on server: +# Preparations, on server (neteler@grasslxd:$): # - Install PROJ incl Datum shift grids # - Install GDAL # - Install apt-get install texlive-latex-extra python3-sphinxcontrib.apidoc @@ -30,7 +30,9 @@ # ln -s /var/www/code_and_data/grass84 . # ################################# -PATH=/home/neteler/binaries/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/local/bin +# variables for build environment (grass.osgeo.org specific) +MAINDIR=/home/neteler +PATH=$MAINDIR/bin:/bin:/usr/bin:/usr/local/bin GMAJOR=8 GMINOR=5 @@ -39,7 +41,6 @@ DOTVERSION=$GMAJOR.$GMINOR VERSION=$GMAJOR$GMINOR GVERSION=$GMAJOR -################### # fail early set -e @@ -48,9 +49,7 @@ CFLAGSSTRING='-O2' CFLAGSSTRING='-Werror-implicit-function-declaration -fno-common' LDFLAGSSTRING='-s' -#define several paths if required: - -MAINDIR=/home/neteler +# define GRASS GIS build related paths: # where to find the GRASS sources (git clone): SOURCE=$MAINDIR/src/ BRANCH=main @@ -78,18 +77,17 @@ halt_on_error() exit 1 } +# function to configure for compilation configure_grass() { -# which package? -# --with-mysql --with-mysql-includes=/usr/include/mysql --with-mysql-libs=/usr/lib/mysql \ - -# cleanup +# cleanup from previous run rm -f config_$GMAJOR.$GMINOR.git_log.txt # reset i18N POT files to git, just to be sure git checkout locale/templates/*.pot +# configure for compilation CFLAGS=$CFLAGSSTRING LDFLAGS=$LDFLAGSSTRING ./configure \ --with-cxx \ --with-sqlite \ @@ -115,12 +113,11 @@ CFLAGS=$CFLAGSSTRING LDFLAGS=$LDFLAGSSTRING ./configure \ fi } -######## update from git: - +# be sure the directories are there mkdir -p $TARGETDIR cd $GRASSBUILDDIR/ -# clean up +# clean up from previous run touch include/Make/Platform.make $MYMAKE distclean > /dev/null 2>&1 @@ -129,31 +126,30 @@ git status | grep '.rst' | xargs rm -f rm -rf lib/python/docs/_build/ lib/python/docs/_templates/layout.html rm -f config_${DOTVERSION}.git_log.txt ChangeLog -# be sure to be on branch +# be sure to be on the right branch git checkout $BRANCH echo "git update..." git fetch --all --prune && git checkout $BRANCH && git pull --rebase || halt_on_error "git update error!" git status -# for the contributors list in CMS +# for the "contributors list" in old CMSMS (still needed for hugo?) cp -f *.csv $TARGETMAIN/uploads/grass/ -#configure +# configure for compilation echo "configuring" configure_grass || (echo "$0: an error occurred" ; exit 1) pwd ARCH=`cat include/Make/Platform.make | grep ^ARCH | cut -d'=' -f2 | xargs` -######## now GRASS is prepared #################### - -#### next compile GRASS: +######## now GRASS GIS source code is prepared #################### +#### next compile GRASS, takes a while $MYMAKE echo "GRASS $VERSION compilation done" -# now GRASS is prepared ############################################ +######## now GRASS GIS binaries are prepared #################### #### create module overview (https://trac.osgeo.org/grass/ticket/1203) #sh utils/module_synopsis.sh @@ -167,7 +163,7 @@ $MYMAKE sphinxdoclib echo "Copy over the manual + pygrass HTML pages:" mkdir -p $TARGETHTMLDIR mkdir -p $TARGETHTMLDIR/addons # indeed only relevant the very first compile time -# don't destroy the addons +# don't destroy the addons during update \mv $TARGETHTMLDIR/addons /tmp rm -f $TARGETHTMLDIR/*.* (cd $TARGETHTMLDIR ; rm -rf barscales colortables icons northarrows) @@ -176,9 +172,11 @@ rm -f $TARGETHTMLDIR/*.* cp -rp dist.$ARCH/docs/html/* $TARGETHTMLDIR/ echo "Copied pygrass progman to http://grass.osgeo.org/grass${VERSION}/manuals/libpython/" +# search to be improved with mkdocs or similar; for now we use DuckDuckGo echo "Injecting DuckDuckGo search field into manual main page..." (cd $TARGETHTMLDIR/ ; sed -i -e "s+
+
<\!\-\- injected in cron_grass8_relbranch_build_binaries.sh \-\->
+g" index.html) +# copy important files to web space cp -p AUTHORS CHANGES CITING CITATION.cff COPYING GPL.TXT INSTALL.md REQUIREMENTS.md $TARGETDIR/ # clean wxGUI sphinx manual etc @@ -233,19 +231,19 @@ cat i18n_stats.txt | grep lib > i18n_stats_libs.txt cat i18n_stats.txt | grep wxpy > i18n_stats_wxpy.txt cd $GRASSBUILDDIR -# package the package +# package the GRASS GIS package $MYMAKE bindist if [ $? -ne 0 ] ; then halt_on_error "make bindist." fi -#report system: +# report system: echo "System: $ARCH, compiled with:" > grass-$DOTVERSION\_$ARCH\_bin.txt ## echo "Including precompiled $GDALVERSION library for r.in.gdal" >> grass-$DOTVERSION\_$ARCH\_bin.txt gcc -v 2>&1 | grep -v Reading >> grass-$DOTVERSION\_$ARCH\_bin.txt -# clean old version off +# clean old version from previous run rm -f $TARGETDIR/grass-$DOTVERSION\_$ARCH\_bin.txt rm -f $TARGETDIR/grass-${DOTVERSION}*.tar.gz rm -f $TARGETDIR/grass-${DOTVERSION}*install.sh @@ -273,7 +271,7 @@ cd $GRASSBUILDDIR # compile addons # update addon repo (addon repo has been cloned twice on the server to -# separate grass7 and grass8 addon compilation) +# have separate grass7 and grass8 addon compilation) (cd ~/src/grass$GMAJOR-addons/; git checkout grass$GMAJOR; git pull origin grass$GMAJOR) # compile addons cd $GRASSBUILDDIR @@ -298,6 +296,7 @@ for dir in `find ~/.grass$GMAJOR/addons -maxdepth 1 -type d`; do fi done sh ~/cronjobs/grass-addons-index.sh $GMAJOR $GMINOR $GPATCH $TARGETHTMLDIR/addons/ +# copy over hamburger menu assets cp $TARGETHTMLDIR/grass_logo.png \ $TARGETHTMLDIR/hamburger_menu.svg \ $TARGETHTMLDIR/hamburger_menu_close.svg \ @@ -305,7 +304,7 @@ cp $TARGETHTMLDIR/grass_logo.png \ $TARGETHTMLDIR/addons/ chmod -R a+r,g+w $TARGETHTMLDIR 2> /dev/null -# cp logs from ~/.grass$GMAJOR/addons/logs/ +# copy over logs from ~/.grass$GMAJOR/addons/logs/ mkdir -p $TARGETMAIN/addons/grass$GMAJOR/logs/ cp -p ~/.grass$GMAJOR/addons/logs/* $TARGETMAIN/addons/grass$GMAJOR/logs/ diff --git a/utils/cronjobs_osgeo_lxd/cron_grass_preview_src_snapshot.sh b/utils/cronjobs_osgeo_lxd/cron_grass_preview_src_snapshot.sh index 687f8a063c..c3851b56fc 100755 --- a/utils/cronjobs_osgeo_lxd/cron_grass_preview_src_snapshot.sh +++ b/utils/cronjobs_osgeo_lxd/cron_grass_preview_src_snapshot.sh @@ -5,12 +5,22 @@ # # GRASS GIS github, https://github.com/OSGeo/grass # -## prep -# git clone https://github.com/OSGeo/grass.git main +################################################################### +# how it works: +# - it updates locally the GRASS source code from github server +# - packages the source code tarball +# +# Preparations, on server (neteler@grasslxd:$): +# mkdir -p ~/src +# cd ~/src +# git clone https://github.com/OSGeo/grass.git main # ################################################################### - +# variables for packaging environment (grass.osgeo.org specific) MAINDIR=/home/neteler +PATH=$MAINDIR/bin:/bin:/usr/bin:/usr/local/bin + +# https://github.com/OSGeo/grass/tags GMAJOR=8 GMINOR=5 GVERSION=$GMAJOR.$GMINOR.git @@ -50,7 +60,7 @@ mkdir -p $TARGETDIR cd $SOURCE/$BRANCH/ date -# clean up +# clean up from previous run touch include/Make/Platform.make $MYMAKE distclean > /dev/null 2>&1 rm -f grass-$GMAJOR.*-install.sh grass-$GMAJOR.*.tar.gz grass-$GMAJOR.*_bin.txt @@ -73,27 +83,27 @@ git merge origin/$BRANCH git status -#generate changelog +# generate changelog touch include/Make/Platform.make # workaround for https://trac.osgeo.org/grass/ticket/3853 make changelog rm -f include/Make/Platform.make -# go to parent for packaging +# go to parent directory for packaging cd .. date -#package it (we rename the directory to have the date inside the package): +# package it (we rename the directory to have the date inside the package): DATE=`date '+_%Y_%m_%d'` mv $BRANCH $PACKAGENAME\src_snapshot$DATE # exclude version control system directories (the flag order matters!) $TAR cfz $PACKAGENAME\src_snapshot$DATE.tar.gz --exclude-vcs $PACKAGENAME\src_snapshot$DATE mv $PACKAGENAME\src_snapshot$DATE $BRANCH -#remove old snapshot: +# remove old snapshot: rm -f $TARGETDIR/$PACKAGENAME\src_snapshot* rm -f $TARGETDIR/ChangeLog.gz -#publish the new one: +# publish the new one: cd $BRANCH/ cp -p ChangeLog AUTHORS CHANGES CITING CITATION.cff COPYING GPL.TXT INSTALL.md REQUIREMENTS.md $TARGETDIR @@ -102,9 +112,9 @@ gzip $TARGETDIR/ChangeLog cp $PACKAGENAME\src_snapshot$DATE.tar.gz $TARGETDIR rm -f $PACKAGENAME\src_snapshot$DATE.tar.gz chmod a+r,g+w $TARGETDIR/* 2> /dev/null -#chgrp grass $TARGETDIR/* 2> /dev/null +# chgrp grass $TARGETDIR/* 2> /dev/null -# link for convenience: +# "latest" link for convenience: (cd $TARGETDIR ; rm -f $PACKAGENAME\src_snapshot_latest.tar.gz ; ln -s $PACKAGENAME\src_snapshot$DATE.tar.gz $PACKAGENAME\src_snapshot_latest.tar.gz) echo "Written to: $TARGETDIR