freebsd-ports/net-im/imspector/files/patch-Makefile
Tijl Coosemans 216b5a285f - Fix missing library problems when the linker enforces explicit linking
PR:		192062
Exp-run by:	antoine
Approved by:	portmgr (antoine)
2014-08-26 14:06:08 +00:00

80 lines
2.9 KiB
Text

--- Makefile.orig 2010-02-23 14:20:33.000000000 -0300
+++ Makefile 2014-02-11 21:23:19.000000000 -0200
@@ -1,5 +1,5 @@
-DESTDIR = /
-PREFIX = /usr
+DESTDIR ?= /
+PREFIX ?= /usr
##########
# Comment this out if you dont want SSL
@@ -7,27 +7,27 @@
##########
# Location of openssl installation
-SSL_DIR = /usr
+SSL_DIR ?= /usr
##########
# If using FreeBSD or OpenBSD COMMENT the below lines
-LIBS = -ldl
+#LIBS = -ldl
# For any distro
#ADD_PLUGINS = mysqlloggingplugin.so sqliteloggingplugin.so postgresqlloggingplugin.so dbfilterplugin.so dbresponderplugin.so
##########
ifdef SSL
-SSL_LIBS = -L$(SSL_DIR)/lib -lssl
+SSL_LIBS = -L$(SSL_DIR)/lib -lssl -lcrypto
SSL_FLAGS = -I$(SSL_DIR)/include -DHAVE_SSL
SSL_OBJS = sslstate.o
endif
-CXX = g++
+CXX ?= g++
-CXXFLAGS = -Wall -O2 -fPIC $(SSL_FLAGS)
+CXXFLAGS ?= -Wall -O2 -fPIC $(SSL_FLAGS)
-PLUGIN_FLAGS = $(LIBS) -fPIC -shared -Wl,-soname,$@ -o $@
+PLUGIN_FLAGS ?= $(LIBS) -fPIC -shared -Wl,-soname,$@ -o $@
IMSPECTOR_OBJS = main.o protocolplugin.o loggingplugin.o filterplugin.o responderplugin.o $(SSL_OBJS)
@@ -54,7 +54,7 @@
msnprotocolplugin.so: msnprotocolplugin.o libimspector.so
$(CXX) msnprotocolplugin.o libimspector.so $(PLUGIN_FLAGS)
icqprotocolplugin.so: icqprotocolplugin.o libimspector.so
- $(CXX) icqprotocolplugin.o libimspector.so $(PLUGIN_FLAGS)
+ $(CXX) icqprotocolplugin.o libimspector.so $(PLUGIN_FLAGS) %%ICONV_LIB%% -L${LOCALBASE}/lib
yahooprotocolplugin.so: yahooprotocolplugin.o libimspector.so
$(CXX) yahooprotocolplugin.o libimspector.so $(PLUGIN_FLAGS)
ircprotocolplugin.so: ircprotocolplugin.o libimspector.so
@@ -162,17 +162,17 @@
install: imspector libimspector.so $(PLUGINS)
-mkdir -p $(DESTDIR)/$(PREFIX)/sbin
-mkdir -p $(DESTDIR)/$(PREFIX)/lib/imspector
- -install imspector $(DESTDIR)/$(PREFIX)/sbin/imspector
- -install libimspector.so $(DESTDIR)/$(PREFIX)/lib/libimspector.so
+ -${BSD_INSTALL_PROGRAM} imspector $(DESTDIR)/$(PREFIX)/sbin/imspector
+ -${BSD_INSTALL_PROGRAM} libimspector.so $(DESTDIR)/$(PREFIX)/lib/libimspector.so
-(for PLUGIN in $(PLUGINS) $(ADD_PLUGINS); do \
- install $$PLUGIN $(DESTDIR)/$(PREFIX)/lib/imspector/$$PLUGIN; \
+ ${BSD_INSTALL_PROGRAM} $$PLUGIN $(DESTDIR)/$(PREFIX)/lib/imspector/$$PLUGIN; \
done);
- -mkdir -p $(DESTDIR)/$(PREFIX)/etc/imspector
- -install imspector.conf $(DESTDIR)/$(PREFIX)/etc/imspector/imspector.conf
- -install badwords.txt $(DESTDIR)/$(PREFIX)/etc/imspector/badwords.txt
- -install acl.txt $(DESTDIR)/$(PREFIX)/etc/imspector/acl.txt
- -mkdir -p /var/log/imspector
- -mkdir -p /var/lib/imspector
+ -mkdir -p $(DESTDIR)/$(ETCDIR)
+ -${BSD_INSTALL_DATA} imspector.conf $(DESTDIR)/$(ETCDIR)/imspector.conf.sample
+ -${BSD_INSTALL_DATA} badwords.txt $(DESTDIR)/$(ETCDIR)/badwords.txt.sample
+ -${BSD_INSTALL_DATA} acl.txt $(DESTDIR)/$(ETCDIR)/acl.txt.sample
+ -mkdir -p $(DESTDIR)/var/log/imspector
+ -mkdir -p $(DESTDIR)/var/lib/imspector
install-cert:
-mkdir -p $(DESTDIR)/$(PREFIX)/etc/imspector