[6ce3f4]: openssl / openssl-1.0.1e-msys2.patch  Maximize  Restore  History

Download this file

448 lines (438 with data), 16.6 kB

  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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
diff -Naur openssl-1.0.1e-cygwin/config openssl-1.0.1e-msys/config
--- openssl-1.0.1e-cygwin/config 2013-02-11 15:26:04.000000000 +0000
+++ openssl-1.0.1e-msys/config 2013-03-26 19:46:33.236328100 +0000
@@ -358,7 +358,9 @@
esac
exit 0
;;
-
+ MSYS*)
+ echo "${MACHINE}-whatever-msys"; exit 0;
+ ;;
*"CRAY T3E")
echo "t3e-cray-unicosmk"; exit 0;
;;
@@ -834,6 +836,7 @@
mips-sony-newsos4) OUT="newsos4-gcc" ;;
*-*-cygwin_pre1.3) OUT="Cygwin-pre1.3" ;;
*-*-cygwin) OUT="Cygwin" ;;
+ *-*-msys) OUT="Msys" ;;
t3e-cray-unicosmk) OUT="cray-t3e" ;;
j90-cray-unicos) OUT="cray-j90" ;;
nsr-tandem-nsk) OUT="tandem-c89" ;;
diff -Naur openssl-1.0.1e-cygwin/Configure openssl-1.0.1e-msys/Configure
--- openssl-1.0.1e-cygwin/Configure 2013-03-27 04:58:53.265625000 +0000
+++ openssl-1.0.1e-msys/Configure 2013-03-26 20:17:23.732421900 +0000
@@ -552,6 +552,11 @@
"debug-Cygwin", "gcc:-DTERMIOS -DL_ENDIAN -march=i486 -Wall -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DOPENSSL_NO_ASM -g -Wformat -Wshadow -Wmissing-prototypes -Wmissing-declarations -Werror:::CYGWIN32:::${no_asm}:dlfcn:cygwin-shared:-D_WINDLL:-shared:.dll.a",
"Cygwin-x86_64", "gcc:-DTERMIOS -DL_ENDIAN -O3 -Wall:::CYGWIN32::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:mingw64:dlfcn:cygwin-shared:-D_WINDLL:-shared:.dll.a",
+# MSYS
+"Msys", "gcc:-DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O3 -march=i486 -Wall:::CYGWIN32::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_asm}:coff:dlfcn:msys-shared:-D_WINDLL:-shared:.dll.a",
+"debug-Msys", "gcc:-DTERMIOS -DL_ENDIAN -march=i486 -Wall -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DOPENSSL_NO_ASM -g -Wformat -Wshadow -Wmissing-prototypes -Wmissing-declarations -Werror:::CYGWIN32:::${no_asm}:dlfcn:msys-shared:-D_WINDLL:-shared:.dll.a",
+"Msys-x86_64", "gcc:-DTERMIOS -DL_ENDIAN -O3 -Wall:::CYGWIN32::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:mingw64:dlfcn:msys-shared:-D_WINDLL:-shared:.dll.a",
+
# NetWare from David Ward (dsward@novell.com)
# requires either MetroWerks NLM development tools, or gcc / nlmconv
# NetWare defaults socket bio to WinSock sockets. However,
@@ -1123,7 +1128,7 @@
my $IsMK1MF=scalar grep /^$target$/,@MK1MF_Builds;
-$exe_ext=".exe" if ($target eq "Cygwin" || $target eq "DJGPP" || $target =~ /^mingw/);
+$exe_ext=".exe" if ($target eq "Cygwin" || $target eq "Msys" || $target eq "DJGPP" || $target =~ /^mingw/);
$exe_ext=".nlm" if ($target =~ /netware/);
$exe_ext=".pm" if ($target =~ /vos/);
$openssldir="/usr/local/ssl" if ($openssldir eq "" and $prefix eq "");
diff -Naur openssl-1.0.1e-cygwin/demos/engines/rsaref/Makefile openssl-1.0.1e-msys/demos/engines/rsaref/Makefile
--- openssl-1.0.1e-cygwin/demos/engines/rsaref/Makefile 2013-02-11 15:02:48.000000000 +0000
+++ openssl-1.0.1e-msys/demos/engines/rsaref/Makefile 2013-03-26 20:07:21.025390600 +0000
@@ -36,6 +36,7 @@
darwin: install $(SHLIB).darwin
cygwin: install $(SHLIB).cygwin
+msys: install $(SHLIB).msys
gnu: install $(SHLIB).gnu
alpha-osf1: install $(SHLIB).alpha-osf1
tru64: install $(SHLIB).tru64
@@ -67,6 +68,12 @@
SHAREDCMD='$(CC)'; \
$(LINK_SO)
touch $(SHLIB).cygwin
+$(SHLIB).msys: $(LIB) install/librsaref.a
+ ALLSYMSFLAGS='--whole-archive' \
+ SHAREDFLAGS='-shared -Wl,-Bsymbolic -Wl,--out-implib,$(LIBNAME).dll.a' \
+ SHAREDCMD='$(CC)'; \
+ $(LINK_SO)
+ touch $(SHLIB).msys
$(SHLIB).gnu: $(LIB) install/librsaref.a
ALLSYMSFLAGS='--whole-archive' \
SHAREDFLAGS='-shared -Wl,-soname=$(SHLIB)' \
diff -Naur openssl-1.0.1e-cygwin/engines/ccgost/Makefile openssl-1.0.1e-msys/engines/ccgost/Makefile
--- openssl-1.0.1e-cygwin/engines/ccgost/Makefile 2013-03-27 04:58:53.281250000 +0000
+++ openssl-1.0.1e-msys/engines/ccgost/Makefile 2013-03-26 20:13:34.955078100 +0000
@@ -49,6 +49,10 @@
sfx=".so"; \
cp cyg$(LIBNAME).dll $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines/$${pfx}$(LIBNAME)$$sfx.new; \
;; \
+ Msys*) \
+ sfx=".so"; \
+ cp msys-$(LIBNAME).dll $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines/$${pfx}$(LIBNAME)$$sfx.new; \
+ ;; \
*) \
case "$(CFLAGS)" in \
*DSO_BEOS*) sfx=".so";; \
diff -Naur openssl-1.0.1e-cygwin/engines/Makefile openssl-1.0.1e-msys/engines/Makefile
--- openssl-1.0.1e-cygwin/engines/Makefile 2013-03-27 05:03:58.596679600 +0000
+++ openssl-1.0.1e-msys/engines/Makefile 2013-03-26 20:11:59.808593800 +0000
@@ -115,6 +115,10 @@
sfx=".so"; \
cp cyg$$l.dll $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines/$$pfx$$l$$sfx.new; \
;; \
+ Msys*) \
+ sfx=".so"; \
+ cp msys-$$l.dll $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines/$$pfx$$l$$sfx.new; \
+ ;; \
*) \
case "$(CFLAGS)" in \
*DSO_BEOS*) sfx=".so";; \
@@ -124,7 +128,7 @@
*) sfx=".bad";; \
esac; \
cp $$pfx$$l$$sfx $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines/$$pfx$$l$$sfx.new; \
- esac; \
+ esac; \
chmod 555 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines/$$pfx$$l$$sfx.new; \
mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines/$$pfx$$l$$sfx.new $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines/$$pfx$$l$$sfx ); \
done; \
diff -Naur openssl-1.0.1e-cygwin/Makefile openssl-1.0.1e-msys/Makefile
--- openssl-1.0.1e-cygwin/Makefile 2013-02-11 15:26:04.000000000 +0000
+++ openssl-1.0.1e-msys/Makefile 2013-03-26 20:00:37.626953100 +0000
@@ -330,6 +330,9 @@
if [ "$(PLATFORM)" = "Cygwin" ]; then \
( set -x; rm -f cyg$$i$(SHLIB_EXT) lib$$i$(SHLIB_EXT).a ); \
fi; \
+ if [ "$(PLATFORM)" = "Msys" ]; then \
+ ( set -x; rm -f msys-$$i$(SHLIB_EXT) lib$$i$(SHLIB_EXT).a ); \
+ fi; \
done
link-shared:
@@ -572,19 +575,29 @@
do \
if [ -f "$$i" -o -f "$$i.a" ]; then \
( echo installing $$i; \
- if [ "$(PLATFORM)" != "Cygwin" ]; then \
+ case "$(PLATFORM)" in Cygwin*) \
+ c=`echo $$i | sed 's/^lib\(.*\)\.dll\.a/cyg\1-$(SHLIB_VERSION_NUMBER).dll/'`; \
+ cp $$c $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new; \
+ chmod 755 $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new; \
+ mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c; \
cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
- chmod 555 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
+ chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i; \
- else \
- c=`echo $$i | sed 's/^lib\(.*\)\.dll\.a/cyg\1-$(SHLIB_VERSION_NUMBER).dll/'`; \
+ ;; \
+ Msys*) \
+ c=`echo $$i | sed 's/^lib\(.*\)\.dll\.a/msys-\1-$(SHLIB_VERSION_NUMBER).dll/'`; \
cp $$c $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new; \
chmod 755 $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new; \
mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c; \
cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i; \
- fi ); \
+ ;; \
+ *) \
+ cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
+ chmod 555 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
+ mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i; \
+ esac ); \
if expr $(PLATFORM) : 'mingw' > /dev/null; then \
( case $$i in \
*crypto*) i=libeay32.dll;; \
diff -Naur openssl-1.0.1e-cygwin/Makefile.org openssl-1.0.1e-msys/Makefile.org
--- openssl-1.0.1e-cygwin/Makefile.org 2013-03-27 04:58:53.265625000 +0000
+++ openssl-1.0.1e-msys/Makefile.org 2013-03-26 19:52:02.767578100 +0000
@@ -328,6 +328,9 @@
case "$(PLATFORM)" in Cygwin*) \
( set -x; rm -f cyg$$i$(SHLIB_EXT) lib$$i$(SHLIB_EXT).a ); \
esac; \
+ case "$(PLATFORM)" in Msys*) \
+ ( set -x; rm -f msys-$$i$(SHLIB_EXT) lib$$i$(SHLIB_EXT).a ); \
+ esac; \
done
link-shared:
@@ -579,6 +582,15 @@
chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i; \
;; \
+ Msys*) \
+ c=`echo $$i | sed 's/^lib\(.*\)\.dll\.a/msys-\1-$(SHLIB_VERSION_NUMBER).dll/'`; \
+ cp $$c $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new; \
+ chmod 755 $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new; \
+ mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c; \
+ cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
+ chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
+ mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i; \
+ ;; \
*) \
cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
chmod 555 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
@@ -643,7 +655,7 @@
@pod2man="`cd ./util; ./pod2mantest $(PERL)`"; \
here="`pwd`"; \
filecase=; \
- case "$(PLATFORM)" in DJGPP|Cygwin*|mingw*) \
+ case "$(PLATFORM)" in DJGPP|Cygwin*|Msys*|mingw*) \
filecase=-i; \
esac; \
set -e; for i in doc/apps/*.pod; do \
diff -Naur openssl-1.0.1e-cygwin/Makefile.shared openssl-1.0.1e-msys/Makefile.shared
--- openssl-1.0.1e-cygwin/Makefile.shared 2013-02-11 15:26:04.000000000 +0000
+++ openssl-1.0.1e-msys/Makefile.shared 2013-03-26 20:04:54.736328100 +0000
@@ -311,6 +311,62 @@
fi; \
$(LINK_APP)
+link_o.msys:
+ @ $(CALC_VERSIONS); \
+ INHIBIT_SYMLINKS=yes; \
+ SHLIB=msys-$(LIBNAME); \
+ base=-Wl,--enable-auto-image-base; \
+ deffile=; \
+ if expr $(PLATFORM) : 'mingw' > /dev/null; then \
+ SHLIB=$(LIBNAME)eay32; base=; \
+ if test -f $(LIBNAME)eay32.def; then \
+ deffile=$(LIBNAME)eay32.def; \
+ fi; \
+ fi; \
+ SHLIB_SUFFIX=.dll; \
+ LIBVERSION="$(LIBVERSION)"; \
+ SHLIB_SOVER=${LIBVERSION:+"-$(LIBVERSION)"}; \
+ ALLSYMSFLAGS='-Wl,--whole-archive'; \
+ NOALLSYMSFLAGS='-Wl,--no-whole-archive'; \
+ SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared $$base $$deffile -Wl,-s,-Bsymbolic"; \
+ $(LINK_SO_O)
+#for mingw target if def-file is in use dll-name should match library-name
+link_a.msys:
+ @ $(CALC_VERSIONS); \
+ INHIBIT_SYMLINKS=yes; \
+ SHLIB=msys-$(LIBNAME); SHLIB_SOVER=-$(LIBVERSION); SHLIB_SUFFIX=.dll; \
+ dll_name=$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX; extras=; \
+ base=-Wl,--enable-auto-image-base; \
+ if expr $(PLATFORM) : 'mingw' > /dev/null; then \
+ case $(LIBNAME) in \
+ crypto) SHLIB=libeay;; \
+ ssl) SHLIB=ssleay;; \
+ esac; \
+ SHLIB_SOVER=32; \
+ extras="$(LIBNAME).def"; \
+ $(PERL) util/mkdef.pl 32 $$SHLIB > $$extras; \
+ base=; [ $(LIBNAME) = "crypto" ] && base=-Wl,--image-base,0x63000000; \
+ fi; \
+ dll_name=$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX; \
+ $(PERL) util/mkrc.pl $$dll_name | \
+ $(CROSS_COMPILE)windres -o rc.o; \
+ extras="$$extras rc.o"; \
+ ALLSYMSFLAGS='-Wl,--whole-archive'; \
+ NOALLSYMSFLAGS='-Wl,--no-whole-archive'; \
+ SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared $$base -Wl,-s,-Bsymbolic -Wl,--out-implib,lib$(LIBNAME).dll.a $$extras"; \
+ [ -f apps/$$dll_name ] && rm apps/$$dll_name; \
+ [ -f test/$$dll_name ] && rm test/$$dll_name; \
+ $(LINK_SO_A) || exit 1; \
+ rm $$extras; \
+ cp -p $$dll_name apps/; \
+ cp -p $$dll_name test/
+link_app.msys:
+ @if expr "$(CFLAGS)" : '.*OPENSSL_USE_APPLINK' > /dev/null; then \
+ LIBDEPS="$(TOP)/crypto/applink.o $${LIBDEPS:-$(LIBDEPS)}"; \
+ export LIBDEPS; \
+ fi; \
+ $(LINK_APP)
+
link_o.alpha-osf1:
@ if $(DETECT_GNU_LD); then \
$(DO_GNU_SO); \
@@ -591,7 +647,7 @@
expr $(PLATFORM) : '.*ia64' > /dev/null && SHLIB=lib$(LIBNAME).so; \
$(SYMLINK_SO)
# The following lines means those specific architectures do no symlinks
-symlink.cygwin symlink.alpha-osf1 symlink.tru64 symlink.tru64-rpath symlink.beos:
+symlink.cygwin symlink.msys symlink.alpha-osf1 symlink.tru64 symlink.tru64-rpath symlink.beos:
# Compatibility targets
link_o.bsd-gcc-shared link_o.linux-shared link_o.gnu-shared: link_o.gnu
@@ -609,6 +665,10 @@
link_a.cygwin-shared: link_a.cygwin
link_app.cygwin-shared: link_app.cygwin
symlink.cygwin-shared: symlink.cygwin
+link_o.msys-shared: link_o.msys
+link_a.msys-shared: link_a.msys
+link_app.msys-shared: link_app.msys
+symlink.msys-shared: symlink.msys
link_o.alpha-osf1-shared: link_o.alpha-osf1
link_a.alpha-osf1-shared: link_a.alpha-osf1
link_app.alpha-osf1-shared: link_app.alpha-osf1
--- openssl-1.0.1e-cygwin/util/mklink.pl 2013-04-04 07:00:05.511718700 +0000
+++ openssl-1.0.1e-msys/util/mklink.pl 2013-04-04 07:00:17.292968700 +0000
@@ -51,7 +51,6 @@
my $file;
$symlink_exists=eval {symlink("",""); 1};
-if ($^O eq "msys") { $symlink_exists=0 };
foreach $file (@files) {
my $err = "";
if ($symlink_exists) {
diff -Naur openssl-1.0.1e-cygwin/util/msys.sh openssl-1.0.1e-msys/util/msys.sh
--- openssl-1.0.1e-cygwin/util/msys.sh 1970-01-01 00:00:00.000000000 +0000
+++ openssl-1.0.1e-msys/util/msys.sh 2013-03-26 20:15:33.357421900 +0000
@@ -0,0 +1,154 @@
+#!/bin/bash
+#
+# This script configures, builds and packs the binary package for
+# the Cygwin net distribution version of OpenSSL
+#
+
+# Uncomment when debugging
+#set -x
+
+CONFIG_OPTIONS="--prefix=/usr shared zlib no-idea no-rc5"
+INSTALL_PREFIX=/tmp/install/INSTALL
+
+VERSION=
+SHLIB_VERSION_NUMBER=
+SUBVERSION=$1
+
+function cleanup()
+{
+ rm -rf ${INSTALL_PREFIX}/etc
+ rm -rf ${INSTALL_PREFIX}/usr
+}
+
+function get_openssl_version()
+{
+ eval `grep '^VERSION=' Makefile`
+ if [ -z "${VERSION}" ]
+ then
+ echo "Error: Couldn't retrieve OpenSSL version from Makefile."
+ echo " Check value of variable VERSION in Makefile."
+ exit 1
+ fi
+ eval `grep '^SHLIB_VERSION_NUMBER=' Makefile`
+ if [ -z "${SHLIB_VERSION_NUMBER}" ]
+ then
+ echo "Error: Couldn't retrieve OpenSSL shared lib version from Makefile."
+ echo " Check value of variable SHLIB_VERSION_NUMBER in Makefile."
+ exit 1
+ fi
+}
+
+function base_install()
+{
+ mkdir -p ${INSTALL_PREFIX}
+ cleanup
+ make install INSTALL_PREFIX="${INSTALL_PREFIX}"
+}
+
+function doc_install()
+{
+ DOC_DIR=${INSTALL_PREFIX}/usr/share/doc/openssl
+
+ mkdir -p ${DOC_DIR}
+ cp CHANGES CHANGES.SSLeay INSTALL LICENSE NEWS README ${DOC_DIR}
+
+ create_cygwin_readme
+}
+
+function certs_install()
+{
+ CERTS_DIR=${INSTALL_PREFIX}/usr/ssl/certs
+
+ mkdir -p ${CERTS_DIR}
+ cp -rp certs/* ${CERTS_DIR}
+}
+
+function create_cygwin_readme()
+{
+ README_DIR=${INSTALL_PREFIX}/usr/share/doc/Cygwin
+ README_FILE=${README_DIR}/openssl-${VERSION}.README
+
+ mkdir -p ${README_DIR}
+ cat > ${README_FILE} <<- EOF
+ The Cygwin version has been built using the following configure:
+
+ ./config ${CONFIG_OPTIONS}
+
+ The IDEA and RC5 algorithms are disabled due to patent and/or
+ licensing issues.
+ EOF
+}
+
+function create_profile_files()
+{
+ PROFILE_DIR=${INSTALL_PREFIX}/etc/profile.d
+
+ mkdir -p $PROFILE_DIR
+ cat > ${PROFILE_DIR}/openssl.sh <<- "EOF"
+ export MANPATH="${MANPATH}:/usr/ssl/man"
+ EOF
+ cat > ${PROFILE_DIR}/openssl.csh <<- "EOF"
+ if ( $?MANPATH ) then
+ setenv MANPATH "${MANPATH}:/usr/ssl/man"
+ else
+ setenv MANPATH ":/usr/ssl/man"
+ endif
+ EOF
+}
+
+if [ -z "${SUBVERSION}" ]
+then
+ echo "Usage: $0 subversion"
+ exit 1
+fi
+
+if [ ! -f config ]
+then
+ echo "You must start this script in the OpenSSL toplevel source dir."
+ exit 1
+fi
+
+./config ${CONFIG_OPTIONS}
+
+get_openssl_version
+
+make depend || exit 1
+
+make || exit 1
+
+base_install
+
+doc_install
+
+certs_install
+
+create_cygwin_readme
+
+create_profile_files
+
+cd ${INSTALL_PREFIX}
+chmod u+w usr/lib/engines/*.so
+strip usr/bin/*.exe usr/bin/*.dll usr/lib/engines/*.so
+chmod u-w usr/lib/engines/*.so
+
+# Runtime package
+tar cjf libopenssl${SHLIB_VERSION_NUMBER//[!0-9]/}-${VERSION}-${SUBVERSION}.tar.bz2 \
+ usr/bin/msys*dll
+# Base package
+find etc usr/bin/openssl.exe usr/bin/c_rehash usr/lib/engines usr/share/doc \
+ usr/ssl/certs usr/ssl/man/man[157] usr/ssl/misc usr/ssl/openssl.cnf \
+ usr/ssl/private \
+ -empty -o \! -type d |
+tar cjfT openssl-${VERSION}-${SUBVERSION}.tar.bz2 -
+# Development package
+find usr/include usr/lib/*.a usr/lib/pkgconfig usr/ssl/man/man3 \
+ -empty -o \! -type d |
+tar cjfT openssl-devel-${VERSION}-${SUBVERSION}.tar.bz2 -
+
+ls -l openssl-${VERSION}-${SUBVERSION}.tar.bz2
+ls -l openssl-devel-${VERSION}-${SUBVERSION}.tar.bz2
+ls -l libopenssl${SHLIB_VERSION_NUMBER//[!0-9]/}-${VERSION}-${SUBVERSION}.tar.bz2
+
+cleanup
+
+exit 0