2019-02-04 15:05:36 -05:00
|
|
|
#!/bin/bash
|
|
|
|
cd `dirname $0`
|
2019-02-11 13:54:49 -05:00
|
|
|
PKGNAME=$(basename $(pwd))
|
|
|
|
DPKGNAME=$(basename $(pwd) | sed -e s/_/-/)
|
2019-03-26 13:49:54 -04:00
|
|
|
OPKGNAME=$(basename $(pwd) | sed -e s/_/-/)
|
2019-03-19 15:03:06 -04:00
|
|
|
if grep wheezy /etc/os-release; then
|
|
|
|
DPKGNAME=python-$DPKGNAME
|
|
|
|
fi
|
2019-02-11 15:16:24 -05:00
|
|
|
cd ..
|
|
|
|
mkdir -p /tmp/confluent # $DPKGNAME
|
|
|
|
cp -a * .git /tmp/confluent # $DPKGNAME
|
|
|
|
cd /tmp/confluent/$PKGNAME
|
2019-02-04 15:05:36 -05:00
|
|
|
if [ -x ./makeman ]; then
|
|
|
|
./makeman
|
|
|
|
fi
|
|
|
|
./makesetup
|
|
|
|
VERSION=`cat VERSION`
|
2019-02-05 13:12:35 -05:00
|
|
|
cat > setup.cfg << EOF
|
|
|
|
[install]
|
|
|
|
install-purelib=/opt/confluent/lib/python
|
|
|
|
install-scripts=/opt/confluent/bin
|
|
|
|
|
|
|
|
[sdist_dsc]
|
2019-02-05 15:41:03 -05:00
|
|
|
package=$DPKGNAME
|
2019-02-05 13:12:35 -05:00
|
|
|
EOF
|
|
|
|
|
2019-02-04 15:05:36 -05:00
|
|
|
python setup.py sdist > /dev/null 2>&1
|
|
|
|
py2dsc dist/*.tar.gz
|
|
|
|
shopt -s extglob
|
|
|
|
cd deb_dist/!(*.orig)/
|
2019-03-26 13:49:54 -04:00
|
|
|
if [ "$OPKGNAME" = "confluent-server" ]; then
|
2019-02-12 16:18:21 -05:00
|
|
|
if grep wheezy /etc/os-release; then
|
2019-08-30 10:22:17 -04:00
|
|
|
sed -i 's/^\(Depends:.*\)/\1, python-confluent-client, python-lxml, python-eficompressor, python-pycryptodomex, python-dateutil, python-pyopenssl/' debian/control
|
2019-02-12 16:18:21 -05:00
|
|
|
else
|
2019-06-27 15:31:00 -04:00
|
|
|
sed -i 's/^\(Depends:.*\)/\1, confluent-client, python-lxml, python-eficompressor, python-pycryptodome, python-dateutil/' debian/control
|
2019-02-12 16:18:21 -05:00
|
|
|
fi
|
2019-03-26 13:46:39 -04:00
|
|
|
if grep wheezy /etc/os-release; then
|
|
|
|
echo 'confluent_client python-confluent-client' >> debian/pydist-overrides
|
|
|
|
else
|
|
|
|
echo 'confluent_client confluent-client' >> debian/pydist-overrides
|
|
|
|
fi
|
2019-02-11 10:09:02 -05:00
|
|
|
fi
|
2019-02-26 11:09:23 -05:00
|
|
|
head -n -1 debian/control > debian/control1
|
|
|
|
mv debian/control1 debian/control
|
2019-07-02 14:42:45 -04:00
|
|
|
echo 'export PYBUILD_INSTALL_ARGS=--install-lib=/opt/confluent/lib/python' >> debian/rules
|
2019-03-26 13:49:54 -04:00
|
|
|
#echo 'Provides: python-'$DPKGNAME >> debian/control
|
2019-02-26 13:39:11 -05:00
|
|
|
#echo 'Conflicts: python-'$DPKGNAME >> debian/control
|
2019-03-26 13:49:54 -04:00
|
|
|
#echo 'Replaces: python-'$DPKGNAME' (<<2)' >> debian/control
|
|
|
|
#echo 'Breaks: python-'$DPKGNAME' (<<2)' >> debian/control
|
2019-02-12 16:18:21 -05:00
|
|
|
|
2019-02-04 15:05:36 -05: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 15:35:55 -05:00
|
|
|
cd -
|
2019-02-04 15:05:36 -05:00
|
|
|
# Clean up the generated files in this directory
|
|
|
|
rm -rf $PKGNAME.egg-info dist setup.py
|
2019-02-04 15:14:39 -05:00
|
|
|
rm -rf $(find deb_dist -mindepth 1 -maxdepth 1 -type d)
|
2019-02-05 10:29:31 -05:00
|
|
|
if [ ! -z "$1" ]; then
|
2019-02-05 10:36:06 -05:00
|
|
|
mv deb_dist/* $1/
|
2019-02-05 10:29:31 -05:00
|
|
|
fi
|
2019-02-04 15:05:36 -05:00
|
|
|
fi
|
|
|
|
exit 0
|