- configure)
- # Configure this package. If the package must prompt the user for
- # information, do it here.
- if ! getent group citadel >/dev/null; then
- groupadd citadel
- fi
- if ! getent passwd citadel >/dev/null; then
- adduser --system --ingroup citadel --home /var/lib/citadel \
- --gecos "Citadel system user" --shell /bin/sh \
- --disabled-password citadel
- fi
- mkdir -p /etc/citadel
- chown citadel:citadel /etc/citadel
- # Activate menu-methods script
- #: chmod a+x /etc/menu-methods/foo
-
- # Update ld.so cache
- #: ldconfig
-
- # Make our version of a program available
- #: update-alternatives \
- #: --install /usr/bin/program program /usr/bin/alternative 50 \
- #: --slave /usr/share/man/man1/program.1.gz program.1.gz \
- #: /usr/share/man/man1/alternative.1.gz
-
- # Tell ucf that the file in /usr/share/foo is the latest
- # maintainer version, and let it handle how to manage the real
- # confuguration file in /etc. This is how a static configuration
- # file can be handled:
- ucf /usr/share/doc/citadel-server/examples/mail.aliases /etc/citadel/mail.aliases
- ucf /usr/share/doc/citadel-server/examples/public_clients /etc/citadel/public_clients
-
- #: !TODO: should network/systems go to /etc/citadel?
-
-# mkdir -p \
-# /var/lib/citadel/help \
-# /var/lib/citadel/messages \
-# /var/lib/citadel/data/ \
-# /var/lib/citadel/bio/ \
-# /var/lib/citadel/bitbucket/ \
-# /var/lib/citadel/files/ \
-# /var/lib/citadel/images/ \
-# /var/lib/citadel/info/ \
-# /var/lib/citadel/userpics/ \
-# /var/spool/citadel/network/spoolin \
-# /var/spool/citadel/network/spoolout \
-# /var/spool/citadel/network/spoolsystems \
-# /var/run/citadel
-#
-
- for i in aide floors hours intro.gz mail network nice.gz policy software summary.gz; do
- case $i in
- *.gz)
- j=`echo $i|sed "s;.gz;;"`
- gunzip -c "/usr/share/doc/citadel-server/examples/help/$i" >"/tmp/$j"
- i=$j
- ;;
- *)
- cp "/usr/share/doc/citadel-server/examples/help/$i" "/tmp"
- ;;
- esac
- ucf "/tmp/$i" "/var/lib/citadel/help/$i"
- rm -f "/tmp/$i"
+ configure)
+ chown -R citadel:citadel /etc/citadel
+ chown -R citadel:citadel /var/lib/citadel /var/spool/citadel
+ move_file /var/run/refcount_adjustments.dat /etc/citadel/data/refcount_adjustments.dat
+ move_file /etc/citadel/citadel.control /var/lib/citadel/data/citadel.control
+ move_file /etc/citadel/citadel.config /var/lib/citadel/data/citadel.config
+ invoke-rc.d citadel start
+
+ db_get citadel/Administrator && admin="$RET"
+ db_get citadel/ServerIPAddress && ip_addr="$RET"
+ db_get citadel/LoginType && ENABLE_UNIX_AUTH="$RET"; export ENABLE_UNIX_AUTH
+ db_get citadel/LDAPServer && LDAP_HOST="$RET"; export LDAP_HOST
+ db_get citadel/LDAPServerPort && LDAP_PORT="$RET"; export LDAP_PORT
+ db_get citadel/LDAPBaseDN && LDAP_BASE_DN="$RET"; export LDAP_BASE_DN
+ db_get citadel/LDAPBindDN && LDAP_BIND_DN="$RET"; export LDAP_BIND_DN
+ db_get citadel/LDAPBindDNPassword && LDAP_BIND_PW="$RET"; export LDAP_BIND_PW
+
+
+ export IP_ADDR=$ip_addr
+ export CITADEL='/var/run/citadel'
+ export CITADEL_PORT=504
+ export CITADEL_INSTALLER=yes
+ export CITADEL_UID=`grep ^citadel: /etc/passwd | cut -d : -f 3`
+ export ACT_AS_MTA=no
+ export SYSADMIN_NAME=$admin
+ export CREATE_XINETD_ENTRY=no
+ export CREATE_INITTAB_ENTRY=no
+ export NO_INIT_SCRIPTS=yes
+
+ while test ! -S /var/run/citadel/citadel-admin.socket; do
+ sleep 1
+ echo -n :