Last active
June 24, 2017 21:51
-
-
Save leoforney/3bfe2aca911c16416170 to your computer and use it in GitHub Desktop.
Installing icu4c (AKA libicu) on dreamhost
This file contains 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/shell | |
echo "Hey, I heard you want to install libicu on Dreamhost... Let me help you out! :D" | |
if [ ! -d "$HOME/usr/local" ]; then | |
mkdir -p ~/usr/local | |
fi | |
if [ -d "$HOME/icu" ]; then | |
echo "Removing the folder ~/icu..." | |
rm -rf $HOME/icu | |
fi | |
if [ ! -d "$HOME/icu" ]; then | |
rm -rf icu4c-53_1-src.zip | |
if [ ! -f "$HOME/icu4c-53_1-src.zip" ]; then | |
clear | |
echo "Downloading ICU with wget..." | |
sleep 2 | |
cd $HOME | |
wget http://download.icu-project.org/files/icu4c/53.1/icu4c-53_1-src.zip | |
fi | |
if [ -f "$HOME/icu4c-53_1-src.zip" ]; then | |
clear | |
echo "Extracting source (Silently)..." | |
sleep 2 | |
unzip --qq icu4c-53_1-src.zip | |
fi | |
fi | |
if [ -d "$HOME/icu" ]; then | |
echo "${green}Removing zip file...${NC}" | |
rm -rf icu4c-53_1-src.zip | |
cd $HOME/icu/source | |
clear | |
echo "Configuring icu... (This could take a while)" | |
sleep 2 | |
./configure --prefix=$HOME/usr/local | |
if [ -d "$HOME/usr/local" ]; then | |
clear | |
echo "Compiling icu... with flag -j 2 (Makes it faster)" | |
sleep 2 | |
make -j 2 | |
clear | |
echo "Installing icu... with flag -j 2 (Makes it faster)" | |
sleep 2 | |
make install -j 2 | |
rm -rf $HOME/icu | |
clear | |
(echo export PATH=$HOME/usr/local/bin:PATH; echo export LD_LIBRARY_PATH=$HOME/usr/local/lib:$LD_LIBRARY_PATH) >> ~/.bash_profile | |
clear | |
echo "Injecting into your shell session..." | |
sleep 2 | |
source ~/.bash_profile | |
clear | |
echo "Congratulations! You have installed libicu for your server... Now run your gem instalations with --with-icu-lib=$HOME/usr/local/lib --with-icu-include=$HOME/usr/local/include ." | |
fi | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
thank you very much for this gist. lifesaver. 💯