Merge pull request #41 from darkxst/rpath_linux

Don't set RPATH on installed libraries on Linux
diff --git a/THANKS b/THANKS
index 1f8f1c0..c80e660 100644
--- a/THANKS
+++ b/THANKS
@@ -67,6 +67,7 @@
 Simon Talbot <simont@nse.co.uk>
 Stephen Bryant <steve@bawue.de>
 Tarmo Pikaro <tapika@yahoo.com>
+Tim Lunn <Tim@feathertop.org>
 Timo Warns <warns@pre-sense.de>
 Tom Callaway <tcallawa@redhat.com>
 Tomas Hoger <thoger@redhat.com>
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
index be4db6d..92c4bec 100644
--- a/lib/CMakeLists.txt
+++ b/lib/CMakeLists.txt
@@ -2,6 +2,8 @@
 
 INSTALL(FILES zip.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
 
+SET(CMAKE_C_VISIBILITY_PRESET hidden)
+
 # from http://www.cmake.org/Wiki/CMakeMacroLibtoolFile
 MACRO(GET_TARGET_PROPERTY_WITH_DEFAULT _variable _target _property _default_value)
   GET_TARGET_PROPERTY(${_variable} ${_target} ${_property})
@@ -177,7 +179,7 @@
   )
 ENDIF(WIN32)
 
-INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/..)
+INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/..)
 
 ADD_CUSTOM_TARGET(update_zip_err_str
   COMMAND sh ${CMAKE_CURRENT_SOURCE_DIR}/make_zip_err_str.sh ${CMAKE_CURRENT_SOURCE_DIR}/zip.h ${CMAKE_CURRENT_SOURCE_DIR}/zip_err_str.c
diff --git a/man/zip_errors.man b/man/zip_errors.man
index 45f8735..714d4ae 100644
--- a/man/zip_errors.man
+++ b/man/zip_errors.man
@@ -10,100 +10,100 @@
 \fB#include <zip.h>\fR
 .SH "DESCRIPTION"
 The following error codes are used by libzip:
-.TP 23n
+.TP 26n
 [\fRZIP_ER_CHANGED\fR]
 Entry has been changed.
-.TP 23n
+.TP 26n
 [\fRZIP_ER_CLOSE\fR]
 Closing zip archive failed.
-.TP 23n
+.TP 26n
 [\fRZIP_ER_COMPNOTSUPP\fR]
 Compression method not supported.
-.TP 23n
+.TP 26n
 [\fRZIP_ER_COMPRESSED_DATA\fR]
 Compressed data invalid.
-.TP 23n
+.TP 26n
 [\fRZIP_ER_CRC\fR]
 CRC error.
-.TP 23n
+.TP 26n
 [\fRZIP_ER_DELETED\fR]
 Entry has been deleted.
-.TP 23n
+.TP 26n
 [\fRZIP_ER_ENCRNOTSUPP\fR]
 Encryption method not supported.
-.TP 23n
+.TP 26n
 [\fRZIP_ER_EOF\fR]
 Premature end of file.
-.TP 23n
+.TP 26n
 [\fRZIP_ER_EXISTS\fR]
 File already exists.
-.TP 23n
+.TP 26n
 [\fRZIP_ER_INCONS\fR]
 Zip archive inconsistent.
-.TP 23n
+.TP 26n
 [\fRZIP_ER_INTERNAL\fR]
 Internal error.
-.TP 23n
+.TP 26n
 [\fRZIP_ER_INUSE\fR]
 Resource still in use.
-.TP 23n
+.TP 26n
 [\fRZIP_ER_INVAL\fR]
 Invalid argument.
-.TP 23n
+.TP 26n
 [\fRZIP_ER_MEMORY\fR]
 Malloc failure.
-.TP 23n
+.TP 26n
 [\fRZIP_ER_MULTIDISK\fR]
 Multi-disk zip archives not supported.
-.TP 23n
+.TP 26n
 [\fRZIP_ER_NOENT\fR]
 No such file.
-.TP 23n
+.TP 26n
 [\fRZIP_ER_NOPASSWD\fR]
 No password provided.
-.TP 23n
+.TP 26n
 [\fRZIP_ER_NOZIP\fR]
 Not a zip archive.
-.TP 23n
+.TP 26n
 [\fRZIP_ER_OK\fR]
 No error.
-.TP 23n
+.TP 26n
 [\fRZIP_ER_OPEN\fR]
 Can't open file.
-.TP 23n
+.TP 26n
 [\fRZIP_ER_OPNOTSUPP\fR]
 Operation not supported.
-.TP 23n
+.TP 26n
 [\fRZIP_ER_RDONLY\fR]
 Read-only archive.
-.TP 23n
+.TP 26n
 [\fRZIP_ER_READ\fR]
 Read error.
-.TP 23n
+.TP 26n
 [\fRZIP_ER_REMOVE\fR]
 Can't remove file.
-.TP 23n
+.TP 26n
 [\fRZIP_ER_RENAME\fR]
 Renaming temporary file failed.
-.TP 23n
+.TP 26n
 [\fRZIP_ER_SEEK\fR]
 Seek error.
-.TP 23n
+.TP 26n
 [\fRZIP_ER_TELL\fR]
 Tell error.
-.TP 23n
+.TP 26n
 [\fRZIP_ER_TMPOPEN\fR]
 Failure to create temporary file.
-.TP 23n
+.TP 26n
 [\fRZIP_ER_WRITE\fR]
 Write error.
-.TP 23n
+.TP 26n
 [\fRZIP_ER_WRONGPASSWD\fR]
 Wrong password provided.
-.TP 23n
+.TP 26n
 [\fRZIP_ER_ZIPCLOSED\fR]
 Containing zip archive was closed.
-.TP 23n
+.TP 26n
 [\fRZIP_ER_ZLIB\fR]
 Zlib error.
 .SH "AUTHORS"
diff --git a/man/zip_file_get_external_attributes.man b/man/zip_file_get_external_attributes.man
index c2429f8..0c4801e 100644
--- a/man/zip_file_get_external_attributes.man
+++ b/man/zip_file_get_external_attributes.man
@@ -10,6 +10,7 @@
 \fB#include <zip.h>\fR
 .sp
 \fIint\fR
+.br
 .PD 0
 .HP 4n
 \fBzip_file_get_external_attributes\fR(\fIzip_t\ *archive\fR, \fIzip_uint64_t\ index\fR, \fIzip_flags_t\ flags\fR, \fIzip_uint8_t\ *opsys\fR, \fIzip_uint32_t\ *attributes\fR);
diff --git a/man/zip_ftell.man b/man/zip_ftell.man
index 7baa856..7951ba3 100644
--- a/man/zip_ftell.man
+++ b/man/zip_ftell.man
@@ -10,6 +10,7 @@
 \fB#include <zip.h>\fR
 .sp
 \fIzip_int64_t\fR
+.br
 .PD 0
 .HP 4n
 \fBzip_ftell\fR(\fIzip_file_t\ *file\fR);
diff --git a/man/zip_libzip_version.man b/man/zip_libzip_version.man
index 864be71..6628436 100644
--- a/man/zip_libzip_version.man
+++ b/man/zip_libzip_version.man
@@ -18,7 +18,7 @@
 .SH "DESCRIPTION"
 \fBzip_libzip_version\fR
 returns the version number of the library as string in the format
-\(Lq$MAJOR.$MINOR.$MICRO$SUFFIX\(Rq
+\(lq$MAJOR.$MINOR.$MICRO$SUFFIX\(rq
 where
 \fI$MAJOR\fR
 is the major version,
diff --git a/man/ziptool.man b/man/ziptool.man
index 0037dd7..b3d10fc 100644
--- a/man/ziptool.man
+++ b/man/ziptool.man
@@ -325,9 +325,9 @@
 to the zip archive
 \fItestbuffer.zip\fR
 with data
-\(LqThis is a test.\en\(Rq
+\(lqThis is a test.\en\(rq
 where
-\(Lq\en\(Rq
+\(lq\en\(rq
 is replaced with a newline character:
 .nf
 .sp
diff --git a/regress/CMakeLists.txt b/regress/CMakeLists.txt
index aaded89..6337e16 100644
--- a/regress/CMakeLists.txt
+++ b/regress/CMakeLists.txt
@@ -1,8 +1,6 @@
 CHECK_FUNCTION_EXISTS(getopt HAVE_GETOPT)
 IF(NOT HAVE_GETOPT)
   SET(SRC_EXTRA_FILES ../src/getopt.c)
-INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}
-  ${CMAKE_CURRENT_SOURCE_DIR}/../src)
 ENDIF()
 
 SET(TEST_PROGRAMS
@@ -203,8 +201,6 @@
   SET_TESTS_PROPERTIES(${CASE} PROPERTIES SKIP_RETURN_CODE 77)
 ENDFOREACH()
 
-INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../lib
-	${CMAKE_CURRENT_SOURCE_DIR}/../src
-	${CMAKE_CURRENT_BINARY_DIR}/..)
+INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/../lib ${CMAKE_CURRENT_SOURCE_DIR}/../src ${CMAKE_CURRENT_BINARY_DIR}/..)
 
 ADD_CUSTOM_TARGET(check COMMAND ${CMAKE_CTEST_COMMAND})
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index ccc8f7e..ad1f38c 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -1,5 +1,4 @@
-INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../lib
-  ${CMAKE_CURRENT_BINARY_DIR}/..)
+INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/../lib ${CMAKE_CURRENT_BINARY_DIR}/..)
 
 CHECK_FUNCTION_EXISTS(getopt HAVE_GETOPT)
 IF(NOT HAVE_GETOPT)