ports/databases/redis62/files/patch-deps-hiredis-Makefile
Yasuhiro Kimura da202ea080 databases/redis{6,62}: Fix problem that pkg-message is misleading
When installing package of databases/redis62, following pkg-message is
displayed.

          To setup "redis62" you need to edit the configuration file:
          /usr/local/etc/redis62.conf

          To run redis from startup, add redis62_enable="YES"
          in your /etc/rc.conf.

But path of configuration file is /usr/local/etc/redis.conf and what
should really be added to /etc/rc.conf is redis_enable="YES". Same
problem also happens when installing databases/redis6

The source of the problem is that the value of ${PORTNAME} is used to
create pkg-message from file/pkg-message.in. So fix it by changing the
value of ${PORTNAME} to "redis" and set PKGNAMESUFFIX in Makefile of
each port.

While I'm here,

* Pet portlint and portclippy
* Tidy up Makefile with portfmt.

PR:		265623
Reported by:	FiLiS
MFH:		2022Q3
2022-08-07 14:30:30 +09:00

41 lines
1.4 KiB
Text

--- deps/hiredis/Makefile.orig 2021-01-12 14:21:03 UTC
+++ deps/hiredis/Makefile
@@ -21,7 +21,7 @@
HIREDIS_SONAME=$(shell grep HIREDIS_SONAME hiredis.h | awk '{print $$3}')
# Installation related variables and target
-PREFIX?=/usr/local
+PREFIX?=${PREFIX}
INCLUDE_PATH?=include/hiredis
LIBRARY_PATH?=lib
PKGCONF_PATH?=pkgconfig
@@ -44,10 +44,8 @@
# Fallback to gcc when $CC is not in $PATH.
CC:=$(shell sh -c 'type $${CC%% *} >/dev/null 2>/dev/null && echo $(CC) || echo gcc')
CXX:=$(shell sh -c 'type $${CXX%% *} >/dev/null 2>/dev/null && echo $(CXX) || echo g++')
-OPTIMIZATION?=-O3
WARNINGS=-Wall -W -Wstrict-prototypes -Wwrite-strings -Wno-missing-field-initializers
-DEBUG_FLAGS?= -g -ggdb
-REAL_CFLAGS=$(OPTIMIZATION) -fPIC $(CPPFLAGS) $(CFLAGS) $(WARNINGS) $(DEBUG_FLAGS)
+REAL_CFLAGS=$(OPTIMIZATION) -fPIC $(CFLAGS) $(WARNINGS) $(DEBUG_FLAGS)
REAL_LDFLAGS=$(LDFLAGS)
DYLIBSUFFIX=so
@@ -83,7 +81,16 @@
CFLAGS+=-I$(OPENSSL_PREFIX)/include
SSL_LDFLAGS+=-L$(OPENSSL_PREFIX)/lib -lssl -lcrypto
endif
-
+ifeq ($(uname_S),FreeBSD)
+ CFLAGS?=$(CFLAGS)
+ CCLINK?=pthread
+ LDFLAGS?=-L. -Wl,-rpath,.
+ DYLIBNAME?=libhiredis.so
+ DYLIB_MAKE_CMD?=$(CC) -o ${DYLIBNAME} ${OBJ}
+ STLIBNAME?=libhiredis.a
+ STLIB_MAKE_CMD?=ar rcs ${STLIBNAME} ${OBJ}
+ SSL_LDFLAGS+=${OPENSSL_LDFLAGS}
+endif
ifeq ($(uname_S),SunOS)
IS_SUN_CC=$(shell sh -c '$(CC) -V 2>&1 |egrep -i -c "sun|studio"')
ifeq ($(IS_SUN_CC),1)