diff options
author | brix <brix@FreeBSD.org> | 2008-01-09 04:51:45 +0800 |
---|---|---|
committer | brix <brix@FreeBSD.org> | 2008-01-09 04:51:45 +0800 |
commit | 6379baf227f896986ebb375f20cd885e30f47ace (patch) | |
tree | a9d81af9fc4397c7f9943654a055c5e07738e259 /irc/bitlbee | |
parent | ee546f44d68781d009f1b90dc93786a27ff6f74a (diff) | |
download | freebsd-ports-gnome-6379baf227f896986ebb375f20cd885e30f47ace.tar.gz freebsd-ports-gnome-6379baf227f896986ebb375f20cd885e30f47ace.tar.zst freebsd-ports-gnome-6379baf227f896986ebb375f20cd885e30f47ace.zip |
Various improvements:
- Add rc script for running bitlbee in experimental daemon mode
- Add instructions for launching bitlbee from inetd(8)
- Install bitlbee to be run as nobody, not root
- Store saved user settings in /var/db/bitlbee, not $PREFIX/etc/bitlbee
- Do not rely on autodetection for SSL library
- Use $EXTRA_PATCHES instead of custom post-patch target
- Install port documentation files
- Install example configuration files as port examples
- Reflect custom FreeBSD paths in installed man pages and example files
- Bump PORTREVISION
Please read UPDATING for important migration information.
Approved by: Lars Sommer <lasg@lasg.dk> (maintainer), erwin (mentor)
Diffstat (limited to 'irc/bitlbee')
-rw-r--r-- | irc/bitlbee/Makefile | 35 | ||||
-rw-r--r-- | irc/bitlbee/files/bitlbee.in | 31 | ||||
-rw-r--r-- | irc/bitlbee/files/pkg-message.in | 27 | ||||
-rw-r--r-- | irc/bitlbee/pkg-plist | 7 |
4 files changed, 83 insertions, 17 deletions
diff --git a/irc/bitlbee/Makefile b/irc/bitlbee/Makefile index 4da96e18ee04..56df8503ad32 100644 --- a/irc/bitlbee/Makefile +++ b/irc/bitlbee/Makefile @@ -7,7 +7,7 @@ PORTNAME= bitlbee PORTVERSION= 1.0.4 -PORTREVISION= 0 +PORTREVISION= 1 CATEGORIES= irc MASTER_SITES= http://get.bitlbee.org/src/ @@ -19,11 +19,14 @@ COMMENT= An IRC to other chat networks gateway SUB_FILES= pkg-message MAN5= bitlbee.conf.5 MAN8= bitlbee.8 +PORTDOCS= AUTHORS CHANGES CREDITS FAQ README +PORTEXAMPLES= bitlbee.conf motd.txt GNU_CONFIGURE= yes USE_GMAKE= yes USE_GNOME= glib20 USE_GETOPT_LONG=yes +USE_RC_SUBR= bitlbee PKGMESSAGE= ${WRKDIR}/pkg-message OPTIONS= MSN "Enable MSN protocol support" On \ @@ -33,7 +36,7 @@ OPTIONS= MSN "Enable MSN protocol support" On \ OPENSSL "Use openssl rather than gnutls" Off \ IPV6 "Compile IPV6 support" On -CONFIGURE_ARGS= --config=${PREFIX}/etc/bitlbee +CONFIGURE_ARGS= --config=/var/db/bitlbee .include <bsd.port.pre.mk> @@ -50,6 +53,7 @@ CONFIGURE_ARGS+=--msn=0 --ssl=bogus .if defined(WITH_OPENSSL) CONFIGURE_ARGS+=--ssl=openssl .else +CONFIGURE_ARGS+=--ssl=gnutls LIB_DEPENDS+= gnutls.13:${PORTSDIR}/security/gnutls .endif @@ -59,9 +63,7 @@ CONFIGURE_ARGS+=--ldap=${LOCALBASE} .endif .if defined(WITH_RECODE) -post-patch:: - @cd ${WRKDIR} && \ - ${PATCH} ${PATCH_ARGS} < ${FILESDIR}/oscar-recode-patch +EXTRA_PATCHES+= ${FILESDIR}/oscar-recode-patch .endif .if defined(WITH_DEBUG) @@ -72,12 +74,29 @@ CONFIGURE_ARGS+=--debug=1 CONFIGURE_ARGS+=--ipv6=0 .endif +post-patch: + @${REINPLACE_CMD} \ + -e "s:/etc/bitlbee/motd.txt:${PREFIX}/etc/bitlbee/motd.txt:" \ + -e "s:/var/lib/bitlbee:/var/db/bitlbee:" \ + ${WRKSRC}/bitlbee.conf + @${REINPLACE_CMD} \ + -e "s:/var/lib/bitlbee:/var/db/bitlbee:" \ + ${WRKSRC}/doc/bitlbee.8 + pre-install: - @${MKDIR} -m 700 ${PREFIX}/etc/bitlbee + ${MKDIR} ${PREFIX}/etc/bitlbee + ${MKDIR} -m 0700 /var/db/bitlbee + ${CHOWN} nobody:nobody /var/db/bitlbee post-install: - @${CP} ${WRKSRC}/bitlbee.conf ${PREFIX}/etc/bitlbee/bitlbee.conf.orig - @${CP} ${WRKSRC}/motd.txt ${PREFIX}/etc/bitlbee/motd.txt.orig +.if !defined(NOPORTDOCS) + ${MKDIR} ${DOCSDIR} + ${INSTALL_DATA} ${PORTDOCS:S@^@${WRKSRC}/doc/@} ${DOCSDIR} +.endif +.if !defined(NOPORTEXAMPLES) + ${MKDIR} ${EXAMPLESDIR} + ${INSTALL_DATA} ${PORTEXAMPLES:S@^@${WRKSRC}/@} ${EXAMPLESDIR} +.endif @${CAT} ${PKGMESSAGE} .include <bsd.port.post.mk> diff --git a/irc/bitlbee/files/bitlbee.in b/irc/bitlbee/files/bitlbee.in new file mode 100644 index 000000000000..d28c65f34fb5 --- /dev/null +++ b/irc/bitlbee/files/bitlbee.in @@ -0,0 +1,31 @@ +#!/bin/sh +# +# $FreeBSD$ +# +# PROVIDE: bitlbee +# REQUIRE: DAEMON +# KEYWORD: shutdown + +. %%RC_SUBR%% + +name="bitlbee" +rcvar=`set_rcvar` + +load_rc_config $name + +: ${bitlbee_enable="NO"} +: ${bitlbee_user="nobody"} +: ${bitlbee_config="%%PREFIX%%/etc/bitlbee/bitlbee.conf"} +: ${bitlbee_flags=""} + +required_files="${bitlbee_config}" +command="%%PREFIX%%/sbin/bitlbee" +start_cmd="bitlbee_start" + +bitlbee_start() +{ + echo "Starting ${name}." + su -m ${bitlbee_user} -c "${command} -D -c ${bitlbee_config} ${bitlbee_flags}" +} + +run_rc_command "$1" diff --git a/irc/bitlbee/files/pkg-message.in b/irc/bitlbee/files/pkg-message.in index 9651ae72cecc..0baaba16be62 100644 --- a/irc/bitlbee/files/pkg-message.in +++ b/irc/bitlbee/files/pkg-message.in @@ -1,8 +1,23 @@ /************************************************************************ -Remember: - rename %%PREFIX%%/etc/bitlbee/bitlbee.conf.orig - to %%PREFIX%%/etc/bitlbee/bitlbee.conf , - rename %%PREFIX%%/etc/bitlbee/motd.txt.orig - to %%PREFIX%%/etc/bitlbee/motd.txt - and modify them. +To configure bitlbee, do the following: + +Copy %%EXAMPLESDIR%%/bitlbee.conf + to %%PREFIX%%/etc/bitlbee/bitlbee.conf , +Copy %%EXAMPLESDIR%%/motd.txt + to %%PREFIX%%/etc/bitlbee/motd.txt +and modify them to suit your needs. + +You have two options for launching bitlbee: either launch it from +inetd(8) or run it as a stand-alone daemon (experimental). + +To launch bitlbee from inetd(8), add the following line to +/etc/inetd.conf and reload inetd(8): + +ircd stream tcp nowait nobody /usr/local/sbin/bitlbee bitlbee -I + +To instead launch bitlbee as a daemon (experimental), add the +following line to /etc/rc.conf: + +bitlbee_enable="YES" + *************************************************************************/ diff --git a/irc/bitlbee/pkg-plist b/irc/bitlbee/pkg-plist index 5c971aa85e51..697162f22bac 100644 --- a/irc/bitlbee/pkg-plist +++ b/irc/bitlbee/pkg-plist @@ -1,7 +1,8 @@ sbin/bitlbee %%DATADIR%%/help.txt -@exec mkdir -p -m 700 %D/etc/bitlbee -etc/bitlbee/bitlbee.conf.orig -etc/bitlbee/motd.txt.orig @dirrm %%DATADIR%% @dirrmtry etc/bitlbee +@exec mkdir -p %D/etc/bitlbee +@exec mkdir -m 0700 -p /var/db/bitlbee +@exec chown nobody:nobody /var/db/bitlbee +@unexec rmdir /var/db/bitlbee 2>/dev/null || true |