postgresql/contrib/pgcrypto/Makefile
Bruce Momjian cb5427ee47 I would like to do a interface change in pgcrypto. (Good
timing, I know :))  At the moment the digest() function returns
hexadecimal coded hash, but I want it to return pure binary.  I
have also included functions encode() and decode() which support
'base64' and 'hex' encodings, so if anyone needs digest() in hex
he can do encode(digest(...), 'hex').

Main reason for it is "to do one thing and do it well" :)

Another reason is if someone needs really lot of digesting, in
the end he wants to store the binary not the hexadecimal result.
It is really silly to convert it to hex then back to binary
again.  As I said if someone needs hex he can get it.

Well, and the real reason that I am doing encrypt()/decrypt()
functions and _they_ return binary.  For testing I like to see
it in hex occasionally, but it is really wrong to let them
return hex.  Only now it caught my eye that hex-coding in
digest() is wrong.  When doing digest() I thought about 'common
case' but hacking with psql is probably _not_ the common case :)

Marko Kreen
2001-01-24 03:46:16 +00:00

64 lines
1.5 KiB
Makefile

#
# $Header: /cvsroot/pgsql/contrib/pgcrypto/Makefile,v 1.2 2001/01/24 03:46:16 momjian Exp $
#
subdir = contrib/pgcrypto
top_builddir = ../..
include $(top_builddir)/src/Makefile.global
# either 'builtin', 'mhash', 'openssl', 'krb5'
cryptolib = builtin
##########################
ifeq ($(cryptolib), builtin)
SRCS= md5.c sha1.c internal.c
endif
ifeq ($(cryptolib), openssl)
cryptoinc := -I/usr/include/openssl
cryptolib := -lcrypto
SRCS = openssl.c
endif
ifeq ($(cryptolib), mhash)
cryptoinc=
cryptolib=-lmhash
SRCS=mhash.c
endif
ifeq ($(cryptolib), krb5)
cryptoinc=-I/usr/include
cryptolib=-ldes
SRCS=krb.c
endif
NAME := pgcrypto
SRCS += pgcrypto.c encode.c
OBJS := $(SRCS:.c=.o)
SO_MAJOR_VERSION = 0
SO_MINOR_VERSION = 1
override CPPFLAGS += -I$(srcdir) $(cryptoinc)
all: all-lib $(NAME).sql
include $(top_srcdir)/src/Makefile.shlib
$(NAME).sql: $(NAME).sql.in
sed 's,@MODULE_FILENAME@,$(libdir)/contrib/pgcrypto$(DLSUFFIX),g' $< >$@
install: all installdirs
$(INSTALL_SHLIB) $(shlib) $(DESTDIR)$(libdir)/contrib/pgcrypto$(DLSUFFIX)
$(INSTALL_DATA) $(NAME).sql $(DESTDIR)$(datadir)/contrib/$(NAME).sql
$(INSTALL_DATA) README.$(NAME) $(DESTDIR)$(docdir)/contrib/README.$(NAME)
installdirs:
$(mkinstalldirs) $(libdir)/contrib $(datadir)/contrib $(docdir)/contrib
uninstall: uninstall-lib
rm -f $(DESTDIR)$(libdir)/contrib/pgcrypto$(DLSUFFIX) $(datadir)/contrib/$(NAME).sql $(docdir)/contrib/README.$(NAME)
clean distclean maintainer-clean: clean-lib
rm -f $(OBJS) $(NAME).sql