mirror of
https://github.com/matrix-construct/construct
synced 2024-12-25 15:04:10 +01:00
Add datadir (share) configure, Makefile and ircd::fs related.
This commit is contained in:
parent
e1230f79ff
commit
8900c7d95e
5 changed files with 59 additions and 0 deletions
|
@ -4,6 +4,7 @@ ACLOCAL_AMFLAGS = -I m4
|
|||
SUBDIRS = include/ircd
|
||||
SUBDIRS += ircd
|
||||
SUBDIRS += modules
|
||||
SUBDIRS += share
|
||||
SUBDIRS += construct
|
||||
|
||||
.PHONY: subdirs $(SUBDIRS)
|
||||
|
|
34
configure.ac
34
configure.ac
|
@ -43,6 +43,7 @@ AC_CONFIG_FILES(\
|
|||
construct/Makefile \
|
||||
ircd/Makefile \
|
||||
modules/Makefile \
|
||||
share/Makefile \
|
||||
)
|
||||
|
||||
AM_INIT_AUTOMAKE([subdir-objects])
|
||||
|
@ -768,6 +769,21 @@ dnl
|
|||
RB_DEFINE_UNQUOTED([CONF_DIR], ["$(sysconfdir)"], [Prefix where config files are installed.])
|
||||
AC_SUBST_DIR([sysconfdir])
|
||||
|
||||
dnl
|
||||
dnl datarootdir
|
||||
dnl
|
||||
|
||||
dnl Avoid name collisions.
|
||||
RB_DEFINE_UNQUOTED([DATAROOT_DIR], ["$(datarootdir)"], [Prefix where read-only assets go])
|
||||
AC_SUBST_DIR([datarootdir])
|
||||
|
||||
dnl
|
||||
dnl datadir
|
||||
dnl
|
||||
|
||||
RB_DEFINE_UNQUOTED([DATA_DIR], ["$(datadir)/${PACKAGE_TARNAME}"], [Directory where read-only assets go.])
|
||||
AC_SUBST_DIR([datadir])
|
||||
|
||||
dnl
|
||||
dnl Check for --with-dbdir
|
||||
dnl
|
||||
|
@ -819,6 +835,24 @@ AC_ARG_WITH(moduledir, [AC_HELP_STRING([--with-moduledir=DIR], [Directory to ins
|
|||
RB_DEFINE_UNQUOTED([MODULE_DIR], ["$moduledir"], [Prefix where modules are installed.])
|
||||
AC_SUBST_DIR([moduledir])
|
||||
|
||||
dnl
|
||||
dnl Check for --with-webappdir
|
||||
dnl
|
||||
|
||||
AC_MSG_CHECKING([whether to modify webappdir])
|
||||
AC_ARG_WITH(webappdir, [AC_HELP_STRING([--with-webappdir=DIR], [Directory to install served assets])],
|
||||
[
|
||||
AC_MSG_RESULT(yes)
|
||||
webappdir=`echo $withval | sed 's/\/$//'`
|
||||
], [
|
||||
AC_MSG_RESULT(no)
|
||||
webappdir="${datadir}/webapp"
|
||||
])
|
||||
|
||||
RB_DEFINE_UNQUOTED([WEBAPP_DIR], ["$webappdir"], [Prefix where website assets are served from.])
|
||||
AC_SUBST_DIR([webappdir])
|
||||
|
||||
|
||||
dnl ***************************************************************************
|
||||
dnl
|
||||
dnl Third party
|
||||
|
|
|
@ -75,6 +75,7 @@ enum ircd::fs::index
|
|||
PREFIX,
|
||||
BIN,
|
||||
CONF,
|
||||
DATA,
|
||||
DB,
|
||||
LOG,
|
||||
MODULES,
|
||||
|
|
|
@ -75,6 +75,7 @@ ircd::fs::syspaths
|
|||
{ "installation prefix", RB_PREFIX },
|
||||
{ "binary directory", RB_BIN_DIR },
|
||||
{ "configuration directory", RB_CONF_DIR },
|
||||
{ "data directory", RB_DATA_DIR },
|
||||
{ "database directory", RB_DB_DIR },
|
||||
{ "log directory", RB_LOG_DIR },
|
||||
{ "module directory", RB_MODULE_DIR },
|
||||
|
|
22
share/Makefile.am
Normal file
22
share/Makefile.am
Normal file
|
@ -0,0 +1,22 @@
|
|||
################################################################################
|
||||
#
|
||||
# IRCd read-only data (share) assets.
|
||||
#
|
||||
|
||||
datadir = @datadir@/$(PACKAGE_TARNAME)
|
||||
data_DATA = share/
|
||||
|
||||
install-mkdirs:
|
||||
-@if test ! -d $(datadir); then \
|
||||
echo "mkdir -p $(datadir)"; \
|
||||
mkdir -p $(datadir); \
|
||||
fi
|
||||
|
||||
install: install-mkdirs
|
||||
@echo "ircd: installing shared assets"
|
||||
@for i in $(srcdir)/*; do \
|
||||
if [[ "$$i" != "./Makefile"* ]] && [[ "$$i" != "README.md" ]]; then \
|
||||
echo "installing $$i to $(DESTDIR)$(datadir)"; \
|
||||
cp -r $$i $(DESTDIR)$(datadir); \
|
||||
fi \
|
||||
done
|
Loading…
Reference in a new issue