summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authorjoerg <joerg@pkgsrc.org>2014-06-11 12:57:22 +0000
committerjoerg <joerg@pkgsrc.org>2014-06-11 12:57:22 +0000
commit07e928a6e09e1e014ccb4429ea2947ff2e76bf56 (patch)
tree4ed7f4ab08f72c38eb95ccaa99f266a9ce6c04dc /mk
parent2c56d50b2b5f12d299c130fbbbddf320b1e0381c (diff)
downloadpkgsrc-07e928a6e09e1e014ccb4429ea2947ff2e76bf56.tar.gz
Move www/apache/module.mk to mk/apache.module.mk and adjust it to use
mk/apache.mk.
Diffstat (limited to 'mk')
-rw-r--r--mk/apache.module.mk54
1 files changed, 54 insertions, 0 deletions
diff --git a/mk/apache.module.mk b/mk/apache.module.mk
new file mode 100644
index 00000000000..b748bea7b6a
--- /dev/null
+++ b/mk/apache.module.mk
@@ -0,0 +1,54 @@
+# $NetBSD: apache.module.mk,v 1.1 2014/06/11 12:57:22 joerg Exp $
+#
+# This Makefile fragment is intended to be included by packages that build
+# and install apache modules.
+#
+# The following targets are provided by this file:
+#
+# do-build builds the module using APXS.
+#
+# do-install installs the module using APXS.
+#
+# The following variables may be set prior to including this file:
+#
+# APACHE_MODULE_NAME the name of this module, including the .so suffix.
+#
+# APACHE_MODULE_SRCDIR the location of the source files for this module,
+# defaults to WRKSRC.
+#
+# APACHE_MODULE_SRC the source files to be compiled for this
+# module, defaults to *.c.
+#
+
+.if !defined(_APACHE_MODULE_MK)
+_APACHE_MODULE_MK= # defined
+
+APACHE_MODULE= yes
+
+.include "../../mk/apache.mk"
+
+APACHE_MODULE_SRCDIR?= ${WRKSRC}
+APACHE_MODULE_SRC?= *.c
+APACHE_MODULE_DESTDIR= ${DESTDIR}${PREFIX}/lib/httpd
+
+.PHONY: apache-module-build
+apache-module-build:
+ ${RUN} \
+ cd ${APACHE_MODULE_SRCDIR} && \
+ ${SETENV} PATH=${PATH:Q} \
+ ${APXS} ${CPPFLAGS} ${LDFLAGS} \
+ -c -o ${APACHE_MODULE_NAME} ${APACHE_MODULE_SRC}
+
+do-build: apache-module-build
+
+.PHONY: apache-module-install
+apache-module-install:
+ ${INSTALL_LIB_DIR} ${APACHE_MODULE_DESTDIR}
+ ${PREFIX}/share/httpd/build/instdso.sh \
+ SH_LIBTOOL=${PREFIX}/share/httpd/build/libtool \
+ ${APACHE_MODULE_SRCDIR}/${APACHE_MODULE_NAME} \
+ ${APACHE_MODULE_DESTDIR}
+
+do-install: apache-module-install
+
+.endif # _APACHE_MODULE_MK