diff --git a/src/install/debian/changelog b/src/install/debian/changelog index aadf3d2f..2c0645f9 100644 --- a/src/install/debian/changelog +++ b/src/install/debian/changelog @@ -1,3 +1,9 @@ +lsc (2.2.0-1) unstable; urgency=low + + * Update to 2.2.0 + + -- Clement Oudot (LTB-project) Tue, 24 Aug 2021 12:00:00 +0100 + lsc (2.1.6-1) unstable; urgency=low * Update to 2.1.6 diff --git a/src/install/debian/control b/src/install/debian/control index c343478e..c1b8699e 100644 --- a/src/install/debian/control +++ b/src/install/debian/control @@ -10,10 +10,15 @@ Vcs-Browser: https://github.com/lsc-project/lsc Package: lsc Architecture: all -Depends: ${misc:Depends} +Depends: cron, ${misc:Depends} Description: LDAP Synchronization Connector LSC offers a powerful transformation engine, based on a scripting language, to easily manipulate data on the fly. Various identity management functions are included for directory-specific compatibility - most notably Active Directory (changing passwords, account status, last logon, etc ...). LSC is an open source project written in Java, available under the BSD license. + +Package: nagios-plugins-lsc +Architecture: all +Depends: ${perl:Depends} +Description: Nagios plugins to check lsc diff --git a/src/install/debian/lsc.install b/src/install/debian/lsc.install index 8e3e37f6..c76b09a9 100644 --- a/src/install/debian/lsc.install +++ b/src/install/debian/lsc.install @@ -2,8 +2,6 @@ bin/lsc usr/bin bin/lsc-agent usr/bin bin/hsqldb usr/bin -## config -etc/logback.xml etc/lsc ## lib lib/* usr/lib/lsc ## sample @@ -11,6 +9,4 @@ sample/* usr/share/doc/lsc ## systemd etc/default/lsc-sync etc/default etc/default/lsc-async etc/default -## nagios -bin/check_lsc* var/lib/lsc/nagios diff --git a/src/install/debian/lsc.manpages b/src/install/debian/lsc.manpages new file mode 100644 index 00000000..b3e3955c --- /dev/null +++ b/src/install/debian/lsc.manpages @@ -0,0 +1,4 @@ +doc/man/man1/lsc.1 +doc/man/man1/lsc-agent.1 +doc/man/man5/lsc.properties.5 +doc/man/man5/lsc.xml.5 diff --git a/src/install/debian/lsc.postinst b/src/install/debian/lsc.postinst index 924f96b6..ba5a3eb9 100644 --- a/src/install/debian/lsc.postinst +++ b/src/install/debian/lsc.postinst @@ -4,25 +4,26 @@ lsc_logdir=/var/log/lsc lsc_user=lsc lsc_group=lsc -getent group ${lsc_group} > /dev/null 2>&1 || groupadd --system ${lsc_group} -getent passwd ${lsc_user} > /dev/null 2>&1 || useradd --system --gid ${lsc_group} --home-dir /etc/lsc ${lsc_user} - # Always do this chown -R ${lsc_user}:${lsc_group} ${lsc_logdir} +chown ${lsc_user}:${lsc_group} /var/lib/lsc # Reconfigure files ## logback -sed -i "s:/tmp/lsc/log:${lsc_logdir}:" /etc/lsc/logback.xml +sed -i "s:/tmp/lsc/log:${lsc_logdir}:" \ + /etc/lsc/logback.xml ## bin -sed -i 's:^CFG_DIR.*:CFG_DIR="/etc/lsc":' /usr/bin/lsc /usr/bin/lsc-agent /usr/bin/hsqldb -sed -i 's:^LIB_DIR.*:LIB_DIR="/usr/lib/lsc":' /usr/bin/lsc /usr/bin/lsc-agent /usr/bin/hsqldb -sed -i "s:^LOG_DIR.*:LOG_DIR=\"${lsc_logdir}\":" /usr/bin/lsc /usr/bin/lsc-agent /usr/bin/hsqldb -sed -i 's:^VAR_DIR.*:VAR_DIR="/var/lsc":' /usr/bin/hsqldb - -# Copy sample configuration for a fresh install -[ -f /etc/lsc/lsc.xml ] || cp /usr/share/doc/lsc/lsc.xml-sample /etc/lsc/lsc.xml -[ -f /etc/lsc/sql-map-config.xml ] || cp /usr/share/doc/lsc/sql-map-config.xml-sample /etc/lsc/sql-map-config.xml -[ -f /etc/lsc/sql-map-config.d/InetOrgPerson.xml ] || cp /usr/share/doc/lsc/InetOrgPerson.xml-sample /etc/lsc/sql-map-config.d/InetOrgPerson.xml +sed -i \ + -e 's:^CFG_DIR.*:CFG_DIR="/etc/lsc":' \ + -e 's:^LIB_DIR.*:LIB_DIR="/usr/lib/lsc":' \ + -e "s:^LOG_DIR.*:LOG_DIR=\"${lsc_logdir}\":" \ + /usr/bin/lsc \ + /usr/bin/lsc-agent \ + /usr/bin/hsqldb +sed -i \ + -e 's:^VAR_DIR.*:VAR_DIR="/var/lib/lsc":' \ + -e 's:^HSQLDB_PIDFILE.*:HSQLDB_PIDFILE="/run/hsqldb.pid":' \ + /usr/bin/hsqldb #DEBHELPER# diff --git a/src/install/debian/lsc.preinst b/src/install/debian/lsc.preinst new file mode 100644 index 00000000..bd19c71f --- /dev/null +++ b/src/install/debian/lsc.preinst @@ -0,0 +1,9 @@ +#!/bin/bash + +lsc_logdir=/var/log/lsc +lsc_user=lsc +lsc_group=lsc + +getent group ${lsc_group} > /dev/null 2>&1 || groupadd --system ${lsc_group} +getent passwd ${lsc_user} > /dev/null 2>&1 || useradd --system --gid ${lsc_group} --home-dir /var/lib/lsc --shell "/sbin/nologin" --comment "LDAP Synchronization Connector user" ${lsc_user} + diff --git a/src/install/debian/nagios-plugins-lsc.install b/src/install/debian/nagios-plugins-lsc.install new file mode 100644 index 00000000..9ed48fe0 --- /dev/null +++ b/src/install/debian/nagios-plugins-lsc.install @@ -0,0 +1,2 @@ +## nagios +bin/check_lsc* usr/lib/nagios/plugins diff --git a/src/install/debian/rules b/src/install/debian/rules old mode 100644 new mode 100755 index 0c88dc43..1e67f828 --- a/src/install/debian/rules +++ b/src/install/debian/rules @@ -9,7 +9,7 @@ override_dh_compress: override_dh_testdir: -## systemd + # systemd cp -f lib/systemd/system/lsc-async.service debian/ cp -f lib/systemd/system/lsc-async@.service debian/ cp -f lib/systemd/system/lsc-sync.service debian/ @@ -25,3 +25,16 @@ override_dh_installsystemd: dh_installsystemd --no-start --no-enable --no-stop-on-upgrade --name=lsc-sync dh_installsystemd --no-start --no-enable --no-stop-on-upgrade --name=lsc-sync@ dh_installsystemd --name=lsc-sync.timer + + +override_dh_install: + dh_install + # Copy configuration files + mkdir -p `pwd`/debian/lsc/var/lib/lsc + mkdir -p `pwd`/debian/lsc/etc/lsc/sql-map-config.d + cp -a etc/logback.xml `pwd`/debian/lsc/etc/lsc/logback.xml + cp -a etc/lsc.xml-sample `pwd`/debian/lsc/etc/lsc/lsc.xml + cp -a etc/sql-map-config.xml-sample `pwd`/debian/lsc/etc/lsc/sql-map-config.xml + cp -a etc/sql-map-config.d/InetOrgPerson.xml-sample `pwd`/debian/lsc/etc/lsc/sql-map-config.d/InetOrgPerson.xml + # Remove useless windows .bat files + find debian/lsc -type f -name '*.bat' -delete