On 2019-12-17 at 01:20:15, Jonathan Nieder wrote:
> forcemerge 878599 946879
> quit
> 
> Hi,
> 
> brian m. carlson wrote:
> 
> > It would be great if the libsecret credential helper could be built in
> > its own package so that folks could easily use it.
> 
> Thanks!  I agree.

Here's what should be a complete patch that provides a package called
"git-credential-libsecret" (in case we would like to support other
credential packages in the future), including a commit message.  It
applies to the debian-sid branch of the upstream repo and the package.
I've done a test build and install and verified that a clone works as
expected.
-- 
brian m. carlson: Houston, Texas, US
OpenPGP: https://keybase.io/bk2204
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: "brian m. carlson" <sand...@crustytoothpaste.net>
Date: Sun, 15 Mar 2020 23:07:29 +0000
Subject: [PATCH] debian: add libsecret credential helper

There's a standard XDG secret service API for D-Bus which can be used to
talk to an appropriate credential storage service and Git supports using
this with the libsecret credential helper.  Shipping this as part of the
standard Debian package means that users will be more likely to install
it and therefore more likely to store their credentials in an encrypted
storage format, which is good for everyone.  Build the libsecret
credential helper and ship it as its own package.

Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net>
---
 debian/control                          | 22 +++++++++++++++++++++-
 debian/git-credential-libsecret.install |  1 +
 debian/rules                            |  8 +++++++-
 3 files changed, 29 insertions(+), 2 deletions(-)
 create mode 100644 debian/git-credential-libsecret.install

diff --git a/debian/control b/debian/control
index 4c7face4e9..70fd4d30f2 100644
--- a/debian/control
+++ b/debian/control
@@ -6,6 +6,7 @@ Uploaders: Anders Kaseorg <ande...@mit.edu>
 Build-Depends: libz-dev, gettext,
  libpcre2-dev | libpcre3-dev,
  libcurl4-gnutls-dev, libexpat1-dev,
+ libsecret-1-dev,
  subversion, libsvn-perl, libyaml-perl,
  tcl, python3,
  libhttp-date-perl | libtime-parsedate-perl,
@@ -165,6 +166,25 @@ Description: fast, scalable, distributed revision control system (MediaWiki remo
  remote Git repository, and a 'git mw' command that can show a preview
  of how wiki markup will be rendered before pushing.
 
+Package: git-credential-libsecret
+Architecture: all
+Multi-Arch: foreign
+Depends: ${misc:Depends}, git (>> ${source:Upstream-Version}), git (<< ${source:Upstream-Version}-.)
+Suggests: git-doc
+Description: fast, scalable, distributed revision control system (libsecret credential helper)
+ Git is popular version control system designed to handle very large
+ projects with speed and efficiency; it is used for many high profile
+ open source projects, most notably the Linux kernel.
+ .
+ Git falls in the category of distributed source code management tools.
+ Every Git working directory is a full-fledged repository with full
+ revision tracking capabilities, not dependent on network access or a
+ central server.
+ .
+ This package provides the libsecret credential helper, which can be
+ used to securely store Git credentials in any secret storage supporting
+ the D-Bus Secret Service API.
+
 Package: git-email
 Architecture: all
 Multi-Arch: foreign
@@ -328,7 +348,7 @@ Architecture: all
 Multi-Arch: foreign
 Depends: ${misc:Depends}, git (>> ${source:Upstream-Version}), git (<< ${source:Upstream-Version}-.),
  git-doc, git-el, git-cvs, git-mediawiki, git-svn,
- git-email, git-gui, gitk, gitweb
+ git-email, git-gui, gitk, gitweb, git-credential-libsecret
 Recommends: git-daemon-run | git-daemon-sysvinit
 Description: fast, scalable, distributed revision control system (all subpackages)
  Git is popular version control system designed to handle very large
diff --git a/debian/git-credential-libsecret.install b/debian/git-credential-libsecret.install
new file mode 100644
index 0000000000..3b9ead831a
--- /dev/null
+++ b/debian/git-credential-libsecret.install
@@ -0,0 +1 @@
+usr/lib/git-core/git-credential-libsecret usr/lib/git-core
diff --git a/debian/rules b/debian/rules
index de5a084e9c..82dda426b7 100755
--- a/debian/rules
+++ b/debian/rules
@@ -66,6 +66,8 @@ build-stamp:
 override_dh_auto_build-arch: build-stamp
 	$(MAKE) -C contrib/subtree all $(OPTS)
 	ln -s contrib/subtree/git-subtree
+	$(MAKE) -C contrib/credential/libsecret all $(OPTS)
+	ln -s contrib/credential/libsecret
 
 override_dh_auto_test-arch:
 	test -z '$(TEST)' || \
@@ -91,8 +93,9 @@ override_dh_auto_test-indep:
 override_dh_auto_clean:
 	$(MAKE) -C contrib/mw-to-git clean $(OPTS)
 	$(MAKE) -C contrib/subtree clean $(OPTS)
+	$(MAKE) -C contrib/credential/libsecret clean $(OPTS)
 	$(MAKE) clean $(OPTS)
-	rm -f git-subtree
+	rm -f git-subtree libsecret
 
 override_dh_clean:
 	dh_clean -Xmailinfo.c.orig
@@ -101,6 +104,9 @@ override_dh_auto_install-arch:
 	# git
 	DESTDIR='$(GIT)' $(MAKE) install $(OPTS)
 	DESTDIR='$(GIT)' $(MAKE) -C contrib/subtree install $(OPTS)
+	install -d -m0755 '$(TMP)'/usr/lib/git-core
+	install -m0755 contrib/credential/libsecret/git-credential-libsecret \
+		'$(TMP)'/usr/lib/git-core
 	install -d -m0755 '$(GIT)'/var/lib/git
 	rm -rf '$(GIT)'/usr/share/man
 	# don't include arch, cvs, p4, svn, email, gui tools, and gitk program

Attachment: signature.asc
Description: PGP signature

Reply via email to