From 2a2a6654b211032fe426e667e3b3950285503889 Mon Sep 17 00:00:00 2001 From: Roman Demidov Date: Wed, 11 Oct 2023 14:45:38 +0300 Subject: [PATCH] Add console output for --changelog param for RPM (#995) * Add console output for --changelog param for RPM * Small changes --- win-linux/package/linux/Makefile | 21 +++++++++++++++---- .../linux/common/usr/share/doc/ChangeLog.m4 | 2 ++ win-linux/package/linux/rpm/common.spec | 4 ++++ 3 files changed, 23 insertions(+), 4 deletions(-) create mode 100644 win-linux/package/linux/common/usr/share/doc/ChangeLog.m4 diff --git a/win-linux/package/linux/Makefile b/win-linux/package/linux/Makefile index 50c9a9137..9ba820c5e 100644 --- a/win-linux/package/linux/Makefile +++ b/win-linux/package/linux/Makefile @@ -72,8 +72,10 @@ DEB_ASTRA = deb-astra/$(PACKAGE_NAME)_$(PACKAGE_VERSION)$(DEB_ASTRA_RELEASE_SUFF TAR = $(TAR_PACKAGE_DIR)/$(PACKAGE_NAME)-$(PACKAGE_VERSION)$(TAR_RELEASE_SUFFIX)-$(TAR_ARCH).tar.xz HELP_TAR = $(TAR_PACKAGE_DIR)/$(PACKAGE_NAME)-help-$(PACKAGE_VERSION)$(TAR_RELEASE_SUFFIX)-any.tar.xz -CHANGELOG_RPM = common/usr/share/doc/$(PACKAGE_NAME)/NEWS -CHANGELOG_RPM_M4 = common/usr/share/doc/NEWS.m4 +NEWS_RPM = common/usr/share/doc/$(PACKAGE_NAME)/NEWS +NEWS_RPM_M4 = common/usr/share/doc/NEWS.m4 +CHANGELOG_RPM = common/usr/share/doc/$(PACKAGE_NAME)/ChangeLog +CHANGELOG_RPM_M4 = common/usr/share/doc/ChangeLog.m4 CHANGELOG_DEB = deb/build/debian/changelog CHANGELOG_DEB_M4 = deb/template/changelog.m4 CHANGELOG_DEB_ASTRA = deb-astra/build/debian/changelog @@ -266,6 +268,7 @@ clean: suse-rpm/$(PACKAGE_NAME).spec \ $(shell dirname $(CHANGELOG_RPM)) \ $(CHANGES_DIR)/*/changes_??? \ + $(CHANGES_DIR)/*/news_??? \ $(INSTALLER) branding: $(BRANDING_DIR) @@ -335,7 +338,7 @@ $(CHANGELOG_DEB) : $(CHANGELOG_DEB_M4) $(CHANGELOG_RPM) $(foreach dir, \ $(CHANGES_DIR_LIST), \ $(shell \ - sed 's/^[^ *]/* &/' $(CHANGES_DIR)/$(dir)/changes_rpm | \ + sed 's/^[^ *]/* &/' $(CHANGES_DIR)/$(dir)/news_rpm | \ sed 's/^/ /' \ > $(CHANGES_DIR)/$(dir)/changes_deb; \ mkdir -p deb/build/debian; \ @@ -361,9 +364,19 @@ $(CHANGELOG_RPM) : sed '/<\/ul>/d' | \ sed '/

/d' | \ sed '/^$$/d' \ + > $(CHANGES_DIR)/$(dir)/news_rpm; \ + mkdir -p $(shell dirname $(NEWS_RPM)); \ + m4 $(M4_PARAMS) -D M4_VERSION='$(dir)' -D M4_DATE_SHORT='$(shell date -d "$(shell grep \"releasedate\" $(CHANGES_DIR)/$(dir)/$(CHANGES_HTML) | sed 's/.* - //' | sed 's/<\/span>.*//' | sed 's/{{DATE}}/$(shell date -R)/')" -I)' $(NEWS_RPM_M4) | sed '2r $(CHANGES_DIR)/$(dir)/news_rpm' >> $(NEWS_RPM))) + + $(foreach dir, \ + $(CHANGES_DIR_LIST), \ + $(shell \ + sed 's/ - / - /' $(CHANGES_DIR)/$(dir)/news_rpm | \ + sed 's/* / - /' | \ + sed 's/^[^ *]/- &/' \ > $(CHANGES_DIR)/$(dir)/changes_rpm; \ mkdir -p $(shell dirname $(CHANGELOG_RPM)); \ - m4 $(M4_PARAMS) -D M4_VERSION='$(dir)' -D M4_DATE_SHORT='$(shell date -d "$(shell grep \"releasedate\" $(CHANGES_DIR)/$(dir)/$(CHANGES_HTML) | sed 's/.* - //' | sed 's/<\/span>.*//' | sed 's/{{DATE}}/$(shell date -R)/')" -I)' $(CHANGELOG_RPM_M4) | sed '2r $(CHANGES_DIR)/$(dir)/changes_rpm' >> $(CHANGELOG_RPM))) + m4 $(M4_PARAMS) -D M4_VERSION='$(dir)' -D M4_DATE='$(shell LC_TIME="en_US.UTF-8" date -d "$(shell grep \"releasedate\" $(CHANGES_DIR)/$(dir)/$(CHANGES_HTML) | sed 's/.* - //' | sed 's/<\/span>.*//' | sed 's/{{DATE}}/$(shell date -R)/')" +"%a %b %d %Y")' $(CHANGELOG_RPM_M4) | sed '1r $(CHANGES_DIR)/$(dir)/changes_rpm' >> $(CHANGELOG_RPM))) deb/build/debian/$(PACKAGE_NAME).% : deb/template/package.%.m4 mkdir -pv $(@D) && m4 $(M4_DEB_PARAMS) $< > $@ diff --git a/win-linux/package/linux/common/usr/share/doc/ChangeLog.m4 b/win-linux/package/linux/common/usr/share/doc/ChangeLog.m4 new file mode 100644 index 000000000..c95783f12 --- /dev/null +++ b/win-linux/package/linux/common/usr/share/doc/ChangeLog.m4 @@ -0,0 +1,2 @@ +* M4_DATE M4_PUBLISHER_NAME M4_VERSION + diff --git a/win-linux/package/linux/rpm/common.spec b/win-linux/package/linux/rpm/common.spec index 67a5cfbfa..ba9c62ebe 100644 --- a/win-linux/package/linux/rpm/common.spec +++ b/win-linux/package/linux/rpm/common.spec @@ -178,3 +178,7 @@ for icon in "/opt/%{_desktopeditors_prefix}/asc-de-"*.png; do size="${icon##*/asc-de-}" "$XDG_ICON_RESOURCE" install --size "${size%.png}" "$icon" "%{_package_name}" done + +%changelog + +%include ../common/usr/share/doc/%{_package_name}/ChangeLog