forked from petermilne/acq400ioc
-
Notifications
You must be signed in to change notification settings - Fork 1
/
make.package
executable file
·84 lines (74 loc) · 2.4 KB
/
make.package
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#!/bin/bash
# xl- excluding libraries. Libs are assumed to be preloaded, eg with .ovl
DC="$(date +%y%m%d%H%M)"
ISXL=0
if [ "x$1" = "xxl" ]; then
ISXL=1
git branch | grep xl$
if [ $? -eq 0 ]; then
echo on xl branch, build xl
ISXL=1
else
echo WARNING NOT on xl branch
fi
elif [ "$(basename $(dirname $PWD))" = "ACQ400_ESW_TOP" ]; then
ISXL=1
echo "ACQ400_ESW_TOP detected, ISXL set $ISXL"
fi
[ $ISXL -eq 1 ] && DC="xl_$(date +%y%m%d%H%M)"
SEQ=40
if [ "x$EPICS_BASE" = "x" ]; then
echo ERROR: please run epics setup.env
exit 1
fi
rm -Rf opkg/*
mkdir -p release
mkdir -p opkg/usr/local/bin/ opkg/usr/local/init/ \
opkg/etc/ \
opkg/usr/local/lib/ \
opkg/usr/local/epics/dbd/ \
opkg/usr/local/epics/db \
opkg/usr/local/epics/protocols \
opkg/usr/local/epics/scripts \
opkg/usr/local/epics/init.d \
opkg/usr/local/CARE
cp -r CARE/* opkg/usr/local/CARE
(cd opkg/usr/local/CARE;ln -s acq2106+acq42x.init acq2106+acq424.init)
(cd opkg/usr/local/CARE;ln -s acq1001+acq42x.init acq1001+acq424.init)
(cd opkg/usr/local/CARE;ln -s acq2106+acq480.init acq2106+acq48x.init)
(cd opkg/usr/local/CARE;ln -s acq2106+acq480.init acq1102+acq48x.init)
strip_all()
{ (
cd $1
for file in $(find . -type f -print); do
chmod u+w $file;
arm-linux-gnueabihf-strip -g -S -d --strip-debug $file 2>/dev/null;
chmod u-w $file;
done
) }
cp bin/linux-arm/acq400ioc opkg/usr/local/bin
cp bin-scripts/* opkg/usr/local/bin
cp init/* opkg/usr/local/init/
cp -r etc/* opkg/etc
rm -f opkg/usr/local/lib/*
cp lib/linux-arm/*.so opkg/usr/local/lib
strip_all opkg/usr/local/lib
rm -f opkg/usr/local/epics/dbd/acq400ioc.dbd
cp README opkg/usr/local/epics/
cp dbd/acq400ioc.dbd opkg/usr/local/epics/dbd
cp db/* opkg/usr/local/epics/db
cp protocols/* opkg/usr/local/epics/protocols
cp scripts/* opkg/usr/local/epics/scripts
cp -a CARE/SITE0 opkg/usr/local/epics/scripts
if [ $ISXL -eq 0 ]; then
tar cf - --exclude=lib*.a --exclude=libtest* --exclude=libdevTestGpib.so -C ${EPICS_BASE}/lib/linux-arm/ . | tar xf - -C opkg/usr/local/lib
cp -a ${EPICS_BASE}/bin/linux-arm/ca* opkg/usr/local/bin
strip_all opkg/usr/local/bin
fi
#cp -a ../seq/lib/linux-arm/libpv.so ../seq/lib/linux-arm/libseq.so opkg/usr/local/lib
tar cvzf release/${SEQ}-acq400ioc-${DC}.tgz -C opkg .
echo git tag -a -m R${DC} R${DC}
git tag -a -m R${DC} R${DC}
ls -l release/${SEQ}-acq400ioc-${DC}.tgz
rm -f ../PACKAGES/${SEQ}-acq400ioc*
cp release/${SEQ}-acq400ioc-${DC}.tgz ../PACKAGES/