1 # --- T2-COPYRIGHT-NOTE-BEGIN ---
2 # T2 SDE: package/*/sancp/sancp.conf
3 # Copyright (C) 2004 - 2021 The T2 SDE Project
5 # This Copyright note is generated by scripts/Create-CopyPatch,
6 # more information can be found in the files COPYING and README.
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License version 2.
10 # --- T2-COPYRIGHT-NOTE-END ---
12 if [ "$prefix_auto" == 1 ]; then
19 pkg_sancp_prelude_prepatch() {
20 # creating a temporary directory
23 # getting the full path of the original patch
24 orig_sancp_prelude_patch="`match_source_file -p prelude`"
26 # name of the patch we will include
27 sancp_prelude_patch="sancp-$ver-prelude-3.patch"
29 # removing "/root/" from the path of the effected files in the original patch
30 # and creating the sanitized patch in tempdir
31 sed -e "s/^\(\+\+\+\ \)\/root\//\1/g" $orig_sancp_prelude_patch > $tempdir/$sancp_prelude_patch
33 # including the sanitized patch
34 echo_status "Enabling Prelude-IDS Support by including ($sancp_prelude_patch)"
35 var_append patchfiles ' ' "$tempdir/$sancp_prelude_patch"
40 # adjusting default config file location
41 sed -i "/CONFIG_DIR/s,/.*,$sysconfdir\"," sancp.h
46 # copying sancp binary
47 mkdir -p $root/$prefix/bin
48 cp -v sancp $root/$prefix/bin/sancp
50 # copying default config file
51 mkdir -p $root$sysconfdir
52 cp -v etc/sancp/sancp.conf $root$sysconfdir/
54 # creating log directory
55 mkdir -p $root$localstatedir/log
58 hook_add premake 5 'pkg_sancp_premake'
59 hook_add postmake 5 'pkg_sancp_install'
61 # including the officially released sancp patches from our package
62 var_append patchfiles ' ' "`match_source_file -p patch | tr '\n' ' '`"
64 # if libprelude is available patch sancp to become a prelude sensor
65 if pkginstalled libprelude; then
66 hook_add prepatch 5 'pkg_sancp_prelude_prepatch'