Skip to content

Instantly share code, notes, and snippets.

@johnhamelink
Created January 12, 2016 18:44
Show Gist options
  • Select an option

  • Save johnhamelink/4acb573e4aea6c6d08f0 to your computer and use it in GitHub Desktop.

Select an option

Save johnhamelink/4acb573e4aea6c6d08f0 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
LIB_PHONE_NUMBER_REPO=https://github.com/googlei18n/libphonenumber.git
LIB_PHONE_NUMBER_REV=master
function log()
{
echo " -> $1"
}
log "Using repo ${LIB_PHONE_NUMBER_REPO} and revision ${LIB_PHONE_NUMBER_REV}"
log "Installing build dependencies"
log "Installing webupd8team's Java PPA"
sudo add-apt-repository -y ppa:webupd8team/java
sudo apt-get update
sudo apt-get install -y \
cmake cmake-curses-gui libprotobuf-dev \
libgtest-dev libre2-dev libicu-dev \
libboost-dev libboost-thread-dev \
libboost-system-dev protobuf-compiler \
oracle-java7-installer
log "Checking out Repo"
git clone --depth=1 ${LIB_PHONE_NUMBER_REPO}
git checkout ${LIB_PHONE_NUMBER_REV}
mkdir -p libphonenumber/cpp/build
cd libphonenumber/cpp/build
export CFLAGS=-fPIC
export CXXFLAGS=-fPIC
log "Adding Debian packaging information to CMakeLists.txt"
echo "set(CPACK_GENERATOR "DEB")" >> ../CMakeLists.txt
echo 'set(CPACK_DEBIAN_PACKAGE_MAINTAINER "John Hamelink")' >> ../CMakeLists.txt
echo 'set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS true)' >> ../CMakeLists.txt
echo "include(CPack)" >> ../CMakeLists.txt
log "Producing Makefile"
cmake ..
log "Building Package"
make package
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment