# This is a POSIX shell fragment
#
-# User and HOME of metaproxy daemon
-SERVER_HOME=/var/metaproxy
-SERVER_USER=metaproxy
-SERVER_GROUP=metaproxy
-SERVER_NAME="Metaproxy user"
-
# Additional options that are passed to the Daemon.
-DAEMON_OPTS="-D -u ${SERVER_USER} -p /var/run/metaproxy.pid -l /var/log/metaproxy.log -c /etc/metaproxy/metaproxy.xml"
+DAEMON_OPTS="-D -u $SERVER_USER -p /var/run/metaproxy.pid -l /var/log/metaproxy.log -c /etc/metaproxy/metaproxy.xml"
# Exit if the package is not installed
[ -x "$DAEMON" ] || exit 0
+# Read user information
+. /etc/metaproxy/metaproxy.user
+
# Read configuration variable file if it is present
[ -r /etc/default/$NAME ] && . /etc/default/$NAME
debian/tmp/etc/metaproxy/metaproxy.xml
+debian/tmp/etc/metaproxy/metaproxy.user
debian/tmp/usr/bin/metaproxy
debian/tmp/usr/share/man/man1/*
debian/tmp/usr/share/man/man3/*
case "$1" in
configure)
- [ -f /etc/default/metaproxy ] && . /etc/default/metaproxy
-
- [ -z "$SERVER_HOME" ] && SERVER_HOME=/var/metaproxy
- [ -z "$SERVER_USER" ] && SERVER_USER=metaproxy
- [ -z "$SERVER_NAME" ] && SERVER_NAME="Metaproxy user"
- [ -z "$SERVER_GROUP" ] && SERVER_GROUP=metaproxy
+ . /etc/metaproxy/metaproxy.user
# 1. create group if not existing
if ! getent group | grep -q "^$SERVER_GROUP:" ; then
purge)
update-rc.d metaproxy remove >/dev/null
- [ -f /etc/default/metaproxy ] && . /etc/default/metaproxy
-
- [ -z "$SERVER_HOME" ] && SERVER_HOME=/var/metaproxy
- [ -z "$SERVER_USER" ] && SERVER_USER=metaproxy
- [ -z "$SERVER_NAME" ] && SERVER_NAME="Metaproxy user"
- [ -z "$SERVER_GROUP" ] && SERVER_GROUP=metaproxy
+ # copy of metaproxy.user, which is gone at this point
+ SERVER_HOME=/var/metaproxy
+ SERVER_USER=metaproxy
+ SERVER_NAME="Metaproxy user"
+ SERVER_GROUP=metaproxy
# find first and last SYSTEM_UID numbers
for LINE in `grep SYSTEM_UID /etc/adduser.conf | grep -v "^#"`; do
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
-# Force compat level four
-export DH_COMPAT=4
+# Force compat level five
+export DH_COMPAT=5
# These are used for cross-compiling and for saving the configure script
# from having to guess our platform (since we know it already)
config.status: configure
dh_testdir
# Add here commands to configure the package.
- CFLAGS="$(CFLAGS)" ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr --mandir=\$${prefix}/share/man --with-yazpp=/usr/bin
+ CFLAGS="$(CFLAGS)" ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr --mandir=\$${prefix}/share/man --with-yazpp=/usr/bin --without-usemarcon
#--infodir=\$${prefix}/share/info --enable-shared --enable-static --with-xslt
mv debian/tmp/usr/share/doc/metaproxy debian/tmp/usr/share/doc/metaproxy-doc
mkdir -p debian/tmp/etc/metaproxy
cp debian/metaproxy.xml debian/tmp/etc/metaproxy/metaproxy.xml
+ cp rpm/metaproxy.user debian/tmp/etc/metaproxy/metaproxy.user
dh_install
# dh_installmenu
# dh_installdebconf
mkdir -p ${RPM_BUILD_ROOT}/etc/init.d
mkdir -p ${RPM_BUILD_ROOT}/etc/sysconfig
install -m 644 rpm/metaproxy.xml ${RPM_BUILD_ROOT}/etc/metaproxy/metaproxy.xml
+install -m 644 rpm/metaproxy.user ${RPM_BUILD_ROOT}/etc/metaproxy/metaproxy.user
install -m 755 rpm/metaproxy.init ${RPM_BUILD_ROOT}/etc/init.d/metaproxy
install -m 644 rpm/metaproxy.sysconfig ${RPM_BUILD_ROOT}/etc/sysconfig/metaproxy
install -m 644 rpm/metaproxy.logrotate ${RPM_BUILD_ROOT}/etc/logrotate.d/metaproxy
%{_mandir}/man?/*
%config /etc/init.d/metaproxy
%config(noreplace) /etc/metaproxy/metaproxy.xml
+%config /etc/metaproxy/metaproxy.user
%dir /etc/metaproxy/filters-available
%dir /etc/metaproxy/filters-enabled
%config(noreplace) /etc/logrotate.d/metaproxy
%config(noreplace) /etc/sysconfig/metaproxy
%post
-[ -f /etc/sysconfig/metaproxy ] && . /etc/sysconfig/metaproxy
-[ -z "$SERVER_HOME" ] && SERVER_HOME=/var/metaproxy
-[ -z "$SERVER_USER" ] && SERVER_USER=metaproxy
-[ -z "$SERVER_NAME" ] && SERVER_NAME="Metaproxy user"
-[ -z "$SERVER_GROUP" ] && SERVER_GROUP=metaproxy
+. /etc/metaproxy/metaproxy.user
# 1. create group if not existing
if ! getent group | grep -q "^$SERVER_GROUP:" ; then
/sbin/service metaproxy stop > /dev/null 2>&1
/sbin/chkconfig --del metaproxy
fi
-fi
-%postun
-[ -f /etc/sysconfig/metaproxy ] && . /etc/sysconfig/metaproxy
-[ -z "$SERVER_HOME" ] && SERVER_HOME=/var/metaproxy
-[ -z "$SERVER_USER" ] && SERVER_USER=metaproxy
-[ -z "$SERVER_NAME" ] && SERVER_NAME="Metaproxy user"
-[ -z "$SERVER_GROUP" ] && SERVER_GROUP=metaproxy
-
-if [ $1 = 0 ]; then
+ . /etc/metaproxy/metaproxy.user
test -d $SERVER_HOME && rm -fr $SERVER_HOME
userdel $SERVER_USER
fi
fi
# end of compatibility layer for RedHat/SuSE
-OPTIONS="-u nobody -l /var/log/metaproxy.log -c /etc/metaproxy/metaproxy.xml"
+. /etc/metaproxy/metaproxy.user
+
+OPTIONS="-u $SERVER_USER -l /var/log/metaproxy.log -c /etc/metaproxy/metaproxy.xml"
if [ -f /etc/sysconfig/metaproxy ]; then
. /etc/sysconfig/metaproxy
# Defaults for metaproxy
-# User and HOME of metaproxy daemon
-SERVER_HOME=/var/metaproxy
-SERVER_USER=metaproxy
-SERVER_GROUP=metaproxy
-SERVER_NAME="Metaproxy user"
-#
OPTIONS="-u $SERVER_USER -l /var/log/metaproxy.log -c /etc/metaproxy/metaproxy.xml"
# The following options should noe be set, because since init.d script
# already sets them: -p, -D, -t
--- /dev/null
+# Metaproxy user information
+SERVER_HOME=/var/metaproxy
+SERVER_USER=metaproxy
+SERVER_NAME="Metaproxy user"
+SERVER_GROUP=metaproxy