Last active
February 11, 2018 23:29
-
-
Save knight-of-ni/a3e9f5ba51cdd539f3b87a21ef0ae72c to your computer and use it in GitHub Desktop.
build odb shell script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| install_deps () { | |
| mk-build-deps -ir -t "apt-get -o Debug::pkgProblemResolver=yes \ | |
| --no-install-recommends --no-upgrade -y" \ | |
| ./debian/control | |
| } | |
| set -e | |
| if [ -z ${DEB_BUILD_OPTIONS} ] ; then | |
| export DEB_BUILD_OPTIONS="parallel=2" | |
| fi | |
| # Get the three digit gcc version number | |
| gcc_ver=$(gcc -v 2>&1 |grep "gcc version") | |
| gcc_ver=$(echo ${gcc_ver} | sed 's/.*\([0-9]\.[0-9]\.[0-9]\) .*/\1/') | |
| mkdir -p /debian | |
| cd /debian | |
| # Grab the source files | |
| apt-get source odb libodb libodb-boost libodb-mysql libodb-sqlite libodb-pgsql | |
| # | |
| # ODB | |
| # | |
| echo | |
| echo "Begin building ODB package..." | |
| echo | |
| cd /debian/odb-2.4.0 | |
| # Bump the package version | |
| dch -i "Additional backport upstream development for GCC 6.x versions (see #889664)." | |
| # Get the patch for the odb compiler and apply it to the package | |
| cp -v /odb_gcc6_fix.patch /debian/odb-2.4.0/debian/patches/ | |
| echo "odb_gcc6_fix.patch" >> /debian/odb-2.4.0/debian/patches/series | |
| quilt push -a && quilt refresh && quilt pop -a | |
| # Install the package's build dependencies | |
| install_deps | |
| # Build the package | |
| debuild -i -us -uc -b | |
| # | |
| # LIBODB | |
| # | |
| echo | |
| echo "Begin building LIBODB package..." | |
| echo | |
| # Bump the package version | |
| cd /debian/libodb-2.4.0 | |
| dch -i "Rebuild with gcc ${gcc_ver}" | |
| # Install build dependencies | |
| install_deps | |
| # Build the package | |
| debuild -i -us -uc -b | |
| # | |
| # Install LIBODB | |
| # | |
| echo | |
| echo "Installing LIBODB packages for build dependencies..." | |
| echo | |
| cd /debian | |
| gdebi --non-interactive libodb-2.4_*.deb | |
| gdebi --non-interactive libodb-dev*.deb | |
| # | |
| # LIBODB-BOOST | |
| # | |
| echo | |
| echo "Begin building LIBODB-BOOST package..." | |
| echo | |
| # Bump the package version | |
| cd /debian/libodb-boost-2.4.0 | |
| dch -i "Rebuild with gcc ${gcc_ver}" | |
| # Install build dependencies | |
| install_deps | |
| # Build the package | |
| debuild -i -us -uc -b | |
| # | |
| # LIBODB-MYSQL | |
| # | |
| echo | |
| echo "Begin building LIBODB-MYSQL package..." | |
| echo | |
| # Bump the package version | |
| cd /debian/libodb-mysql-2.4.0 | |
| dch -i "Rebuild with gcc ${gcc_ver}" | |
| # Install build dependencies | |
| install_deps | |
| # Build the package | |
| debuild -i -us -uc -b | |
| # | |
| # LIBODB-SQLITE | |
| # | |
| echo | |
| echo "Begin building LIBODB-SQLITE package..." | |
| echo | |
| # Bump the package version | |
| cd /debian/libodb-sqlite-2.4.0 | |
| dch -i "Rebuild with gcc ${gcc_ver}" | |
| # Install build dependencies | |
| install_deps | |
| # Build the package | |
| debuild -i -us -uc -b | |
| # | |
| # LIBODB-PGSQL | |
| # | |
| echo | |
| echo "Begin building LIBODB-PGSQL package..." | |
| echo | |
| # Bump the package version | |
| cd /debian/libodb-pgsql-2.4.0 | |
| dch -i "Rebuild with gcc ${gcc_ver}" | |
| # Install build dependencies | |
| install_deps | |
| # Build the package | |
| debuild -i -us -uc -b | |
| echo | |
| echo "Build Completed. Check Docker Volume folder for packages..." | |
| echo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment