Skip to content

Commit 9afae98

Browse files
committed
Put debian/postinst.in in separate file
Signed-off-by: Amin Vakil <info@aminvakil.com>
1 parent 53dce59 commit 9afae98

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

CMakeLists.txt

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1558,14 +1558,10 @@ ldconfig
15581558
list(APPEND CPACK_DEBIAN_RUNTIME_PACKAGE_CONTROL_EXTRA "${PROJECT_BINARY_DIR}/scripts/postinst;${PROJECT_BINARY_DIR}/scripts/prerm")
15591559
endif(FLB_RUN_LDCONFIG)
15601560

1561-
file(WRITE ${PROJECT_BINARY_DIR}/scripts/postinst "#!/bin/sh
1562-
set -e
1563-
${LDCONFIG_SCRIPT_CMDS}
1564-
if [ \"\$1\" = \"configure\" ]; then
1565-
systemctl --system daemon-reload >/dev/null || true
1566-
systemctl try-restart ${FLB_OUT_NAME}.service >/dev/null || true
1567-
fi
1568-
")
1561+
configure_file(
1562+
${CMAKE_CURRENT_SOURCE_DIR}/cpack/debian/postinst.in
1563+
${PROJECT_BINARY_DIR}/scripts/postinst
1564+
)
15691565

15701566
list(APPEND CPACK_DEBIAN_RUNTIME_PACKAGE_CONTROL_EXTRA "${PROJECT_BINARY_DIR}/scripts/postinst;${PROJECT_BINARY_DIR}/scripts/prerm")
15711567

cpack/debian/postinst.in

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/sh
2+
set -e
3+
@LDCONFIG_POSTINST_CMDS@
4+
if [ "$1" = "configure" ]; then
5+
systemctl --system daemon-reload >/dev/null || true
6+
systemctl try-restart @FLB_OUT_NAME@.service >/dev/null || true
7+
fi

0 commit comments

Comments
 (0)