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 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
|
#!/bin/bash
# Checking environment
echo "VERSION=$VERSION"
#####################
# Preparing directory
#####################
# Extracting tar.gz
cd $HOME
cp /tmp/omnidb-plpgsql-debugger_$VERSION.tar.gz .
tar -xzvf omnidb-plpgsql-debugger_$VERSION.tar.gz
mv omnidb-plpgsql-debugger_$VERSION tmp
rm -rf omnidb-plpgsql-debugger_$VERSION.tar.gz
# Creating directory structure
mkdir omnidb-plpgsql-debugger_$VERSION
cd omnidb-plpgsql-debugger_$VERSION/
mkdir -p opt/omnidb-plpgsql-debugger
cp $HOME/tmp/* opt/omnidb-plpgsql-debugger/
rm -rf $HOME/tmp/
mkdir DEBIAN
cat > DEBIAN/control << EOF
Package: omnidb-plpgsql-debugger
Version: $VERSION
Section: base
Priority: optional
Architecture: amd64
Installed-Size: $(du -s)
Maintainer: The OmniDB Team
Homepage: http://omnidb.org
Description: OmniDB is a very flexible, secure and work-effective environment for multiple DBMS.
The OmniDB PL/pgSQL debugger is a PostgreSQL extension that adds debugging capabilities for PL/pgSQL functions and procedures.
OmniDB is supported by 2ndQuadrant (http://www.2ndquadrant.com)
EOF
cd ..
########################
# Generating deb package
########################
dpkg -b omnidb-plpgsql-debugger_$VERSION
########################
# Generating rpm package
########################
fpm -s deb -t rpm omnidb-plpgsql-debugger_$VERSION.deb
#############################################
# Moving packages to outside of the container
#############################################
mv omnidb*.deb /tmp/
mv omnidb*.rpm /tmp/
|