forked from widesky/hszinc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mkdeb.sh
34 lines (26 loc) · 818 Bytes
/
mkdeb.sh
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
#!/bin/bash
# Build a Debian package of hszinc.
set -e
: ${MY_DIR:=$( dirname "$0" )}
: ${PYTHON:=$( which python2 )}
: ${BUILD_PY2:=True}
: ${BUILD_PY3:=True}
# Set the output directory if not already given
: ${OUT_DIR:=${MY_DIR}/out}
cd "${MY_DIR}"
# Clean up
[ ! -d deb_dist ] || rm -fr deb_dist
[ ! -d dist ] || rm -fr dist
# Build
"${PYTHON}" setup.py \
--command-package stdeb.command sdist_dsc \
--with-python2=${BUILD_PY2} --with-python3=${BUILD_PY3} \
--suggests=python-pint --suggests3=python3-pint \
--depends=python-backports.functools-lru-cache \
${DEBIAN_VERSION:+--debian-version=}${DEBIAN_VERSION} \
bdist_deb
# Clean up source tree
find deb_dist -mindepth 1 -maxdepth 1 -type d | xargs rm -fr
# Move out the resultant files
[ -d ${OUT_DIR} ] || mkdir ${OUT_DIR}
mv deb_dist/* ${OUT_DIR}