File: make-install.sh

package info (click to toggle)
dq 20181021-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster
  • size: 1,620 kB
  • sloc: ansic: 9,200; sh: 419; python: 77; makefile: 15
file content (48 lines) | stat: -rw-r--r-- 1,162 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/sh -e

build="`pwd`/build"
source="`pwd`"
bin="${build}/bin"
man="${build}/man"

cat "${source}/dq/TARGETS" |\
while read x
do
  [ -x "${bin}/${x}" ] || \
    ( 
      echo "=== `date` === $x not compiled, compile first!"
      exit 111; 
    ) || exit 111
done || exit 111

echo "=== `date` === installing bin directory"
cat "${source}/dq/TARGETS" |\
while read x
do
  if [ x"${x}" = xdq ]; then
    confbin="`head -1 conf-bin`"
  else
    confbin="`head -1 conf-sbin`"
  fi
  echo "=== `date` ===   installing build/bin/${x} -> $1/${confbin}/${x}"
  mkdir -p "$1/${confbin}" || exit 111
  cp "${bin}/${x}" "$1/${confbin}" || exit 111
  chmod 755 "$1/${confbin}/${x}" || exit 111
  chown 0:0 "$1/${confbin}/${x}" || exit 111
done
echo "=== `date` === finishing"

#man
confman="`head -1 conf-man`"
echo "=== `date` === installing man directory"
ls "${man}" | sort |\
while read x
do
  n=`echo "${x}" | cut -d'.' -f2`
  mkdir -p "$1/${confman}/man${n}" || exit 111
  cp "${man}/${x}" "$1/${confman}/man${n}" || exit 111
  echo "=== `date` ===   installing ${man}/${x} -> $1/${confman}/man${n}/${x}"
done || exit 111
echo "=== `date` === finishing"

exit 0