Include etckeeper plugin in Debian package.
authorJoey Hess <joey@kodama.kitenet.net>
Sat, 5 Apr 2008 18:31:19 +0000 (14:31 -0400)
committerJoey Hess <joey@kodama.kitenet.net>
Sat, 5 Apr 2008 18:31:19 +0000 (14:31 -0400)
Conflicts:

debian/control

Makefile
debian/control
debian/rules
etckeeper-bzr/__init__.py [moved from etckeeper-bzr.py with 78% similarity]

index 930dc7bf4a15f2ed91b8359676b532f5e74a7561..aac2f1ef18f9be2dac9d4c774b76f3e19889f5d1 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -27,3 +27,4 @@ endif
 ifeq ($(LOWLEVEL_PACKAGE_MANAGER),pacman-g2)
        $(INSTALL_DATA) pacman-g2.hook $(DESTDIR)$(etcdir)/pacman-g2/hooks/etckeeper
 endif
+       -./etckeeper-bzr/__init__.py install --root=$(DESTDIR)
index af675b62ab738486caf92f7723f6e674f78d20e9..df3e58c7b07e1c6160796815b030156e4516d25c 100644 (file)
@@ -1,7 +1,7 @@
 Source: etckeeper
 Section: admin
 Priority: optional
-Build-Depends: debhelper (>= 5), dpkg-dev (>= 1.9.0)
+Build-Depends: debhelper (>= 5), dpkg-dev (>= 1.9.0), bzr (>= 1.4~), python-support (>= 0.5.3) 
 Maintainer: Joey Hess <joeyh@debian.org>
 Standards-Version: 3.7.3
 Vcs-Git: git://git.kitenet.net/etckeeper
@@ -10,7 +10,7 @@ Homepage: http://kitenet.net/~joey/code/etckeeper/
 Package: etckeeper
 Architecture: all
 Section: admin
-Depends: git-core (>= 1:1.5.4) | mercurial | bzr (>= 1.0), ${misc:Depends}
+Depends: git-core (>= 1:1.5.4) | mercurial | bzr (>= 1.4~), ${misc:Depends}
 Description: store /etc in git, mercurial, or bzr
  The etckeeper program is a tool to let /etc be stored in a git, mercurial,
  or bzr repository. It hooks into APT to automatically commit changes made to
index eb737a591ba85cc10f995d1706cc512f165fe444..28e3c1bb09e8d8049120e612e459feed8638a6b9 100755 (executable)
@@ -15,6 +15,7 @@ binary-indep: build
        dh_testroot
        dh_clean -k
        $(MAKE) install DESTDIR=debian/etckeeper
+       dh_pysupport
        dh_installdocs README TODO
        dh_installexamples
        dh_installchangelogs
similarity index 78%
rename from etckeeper-bzr.py
rename to etckeeper-bzr/__init__.py
index 97a86892c45bceb7e071360b61289bfa59b5d8c1..a5381c54ef6448950cb5214ec1705f40d4221354 100755 (executable)
@@ -3,11 +3,15 @@
 
 """Runs etckeeper pre-commit when necessary."""
 
+import bzrlib
 from bzrlib.mutabletree import MutableTree
 from bzrlib.errors import BzrError, NotLocalUrl
 import os
 import subprocess
 
+if bzrlib.version_info[:2] < (1,4):
+    raise "Version of Bazaar to old. Need at least 1.4."
+
 def etckeeper_startcommit_hook(tree):
     if not os.path.exists(tree.abspath(".etckeeper")):
         # Only run the commit hook when this is an etckeeper branch
@@ -22,5 +26,5 @@ MutableTree.hooks.name_hook(etckeeper_startcommit_hook, "etckeeper")
 if __name__ == "__main__":
     from distutils.core import setup
     setup(name="bzr-etckeeper", 
-          package_dir={"bzrlib.plugins.etckeeper":__file__},
-          py_modules=["bzrlib.plugins.etckeeper"])
+          packages=["bzrlib.plugins.etckeeper"],
+          package_dir={"bzrlib.plugins.etckeeper":"etckeeper-bzr"})