mirror of
https://github.com/matrix-construct/construct
synced 2024-11-14 14:01:08 +01:00
Add explicit support for being installed into a system triggered with --enable-fhs-paths.
Add two mechanism for avoiding name-collisions in a system-wide installation of charybdis. The ssld and bandb daemons, intended to be directly used by ircd and not the user, install into libexec when --enable-fhs-paths is set. For binaries which are meant to be in PATH (bindir), such as ircd and viconf, there is now an option --with-program-prefix=progprefix inspired by automake. If the user specifies --with-program-prefix=charybdis, the ircd binary is named charybdisircd when installed. Add support for saving the pidfile to a rundir and storing the ban database in localstatedir instead of in sysconfdir. This is, again, conditional on --enable-fhs-paths. Fix(?) genssl.sh to always write created SSL key/certificate/dh parameters to the sysconfdir specified during ./configure. The previous behavior was to assume that the user ran genssl.sh after ensuring that his current working directory was either sysconfdir or a sibling directory of sysconfdir.
This commit is contained in:
parent
f2ee5e6219
commit
c74836dc4a
19 changed files with 233 additions and 93 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -34,6 +34,7 @@ src/y.tab.c
|
|||
ssld/ssld
|
||||
tools/convertilines
|
||||
tools/convertklines
|
||||
tools/genssl.sh
|
||||
tools/mkpasswd
|
||||
tools/viconf
|
||||
include/serno.h
|
||||
|
|
25
Makefile.in
25
Makefile.in
|
@ -24,10 +24,17 @@ prefix = @prefix@
|
|||
exec_prefix = @exec_prefix@
|
||||
bindir = @bindir@
|
||||
mandir = @mandir@
|
||||
libdir = @libdir@
|
||||
pkglibdir = @pkglibdir@
|
||||
moduledir = @moduledir@
|
||||
helpdir = @helpdir@
|
||||
confdir = @confdir@
|
||||
logdir = @logdir@
|
||||
rundir = @rundir@
|
||||
pkgrundir = @pkgrundir@
|
||||
localstatedir = @localstatedir@
|
||||
pkglocalstatedir= @pkglocalstatedir@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
|
||||
# Default CFLAGS
|
||||
# CFLAGS = -g -O2 -DNDEBUG
|
||||
|
@ -118,21 +125,27 @@ lint:
|
|||
install-mkdirs:
|
||||
@echo "ircd: setting up ircd directory structure"
|
||||
-@if test ! -d $(DESTDIR)$(prefix); then \
|
||||
mkdir $(DESTDIR)$(prefix); \
|
||||
mkdir -p -m 755 $(DESTDIR)$(prefix); \
|
||||
fi
|
||||
-@if test ! -d $(DESTDIR)$(bindir); then \
|
||||
mkdir $(DESTDIR)$(bindir); \
|
||||
mkdir -p -m 755 $(DESTDIR)$(bindir); \
|
||||
fi
|
||||
-@if test ! -d $(DESTDIR)$(confdir); then \
|
||||
mkdir $(DESTDIR)$(confdir); \
|
||||
mkdir -p -m 755 $(DESTDIR)$(confdir); \
|
||||
fi
|
||||
-@if test ! -d $(DESTDIR)$(mandir); then \
|
||||
mkdir $(DESTDIR)$(mandir); \
|
||||
mkdir -p -m 755 $(DESTDIR)$(mandir); \
|
||||
fi
|
||||
-@if test ! -d $(DESTDIR)$(logdir); then \
|
||||
mkdir $(DESTDIR)$(logdir); \
|
||||
mkdir -p -m 755 $(DESTDIR)$(logdir); \
|
||||
fi
|
||||
|
||||
-@if test ! -d '$(DESTDIR)$(pkgrundir)'; then \
|
||||
mkdir -p -m 755 '$(DESTDIR)$(pkgrundir)'; \
|
||||
fi
|
||||
-@if test ! -d '$(DESTDIR)$(pkglocalstatedir)'; then \
|
||||
mkdir -p -m 755 '$(DESTDIR)$(pkglocalstatedir)'; \
|
||||
fi
|
||||
|
||||
install: install-mkdirs all
|
||||
@for i in $(SUBDIRS); do \
|
||||
echo "install ==> $$i";\
|
||||
|
|
8
aclocal.m4
vendored
8
aclocal.m4
vendored
|
@ -2,8 +2,12 @@
|
|||
AC_DEFUN([AC_DEFINE_DIR], [
|
||||
test "x$prefix" = xNONE && prefix="$ac_default_prefix"
|
||||
test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
|
||||
ac_define_dir=`eval echo [$]$2`
|
||||
ac_define_dir=`eval echo [$]ac_define_dir`
|
||||
last_ac_define_dir=`eval echo [$]$2`
|
||||
ac_define_dir=`eval echo [$]last_ac_define_dir`
|
||||
while test "x[$]last_ac_define_dir" != "x[$]ac_define_dir"; do
|
||||
last_ac_define_dir="[$]ac_define_dir"
|
||||
ac_define_dir=`eval echo [$]last_ac_define_dir`
|
||||
done
|
||||
$1="$ac_define_dir"
|
||||
AC_SUBST($1)
|
||||
ifelse($3, ,
|
||||
|
|
|
@ -22,8 +22,12 @@ exec_prefix = @exec_prefix@
|
|||
bindir = @bindir@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
pkglibexecdir = @pkglibexecdir@
|
||||
confdir = @confdir@
|
||||
localstatedir = @localstatedir@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
|
||||
PROGRAM_PREFIX = @PROGRAM_PREFIX@
|
||||
|
||||
ZIP_LIB = @ZLIB_LD@
|
||||
|
||||
|
@ -34,7 +38,9 @@ CPPFLAGS = ${INCLUDES} @CPPFLAGS@
|
|||
|
||||
CFLAGS += -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION=1
|
||||
|
||||
PROGS = bandb bantool
|
||||
pkglibexec_PROGS = bandb
|
||||
bin_PROGS = bantool
|
||||
PROGS = $(pkglibexec_PROGS) $(bin_PROGS)
|
||||
|
||||
BANDB_SOURCES = \
|
||||
bandb.c \
|
||||
|
@ -64,12 +70,18 @@ bantool: ${BANTOOL_OBJECTS}
|
|||
|
||||
install: build
|
||||
@echo "ircd: installing bandb ($(PROGS))"
|
||||
@for i in $(PROGS); do \
|
||||
if test -f $(DESTDIR)$(bindir)/$$i; then \
|
||||
$(MV) $(DESTDIR)$(bindir)/$$i $(DESTDIR)$(bindir)/$$i.old; \
|
||||
@for i in $(bin_PROGS); do \
|
||||
if test -f $(DESTDIR)$(bindir)/$(PROGRAM_PREFIX)$$i; then \
|
||||
$(MV) $(DESTDIR)$(bindir)/$(PROGRAM_PREFIX)$$i $(DESTDIR)$(bindir)/$(PROGRAM_PREFIX)$$i.old; \
|
||||
fi; \
|
||||
$(INSTALL_BIN) $$i $(DESTDIR)$(bindir); \
|
||||
$(INSTALL_BIN) $$i $(DESTDIR)$(bindir)/$(PROGRAM_PREFIX)$$i; \
|
||||
done
|
||||
@for i in $(pkglibexec_PROGS); do \
|
||||
if test -f '$(DESTDIR)$(pkglibexecdir)/'$$i; then \
|
||||
$(MV) '$(DESTDIR)$(pkglibexecdir)/'$$i '$(DESTDIR)$(pkglibexecdir)/'$$i.old; \
|
||||
fi; \
|
||||
$(INSTALL_BIN) $$i '$(DESTDIR)$(pkglibexecdir)/'$$i; \
|
||||
done
|
||||
|
||||
.c.o:
|
||||
${CC} ${CPPFLAGS} ${CFLAGS} -c $<
|
||||
|
|
112
configure.ac
112
configure.ac
|
@ -225,12 +225,37 @@ if test "$LEX" = ":"; then
|
|||
AC_MSG_ERROR([could not locate a suitable lexical generator, install flex or lex.])
|
||||
fi
|
||||
|
||||
AC_ARG_ENABLE([fhs-paths],
|
||||
[AS_HELP_STRING([--enable-fhs-paths], [User more FHS-like pathnames (for packagers).])],
|
||||
[],
|
||||
[dnl detect if the user appears to want --enable-fhs-paths
|
||||
AS_IF([test "$libexecdir" = '${exec_prefix}/libexec' && \
|
||||
test "$localstatedir" = '${prefix}/var' && \
|
||||
test "$libdir" = '${exec_prefix}/lib'],
|
||||
[enable_fhs_paths=no],
|
||||
[enable_fhs_paths=yes])
|
||||
])
|
||||
dnl use directory structure of cached as default (hack)
|
||||
if test "$libexecdir" = '${exec_prefix}/libexec' &&
|
||||
test "$localstatedir" = '${prefix}/var'; then
|
||||
libexecdir='${bindir}'
|
||||
AS_IF([test "x$enable_fhs_paths" = "xyes"],
|
||||
[dnl Avoid name collisions.
|
||||
pkglibexecdir='${libexecdir}/${PACKAGE_TARNAME}'
|
||||
rundir=${rundir-'${prefix}/run'}
|
||||
pkgrundir='${rundir}/${PACKAGE_TARNAME}'
|
||||
pkglocalstatedir='${localstatedir}/${PACKAGE_TARNAME}'],
|
||||
[libexecdir='${bindir}'
|
||||
pkglibexecdir='${libexecdir}'
|
||||
rundir='${sysconfdir}'
|
||||
pkgrundir='${rundir}'
|
||||
localstatedir='${prefix}'
|
||||
fi
|
||||
pkglocalstatedir='${sysconfdir}'])
|
||||
pkglibdir='${libdir}/${PACKAGE_TARNAME}'
|
||||
AC_SUBST([pkglibdir])
|
||||
AC_SUBST([rundir])
|
||||
AC_SUBST([pkgrundir])
|
||||
AC_SUBST([pkglocalstatedir])
|
||||
AC_DEFINE_DIR([PKGLOCALSTATEDIR], [pkglocalstatedir], [[Directory in which to store state, such as band database]])
|
||||
AC_SUBST([pkglibexecdir])
|
||||
AC_DEFINE_DIR([PKGLIBEXECDIR], [pkglibexecdir], [Directory where binaries the IRCd itself spawns live])
|
||||
|
||||
dnl Checks for header files.
|
||||
AC_HEADER_STDC
|
||||
|
@ -595,7 +620,7 @@ AC_HELP_STRING([--with-confdir=DIR],
|
|||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE_DIR(ETC_DIR, confdir, [Prefix where config files are installed.])
|
||||
AC_SUBST_DIR([confdir]) ],
|
||||
[ confdir='${prefix}/etc'
|
||||
[ confdir='${sysconfdir}'
|
||||
AC_MSG_RESULT(no)
|
||||
AC_DEFINE_DIR(ETC_DIR, confdir, [Prefix where config files are installed.])
|
||||
AC_SUBST_DIR([confdir])]
|
||||
|
@ -610,14 +635,13 @@ AC_ARG_WITH(logdir,
|
|||
AC_HELP_STRING([--with-logdir=DIR],
|
||||
[Directory where to write logfiles.]),
|
||||
[ logdir=`echo $withval | sed 's/\/$//'`
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE_DIR(LOG_DIR, logdir, [Prefix where to write logfiles.])
|
||||
AC_SUBST_DIR([logdir]) ],
|
||||
[ logdir='${prefix}/logs'
|
||||
AC_MSG_RESULT(no)
|
||||
AC_DEFINE_DIR(LOG_DIR, logdir, [Prefix where to write logfiles.])
|
||||
AC_SUBST_DIR([logdir])]
|
||||
)
|
||||
AC_MSG_RESULT(yes)],
|
||||
[ AS_IF([test "x$enable_fhs_paths" = "xyes"],
|
||||
[logdir='${localstatedir}/log/${PACKAGE_TARNAME}'],
|
||||
[logdir='${prefix}/logs'])
|
||||
AC_MSG_RESULT(no)])
|
||||
AC_DEFINE_DIR([LOG_DIR], [logdir], [Prefix where to write logfiles.])
|
||||
AC_SUBST_DIR([logdir])
|
||||
|
||||
dnl **********************************************************************
|
||||
dnl Check for --with-helpdir
|
||||
|
@ -628,14 +652,13 @@ AC_ARG_WITH(helpdir,
|
|||
AC_HELP_STRING([--with-helpdir=DIR],
|
||||
[Directory to install help files.]),
|
||||
[ helpdir=`echo $withval | sed 's/\/$//'`
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE_DIR(HELP_DIR, helpdir, [Prefix where help files are installed.])
|
||||
AC_SUBST_DIR([helpdir]) ],
|
||||
[ helpdir='${prefix}/help'
|
||||
AC_MSG_RESULT(no)
|
||||
AC_DEFINE_DIR(HELP_DIR, helpdir, [Prefix where help file are installed.])
|
||||
AC_SUBST_DIR([helpdir])]
|
||||
)
|
||||
AC_MSG_RESULT(yes) ],
|
||||
[ AS_IF([test "x$enable_fhs_paths" = "xyes"],
|
||||
[helpdir='${datadir}/${PACKAGE_TARNAME}/help'],
|
||||
[helpdir='${prefix}/help'])
|
||||
AC_MSG_RESULT(no) ])
|
||||
AC_DEFINE_DIR([HELP_DIR], [helpdir], [Prefix where help files are installed.])
|
||||
AC_SUBST_DIR([helpdir])
|
||||
|
||||
dnl **********************************************************************
|
||||
dnl Check for --with-moduledir
|
||||
|
@ -643,17 +666,44 @@ dnl **********************************************************************
|
|||
|
||||
AC_MSG_CHECKING([whether to modify moduledir])
|
||||
AC_ARG_WITH(moduledir,
|
||||
AC_HELP_STRING([--with-moduledir=DIR],
|
||||
[Directory to install modules.]),
|
||||
[AC_HELP_STRING([--with-moduledir=DIR],
|
||||
[Directory to install modules.])],
|
||||
[ moduledir=`echo $withval | sed 's/\/$//'`
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE_DIR(MODULE_DIR, moduledir, [Prefix where modules are installed.])
|
||||
AC_SUBST_DIR([moduledir]) ],
|
||||
[ moduledir='${prefix}/modules'
|
||||
AC_MSG_RESULT(yes)],
|
||||
[ AS_IF([test "x$enable_fhs_paths" = "xyes"],
|
||||
[moduledir='${pkglibdir}/modules'],
|
||||
[moduledir='${prefix}/modules'])
|
||||
AC_MSG_RESULT(no)
|
||||
AC_DEFINE_DIR(MODULE_DIR, moduledir, [Prefix where modules are installed.])
|
||||
AC_SUBST_DIR([moduledir])]
|
||||
)
|
||||
])
|
||||
AC_DEFINE_DIR(MODULE_DIR, moduledir, [Prefix where modules are installed.])
|
||||
AC_SUBST_DIR([moduledir])
|
||||
|
||||
dnl Check for --with-rundir
|
||||
|
||||
AC_MSG_CHECKING([whether or modify rundir])
|
||||
AC_ARG_WITH([rundir],
|
||||
[AC_HELP_STRING([--with-rundir=DIR],
|
||||
[Directory in which to store pidfile.])],
|
||||
[AC_MSG_RESULT([yes])
|
||||
rundir=`echo $withval | sed 's/\/$//'`],
|
||||
[AC_MSG_RESULT([no])
|
||||
AS_IF([test "x$enable_fhs_paths" = "xyes"],
|
||||
[rundir='${prefix}/run'],
|
||||
[rundir='${sysconfdir}'])])
|
||||
AC_SUBST([rundir])
|
||||
AC_DEFINE_DIR([PKGRUNDIR], [pkgrundir], [Directory to store pidfile in.])
|
||||
|
||||
dnl Installed utility program prefixes (does not affect binaries
|
||||
dnl installed into pkglibexecdir)
|
||||
AC_MSG_CHECKING([for program prefix])
|
||||
AC_ARG_WITH([program-prefix],
|
||||
[AS_HELP_STRING([--with-program-prefix=], [If set, programs installed into PATH will be installed with names prefixed by this prefix.])],
|
||||
[test "x$with_program_prefix" = "xno" && with_program_prefix=],
|
||||
[with_program_prefix=])
|
||||
AC_MSG_RESULT(["$with_program_prefix"])
|
||||
PROGRAM_PREFIX="$with_program_prefix"
|
||||
AC_SUBST([PROGRAM_PREFIX])
|
||||
AC_DEFINE_UNQUOTED([PROGRAM_PREFIX], ["$with_program_prefix"], [String with which all programs intended to be in PATH are prefixed.])
|
||||
|
||||
dnl **********************************************************************
|
||||
dnl Branding
|
||||
|
@ -1197,9 +1247,11 @@ AC_CONFIG_FILES( \
|
|||
src/Makefile \
|
||||
modules/Makefile \
|
||||
tools/Makefile \
|
||||
tools/genssl.sh \
|
||||
doc/Makefile \
|
||||
help/Makefile \
|
||||
)
|
||||
AC_CONFIG_COMMANDS([tools/genssl.sh_chmod], [chmod 755 tools/genssl.sh])
|
||||
|
||||
AC_OUTPUT
|
||||
|
||||
|
|
|
@ -15,6 +15,8 @@ RM = @RM@
|
|||
CP = @CP@
|
||||
TOUCH = @TOUCH@
|
||||
|
||||
PROGRAM_PREFIX = @PROGRAM_PREFIX@
|
||||
|
||||
prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
exec_suffix = @exec_suffix@
|
||||
|
@ -73,8 +75,8 @@ install: install-mkdirs build
|
|||
|
||||
@echo "ircd: installing manpage"
|
||||
@for i in $(MANPAGES); do \
|
||||
if test ! -f $(DESTDIR)$(mandir)/$$i; then \
|
||||
$(INSTALL_DATA) $$i $(DESTDIR)$(mandir); \
|
||||
if test ! -f $(DESTDIR)$(mandir)/$(PROGRAM_PREFIX)$$i; then \
|
||||
$(INSTALL_DATA) $$i $(DESTDIR)$(mandir)/$(PROGRAM_PREFIX)$$i; \
|
||||
fi; \
|
||||
done
|
||||
|
||||
|
|
|
@ -16,7 +16,14 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
|||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_SUID = @INSTALL_PROGRAM@ -o root -m 4755
|
||||
SHELL = /bin/sh
|
||||
AUTOMODULEDIR = @moduledir@/extensions
|
||||
|
||||
prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
libdir = @libdir@
|
||||
pkglibdir = @pkglibdir@
|
||||
moduledir = @moduledir@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
AUTOMODULEDIR = $(moduledir)/extensions
|
||||
|
||||
SSL_LIBS = @SSL_LIBS@
|
||||
SSL_INCLUDES = @SSL_INCLUDES@
|
||||
|
|
|
@ -7,7 +7,9 @@ INSTALL_DATA= @INSTALL_DATA@
|
|||
RM= @RM@
|
||||
|
||||
prefix= @prefix@
|
||||
exec_prefix= @execprefix@
|
||||
exec_prefix= @exec_prefix@
|
||||
datarootdir = @datarootdir@
|
||||
datadir = @datadir@
|
||||
helpdir= @helpdir@
|
||||
uhelpdir= ${helpdir}/users
|
||||
ohelpdir= ${helpdir}/opers
|
||||
|
|
|
@ -59,14 +59,13 @@
|
|||
#define HPATH HELP_DIR "/opers"
|
||||
|
||||
/* files */
|
||||
#define SPATH BINPATH "/ircd" /* ircd executable */
|
||||
#define LIPATH LIBPATH "/libircd" SHARED_SUFFIX /* ircd library */
|
||||
#define SPATH BINPATH "/" PROGRAM_PREFIX "ircd" /* ircd executable */
|
||||
#define CPATH ETCPATH "/ircd.conf" /* ircd.conf file */
|
||||
#define MPATH ETCPATH "/ircd.motd" /* MOTD file */
|
||||
#define LPATH LOGPATH "/ircd.log" /* ircd logfile */
|
||||
#define PPATH ETCPATH "/ircd.pid" /* pid file */
|
||||
#define PPATH PKGRUNDIR "/ircd.pid" /* pid file */
|
||||
#define OPATH ETCPATH "/opers.motd" /* oper MOTD file */
|
||||
#define DBPATH ETCPATH "/ban.db" /* bandb file */
|
||||
#define DBPATH PKGLOCALSTATEDIR "/ban.db" /* bandb file */
|
||||
|
||||
/* IGNORE_BOGUS_TS
|
||||
* Ignore bogus timestamps from other servers. Yes this will desync
|
||||
|
|
|
@ -2,8 +2,12 @@
|
|||
AC_DEFUN([AC_DEFINE_DIR], [
|
||||
test "x$prefix" = xNONE && prefix="$ac_default_prefix"
|
||||
test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
|
||||
ac_define_dir=`eval echo [$]$2`
|
||||
ac_define_dir=`eval echo [$]ac_define_dir`
|
||||
last_ac_define_dir=`eval echo [$]$2`
|
||||
ac_define_dir=`eval echo [$]last_ac_define_dir`
|
||||
while test "x[$]last_ac_define_dir" != "x[$]ac_define_dir"; do
|
||||
last_ac_define_dir="[$]ac_define_dir"
|
||||
ac_define_dir=`eval echo [$]last_ac_define_dir`
|
||||
done
|
||||
$1="$ac_define_dir"
|
||||
AC_SUBST($1)
|
||||
ifelse($3, ,
|
||||
|
|
|
@ -28,7 +28,11 @@ SSL_INCLUDES = @SSL_INCLUDES@
|
|||
IRCDLIBS = @LIBS@ $(SSL_LIBS)
|
||||
|
||||
prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
libdir = @libdir@
|
||||
pkglibdir = @pkglibdir@
|
||||
moduledir = @moduledir@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
# Change this later! -- adrian
|
||||
automoduledir = @moduledir@/autoload
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ RM = @RM@
|
|||
LEX = @LEX@
|
||||
LEXLIB = @LEXLIB@
|
||||
PICFLAGS = @PICFLAGS@
|
||||
CFLAGS = @IRC_CFLAGS@ -DIRCD_PREFIX=\"@prefix@\"
|
||||
CFLAGS = @IRC_CFLAGS@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
MKDEP = @MKDEP@ -DIRCD_PREFIX=\"@prefix@\"
|
||||
MV = @MV@
|
||||
|
@ -23,6 +23,9 @@ exec_prefix = @exec_prefix@
|
|||
bindir = @bindir@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
pkglibexecdir = @pkglibexecdir@
|
||||
|
||||
PROGRAM_PREFIX = @PROGRAM_PREFIX@
|
||||
|
||||
DOLLAR = $$
|
||||
|
||||
|
@ -36,7 +39,7 @@ SSL_INCLUDES = @SSL_INCLUDES@
|
|||
IRCDLIBS = @MODULES_LIBS@ -L../libratbox/src/.libs -lratbox @LIBS@ $(SSL_LIBS)
|
||||
|
||||
INCLUDES = -I../include -I../libratbox/include $(SSL_INCLUDES)
|
||||
CPPFLAGS = ${INCLUDES} @CPPFLAGS@
|
||||
CPPFLAGS = ${INCLUDES} -DIRCD_PREFIX=\"@prefix@\" @CPPFLAGS@
|
||||
|
||||
default: all
|
||||
|
||||
|
@ -133,10 +136,10 @@ install: install-mkdirs build
|
|||
fi
|
||||
@echo "ircd: installing ircd ($(PROGS))"
|
||||
@for i in $(PROGS); do \
|
||||
if test -f $(DESTDIR)$(bindir)/$$i; then \
|
||||
$(MV) $(DESTDIR)$(bindir)/$$i $(DESTDIR)$(bindir)/$$i.old; \
|
||||
if test -f $(DESTDIR)$(bindir)/$(PROGRAM_PREFIX)$$i; then \
|
||||
$(MV) $(DESTDIR)$(bindir)/$(PROGRAM_PREFIX)$$i $(DESTDIR)$(bindir)/$(PROGRAM_PREFIX)$$i.old; \
|
||||
fi; \
|
||||
$(INSTALL_BIN) $$i $(DESTDIR)$(bindir); \
|
||||
$(INSTALL_BIN) $$i $(DESTDIR)$(bindir)/$(PROGRAM_PREFIX)$$i; \
|
||||
done
|
||||
|
||||
version.c: version.c.SH
|
||||
|
|
|
@ -85,7 +85,7 @@ start_bandb(void)
|
|||
rb_setenv("BANDB_DPATH", ConfigFileEntry.dpath, 1);
|
||||
if(bandb_path == NULL)
|
||||
{
|
||||
rb_snprintf(fullpath, sizeof(fullpath), "%s/bandb%s", BINPATH, suffix);
|
||||
rb_snprintf(fullpath, sizeof(fullpath), "%s/bandb%s", PKGLIBEXECDIR, suffix);
|
||||
|
||||
if(access(fullpath, X_OK) == -1)
|
||||
{
|
||||
|
@ -95,8 +95,8 @@ start_bandb(void)
|
|||
if(access(fullpath, X_OK) == -1)
|
||||
{
|
||||
ilog(L_MAIN,
|
||||
"Unable to execute bandb in %s or %s/bin",
|
||||
BINPATH, ConfigFileEntry.dpath);
|
||||
"Unable to execute bandb%s in %s or %s/bin",
|
||||
suffix, PKGLIBEXECDIR, ConfigFileEntry.dpath);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -261,7 +261,7 @@ start_ssldaemon(int count, const char *ssl_cert, const char *ssl_private_key, co
|
|||
|
||||
if(ssld_path == NULL)
|
||||
{
|
||||
rb_snprintf(fullpath, sizeof(fullpath), "%s/ssld%s", BINPATH, suffix);
|
||||
rb_snprintf(fullpath, sizeof(fullpath), "%s/ssld%s", PKGLIBEXECDIR, suffix);
|
||||
|
||||
if(access(fullpath, X_OK) == -1)
|
||||
{
|
||||
|
@ -270,8 +270,8 @@ start_ssldaemon(int count, const char *ssl_cert, const char *ssl_private_key, co
|
|||
if(access(fullpath, X_OK) == -1)
|
||||
{
|
||||
ilog(L_MAIN,
|
||||
"Unable to execute ssld%s in %s/bin or %s",
|
||||
ConfigFileEntry.dpath, suffix, BINPATH);
|
||||
"Unable to execute ssld%s in %s or %s/bin",
|
||||
suffix, PKGLIBEXECDIR, ConfigFileEntry.dpath);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,8 +22,12 @@ exec_prefix = @exec_prefix@
|
|||
bindir = @bindir@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
pkglibexecdir = @pkglibexecdir@
|
||||
confdir = @confdir@
|
||||
localstatedir = @localstatedir@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
|
||||
PROGRAM_PREFIX = @PROGRAM_PREFIX@
|
||||
|
||||
ZIP_LIB = @ZLIB_LD@
|
||||
|
||||
|
@ -32,7 +36,8 @@ IRCDLIBS = @MODULES_LIBS@ -L../libratbox/src/.libs -lratbox @LIBS@ $(SSL_LIBS) $
|
|||
INCLUDES = -I. -I../include -I../libratbox/include $(SSL_INCLUDES)
|
||||
CPPFLAGS = ${INCLUDES} @CPPFLAGS@
|
||||
|
||||
PROGS = ssld
|
||||
pkglibexec_PROGS = ssld
|
||||
PROGS = $(pkglibexec_PROGS)
|
||||
|
||||
SOURCES = \
|
||||
ssld.c
|
||||
|
@ -47,14 +52,27 @@ build: all
|
|||
ssld: ${OBJECTS}
|
||||
${CC} ${CFLAGS} ${LDFLAGS} -o $@ ${OBJECTS} ${IRCDLIBS}
|
||||
|
||||
install: build
|
||||
install-mkdirs:
|
||||
-@for dir in '$(bindir)' '$(pkglibexecdir)'; do \
|
||||
if test ! -d '$(DESTDIR)'"$${dir}"; then \
|
||||
mkdir -p -m 755 '$(DESTDIR)'"$${dir}"; \
|
||||
fi; \
|
||||
done
|
||||
|
||||
install: install-mkdirs build
|
||||
@echo "ircd: installing ssld ($(PROGS))"
|
||||
@for i in $(PROGS); do \
|
||||
@for i in $(bin_PROGS); do \
|
||||
if test -f $(DESTDIR)$(bindir)/$$i; then \
|
||||
$(MV) $(DESTDIR)$(bindir)/$$i $(DESTDIR)$(bindir)/$$i.old; \
|
||||
$(MV) $(DESTDIR)$(bindir)/$(PROGRAM_PREFIX)$$i $(DESTDIR)$(bindir)/$(PROGRAM_PREFIX)$$i.old; \
|
||||
fi; \
|
||||
$(INSTALL_BIN) $$i $(DESTDIR)$(bindir); \
|
||||
$(INSTALL_BIN) $$i $(DESTDIR)$(bindir)/$(PROGRAM_PREFIX)$$i; \
|
||||
done
|
||||
@for i in $(pkglibexec_PROGS); do \
|
||||
if test -f '$(DESTDIR)$(pkglibexecdir)/'$$i; then \
|
||||
$(MV) '$(DESTDIR)$(pkglibexecdir)/'$$i '$(DESTDIR)$(pkglibexecdir)/'$$i.old; \
|
||||
fi; \
|
||||
$(INSTALL_BIN) $$i '$(DESTDIR)$(pkglibexecdir)/'$$i; \
|
||||
done
|
||||
|
||||
.c.o:
|
||||
${CC} ${CPPFLAGS} ${CFLAGS} -c $<
|
||||
|
|
|
@ -15,6 +15,8 @@ MV = @MV@
|
|||
RM = @RM@
|
||||
LN = @LN@
|
||||
|
||||
PROGRAM_PREFIX = @PROGRAM_PREFIX@
|
||||
|
||||
IRCDLIBS = -L../libratbox/src/.libs -lratbox @LIBS@
|
||||
INCLUDES = -I../include -I../libratbox/include
|
||||
CPPFLAGS = ${INCLUDES} @CPPFLAGS@
|
||||
|
@ -45,13 +47,14 @@ convertilines: convertilines.c
|
|||
convertklines: convertklines.c
|
||||
$(CC) $(CFLAGS) $(LDFLAGS) $(INCLUDES) convertklines.c -o convertklines $(IRCDLIBS)
|
||||
|
||||
genssl.sh:
|
||||
genssl.sh: genssl.sh.in
|
||||
cd .. && ./config.status tools/genssl.sh && ./config.status tools/genssl.sh_chmod
|
||||
|
||||
clean:
|
||||
$(RM) -f encspeed viconf chkconf mkpasswd *~ core *.exe convertklines convertilines
|
||||
|
||||
distclean: clean
|
||||
$(RM) -f Makefile
|
||||
$(RM) -f genssl.sh Makefile
|
||||
|
||||
lint:
|
||||
lint -aacgprxhH $(CPPFLAGS) -DIRCD_PREFIX=\"@prefix@\" $(convertklines_SOURCES) $(mkpasswd_SOURCES) $(viconf_SOURCES) $(encspeed_SOURCES) >>../lint.out
|
||||
|
@ -91,11 +94,11 @@ install-mkdirs:
|
|||
install: install-mkdirs build
|
||||
@echo "ircd: installing tools ($(PROGS))"
|
||||
@for i in $(PROGS); do \
|
||||
if test -f $(DESTDIR)$(bindir)/$$i; then \
|
||||
$(MV) $(DESTDIR)$(bindir)/$$i $(DESTDIR)$(bindir)/$$i.old; \
|
||||
if test -f $(DESTDIR)$(bindir)/$(PROGRAM_PREFIX)$$i; then \
|
||||
$(MV) $(DESTDIR)$(bindir)/$(PROGRAM_PREFIX)$$i $(DESTDIR)$(bindir)/$(PROGRAM_PREFIX)$$i.old; \
|
||||
fi; \
|
||||
$(INSTALL_BIN) $$i $(DESTDIR)$(bindir); \
|
||||
$(INSTALL_BIN) $$i $(DESTDIR)$(bindir)/$(PROGRAM_PREFIX)$$i; \
|
||||
done; \
|
||||
$(RM) -f $(DESTDIR)$(bindir)/vimotd
|
||||
$(LN) $(DESTDIR)$(bindir)/viconf $(DESTDIR)$(bindir)/vimotd
|
||||
$(RM) -f $(DESTDIR)$(bindir)/$(PROGRAM_PREFIX)vimotd
|
||||
$(LN) $(DESTDIR)$(bindir)/$(PROGRAM_PREFIX)viconf $(DESTDIR)$(bindir)/$(PROGRAM_PREFIX)vimotd
|
||||
|
||||
|
|
|
@ -1,16 +0,0 @@
|
|||
#!/bin/sh
|
||||
echo "Generating self-signed certificate .. "
|
||||
openssl req -x509 -nodes -newkey rsa:1024 -keyout ../etc/ssl.key -out ../etc/ssl.cert
|
||||
|
||||
echo "Generating Diffie-Hellman file for secure SSL/TLS negotiation .. "
|
||||
openssl dhparam -out ../etc/dh.pem 1024
|
||||
|
||||
echo "
|
||||
Now change these lines in the IRCd config file:
|
||||
|
||||
ssl_private_key = "etc/ssl.key";
|
||||
ssl_cert = "etc/ssl.cert";
|
||||
ssl_dh_params = "etc/dh.pem";
|
||||
|
||||
Enjoy using ssl.
|
||||
"
|
29
tools/genssl.sh.in
Executable file
29
tools/genssl.sh.in
Executable file
|
@ -0,0 +1,29 @@
|
|||
#!/bin/sh
|
||||
prefix="@prefix@"
|
||||
exec_prefix="@exec_prefix@"
|
||||
sysconfdir="@sysconfdir@"
|
||||
|
||||
echo "Generating self-signed certificate .. "
|
||||
openssl req -x509 -nodes -newkey rsa:1024 -keyout "${sysconfdir}"/ssl.key -out "${sysconfdir}"/ssl.cert
|
||||
|
||||
echo "Generating Diffie-Hellman file for secure SSL/TLS negotiation .. "
|
||||
openssl dhparam -out "${sysconfdir}"/dh.pem 1024
|
||||
|
||||
# If sysconfdir is relative to prefix, make the path relative. I.e.,
|
||||
# prefix=/usr and sysconfdir=/etc -> relative_sysconfdir=/etc,
|
||||
# prefix=/home/binki/chary and sysconfdir=/home/binki/chary/etc ->
|
||||
# relative_sysconfdir=etc
|
||||
relative_sysconfdir="${sysconfdir#${prefix%/}/}"
|
||||
relative_sysconfdir="${relative_sysconfdir%/}"
|
||||
|
||||
cat <<EOF
|
||||
|
||||
|
||||
Now change these lines in the IRCd config file:
|
||||
|
||||
ssl_private_key = "${relative_sysconfdir}/ssl.key";
|
||||
ssl_cert = "${relative_sysconfdir}/ssl.cert";
|
||||
ssl_dh_params = "${relative_sysconfdir}/dh.pem";
|
||||
|
||||
Enjoy using ssl.
|
||||
EOF
|
|
@ -13,6 +13,9 @@
|
|||
#include <signal.h>
|
||||
#include "config.h"
|
||||
|
||||
#ifndef PROGRAM_PREFIX
|
||||
#define PROGRAM_PREFIX ""
|
||||
#endif
|
||||
|
||||
/* wait.h is in /include on solaris, likely on other SYSV machines as well
|
||||
* but wait.h is normally in /include/sys on BSD boxen,
|
||||
|
@ -45,7 +48,7 @@ int main(int argc, char *argv[])
|
|||
else
|
||||
p++;
|
||||
|
||||
if(strcmp(p, "vimotd") == 0)
|
||||
if(strcmp(p, PROGRAM_PREFIX "vimotd") == 0)
|
||||
filename = MPATH;
|
||||
|
||||
if(LockedFile(filename))
|
||||
|
|
Loading…
Reference in a new issue