Skip to content

Commit

Permalink
Merge pull request #41 from fehlix/master
Browse files Browse the repository at this point in the history
rules: set version number during build from changelog
  • Loading branch information
dolphinoracle authored Dec 31, 2024
2 parents ccac757 + 7ac6821 commit a3863fc
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
6 changes: 6 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
mx-packageinstaller (24.12.05) mx; urgency=medium

* Set version number during build from changelog within debian/rules

-- fehlix <[email protected]> Tue, 31 Dec 2024 15:11:46 -0500

mx-packageinstaller (24.12.04) mx; urgency=medium

* Adjust regex to read binary-packages for current arch only and
Expand Down
21 changes: 20 additions & 1 deletion debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,25 @@ export QT_SELECT=5
QMAKE_OPTS = DEFINES+=NO_DEBUG_ON_CONSOLE
MAKE_OPTS = QMAKE=qmake-qt5 LRELEASE=lrelease-qt5 QMAKE_OPTS="$(QMAKE_OPTS)"

# Define version.h
VERSION_H = version.h

# Get version from debian/changelog
VERSION := $(shell dpkg-parsechangelog --show-field Version)

override_dh_auto_clean:
dh_auto_clean
rm -f translations/*.qm
rm -f src/translations/*.qm

override_dh_auto_build:
# Rename existing version.h to version.h~
@echo "Renaming existing version.h to version.h~"
@mv -f $(VERSION_H) $(VERSION_H)~ || true
# Create new version.h with version from changelog
@echo "Creating new version.h with version $(VERSION)"
@echo "#define VERSION \"$(VERSION)\"" > $(VERSION_H)
# Build
lrelease translations/*.ts
dh_auto_build -- $(MAKE_OPTS)

Expand All @@ -19,8 +32,14 @@ override_dh_auto_install:
override_dh_shlibdeps:
dh_shlibdeps -- -xvirtualbox-guest-x11 --ignore-missing-info

# Restore original version.h after build
override_dh_auto_clean:
@echo "Restoring original version.h from version.h~"
@mv -f $(VERSION_H)~ $(VERSION_H) || true
dh_auto_clean

%:
dh $@ --no-automatic-dbgsym --parallel
dh $@ --no-automatic-dbgsym --parallel

override_dh_auto_install:
dh_auto_install

0 comments on commit a3863fc

Please sign in to comment.