1#!/bin/sh
2#         $NetBSD: mkpc,v 1.6 2018/04/06 15:47:08 ryo Exp $
3
4getversion() {
5          (echo '#include "openssl/opensslv.h"'; echo OPENSSL_VERSION_TEXT) |
6              eval "$CPP $CPPFLAGS" -I$1 | grep OpenSSL | cut -d ' ' -f 2
7}
8VERSION="$(getversion $1)"
9
10sed -e "s/@VERSION@/${VERSION}/g" < "$2"
11
12case "$2" in
13libcrypto.pc)
14          NAME="OpenSSL-libcrypto"
15          LIBS="-lcrypto"
16          DESCRIPTION="OpenSSL cryptography library"
17          ;;
18libssl.pc)
19          NAME="OpenSSL"
20          LIBS="-lssl -lcrypto"
21          DESCRIPTION="Secure Sockets Layer and cryptography libraries"
22          ;;
23openssl.pc)
24          NAME="OpenSSL"
25          LIBS="-lssl -lcrypto"
26          DESCRIPTION="Sockets Layer and cryptography libraries and tools"
27          ;;
28*)
29          echo "$0: I don't know about $2" 1>&2
30          exit 1
31          ;;
32esac
33
34cat << EOF > "$2"
35# \$NetBSD: mkpc,v 1.6 2018/04/06 15:47:08 ryo Exp $
36prefix=/usr
37exec_prefix=/usr
38libdir=/usr/lib
39includedir=/usr/include
40
41Name: ${NAME}
42Description: ${DESCRIPTION}
43Version: ${VERSION}
44Requires: 
45Libs: ${LIBS}
46Libs.private:
47Cflags:
48EOF
49