# DevIL 1.8.0
# ===========
# If you want to clean up files from an old version before installing
# this one, or if you want to uninstall DevIL, skip down to the
# bottom for instructions.
# If you're building this for Graphviz, make sure you pass --enable-ILU
# to configure
# IL = main library
# ILU = utility library
# ILUT = utility toolkit
# Get it
cd
test -f installed/DevIL-1.8.0.tar.gz &&
mv installed/DevIL-1.8.0.tar.gz .
test ! -f DevIL-1.8.0.tar.gz &&
wget http://downloads.sf.net/openil/DevIL-1.8.0.tar.gz
# Extract the source
mkdir -p -m 0700 ~/src
cd ~/src
find -maxdepth 1 -type d -name "devil-*" -exec rm -r {} \;
find -maxdepth 1 -type d -name "DevIL-*" -exec rm -r {} \;
tar xzvf ~/DevIL-1.8.0.tar.gz
mv DevIL devil-1.8.0
cd devil-1.8.0
test $UID = 0 && chown -R root:root .
cd DevIL
# Read ./README.md
# Read ./README.cmake for build details
# If upgrading, read ./ChangeLog
# Create a build directory
mkdir build
cd build
# Configure the build
cmake ..
# It doesn't seem to listen to CMAKE_INSTALL_LIBDIR so alter the CMake
# install files to use /usr/local/lib64, if 64-bit
test $(uname -m) = 'x86_64' &&
for srcdir in src-IL src-ILU src-ILUT;
do
echo $srcdir
( cd $srcdir
test ! -f cmake_install.cmake.orig &&
cp -a cmake_install.cmake cmake_install.cmake.orig
cat cmake_install.cmake.orig |
sed 's%_INSTALL_PREFIX}/lib%\_INSTALL_PREFIX}/lib64%g' \
> cmake_install.cmake )
done
# Build it
make
# Become root to install it
su
# Install it
make install
ldconfig
# Make sure your non-root user can remove the source later
chown -R $(logname) .
chmod -R u+w .
# Become your non-root user again
exit
# Save the source for later
cd
mkdir -p -m 0700 installed
rm -f installed/DevIL-*.tar.*
mv DevIL-1.8.0.tar.gz installed/
# If you ever want to uninstall DevIL, this should do it:
cd
su
test -d src/DevIL-* && ( cd src/DevIL-* ; make uninstall )
for pfx in /usr /usr/local;
do
( cd ${pfx}/bin ; rm -f ilur )
test -d ${pfx}/include/IL && rm -r ${pfx}/include/IL
( cd ${pfx}/lib ; rm -f libIL.* libILU.* libILUT.* )
test -d ${pfx}/lib64 &&
( cd ${pfx}/lib64 ; rm -f libIL.* libILU.* libILUT.* )
test -d ${pfx}/share/devil && rm -r ${pfx}/share/devil
test -d ${pfx}/lib/pkgconfig &&
( cd ${pfx}/lib/pkgconfig ; rm -f IL.pc ILU.pc ILUT.pc )
test -d ${pfx}/lib64/pkgconfig &&
( cd ${pfx}/lib64/pkgconfig ; rm -f IL.pc ILU.pc ILUT.pc )
rm -f ${pfx}/info/DevIL_manual.info ${pfx}/share/info/DevIL_manual.info
done
ldconfig
exit
find ~/src -maxdepth 1 -type d -name "DevIL-*" -exec rm -r {} \;
rm -f ~/installed/DevIL-*.tar.*