diff options
author | jasper <> | 2011-05-05 20:58:15 +0000 |
---|---|---|
committer | jasper <> | 2011-05-05 20:58:15 +0000 |
commit | daa41feed7a1d73dfc71d8d7a287a7f1db625be9 (patch) | |
tree | 4aea5329d2bc9a333ee7fc75ed3ddd709cce8ae1 /src/lib/libssl/generate_pkgconfig.sh | |
parent | ad527ff4137ec2b21fca81a6af20dd16c170ea59 (diff) | |
download | openbsd-daa41feed7a1d73dfc71d8d7a287a7f1db625be9.tar.gz openbsd-daa41feed7a1d73dfc71d8d7a287a7f1db625be9.tar.bz2 openbsd-daa41feed7a1d73dfc71d8d7a287a7f1db625be9.zip |
Make this script more generic and minimize differences between
the openssl and libz versions:
- use a generic ${lib_version}
- define ${version_file} to look run ${version_re} on to
acquire the library version.
- add license
- remove unused -k flag
no change in generated files
ok sthen@
Diffstat (limited to 'src/lib/libssl/generate_pkgconfig.sh')
-rw-r--r-- | src/lib/libssl/generate_pkgconfig.sh | 31 |
1 files changed, 23 insertions, 8 deletions
diff --git a/src/lib/libssl/generate_pkgconfig.sh b/src/lib/libssl/generate_pkgconfig.sh index 434ab6cdc3..04bc77e38d 100644 --- a/src/lib/libssl/generate_pkgconfig.sh +++ b/src/lib/libssl/generate_pkgconfig.sh | |||
@@ -1,17 +1,31 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/sh |
2 | # | 2 | # |
3 | # $OpenBSD: generate_pkgconfig.sh,v 1.6 2011/05/03 17:28:25 jasper Exp $ | 3 | # $OpenBSD: generate_pkgconfig.sh,v 1.7 2011/05/05 20:58:15 jasper Exp $ |
4 | # | ||
5 | # Copyright (c) 2010,2011 Jasper Lievisse Adriaanse <jasper@openbsd.org> | ||
6 | # | ||
7 | # Permission to use, copy, modify, and distribute this software for any | ||
8 | # purpose with or without fee is hereby granted, provided that the above | ||
9 | # copyright notice and this permission notice appear in all copies. | ||
10 | # | ||
11 | # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||
12 | # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | ||
13 | # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | ||
14 | # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
15 | # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||
16 | # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | ||
17 | # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
4 | # | 18 | # |
5 | # Generate pkg-config files for OpenSSL. | 19 | # Generate pkg-config files for OpenSSL. |
6 | 20 | ||
7 | usage() { | 21 | usage() { |
8 | echo "usage: ${0##*/} [-k] -c current_directory -o obj_directory" | 22 | echo "usage: ${0##*/} -c current_directory -o obj_directory" |
9 | exit 1 | 23 | exit 1 |
10 | } | 24 | } |
11 | 25 | ||
12 | curdir= | 26 | curdir= |
13 | objdir= | 27 | objdir= |
14 | while getopts "c:ko:" flag; do | 28 | while getopts "c:o:" flag; do |
15 | case "$flag" in | 29 | case "$flag" in |
16 | c) | 30 | c) |
17 | curdir=$OPTARG | 31 | curdir=$OPTARG |
@@ -36,8 +50,9 @@ if [ ! -w "${objdir}" ]; then | |||
36 | exit 1 | 50 | exit 1 |
37 | fi | 51 | fi |
38 | 52 | ||
39 | ssl_version=$(sed -nE 's/^#define[[:blank:]]+SHLIB_VERSION_NUMBER[[:blank:]]+"(.*)".*/\1/p' \ | 53 | version_re="s/^#define[[:blank:]]+SHLIB_VERSION_NUMBER[[:blank:]]+\"(.*)\".*/\1/p" |
40 | ${curdir}/src/crypto/opensslv.h) | 54 | version_file=${curdir}/src/crypto/opensslv.h |
55 | lib_version=$(sed -nE ${version_re} ${version_file}) | ||
41 | 56 | ||
42 | # Put -I${includedir} into Cflags so configure script tests like | 57 | # Put -I${includedir} into Cflags so configure script tests like |
43 | # test -n "`pkg-config --cflags openssl`" | 58 | # test -n "`pkg-config --cflags openssl`" |
@@ -52,7 +67,7 @@ includedir=\${prefix}/include | |||
52 | 67 | ||
53 | Name: OpenSSL-libcrypto | 68 | Name: OpenSSL-libcrypto |
54 | Description: OpenSSL cryptography library | 69 | Description: OpenSSL cryptography library |
55 | Version: ${ssl_version} | 70 | Version: ${lib_version} |
56 | Requires: | 71 | Requires: |
57 | Libs: -L\${libdir} -lcrypto | 72 | Libs: -L\${libdir} -lcrypto |
58 | Cflags: -I\${includedir} | 73 | Cflags: -I\${includedir} |
@@ -68,7 +83,7 @@ includedir=\${prefix}/include | |||
68 | 83 | ||
69 | Name: OpenSSL | 84 | Name: OpenSSL |
70 | Description: Secure Sockets Layer and cryptography libraries | 85 | Description: Secure Sockets Layer and cryptography libraries |
71 | Version: ${ssl_version} | 86 | Version: ${lib_version} |
72 | Requires: | 87 | Requires: |
73 | Libs: -L\${libdir} -lssl -lcrypto | 88 | Libs: -L\${libdir} -lssl -lcrypto |
74 | Cflags: -I\${includedir} | 89 | Cflags: -I\${includedir} |
@@ -84,7 +99,7 @@ includedir=\${prefix}/include | |||
84 | 99 | ||
85 | Name: OpenSSL | 100 | Name: OpenSSL |
86 | Description: Secure Sockets Layer and cryptography libraries and tools | 101 | Description: Secure Sockets Layer and cryptography libraries and tools |
87 | Version: ${ssl_version} | 102 | Version: ${lib_version} |
88 | Requires: | 103 | Requires: |
89 | Libs: -L\${libdir} -lssl -lcrypto | 104 | Libs: -L\${libdir} -lssl -lcrypto |
90 | Cflags: -I\${includedir} | 105 | Cflags: -I\${includedir} |