Hi again,

please find attached an updated patch series against 1:1.9.1-1.
The GitHub branch at [1] is updated accordingly.

I have updated the implementation slightly to include a patch against
the upstream Makefile (adding an 'install' target), which is not yet
submitted, though.

Please let me know, if there's anything missing or unsuitable for merging.

Thanks,
  Philipp

On 04/03/14 16:56, Philipp A. Hartmann wrote:
[...]
> For your convenience, I have pushed the branch to my GitHub fork.  You
> can review the changes at [1].
[...]
> [1] https://github.com/pah/git/compare/debian-sid...deb-cred-gnome-keyring

-- 
vay' DalarghDI' yIqaw
From c91eae6cf55108a3443bfdcf0db5508f76f66bfe Mon Sep 17 00:00:00 2001
From: "Philipp A. Hartmann" <[email protected]>
Date: Mon, 24 Mar 2014 17:56:09 +0100
Subject: [PATCH 1/2] debian/rules: add PKG_ARCH list

This patch adds a new variable PKG_ARCH holding the names of the
arch-dependent packages to the debian/rules file.

This simplifies the addition of further arch-dependent packages
from the Git sources, e.g. binaries built from the contrib/
directory.

Currently, only 'git' itself is in this list.

Signed-off-by: Philipp A. Hartmann <[email protected]>
---
 debian/rules | 32 ++++++++++++++++++++------------
 1 file changed, 20 insertions(+), 12 deletions(-)

diff --git a/debian/rules b/debian/rules
index 0533779..2a81c16 100755
--- a/debian/rules
+++ b/debian/rules
@@ -33,6 +33,9 @@ ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
   MAKEFLAGS += -j$(NUMJOBS)
 endif
 
+PKG_ARCH =
+PKG_ARCH += git
+
 PKG_INDEP =
 PKG_INDEP += git-doc
 PKG_INDEP += git-arch
@@ -117,14 +120,14 @@ clean: deb-checkdir
        rm -rf '$(TMP)'
        rm -f patch-stamp build-arch-stamp build-indep-stamp
        set -e; \
-         for i in '' $(patsubst git%,%,$(PKG_INDEP)) -core; do \
+         for i in $(patsubst git%,'%',$(PKG_ARCH) $(PKG_INDEP)) -core; do \
            rm -rf '$(GIT)'$$i; \
          done
        rm -f debian/files debian/substvars
        rm -f git-subtree
 
 install: install-arch install-indep
-git.install: install-arch
+$(patsubst %,%.install,$(PKG_ARCH)): install-arch
 install-arch: deb-checkdir deb-checkuid build-arch-stamp
        # git
        rm -rf '$(GIT)'
@@ -144,12 +147,6 @@ install-arch: deb-checkdir deb-checkuid build-arch-stamp
        done
        rm -f '$(GIT)'/usr/bin/git-cvsserver
        rm -f '$(GIT)'/usr/bin/gitk
-       for i in '$(GIT)'/usr/bin/* '$(GIT)'/usr/lib/git-core/*; do \
-         test -d $$i || \
-         test "`head -c2 $$i`" = '#!' || \
-         test "`head -c2 $$i`" = '# ' || \
-         $(STRIP) -R .comment -R .note $$i; \
-       done
        # don't include git-gui's lib
        rm -rf '$(GIT)'/usr/share/git-gui/
        # don't include gitk's lib
@@ -194,6 +191,15 @@ install-arch: deb-checkdir deb-checkuid build-arch-stamp
        ln -s ../../../git-core/contrib/hooks \
          '$(GIT)'/usr/share/doc/git/contrib/
        find '$(GIT)'/usr/share/doc/git/ -name .gitignore | xargs rm -f
+       # strip all arch binaries
+       for p in $(patsubst git%,'%',$(PKG_ARCH)) ; do \
+         for i in '$(GIT)'$$p/usr/bin/* '$(GIT)'$$p/usr/lib/git-core/*; do \
+           test -d $$i || test ! -f $$i || \
+           test "`head -c2 $$i`" = '#!' || \
+           test "`head -c2 $$i`" = '# ' || \
+           $(STRIP) -R .comment -R .note $$i; \
+         done; \
+       done
 
 $(patsubst %,%.install,$(PKG_INDEP)) git-core.install: install-indep
 install-indep: build-arch-stamp build-indep-stamp
@@ -377,11 +383,13 @@ git-core.deb-docs:
        : no doc dir
 
 binary: binary-arch binary-indep
-binary-arch: install-arch git.deb
+binary-arch: install-arch $(patsubst %,%.deb,$(PKG_ARCH))
        rm -f debian/substvars
-       dpkg-shlibdeps '$(GIT)'/usr/bin/* '$(GIT)'/usr/lib/git-core/*
-       dpkg-gencontrol -isp -pgit -P'$(GIT)'
-       dpkg -b '$(GIT)' ..
+       for i in $(patsubst git%,'%',$(PKG_ARCH)); do \
+         dpkg-shlibdeps '$(GIT)'$$i/usr/bin/* '$(GIT)'$$i/usr/lib/git-core/* ; 
\
+         dpkg-gencontrol -isp -pgit$$i -P'$(GIT)'$$i && \
+         dpkg -b '$(GIT)'$$i .. || exit 1; \
+       done
 binary-indep: install-indep $(patsubst %,%.deb,$(PKG_INDEP)) 
git-core.deb-DEBIAN
        rm -f debian/substvars
        for i in $(patsubst git%,%,$(PKG_INDEP)) -core; do \
-- 
1.9.1


From 1b8c92ad9ce703b4014fe2e941b8f4a75132c228 Mon Sep 17 00:00:00 2001
From: "Philipp A. Hartmann" <[email protected]>
Date: Mon, 24 Mar 2014 18:18:53 +0100
Subject: [PATCH 2/2] git-credential-gnome-keyring: add new package

This patch adds a new package for 'git-credential-gnome-keyring'
to Debian's Git source package.

Quoting from its README.Debian:

  Git will sometimes need credentials from the user in order to perform
  operations; for example, it may need to ask for a username and password in
  order to access a remote repository over HTTP.  This package contains a Git
  credential helper for passwords stored in a GNOME keyring.

Signed-off-by: Philipp A. Hartmann <[email protected]>
---
 debian/changelog                                   |  9 +++++
 debian/control                                     | 20 +++++++++-
 ...dential-gnome-keyring-Makefile-add-install.diff | 44 ++++++++++++++++++++++
 debian/git-credential-gnome-keyring.README.Debian  | 14 +++++++
 debian/rules                                       |  7 ++++
 5 files changed, 93 insertions(+), 1 deletion(-)
 create mode 100644 
debian/diff/0010-contrib-credential-gnome-keyring-Makefile-add-install.diff
 create mode 100644 debian/git-credential-gnome-keyring.README.Debian

diff --git a/debian/changelog b/debian/changelog
index e05991f..caf4e8c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,12 @@
+git (1:1.9.1-1.1) unstable; urgency=low
+
+  * package git-credential-gnome-keyring (closes: #740739)
+  * debian/diff/0010-contrib-credential-gnome-keyring-Makefile....diff:
+    new; add install target
+  * debian/rules: add PKG_ARCH list to build arch-dependent packages
+
+ -- Philipp A. Hartmann <[email protected]>  Fri, 21 Mar 2014 17:31:26 +0100
+
 git (1:1.9.1-1) unstable; urgency=low
 
   * new upstream point release.
diff --git a/debian/control b/debian/control
index 14e14b7..b1e8566 100644
--- a/debian/control
+++ b/debian/control
@@ -11,7 +11,8 @@ Build-Depends: libz-dev, libpcre3-dev, gettext,
  bzr, python, python-bzrlib,
  cvs, cvsps, libdbd-sqlite3-perl,
  unzip, libio-pty-perl,
- dpkg-dev (>= 1.16.2~)
+ dpkg-dev (>= 1.16.2~),
+ libgnome-keyring-dev
 Build-Depends-Indep: asciidoc, xmlto, docbook-xsl
 Standards-Version: 3.9.4.0
 Homepage: http://git-scm.com/
@@ -376,6 +377,23 @@ Description: fast, scalable, distributed revision control 
system (web interface)
  If libcgi-fast-perl is installed, gitweb can also be run over FastCGI
  (and served by nginx, for example).
 
+Package: git-credential-gnome-keyring
+Architecture: any
+Multi-Arch: foreign
+Depends: ${shlibs:Depends}, git (>> 1:1.7.9)
+Description: fast, scalable, distributed revision control system (GNOME 
keyring 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 a gitcredentials(7) helper to access and manage
+ usernames and passwords for Git stored in the GNOME keyring.
+
 Package: git-all
 Architecture: all
 Multi-Arch: foreign
diff --git 
a/debian/diff/0010-contrib-credential-gnome-keyring-Makefile-add-install.diff 
b/debian/diff/0010-contrib-credential-gnome-keyring-Makefile-add-install.diff
new file mode 100644
index 0000000..5269cf4
--- /dev/null
+++ 
b/debian/diff/0010-contrib-credential-gnome-keyring-Makefile-add-install.diff
@@ -0,0 +1,44 @@
+From 318594271b235d6e2c84ded879549a522cae6122 Mon Sep 17 00:00:00 2001
+From: "Philipp A. Hartmann" <[email protected]>
+Date: Fri, 21 Mar 2014 17:57:16 +0100
+Subject: contrib/credential/gnome-keyring/Makefile: add "install"
+
+In order to integrate the build of the credential helper
+from within a build of Git itself (e.g. for packaging),
+an "install" target would be helpful.
+
+Signed-off-by: Philipp A. Hartmann <[email protected]>
+---
+ contrib/credential/gnome-keyring/Makefile | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/contrib/credential/gnome-keyring/Makefile 
b/contrib/credential/gnome-keyring/Makefile
+index c3c7c98..d4b52ae 100644
+--- a/contrib/credential/gnome-keyring/Makefile
++++ b/contrib/credential/gnome-keyring/Makefile
+@@ -4,10 +4,14 @@ all:: $(MAIN)
+ CC = gcc
+ RM = rm -f
+ CFLAGS = -g -O2 -Wall
++INSTALL = install
+ 
+ -include ../../../config.mak.autogen
+ -include ../../../config.mak
+ 
++prefix ?= /usr/local
++gitexecdir ?= $(prefix)/libexec/git-core
++
+ INCS:=$(shell pkg-config --cflags gnome-keyring-1 glib-2.0)
+ LIBS:=$(shell pkg-config --libs gnome-keyring-1 glib-2.0)
+ 
+@@ -22,3 +26,7 @@ $(MAIN): $(OBJS)
+ 
+ clean:
+       @$(RM) $(MAIN) $(OBJS)
++
++install: all
++      $(INSTALL) -d -m 0755 $(DESTDIR)$(gitexecdir)
++      $(INSTALL) -m 0755 $(MAIN) $(DESTDIR)$(gitexecdir)
+-- 
+1.9.1
+
diff --git a/debian/git-credential-gnome-keyring.README.Debian 
b/debian/git-credential-gnome-keyring.README.Debian
new file mode 100644
index 0000000..a0d5152
--- /dev/null
+++ b/debian/git-credential-gnome-keyring.README.Debian
@@ -0,0 +1,14 @@
+git-credential-gnome-keyring for Debian
+---------------------------------------
+
+Git will sometimes need credentials from the user in order to perform
+operations; for example, it may need to ask for a username and password in
+order to access a remote repository over HTTP.  This package contains a Git
+credential helper for passwords stored in a GNOME keyring.
+
+To use this backend, you can add it to your (global) Git
+configuration by setting
+
+  git config [--global] credential.helper gnome-keyring
+
+See gitcredentials(7) for more information.
diff --git a/debian/rules b/debian/rules
index 2a81c16..2404f41 100755
--- a/debian/rules
+++ b/debian/rules
@@ -35,6 +35,7 @@ endif
 
 PKG_ARCH =
 PKG_ARCH += git
+PKG_ARCH += git-credential-gnome-keyring
 
 PKG_INDEP =
 PKG_INDEP += git-doc
@@ -72,6 +73,8 @@ build-arch-stamp: patch-stamp
        DESTDIR='$(GIT)' $(MAKE) all $(OPTS)
        DESTDIR='$(GIT)' $(MAKE) -C contrib/subtree all $(OPTS)
        ln -s contrib/subtree/git-subtree
+       DESTDIR='$(GIT)'-credential-gnome-keyring \
+         $(MAKE) -C contrib/credential/gnome-keyring all $(OPTS)
        test -z '$(TEST)' || \
          DESTDIR='$(GIT)' $(MAKE) $(TEST) $(OPTS) || \
          GIT_TEST_OPTS=--verbose DESTDIR='$(GIT)' $(MAKE) $(TEST) $(OPTS)
@@ -108,6 +111,7 @@ clean: deb-checkdir
        rm -f debian/git-remote-bzr.xml debian/git-remote-bzr.html
        rm -f Documentation/git-remote-bzr.1
        $(MAKE) clean $(OPTS)
+       $(MAKE) -C contrib/credential/gnome-keyring clean $(OPTS)
        ! test -e patch-stamp || \
        { \
          set -e; \
@@ -134,6 +138,8 @@ install-arch: deb-checkdir deb-checkuid build-arch-stamp
        install -d -m0755 '$(GIT)'/usr/bin
        DESTDIR='$(GIT)' $(MAKE) install $(OPTS)
        DESTDIR='$(GIT)' $(MAKE) -C contrib/subtree install $(OPTS)
+       DESTDIR='$(GIT)'-credential-gnome-keyring \
+         $(MAKE) -C contrib/credential/gnome-keyring install $(OPTS)
        install -d -m0755 '$(GIT)'/var/lib/git
        rm -f '$(GIT)'/usr/share/perl5/Error.pm
        rm -rf '$(GIT)'/usr/share/man
@@ -181,6 +187,7 @@ install-arch: deb-checkdir deb-checkuid build-arch-stamp
        install -d -m0755 '$(GIT)'/usr/share/doc/git
        cp -R contrib '$(GIT)'/usr/share/doc/git/
        rm -rf '$(GIT)'/usr/share/doc/git/contrib/completion
+       rm -rf '$(GIT)'/usr/share/doc/git/contrib/credential/gnome-keyring
        rm -rf '$(GIT)'/usr/share/doc/git/contrib/emacs
        rm -rf '$(GIT)'/usr/share/doc/git/contrib/mw-to-git
        find '$(GIT)'/usr/share/doc/git/contrib -type f | xargs chmod 0644
-- 
1.9.1

Reply via email to