summaryrefslogtreecommitdiffstats
path: root/libzip-upstream.patch
blob: 50be1823c9ff8abdd5f2b0428dbcfb45098db0d9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
From 42a3c4a40b9925b8ef0fb8f38b200fdc9f6fe5a4 Mon Sep 17 00:00:00 2001
From: Thomas Klausner <tk@giga.or.at>
Date: Fri, 29 Dec 2017 22:29:37 +0100
Subject: [PATCH] Use GNUInstallDirs variables to allow installation
 customization.

---
 CMakeLists.txt     | 13 ++++++-------
 lib/CMakeLists.txt |  8 ++++----
 src/CMakeLists.txt |  6 +++---
 3 files changed, 13 insertions(+), 14 deletions(-)

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 @@ endif(CMAKE_SYSTEM_NAME MATCHES WindowsPhone OR CMAKE_SYSTEM_NAME MATCHES Window
 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 @@ ADD_SUBDIRECTORY(examples)
 # 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 @@ IF(CMAKE_SYSTEM_NAME MATCHES BSD)
   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 @@ FILE(COPY ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/runtest
 
 # 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 @@ ADD_LIBRARY(zip ${LIBZIP_SOURCES} ${LIBZIP_EXTRA_FILES} ${LIBZIP_OPSYS_FILES})
 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 @@ ENDIF(NOT HAVE_GETOPT)
 
 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})
From 3a7497b791289e316aa794b7f2f1a95dd26ced26 Mon Sep 17 00:00:00 2001
From: Thomas Klausner <tk@giga.or.at>
Date: Fri, 29 Dec 2017 22:35:53 +0100
Subject: [PATCH] Set bindir in pkgconfig file and use it.

---
 CMakeLists.txt | 1 +
 libzip.pc.in   | 3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index b61f5ea..3366b25 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -156,6 +156,7 @@ ADD_SUBDIRECTORY(examples)
 # pkgconfig file
 SET(prefix ${CMAKE_INSTALL_PREFIX})
 SET(exec_prefix \${prefix})
+SET(bindir \${exec_prefix}/${CMAKE_INSTALL_BINDIR})
 SET(libdir \${exec_prefix}/${CMAKE_INSTALL_LIBDIR})
 SET(includedir \${prefix}/${CMAKE_INSTALL_INCLUDEDIR})
 IF(BZIP2_FOUND)
diff --git a/libzip.pc.in b/libzip.pc.in
index 53abc47..7be7f3e 100644
--- a/libzip.pc.in
+++ b/libzip.pc.in
@@ -1,9 +1,10 @@
 prefix=@prefix@
 exec_prefix=@exec_prefix@
+bindir=@bindir@
 libdir=@libdir@
 includedir=@includedir@
 
-zipcmp=@prefix@/bin/zipcmp
+zipcmp=@bindir@/zipcmp
 
 Name: libzip
 Description: library for handling zip archives