Index: jailkit-2.3-destdir.patch
===================================================================
--- jailkit-2.3-destdir.patch	(revision 6181)
+++ jailkit-2.3-destdir.patch	(working copy)
@@ -1,25 +1,29 @@
 diff -ur jailkit-2.3/Makefile.in jailkit-2.3-destdir/Makefile.in
 --- jailkit-2.3/Makefile.in	2006-12-24 16:26:10.000000000 +0200
 +++ jailkit-2.3-gentoo/Makefile.in	2007-04-21 21:01:19.000000000 +0300
-@@ -28,8 +28,8 @@
+@@ -28,8 +28,9 @@
  #POSSIBILITY OF SUCH DAMAGE.
  #
  INSTALL = @INSTALL@
 -prefix = @prefix@
 -sysconfdir = @sysconfdir@
 +prefix = $(DESTDIR)@prefix@
++prefix2 = @prefix@
 +sysconfdir = $(DESTDIR)@sysconfdir@
  iniprefix = ${sysconfdir}/jailkit
  PACKAGE = @PACKAGE@
  
-@@ -72,8 +72,8 @@
+@@ -71,9 +72,10 @@
+ 	@cd man/ && $(MAKE) install
  	# test if the jk_chrootsh is already in /etc/shells
  	# this previously had @echo but that fails on FreeBSD
- 	if ! grep ${prefix}/sbin/jk_chrootsh /etc/shells ; then \
+-	if ! grep ${prefix}/sbin/jk_chrootsh /etc/shells ; then \
 -		echo "appending ${prefix}/sbin/jk_chroots to /etc/shells";\
 -		echo ${prefix}/sbin/jk_chrootsh >> /etc/shells ;\
-+		echo "appending ${prefix}/sbin/jk_chrootsh to $(DESTDIR)/etc/shells";\
-+		echo ${prefix}/sbin/jk_chrootsh >> $(DESTDIR)/etc/shells ;\
++	if ! grep ${prefix2}/sbin/jk_chrootsh /etc/shells ; then \
++		echo "appending ${prefix2}/sbin/jk_chroots to ${DESTDIR}/etc/shells";\
++		cp -a /etc/shells ${DESTDIR}/etc/shells ;\
++		echo ${prefix2}/sbin/jk_chrootsh >> ${DESTDIR}/etc/shells ;\
  	fi
  
  
