implement automatic version string on packaging

This commit is contained in:
joshuaboud 2021-07-19 13:32:24 -03:00
parent 649f6ec371
commit d367d69c67
No known key found for this signature in database
GPG Key ID: 17EFB59E2A8BF50E
6 changed files with 14 additions and 6 deletions

View File

@ -27,6 +27,9 @@ ifeq ($(DIST),$(EL7_DIST))
sed -i "s/pf-c-button/btn/g;s/pf-m-primary/btn-primary/g;s/pf-m-secondary/btn-default/g;s/pf-m-danger/btn-danger/g" $(DESTDIR)/usr/share/cockpit/navigator/navigator.html
sed -i "s/pf-c-button/btn/g;s/pf-m-primary/btn-primary/g;s/pf-m-secondary/btn-default/g;s/pf-m-danger/btn-danger/g" $(DESTDIR)/usr/share/cockpit/navigator/components/ModalPrompt.js
endif
ifneq ($(NAV_VERS),)
echo "export let NAVIGATOR_VERSION = \"$(NAV_VERS)\";" > $(DESTDIR)/usr/share/cockpit/navigator/version.js
endif
uninstall:
rm -rf $(DESTDIR)/usr/share/cockpit/navigator
@ -35,6 +38,9 @@ install-local:
mkdir -p $(HOME)/.local/share/cockpit
cp -rpf navigator $(HOME)/.local/share/cockpit
find $(HOME)/.local/share/cockpit/navigator -name '*.js' -exec sed -i "s#\"/usr/share/\(cockpit/navigator/scripts/.*\)\"#\"$(HOME)/.local/share/\1\"#g" {} \;
ifneq ($(NAV_VERS),)
echo "export let NAVIGATOR_VERSION = \"$(NAV_VERS)\";" > $(HOME)/.local/share/cockpit/navigator/version.js
endif
uninstall-local:
rm -rf $(HOME)/.local/share/cockpit/navigator

View File

@ -143,7 +143,7 @@ function set_up_buttons() {
});
document.getElementById("nav-info-btn").addEventListener("click", () => {
new ModalPrompt().alert(
`Cockpit Navigator v${NAVIGATOR_VERSION}`,
`Cockpit Navigator ${NAVIGATOR_VERSION}`,
`<p>` +
`Created by <a target="_blank" href=https://www.45drives.com/?utm_source=Houston&utm_medium=UI&utm_campaign=OS-Link>45Drives</a> for Houston UI (Cockpit).<br>` +
`<a target="_blank" href=https://github.com/45Drives/cockpit-navigator/issues>Issue Tracker</a><br>` +

View File

@ -1 +1 @@
export let NAVIGATOR_VERSION = "0.5.3";
export let NAVIGATOR_VERSION = "built from source";

View File

@ -23,7 +23,7 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
# empty
%install
make DESTDIR=%{buildroot} DIST=%{dist} install
make DESTDIR=%{buildroot} DIST=%{dist} NAV_VERS="%{version}-%{release}" install
%clean
rm -rf %{buildroot}
@ -41,7 +41,7 @@ rm -rf %{buildroot}
* Thu Jul 15 2021 Josh Boudreau <jboudreau@45drives.com> 0.5.0-1
- Implement custom modal style popups to replace browser dialogs.
* Wed Jul 07 2021 Josh Boudreau <jboudreau@45drives.com> 0.4.6-3
- Add relase for el7
- Add release for el7
* Wed Jun 30 2021 Josh Boudreau <jboudreau@45drives.com> 0.4.6-2
- First build with auto packaging
* Fri Jun 18 2021 Josh Boudreau <jboudreau@45drives.com> 0.4.6-1

View File

@ -23,7 +23,7 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
# empty
%install
make DESTDIR=%{buildroot} DIST=%{dist} install
make DESTDIR=%{buildroot} DIST=%{dist} NAV_VERS="%{version}-%{release}" install
%clean
rm -rf %{buildroot}
@ -41,7 +41,7 @@ rm -rf %{buildroot}
* Thu Jul 15 2021 Josh Boudreau <jboudreau@45drives.com> 0.5.0-1
- Implement custom modal style popups to replace browser dialogs.
* Wed Jul 07 2021 Josh Boudreau <jboudreau@45drives.com> 0.4.6-3
- Add relase for el7
- Add release for el7
* Wed Jun 30 2021 Josh Boudreau <jboudreau@45drives.com> 0.4.6-2
- First build with auto packaging
* Fri Jun 18 2021 Josh Boudreau <jboudreau@45drives.com> 0.4.6-1

View File

@ -13,6 +13,8 @@
# package maintainers to append LDFLAGS
#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
export NAV_VERS := $(shell dpkg-parsechangelog | egrep '^Version:' | cut -f 2 -d ':')
%:
dh $@