Use GNUInstallDirs variables to allow installation customization.
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 69cdb8b..b61f5ea 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,6 +1,5 @@
 # TODO:
-# 1. Problems generating html pages.
-# 2. create usable libtool .la file
+# create usable libtool .la file
 
 CMAKE_MINIMUM_REQUIRED(VERSION 3.0.2)
 
@@ -141,7 +140,7 @@
 ADD_DEFINITIONS("-DHAVE_CONFIG_H")
 
 # rpath handling: use rpath in installed binaries
-SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
+SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
 SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
 
 # Testing
@@ -157,8 +156,8 @@
 # pkgconfig file
 SET(prefix ${CMAKE_INSTALL_PREFIX})
 SET(exec_prefix \${prefix})
-SET(libdir \${exec_prefix}/lib)
-SET(includedir \${prefix}/include)
+SET(libdir \${exec_prefix}/${CMAKE_INSTALL_LIBDIR})
+SET(includedir \${prefix}/${CMAKE_INSTALL_INCLUDEDIR})
 IF(BZIP2_FOUND)
   SET(LIBS "${LIBS} -lbz2")
 ENDIF()
@@ -167,7 +166,7 @@
   SET(PKG_CONFIG_RPATH "-Wl,-R\${libdir}")
 ENDIF(CMAKE_SYSTEM_NAME MATCHES BSD)
 CONFIGURE_FILE(libzip.pc.in libzip.pc @ONLY)
-INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/libzip.pc DESTINATION lib/pkgconfig)
+INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/libzip.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
 
 # write out config file
 CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/cmake-config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h)
@@ -188,4 +187,4 @@
 
 # installation
 
-INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/zipconf.h DESTINATION include)
+INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/zipconf.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
index 855ccf5..ecbb45e 100644
--- a/lib/CMakeLists.txt
+++ b/lib/CMakeLists.txt
@@ -1,6 +1,6 @@
 INCLUDE(CheckFunctionExists)
 
-INSTALL(FILES zip.h DESTINATION include)
+INSTALL(FILES zip.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
 
 # from http://www.cmake.org/Wiki/CMakeMacroLibtoolFile
 MACRO(GET_TARGET_PROPERTY_WITH_DEFAULT _variable _target _property _default_value)
@@ -203,7 +203,7 @@
 SET_TARGET_PROPERTIES(zip PROPERTIES VERSION 5.0 SOVERSION 5)
 TARGET_LINK_LIBRARIES(zip ${ZLIB_LIBRARY} ${OPTIONAL_LIBRARY})
 INSTALL(TARGETS zip
-  RUNTIME DESTINATION bin
-  ARCHIVE DESTINATION lib
-  LIBRARY DESTINATION lib)
+  RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
+  ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
+  LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
 #CREATE_LIBTOOL_FILE(zip lib)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 2a3f4d2..ccc8f7e 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -8,12 +8,12 @@
 
 ADD_EXECUTABLE(zipcmp zipcmp.c ${SRC_EXTRA_FILES})
 TARGET_LINK_LIBRARIES(zipcmp zip)
-INSTALL(TARGETS zipcmp RUNTIME DESTINATION bin)
+INSTALL(TARGETS zipcmp RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
 
 ADD_EXECUTABLE(zipmerge zipmerge.c ${SRC_EXTRA_FILES})
 TARGET_LINK_LIBRARIES(zipmerge zip)
-INSTALL(TARGETS zipmerge RUNTIME DESTINATION bin)
+INSTALL(TARGETS zipmerge RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
 
 ADD_EXECUTABLE(ziptool ziptool.c ${SRC_EXTRA_FILES})
 TARGET_LINK_LIBRARIES(ziptool zip)
-INSTALL(TARGETS ziptool RUNTIME DESTINATION bin)
+INSTALL(TARGETS ziptool RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})