From ab00d98f6ef6bed45cec4578f324ed958c1e9e54 Mon Sep 17 00:00:00 2001 From: Daniel Hokka Zakrisson Date: Tue, 20 Jul 2010 12:41:31 +0000 Subject: [PATCH] Improved Debian package. git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@2901 94cd875c-1c1d-0410-91d2-eb244daf1a30 --- Makefile.am | 3 +++ contrib/make-deb-manifest | 5 ++++- contrib/make-manifest | 2 +- contrib/manifest.dat.pathsubst | 1 + debian/control | 26 ++++++++++++++------------ debian/copyright | 2 +- debian/util-vserver-build.postinst | 8 ++++++++ debian/util-vserver-legacy.postinst | 9 +++++++++ debian/util-vserver-legacy.prerm | 10 ++++++++++ debian/util-vserver-sysv.postinst | 7 +++++++ debian/util-vserver-sysv.postrm | 5 +++++ debian/util-vserver-sysv.prerm | 8 ++++++++ debian/util-vserver.postinst | 10 ++++++++++ debian/util-vserver.postrm | 5 +++++ util-vserver.spec.in | 5 +++-- 15 files changed, 89 insertions(+), 17 deletions(-) create mode 100755 debian/util-vserver-build.postinst create mode 100755 debian/util-vserver-legacy.postinst create mode 100755 debian/util-vserver-legacy.prerm create mode 100755 debian/util-vserver-sysv.postinst create mode 100755 debian/util-vserver-sysv.postrm create mode 100755 debian/util-vserver-sysv.prerm create mode 100755 debian/util-vserver.postinst create mode 100755 debian/util-vserver.postrm diff --git a/Makefile.am b/Makefile.am index e4c1187..c21dc9d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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 diff --git a/contrib/make-deb-manifest b/contrib/make-deb-manifest index 17ccd1b..44ee869 100755 --- a/contrib/make-deb-manifest +++ b/contrib/make-deb-manifest @@ -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 diff --git a/contrib/make-manifest b/contrib/make-manifest index 7e497c7..fd0d7b2 100755 --- a/contrib/make-manifest +++ b/contrib/make-manifest @@ -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 diff --git a/contrib/manifest.dat.pathsubst b/contrib/manifest.dat.pathsubst index 6643ec4..5b87296 100644 --- a/contrib/manifest.dat.pathsubst +++ b/contrib/manifest.dat.pathsubst @@ -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@/* diff --git a/debian/control b/debian/control index 72c6cf2..c7d50a6 100644 --- a/debian/control +++ b/debian/control @@ -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. diff --git a/debian/copyright b/debian/copyright index eb2d234..6c3f39a 100644 --- a/debian/copyright +++ b/debian/copyright @@ -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 index 0000000..3d40cac --- /dev/null +++ b/debian/util-vserver-build.postinst @@ -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 index 0000000..3d98fba --- /dev/null +++ b/debian/util-vserver-legacy.postinst @@ -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 index 0000000..6e54d47 --- /dev/null +++ b/debian/util-vserver-legacy.prerm @@ -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 index 0000000..21bd69c --- /dev/null +++ b/debian/util-vserver-sysv.postinst @@ -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 index 0000000..8d1bed8 --- /dev/null +++ b/debian/util-vserver-sysv.postrm @@ -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 index 0000000..83dd404 --- /dev/null +++ b/debian/util-vserver-sysv.prerm @@ -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 index 0000000..b6ecbcc --- /dev/null +++ b/debian/util-vserver.postinst @@ -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 index 0000000..033af8d --- /dev/null +++ b/debian/util-vserver.postrm @@ -0,0 +1,5 @@ +#!/bin/sh + +if test "$1" = purge; then + rm -rf /var/cache/vservers/* 2>/dev/null || : +fi diff --git a/util-vserver.spec.in b/util-vserver.spec.in index 48026ae..0125bcb 100644 --- a/util-vserver.spec.in +++ b/util-vserver.spec.in @@ -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 -- 1.8.1.5