diff --git a/win-linux/package/windows/Makefile.mk b/win-linux/package/windows/Makefile.mk index e0c28533f..759edd591 100644 --- a/win-linux/package/windows/Makefile.mk +++ b/win-linux/package/windows/Makefile.mk @@ -27,10 +27,10 @@ VCREDIST += $(VCREDIST13) endif VCREDIST += $(VCREDIST15) -BUILD_TIMESTAMP = $(shell date +%s) APPCAST := win-linux/package/windows/update/appcast.xml CHANGES_EN := win-linux/package/windows/update/changes.html CHANGES_RU := win-linux/package/windows/update/changes_ru.html +CHANGES_DIR := $(BRANDING_DIR)/win-linux/package/windows/update/changes/$(PRODUCT_VERSION) DEPLOY_JSON := win-linux/package/windows/deploy.json EXE_URI := $(COMPANY_NAME_LOW)/$(RELEASE_BRANCH)/windows/$(notdir $(DESKTOP_EDITORS_EXE)) @@ -190,19 +190,19 @@ endif deploy: $(DEPLOY) $(DEPLOY_JSON) -M4_PARAMS += -D M4_COMPANY_NAME="$(COMPANY_NAME)" -M4_PARAMS += -D M4_PRODUCT_NAME="$(PRODUCT_NAME)" -M4_PARAMS += -D M4_PACKAGE_VERSION="$(PACKAGE_VERSION)" -M4_PARAMS += -D M4_BUILD_TIMESTAMP="$(shell date +%s)" +AWK_PARAMS += -v Version="$(PRODUCT_VERSION)" +AWK_PARAMS += -v Build="$(BUILD_NUMBER)" +AWK_PARAMS += -v Timestamp="$(shell date +%s)" +AWK_PARAMS += -i "$(BRANDING_DIR)/win-linux/package/windows/update/branding.awk" -$(APPCAST): - m4 $(M4_PARAMS) $(BRANDING_DIR)/win-linux/package/windows/update/appcast.xml.m4 > $@ +%/appcast.xml: %/appcast.xml.awk + LANG=en_US.UTF-8 \ + awk $(AWK_PARAMS) -f $< > $@ -$(CHANGES_EN): L10N=en -$(CHANGES_RU): L10N=ru +%/changes.html: %/changes.html.awk + LANG=en_US.UTF-8 \ + awk $(AWK_PARAMS) -f $< "$(CHANGES_DIR)/en.html" > $@ -$(CHANGES_EN) $(CHANGES_RU): - m4 $(M4_PARAMS) -D L10N="$(L10N)" $(BRANDING_DIR)/win-linux/package/windows/update/changes.html.m4 > $@ - -% : %.m4 - m4 $(M4_PARAMS) $< > $@ +%/changes_ru.html: %/changes.html.awk + LANG=ru_RU.UTF-8 \ + awk $(AWK_PARAMS) -f $< "$(CHANGES_DIR)/ru.html" > $@ diff --git a/win-linux/package/windows/update/appcast.xml.awk b/win-linux/package/windows/update/appcast.xml.awk new file mode 100644 index 000000000..947399835 --- /dev/null +++ b/win-linux/package/windows/update/appcast.xml.awk @@ -0,0 +1,55 @@ +BEGIN { + Title = AppcastProductTitle " Changelog"; + PubDate = strftime("%a, %e %b %Y %H:%M:%S %z", Timestamp, "0"); + SparkleVersion = Version "." Build; + + print ""; + print ""; + print " "; + print " " Title ""; + print " Most recent changes with links to updates." \ + ""; + print " en"; + print " "; + + print " Version " Version ""; + print " " \ + AppcastChangesPath "/changes.html"; + if (onlyoffice) + print " " \ + AppcastChangesPath "/changes_ru.html"; + print " " PubDate ""; + print " "; + + print " "; + print " "; + + print " Version " Version ""; + print " " \ + AppcastChangesPath "/changes.html"; + if (onlyoffice) + print " " \ + AppcastChangesPath "/changes_ru.html"; + print " " PubDate ""; + print " "; + + print " "; + print " "; + print ""; +} diff --git a/win-linux/package/windows/update/appcast.xml.m4 b/win-linux/package/windows/update/appcast.xml.m4 deleted file mode 100644 index 48ad292ca..000000000 --- a/win-linux/package/windows/update/appcast.xml.m4 +++ /dev/null @@ -1,32 +0,0 @@ -changequote()changequote(`,`)dnl -define(`APPCAST_TITLE`,format(`%s Changelog`,M4_COMPANY_NAME M4_PRODUCT_NAME))dnl -define(`APPCAST_DESCRIPTION`,`Most recent changes with links to updates.`)dnl -define(`APPCAST_VERSION`,M4_PACKAGE_VERSION)dnl -define(`APPCAST_ITEM_TITLE`,format(`Version %s`,patsubst(M4_PACKAGE_VERSION,`\(\.\w+\)$`)))dnl -define(`APPCAST_PUBDATE`,esyscmd(echo -n $(LANG=en_US date -u -d @M4_BUILD_TIMESTAMP "+%b %e %Y")))dnl -define(`APPCAST_LINK_CHANGES_EN`,`http://download.onlyoffice.com/install/desktop/editors/windows/onlyoffice/changes/changes.html`)dnl -define(`APPCAST_LINK_CHANGES_RU`,`http://download.onlyoffice.com/install/desktop/editors/windows/onlyoffice/changes/changes_ru.html`)dnl -define(`APPCAST_LINK_EXE_64`,`http://download.onlyoffice.com/install/desktop/editors/windows/onlyoffice/updates/editors_update_x64.exe`)dnl -define(`APPCAST_LINK_EXE_32`,`http://download.onlyoffice.com/install/desktop/editors/windows/onlyoffice/updates/editors_update_x86.exe`)dnl - - - - APPCAST_TITLE - APPCAST_DESCRIPTION - en - - APPCAST_ITEM_TITLE - APPCAST_PUBDATE - APPCAST_LINK_CHANGES_EN - APPCAST_LINK_CHANGES_RU - - - - APPCAST_ITEM_TITLE - APPCAST_PUBDATE - APPCAST_LINK_CHANGES_EN - APPCAST_LINK_CHANGES_RU - - - - diff --git a/win-linux/package/windows/update/branding.awk b/win-linux/package/windows/update/branding.awk new file mode 100644 index 000000000..14069a50d --- /dev/null +++ b/win-linux/package/windows/update/branding.awk @@ -0,0 +1,15 @@ +BEGIN { + onlyoffice = "1"; + + # Appcast Vars + AppcastProductTitle = "ONLYOFFICE Desktop Editors"; + AppcastBaseUrl = "https://download.onlyoffice.com/install/desktop/editors/windows/onlyoffice"; + AppcastChangesPath = AppcastBaseUrl "/changes"; + AppcastUpdatesPath = AppcastBaseUrl "/updates"; + + # Changes Vars + ChangesProductTitle = "ONLYOFFICE Desktop Editors"; + ChangesProductHeading = "ONLYOFFICE Desktop Editors"; + ChangesMoreUrl = "https://github.com/ONLYOFFICE/DesktopEditors/blob/master/" \ + "CHANGELOG.md#" gensub(/\./, "", "g", Version); +} diff --git a/win-linux/package/windows/update/changes.html.awk b/win-linux/package/windows/update/changes.html.awk new file mode 100644 index 000000000..578847149 --- /dev/null +++ b/win-linux/package/windows/update/changes.html.awk @@ -0,0 +1,78 @@ +BEGIN { + if (Lang == "") Lang = ENVIRON["LANG"]; + if (Lang == "en_US.UTF-8") { + Title = ChangesProductTitle " Release Notes"; + ReleaseDate = strftime("%B %e, %Y", Timestamp, "0"); + More = "and a little more..."; + } + else if (Lang == "ru_RU.UTF-8") { + Title = "История изменений " ChangesProductTitle; + ReleaseDate = strftime("%e %B %Y", Timestamp, "0"); + More = "и многое другое..."; + } + + print ""; + print ""; + print ""; + print " "; + print " " Title ""; + print " "; + print ""; + print ""; + print "
"; + print "

" ChangesProductHeading " " Version \ + " - " ReleaseDate "

"; + + # if (system("test -r " ARGV[1]) != 0) { + # print "

empty

" + # exit + # } +} +BEGINFILE { + if (ERRNO != "") { + print "

" ERRNO "

"; + nextfile; + } +} +{ + print " " $0; +} +END { + if (onlyoffice) + print "
" More "
"; + print "
"; + print ""; + print ""; +} diff --git a/win-linux/package/windows/update/changes.html.m4 b/win-linux/package/windows/update/changes.html.m4 deleted file mode 100644 index a28ad9204..000000000 --- a/win-linux/package/windows/update/changes.html.m4 +++ /dev/null @@ -1,55 +0,0 @@ -changequote()changequote(`,`)dnl -changecom(``)dnl -define(`CHANGES_TITLE[en]`,format(`%s Release Notes`,M4_COMPANY_NAME M4_PRODUCT_NAME))dnl -define(`CHANGES_TITLE[ru]`,format(`История изменений %s`,M4_COMPANY_NAME M4_PRODUCT_NAME))dnl -define(`CHANGES_VERSION`,patsubst(M4_PACKAGE_VERSION,`\(\.\w+\)$`))dnl -define(`CHANGES_HEADING`,M4_COMPANY_NAME M4_PRODUCT_NAME CHANGES_VERSION)dnl -define(`CHANGES_RELEASE_DATE[en]`,esyscmd(echo -n $(LANG=en_US.UTF-8 date -u -d @M4_BUILD_TIMESTAMP "+%b %e, %Y")))dnl -define(`CHANGES_RELEASE_DATE[ru]`,esyscmd(echo -n $(LANG=ru_RU.UTF-8 date -u -d @M4_BUILD_TIMESTAMP "+%e %b %Y")))dnl -define(`CHANGES_BODY_FILE`,esyscmd(echo -n $(dirname "__file__"))/changes/CHANGES_VERSION/L10N.html)dnl -define(`CHANGES_BODY`,patsubst(sinclude(CHANGES_BODY_FILE),`^`,` `))dnl -define(`CHANGES_MORE[en]`,`and a little more...`)dnl -define(`CHANGES_MORE[ru]`,`и многое другое...`)dnl -define(`CHANGES_LINK_CHANGELOG`,format(`https://github.com/ONLYOFFICE/DesktopEditors/blob/master/CHANGELOG.md#%s`,patsubst(CHANGES_VERSION,`\.`)))dnl - - - - - defn(CHANGES_TITLE[L10N]) - - - -
-

CHANGES_HEADING - defn(CHANGES_RELEASE_DATE[L10N])

-CHANGES_BODY -
defn(CHANGES_MORE[L10N])
-
- -