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