Looks like the start of a working Debianization debian
authorPaul Crowley <paul@lshift.net>
Tue, 13 Oct 2009 18:21:22 +0100
branchdebian
changeset 116 d99f3169828a
parent 115 731a72b742db
child 118 107906bfe2c6
Looks like the start of a working Debianization
debian/changelog
debian/control
debian/dirs
debian/docs
debian/postinst
debian/postrm
debian/rules
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/debian/changelog	Tue Oct 13 18:21:22 2009 +0100
@@ -0,0 +1,6 @@
+mercurial-server (0.6.1) stable; urgency=low
+
+  * Packaged for Debian
+    
+ -- Paul Crowley <paul@lshift.net>  Mon, 13 Oct 2009 18:11:00 +0100
+
--- a/debian/control	Tue Oct 13 15:30:03 2009 +0100
+++ b/debian/control	Tue Oct 13 18:21:22 2009 +0100
@@ -8,7 +8,7 @@
 
 Package: mercurial-server
 Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}, mercurial
+Depends: ${shlibs:Depends}, ${misc:Depends}, mercurial, openssh-server | ssh-server
 Description: provide and manage a shared Mercurial repository
  mercurial-server makes a group of repositories available to the developers
  you choose, identified by ssh keys, with easy key and access management
--- a/debian/dirs	Tue Oct 13 15:30:03 2009 +0100
+++ b/debian/dirs	Tue Oct 13 18:21:22 2009 +0100
@@ -1,4 +1,8 @@
 usr/share/mercurial-server
-/usr/share/doc/mercurial-server
+usr/share/mercurial-server/init
+usr/share/mercurial-server/mercurialserver
+usr/share/doc/mercurial-server
 etc/mercurial-server
-
+etc/mercurial-server/keys
+etc/mercurial-server/keys/root
+etc/mercurial-server/keys/users
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/debian/docs	Tue Oct 13 18:21:22 2009 +0100
@@ -0,0 +1,6 @@
+README
+doc/configuring-access
+doc/file-conditions
+doc/how-it-works
+doc/security
+
--- a/debian/postinst	Tue Oct 13 15:30:03 2009 +0100
+++ b/debian/postinst	Tue Oct 13 18:21:22 2009 +0100
@@ -20,6 +20,13 @@
 
 case "$1" in
     configure)
+        if ! getent passwd hg >/dev/null; then
+            adduser --disabled-password --quiet --system \
+                --shell /bin/sh --group \
+                --home /var/lib/mercurial-server \
+                --gecos "Mercurial repositories" hg
+            su -c "/usr/share/mercurial-server/init/hginit /usr/share/mercurial-server" hg
+        fi
     ;;
 
     abort-upgrade|abort-remove|abort-deconfigure)
--- a/debian/postrm	Tue Oct 13 15:30:03 2009 +0100
+++ b/debian/postrm	Tue Oct 13 18:21:22 2009 +0100
@@ -20,7 +20,12 @@
 
 
 case "$1" in
-    purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
+    purge)
+        deluser --quiet --system hg > /dev/null || true
+        delgroup --quiet --system hg > /dev/null || true
+    ;;
+
+    remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
     ;;
 
     *)
--- a/debian/rules	Tue Oct 13 15:30:03 2009 +0100
+++ b/debian/rules	Tue Oct 13 18:21:22 2009 +0100
@@ -9,10 +9,6 @@
 # Uncomment this to turn on verbose mode.
 #export DH_VERBOSE=1
 
-
-
-
-
 configure: configure-stamp
 configure-stamp:
 	dh_testdir
@@ -27,7 +23,6 @@
 	dh_testdir
 
 	# Add here commands to compile the package.
-	$(MAKE)
 	#docbook-to-man debian/mercurial-server.sgml > mercurial-server.1
 
 	touch $@
@@ -38,7 +33,6 @@
 	rm -f build-stamp configure-stamp
 
 	# Add here commands to clean up after the build process.
-	$(MAKE) clean
 
 	dh_clean 
 
@@ -49,8 +43,27 @@
 	dh_installdirs
 
 	# Add here commands to install the package into debian/mercurial-server.
-	$(MAKE) DESTDIR=$(CURDIR)/debian/mercurial-server install
-
+	cp \
+	    src/hg-ssh \
+	    src/refresh-auth \
+	    debian/mercurial-server/usr/share/mercurial-server
+	cp \
+	    src/mercurialserver/__init__.py \
+	    src/mercurialserver/paths.py \
+	    src/mercurialserver/changes.py \
+	    src/mercurialserver/access.py \
+	    src/mercurialserver/servelog.py \
+	    src/mercurialserver/refreshauth.py \
+	    src/mercurialserver/ruleset.py \
+	    debian/mercurial-server/usr/share/mercurial-server/mercurialserver
+	cp \
+	    src/init/hginit \
+	    src/init/hgadmin-hgrc \
+	    debian/mercurial-server/usr/share/mercurial-server/init
+	cp \
+	    src/init/conf/remote-hgrc \
+	    src/init/conf/access.conf \
+	    debian/mercurial-server/etc/mercurial-server
 
 # Build architecture-independent files here.
 binary-indep: build install
@@ -60,9 +73,9 @@
 binary-arch: build install
 	dh_testdir
 	dh_testroot
-	dh_installchangelogs 
+#	dh_installchangelogs 
 	dh_installdocs
-	dh_installexamples
+#	dh_installexamples
 #	dh_install
 #	dh_installmenu
 #	dh_installdebconf