Version "name" of installer and snap is now deduced from beremiz' version.py
authorEdouard Tisserant <edouard.tisserant@gmail.com>
Sun, 21 Aug 2022 19:27:35 +0200
changeset 101 5799370243c0
parent 100 ef5ecf478dde
child 102 86aab112a8f4
Version "name" of installer and snap is now deduced from beremiz' version.py
Makefile
snap/snapcraft.yaml
windows_installer.mk
--- a/Makefile	Wed Aug 17 09:44:06 2022 +0200
+++ b/Makefile	Sun Aug 21 19:27:35 2022 +0200
@@ -15,7 +15,8 @@
 HGROOT ?= $(abspath $(src)/..)
 GITROOT := $(HGROOT)
 CPUS := `cat /proc/cpuinfo | grep -e 'processor\W*:\W*[[:digit:]]*' | nl -n ln | tail -n1 | cut -f1`
-BLKDEV=/dev/null
+
+BVERSION=$(shell python2 sources/beremiz/version.py)
 
 distfiles = $(src)/distfiles
 sfmirror = downloads
--- a/snap/snapcraft.yaml	Wed Aug 17 09:44:06 2022 +0200
+++ b/snap/snapcraft.yaml	Sun Aug 21 19:27:35 2022 +0200
@@ -1,14 +1,18 @@
 name: beremiz
-version: '1.3-beta2'
-summary: Beremiz
+adopt-info: beremiz
+summary: Beremiz Open Source PLC.
 description: |
   Beremiz is Free and Open Source PLC. It brings Free Software IDE (GPL) and Runtime (LGPL) for machine automation, conforming to IEC-61131.
-# TODO icon
+icon: snap/gui/beremiz.png
+contact: 
+  - https://beremiz.org
+  - snap@beremiz.fr
 
 
 grade: devel
-confinement: devmode
+confinement: strict
 base: core20
+architectures: [amd64, arm64]
 
 parts:
 
@@ -77,6 +81,9 @@
       - linux-libc-dev
       - libgcc-9-dev
       - libgcc-s1
+    override-pull: |
+      snapcraftctl pull
+      snapcraftctl set-version `python2 $SNAPCRAFT_PART_SRC/version.py`
     override-build: |
       cp -a $SNAPCRAFT_PART_SRC $SNAPCRAFT_PART_INSTALL/beremiz
 
@@ -144,16 +151,25 @@
       SYSROOT: $SNAP
     command: usr/bin/python2 $SNAP/beremiz/Beremiz.py
     extensions: [gnome-3-38]
+    plugs:
+      - network
+      - network-bind
 
   beremiz:
     # Beremiz Command Line interface
     environment:
       SYSROOT: $SNAP
     command: usr/bin/python2 $SNAP/beremiz/Beremiz_cli.py
+    plugs:
+      - network
+      - network-bind
  
   runtime:
     # Standalone runtime
     environment:
       SYSROOT: $SNAP
     command: usr/bin/python2 $SNAP/beremiz/Beremiz_service.py
+    plugs:
+      - network
+      - network-bind
 
--- a/windows_installer.mk	Wed Aug 17 09:44:06 2022 +0200
+++ b/windows_installer.mk	Sun Aug 21 19:27:35 2022 +0200
@@ -1,4 +1,4 @@
-TIMESTAMP=$(shell date '+%y.%m.%d')
+BVERSION=$(shell python2 sources/beremiz/version.py)
 
 CROSS_COMPILE=i686-w64-mingw32
 CROSS_COMPILE_LIBS_DIR=$(shell dirname $(shell $(CROSS_COMPILE)-gcc -print-libgcc-file-name))
@@ -132,21 +132,21 @@
 $(ide_revisions): revisions.txt
 	cp $< $@ 
 
-Beremiz-build: Beremiz-$(TIMESTAMP)_build
-Beremiz-$(TIMESTAMP)_build: $(mingw32finaldir) $(pydir)/.stamp $(matiecdir)/.stamp $(beremizdir)/.stamp ide_targets_from_dist $(ide_revisions)
+Beremiz-build: Beremiz-$(BVERSION)_build
+Beremiz-$(BVERSION)_build: $(mingw32finaldir) $(pydir)/.stamp $(matiecdir)/.stamp $(beremizdir)/.stamp ide_targets_from_dist $(ide_revisions)
 	touch $@
 
-Beremiz-archive: Beremiz-$(TIMESTAMP).zip
+Beremiz-archive: Beremiz-$(BVERSION).zip
 
-Beremiz-installer: Beremiz-$(TIMESTAMP).exe
+Beremiz-installer: Beremiz-$(BVERSION).exe
 
-Beremiz-$(TIMESTAMP).zip: Beremiz-$(TIMESTAMP)_build
+Beremiz-$(BVERSION).zip: Beremiz-$(BVERSION)_build
 	rm -f $@
 	cd installer; zip -r -q ../$@ .
 
-Beremiz-$(TIMESTAMP).exe: Beremiz-$(TIMESTAMP)_build $(src)/license.txt $(src)/install.nsi 
-	sed -e 's/\$$BVERSION/$(TIMESTAMP)/g' $(src)/license.txt > installer/license.txt
-	sed -e 's/\$$BVERSION/$(TIMESTAMP)/g' $(src)/install.nsi |\
+Beremiz-$(BVERSION).exe: Beremiz-$(BVERSION)_build $(src)/license.txt $(src)/install.nsi 
+	sed -e 's/\$$BVERSION/$(BVERSION)/g' $(src)/license.txt > installer/license.txt
+	sed -e 's/\$$BVERSION/$(BVERSION)/g' $(src)/install.nsi |\
 	makensis -