Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto TAG debian package with github commit... #55

Open
Creteil opened this issue Dec 29, 2023 · 0 comments
Open

Auto TAG debian package with github commit... #55

Creteil opened this issue Dec 29, 2023 · 0 comments

Comments

@Creteil
Copy link

Creteil commented Dec 29, 2023

Hi,

On my side I always tend to make debian package whenever it is possible...

On that way, I also always use commit TAG as the debian package versioning, to be able to find quickly what exact version is installed/running.

To do that, I have :

  1. Created a symbolic link :
bigbob@bigbob-t480s:~/tmp/Building/actions-for-nautilus/actions-for-nautilus$ ln -sf packaging/doc/actions-for-nautilus debian
  1. I have modified the « Makefile » like this :
bigbob@bigbob-t480s:~/tmp/Building/actions-for-nautilus/actions-for-nautilus$ echo '--- Makefile-orig   2023-12-29 20:18:15.790419491 +0100
+++ Makefile    2023-12-29 20:25:07.476102657 +0100
@@ -2,7 +2,7 @@
 nautilus_path=`which nautilus`
 GLOBALLOC=/usr/share
 LOCALLOC=~/.local/share
-VERSION=1.6.1
+VERSION := $(shell git --git-dir .git --work-tree . describe --always --tags | cut -c2-)
 
 install:
        mkdir -p $(LOCALLOC)/nautilus-python/extensions/actions-for-nautilus' | patch -p0
patching file Makefile
bigbob@bigbob-t480s:~/tmp/Building/actions-for-nautilus/actions-for-nautilus$
  1. I have updated the « changelog » using this command line :
bigbob@bigbob-t480s:~/tmp/Building/actions-for-nautilus/actions-for-nautilus$ DEBEMAIL="COLIN Stephane <[email protected]>" dch -b -v $(git --git-dir .git --work-tree . describe --always --tags | cut -c2-) "Update to latest GIT Version..." && sed -i '$!N; /^\(.*\)\n\1$/!P; D' debian/changelog ; head -10 debian/changelog
dch warning: Previous package version was Debian native whilst new version is not
actions-for-nautilus (1.6.1-4-g0a3c7ce) UNRELEASED; urgency=medium

  * Update to latest GIT Version...

 -- COLIN Stephane <[email protected]>  Fri, 29 Dec 2023 20:47:00 +0100

actions-for-nautilus (1.6.1) stable; urgency=high
  * Fix config server being open on all interfaces
  * Fix config server not being closed by FF tab close

bigbob@bigbob-t480s:~/tmp/Building/actions-for-nautilus/actions-for-nautilus$
  1. Then I have build the package with :
bigbob@bigbob-t480s:~/tmp/Building/actions-for-nautilus/actions-for-nautilus$ rm dist/* ; fakeroot make deb
rm -rf build
mkdir -p build//usr/share/nautilus-python
mkdir -p build//usr/share/actions-for-nautilus-configurator
mkdir -p build//usr/share/applications
mkdir -p build//usr/share/doc/actions-for-nautilus
mkdir -p build/DEBIAN
cp -r --preserve=mode,timestamps extensions build//usr/share/nautilus-python
cp -r --preserve=mode,timestamps configurator/* build//usr/share/actions-for-nautilus-configurator
rm build//usr/share/actions-for-nautilus-configurator/javascript/jquery.min.js
LOC=/usr/share python3 -c 'import os,sys; sys.stdout.write(os.path.expandvars(sys.stdin.read()))' \
	< build//usr/share/actions-for-nautilus-configurator/actions-for-nautilus-configurator.desktop \
	> build//usr/share/applications/actions-for-nautilus-configurator.desktop
VERSION=1.6.1-4-g0a3c7ce python3 -c 'import os,sys; sys.stdout.write(os.path.expandvars(sys.stdin.read()))' \
	< packaging/DEBIAN/control \
	> build/DEBIAN/control
cp -r --preserve=mode,timestamps packaging/doc build//usr/share
cp README.md build//usr/share/doc/actions-for-nautilus
cp RELEASE-NOTES.md build//usr/share/doc/actions-for-nautilus/NEWS
mv build//usr/share/actions-for-nautilus-configurator/README.md build//usr/share/doc/actions-for-nautilus/configurator.README.md
gzip -n9 build//usr/share/doc/actions-for-nautilus/NEWS
gzip -n9 build//usr/share/doc/actions-for-nautilus/changelog
find build/ -type d -exec chmod 0755 {} \;
find build/ -type f -exec chmod 0644 {} \;
chmod +x build//usr/share/actions-for-nautilus-configurator/start-configurator.sh
dpkg-deb -Z gzip --build build dist/actions-for-nautilus_1.6.1-4-g0a3c7ce_all.deb
dpkg-deb: construction du paquet « actions-for-nautilus » dans « dist/actions-for-nautilus_1.6.1-4-g0a3c7ce_all.deb ».
lintian dist/actions-for-nautilus_1.6.1-4-g0a3c7ce_all.deb
running with root privileges is not recommended!
E: actions-for-nautilus: debian-changelog-file-missing-or-wrong-name
W: actions-for-nautilus: copyright-without-copyright-notice
bigbob@bigbob-t480s:~/tmp/Building/actions-for-nautilus/actions-for-nautilus$
  1. This ending with the « debian » package named like this :
bigbob@bigbob-t480s:~/tmp/Building/actions-for-nautilus/actions-for-nautilus$ ls dist/
actions-for-nautilus_1.6.1-4-g0a3c7ce_all.deb
bigbob@bigbob-t480s:~/tmp/Building/actions-for-nautilus/actions-for-nautilus$

Hope it help...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant