mirror of
https://github.com/xcat2/confluent.git
synced 2024-11-22 01:22:00 +00:00
43 lines
1.0 KiB
Bash
Executable File
43 lines
1.0 KiB
Bash
Executable File
#!/bin/bash
|
|
cd `dirname $0`
|
|
PKGNAME=$(basename $(pwd))
|
|
DPKGNAME=$(basename $(pwd) | sed -e s/_/-/)
|
|
mkdir -p /tmp/$DKPGNAME
|
|
cp -a * .git /tmp/$DPKGNAME
|
|
cd /tmp/$DPKGNAME
|
|
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]
|
|
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
|
|
sed -i 's/^\(Depends:.*\)/\1, python-lxml, python-eficompressor, python-pycryptodomex/' debian/control
|
|
fi
|
|
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
|
|
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)
|
|
if [ ! -z "$1" ]; then
|
|
mv deb_dist/* $1/
|
|
fi
|
|
fi
|
|
exit 0
|