diff --git a/irc/inspircd/Makefile b/irc/inspircd/Makefile index 5de3f46d3a0d..e6bad097cd8b 100644 --- a/irc/inspircd/Makefile +++ b/irc/inspircd/Makefile @@ -1,155 +1,155 @@ # Created by: Craig Edwards # $FreeBSD$ PORTNAME= inspircd PORTVERSION= 2.0.18 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= irc MAINTAINER= feld@FreeBSD.org COMMENT= Modular C++ IRC daemon LICENSE= GPLv2 CONFLICTS= inspircd-1.* USE_GITHUB= yes GH_ACCOUNT= inspircd GH_PROJECT= ${GH_ACCOUNT} GH_TAGNAME= v${PORTVERSION} GH_COMMIT= c99a439 USE_RC_SUBR= ${PORTNAME} MAKEFILE= BSDmakefile USERS= ircd GROUPS= ircd INSPIRCD_UID= 72 INSPIRCD_RUN?= /var/run/${PORTNAME} INSPIRCD_LOG?= /var/log/${PORTNAME}/ircd.log SUB_LIST+= PORTNAME=${PORTNAME} \ INSPIRCD_LOG=${INSPIRCD_LOG} \ INSPIRCD_RUN=${INSPIRCD_RUN} \ USERS=${USERS} \ GROUPS=${GROUPS} # Configure script is written in perl USES= cpe perl5 USE_PERL5= build CPE_VENDOR= inspire_ircd CPE_PRODUCT= inspircd HAS_CONFIGURE= yes CONFIGURE_ARGS= --with-cc=${CXX} --config-dir=${ETCDIR} \ --module-dir=${PREFIX}/lib/${PORTNAME}/modules \ --prefix=${PREFIX}/lib/${PORTNAME} \ --binary-dir=${PREFIX}/bin --library-dir=${PREFIX}/lib/${PORTNAME} \ --log-dir=${INSPIRCD_LOG} --data-dir=/var/db/inspircd \ --enable-kqueue --disable-interactive \ --uid=${INSPIRCD_UID} OPTIONS_DEFINE= MYSQL PGSQL SQLITE LDAPAUTH LDAPOPER GNUTLS OPENSSL PCRE POSIX OPTIONS_DEFAULT= OPENSSL POSIX GNUTLS_DESC= Build m_ssl_gnutls module LDAPAUTH_DESC= Build m_ldapauth module LDAPOPER_DESC= Build m_ldapoper module MYSQL_DESC= Build m_mysql module OPENSSL_DESC= Build m_ssl_openssl module PGSQL_DESC= Build m_pgsql module SQLITE_DESC= Build m_sqlite3 module PCRE_DESC= Build m_regex_pcre module POSIX_DESC= Build m_regex_posix module .include .if ${PORT_OPTIONS:MLDAPAUTH} USE_OPENLDAP= yes EXTRAS:=${EXTRAS},m_ldapauth.cpp PLIST_SUB+= LDAPAUTH="" .else PLIST_SUB+= LDAPAUTH="@comment " .endif .if ${PORT_OPTIONS:MLDAPOPER} USE_OPENLDAP= yes EXTRAS:=${EXTRAS},m_ldapoper.cpp PLIST_SUB+= LDAPOPER="" .else PLIST_SUB+= LDAPOPER="@comment " .endif .if ${PORT_OPTIONS:MMYSQL} USE_MYSQL= yes EXTRAS:=${EXTRAS},m_mysql.cpp PLIST_SUB+= MYSQL="" .else PLIST_SUB+= MYSQL="@comment " .endif .if ${PORT_OPTIONS:MPGSQL} USES+= pgsql EXTRAS:=${EXTRAS},m_pgsql.cpp PLIST_SUB+= PGSQL="" .else PLIST_SUB+= PGSQL="@comment " .endif .if ${PORT_OPTIONS:MSQLITE} USES+= pkgconfig USE_SQLITE= 3 EXTRAS:=${EXTRAS},m_sqlite3.cpp PLIST_SUB+= SQLITE="" .else PLIST_SUB+= SQLITE="@comment " .endif .if ${PORT_OPTIONS:MGNUTLS} USES+= pkgconfig LIB_DEPENDS+= libgnutls.so:${PORTSDIR}/security/gnutls CONFIGURE_ARGS+= --enable-gnutls EXTRAS:=${EXTRAS},m_ssl_gnutls.cpp PLIST_SUB+= GNUTLS="" .else PLIST_SUB+= GNUTLS="@comment " .endif .if ${PORT_OPTIONS:MOPENSSL} USE_OPENSSL=yes CONFIGURE_ARGS+= --enable-openssl EXTRAS:=${EXTRAS},m_ssl_openssl.cpp PLIST_SUB+= OPENSSL="" .else PLIST_SUB+= OPENSSL="@comment " .endif .if ${PORT_OPTIONS:MPCRE} LIB_DEPENDS+= libpcre.so:${PORTSDIR}/devel/pcre EXTRAS:=${EXTRAS},m_regex_pcre.cpp PLIST_SUB+= PCRE="" .else PLIST_SUB+= PCRE="@comment " .endif .if ${PORT_OPTIONS:MPOSIX} EXTRAS:=${EXTRAS},m_regex_posix.cpp PLIST_SUB+= POSIX="" .else PLIST_SUB+= POSIX="@comment " .endif pre-configure: @if [ ${EXTRAS} ]; then \ cd ${WRKSRC} && ./${CONFIGURE_SCRIPT} --enable-extras=${EXTRAS} ; \ fi post-patch: @${REINPLACE_CMD} -e 's|DATA_PATH "/inspircd.pid"|"/var/run/inspircd/inspircd.pid"|' ${WRKSRC}/src/inspircd.cpp post-install: @${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/${PORTNAME}/modules/*.so @${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/${PORTNAME} .include diff --git a/irc/inspircd/files/inspircd.in b/irc/inspircd/files/inspircd.in index 3bed41d7e486..50d9a502cdd1 100644 --- a/irc/inspircd/files/inspircd.in +++ b/irc/inspircd/files/inspircd.in @@ -1,62 +1,63 @@ #!/bin/sh # # $FreeBSD$ # # PROVIDE: inspircd # REQUIRE: DAEMON # BEFORE: LOGIN mysql postgresql # KEYWORD: shutdown # # Add the following lines to /etc/rc.conf to enable inspircd: # # inspircd_enable="YES" # # Other rc.conf variables: # inspircd_flags="" # # inspircd_config="%%ETCDIR%%/inspircd.conf" # -- path to config file # inspircd_pidfile="%%INSPIRCD_RUN%%/inspircd.pid" # -- location of pidfile: must match setting # in ${inspircd_conffile} # inspircd_logfile="%%INSPIRCD_LOG%%" # -- file inspircd writes logs to # . /etc/rc.subr name=inspircd rcvar=inspircd_enable load_rc_config ${name} : ${inspircd_enable:=NO} : ${inspircd_config="%%ETCDIR%%/inspircd.conf"} : ${inspircd_pidfile="%%INSPIRCD_RUN%%/inspircd.pid"} : ${inspircd_user="%%USERS%%"} : ${inspircd_group="%%GROUPS%%"} -: ${inspircd_data="/var/db/inspircd"} +: ${inspircd_data=/var/db/inspircd} : ${inspircd_logfile="%%INSPIRCD_LOG%%"} : ${inspircd_flags="${inspircd_flags} --logfile ${inspircd_logfile} --config ${inspircd_config}"} command=/usr/sbin/daemon command_args=" -f %%PREFIX%%/bin/inspircd --nofork ${inspircd_flags}" procname=%%PREFIX%%/bin/inspircd pidfile=${inspircd_pidfile} required_files=${inspircd_config} start_precmd=inspircd_prestart +extra_commands=reload inspircd_prestart() { # inspircd_flags gets applied too early if we don't do this. # I didn't want to force people to update their rc.conf files # and change the inspircd_flags to something else. rc_flags="" for i in ${inspircd_pidfile} ${inspircd_logfile}; do install -d -m 755 -o ${inspircd_user} -g ${inspircd_group} ${i%/*} done install -d -m 755 -o ${inspircd_user} -g ${inspircd_group} ${inspircd_data} } run_rc_command "$1"