2019-02-04 20:05:36 +00:00
|
|
|
#!/bin/bash
|
|
|
|
cd `dirname $0`
|
2019-02-11 18:54:49 +00:00
|
|
|
PKGNAME=$(basename $(pwd))
|
|
|
|
DPKGNAME=$(basename $(pwd) | sed -e s/_/-/)
|
2019-02-11 19:06:28 +00:00
|
|
|
mkdir -p /tmp/$DKPGNAME
|
2019-02-11 18:54:49 +00:00
|
|
|
cp -a * .git /tmp/$DPKGNAME
|
|
|
|
cd /tmp/$DPKGNAME
|
2019-02-04 20:05:36 +00:00
|
|
|
if [ -x ./makeman ]; then
|
|
|
|
./makeman
|
|
|
|
fi
|
|
|
|
./makesetup
|
|
|
|
VERSION=`cat VERSION`
|
2019-02-05 18:12:35 +00:00
|
|
|
cat > setup.cfg << EOF
|
|
|
|
[install]
|
|
|
|
install-purelib=/opt/confluent/lib/python
|
|
|
|
install-scripts=/opt/confluent/bin
|
|
|
|
|
|
|
|
[sdist_dsc]
|
2019-02-05 20:41:03 +00:00
|
|
|
package=$DPKGNAME
|
2019-02-05 18:12:35 +00:00
|
|
|
EOF
|
|
|
|
|
2019-02-04 20:05:36 +00:00
|
|
|
python setup.py sdist > /dev/null 2>&1
|
|
|
|
py2dsc dist/*.tar.gz
|
|
|
|
shopt -s extglob
|
|
|
|
cd deb_dist/!(*.orig)/
|
2019-02-11 15:09:02 +00:00
|
|
|
if [ "$DPKGNAME" = "confluent-server" ]; then
|
2019-02-11 16:20:59 +00:00
|
|
|
sed -i 's/^\(Depends:.*\)/\1, python-lxml, python-eficompressor, python-pycryptodomex/' debian/control
|
2019-02-11 15:09:02 +00:00
|
|
|
fi
|
2019-02-04 20:05:36 +00:00
|
|
|
dpkg-buildpackage -rfakeroot -uc -us -i
|
|
|
|
if [ $? -ne 0 ]; then
|
|
|
|
echo "[ERROR] rpmbuild returned non-zero, run: rpmbuild -ba ~/rpmbuild/SPECS/$PKGNAME.spec"
|
|
|
|
exit 1
|
|
|
|
else
|
2019-02-04 20:35:55 +00:00
|
|
|
cd -
|
2019-02-04 20:05:36 +00:00
|
|
|
# Clean up the generated files in this directory
|
|
|
|
rm -rf $PKGNAME.egg-info dist setup.py
|
2019-02-04 20:14:39 +00:00
|
|
|
rm -rf $(find deb_dist -mindepth 1 -maxdepth 1 -type d)
|
2019-02-05 15:29:31 +00:00
|
|
|
if [ ! -z "$1" ]; then
|
2019-02-05 15:36:06 +00:00
|
|
|
mv deb_dist/* $1/
|
2019-02-05 15:29:31 +00:00
|
|
|
fi
|
2019-02-04 20:05:36 +00:00
|
|
|
fi
|
|
|
|
exit 0
|