summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTzafrir Cohen <tzafrir.cohen@xorcom.com>2009-01-06 11:12:29 +0000
committerTzafrir Cohen <tzafrir.cohen@xorcom.com>2009-01-06 11:12:29 +0000
commit62549d8bde584228799cfc302ff6f67523c50481 (patch)
tree5693d86b2b70d2817c77bbe84ca20d33898035eb
parent2167f8f1f9bbdc1943a4dbfd249447965e78b4b6 (diff)
Fix rapid-client deb generation and removal:
* Re-add /var/lib/rapid-tunneling . Add a placeholder file to keep it. * Fix user generation in postinst to not try again. * Delete user's home directory and remove user on purge. git-svn-id: svn+ssh://xorcom/home/svn/debs/components/rapid-tunneling@6555 283159da-0705-0410-b60c-f2062b4bb6ad
-rw-r--r--.placeholder1
-rw-r--r--Makefile4
-rw-r--r--debian/TODO.Debian3
-rw-r--r--debian/prerm44
-rw-r--r--debian/rapid-tunneling.install2
-rw-r--r--debian/rapid-tunneling.postinst4
-rw-r--r--debian/rapid-tunneling.postrm16
-rw-r--r--rapid-tunneling.spec3
8 files changed, 29 insertions, 48 deletions
diff --git a/.placeholder b/.placeholder
new file mode 100644
index 0000000..6b9b8d7
--- /dev/null
+++ b/.placeholder
@@ -0,0 +1 @@
+An empty directory is not possible with .deb packages
diff --git a/Makefile b/Makefile
index 988aa0b..5d0e520 100644
--- a/Makefile
+++ b/Makefile
@@ -4,7 +4,7 @@ SPEC = rapid-tunneling.spec
SCRIPTS = rapid-tunneling rapid-tunneling-status rtadm rt-from-remote
CONFIGS = rtadm.config sshd_support_config support_env
INIT_D = sshd_support
-SOURCES = Makefile $(SPEC) $(SCRIPTS) $(CONFIGS) $(INIT_D)
+SOURCES = Makefile $(SPEC) $(SCRIPTS) $(CONFIGS) $(INIT_D) .placeholder
SBINDIR = /usr/sbin
BINDIR = /usr/share/rapid-tunneling/bin
@@ -51,6 +51,8 @@ install:
install -m 644 rtadm.config $(DESTDIR)/etc/rapid-tunneling/rtadm
install -m 755 -d $(DESTDIR)/etc/ssh
install -m 644 sshd_support_config $(DESTDIR)/etc/ssh/
+ install -m 755 -d $(DESTDIR)/var/lib/rapid-tunneling
+ install -m 644 .placeholder $(DESTDIR)/var/lib/rapid-tunneling/
.PHONY: clean dummy
dummy:
diff --git a/debian/TODO.Debian b/debian/TODO.Debian
index ed0dcc2..5453396 100644
--- a/debian/TODO.Debian
+++ b/debian/TODO.Debian
@@ -3,3 +3,6 @@ not.
If we do, we must use the current useradd command. If we don't: use
adduser. The web interface only assumes that there's such a user.
+
+
+* Do we delete users on purge?
diff --git a/debian/prerm b/debian/prerm
deleted file mode 100644
index 1ac9c16..0000000
--- a/debian/prerm
+++ /dev/null
@@ -1,44 +0,0 @@
-#!/bin/sh
-# prerm script for rapid-tunneling
-#
-# see: dh_installdeb(1)
-
-set -e
-
-# summary of how this script can be called:
-# * <prerm> `remove'
-# * <old-prerm> `upgrade' <new-version>
-# * <new-prerm> `failed-upgrade' <old-version>
-# * <conflictor's-prerm> `remove' `in-favour' <package> <new-version>
-# * <deconfigured's-prerm> `deconfigure' `in-favour'
-# <package-being-installed> <version> `removing'
-# <conflicting-package> <version>
-# for details, see http://www.debian.org/doc/debian-policy/ or
-# the debian-policy package
-
-
-case "$1" in
- remove)
- userdel -r rapid-tunneling || :
- ;;
-
- upgrade)
- ;;
-
- failed-upgrade)
- ;;
-
- *)
- echo "prerm called with unknown argument \`$1'" >&2
- exit 1
- ;;
-esac
-
-# dh_installdeb will replace this with shell code automatically
-# generated by other debhelper scripts.
-
-#DEBHELPER#
-
-exit 0
-
-
diff --git a/debian/rapid-tunneling.install b/debian/rapid-tunneling.install
index ca4453e..100fe09 100644
--- a/debian/rapid-tunneling.install
+++ b/debian/rapid-tunneling.install
@@ -1,3 +1,3 @@
usr/sbin/rapid-tunneling
usr/sbin/rapid-tunneling-status
-
+var/lib/rapid-tunneling
diff --git a/debian/rapid-tunneling.postinst b/debian/rapid-tunneling.postinst
index 5fdc023..bebf14f 100644
--- a/debian/rapid-tunneling.postinst
+++ b/debian/rapid-tunneling.postinst
@@ -21,7 +21,9 @@ set -e
case "$1" in
configure)
# add a user with uid=gid=0
- useradd -d /var/lib/rapid-tunneling/home -m -u 0 -g 0 -o rapid-tunneling 2>/dev/null || true
+ if ! getent passwd rapid-tunneling >/dev/null ; then
+ useradd -d /var/lib/rapid-tunneling/home -m -u 0 -g 0 -o rapid-tunneling
+ fi
;;
abort-upgrade|abort-remove|abort-deconfigure)
diff --git a/debian/rapid-tunneling.postrm b/debian/rapid-tunneling.postrm
new file mode 100644
index 0000000..89276e5
--- /dev/null
+++ b/debian/rapid-tunneling.postrm
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+set -e
+
+case "$1" in
+ purge)
+ userdel -r rapid-tunneling || :
+ rm -rf /var/lib/rapid-tunneling/home
+ ;;
+esac
+
+#DEBHELPER#
+
+exit 0
+
+
diff --git a/rapid-tunneling.spec b/rapid-tunneling.spec
index 8009508..7e342ce 100644
--- a/rapid-tunneling.spec
+++ b/rapid-tunneling.spec
@@ -71,10 +71,11 @@ fi
%defattr(-, root, root, 0755)
%config(noreplace) /etc/rapid-tunneling/rtadm
%config(noreplace) /etc/ssh/sshd_support_config
+%config /etc/init.d/sshd_support
%{_datadir}/rapid-tunneling/support_env
%{_datadir}/rapid-tunneling/bin/rtadm
%{_datadir}/rapid-tunneling/bin/rt-from-remote
-/etc/init.d/sshd_support
+/var/lib/rapid-tunneling
%changelog
* Sun Dec 14 2008 Alex Landau <alex.landau@xorcom.com> 1.0-1