-
-
Notifications
You must be signed in to change notification settings - Fork 71
/
build-deb
executable file
·45 lines (29 loc) · 1.32 KB
/
build-deb
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
#!/bin/sh
VERSION=`date +%y.%m.%d`
PACKAGE=open-semantic-etl_${VERSION}.deb
BUILDDIR=/tmp/open-semantic-etl-$$.deb
#
# Build standard package (preconfigured for Solr)
#
echo "Building ${PACKAGE} in temp directory ${BUILDDIR}"
mkdir ${BUILDDIR}
cp -a DEBIAN ${BUILDDIR}/
cp -a etc ${BUILDDIR}/
cp -a usr ${BUILDDIR}/
mkdir -p ${BUILDDIR}/usr/lib/python3/dist-packages
cp -a src/* ${BUILDDIR}/usr/lib/python3/dist-packages/
mkdir -p ${BUILDDIR}/var/cache/tesseract
mkdir -p ${BUILDDIR}/var/opensemanticsearch/media/thumbnails
# Build standard package (preconfigured for Solr)
dpkg -b ${BUILDDIR} ${PACKAGE}
#
# Build alternate package (preconfigured for Elasticsearch)
#
# change config file and set export plugin to Elasticsearch
PACKAGE=open-semantic-etl-elasticsearch_${VERSION}.deb
echo "Building ${PACKAGE} in temp directory ${BUILDDIR}"
# change option "config['export']" in ${BUILDDIR}/etc/opensemanticsearch/etl from "solr" to "elasticsearch" by commenting / uncommenting
sed -r -e "s/(config\['export'\] = 'export_solr')/#\1/g" -e "s/(config\['index'\] = 'core1')/#\1/g" -e "s/(#)(config\['export'\] = 'export_elasticsearch')/\2/" -e "s/(#)(config\['index'\] = 'opensemanticsearch')/\2/" -i ${BUILDDIR}/etc/opensemanticsearch/etl
# todo: delete dependency on pysolr
# Build the alternate package
dpkg -b ${BUILDDIR} ${PACKAGE}