Skip to content

Commit

Permalink
Don't modify the files in postinst but rather at the build step in de…
Browse files Browse the repository at this point in the history
…b package (#273)
  • Loading branch information
David Coutadeur authored and davidcoutadeur committed May 15, 2024
1 parent 0a375a6 commit d9c5c3e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
17 changes: 0 additions & 17 deletions src/install/debian/lsc.postinst
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,6 @@ lsc_group=lsc
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
## bin
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#

exit 0
17 changes: 17 additions & 0 deletions src/install/debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,20 @@ override_dh_install:
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
# Reconfigure files
## logback
sed -i "s:/tmp/lsc/log:/var/log/lsc:" \
`pwd`/debian/lsc/etc/lsc/logback.xml
## bin
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=\"/var/log/lsc\":" \
`pwd`/debian/lsc/usr/bin/lsc \
`pwd`/debian/lsc/usr/bin/lsc-agent \
`pwd`/debian/lsc/usr/bin/hsqldb
sed -i \
-e 's:^VAR_DIR.*:VAR_DIR="/var/lib/lsc":' \
-e 's:^HSQLDB_PIDFILE.*:HSQLDB_PIDFILE="/run/hsqldb.pid":' \
`pwd`/debian/lsc/usr/bin/hsqldb

0 comments on commit d9c5c3e

Please sign in to comment.