debian packaging finished

This commit is contained in:
lars 2006-11-24 11:03:20 +00:00
parent 3490be26ef
commit 34c2f26b52
12 changed files with 65 additions and 32 deletions

8
debian/control vendored
View File

@ -2,15 +2,15 @@ Source: cryptobox
Section: admin Section: admin
Priority: extra Priority: extra
Maintainer: Lars Kruse <devel@sumpfralle.de> Maintainer: Lars Kruse <devel@sumpfralle.de>
Build-Depends: debhelper (>= 5.0.37.2), dpatch, python-all-dev (>= 2.4), python-central (>= 0.5.6) Build-Depends: debhelper (>= 5.0.38), dpatch, python-all-dev (>= 2.4), python-central (>= 0.5.6)
XS-Python-Version: 2.4 XS-Python-Version: >= 2.4
Standards-Version: 3.7.2 Standards-Version: 3.7.2
Package: cryptobox Package: cryptobox
Architecture: any Architecture: any
Depends: ${python:Depends}, bash (>=2.0), sed (>=4.0), coreutils, grep (>=2.0), hashalot, cryptsetup (>=20050111), dmsetup, initscripts, e2fsprogs (>= 1.27), adduser, python (>=2.4), python-clearsilver, super, dosfstools, python-cherrypy, python-configobj Depends: ${python:Depends}, bash (>=2.0), sed (>=4.0), coreutils, grep (>=2.0), cryptsetup (>=20050111), dmsetup, initscripts, e2fsprogs (>= 1.27), adduser, python (>=2.4), python-clearsilver, super, dosfstools, python-cherrypy, python-configobj
Suggests: samba, stunnel, openssl Suggests: samba, stunnel, openssl
XB-Python-Version: 2.4 XB-Python-Version: ${python:Versions}
Description: Web interface for an encrypting fileserver Description: Web interface for an encrypting fileserver
This web interface allows you to manage the encrypted and plaintext This web interface allows you to manage the encrypted and plaintext
disks of your system. The data is platform independently available disks of your system. The data is platform independently available

View File

@ -1,8 +1,6 @@
# boot configuration file for the CryptoBox # boot configuration file for the CryptoBox
# #
# $Id$ # the default state of the cryptobox is disabled
#
# the default setup of the cryptobox is complete inactivity
# set to "0" to enable the startup of the cryptobox - otherwise "1" # set to "0" to enable the startup of the cryptobox - otherwise "1"
NO_START=1 NO_START=1

View File

@ -2,6 +2,4 @@ README
copyright copyright
changelog changelog
doc/html doc/html
LICENSE
event-scripts event-scripts
conf-examples

1
debian/cryptobox.examples vendored Normal file
View File

@ -0,0 +1 @@
conf-examples

10
debian/cryptobox.init vendored
View File

@ -59,22 +59,20 @@ case "$1" in
log_daemon_msg "Starting $DESC" log_daemon_msg "Starting $DESC"
if start-stop-daemon \ if start-stop-daemon \
--chuid $RUNAS: --quiet --start \ --chuid $RUNAS: --quiet --start \
--oknodo --user $RUNAS --pidfile "$PIDFILE" \ --user $RUNAS --pidfile "$PIDFILE" \
--exec /usr/bin/python --startas "$DAEMON" -- $OPTIONS --exec /usr/bin/python --startas "$DAEMON" -- $OPTIONS
then log_end_msg 0 then log_end_msg 0
else log_end_msg 1 else log_end_msg 1
exit 1
fi fi
;; ;;
stop ) stop )
log_daemon_msg "Stopping cryptobox webserver" "$DESC" log_daemon_msg "Stopping cryptobox webserver" "$DESC"
if start-stop-daemon --oknodo --quiet --stop \ if start-stop-daemon --quiet --stop \
--pidfile "$PIDFILE" \ --pidfile "$PIDFILE" \
--user "$RUNAS" --user "$RUNAS"
then rm "$PIDFILE" then test -e "$PIDFILE" && rm "$PIDFILE"
log_end_msg 0 log_end_msg 0
else log_end_msg 1 else log_end_msg 1
exit 1
fi fi
;; ;;
reload | force-reload | restart ) reload | force-reload | restart )
@ -85,7 +83,7 @@ case "$1" in
status ) status )
echo -n "$DESC " echo -n "$DESC "
if start-stop-daemon --stop --signal 0 --quiet \ if start-stop-daemon --stop --signal 0 --quiet \
--pidfile "$PIDFILE" -user "$RUNAS" --pidfile "$PIDFILE" --user "$RUNAS"
then echo "running" then echo "running"
exit 0 exit 0
else if [ -e "$PIDFILE" ] else if [ -e "$PIDFILE" ]

1
debian/cryptobox.lintian vendored Normal file
View File

@ -0,0 +1 @@
cryptobox: package-has-a-duplicate-relation

2
debian/cryptobox.manpages vendored Normal file
View File

@ -0,0 +1,2 @@
man/CryptoBoxWebserver.8
man/CryptoBoxRootActions.8

4
debian/postinst vendored
View File

@ -6,6 +6,7 @@ PID_DIR=/var/run/cryptobox
CRYPTOBOX_USER=cryptobox CRYPTOBOX_USER=cryptobox
USER_HOME=/var/cache/cryptobox USER_HOME=/var/cache/cryptobox
SUPER_FILE=/etc/super.tab SUPER_FILE=/etc/super.tab
ADDITIONAL_GROUP=disk
# check the current cryptobox user - maybe it was changed # check the current cryptobox user - maybe it was changed
if test -r /etc/default/cryptobox if test -r /etc/default/cryptobox
@ -20,7 +21,8 @@ create_user_home()
getent passwd "$CRYPTOBOX_USER" 2>/dev/null >/dev/null && return 0 getent passwd "$CRYPTOBOX_USER" 2>/dev/null >/dev/null && return 0
# create cryptobox user # create cryptobox user
echo "Creating new user '$CRYPTOBOX_USER' ..." echo "Creating new user '$CRYPTOBOX_USER' ..."
adduser --system --group --groups disk --home "$USER_HOME" cryptobox adduser --system --group --home "$USER_HOME" "$CRYPTOBOX_USER"
adduser "$CRYPTOBOX_USER" "$ADDITIONAL_GROUP"
mkdir -p "$USER_HOME/mnt" mkdir -p "$USER_HOME/mnt"
mkdir -p "$USER_HOME/settings" mkdir -p "$USER_HOME/settings"
chown -R ${CRYPTOBOX_USER}: "$USER_HOME" chown -R ${CRYPTOBOX_USER}: "$USER_HOME"

36
debian/postrm vendored
View File

@ -4,6 +4,8 @@ LOG_FILE=/var/log/cryptobox/cryptobox.log
WEBLOG_FILE=/var/log/cryptobox/webserver.log WEBLOG_FILE=/var/log/cryptobox/webserver.log
PID_DIR=/var/run/cryptobox PID_DIR=/var/run/cryptobox
SUPER_FILE=/etc/super.tab SUPER_FILE=/etc/super.tab
MNT_DIR=/var/cache/cryptobox/mnt
SETTINGS_DIR=/var/cache/cryptobox/settings
remove_super_lines() remove_super_lines()
{ {
@ -14,31 +16,45 @@ remove_super_lines()
} }
remove_log_files() umount_all()
{
test -d "$SETTINGS_DIR" && mountpoint -q "$SETTINGS_DIR" && umount "$SETTINGS_DIR"
test -d "$MNT_DIR" && ls "$MNT_DIR" | while read dir
do if test -d "$MNT_DIR/$dir"
then mountpoint -q "$MNT_DIR/$dir" && umount "$MNT_DIR/$dir"
rm -r "$MNT_DIR/$dir"
fi
done
}
remove_stuff()
{ {
test -e "$LOG_FILE" && rm "$LOG_FILE" test -e "$LOG_FILE" && rm "$LOG_FILE"
test -e "$LOG_FILE" && rm "$WEBLOG_FILE" test -e "$WEBLOG_FILE" && rm "$WEBLOG_FILE"
}
remove_pid_dir()
{
test -e "$PID_DIR" && rm -r "$PID_DIR" test -e "$PID_DIR" && rm -r "$PID_DIR"
test -e "$SETTINGS_DIR" && rm -r "$SETTINGS_DIR"
} }
################## main ################### ################## main ###################
# umount everything that is still active
umount_all
# remove the user
if test "$1" = "purge" && getent passwd cryptobox 2>/dev/null >/dev/null \ if test "$1" = "purge" && getent passwd cryptobox 2>/dev/null >/dev/null \
&& test "$(cd ~cryptobox;pwd)" = /var/cache/cryptobox && test "$(cd ~cryptobox;pwd)" = /var/cache/cryptobox
then echo "Removing user 'cryptobox' ..." then echo "Removing user 'cryptobox' ..."
userdel -r cryptobox userdel -r cryptobox
remove_log_files
remove_pid_dir
fi fi
## always remove the lines from the 'super' configuration file # always remove the lines from the 'super' configuration file
remove_super_lines remove_super_lines
# remove obsolete files
test "$1" = "purge" && remove_stuff
#DEBHELPER# #DEBHELPER#
# return without error # return without error

4
debian/preinst vendored Normal file
View File

@ -0,0 +1,4 @@
#!/bin/sh
#DEBHELPER#

4
debian/prerm vendored Normal file
View File

@ -0,0 +1,4 @@
#!/bin/sh
#DEBHELPER#

21
debian/rules vendored
View File

@ -54,13 +54,20 @@ install: build
mv $(DEB_BUILD_DIR)/usr/bin/CryptoBoxWebserver $(DEB_BUILD_DIR)/usr/sbin/ mv $(DEB_BUILD_DIR)/usr/bin/CryptoBoxWebserver $(DEB_BUILD_DIR)/usr/sbin/
mv $(DEB_BUILD_DIR)/usr/bin/CryptoBoxRootActions $(DEB_BUILD_DIR)/usr/sbin/ mv $(DEB_BUILD_DIR)/usr/bin/CryptoBoxRootActions $(DEB_BUILD_DIR)/usr/sbin/
# remove tests # remove tests
rm -rf $(CB_PYDIR)/tests rm -r $(CB_PYDIR)/tests
# remove duplicate documentation files # remove duplicate documentation files
rm -rf $(CB_PYDIR)/share/doc rm -r $(CB_PYDIR)/doc
# move shared files # move shared files
mv $(CB_PYDIR)/share $(DEB_BUILD_DIR)/usr/share/cryptobox install -d -m 755 $(DEB_BUILD_DIR)/usr/share/cryptobox
$(INSTALL) -d -m 755 $(DEB_BUILD_DIR)/var/log/cryptobox mv $(CB_PYDIR)/share/* $(DEB_BUILD_DIR)/usr/share/cryptobox/
$(INSTALL) -d -m 755 $(DEB_BUILD_DIR)/var/run/cryptobox rmdir $(CB_PYDIR)/share
# create log directory
install -d -m 755 $(DEB_BUILD_DIR)/var/log/cryptobox
# create pid directory
install -d -m 755 $(DEB_BUILD_DIR)/var/run/cryptobox
# install lintian override file: for multiple dependency caused by {python:Depends}
install -D -m 644 debian/cryptobox.lintian \
$(DEB_BUILD_DIR)/usr/share/lintian/overrides/cryptobox
# Build architecture-independent files here. # Build architecture-independent files here.
@ -74,10 +81,12 @@ binary-arch: build install
dh_installdocs dh_installdocs
dh_installexamples dh_installexamples
dh_installlogrotate dh_installlogrotate
dh_installinit
dh_installman dh_installman
dh_install dh_install
dh_pycentral dh_pycentral
@# pycentral must be called before installinit - otherwise the DEBHELPER part
@# in the postinst script is filled in the wrong order
dh_installinit
dh_compress dh_compress
dh_fixperms dh_fixperms
dh_installdeb dh_installdeb