2
0
mirror of https://github.com/xcat2/confluent.git synced 2024-11-22 01:22:00 +00:00
confluent/confluent_server/builddeb

55 lines
1.6 KiB
Plaintext
Raw Normal View History

#!/bin/bash
cd `dirname $0`
PKGNAME=$(basename $(pwd))
DPKGNAME=$(basename $(pwd) | sed -e s/_/-/)
cd ..
mkdir -p /tmp/confluent # $DPKGNAME
cp -a * .git /tmp/confluent # $DPKGNAME
cd /tmp/confluent/$PKGNAME
if [ -x ./makeman ]; then
./makeman
fi
./makesetup
VERSION=`cat VERSION`
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
EOF
python setup.py sdist > /dev/null 2>&1
py2dsc dist/*.tar.gz
shopt -s extglob
cd deb_dist/!(*.orig)/
if [ "$DPKGNAME" = "confluent-server" ]; then
if grep wheezy /etc/os-release; then
sed -i 's/^\(Depends:.*\)/\1, confluent-client, python-lxml, python-eficompressor, python-pycryptodomex/' debian/control
else
sed -i 's/^\(Depends:.*\)/\1, confluent-client, python-lxml, python-eficompressor, python-pycryptodome/' debian/control
fi
2019-02-26 18:02:04 +00:00
echo 'confluent_client confluent-client' >> debian/pydist-overrides
fi
2019-02-26 16:09:23 +00:00
head -n -1 debian/control > debian/control1
mv debian/control1 debian/control
echo 'Provides: python-'$DPKGNAME >> debian/control
echo 'Conflicts: python-'$DPKGNAME >> debian/control
echo 'Replaces: python-'$DPKGNAME >> debian/control
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 -
# Clean up the generated files in this directory
rm -rf $PKGNAME.egg-info dist setup.py
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
fi
exit 0