Improved Debian package.
authorDaniel Hokka Zakrisson <daniel@hozac.com>
Tue, 20 Jul 2010 12:41:31 +0000 (12:41 +0000)
committerDaniel Hokka Zakrisson <daniel@hozac.com>
Tue, 20 Jul 2010 12:41:31 +0000 (12:41 +0000)
git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@2901 94cd875c-1c1d-0410-91d2-eb244daf1a30

15 files changed:
Makefile.am
contrib/make-deb-manifest
contrib/make-manifest
contrib/manifest.dat.pathsubst
debian/control
debian/copyright
debian/util-vserver-build.postinst [new file with mode: 0755]
debian/util-vserver-legacy.postinst [new file with mode: 0755]
debian/util-vserver-legacy.prerm [new file with mode: 0755]
debian/util-vserver-sysv.postinst [new file with mode: 0755]
debian/util-vserver-sysv.postrm [new file with mode: 0755]
debian/util-vserver-sysv.prerm [new file with mode: 0755]
debian/util-vserver.postinst [new file with mode: 0755]
debian/util-vserver.postrm [new file with mode: 0755]
util-vserver.spec.in

index e4c1187..c21dc9d 100644 (file)
@@ -143,6 +143,9 @@ pathsubst_RULES =   s!@'PKGLIBDIR'@!$(pkglibdir)!g; \
                        s!@'ENSC_HAVE_C99_COMPILER_FALSE'@!\@ENSC_HAVE_C99_COMPILER_FALSE@ !g; \
                        s!@'ENSC_HAVE_CXX_COMPILER_TRUE'@!\@ENSC_HAVE_CXX_COMPILER_TRUE@ !g; \
                        s!@'ENSC_HAVE_CXX_COMPILER_FALSE'@!\@ENSC_HAVE_CXX_COMPILER_FALSE@ !g; \
+                       s!@'HAVE_PYTHON_TRUE'@!\@HAVE_PYTHON_TRUE@ !g; \
+                       s!@'HAVE_PYTHON_FALSE'@!\@HAVE_PYTHON_FALSE@ !g; \
+                       s!@'PYEXECDIR'@!$(pyexecdir)!g; \
                        $(ENSC_PATHPROG_SED)
 
 pathconfig.h:          .pathconfig.h.pathsubst.stamp
index 17ccd1b..44ee869 100755 (executable)
@@ -33,7 +33,7 @@ getname() {
     fi
 }
 
-for i in {core,build,legacy,sysv,lib,devel,base}; do
+for i in {core,build,legacy,sysv,lib,devel,base,python}; do
     getname $i
     echo -n >${fullname}.install
     rm -f ${fullname}.conffiles
@@ -46,10 +46,13 @@ while read style file; do
        (\#*)   continue;;
     esac
     getname $style
+    set -o noglob
     set -- $file
+    set +o noglob
     if test "$2"; then
        file="$2"
        for i in ${DESTDIR}$file; do
+           test "${file#/etc/}" != "$file" && continue
            echo "${i#${DESTDIR}}" >>${fullname}.conffiles
        done
     fi
index 7e497c7..fd0d7b2 100755 (executable)
@@ -21,7 +21,7 @@ name=$1
 dest=$2
 data=$3
 
-for i in $name-{core,devel,base,build,legacy,lib,sysv}.list; do
+for i in $name-{core,devel,base,build,legacy,lib,sysv,python}.list; do
     echo '%defattr(-,root,root,-)' >$i
 done
 
index 6643ec4..5b87296 100644 (file)
@@ -159,3 +159,4 @@ legacy @CONFIG@ @INITRDDIR@/rebootmgr
 legacy @CONFIG@ @INITRDDIR@/vservers-legacy
 legacy @CONFIG_NOREPLACE@ @SYSCONFDIR@/vservers.conf
 build  @CONFIG_NOREPLACE@ @CONFDIR@/.distributions/*/apt/sources.list
+@HAVE_PYTHON_TRUE@python @PYEXECDIR@/*
index 72c6cf2..c7d50a6 100644 (file)
@@ -8,40 +8,41 @@ Homepage: http://savannah.nongnu.org/projects/util-vserver/
 
 Package: util-vserver
 Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}, util-vserver-core, util-vserver-lib, util-vserver-sysv, coreutils, diffutils, sed
+Depends: ${shlibs:Depends}, ${misc:Depends}, util-vserver-core, util-vserver-lib, util-vserver-sysv, diffutils
 Description: utilities for managing Linux-VServer guests
  util-vserver provides the components and a framework to setup virtual
- servers.  A virtual server runs inside a linux server. It is nevertheless
+ servers.  A virtual server runs inside a Linux server. It is nevertheless
  highly independent. As such, you can run various services with normal
  configuration. The various vservers can't interact with each other and
  can't interact with services in the main server.
 
 Package: libvserver0
+Section: libs
 Architecture: any
 Depends: ${shlibs:Depends}, ${misc:Depends}
 Description: dynamic libraries for util-vserver
  util-vserver provides the components and a framework to setup virtual
- servers.  A virtual server runs inside a linux server. It is nevertheless
+ servers.  A virtual server runs inside a Linux server. It is nevertheless
  highly independent. As such, you can run various services with normal
  configuration. The various vservers can't interact with each other and
  can't interact with services in the main server.
 
 Package: util-vserver-core
 Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}, util-linux
+Depends: ${shlibs:Depends}, ${misc:Depends}
 Description: core utilities of util-vserver
  util-vserver provides the components and a framework to setup virtual
- servers.  A virtual server runs inside a linux server. It is nevertheless
+ servers.  A virtual server runs inside a Linux server. It is nevertheless
  highly independent. As such, you can run various services with normal
  configuration. The various vservers can't interact with each other and
  can't interact with services in the main server.
 
 Package: util-vserver-build
 Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}, util-vserver, wget, binutils, tar
+Depends: ${shlibs:Depends}, ${misc:Depends}, util-vserver, wget, binutils
 Description: tools which can be used to build vservers
  util-vserver provides the components and a framework to setup virtual
- servers.  A virtual server runs inside a linux server. It is nevertheless
+ servers.  A virtual server runs inside a Linux server. It is nevertheless
  highly independent. As such, you can run various services with normal
  configuration. The various vservers can't interact with each other and
  can't interact with services in the main server.
@@ -51,7 +52,7 @@ Architecture: any
 Depends: ${shlibs:Depends}, ${misc:Depends}, util-vserver, make, diffutils
 Description: initscripts for util-vserver
  util-vserver provides the components and a framework to setup virtual
- servers.  A virtual server runs inside a linux server. It is nevertheless
+ servers.  A virtual server runs inside a Linux server. It is nevertheless
  highly independent. As such, you can run various services with normal
  configuration. The various vservers can't interact with each other and
  can't interact with services in the main server.
@@ -61,27 +62,28 @@ Architecture: any
 Depends: ${shlibs:Depends}, ${misc:Depends}, ${perl:Depends}, util-vserver
 Description: legacy scripts for util-vserver
  util-vserver provides the components and a framework to setup virtual
- servers.  A virtual server runs inside a linux server. It is nevertheless
+ servers.  A virtual server runs inside a Linux server. It is nevertheless
  highly independent. As such, you can run various services with normal
  configuration. The various vservers can't interact with each other and
  can't interact with services in the main server.
 
 Package: libvserver0-dev
+Section: libdevel
 Architecture: any
 Depends: ${shlibs:Depends}, ${misc:Depends}, util-vserver-lib, pkg-config
 Description: headers and libraries needed to develop vserver based applications
  util-vserver provides the components and a framework to setup virtual
- servers.  A virtual server runs inside a linux server. It is nevertheless
+ servers.  A virtual server runs inside a Linux server. It is nevertheless
  highly independent. As such, you can run various services with normal
  configuration. The various vservers can't interact with each other and
  can't interact with services in the main server.
 
 Package: util-vserver-python
 Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}, util-vserver-lib
+Depends: ${shlibs:Depends}, ${misc:Depends}, util-vserver-lib, ${python:Depends}, ${python:Versions}
 Description: python-bindings for util-vserver
  util-vserver provides the components and a framework to setup virtual
- servers.  A virtual server runs inside a linux server. It is nevertheless
+ servers.  A virtual server runs inside a Linux server. It is nevertheless
  highly independent. As such, you can run various services with normal
  configuration. The various vservers can't interact with each other and
  can't interact with services in the main server.
index eb2d234..6c3f39a 100644 (file)
@@ -28,7 +28,7 @@ License:
     for more details.
 
     You should have received a copy of the GNU General Public License with
-    your Debian GNU system, in /usr/share/common-licenses/GPL, or with the
+    your Debian GNU system, in /usr/share/common-licenses/GPL-2, or with the
     Debian GNU source package as the file GNUGPL.TXT.  If not, write to the
     Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
     MA 02110-1301, USA.
diff --git a/debian/util-vserver-build.postinst b/debian/util-vserver-build.postinst
new file mode 100755 (executable)
index 0000000..3d40cac
--- /dev/null
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+test -d /vservers/.hash || mkdir -m0700 /vservers/.hash
+
+f="/etc/vservers/.defaults/apps/vunify/hash"; test -e "$f"/method -o -e "$f"/00 || \
+        ln -s /vservers/.hash "$f"/00
+
+/usr/sbin/setattr --barrier /vservers/.hash || :
diff --git a/debian/util-vserver-legacy.postinst b/debian/util-vserver-legacy.postinst
new file mode 100755 (executable)
index 0000000..3d98fba
--- /dev/null
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+if test "$1" = configure; then
+    update-rc.d rebootmgr start 98 2 3 4 5 stop 02 0 1 6 .
+    update-rc.d vservers-legacy start 98 2 3 4 5 stop 02 0 1 6 .
+    for i in httpd named portmap sendmail smb sshd xinetd gated; do
+       update-rc.d v_$i start 98 2 3 4 5 stop 02 0 1 6 .
+    done
+fi
diff --git a/debian/util-vserver-legacy.prerm b/debian/util-vserver-legacy.prerm
new file mode 100755 (executable)
index 0000000..6e54d47
--- /dev/null
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+if test "$1" = remove; then
+    /etc/init.d/rebootmgr stop > /dev/null 2>&1
+    update-rc.d rebootmgr remove
+    update-rc.d vservers-legacy remove
+    for i in httpd named portmap sendmail smb sshd xinetd gated; do
+       update-rc.d v_$i remove
+    done
+fi
diff --git a/debian/util-vserver-sysv.postinst b/debian/util-vserver-sysv.postinst
new file mode 100755 (executable)
index 0000000..21bd69c
--- /dev/null
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+if test "$1" = configure; then
+    update-rc.d vservers-default start 98 2 3 4 5 stop 02 0 1 6 .
+    update-rc.d vprocunhide start 26 2 3 4 5 stop 74 0 1 6 .
+    update-rc.d util-vserver start 10 2 3 4 5 stop 90 0 1 6 .
+fi
diff --git a/debian/util-vserver-sysv.postrm b/debian/util-vserver-sysv.postrm
new file mode 100755 (executable)
index 0000000..8d1bed8
--- /dev/null
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+if test "$1" = upgrade; then
+    /etc/init.d/vprocunhide condrestart > /dev/null 2>&1
+fi
diff --git a/debian/util-vserver-sysv.prerm b/debian/util-vserver-sysv.prerm
new file mode 100755 (executable)
index 0000000..83dd404
--- /dev/null
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+if test "$1" = remove; then
+    /etc/init.d/vprocunhide stop > /dev/null 2>&1
+    update-rc.d vprocunhide remove
+    update-rc.d util-vserver remove
+    update-rc.d vservers-default remove
+fi
diff --git a/debian/util-vserver.postinst b/debian/util-vserver.postinst
new file mode 100755 (executable)
index 0000000..b6ecbcc
--- /dev/null
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+test -d /vservers      || mkdir -m0000 /vservers
+test -d /vservers/.pkg || mkdir -m0755 /vservers/.pkg
+
+f="/etc/vservers/.defaults/vdirbase";  test -L "$f" -o -e "$f" || ln -s /vservers             "$f"
+f="/etc/vservers/.defaults/run.rev";   test -L "$f" -o -e "$f" || ln -s /var/run/vservers.rev "$f"
+f="/etc/vservers/.defaults/cachebase"; test -L "$f" -o -e "$f" || ln -s /var/cache/vservers   "$f"
+
+/usr/sbin/setattr --barrier /vservers /vservers/.pkg || :
diff --git a/debian/util-vserver.postrm b/debian/util-vserver.postrm
new file mode 100755 (executable)
index 0000000..033af8d
--- /dev/null
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+if test "$1" = purge; then
+    rm -rf /var/cache/vservers/* 2>/dev/null || :
+fi
index 48026ae..0125bcb 100644 (file)
@@ -395,9 +395,10 @@ test "$1" = 0  || %_initrddir/rebootmgr   condrestart >/dev/null || :
 %{!?_without_doc:%doc lib/apidoc/html}
 
 
-%files python
+%if 0%{!?_without_python:1}
+%files python -f %name-python.list
 %defattr(-,root,root,-)
-%{!?_without_python:%{python_sitearch}/*}
+%endif
 
 
 %changelog