Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
| SHA1 Hash: | 5cdf78a68a323347f49faf2f298f7cf1a857b01c |
|---|---|
| Date: | 2009-05-10 20:24:51 |
| User: | djbclark |
| Comment: | Import from opensysadmin.com svn trunk |
- branch=trunk inherited from [3aa1e11386] branch timeline
- sym-trunk inherited from [3aa1e11386]
Changes to src/bcfg2/bcfg2.conf
@@ -1,1 +1,15 @@ +[server] +repository = /usr/local/var/lib/bcfg2 +structures = Bundler,Base +generators = Cfg,Pkgmgr,Svcmgr + +[statistics] +sendmailpath = /usr/sbin/sendmail + +[communication] +protocol = xmlrpc/ssl +password = <password> +key = /usr/local/etc/bcfg2.key +[components] +bcfg2 = https://config.opensysadmin.com:1232
Changes to src/bcfg2/site-settings.conf
@@ -1,1 +1,47 @@
-
+######
+###### Set these variables as appropriate for your site
+######
+####
+#### Site Information
+####
+#set global $ADMIN_NAME = "Daniel Joseph Barnhart Clark"
+#set global $ADMIN_EMAIL = "dclark@opensysadmin.com"
+#set global $SITE_NAME = "OpenSysAdmin.com"
+## SITE_SHORTNAME should be a single word with no punctuation
+#set global $SITE_SHORTNAME = "opensysadmin"
+## SITE_VERSION should be the version of this file, starting at 1
+#set global $SITE_VERSION = "1"
+####
+#### Paths, Variables, and Passwords
+####
+#set global $SENDMAILPATH = "/usr/sbin/sendmail"
+#set global $BCFG2_SERVER = "config.opensysadmin.com"
+#set global $BCFG2_PORT = "1232"
+#set global $OSTIARY_PORT = "7"
+## How often to run the bcfg2 client, or "0" to disable
+#set global $BCFG2_CLIENT_RUN_INTERVAL_SECONDS = "3600"
+## Initial options for bcfg(1). The bcfg2 client is started with these options
+## on installation and periodically based on BCFG2_CLIENT_RUN_INTERVAL_SECONDS,
+## so you probably want to include the "-n" (dry-run mode) flag, unless you
+## already have a good configuration in place. You can then change the config
+## file /usr/local/etc/default/bcfg2-client/env/OPTIONS via the bcfg2 "Cfg"
+## functionality (possibly by kicking off a non-dry from the bcfg2 server using
+## ostiary, or just by running bcfg2 manually on the client) to run in non-dry-
+## run mode.
+#set global $BCFG2_CLIENT_OPTIONS = "-q -v -d -n"
+## Initial options for bcfg2-server(8). Note that bcfg2-server is not fully
+## configured by bcfg2-site; you need to edit /usr/local/etc/bcfg2.conf to
+## include the "[server]" stanza and appropriate values, as well as a "key ="
+## line in the "[communications]" stanza (see bcfg2 doc for details).
+#set global $BCFG2_SERVER_OPTIONS = "-v"
+## You can set passwords here, and you will not be prompted for them at
+## install time; however you will then have to treat your bcfg2-site
+## distribution as equivalent to the bcfg2 server and ostiary passwords.
+## To be prompted for passwords at install time, make these empty string ("")
+#set global $BCFG2_PASSWORD = ""
+#set global $OSTIARY_PASSWORD = ""
+######
+###### Automatically-set variables - you shouldn't have to touch these.
+######
+#from time import localtime, strftime
+#set global $DATE = strftime("%a %b %d %H:%M:%S %Z %Y", localtime())
Changes to src/encap-profiles/current/Makefile
@@ -1,1 +1,156 @@
+# $Id: Makefile 94 2007-07-21 22:00:27Z dclark $
+
+.PHONY : test log all install clean distclean encaps
+.SUFFIXES :
+.SUFFIXES : .ep .sh .installed .packaged .d
+
+export ENCAP_CONTACT = dclark@pobox.com
+export BASEDIR = /usr/local
+export ENCAPDIR := ${BASEDIR}/encap
+export EPKG := ${BASEDIR}/bin/epkg
+export MKENCAP := ${BASEDIR}/bin/mkencap
+export SHELL = /bin/sh
+srcdir = .
+export EP2TARGET := $(srcdir)/ep2target
+PAGER ?= more
+export PKG_CONFIG_PATH = ${BASEDIR}/lib/pkgconfig
+
+sources_sh := $(basename $(wildcard *.sh))
+sources_ep := $(basename $(wildcard *.ep))
+sources := $(sort $(sources_ep) $(sources_sh))
+
+# Get OS for GNU/Linux distributions...
+UNAME := $(shell uname)
+
+ifeq ($(UNAME),Linux)
+DISTRO := $(shell cat /etc/issue | grep ^[a-zA-Z] | head -1)
+UNAMEM := $(shell uname -m)
+endif
+
+ifeq ($(DISTRO),Debian GNU/Linux 3.1 \n \l)
+OS ?= linux_debian_sarge
+endif
+
+ifeq ($(DISTRO),Debian GNU/Linux 4.0 \n \l)
+OS ?= linux_debian_etch
+endif
+
+ifeq ($(DISTRO),Debian GNU/Linux testing/unstable \n \l)
+OS ?= linux_debian_sid
+endif
+
+ifeq ($(DISTRO),Ubuntu 6.06.1 LTS \n \l)
+OS ?= linux_ubuntu_dapper
+endif
+
+ifeq ($(DISTRO),Red Hat Linux release 6.0 (Hedwig))
+OS ?= linux_redhat_60
+endif
+
+ifeq ($(DISTRO),Red Hat Linux release 7.2 (Enigma))
+OS ?= linux_redhat_72
+endif
+
+ifeq ($(DISTRO),Welcome to SuSE SLES 8 (powered by UnitedLinux 1.0) (i586))
+OS ?= linux_suse_sles8
+endif
+
+ifeq ($(DISTRO),Welcome to SUSE Linux Enterprise Server 10 (i586) - Kernel \r (\l).)
+OS ?= linux_suse_sles10
+endif
+
+ifeq ($(DISTRO),Welcome to SUSE Linux Enterprise Server 10 (i686) - Kernel \r (\l).)
+OS ?= linux_suse_sles10
+endif
+
+ifeq ($(DISTRO),Welcome to SUSE Linux Enterprise Server 10 (x86_64) - Kernel \r (\l).)
+OS ?= linux_suse_sles10
+endif
+
+ifeq ($(DISTRO),Red Hat Enterprise Linux AS release 4 (Nahant Update 5))
+OS ?= linux_redhat_rhel4
+endif
+
+ifeq ($(DISTRO),Red Hat Enterprise Linux AS release 4 (Nahant Update 4))
+OS ?= linux_redhat_rhel4
+endif
+
+## Get ARCH for GNU/Linux distributions...
+ARCH = ix86
+ifeq ($(UNAMEM),x86_64)
+ARCH = x86_64
+endif
+
+## Finally, set PLATFORM for GNU/Linux distributions...
+PLATFORM =
+ifeq ($(UNAME),Linux)
+PLATFORM = -p ${ARCH}-${OS}
+endif
+
+export MKENCAPCMD := ${BASEDIR}/bin/mkencap $(PLATFORM)
+
+# Rules
+%.installed : %.ep # Clean, compile and install an encap package
+ @printf "***** START .ep.installed for |$*| ***** \n"
+ -$(EPKG) -q -r $(ENCAPDIR)/$*
+ -rm -rf $(ENCAPDIR)/$*
+ -$(MKENCAPCMD) -m /usr/local/bin/m4 -b -DUP $(srcdir)/$*.ep > ./$*.log 2>&1
+ -$(MKENCAPCMD) -m /usr/local/bin/m4 -b -T $(srcdir)/$*.ep >> ./$*.log 2>&1
+ $(MKENCAPCMD) -m /usr/local/bin/m4 -b -CBI $(srcdir)/$*.ep >> ./$*.log 2>&1
+ $(EPKG) -q -i $(ENCAPDIR)/$*
+ test -h $(BASEDIR)/var/encap/$*
+ touch ./$*.installed
+ @printf "***** STOP .ep.installed for |$*| ***** \n"
+
+%.installed : %.sh # Create and install a "fake" encap package
+ @printf "***** START .sh.installed for |$*| ***** \n"
+ -$(EPKG) -q -r $(ENCAPDIR)/$*
+ -rm -rf $(ENCAPDIR)/$*
+ chmod 755 $(srcdir)/$*.sh && $(srcdir)/$*.sh
+ $(EPKG) -q -i $(ENCAPDIR)/$*
+ test -h $(BASEDIR)/var/encap/$*
+ touch ./$*.installed
+ @printf "***** STOP .sh.installed for |$*| ***** \n"
+
+%.packaged : %.installed # Create .tar.gz encap packages
+ @printf "***** START .installed.packaged for |$*| ***** \n"
+ -rm $(ENCAPDIR)/$*-*.tar.gz
+ -(cd $(ENCAPDIR) && $(MKENCAPCMD) -ef $*)
+ -(cd $(ENCAPDIR) && $(MKENCAPCMD) -c $*)
+ mv $(ENCAPDIR)/$*-encap-*.tar.gz ./
+ touch ./$*.packaged
+ @printf "***** STOP .installed.packaged for |$*| ***** \n"
+
+%.d : %.ep # Create dependancy files from .ep files
+ @printf "***** START .d.ep for |$*| ***** \n"
+ chmod 755 $(EP2TARGET) && $(EP2TARGET) $< > $@
+ @printf "***** STOP .d.ep for |$*| ***** \n"
+
+%.d : %.sh # Create dependancy files from .sh files
+ @printf "***** START .d.sh for |$*| ***** \n"
+ chmod 755 $(EP2TARGET) && $(EP2TARGET) $< > $@
+ @printf "***** STOP .d.sh for |$*| ***** \n"
+
+#test :
+# @echo $(sources)
+
+log :
+ ( $(MAKE) install > ./make.log 2>&1 \
+ && $(MAKE) encaps >> ./make.log 2>&1 ) &
+
+all : install encaps
+
+.DELETE_ON_ERROR : # delete the target of a rule if it has changed and its
+ # commands exit with a nonzero exit status
+
+install : $(EPKG) $(MKENCAP) $(EP2TARGET) $(addsuffix .installed,$(sources))
+
+encaps : $(EPKG) $(MKENCAP) $(EP2TARGET) $(addsuffix .packaged,$(sources))
+
+clean :
+ -(rm ./*.log; rm ./*.packaged; rm ./*.gz; rm ./*~)
+
+distclean : clean
+ -rm ./*.d
+include $(addsuffix .d,$(sources))
Changes to src/encap-profiles/current/bash-3.2.17.ep
@@ -1,1 +1,209 @@
+<?xml version="1.0"?>
+
+<!-- $Id: bash-3.2.17.ep 59 2007-07-16 14:22:49Z dclark $ -->
+
+<encap_profile
+ profile_ver="1.0"
+ pkgspec="bash-3.2.17"
+>
+
+<prereq package="m4-1.4.4" />
+<prereq package="pkg-config-0.22" />
+<prereq package="readline-5.2" />
+<prereq package="patch-2.5.9" />
+
+<environment
+ variable="CC"
+ value="gcc -static-libgcc"
+ type="set"
+/>
+
+<environment
+ variable="PATH"
+PLATFORM_IF_MATCH(solaris)
+ value="/usr/local/bin:/usr/sfw/bin:/usr/ccs/bin:"
+PLATFORM_ELSE
+ value="/usr/local/bin:"
+PLATFORM_ENDIF
+ type="prepend"
+/>
+
+PLATFORM_IF_MATCH(linux)
+PLATFORM_ELSE
+<environment
+ variable="MAKE"
+ value="gmake"
+ type="set"
+/>
+PLATFORM_ENDIF
+
+<environment
+ variable="LDFLAGS"
+PLATFORM_IF_MATCH(linux)
+ value="-L/usr/local/lib -Wl,-rpath,/usr/local/lib -YP,/usr/local/lib:/lib:/usr/lib"
+PLATFORM_ELSE_IF_MATCH(aix)
+ value="-L/usr/local/lib -Wl,-blibpath:/usr/local/lib:/usr/lib"
+PLATFORM_ELSE_IF_MATCH(solaris)
+ value="-L/usr/local/lib -R/usr/local/lib:/usr/lib -YP,/usr/local/lib:/usr/lib"
+PLATFORM_ELSE
+PLATFORM_ENDIF
+ type="set"
+/>
+
+<environment
+ variable="CPPFLAGS"
+ value="-I/usr/local/include"
+ type="set"
+/>
+
+<source
+url="http://encapsrcdist/mirror/bash/bash-3.2.tar.gz
+ http://mirror.opensysadmin.com/bash/bash-3.2.tar.gz
+ http://ftp.gnu.org/gnu/bash/bash-3.2.tar.gz"
+>
+
+<patch options="-p0"
+url="http://encapsrcdist/mirror/bash/bash-3.2-patches/bash32-001
+ http://mirror.opensysadmin.com/bash/bash-3.2-patches/bash32-001
+ http://ftp.gnu.org/gnu/bash/bash-3.2-patches/bash32-001"
+/>
+
+<patch options="-p0"
+url="http://encapsrcdist/mirror/bash/bash-3.2-patches/bash32-002
+ http://mirror.opensysadmin.com/bash/bash-3.2-patches/bash32-002
+ http://ftp.gnu.org/gnu/bash/bash-3.2-patches/bash32-002"
+/>
+
+<patch options="-p0"
+url="http://encapsrcdist/mirror/bash/bash-3.2-patches/bash32-003
+ http://mirror.opensysadmin.com/bash/bash-3.2-patches/bash32-003
+ http://ftp.gnu.org/gnu/bash/bash-3.2-patches/bash32-003"
+/>
+
+<patch options="-p0"
+url="http://encapsrcdist/mirror/bash/bash-3.2-patches/bash32-004
+ http://mirror.opensysadmin.com/bash/bash-3.2-patches/bash32-004
+ http://ftp.gnu.org/gnu/bash/bash-3.2-patches/bash32-004"
+/>
+
+<patch options="-p0"
+url="http://encapsrcdist/mirror/bash/bash-3.2-patches/bash32-005
+ http://mirror.opensysadmin.com/bash/bash-3.2-patches/bash32-005
+ http://ftp.gnu.org/gnu/bash/bash-3.2-patches/bash32-005"
+/>
+
+<patch options="-p0"
+url="http://encapsrcdist/mirror/bash/bash-3.2-patches/bash32-006
+ http://mirror.opensysadmin.com/bash/bash-3.2-patches/bash32-006
+ http://ftp.gnu.org/gnu/bash/bash-3.2-patches/bash32-006"
+/>
+
+<patch options="-p0"
+url="http://encapsrcdist/mirror/bash/bash-3.2-patches/bash32-007
+ http://mirror.opensysadmin.com/bash/bash-3.2-patches/bash32-007
+ http://ftp.gnu.org/gnu/bash/bash-3.2-patches/bash32-007"
+/>
+
+<patch options="-p0"
+url="http://encapsrcdist/mirror/bash/bash-3.2-patches/bash32-008
+ http://mirror.opensysadmin.com/bash/bash-3.2-patches/bash32-008
+ http://ftp.gnu.org/gnu/bash/bash-3.2-patches/bash32-008"
+/>
+
+<patch options="-p0"
+url="http://encapsrcdist/mirror/bash/bash-3.2-patches/bash32-009
+ http://mirror.opensysadmin.com/bash/bash-3.2-patches/bash32-009
+ http://ftp.gnu.org/gnu/bash/bash-3.2-patches/bash32-009"
+/>
+
+<patch options="-p0"
+url="http://encapsrcdist/mirror/bash/bash-3.2-patches/bash32-010
+ http://mirror.opensysadmin.com/bash/bash-3.2-patches/bash32-010
+ http://ftp.gnu.org/gnu/bash/bash-3.2-patches/bash32-010"
+/>
+
+<patch options="-p0"
+url="http://encapsrcdist/mirror/bash/bash-3.2-patches/bash32-011
+ http://mirror.opensysadmin.com/bash/bash-3.2-patches/bash32-011
+ http://ftp.gnu.org/gnu/bash/bash-3.2-patches/bash32-011"
+/>
+<patch options="-p0"
+url="http://encapsrcdist/mirror/bash/bash-3.2-patches/bash32-012
+ http://mirror.opensysadmin.com/bash/bash-3.2-patches/bash32-012
+ http://ftp.gnu.org/gnu/bash/bash-3.2-patches/bash32-012"
+/>
+<patch options="-p0"
+url="http://encapsrcdist/mirror/bash/bash-3.2-patches/bash32-013
+ http://mirror.opensysadmin.com/bash/bash-3.2-patches/bash32-013
+ http://ftp.gnu.org/gnu/bash/bash-3.2-patches/bash32-013"
+/>
+<patch options="-p0"
+url="http://encapsrcdist/mirror/bash/bash-3.2-patches/bash32-014
+ http://mirror.opensysadmin.com/bash/bash-3.2-patches/bash32-014
+ http://ftp.gnu.org/gnu/bash/bash-3.2-patches/bash32-014"
+/>
+<patch options="-p0"
+url="http://encapsrcdist/mirror/bash/bash-3.2-patches/bash32-015
+ http://mirror.opensysadmin.com/bash/bash-3.2-patches/bash32-015
+ http://ftp.gnu.org/gnu/bash/bash-3.2-patches/bash32-015"
+/>
+<patch options="-p0"
+url="http://encapsrcdist/mirror/bash/bash-3.2-patches/bash32-016
+ http://mirror.opensysadmin.com/bash/bash-3.2-patches/bash32-016
+ http://ftp.gnu.org/gnu/bash/bash-3.2-patches/bash32-016"
+/>
+<patch options="-p0"
+url="http://encapsrcdist/mirror/bash/bash-3.2-patches/bash32-017
+ http://mirror.opensysadmin.com/bash/bash-3.2-patches/bash32-017
+ http://ftp.gnu.org/gnu/bash/bash-3.2-patches/bash32-017"
+/>
+
+PLATFORM_IF_MATCH(aix)
+<patch options="-p0"><![CDATA[
+--- configure.orig 2006-10-05 13:12:30.165684414 -0400
++++ configure 2006-10-05 13:12:29.935678950 -0400
+@@ -23204,6 +23204,8 @@
+
+ LOCAL_DEFS=-DSHELL
+
++# Hackish patch for AIX - should not be here on other OS
++LOCAL_LIBS=-lm
+
+ case "${host_os}" in
+ sysv4.2*) cat >>confdefs.h <<\_ACEOF
+]]></patch>
+PLATFORM_ELSE
+PLATFORM_ENDIF
+
+<configure>
+touch ./configure
+./configure \
+ --prefix="${ENCAP_SOURCE}/${ENCAP_PKGNAME}" \
+ --sysconfdir="${ENCAP_TARGET}/etc" \
+ --with-afs \
+ --with-included-gettext \
+ --without-libiconv-prefix \
+ --without-libintl-prefix \
+ --disable-nls
+</configure>
+
+<build>
+touch ./configure
+${MAKE}
+</build>
+
+</source>
+
+<prepackage type="set">
+${STRIP} bin/bash
+# Make "this encap is installed" sentinal file available in /usr/local/var/encap
+test -d var || mkdir var
+test -d var/encap || mkdir var/encap
+touch var/encap/${ENCAP_PKGNAME}
+</prepackage>
+
+<encapinfo>
+description Bourne Again SHell - The GNU bourne shell
+</encapinfo>
+</encap_profile>
Changes to src/encap-profiles/current/coreutils-5.97.ep
@@ -1,1 +1,84 @@
+<?xml version="1.0"?>
+
+<!-- $Id$ -->
+
+<encap_profile
+ profile_ver="1.0"
+ pkgspec="coreutils-5.97"
+>
+
+<prereq package="m4-1.4.4" />
+<prereq package="pkg-config-0.22" />
+<prereq package="readline-5.2" />
+<prereq package="zlib-1.2.3" />
+<prereq package="gzip-1.2.4b" />
+
+<environment
+ variable="CC"
+ value="gcc -static-libgcc"
+ type="set"
+/>
+
+<environment
+ variable="PATH"
+PLATFORM_IF_MATCH(solaris)
+ value="/usr/local/bin:/usr/sfw/bin:/usr/ccs/bin:"
+PLATFORM_ELSE
+ value="/usr/local/bin:"
+PLATFORM_ENDIF
+ type="prepend"
+/>
+
+PLATFORM_IF_MATCH(linux)
+PLATFORM_ELSE
+<environment
+ variable="MAKE"
+ value="gmake"
+ type="set"
+/>
+PLATFORM_ENDIF
+
+<environment
+ variable="LDFLAGS"
+PLATFORM_IF_MATCH(linux)
+ value="-L/usr/local/lib -Wl,-rpath,/usr/local/lib -YP,/usr/local/lib:/lib:/usr/lib"
+PLATFORM_ELSE_IF_MATCH(aix)
+ value="-L/usr/local/lib -Wl,-blibpath:/usr/local/lib:/usr/lib"
+PLATFORM_ELSE_IF_MATCH(solaris)
+ value="-L/usr/local/lib -R/usr/local/lib:/usr/lib -YP,/usr/local/lib:/usr/lib"
+PLATFORM_ELSE
+PLATFORM_ENDIF
+ type="set"
+/>
+
+<environment
+ variable="CPPFLAGS"
+ value="-I/usr/local/include"
+ type="set"
+/>
+
+<source
+url="http://encapsrcdist/mirror/coreutils/coreutils-5.97.tar.gz
+ http://mirror.opensysadmin.com/coreutils/coreutils-5.97.tar.gz
+ http://ftp.gnu.org/gnu/coreutils/coreutils-5.97.tar.gz"
+>
+
+<install type="prepend">
+test -d ${ENCAP_SOURCE} || mkdir ${ENCAP_SOURCE}
+test -d ${ENCAP_SOURCE}/${ENCAP_PKGNAME} || mkdir ${ENCAP_SOURCE}/${ENCAP_PKGNAME}
+</install>
+
+</source>
+
+<prepackage type="set">
+# Make "this encap is installed" sentinal file available in /usr/local/var/encap
+test -d var || mkdir var
+test -d var/encap || mkdir var/encap
+touch var/encap/${ENCAP_PKGNAME}
+</prepackage>
+
+<encapinfo>
+description coreutils - Core GNU Utilities
+</encapinfo>
+</encap_profile>
Changes to src/encap-profiles/current/coreutils-6.9.ep
@@ -1,1 +1,84 @@
+<?xml version="1.0"?>
+
+<!-- $Id$ -->
+
+<encap_profile
+ profile_ver="1.0"
+ pkgspec="coreutils-6.9"
+>
+
+<prereq package="m4-1.4.4" />
+<prereq package="pkg-config-0.22" />
+<prereq package="readline-5.2" />
+<prereq package="zlib-1.2.3" />
+<prereq package="gzip-1.2.4b" />
+
+<environment
+ variable="CC"
+ value="gcc -static-libgcc"
+ type="set"
+/>
+
+<environment
+ variable="PATH"
+PLATFORM_IF_MATCH(solaris)
+ value="/usr/local/bin:/usr/sfw/bin:/usr/ccs/bin:"
+PLATFORM_ELSE
+ value="/usr/local/bin:"
+PLATFORM_ENDIF
+ type="prepend"
+/>
+
+PLATFORM_IF_MATCH(linux)
+PLATFORM_ELSE
+<environment
+ variable="MAKE"
+ value="gmake"
+ type="set"
+/>
+PLATFORM_ENDIF
+
+<environment
+ variable="LDFLAGS"
+PLATFORM_IF_MATCH(linux)
+ value="-L/usr/local/lib -Wl,-rpath,/usr/local/lib -YP,/usr/local/lib:/lib:/usr/lib"
+PLATFORM_ELSE_IF_MATCH(aix)
+ value="-L/usr/local/lib -Wl,-blibpath:/usr/local/lib:/usr/lib"
+PLATFORM_ELSE_IF_MATCH(solaris)
+ value="-L/usr/local/lib -R/usr/local/lib:/usr/lib -YP,/usr/local/lib:/usr/lib"
+PLATFORM_ELSE
+PLATFORM_ENDIF
+ type="set"
+/>
+
+<environment
+ variable="CPPFLAGS"
+ value="-I/usr/local/include"
+ type="set"
+/>
+
+<source
+url="http://encapsrcdist/mirror/coreutils/coreutils-6.9.tar.gz
+ http://mirror.opensysadmin.com/coreutils/coreutils-6.9.tar.gz
+ http://ftp.gnu.org/gnu/coreutils/coreutils-6.9.tar.gz"
+>
+
+<install type="prepend">
+test -d ${ENCAP_SOURCE} || mkdir ${ENCAP_SOURCE}
+test -d ${ENCAP_SOURCE}/${ENCAP_PKGNAME} || mkdir ${ENCAP_SOURCE}/${ENCAP_PKGNAME}
+</install>
+
+</source>
+
+<prepackage type="set">
+# Make "this encap is installed" sentinal file available in /usr/local/var/encap
+test -d var || mkdir var
+test -d var/encap || mkdir var/encap
+touch var/encap/${ENCAP_PKGNAME}
+</prepackage>
+
+<encapinfo>
+description coreutils - Core GNU Utilities
+</encapinfo>
+</encap_profile>
Changes to src/encap-profiles/current/ep2target
@@ -1,1 +1,43 @@
+#!/bin/sh
+
+# $Id: ep2target 49 2007-07-11 07:41:04Z dclark $
+
+# Note: Solaris sed(1) requires a newline from stdin
+SED="sed"
+#SED="/opt/csw/bin/gsed"
+#SED="/usr/xpg4/bin/sed"
+#SED="/usr/ucb/sed"
+
+chomp() {
+ printf "%s\n" "$1" | ${SED} 's:^\ ::g' | ${SED} 's:\ $::g'
+}
+
+cname() {
+ unset CTMP1
+ CTMP1="`chomp "${1}" | ${SED} 's:\.ep$::g' | ${SED} 's:\.sh$::g'`"
+ printf "%s%s" "`basename "$CTMP1"`" "$2"
+}
+
+builddeps() {
+ unset DEPSTMP
+ for LINE in `grep "<prereq package=\"" $1 \
+ | ${SED} 's/\ //g' \
+ | awk -F\" '{print $2}'`; do
+ DEPSTMP="${DEPSTMP} `cname $LINE $2`"
+ done
+ chomp "$DEPSTMP"
+}
+
+installdeps() {
+ unset DEPSTMP
+ for LINE in `grep "prereq pkgspec" $1 \
+ | awk '{print $4}'`; do
+ DEPSTMP="${DEPSTMP} `cname $LINE $2`"
+ done
+ chomp "$DEPSTMP"
+}
+
+printf "%s : %s\n" "`cname $1 .installed`" "`builddeps $1 .installed`"
+printf "%s : %s\n" "`cname $1 .packaged`" "`installdeps $1 .packaged`"
+exit 0
Changes to src/encap-profiles/current/epm-4.1.ep
@@ -1,1 +1,85 @@
+<?xml version="1.0"?>
+
+<!-- $Id: epm-4.1.ep 49 2007-07-11 07:41:04Z dclark $ -->
+
+<encap_profile
+ profile_ver="1.0"
+ pkgspec="epm-4.1"
+>
+
+<prereq package="m4-1.4.4" />
+<prereq package="gzip-1.2.4b" />
+<prereq package="pkg-config-0.22" />
+
+<environment
+ variable="CC"
+ value="gcc -static-libgcc"
+ type="set"
+/>
+
+<environment
+ variable="PATH"
+PLATFORM_IF_MATCH(solaris)
+ value="/usr/local/bin:/usr/sfw/bin:/usr/ccs/bin:"
+PLATFORM_ELSE
+ value="/usr/local/bin:"
+PLATFORM_ENDIF
+ type="prepend"
+/>
+
+PLATFORM_IF_MATCH(linux)
+PLATFORM_ELSE
+<environment
+ variable="MAKE"
+ value="gmake"
+ type="set"
+/>
+PLATFORM_ENDIF
+
+<environment
+ variable="LDFLAGS"
+PLATFORM_IF_MATCH(linux)
+ value="-L/usr/local/lib -Wl,-rpath,/usr/local/lib -YP,/usr/local/lib:/lib:/usr/lib"
+PLATFORM_ELSE_IF_MATCH(aix)
+ value="-L/usr/local/lib -Wl,-blibpath:/usr/local/lib:/usr/lib"
+PLATFORM_ELSE_IF_MATCH(solaris)
+ value="-L/usr/local/lib -R/usr/local/lib:/usr/lib -YP,/usr/local/lib:/usr/lib"
+PLATFORM_ELSE
+PLATFORM_ENDIF
+ type="set"
+/>
+
+<environment
+ variable="CPPFLAGS"
+ value="-I/usr/local/include"
+ type="set"
+/>
+
+<source
+url="http://encapsrcdist/mirror/epm/epm-4.1-source.tar.gz
+ http://mirror.opensysadmin.com/epm/epm-4.1-source.tar.gz
+ ftp://ftp.easysw.com/pub/epm/4.1/epm-4.1-source.tar.gz"
+subdir="epm-4.1"
+use_objdir="no"
+>
+
+<configure>
+./configure \
+ --prefix="${ENCAP_SOURCE}/${ENCAP_PKGNAME}" \
+ --enable-gui=no
+</configure>
+
+</source>
+
+<prepackage type="set">
+# Make "this encap is installed" sentinal file available in /usr/local/var/encap
+test -d var || mkdir var
+test -d var/encap || mkdir var/encap
+touch var/encap/${ENCAP_PKGNAME}
+</prepackage>
+
+<encapinfo>
+description epm - Cross-platform package builder by Easy Software Products
+</encapinfo>
+</encap_profile>
Changes to src/encap-profiles/current/fcron-3.0.3.ep
@@ -1,1 +1,289 @@
+<?xml version="1.0"?>
+
+<!-- $Id: fcron-3.0.3.ep 58 2007-07-16 14:22:20Z dclark $ -->
+
+<encap_profile
+ profile_ver="1.0"
+ pkgspec="fcron-3.0.3"
+>
+
+<prereq package="m4-1.4.4" />
+<prereq package="pkg-config-0.22" />
+<prereq package="patch-2.5.9" />
+
+<environment
+ variable="CC"
+ value="gcc -static-libgcc"
+ type="set"
+/>
+
+<environment
+ variable="PATH"
+PLATFORM_IF_MATCH(solaris)
+ value="/usr/local/bin:/usr/sfw/bin:/usr/ccs/bin:"
+PLATFORM_ELSE
+ value="/usr/local/bin:"
+PLATFORM_ENDIF
+ type="prepend"
+/>
+
+PLATFORM_IF_MATCH(linux)
+PLATFORM_ELSE
+<environment
+ variable="MAKE"
+ value="gmake"
+ type="set"
+/>
+PLATFORM_ENDIF
+
+<environment
+ variable="LDFLAGS"
+PLATFORM_IF_MATCH(linux)
+ value="-L/usr/local/lib -Wl,-rpath,/usr/local/lib -YP,/usr/local/lib:/lib:/usr/lib"
+PLATFORM_ELSE_IF_MATCH(aix)
+ value="-L/usr/local/lib -Wl,-blibpath:/usr/local/lib:/usr/lib"
+PLATFORM_ELSE_IF_MATCH(solaris)
+ value="-L/usr/local/lib -R/usr/local/lib:/usr/lib -YP,/usr/local/lib:/usr/lib"
+PLATFORM_ELSE
+PLATFORM_ENDIF
+ type="set"
+/>
+
+<environment
+ variable="CPPFLAGS"
+ value="-I/usr/local/include"
+ type="set"
+/>
+
+<source
+url="http://encapsrcdist/mirror/fcron/fcron-3.0.3.src.tar.gz
+ http://mirror.opensysadmin.com/fcron/fcron-3.0.3.src.tar.gz
+ http://fcron.free.fr/archives/fcron-3.0.3.src.tar.gz"
+subdir="fcron-3.0.3"
+>
+
+<patch options="-p0" from_dir="script"><![CDATA[
+--- user-group 2007-07-10 10:20:55.000000000 -0400
++++ user-group 2007-07-10 11:08:43.000000000 -0400
+@@ -1,153 +1,35 @@
+-#!/bin/sh
+-# Check if the user and group given in arguments
+-# exit in /etc/passwd and /etc/group, and create
+-# them if necessary.
+-#
+-
+-# $Id: fcron-3.0.3.ep 58 2007-07-16 14:22:20Z dclark $
+-
+-# take 4 arguments : username
+-# groupname
+-# automatic answer
+-# the src dir
++#!/bin/sh -e
++# This replaces fcron's default script/user-group script
+
+ PATH="/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin"
+-if test -d /usr/ucb; then
+- PATH=/usr/ucb:$PATH
+-fi
+-
+-if test $# -ne 4; then
+- echo "Too few/many arguments"
+- exit 1
+-fi
+-
+-USERNAME=$1
+-GROUPNAME=$2
+-ANSWER=$3
+-SRCDIR=$4
+-
+-INSTALL="nothing"
+-INSTALLED=0
+-
+-if test `uname -s` = "FreeBSD"; then
+- IS_FREEBSD=1
+-else
+- IS_FREEBSD=0
+-fi
+-
+-if test $IS_FREEBSD -eq 1; then
+- CMD="pw groupadd $GROUPNAME"
+-else
+- CMD="groupadd $GROUPNAME"
+-fi
+-
+-echo -n "Checking if group $GROUPNAME exists ... "
+-if $SRCDIR/script/has_usrgrp.pl -group "$GROUPNAME"; then
+- echo "yes."
+- INSTALLED=1
+-else
+- echo "no."
+- if test -z "$CMD"; then
+- echo "Could not determine the command to use to add a group."
+- echo "Please add group \"GROUPNAME\" manually"
+- echo "(or choose another groupname with configure script)."
+- exit 1
+- fi
+- if test "$ANSWER" -eq 2; then
+- while test \( ! -z "$INSTALL" \) -a \( "$INSTALL" != "y" \) -a \( "$INSTALL" != "n" \);
+- do
+- echo "Would you like to add $GROUPNAME in /etc/passwd with the following command ?"
+- echo " $CMD"
+- echo "If you use NYS, ldap, etc, you should add the group manually (say no here)"
+- echo -n "Please answer with 'y' or 'n' (default: 'y'): "
+- read INSTALL NOTHING
+- done
+- if test \( -z "$INSTALL" \) -o \( "$INSTALL" = "y" \); then
+- if $CMD; then
+- INSTALLED=1
+- fi
+- fi
+- elif test "$ANSWER" -eq 1; then
+- # automatic answer given by configure script (option --with-answer-all)
+- if $CMD; then
+- INSTALLED=1
+- fi
+- fi
+-fi
+-
+-
+-if test "$INSTALLED" -eq 0; then
+- echo
+- echo "Group \"$GROUPNAME\" does not exist : please create it or choose"
+- echo "another groupname with configure script."
+- exit 1
+-fi
+-
+-INSTALL="nothing"
+-INSTALLED=0
+-
+-echo -n "Checking if user $USERNAME exists ... "
+-if $SRCDIR/script/has_usrgrp.pl -user "$USERNAME"; then
+- echo "yes."
+- INSTALLED=1
+-else
+- echo "no."
+- CMD=""
+- if test "$IS_FREEBSD" -eq 1; then
+- CMD="pw useradd $USERNAME -c $USERNAME"
+- elif useradd -D 2> /dev/null; then
+- CMD="useradd -c '$USERNAME' -g $GROUPNAME $USERNAME"
+- elif adduser -D 2> /dev/null; then
+- CMD="adduser -c '$USERNAME' -g $GROUPNAME $USERNAME"
+- fi
+- if test -z "$CMD"; then
+- echo "Could not determine the command to use to add a user."
+- echo "Please add user \"$USERNAME\" (group \"GROUPNAME\") manually"
+- echo "(or choose another username with configure script)."
+- exit 1
+- fi
+- if test "$ANSWER" -eq 2; then
+- while test \( ! -z "$INSTALL" \) -a \( "$INSTALL" != "y" \) -a \( "$INSTALL" != "n" \);
+- do
+- echo "Would you like to add $USERNAME in /etc/passwd with the following command ?"
+- echo " $CMD"
+- echo "If you use NYS, ldap, or similar, you should add the user manually (say no here)"
+- echo -n "Please answer with 'y' or 'n' (default: 'y'): "
+- read INSTALL NOTHING
+- done
+- if test \( -z "$INSTALL" \) -o \( "$INSTALL" = "y" \); then
+- if $CMD; then
+- INSTALLED=1
+- fi
+- fi
+- elif test "$ANSWER" -eq 1; then
+- # automatic answer given by configure script (option --with-answer-all)
+- if $CMD; then
+- INSTALLED=1
+- fi
+- fi
+-fi
+-
++HOME="/usr/local/home/osafcron"
+
+-if test "$INSTALLED" -eq 0; then
+- echo
+- echo "User \"$USERNAME\" does not exist : please create it or choose another"
+- echo "username with configure script."
+- exit 1
+-else
+- USERGID="`$SRCDIR/script/has_usrgrp.pl -user "$USERNAME" -printgid`"
+- GID="`$SRCDIR/script/has_usrgrp.pl -group "$GROUPNAME" -printgid`"
+- if test \( "$USERGID" = "" \) -o \( "$GID" = "" \); then
+- echo "Could not check if \"$USERNAME\" is in the group \"$GROUPNAME\" :"
+- echo "please do it manually."
+- fi
++umask 002
++test -d /usr/local || mkdir /usr/local
++test -d /usr/local/home || mkdir /usr/local/home
++test -d $HOME || mkdir $HOME
++
++case "`uname`" in
++ AIX) echo "Removing user osafcron if it exists..."
++ rmuser -R files -p osafcron || echo "User osafcron does not yet exist"
++ echo "Removing group osafcron if it exists..."
++ rmgroup -R files osafcron || echo "Group osafcron does not yet exist"
++ echo "Adding group osafcron..."
++ mkgroup -R files id=223 osafcron
++ echo "Adding user osafcron..."
++ mkuser -R files home=${HOME} id=223 pgrp=osafcron osafcron
++ ;;
++ *) echo "Removing user osafcron if it exists..."
++ userdel osafcron || echo "User osafcron does not yet exist"
++ echo "Removing group osafcron if it exists..."
++ groupdel osafcron || echo "Group osafcron does not yet exist"
++ echo "Adding group osafcron..."
++ groupadd -g 223 osafcron
++ echo "Adding user osafcron..."
++ useradd -g osafcron -d ${HOME} -s /bin/sh -u 223 osafcron
++ ;;
++esac
+
+- if test "$GID" -ne "$USERGID"; then
+- echo
+- echo "User $USERNAME exists, but is not in the group $GROUPNAME."
+- echo "Please set its group to \"$GROUPNAME\" (id $GID) manually"
+- echo "(or choose another user and/or group)."
+- exit 1
+- fi
+-fi
++chown osafcron ${HOME}; chgrp osafcron ${HOME}; chmod 0755 ${HOME}
+
++exit 0
+]]></patch>
+
+<configure>
+chmod 755 ./install-sh
+touch /usr/local/etc/fcron.deny
+touch /usr/local/etc/fcron.allow
+./configure \
+ --prefix="${ENCAP_SOURCE}/${ENCAP_PKGNAME}" \
+ --sysconfdir="${ENCAP_TARGET}/etc" \
+ --with-sendmail=/usr/sbin/sendmail \
+PLATFORM_IF_MATCH(aix)
+ --with-rootgroup=system \
+PLATFORM_ELSE
+PLATFORM_ENDIF
+ --with-username=osafcron \
+ --with-groupname=osafcron \
+ --with-db2man=no \
+ --with-pam=no \
+ --with-selinux=no \
+ --with-proc=no \
+ --with-boot-install=no \
+ --with-answer-all=yes
+</configure>
+
+</source>
+
+<prepackage type="set">
+# Make "this encap is installed" sentinal file available in /usr/local/var/encap
+test -d var || mkdir var
+test -d var/encap || mkdir var/encap
+touch var/encap/${ENCAP_PKGNAME}
+</prepackage>
+
+<encapinfo>
+description fcron - cron-like scheduler with extended capabilities
+</encapinfo>
+</encap_profile>
Changes to src/encap-profiles/current/gzip-1.2.4b.ep
@@ -1,1 +1,107 @@
+<?xml version="1.0"?>
+
+<!-- $Id: gzip-1.2.4b.ep 49 2007-07-11 07:41:04Z dclark $ -->
+
+<encap_profile
+ profile_ver="1.0"
+ pkgspec="gzip-1.2.4b"
+>
+
+<prereq package="m4-1.4.4" />
+<prereq package="patch-2.5.9" />
+<prereq package="pkg-config-0.22" />
+
+<environment
+ variable="CC"
+ value="gcc -static-libgcc"
+ type="set"
+/>
+
+<environment
+ variable="PATH"
+PLATFORM_IF_MATCH(solaris)
+ value="/usr/local/bin:/usr/sfw/bin:/usr/ccs/bin:"
+PLATFORM_ELSE
+ value="/usr/local/bin:"
+PLATFORM_ENDIF
+ type="prepend"
+/>
+
+PLATFORM_IF_MATCH(linux)
+PLATFORM_ELSE
+<environment
+ variable="MAKE"
+ value="gmake"
+ type="set"
+/>
+PLATFORM_ENDIF
+
+<environment
+ variable="LDFLAGS"
+PLATFORM_IF_MATCH(linux)
+ value="-L/usr/local/lib -Wl,-rpath,/usr/local/lib -YP,/usr/local/lib:/lib:/usr/lib"
+PLATFORM_ELSE_IF_MATCH(aix)
+ value="-L/usr/local/lib -Wl,-blibpath:/usr/local/lib:/usr/lib"
+PLATFORM_ELSE_IF_MATCH(solaris)
+ value="-L/usr/local/lib -R/usr/local/lib:/usr/lib -YP,/usr/local/lib:/usr/lib"
+PLATFORM_ELSE
+PLATFORM_ENDIF
+ type="set"
+/>
+
+<environment
+ variable="CPPFLAGS"
+ value="-I/usr/local/include"
+ type="set"
+/>
+
+<source
+url="http://encapsrcdist/mirror/gzip/gzip-1.2.4a.tar.gz
+ http://mirror.opensysadmin.com/gzip/gzip-1.2.4a.tar.gz
+ ftp://ftp.gnu.org/gnu/gzip/gzip-1.2.4a.tar.gz"
+>
+
+<patch options="-p1"><![CDATA[
+--- gzip-1.2.4/gzip.c Thu Aug 19 15:39:43 1993
++++ gzip-1.2.4b/gzip.c Tue Jan 8 21:44:18 2002
+@@ -1005,7 +1005,14 @@
+ #ifdef NO_MULTIPLE_DOTS
+ char *dot; /* pointer to ifname extension, or NULL */
+ #endif
++ int max_suffix_len = (z_len > 3 ? z_len : 3);
+
++ /* Leave enough room in ifname or ofname for suffix: */
++ if (strlen(iname) >= sizeof(ifname) - max_suffix_len) {
++ strncpy(ifname, iname, sizeof(ifname) - 1);
++ /* last byte of ifname is already zero and never overwritten */
++ error("file name too long");
++ }
+ strcpy(ifname, iname);
+
+ /* If input file exists, return OK. */
+]]></patch>
+
+<configure>
+./configure \
+ --prefix="${ENCAP_SOURCE}/${ENCAP_PKGNAME}"
+</configure>
+
+<install type="prepend">
+test -d ${ENCAP_SOURCE} || mkdir ${ENCAP_SOURCE}
+test -d ${ENCAP_SOURCE}/${ENCAP_PKGNAME} || mkdir ${ENCAP_SOURCE}/${ENCAP_PKGNAME}
+</install>
+
+</source>
+
+<prepackage type="set">
+# Make "this encap is installed" sentinal file available in /usr/local/var/encap
+test -d var || mkdir var
+test -d var/encap || mkdir var/encap
+touch var/encap/${ENCAP_PKGNAME}
+</prepackage>
+
+<encapinfo>
+description gzip - The GNU compression utility
+</encapinfo>
+</encap_profile>
Changes to src/encap-profiles/current/less-406.ep
@@ -1,1 +1,89 @@
+<?xml version="1.0"?>
+
+<!-- $Id: less-406.ep 49 2007-07-11 07:41:04Z dclark $ -->
+
+<encap_profile
+ profile_ver="1.0"
+ pkgspec="less-406"
+>
+
+<prereq package="m4-1.4.4" />
+<prereq package="pkg-config-0.22" />
+<prereq package="readline-5.2" />
+<prereq package="zlib-1.2.3" />
+<prereq package="gzip-1.2.4b" />
+
+<environment
+ variable="CC"
+ value="gcc -static-libgcc"
+ type="set"
+/>
+
+<environment
+ variable="PATH"
+PLATFORM_IF_MATCH(solaris)
+ value="/usr/local/bin:/usr/sfw/bin:/usr/ccs/bin:"
+PLATFORM_ELSE
+ value="/usr/local/bin:"
+PLATFORM_ENDIF
+ type="prepend"
+/>
+
+PLATFORM_IF_MATCH(linux)
+PLATFORM_ELSE
+<environment
+ variable="MAKE"
+ value="gmake"
+ type="set"
+/>
+PLATFORM_ENDIF
+
+<environment
+ variable="LDFLAGS"
+PLATFORM_IF_MATCH(linux)
+ value="-L/usr/local/lib -Wl,-rpath,/usr/local/lib -YP,/usr/local/lib:/lib:/usr/lib"
+PLATFORM_ELSE_IF_MATCH(aix)
+ value="-L/usr/local/lib -Wl,-blibpath:/usr/local/lib:/usr/lib"
+PLATFORM_ELSE_IF_MATCH(solaris)
+ value="-L/usr/local/lib -R/usr/local/lib:/usr/lib -YP,/usr/local/lib:/usr/lib"
+PLATFORM_ELSE
+PLATFORM_ENDIF
+ type="set"
+/>
+
+<environment
+ variable="CPPFLAGS"
+ value="-I/usr/local/include"
+ type="set"
+/>
+
+<source
+url="http://encapsrcdist/mirror/less/less-406.tar.gz
+ http://mirror.opensysadmin.com/less/less-406.tar.gz
+ http://www.greenwoodsoftware.com/less/less-406.tar.gz"
+>
+
+<configure>
+./configure \
+ --prefix="${ENCAP_SOURCE}/${ENCAP_PKGNAME}"
+</configure>
+
+<install type="prepend">
+test -d ${ENCAP_SOURCE} || mkdir ${ENCAP_SOURCE}
+test -d ${ENCAP_SOURCE}/${ENCAP_PKGNAME} || mkdir ${ENCAP_SOURCE}/${ENCAP_PKGNAME}
+</install>
+
+</source>
+
+<prepackage type="set">
+# Make "this encap is installed" sentinal file available in /usr/local/var/encap
+test -d var || mkdir var
+test -d var/encap || mkdir var/encap
+touch var/encap/${ENCAP_PKGNAME}
+</prepackage>
+
+<encapinfo>
+description less - Pager program similar to more
+</encapinfo>
+</encap_profile>
Changes to src/encap-profiles/current/m4-1.4.4.sh
@@ -1,1 +1,100 @@
+#!/bin/sh
+# $Id: m4-1.4.4.sh 49 2007-07-11 07:41:04Z dclark $
+
+ENCAP_PKGNAME="m4-1.4.4"
+PATH="$PATH:/usr/local/bin"
+export PATH
+
+date > ${ENCAP_PKGNAME}.log
+
+if [ -f "${ENCAP_PKGNAME}.ep" ]; then rm ${ENCAP_PKGNAME}.ep; fi
+cat > ${ENCAP_PKGNAME}.ep << EOF
+<?xml version="1.0"?>
+
+<encap_profile
+ profile_ver="1.0"
+ pkgspec="m4-1.4.4"
+>
+
+<environment
+ variable="CC"
+ value="gcc"
+ type="set"
+/>
+
+<environment
+ variable="PATH"
+ value="/usr/local/bin:"
+ type="prepend"
+/>
+
+<environment
+ variable="PATH"
+ value=":/usr/sfw/bin:/usr/ccs/bin"
+ type="append"
+/>
+
+<source
+ url="http://encapsrcdist/mirror/m4/m4-1.4.4.tar.gz
+ http://mirror.opensysadmin.com/m4/m4-1.4.4.tar.gz
+ http://ftp.gnu.org/gnu/m4/m4-1.4.4.tar.gz"
+>
+
+</source>
+
+<prepackage type="set">
+test -d var || mkdir var
+test -d var/encap || mkdir var/encap
+touch var/encap/${ENCAP_PKGNAME}
+</prepackage>
+
+<encapinfo>
+description m4 - GNU implementation of the traditional Unix macro processor
+</encapinfo>
+
+</encap_profile>
+EOF
+
+if [ -f m4-fake ]; then rm m4-fake; fi
+cat > m4-fake << EOF
+#!/bin/sh
+cat \$4
+EOF
+chmod 755 m4-fake
+
+CURDIR="`pwd`"
+
+printf "Environment variables:\n" \
+ >> ${ENCAP_PKGNAME}.log
+env >> ${ENCAP_PKGNAME}.log
+
+printf "\nsrcdir:|%s| pwd:|%s| \$0:|%s|\n" "${srcdir}" "`pwd`" "$0" \
+ >> ${ENCAP_PKGNAME}.log
+
+printf "\n%s :\n" "`ls -l ${ENCAP_PKGNAME}.ep`" \
+ >> ${ENCAP_PKGNAME}.log
+cat ${ENCAP_PKGNAME}.ep >> ${ENCAP_PKGNAME}.log
+
+printf "\n\n%s :\n" "`ls -l m4-fake`" \
+ >> ${ENCAP_PKGNAME}.log
+cat m4-fake >> ${ENCAP_PKGNAME}.log
+
+printf "\n${MKENCAP} -m ${CURDIR}/m4-fake -b -DUP ${ENCAP_PKGNAME}.ep :\n" \
+ >> ${ENCAP_PKGNAME}.log
+( ${MKENCAP} -m ${CURDIR}/m4-fake -b -DUP ${ENCAP_PKGNAME}.ep || true ) \
+ >> ${ENCAP_PKGNAME}.log 2>&1
+
+printf "\n${MKENCAP} -m ${CURDIR}/m4-fake -b -T ${ENCAP_PKGNAME}.ep :\n" \
+ >> ${ENCAP_PKGNAME}.log
+( ${MKENCAP} -m ${CURDIR}/m4-fake -b -T ${ENCAP_PKGNAME}.ep || true ) \
+ >> ${ENCAP_PKGNAME}.log 2>&1
+
+printf "\n${MKENCAP} -m ${CURDIR}/m4-fake -b -CBI ${ENCAP_PKGNAME}.ep :\n" \
+ >> ${ENCAP_PKGNAME}.log
+( ${MKENCAP} -m ${CURDIR}/m4-fake -b -CBI ${ENCAP_PKGNAME}.ep ) \
+ >> ${ENCAP_PKGNAME}.log 2>&1
+
+rm m4-fake >> ${ENCAP_PKGNAME}.log 2>&1
+rm ${ENCAP_PKGNAME}.ep >> ${ENCAP_PKGNAME}.log 2>&1
+exit 0
Changes to src/encap-profiles/current/ntp-4.2.4p3.ep
@@ -1,1 +1,189 @@
+<?xml version="1.0"?>
+
+<!-- $Id: ntp-4.2.4p3.ep 49 2007-07-11 07:41:04Z dclark $ -->
+
+<encap_profile
+ profile_ver="1.0"
+ pkgspec="ntp-4.2.4p3"
+>
+
+<prereq package="m4-1.4.4" />
+<prereq package="pkg-config-0.22" />
+<prereq package="openssl8-0.9.8e" />
+
+<environment
+ variable="CC"
+ value="gcc -static-libgcc"
+ type="set"
+/>
+
+<environment
+ variable="PATH"
+PLATFORM_IF_MATCH(solaris)
+ value="/usr/local/bin:/usr/sfw/bin:/usr/ccs/bin:"
+PLATFORM_ELSE
+ value="/usr/local/bin:"
+PLATFORM_ENDIF
+ type="prepend"
+/>
+
+PLATFORM_IF_MATCH(linux)
+PLATFORM_ELSE
+<environment
+ variable="MAKE"
+ value="gmake"
+ type="set"
+/>
+PLATFORM_ENDIF
+
+<environment
+ variable="LDFLAGS"
+PLATFORM_IF_MATCH(linux)
+ value="-L/usr/local/lib -Wl,-rpath,/usr/local/lib -YP,/usr/local/lib:/lib:/usr/lib"
+PLATFORM_ELSE_IF_MATCH(aix)
+ value="-L/usr/local/lib -Wl,-blibpath:/usr/local/lib:/usr/lib"
+PLATFORM_ELSE_IF_MATCH(solaris)
+ value="-L/usr/local/lib -R/usr/local/lib:/usr/lib -YP,/usr/local/lib:/usr/lib"
+PLATFORM_ELSE
+PLATFORM_ENDIF
+ type="set"
+/>
+
+<environment
+ variable="CPPFLAGS"
+ value="-I/usr/local/include -I/usr/include/inet6"
+ type="set"
+/>
+
+<source
+url="http://encapsrcdist/mirror/ntp/ntp-4.2.4p3.tar.gz
+ http://mirror.opensysadmin.com/ntp/ntp-4.2.4p3.tar.gz
+ http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2.4p3.tar.gz"
+>
+
+<configure>
+${srcdir}/configure \
+ --prefix="${ENCAP_SOURCE}/${ENCAP_PKGNAME}" \
+ --sysconfdir="/usr/local/etc" \
+ --disable-ipv6 \
+ --enable-step-slew \
+ --enable-ntpdate-step \
+ --with-crypto=openssl \
+ --with-openssl-libdir=/usr/local/lib \
+ --with-openssl-incdir=/usr/local/include
+</configure>
+
+</source>
+
+<prepackage type="set">
+# runit stuff
+test -d var || mkdir var
+test -d etc || mkdir etc
+test -d etc/sv || mkdir etc/sv
+test -d etc/sv/ntpd || mkdir etc/sv/ntpd
+test -d etc/sv/ntpd/log || mkdir etc/sv/ntpd/log
+# Make "this encap is installed" sentinal file available in /usr/local/var/encap
+test -d var || mkdir var
+test -d var/encap || mkdir var/encap
+touch var/encap/${ENCAP_PKGNAME}
+</prepackage>
+
+<include_file name="etc/sv/ntpd/run" mode="0755"><![CDATA[
+#!/bin/sh
+exec 2>&1
+exec /usr/local/bin/ntpd -c /usr/local/etc/ntp.conf -g -n -f /usr/local/etc/ntp.drift
+]]></include_file>
+
+<include_file name="etc/sv/ntpd/log/run" mode="0755"><![CDATA[
+#!/bin/sh
+exec 2>&1
+exec /usr/local/bin/svlogd -tt /usr/local/var/svlogd/ntpd
+]]></include_file>
+
+<include_file name="postinstall" mode="0755"><![CDATA[
+#!/bin/sh -e
+
+umask 002
+BASEDIR="`echo ${0} | xargs -n1 dirname`"
+LOG=${BASEDIR}/postinstall.log
+exec > $LOG 2>&1
+printf "Running ntpd postinstall script...\n"
+date
+test -d /usr/local/var/svlogd || mkdir /usr/local/var/svlogd
+test -d /usr/local/var/svlogd/ntpd || mkdir /usr/local/var/svlogd/ntpd
+
+if [ ! -f /usr/local/etc/ntp.conf ]; then
+ echo "Installing /usr/local/etc/ntp.conf"
+ rm -f /usr/local/etc/ntp.conf || true
+ cp ${ENCAP_SOURCE}/${ENCAP_PKGNAME}/ntp.conf /usr/local/etc/ntp.conf
+fi
+chmod 644 /usr/local/etc/ntp.conf
+printf "Finished ntpd postinstall script.\n"
+]]></include_file>
+
+<include_file name="preremove" mode="0755"><![CDATA[
+#!/bin/sh
+
+printf "Running ntpd preremove script...\n"
+date
+
+if [ -h /usr/local/var/service/ntpd ]; then
+ printf "INFO: Removing /usr/local/var/service/ntpd...\n"
+ rm /usr/local/var/service/ntpd
+fi
+
+printf "Finished ntpd preremove script.\n"
+]]></include_file>
+
+<include_file name="ntp.conf" mode="0644"><![CDATA[
+# /usr/local/etc/ntp.conf, configuration for ntpd
+
+driftfile /usr/local/var/lib/ntp/ntp.drift
+statsdir /usr/local/var/log/ntpstats/
+
+statistics loopstats peerstats clockstats
+filegen loopstats file loopstats type day enable
+filegen peerstats file peerstats type day enable
+filegen clockstats file clockstats type day enable
+
+
+# You do need to talk to an NTP server or two (or three).
+#server ntp.your-provider.example
+
+# pool.ntp.org maps to more than 300 low-stratum NTP servers.
+# Your server will pick a different set every time it starts up.
+# *** Please consider joining the pool! ***
+# *** <http://www.pool.ntp.org/join.html> ***
+server 0.debian.pool.ntp.org iburst
+server 1.debian.pool.ntp.org iburst
+server 2.debian.pool.ntp.org iburst
+server 3.debian.pool.ntp.org iburst
+
+# By default, exchange time with everybody, but don't allow configuration.
+# See /usr/share/doc/ntp-doc/html/accopt.html for details.
+restrict default kod notrap nomodify nopeer noquery
+
+# Local users may interrogate the ntp server more closely.
+restrict 127.0.0.1 nomodify
+
+# Clients from this (example!) subnet have unlimited access,
+# but only if cryptographically authenticated
+#restrict 192.168.123.0 mask 255.255.255.0 notrust
+
+# If you want to provide time to your local subnet, change the next line.
+# (Again, the address is an example only.)
+#broadcast 192.168.123.255
+
+# If you want to listen to time broadcasts on your local subnet,
+# de-comment the next lines. Please do this only if you trust everybody
+# on the network!
+#disable auth
+#broadcastclient
+]]></include_file>
+
+<encapinfo>
+description Network Time Protocol - Time Syncronization Daemon
+exclude ntp.conf
+</encapinfo>
+</encap_profile>
Changes to src/encap-profiles/current/openssh-4.6p1+2.ep
@@ -1,1 +1,409 @@
+<?xml version="1.0"?>
+
+<!-- $Id$ -->
+
+<encap_profile
+ profile_ver="1.0"
+ pkgspec="openssh-4.6p1+2"
+>
+
+<prereq package="m4-1.4.4" />
+<prereq package="pkg-config-0.22" />
+<prereq package="zlib-1.2.3" />
+<prereq package="openssl8-0.9.8e" />
+
+<environment
+ variable="CC"
+ value="gcc -static-libgcc"
+ type="set"
+/>
+
+<environment
+ variable="PATH"
+PLATFORM_IF_MATCH(solaris)
+ value="/usr/local/bin:/usr/sfw/bin:/usr/ccs/bin:"
+PLATFORM_ELSE
+ value="/usr/local/bin:"
+PLATFORM_ENDIF
+ type="prepend"
+/>
+
+PLATFORM_IF_MATCH(linux)
+PLATFORM_ELSE
+<environment
+ variable="MAKE"
+ value="gmake"
+ type="set"
+/>
+PLATFORM_ENDIF
+
+<environment
+ variable="LDFLAGS"
+PLATFORM_IF_MATCH(linux)
+ value="-L/usr/local/lib -Wl,-rpath,/usr/local/lib -YP,/usr/local/lib:/lib:/usr/lib"
+PLATFORM_ELSE_IF_MATCH(aix)
+ value="-L/usr/local/lib -Wl,-blibpath:/usr/local/lib:/usr/lib"
+PLATFORM_ELSE_IF_MATCH(solaris)
+ value="-L/usr/local/lib -R/usr/local/lib:/usr/lib -YP,/usr/local/lib:/usr/lib"
+PLATFORM_ELSE
+PLATFORM_ENDIF
+ type="set"
+/>
+
+<environment
+ variable="CPPFLAGS"
+PLATFORM_IF_MATCH(aix)
+ value="-I/usr/local/include -D_LINUX_SOURCE_COMPAT -DBROKEN_GETADDRINFO"
+PLATFORM_ELSE
+ value="-I/usr/local/include"
+PLATFORM_ENDIF
+ type="set"
+/>
+
+PLATFORM_IF_MATCH(solaris2.6)
+<prepare><![CDATA[
+umask 022; \
+test -d /var/ld || mkdir /var/ld; \
+CURRENT=`crle | grep "^\ \ " | grep -v "^\ \ crle" | cut -f2- -d: -s | awk '{print $1}' | head -1`; \
+HASENTRY=`echo $CURRENT | grep \/usr\/local\/lib || echo no`; \
+if [ "${HASENTRY}x" = "nox" ]; then crle -l $CURRENT:/usr/local/lib; fi
+]]></prepare>
+PLATFORM_ELSE
+PLATFORM_ENDIF
+
+<source
+url="http://encapsrcdist/mirror/openssh/openssh-4.6p1.tar.gz
+http://mirror.opensysadmin.com/openssh/openssh-4.6p1.tar.gz
+http://mirror.mcs.anl.gov/openssh/portable/openssh-4.6p1.tar.gz"
+>
+
+<configure>
+# Now run configure...
+./configure \
+ --prefix="${ENCAP_SOURCE}/${ENCAP_PKGNAME}" \
+ --sysconfdir="/usr/local/etc" \
+PLATFORM_IF_MATCH(aix4)
+ --with-authenticate \
+PLATFORM_ELSE
+ --with-pam \
+PLATFORM_ENDIF
+ --with-ipaddr-display \
+ --with-md5-passwords \
+ --without-libedit \
+ --with-zlib=/usr/local \
+ --with-ssl-dir=/usr/local \
+ --with-privsep-path=/usr/local/var/empty \
+ --with-privsep-user=osasshd
+</configure>
+
+<install>
+${MAKE} install-nokeys sysconfdir="/usr/local/etc"
+PLATFORM_IF_MATCH(linux)
+cp ${srcdir}/contrib/redhat/sshd.pam "${ENCAP_SOURCE}/${ENCAP_PKGNAME}/sshd.pam-redhat"
+PLATFORM_ELSE_IF_MATCH(aix5)
+# Example /etc/pam.conf for AIX 5.2
+cp ${srcdir}/contrib/aix/pam.conf "${ENCAP_SOURCE}/${ENCAP_PKGNAME}/pam.conf-aix"
+PLATFORM_ENDIF
+test -d ${ENCAP_SOURCE}/${ENCAP_PKGNAME}/bin || mkdir ${ENCAP_SOURCE}/${ENCAP_PKGNAME}/bin
+cp ${srcdir}/contrib/ssh-copy-id ${ENCAP_SOURCE}/${ENCAP_PKGNAME}/bin/ssh-copy-id
+chmod 755 ${ENCAP_SOURCE}/${ENCAP_PKGNAME}/bin/ssh-copy-id
+test -d ${ENCAP_SOURCE}/${ENCAP_PKGNAME}/man || mkdir ${ENCAP_SOURCE}/${ENCAP_PKGNAME}/man
+test -d ${ENCAP_SOURCE}/${ENCAP_PKGNAME}/man/man1 || mkdir ${ENCAP_SOURCE}/${ENCAP_PKGNAME}/man/man1
+cp ${srcdir}/contrib/ssh-copy-id.1 ${ENCAP_SOURCE}/${ENCAP_PKGNAME}/man/man1/ssh-copy-id.1
+chmod 644 ${ENCAP_SOURCE}/${ENCAP_PKGNAME}/man/man1/ssh-copy-id.1
+</install>
+
+</source>
+
+
+<prepackage><![CDATA[
+# runit stuff
+test -d var || mkdir var
+test -d etc || mkdir etc
+test -d etc/sv || mkdir etc/sv
+test -d etc/sv/sshd || mkdir etc/sv/sshd
+test -d etc/sv/sshd/log || mkdir etc/sv/sshd/log
+
+# Make "this encap is installed" sentinal file available in /usr/local/var/encap
+test -d var || mkdir var
+test -d var/encap || mkdir var/encap
+touch var/encap/${ENCAP_PKGNAME}
+]]></prepackage>
+
+<include_file name="etc/sv/sshd/run" mode="0755"><![CDATA[
+#!/bin/sh
+exec 2>&1
+exec /usr/local/sbin/sshd -4 -D -e -p 222 -o "Protocol 2"
+]]></include_file>
+
+<include_file name="etc/sv/sshd/log/run" mode="0755"><![CDATA[
+#!/bin/sh
+exec 2>&1
+exec /usr/local/bin/svlogd -tt /usr/local/var/svlogd/sshd
+]]></include_file>
+
+<include_file name="preinstall" mode="0755"><![CDATA[
+#!/bin/sh -e
+
+# This makes the privsep user/group/home dir
+
+umask 002
+
+EMPTY="/usr/local/var/empty"
+test -d /usr/local || mkdir /usr/local
+test -d /usr/local/var || mkdir /usr/local/var
+
+if [ ! -d ${EMPTY} ]; then mkdir ${EMPTY}; fi
+chown 0 ${EMPTY}; chgrp 0 ${EMPTY}; chmod 0755 ${EMPTY}
+
+PLATFORM_IF_MATCH(aix)
+ echo "Removing user osasshd if it exists..."
+ rmuser -R files -p osasshd || echo "User osasshd does not yet exist"
+ echo "Removing group osasshd if it exists..."
+ rmgroup -R files osasshd || echo "Group osasshd does not yet exist"
+ U222="`awk -F: '{print $1":"$3}' /etc/passwd | grep \:222 | awk -F: '{print $1}'`"
+ G222="`awk -F: '{print $1":"$3}' /etc/group | grep \:222 | awk -F: '{print $1}'`"
+ if [ "${U222}x" != "x" ]; then rmuser -R files -p ${U222}; echo "User 222 removed"; fi
+ if [ "${G222}x" != "x" ]; then rmgroup -R files ${G222}; echo "Group 222 removed"; fi
+ echo "Adding group osasshd..."
+ mkgroup -R files id=222 osasshd
+ echo "Adding user osasshd..."
+ mkuser -R files home=${EMPTY} id=222 pgrp=osasshd login=false osasshd
+PLATFORM_ELSE
+ echo "Removing user osasshd if it exists..."
+ userdel osasshd || echo "User osasshd does not yet exist"
+ echo "Removing group osasshd if it exists..."
+ groupdel osasshd || echo "Group osasshd does not yet exist"
+ U222="`awk -F: '{print $1":"$3}' /etc/passwd | grep \:222 | awk -F: '{print $1}'`"
+ G222="`awk -F: '{print $1":"$3}' /etc/group | grep \:222 | awk -F: '{print $1}'`"
+ if [ "${U222}x" != "x" ]; then userdel ${U222}; echo "User 222 removed"; fi
+ if [ "${G222}x" != "x" ]; then groupdel ${G222}; echo "Group 222 removed"; fi
+ echo "Adding group osasshd..."
+ groupadd -g 222 osasshd
+ echo "Adding user osasshd..."
+ useradd -g osasshd -d ${EMPTY} -s /bin/false -u 222 osasshd
+PLATFORM_ENDIF
+
+PLATFORM_IF_MATCH(solaris2.6)
+umask 022; \
+test -d /var/ld || mkdir /var/ld; \
+CURRENT=`crle | grep "^\ \ " | grep -v "^\ \ crle" | cut -f2- -d: -s | awk '{print $1}' | head -1`; \
+HASENTRY=`echo $CURRENT | grep \/usr\/local\/lib || echo no`; \
+if [ "${HASENTRY}x" = "nox" ]; then crle -l $CURRENT:/usr/local/lib; fi
+PLATFORM_ELSE
+PLATFORM_ENDIF
+
+exit 0
+]]></include_file>
+
+<include_file name="postinstall" mode="0755"><![CDATA[
+#!/bin/sh
+
+umask 002
+BASEDIR="`echo ${0} | xargs -n1 dirname`"
+LOG=${BASEDIR}/postinstall.log
+exec > $LOG 2>&1
+printf "Running sshd postinstall script...\n"
+date
+test -d /usr/local/var/svlogd || mkdir /usr/local/var/svlogd
+test -d /usr/local/var/svlogd/sshd || mkdir /usr/local/var/svlogd/sshd
+
+test -d /var/run || mkdir /var/run
+PIDDIR=/var/run
+
+if [ -f /usr/local/etc/ssh_host_key ]; then
+ echo "Removing SSH1 host key (/usr/local/etc/ssh_host_key)"
+ rm /usr/local/etc/ssh_host_key
+fi
+
+CHECKDIRS="/etc /etc/ssh /etc/sshd /etc/openssh /etc/opensshd /usr/local/etc/ssh /usr/local/etc/sshd /usr/local/etc/openssh /usr/local/etc/opensshd"
+
+if [ ! -f /usr/local/etc/ssh_host_rsa_key ]; then
+ for CHECKDIR in $CHECKDIRS; do
+ if [ -f ${CHECKDIR}/ssh_host_rsa_key ]; then
+ echo "Copying existing RSA keys from $CHECKDIR"
+ cp ${CHECKDIR}/ssh_host_rsa_key* /usr/local/etc/
+ break
+ fi
+ done
+fi
+if [ ! -f /usr/local/etc/ssh_host_rsa_key ]; then
+ echo "Generating SSH2 RSA host keys (/usr/local/etc/ssh_host_rsa_key*)";
+ ${ENCAP_TARGET}/bin/ssh-keygen -t rsa -f /usr/local/etc/ssh_host_rsa_key -N '';
+fi
+
+if [ ! -f /usr/local/etc/ssh_host_dsa_key ]; then
+ for CHECKDIR in $CHECKDIRS; do
+ if [ -f ${CHECKDIR}/ssh_host_dsa_key ]; then
+ echo "Copying existing DSA keys from $CHECKDIR"
+ cp ${CHECKDIR}/ssh_host_dsa_key* /usr/local/etc/
+ break
+ fi
+ done
+fi
+if [ ! -f /usr/local/etc/ssh_host_dsa_key ]; then
+ echo "Generating SSH2 DSA host keys (/usr/local/etc/ssh_host_dsa_key*)";
+ ${ENCAP_TARGET}/bin/ssh-keygen -t dsa -f /usr/local/etc/ssh_host_dsa_key -N '';
+fi
+
+PLATFORM_IF_MATCH(linux)
+if [ ! -f /etc/pam.d/sshd ]; then
+ if [ -f /etc/pam.d/ssh ]; then
+ echo "Copying /etc/pam.d/ssh to /etc/pam.d/sshd"
+ cp -p /etc/pam.d/ssh /etc/pam.d/sshd
+ else
+ echo "Copying /etc/pam.d/login to /etc/pam.d/sshd"
+ cp -p /etc/pam.d/login /etc/pam.d/sshd
+ fi
+fi
+PLATFORM_ENDIF
+
+PRIV="/usr/local/etc/ssh_host_rsa_key /usr/local/etc/ssh_host_dsa_key"
+PUB="/usr/local/etc/ssh_host_rsa_key.pub /usr/local/etc/ssh_host_dsa_key.pub"
+chmod 0600 $PRIV
+chmod 0644 $PUB
+chown 0 $PRIV $PUB
+chgrp 0 $PRIV $PUB
+
+echo "Installing /usr/local/etc/sshd_config"
+rm -f /usr/local/etc/sshd_config 2>/dev/null || true
+cp ${ENCAP_SOURCE}/${ENCAP_PKGNAME}/sshd_config /usr/local/etc/sshd_config
+chmod 0644 /usr/local/etc/sshd_config
+chown 0 /usr/local/etc/sshd_config
+chgrp 0 /usr/local/etc/sshd_config
+
+printf "Finished sshd postinstall script.\n"
+
+exit 0
+]]></include_file>
+
+<include_file name="preremove" mode="0755"><![CDATA[
+#!/bin/sh
+
+printf "Running sshd preremove script...\n"
+date
+
+if [ -h /usr/local/var/service/sshd ]; then
+ printf "INFO: Removing /usr/local/var/service/sshd...\n"
+ rm /usr/local/var/service/sshd
+fi
+
+printf "Finished sshd preremove script.\n"
+]]></include_file>
+
+<include_file name="sshd_config" mode="0644"><![CDATA[
+# $OpenBSD: sshd_config,v 1.74 2006/07/19 13:07:10 dtucker Exp $
+
+# This is the sshd server system-wide configuration file. See
+# sshd_config(5) for more information.
+
+# This sshd was compiled with PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/encap/openssh-4.4p1/bin
+
+# The strategy used for options in the default sshd_config shipped with
+# OpenSSH is to specify options with their default value where
+# possible, but leave them commented. Uncommented options change a
+# default value.
+
+Port 222
+Protocol 2
+#AddressFamily any
+#ListenAddress 0.0.0.0
+#ListenAddress ::
+
+# HostKey for protocol version 1
+#HostKey /usr/local/etc/ssh_host_key
+# HostKeys for protocol version 2
+#HostKey /usr/local/etc/ssh_host_rsa_key
+#HostKey /usr/local/etc/ssh_host_dsa_key
+
+# Lifetime and size of ephemeral version 1 server key
+#KeyRegenerationInterval 1h
+#ServerKeyBits 768
+
+# Logging
+# obsoletes QuietMode and FascistLogging
+#SyslogFacility AUTH
+#LogLevel INFO
+
+# Authentication:
+
+#LoginGraceTime 2m
+PermitRootLogin no
+#StrictModes yes
+MaxAuthTries 5
+
+#RSAAuthentication yes
+#PubkeyAuthentication yes
+#AuthorizedKeysFile .ssh/authorized_keys
+
+# For this to work you will also need host keys in /usr/local/etc/ssh_known_hosts
+#RhostsRSAAuthentication no
+# similar for protocol version 2
+#HostbasedAuthentication no
+# Change to yes if you don't trust ~/.ssh/known_hosts for
+# RhostsRSAAuthentication and HostbasedAuthentication
+#IgnoreUserKnownHosts no
+# Don't read the user's ~/.rhosts and ~/.shosts files
+#IgnoreRhosts yes
+
+# To disable tunneled clear text passwords, change to no here!
+#PasswordAuthentication yes
+#PermitEmptyPasswords no
+
+# Change to no to disable s/key passwords
+#ChallengeResponseAuthentication yes
+
+# Set this to 'yes' to enable PAM authentication, account processing,
+# and session processing. If this is enabled, PAM authentication will
+# be allowed through the ChallengeResponseAuthentication and
+# PasswordAuthentication. Depending on your PAM configuration,
+# PAM authentication via ChallengeResponseAuthentication may bypass
+# the setting of "PermitRootLogin without-password".
+# If you just want the PAM account and session checks to run without
+# PAM authentication, then enable this but set PasswordAuthentication
+# and ChallengeResponseAuthentication to 'no'.
+PLATFORM_IF_MATCH(aix4)
+# UsePAM no
+PLATFORM_ELSE_IF_MATCH(solaris\|hpux11\|linux\|aix5)
+UsePAM yes
+PLATFORM_ENDIF
+
+#AllowTcpForwarding yes
+#GatewayPorts no
+X11Forwarding yes
+#X11DisplayOffset 10
+#X11UseLocalhost yes
+#PrintMotd yes
+#PrintLastLog yes
+#TCPKeepAlive yes
+#UseLogin no
+#UsePrivilegeSeparation yes
+#PermitUserEnvironment no
+#Compression delayed
+#ClientAliveInterval 0
+#ClientAliveCountMax 3
+#UseDNS yes
+#PidFile /var/run/sshd.pid
+#MaxStartups 10
+#PermitTunnel no
+
+# no default banner path
+#Banner /some/path
+
+# override default of no subsystems
+Subsystem sftp /usr/local/encap/openssh-4.4p1/libexec/sftp-server
+
+# Example of overriding settings on a per-user basis
+#Match User anoncvs
+# X11Forwarding no
+# AllowTcpForwarding no
+# ForceCommand cvs server
+]]></include_file>
+
+
+<encapinfo>
+description openssh - SSH client and server programs
+exclude sshd_config
+</encapinfo>
+</encap_profile>
Changes to src/encap-profiles/current/openssl8-0.9.8e.ep
@@ -1,1 +1,101 @@
+<?xml version="1.0"?>
+
+<!-- $Id: openssl8-0.9.8e.ep 49 2007-07-11 07:41:04Z dclark $ -->
+
+<encap_profile
+ profile_ver="1.0"
+ pkgspec="openssl8-0.9.8e"
+>
+
+<prereq package="m4-1.4.4" />
+<prereq package="zlib-1.2.3" />
+<prereq package="pkg-config-0.22" />
+
+<environment
+ variable="CC"
+ value="gcc -static-libgcc"
+ type="set"
+/>
+
+<environment
+ variable="PATH"
+PLATFORM_IF_MATCH(solaris)
+ value="/usr/local/bin:/usr/sfw/bin:/usr/ccs/bin:"
+PLATFORM_ELSE
+ value="/usr/local/bin:"
+PLATFORM_ENDIF
+ type="prepend"
+/>
+
+PLATFORM_IF_MATCH(linux)
+PLATFORM_ELSE
+<environment
+ variable="MAKE"
+ value="gmake"
+ type="set"
+/>
+PLATFORM_ENDIF
+
+<environment
+ variable="LDFLAGS"
+PLATFORM_IF_MATCH(linux)
+ value="-L/usr/local/lib -Wl,-rpath,/usr/local/lib"
+PLATFORM_ELSE_IF_MATCH(aix)
+ value="-L/usr/local/lib -Wl,-blibpath:/usr/local/lib:/usr/lib"
+PLATFORM_ELSE_IF_MATCH(solaris)
+ value="-L/usr/local/lib -R/usr/local/lib:/usr/lib -YP,/usr/local/lib:/usr/lib"
+PLATFORM_ELSE
+PLATFORM_ENDIF
+ type="set"
+/>
+
+<environment
+ variable="CPPFLAGS"
+ value="-I/usr/local/include"
+ type="set"
+/>
+
+<source
+url="http://encapsrcdist/mirror/openssl/openssl-0.9.8e.tar.gz
+ http://mirror.opensysadmin.com/openssl/openssl-0.9.8e.tar.gz
+ http://www.openssl.org/source/openssl-0.9.8e.tar.gz"
+use_objdir="no"
+>
+
+<configure>
+if [ -f config.orig ]; then cp config.orig config; fi
+cat config | sed s:CC\=ccc:CC\=gcc:g | sed s:CC\=cc:CC\=gcc:g > config.osa
+mv config config.orig
+cp config.osa config
+chmod 755 config
+./config \
+ --prefix="${ENCAP_SOURCE}/${ENCAP_PKGNAME}" \
+ zlib-dynamic shared no-asm \
+ -L/usr/local/lib \
+ -I/usr/local/include
+</configure>
+
+<build type="append">
+ ${MAKE} test || true
+</build>
+
+</source>
+
+<prepackage>
+# Put source back to pristine state
+rm ${builddir}/config
+cp ${builddir}/config.orig ${builddir}/config
+chmod 755 ${builddir}/config
+# Make man pages available from /usr/local/man
+mv ssl/man .
+# Make "this encap is installed" sentinal file available in /usr/local/var/encap
+test -d var || mkdir var
+test -d var/encap || mkdir var/encap
+touch var/encap/${ENCAP_PKGNAME}
+</prepackage>
+
+<encapinfo>
+description openssl8 - SSL encryption tool and library
+</encapinfo>
+</encap_profile>
Changes to src/encap-profiles/current/patch-2.5.9.ep
@@ -1,1 +1,76 @@
+<?xml version="1.0"?>
+
+<!-- $Id: patch-2.5.9.ep 49 2007-07-11 07:41:04Z dclark $ -->
+
+<encap_profile
+ profile_ver="1.0"
+ pkgspec="patch-2.5.9"
+>
+
+<prereq package="m4-1.4.4" />
+<prereq package="pkg-config-0.22" />
+
+<environment
+ variable="CC"
+ value="gcc -static-libgcc"
+ type="set"
+/>
+
+<environment
+ variable="PATH"
+PLATFORM_IF_MATCH(solaris)
+ value="/usr/local/bin:/usr/sfw/bin:/usr/ccs/bin:"
+PLATFORM_ELSE
+ value="/usr/local/bin:"
+PLATFORM_ENDIF
+ type="prepend"
+/>
+
+PLATFORM_IF_MATCH(linux)
+PLATFORM_ELSE
+<environment
+ variable="MAKE"
+ value="gmake"
+ type="set"
+/>
+PLATFORM_ENDIF
+
+<environment
+ variable="LDFLAGS"
+PLATFORM_IF_MATCH(linux)
+ value="-L/usr/local/lib -Wl,-rpath,/usr/local/lib -YP,/usr/local/lib:/lib:/usr/lib"
+PLATFORM_ELSE_IF_MATCH(aix)
+ value="-L/usr/local/lib -Wl,-blibpath:/usr/local/lib:/usr/lib"
+PLATFORM_ELSE_IF_MATCH(solaris)
+ value="-L/usr/local/lib -R/usr/local/lib:/usr/lib -YP,/usr/local/lib:/usr/lib"
+PLATFORM_ELSE
+PLATFORM_ENDIF
+ type="set"
+/>
+
+<environment
+ variable="CPPFLAGS"
+ value="-I/usr/local/include"
+ type="set"
+/>
+
+<source
+ url="http://encapsrcdist/mirror/patch/patch-2.5.9.tar.gz
+ http://mirror.opensysadmin.com/patch/patch-2.5.9.tar.gz
+ ftp://alpha.gnu.org/gnu/diffutils/patch-2.5.9.tar.gz"
+>
+
+</source>
+
+<prepackage type="set">
+# Make "this encap is installed" sentinal file available in /usr/local/var/encap
+test -d var || mkdir var
+test -d var/encap || mkdir var/encap
+touch var/encap/${ENCAP_PKGNAME}
+</prepackage>
+
+<encapinfo>
+description patch - apply a diff file to an original
+</encapinfo>
+</encap_profile>
Changes to src/encap-profiles/current/pkg-config-0.22.ep
@@ -1,1 +1,81 @@
+<?xml version="1.0"?>
+
+<!-- $Id: pkg-config-0.22.ep 49 2007-07-11 07:41:04Z dclark $ -->
+
+<encap_profile
+ profile_ver="1.0"
+ pkgspec="pkg-config-0.22"
+>
+
+<prereq package="m4-1.4.4" />
+
+<environment
+ variable="CC"
+ value="gcc -static-libgcc"
+ type="set"
+/>
+
+<environment
+ variable="PATH"
+PLATFORM_IF_MATCH(solaris)
+ value="/usr/local/bin:/usr/sfw/bin:/usr/ccs/bin:"
+PLATFORM_ELSE
+ value="/usr/local/bin:"
+PLATFORM_ENDIF
+ type="prepend"
+/>
+
+PLATFORM_IF_MATCH(linux)
+PLATFORM_ELSE
+<environment
+ variable="MAKE"
+ value="gmake"
+ type="set"
+/>
+PLATFORM_ENDIF
+
+<environment
+ variable="LDFLAGS"
+PLATFORM_IF_MATCH(linux)
+ value="-L/usr/local/lib -Wl,-rpath,/usr/local/lib -YP,/usr/local/lib:/lib:/usr/lib"
+PLATFORM_ELSE_IF_MATCH(aix)
+ value="-L/usr/local/lib -Wl,-blibpath:/usr/local/lib:/usr/lib"
+PLATFORM_ELSE_IF_MATCH(solaris)
+ value="-L/usr/local/lib -R/usr/local/lib:/usr/lib -YP,/usr/local/lib:/usr/lib"
+PLATFORM_ELSE
+PLATFORM_ENDIF
+ type="set"
+/>
+
+<environment
+ variable="CPPFLAGS"
+ value="-I/usr/local/include"
+ type="set"
+/>
+
+<source
+url="http://encapsrcdist/mirror/pkg-config/pkg-config-0.22.tar.gz
+ http://mirror.opensysadmin.com/pkg-config/pkg-config-0.22.tar.gz
+ http://pkgconfig.freedesktop.org/releases/pkg-config-0.22.tar.gz"
+>
+
+<configure>
+./configure \
+ --prefix="${ENCAP_SOURCE}/${ENCAP_PKGNAME}" \
+ --with-pc-path=/usr/local/lib/pkgconfig
+</configure>
+
+</source>
+
+<prepackage type="set">
+# Make "this encap is installed" sentinal file available in /usr/local/var/encap
+test -d var || mkdir var
+test -d var/encap || mkdir var/encap
+touch var/encap/${ENCAP_PKGNAME}
+</prepackage>
+
+<encapinfo>
+description pkg-config - application and library compilation helper tool
+</encapinfo>
+</encap_profile>
Changes to src/encap-profiles/current/python24-2.4.4.ep
@@ -1,1 +1,118 @@
+<?xml version="1.0"?>
+
+<!-- $Id: python24-2.4.4.ep 78 2007-07-18 08:51:19Z dclark $ -->
+
+<!-- On AIX 4.3.3 you need GNU binutils installed (from the IBM RPM) -->
+
+<encap_profile
+ profile_ver="1.0"
+ pkgspec="python24-2.4.4"
+>
+
+<prereq package="m4-1.4.4" />
+<prereq package="zlib-1.2.3" />
+<prereq package="gzip-1.2.4b" />
+<prereq package="pkg-config-0.22" />
+<prereq package="readline-5.2" />
+<prereq package="openssl8-0.9.8e" />
+<prereq package="patch-2.5.9" />
+
+<environment
+ variable="CC"
+ value="gcc -static-libgcc"
+ type="set"
+/>
+
+<environment
+ variable="PATH"
+PLATFORM_IF_MATCH(solaris)
+ value="/usr/local/bin:/usr/sfw/bin:/usr/ccs/bin:"
+PLATFORM_ELSE_IF_MATCH(aix4.3.3)
+ value="/usr/local/bin:/usr/linux/bin:"
+PLATFORM_ELSE
+ value="/usr/local/bin:"
+PLATFORM_ENDIF
+ type="prepend"
+/>
+
+PLATFORM_IF_MATCH(linux)
+PLATFORM_ELSE
+<environment
+ variable="MAKE"
+ value="gmake"
+ type="set"
+/>
+PLATFORM_ENDIF
+
+<environment
+ variable="LDFLAGS"
+PLATFORM_IF_MATCH(linux)
+ value="-L/usr/local/lib -Wl,-rpath,/usr/local/lib -YP,/usr/local/lib:/lib:/usr/lib"
+PLATFORM_ELSE_IF_MATCH(aix)
+ value="-L/usr/local/lib -Wl,-blibpath:/usr/local/lib:/usr/lib"
+PLATFORM_ELSE_IF_MATCH(solaris)
+ value="-L/usr/local/lib -R/usr/local/lib:/usr/lib -YP,/usr/local/lib:/usr/lib"
+PLATFORM_ELSE
+PLATFORM_ENDIF
+ type="set"
+/>
+
+<environment
+ variable="CPPFLAGS"
+ value="-I/usr/local/include"
+ type="set"
+/>
+
+PLATFORM_IF_MATCH(aix4.3.3)
+<environment
+ variable="NM"
+ value="/usr/linux/bin/nm"
+ type="set"
+/>
+PLATFORM_ELSE
+PLATFORM_ENDIF
+
+<source
+ url="http://encapsrcdist/mirror/python/Python-2.4.4.tgz
+ http://mirror.opensysadmin.com/python/Python-2.4.4.tgz
+ http://www.python.org/ftp/python/2.4.4/Python-2.4.4.tgz"
+>
+
+<configure>
+./configure \
+ --prefix="${ENCAP_SOURCE}/${ENCAP_PKGNAME}" \
+PLATFORM_IF_MATCH(linux)
+PLATFORM_ELSE
+ --with-gcc \
+PLATFORM_ENDIF
+ --enable-shared=no \
+ --disable-ipv6 \
+ --without-cxx
+</configure>
+
+<build type="append"><![CDATA[
+# Make sure linking to openssl worked
+${builddir}/python -c "from httplib import HTTPS" || HS="no"; \
+if [ "${HS}x" = "nox" ]; then \
+ printf "ERROR: HTTPS fails (usually a problem with linking against "; \
+ printf "openssl), aborting...\n"; \
+ exit 1; \
+else \
+ printf "INFO: HTTPS works\n"; \
+fi
+]]></build>
+
+</source>
+
+<prepackage><![CDATA[
+# Make "this encap is installed" sentinal file available in /usr/local/var/encap
+test -d var || mkdir var
+test -d var/encap || mkdir var/encap
+touch var/encap/${ENCAP_PKGNAME}
+]]></prepackage>
+
+<encapinfo>
+description python - scripting language
+</encapinfo>
+</encap_profile>
Changes to src/encap-profiles/current/readline-5.2.ep
@@ -1,1 +1,84 @@
+<?xml version="1.0"?>
+
+<!-- $Id: readline-5.2.ep 49 2007-07-11 07:41:04Z dclark $ -->
+
+<encap_profile
+ profile_ver="1.0"
+ pkgspec="readline-5.2"
+>
+
+<prereq package="m4-1.4.4" />
+<prereq package="pkg-config-0.22" />
+
+<environment
+ variable="CC"
+ value="gcc -static-libgcc"
+ type="set"
+/>
+
+<environment
+ variable="PATH"
+PLATFORM_IF_MATCH(solaris)
+ value="/usr/local/bin:/usr/sfw/bin:/usr/ccs/bin:"
+PLATFORM_ELSE
+ value="/usr/local/bin:"
+PLATFORM_ENDIF
+ type="prepend"
+/>
+
+PLATFORM_IF_MATCH(linux)
+PLATFORM_ELSE
+<environment
+ variable="MAKE"
+ value="gmake"
+ type="set"
+/>
+PLATFORM_ENDIF
+
+<environment
+ variable="LDFLAGS"
+PLATFORM_IF_MATCH(linux)
+ value="-L/usr/local/lib -Wl,-rpath,/usr/local/lib -YP,/usr/local/lib:/lib:/usr/lib"
+PLATFORM_ELSE_IF_MATCH(aix)
+ value="-L/usr/local/lib -Wl,-blibpath:/usr/local/lib:/usr/lib"
+PLATFORM_ELSE_IF_MATCH(solaris)
+ value="-L/usr/local/lib -R/usr/local/lib:/usr/lib -YP,/usr/local/lib:/usr/lib"
+PLATFORM_ELSE
+PLATFORM_ENDIF
+ type="set"
+/>
+
+<environment
+ variable="CPPFLAGS"
+ value="-I/usr/local/include"
+ type="set"
+/>
+
+<source
+url="http://encapsrcdist/mirror/readline/readline-5.2.tar.gz
+ http://mirror.opensysadmin.com/readline/readline-5.2.tar.gz
+ ftp://ftp.cwru.edu/pub/bash/readline-5.2.tar.gz"
+>
+
+<configure>
+./configure \
+ --prefix="${ENCAP_SOURCE}/${ENCAP_PKGNAME}" \
+ --with-curses=no \
+ --enable-shared=no \
+ --enable-static=yes
+</configure>
+
+</source>
+
+<prepackage type="set">
+# Make "this encap is installed" sentinal file available in /usr/local/var/encap
+test -d var || mkdir var
+test -d var/encap || mkdir var/encap
+touch var/encap/${ENCAP_PKGNAME}
+</prepackage>
+
+<encapinfo>
+description readline - lets users edit command lines as they are typed in
+</encapinfo>
+</encap_profile>
Changes to src/encap-profiles/current/rsync-2.6.9.ep
@@ -1,1 +1,93 @@
+<?xml version="1.0"?>
+
+<!-- $Id: rsync-2.6.9.ep 72 2007-07-18 01:23:43Z dclark $ -->
+
+<encap_profile
+ profile_ver="1.0"
+ pkgspec="rsync-2.6.9"
+>
+
+<prereq package="m4-1.4.4" />
+<prereq package="pkg-config-0.22" />
+<prereq package="readline-5.2" />
+
+<environment
+ variable="CC"
+ value="gcc -static-libgcc"
+ type="set"
+/>
+
+<environment
+ variable="PATH"
+PLATFORM_IF_MATCH(solaris)
+ value="/usr/local/bin:/usr/sfw/bin:/usr/ccs/bin:"
+PLATFORM_ELSE
+ value="/usr/local/bin:"
+PLATFORM_ENDIF
+ type="prepend"
+/>
+
+PLATFORM_IF_MATCH(linux)
+PLATFORM_ELSE
+<environment
+ variable="MAKE"
+ value="gmake"
+ type="set"
+/>
+PLATFORM_ENDIF
+
+<environment
+ variable="LDFLAGS"
+PLATFORM_IF_MATCH(linux)
+ value="-L/usr/local/lib -Wl,-rpath,/usr/local/lib -YP,/usr/local/lib:/lib:/usr/lib"
+PLATFORM_ELSE_IF_MATCH(aix)
+ value="-L/usr/local/lib -Wl,-blibpath:/usr/local/lib:/usr/lib"
+PLATFORM_ELSE_IF_MATCH(solaris)
+ value="-L/usr/local/lib -R/usr/local/lib:/usr/lib -YP,/usr/local/lib:/usr/lib"
+PLATFORM_ELSE
+PLATFORM_ENDIF
+ type="set"
+/>
+
+<environment
+ variable="CPPFLAGS"
+ value="-I/usr/local/include"
+ type="set"
+/>
+
+<source
+ url="http://encapsrcdist/mirror/rsync/rsync-2.6.9.tar.gz
+ http://mirror.opensysadmin.com/rsync/rsync-2.6.9.tar.gz
+ http://samba.anu.edu.au/ftp/rsync/rsync-2.6.9.tar.gz"
+>
+
+<configure><![CDATA[
+test -f config.h.orig && mv config.h.orig config.h || true
+./configure \
+ --prefix="${ENCAP_SOURCE}/${ENCAP_PKGNAME}" \
+ --sysconfdir="${ENCAP_TARGET}/etc" \
+ --disable-ipv6 \
+ --disable-locale \
+ --with-included-popt \
+ --with-rsyncd-conf=/usr/local/etc/rsyncd.conf
+PLATFORM_IF_MATCH(aix)
+cp config.h config.h.orig
+printf "\n#ifdef _LARGE_FILES\n#undef HAVE_SECURE_MKSTEMP\n#endif\n" >> config.h
+PLATFORM_ELSE
+PLATFORM_ENDIF
+]]></configure>
+
+</source>
+
+<prepackage type="set">
+# Make "this encap is installed" sentinal file available in /usr/local/var/encap
+test -d var || mkdir var
+test -d var/encap || mkdir var/encap
+touch var/encap/${ENCAP_PKGNAME}
+</prepackage>
+
+<encapinfo>
+description rsync - fast remote file copy program
+</encapinfo>
+</encap_profile>
Changes to src/encap-profiles/current/runit-utils-2.1.0.ep
@@ -1,1 +1,85 @@
+<?xml version="1.0"?>
+
+<!-- $Id: runit-utils-2.1.0.ep 50 2007-07-11 07:56:17Z dclark $ -->
+
+<encap_profile
+ profile_ver="1.0"
+ pkgspec="runit-utils-2.1.0"
+>
+
+<prereq package="m4-1.4.4" />
+
+<environment
+ variable="CC"
+ value="gcc -static-libgcc"
+ type="set"
+/>
+
+<environment
+ variable="PATH"
+PLATFORM_IF_MATCH(solaris)
+ value="/usr/local/lib/bcfg2/bin:/usr/local/bin:/usr/sfw/bin:/usr/ccs/bin:"
+PLATFORM_ELSE
+ value="/usr/local/lib/bcfg2/bin:/usr/local/bin:"
+PLATFORM_ENDIF
+ type="prepend"
+/>
+
+<environment
+ variable="CPPFLAGS"
+ value="-I/usr/local/lib"
+ type="set"
+/>
+
+PLATFORM_IF_MATCH(linux)
+PLATFORM_ELSE
+<environment
+ variable="MAKE"
+ value="gmake"
+ type="set"
+/>
+PLATFORM_ENDIF
+
+<source
+url="http://encapsrcdist/mirror/runit-utils/runit-utils-2.1.0.tar.gz
+ http://mirror.opensysadmin.com/runit-utils/runit-utils-2.1.0.tar.gz"
+use_objdir="no"
+subdir="admin/runit-utils-2.1.0"
+>
+
+<configure type="unset" />
+
+<build>
+./package/compile
+</build>
+
+<install>
+test -d ${ENCAP_SOURCE} || mkdir ${ENCAP_SOURCE}
+test -d ${ENCAP_SOURCE}/${ENCAP_PKGNAME} || mkdir ${ENCAP_SOURCE}/${ENCAP_PKGNAME}
+test -d ${ENCAP_SOURCE}/${ENCAP_PKGNAME}/bin || mkdir ${ENCAP_SOURCE}/${ENCAP_PKGNAME}/bin
+test -d ${ENCAP_SOURCE}/${ENCAP_PKGNAME}/share || mkdir ${ENCAP_SOURCE}/${ENCAP_PKGNAME}/share
+test -d ${ENCAP_SOURCE}/${ENCAP_PKGNAME}/share/doc || mkdir ${ENCAP_SOURCE}/${ENCAP_PKGNAME}/share/doc
+test -d ${ENCAP_SOURCE}/${ENCAP_PKGNAME}/share/doc/runit-utils || mkdir ${ENCAP_SOURCE}/${ENCAP_PKGNAME}/share/doc/runit-utils
+test -d ${ENCAP_SOURCE}/${ENCAP_PKGNAME}/man || mkdir ${ENCAP_SOURCE}/${ENCAP_PKGNAME}/man
+test -d ${ENCAP_SOURCE}/${ENCAP_PKGNAME}/man/man1 || mkdir ${ENCAP_SOURCE}/${ENCAP_PKGNAME}/man/man1
+cp command/* ${ENCAP_SOURCE}/${ENCAP_PKGNAME}/bin
+cp -r doc/* ${ENCAP_SOURCE}/${ENCAP_PKGNAME}/share/doc/runit-utils
+cp man/* ${ENCAP_SOURCE}/${ENCAP_PKGNAME}/man/man1
+</install>
+
+<clean type="unset" />
+
+</source>
+
+<prepackage>
+# Make "this encap is installed" sentinal file available in /usr/local/var/encap
+test -d var || mkdir var
+test -d var/encap || mkdir var/encap
+touch var/encap/${ENCAP_PKGNAME}
+</prepackage>
+
+<encapinfo>
+description runit-utils - tai64nlocal, tryto, and uncat
+</encapinfo>
+</encap_profile>
Changes to src/encap-profiles/current/sudo-1.6.9.ep
@@ -1,1 +1,239 @@
+<?xml version="1.0"?>
+
+<!-- $Id: sudo-1.6.9.ep 68 2007-07-17 21:11:03Z dclark $ -->
+
+<encap_profile
+ profile_ver="1.0"
+ pkgspec="sudo-1.6.9"
+>
+
+<prereq package="m4-1.4.4" />
+<prereq package="pkg-config-0.22" />
+
+<environment
+ variable="CC"
+ value="gcc -static-libgcc"
+ type="set"
+/>
+
+<environment
+ variable="PATH"
+PLATFORM_IF_MATCH(solaris)
+ value="/usr/local/bin:/usr/sfw/bin:/usr/ccs/bin:"
+PLATFORM_ELSE
+ value="/usr/local/bin:"
+PLATFORM_ENDIF
+ type="prepend"
+/>
+
+PLATFORM_IF_MATCH(linux)
+PLATFORM_ELSE
+<environment
+ variable="MAKE"
+ value="gmake"
+ type="set"
+/>
+PLATFORM_ENDIF
+
+<environment
+ variable="LDFLAGS"
+PLATFORM_IF_MATCH(linux)
+ value="-L/usr/local/lib -Wl,-rpath,/usr/local/lib -YP,/usr/local/lib:/lib:/usr/lib"
+PLATFORM_ELSE_IF_MATCH(aix)
+ value="-L/usr/local/lib -Wl,-blibpath:/usr/local/lib:/usr/lib"
+PLATFORM_ELSE_IF_MATCH(solaris)
+ value="-L/usr/local/lib -R/usr/local/lib:/usr/lib -YP,/usr/local/lib:/usr/lib"
+PLATFORM_ELSE
+PLATFORM_ENDIF
+ type="set"
+/>
+
+<environment
+ variable="CPPFLAGS"
+ value="-I/usr/local/include"
+ type="set"
+/>
+
+<source
+ url="http://encapsrcdist/mirror/sudo/sudo-1.6.9.tar.gz
+ http://mirror.opensysadmin.com/sudo/sudo-1.6.9.tar.gz
+ http://www.sudo.ws/sudo/dist/sudo-1.6.9.tar.gz"
+>
+
+<configure>
+${srcdir}/configure \
+PLATFORM_IF_MATCH(aix)
+ --with-aixauth \
+PLATFORM_ELSE
+ --with-pam \
+PLATFORM_ENDIF
+ --prefix="${ENCAP_SOURCE}/${ENCAP_PKGNAME}" \
+ --sysconfdir="/usr/local/etc" \
+ --with-ignore-dot \
+ --without-umask \
+ --with-tty-tickets \
+ --with-logging=both \
+ --with-passwd-tries=5 \
+ --enable-log-host \
+ --without-sendmail \
+ --with-logfac="auth" \
+ --with-stow \
+ --disable-log-wrap \
+ --without-ldap
+</configure>
+
+</source>
+
+<prepackage type="set">
+# Make "this encap is installed" sentinal file available in /usr/local/var/encap
+test -d var || mkdir var
+test -d var/encap || mkdir var/encap
+touch var/encap/${ENCAP_PKGNAME}
+</prepackage>
+
+<encapinfo>
+description SUperuser DO - allows users to execute commands as root
+exclude etc/sudoers
+</encapinfo>
+
+<include_file name="bin/xsudo" mode="0755"><![CDATA[
+#!/bin/sh
+#
+# This script allows you to use sudo to invoke an X application without
+# having to use "xhost +" or "xhost +<hostname>".
+#
+# It works by sending the MIT-MAGIC-COOKIE value through the sudo
+# command. The application then merges it into a private XAUTH file
+# before it runs.
+#
+# Because the application is assumed to be an X app, we redirect its
+# stderr (Gnome applications in particular tend to print a lot of crap
+# which is very annoying).
+
+# FIXME Aaron: xauth nmerge complains if its stdin is empty. The comment at
+# the start of the file says that stderr is redirected to deal with Gnome app
+# complaints. No redirection occurs in the script. It might be needed.
+# Or not.
+
+#
+# ????-??-?? Author: Paul D. Smith <psmith@bogus.example.com>
+
+# Initialize variables
+xauthbase=/tmp/.xsudo.
+xauthdir=$xauthbase/.`date +%Y%m%d%H%M%S`.$$
+xauthfile=$xauthdir/.Xauthority
+xumask=`umask`
+
+#
+# Error print and exit
+die () {
+ echo "ERROR: $*"
+ exit 1
+}
+
+[ -z "$DISPLAY" ] && die 'You must set the $DISPLAY variable before running xsudo.'
+
+#
+# Make sure we clean up after ourselves
+cleanup () {
+ rm -rf $xauthdir
+ umask $xumask
+}
+trap cleanup 0 1 2 3 10 12 14 15
+
+#
+# Create the private directory and cookiefile for this invocation
+[ -d $xauthbase ] || {
+ mkdir $xauthbase || die "cannot create shared directory '$xauthbase'"
+ chmod 1777 $xauthbase || die "cannot set permissions on '$xauthbase'"
+ }
+umask 077
+[ -d $xauthdir ] && die "'$xauthdir' already exists"
+mkdir $xauthdir || die "cannot create private directory '$xauthdir'"
+touch $xauthfile || die "cannot create file '$xauthfile'"
+
+#
+# Give over the cookie. Technically this needs to be done only once per
+# X session, but I don't know of any reliable way to manage this? I
+# suppose we could invoke the X program and if it fails due to
+# permission errors we could do this then retry. But, what's a good way
+# to know if it fails... just grabbing the errors? Ouch!
+xauth nlist $DISPLAY | XAUTHORITY="$xauthfile" xauth nmerge -
+
+# Now run the command
+XAUTHORITY="$xauthfile" /usr/local/bin/sudo "$*"
+
+# It worked; the trap above will clean up for us.
+# end of xsudo
+]]></include_file>
+
+<include_file name="preinstall" mode="0755"><![CDATA[
+#!/bin/sh
+
+# We remove the sudo rpm here if it exists, because if it is removed
+# later, it blows away /etc/pam.d/sudo, and causes sudo to fail
+rpm -e sudo 2>/dev/null || true
+
+# Clean up from past sudo installs
+FILES="/usr/local/bin/sudo /usr/bin/xsudo /usr/bin/wplc-sudo /usr/bin/sudo-wplc /usr/bin/osa-sudo /usr/bin/sudo-osa /usr/bin/sudo-nasa"
+
+for FILE in $FILES; do
+ if [ -f $FILE -o -h $FILE ]; then
+ rm $FILE
+ fi
+done
+
+# Get rid of sudoers files that are symlinks; they won't work.
+if [ -h /usr/local/etc/sudoers ]; then
+ rm /usr/local/etc/sudoers
+fi
+
+if [ -h /etc/sudoers ]; then
+ rm /etc/sudoers
+fi
+
+# Make sure we have some sudoers in place
+if [ ! -f /usr/local/etc/sudoers ]; then
+ if [ -f /etc/sudoers ]; then
+ echo "No /usr/local/etc/sudoers, copying /etc/sudoers..."
+ cp /etc/sudoers /usr/local/etc/sudoers
+ else
+ echo "Installing default /usr/local/etc/sudoers"
+ cp ${ENCAP_SOURCE}/${ENCAP_PKGNAME}/etc/sudoers /usr/local/etc/sudoers
+ fi
+fi
+
+chmod 0440 /usr/local/etc/sudoers
+chown 0 /usr/local/etc/sudoers
+chgrp 0 /usr/local/etc/sudoers
+
+# If we are using PAM, we want the same auth behavior as login.
+if [ -f /etc/pam.d/login ]; then
+ if [ ! -f /etc/pam.d/sudo ]; then
+ echo "Copying /etc/pam.d/login over to /etc/pam.d/sudo"
+ cp -p /etc/pam.d/login /etc/pam.d/sudo
+ fi
+fi
+]]></include_file>
+
+<include_file name="postremove" mode="0755"><![CDATA[
+#!/bin/sh
+
+FILES="/usr/local/bin/sudo /usr/bin/xsudo /usr/bin/wplc-sudo /usr/bin/sudo-wplc /usr/bin/osa-sudo /usr/bin/sudo-osa /usr/bin/sudo-nasa"
+
+for FILE in $FILES; do
+ if [ -f $FILE -o -h $FILE ]; then
+ rm $FILE
+ fi
+done
+
+if [ -h /etc/sudoers -a ! -h /usr/local/etc/sudoers ]; then
+ rm /etc/sudoers
+ mv /usr/local/etc/sudoers /etc/sudoers
+ chmod 0440 /etc/sudoers
+ chown 0 /etc/sudoers
+ chgrp 0 /etc/sudoers
+fi
+]]></include_file>
+</encap_profile>
Changes to src/encap-profiles/current/sudosh-1.8.2.ep
@@ -1,1 +1,99 @@
+<?xml version="1.0"?>
+
+<!-- $Id$ -->
+
+<encap_profile
+ profile_ver="1.0"
+ pkgspec="sudosh-1.8.2"
+>
+
+<prereq package="m4-1.4.4" />
+<prereq package="patch-2.5.9" />
+<prereq package="pkg-config-0.22" />
+<prereq package="readline-5.2" />
+<prereq package="sudo-1.6.9" />
+
+<environment
+ variable="CC"
+ value="gcc -static-libgcc"
+ type="set"
+/>
+
+<environment
+ variable="PATH"
+PLATFORM_IF_MATCH(solaris)
+ value="/usr/local/bin:/usr/sfw/bin:/usr/ccs/bin:"
+PLATFORM_ELSE
+ value="/usr/local/bin:"
+PLATFORM_ENDIF
+ type="prepend"
+/>
+
+PLATFORM_IF_MATCH(linux)
+PLATFORM_ELSE
+<environment
+ variable="MAKE"
+ value="gmake"
+ type="set"
+/>
+PLATFORM_ENDIF
+
+<environment
+ variable="LDFLAGS"
+PLATFORM_IF_MATCH(linux)
+ value="-L/usr/local/lib -Wl,-rpath,/usr/local/lib -YP,/usr/local/lib:/lib:/usr/lib"
+PLATFORM_ELSE_IF_MATCH(aix)
+ value="-L/usr/local/lib -Wl,-blibpath:/usr/local/lib:/usr/lib"
+PLATFORM_ELSE_IF_MATCH(solaris)
+ value="-L/usr/local/lib -R/usr/local/lib:/usr/lib -YP,/usr/local/lib:/usr/lib"
+PLATFORM_ELSE
+PLATFORM_ENDIF
+ type="set"
+/>
+
+<environment
+ variable="CPPFLAGS"
+ value="-I/usr/local/include"
+ type="set"
+/>
+
+<source
+url="http://encapsrcdist/mirror/sudosh/sudosh-1.8.2.tar.gz
+ http://mirror.opensysadmin.com/sudosh/sudosh-1.8.2.tar.gz
+ http://sudosh.sourceforge.net/sudosh-1.8.2.tar.gz"
+>
+
+<patch options="-p0"><![CDATA[
+--- src/parse.c.orig Sun Jun 12 16:22:42 2005
++++ src/parse.c Fri Jan 5 17:54:55 2007
+@@ -19,7 +19,8 @@
+ void parse(option * o, const char *file)
+ {
+ FILE *f = fopen(file, "r");
+- unsigned int line_number, i;
++ unsigned int line_number;
++ int i;
+ char line[BUFSIZ];
+ char *arg, *cmt, *opt;
+ config *scan;
+
+]]></patch>
+
+<clean type="append">
+${MAKE} distclean
+</clean>
+
+</source>
+
+<prepackage type="set">
+# Make "this encap is installed" sentinal file available in /usr/local/var/encap
+test -d var || mkdir var
+test -d var/encap || mkdir var/encap
+touch var/encap/${ENCAP_PKGNAME}
+</prepackage>
+
+<encapinfo>
+description sudosh - allows the execution of a shell with logging
+</encapinfo>
+</encap_profile>
Changes to src/encap-profiles/current/zlib-1.2.3.ep
@@ -1,1 +1,94 @@
+<?xml version="1.0"?>
+
+<!-- $Id: zlib-1.2.3.ep 49 2007-07-11 07:41:04Z dclark $ -->
+
+<encap_profile
+ profile_ver="1.0"
+ pkgspec="zlib-1.2.3"
+>
+
+<prereq package="m4-1.4.4" />
+<prereq package="pkg-config-0.22" />
+
+<environment
+ variable="CC"
+ value="gcc -static-libgcc -fPIC"
+ type="set"
+/>
+
+<environment
+ variable="PATH"
+PLATFORM_IF_MATCH(solaris)
+ value="/usr/local/bin:/usr/sfw/bin:/usr/ccs/bin:"
+PLATFORM_ELSE
+ value="/usr/local/bin:"
+PLATFORM_ENDIF
+ type="prepend"
+/>
+
+PLATFORM_IF_MATCH(linux)
+PLATFORM_ELSE
+<environment
+ variable="MAKE"
+ value="gmake"
+ type="set"
+/>
+PLATFORM_ENDIF
+
+<environment
+ variable="LDFLAGS"
+PLATFORM_IF_MATCH(linux)
+ value="-L/usr/local/lib -Wl,-rpath,/usr/local/lib -YP,/usr/local/lib:/lib:/usr/lib"
+PLATFORM_ELSE_IF_MATCH(aix)
+ value="-L/usr/local/lib -Wl,-blibpath:/usr/local/lib:/usr/lib"
+PLATFORM_ELSE_IF_MATCH(solaris)
+ value="-L/usr/local/lib -R/usr/local/lib:/usr/lib -YP,/usr/local/lib:/usr/lib"
+PLATFORM_ELSE
+PLATFORM_ENDIF
+ type="set"
+/>
+
+<environment
+ variable="CPPFLAGS"
+ value="-I/usr/local/include"
+ type="set"
+/>
+
+PLATFORM_IF_MATCH(solaris)
+<environment
+ variable="CFLAGS"
+ type="unset"
+/>
+PLATFORM_ENDIF
+
+<source
+ url="http://encapsrcdist/mirror/zlib/zlib-1.2.3.tar.gz
+ http://mirror.opensysadmin.com/zlib/zlib-1.2.3.tar.gz
+ http://www.zlib.net/zlib-1.2.3.tar.gz"
+>
+
+<configure>
+./configure \
+PLATFORM_IF_MATCH(aix)
+PLATFORM_ELSE
+ --shared \
+PLATFORM_ENDIF
+ --prefix="${ENCAP_SOURCE}/${ENCAP_PKGNAME}"
+</configure>
+
+</source>
+
+<prepackage type="set">
+# Make man pages available from /usr/local/man
+mv share/man .
+# Make "this encap is installed" sentinal file available in /usr/local/var/encap
+test -d var || mkdir var
+test -d var/encap || mkdir var/encap
+touch var/encap/${ENCAP_PKGNAME}
+</prepackage>
+
+<encapinfo>
+description zlib - compression library
+</encapinfo>
+</encap_profile>
Changes to src/encap-profiles/depricated/ORDER
@@ -1,1 +1,10 @@ - +patch +zlib +bash +ntp +sudo +prngd +openssl +db +cfengine +openssh
Changes to src/encap-profiles/depricated/apr-0.9.12.ep
@@ -1,1 +1,78 @@
+<?xml version="1.0"?>
+
+<!-- $Id$ -->
+
+<encap_profile
+ profile_ver="1.0"
+ pkgspec="apr-0.9.12"
+>
+
+<prereq package="m4-1.4.4" />
+<prereq package="zlib-1.2.3" />
+<prereq package="libiconv-1.9.2" />
+<prereq package="gettext-0.14.5" />
+<prereq package="pkg-config-0.20" />
+
+<environment
+ variable="CC"
+ value="gcc"
+ type="set"
+/>
+
+<environment
+ variable="PATH"
+PLATFORM_IF_MATCH(solaris)
+ value="/usr/local/bin:/usr/sfw/bin:/usr/ccs/bin:"
+PLATFORM_ELSE
+ value="/usr/local/bin:"
+PLATFORM_ENDIF
+ type="prepend"
+/>
+
+PLATFORM_IF_MATCH(linux)
+PLATFORM_ELSE
+<environment
+ variable="MAKE"
+ value="gmake"
+ type="set"
+/>
+PLATFORM_ENDIF
+
+<environment
+ variable="LDFLAGS"
+PLATFORM_IF_MATCH(linux)
+ value="-L/usr/local/lib -Wl,-rpath,/usr/local/lib"
+PLATFORM_ELSE_IF_MATCH(aix)
+ value="-L/usr/local/lib -Wl,-blibpath:/usr/local/lib:/usr/lib"
+PLATFORM_ELSE_IF_MATCH(solaris)
+ value="-L/usr/local/lib -R/usr/local/lib:/usr/lib -YP,/usr/local/lib:/usr/lib"
+PLATFORM_ELSE
+PLATFORM_ENDIF
+ type="set"
+/>
+
+<environment
+ variable="CPPFLAGS"
+ value="-I/usr/local/include"
+ type="set"
+/>
+
+<source
+ url="http://www.pobox.com/users/dclark/mirror/apr/apr-0.9.12.tar.gz
+ http://www.ibiblio.org/pub/mirrors/apache/apr/apr-0.9.12.tar.gz"
+>
+
+</source>
+
+<prepackage type="set">
+# Make "this encap is installed" sentinal file available in /usr/local/var/encap
+test -d var || mkdir var
+test -d var/encap || mkdir var/encap
+touch var/encap/${ENCAP_PKGNAME}
+</prepackage>
+
+<encapinfo>
+description apr - apache portable runtime
+</encapinfo>
+</encap_profile>
Changes to src/encap-profiles/depricated/apr-util-0.9.12.ep
@@ -1,1 +1,87 @@
+<?xml version="1.0"?>
+
+<!-- $Id$ -->
+
+<encap_profile
+ profile_ver="1.0"
+ pkgspec="apr-util-0.9.12"
+>
+
+<prereq package="m4-1.4.4" />
+<prereq package="zlib-1.2.3" />
+<prereq package="libiconv-1.9.2" />
+<prereq package="gettext-0.14.5" />
+<prereq package="pkg-config-0.20" />
+<prereq package="apr-0.9.12" />
+
+<environment
+ variable="CC"
+ value="gcc"
+ type="set"
+/>
+
+<environment
+ variable="PATH"
+PLATFORM_IF_MATCH(solaris)
+ value="/usr/local/bin:/usr/sfw/bin:/usr/ccs/bin:"
+PLATFORM_ELSE
+ value="/usr/local/bin:"
+PLATFORM_ENDIF
+ type="prepend"
+/>
+
+PLATFORM_IF_MATCH(linux)
+PLATFORM_ELSE
+<environment
+ variable="MAKE"
+ value="gmake"
+ type="set"
+/>
+PLATFORM_ENDIF
+
+<environment
+ variable="LDFLAGS"
+PLATFORM_IF_MATCH(linux)
+ value="-L/usr/local/lib -Wl,-rpath,/usr/local/lib"
+PLATFORM_ELSE_IF_MATCH(aix)
+ value="-L/usr/local/lib -Wl,-blibpath:/usr/local/lib:/usr/lib"
+PLATFORM_ELSE_IF_MATCH(solaris)
+ value="-L/usr/local/lib -R/usr/local/lib:/usr/lib -YP,/usr/local/lib:/usr/lib"
+PLATFORM_ELSE
+PLATFORM_ENDIF
+ type="set"
+/>
+
+<environment
+ variable="CPPFLAGS"
+ value="-I/usr/local/include"
+ type="set"
+/>
+
+<source
+url="http://www.pobox.com/users/dclark/mirror/apr-util/apr-util-0.9.12.tar.gz
+ http://www.ibiblio.org/pub/mirrors/apache/apr/apr-util-0.9.12.tar.gz"
+>
+
+<configure>
+./configure \
+ --prefix="${ENCAP_SOURCE}/${ENCAP_PKGNAME}" \
+ --with-apr=/usr/local \
+ --with-expat=builtin \
+ --with-iconv=/usr/local
+</configure>
+
+</source>
+
+<prepackage type="set">
+# Make "this encap is installed" sentinal file available in /usr/local/var/encap
+test -d var || mkdir var
+test -d var/encap || mkdir var/encap
+touch var/encap/${ENCAP_PKGNAME}
+</prepackage>
+
+<encapinfo>
+description apr-util - apache portable runtime utilities
+</encapinfo>
+</encap_profile>
Changes to src/encap-profiles/depricated/autoconf-2.61.ep
@@ -1,1 +1,76 @@
+<?xml version="1.0"?>
+
+<!-- $Id$ -->
+
+<encap_profile
+ profile_ver="1.0"
+ pkgspec="autoconf-2.61"
+>
+
+<prereq package="m4-1.4.4" />
+<prereq package="pkg-config-0.22" />
+
+<environment
+ variable="CC"
+ value="gcc -static-libgcc"
+ type="set"
+/>
+
+<environment
+ variable="PATH"
+ PLATFORM_IF_MATCH(solaris)
+ value="/usr/local/bin:/usr/sfw/bin:/usr/ccs/bin:"
+ PLATFORM_ELSE
+ value="/usr/local/bin:"
+ PLATFORM_ENDIF
+ type="prepend"
+/>
+
+PLATFORM_IF_MATCH(linux)
+PLATFORM_ELSE
+<environment
+ variable="MAKE"
+ value="gmake"
+ type="set"
+/>
+PLATFORM_ENDIF
+
+<environment
+ variable="LDFLAGS"
+PLATFORM_IF_MATCH(linux)
+ value="-L/usr/local/lib -Wl,-rpath,/usr/local/lib -YP,/usr/local/lib:/lib:/usr/lib"
+PLATFORM_ELSE_IF_MATCH(aix)
+ value="-L/usr/local/lib -Wl,-blibpath:/usr/local/lib:/usr/lib"
+PLATFORM_ELSE_IF_MATCH(solaris)
+ value="-L/usr/local/lib -R/usr/local/lib:/usr/lib -YP,/usr/local/lib:/usr/lib"
+PLATFORM_ELSE
+PLATFORM_ENDIF
+ type="set"
+/>
+
+<environment
+ variable="CPPFLAGS"
+ value="-I/usr/local/include"
+ type="set"
+/>
+<source
+url="http://encapsrcdist/mirror/autoconf/autoconf-2.61.tar.gz
+ http://mirror.opensysadmin.com/autoconf/autoconf-2.61.tar.gz
+ http://ftp.gnu.org/gnu/autoconf/autoconf-2.61.tar.gz"
+ use_objdir="no"
+>
+
+</source>
+
+<prepackage>
+# encap stuff
+mkdir var 2>/dev/null || exit 0
+mkdir var/encap 2>/dev/null || exit 0
+touch var/encap/${ENCAP_PKGNAME}
+</prepackage>
+
+<encapinfo>
+description autoconf - automatic configure script builder
+</encapinfo>
+</encap_profile>
Changes to src/encap-profiles/depricated/automake-1.10.ep
@@ -1,1 +1,77 @@
+<?xml version="1.0"?>
+
+<!-- $Id$ -->
+
+<encap_profile
+ profile_ver="1.0"
+ pkgspec="automake-1.10"
+>
+
+<prereq package="m4-1.4.4" />
+<prereq package="pkg-config-0.22" />
+
+<environment
+ variable="CC"
+ value="gcc -static-libgcc"
+ type="set"
+/>
+
+<environment
+ variable="PATH"
+PLATFORM_IF_MATCH(solaris)
+ value="/usr/local/bin:/usr/sfw/bin:/usr/ccs/bin:"
+PLATFORM_ELSE
+ value="/usr/local/bin:"
+PLATFORM_ENDIF
+ type="prepend"
+/>
+
+PLATFORM_IF_MATCH(linux)
+PLATFORM_ELSE
+<environment
+ variable="MAKE"
+ value="gmake"
+ type="set"
+/>
+PLATFORM_ENDIF
+
+<environment
+ variable="LDFLAGS"
+PLATFORM_IF_MATCH(linux)
+ value="-L/usr/local/lib -Wl,-rpath,/usr/local/lib -YP,/usr/local/lib:/lib:/usr/lib"
+PLATFORM_ELSE_IF_MATCH(aix)
+ value="-L/usr/local/lib -Wl,-blibpath:/usr/local/lib:/usr/lib"
+PLATFORM_ELSE_IF_MATCH(solaris)
+ value="-L/usr/local/lib -R/usr/local/lib:/usr/lib -YP,/usr/local/lib:/usr/lib"
+PLATFORM_ELSE
+PLATFORM_ENDIF
+ type="set"
+/>
+
+<environment
+ variable="CPPFLAGS"
+ value="-I/usr/local/include"
+ type="set"
+/>
+
+<source
+url="http://encapsrcdist/mirror/automake/automake-1.10.tar.gz
+ http://mirror.opensysadmin.com/automake/automake-1.10.tar.gz
+ http://ftp.gnu.org/gnu/automake/automake-1.10.tar.gz"
+ use_objdir="no"
+>
+
+</source>
+
+<prepackage>
+# encap stuff
+mkdir var 2>/dev/null || exit 0
+mkdir var/encap 2>/dev/null || exit 0
+touch var/encap/${ENCAP_PKGNAME}
+</prepackage>
+
+<encapinfo>
+description automake - A tool for generating GNU Standards-compliant Makefiles
+</encapinfo>
+</encap_profile>
Changes to src/encap-profiles/depricated/buildbot-0.7.4.ep
@@ -1,1 +1,2 @@ - +http://www.dclark.us/mirror/buildbot/buildbot-0.7.4.tar.gz +http://umn.dl.sourceforge.net/sourceforge/buildbot/buildbot-0.7.4.tar.gz
Changes to src/encap-profiles/depricated/cdrtools-2.00.3.profile
@@ -1,1 +1,61 @@
+<?xml version="1.0"?>
+
+<!-- $Id$ -->
+
+<encap_profile
+ profile_ver="1.0"
+ pkgspec="cdrtools-2.00.3"
+>
+
+<prereq package="zlib-1.2.1" use_lib="yes" />
+<prereq package="smake-1.2a22" use_bin="yes" />
+
+<environment
+ variable="CC"
+ value="gcc"
+ type="set"
+/>
+
+<environment
+ variable="PATH"
+ value="/usr/local/bin:"
+ type="prepend"
+/>
+
+<environment
+ variable="MAKE"
+ value="smake"
+ type="set"
+/>
+
+<source
+ url="ftp://ftp.berlios.de/pub/cdrecord/cdrtools-2.00.3.tar.gz"
+>
+
+<configure type="unset" />
+
+<install>
+${MAKE} INS_BASE=${ENCAP_SOURCE}/${ENCAP_PKGNAME} install
+</install>
+
+</source>
+
+<prepackage>
+${STRIP} bin/cdda2wav
+${STRIP} bin/cdrecord
+${STRIP} bin/devdump
+${STRIP} bin/isodebug
+${STRIP} bin/isodump
+${STRIP} bin/isoinfo
+${STRIP} bin/isovfy
+${STRIP} bin/mkhybrid
+${STRIP} bin/readcd
+${STRIP} bin/scgcheck
+${STRIP} sbin/rscsi
+</prepackage>
+
+<encapinfo>
+description smake - Schily SING makefile system
+</encapinfo>
+</encap_profile>
Changes to src/encap-profiles/depricated/cfengine-2.1.6.profile
@@ -1,1 +1,267 @@
+<?xml version="1.0"?>
+
+<!-- $Id$ -->
+
+<encap_profile
+ profile_ver="1.0"
+ pkgspec="cfengine-2.1.6"
+>
+
+<prereq package="openssl-0.9.7d" use_lib="yes" />
+<prereq package="db-4.2.52" use_lib="yes" />
+
+<environment
+ variable="LD_RUN_PATH"
+ value="/usr/local/lib"
+ type="set"
+/>
+
+<environment
+ variable="CC"
+ value="gcc"
+ type="set"
+/>
+
+PLATFORM_IF_MATCH(linux)
+PLATFORM_ELSE
+<environment
+ variable="MAKE"
+ value="gmake"
+ type="set"
+/>
+PLATFORM_ENDIF
+
+<environment
+ variable="PATH"
+ value="/usr/local/bin:"
+ type="prepend"
+/>
+
+<source
+ url="http://www.gtlib.gatech.edu/pub/Cfengine/cfengine-2.1.6.tar.gz"
+>
+
+</source>
+
+<prepackage type="set">
+ ${STRIP} sbin/cfagent
+ ${STRIP} sbin/cfenvd
+ ${STRIP} sbin/cfenvgraph
+ ${STRIP} sbin/cfexecd
+ ${STRIP} sbin/cfkey
+ ${STRIP} sbin/cfrun
+ ${STRIP} sbin/cfservd
+ rm -rf share
+ rm -rf doc
+ mkdir var
+ mkdir var/ppkeys
+ mkdir var/inputs
+</prepackage>
+
+<!-- Replace this with your site's update.conf -->
+<include_file name="var/inputs/update.conf" mode="0644"><![CDATA[
+#---------------------------------------------------------------------------
+#
+# BEGIN update.conf for OpenSysAdmin.com
+#
+# This script only distributes the configuration, a simple file so that,
+# if there are syntax errors in the main config, we can still
+# distribute a correct configuration to the machines afterwards, even
+# though the main config won't parse. It is read and run just before the
+# main configuration is parsed.
+#
+# $Id$
+#
+#---------------------------------------------------------------------------
+
+control:
+
+ # Change to <Some_RT_Queue@rt.opensysadmin.com> after testing...
+ sysadm = ( dclark@opensysadmin.com )
+
+ domain = ( ExecResult(/bin/sh -c "nslookup `hostname` 2>/dev/null | grep Name | awk '{print $2}' | sed 's/[^.][^.]*\.//') )
+
+ # Keep this simple and constant
+ actionsequence = ( copy tidy )
+
+ workdir = ( /var/cfengine )
+ sourcedir = ( /usr/local/var/cfengine )
+ policyhost = ( config.opensysadmin.com )
+ cfbindir = ( /usr/local/sbin )
+
+ SplayTime = ( 0 )
+ IfElapsed = ( 0 )
+
+#---------------------------------------------------------------------------
+#
+# Make sure there is a local copy of the configuration and
+# the most important binaries in case we have no connectivity
+# e.g. for mobile stations or during DOS attacks
+#
+
+copy:
+
+ ${sourcedir} dest=${workdir}
+ r=inf
+ mode=750
+ type=binary
+ owner=root
+ group=0
+ exclude=*.lst
+ exclude=*~
+ exclude=*.swp
+ exclude=*.swo
+ exclude=#*
+ server=${policyhost}
+ trustkey=false
+ encrypt=true
+ verify=true
+
+ ${cfbindir}/cfagent dest=${workdir}/bin/cfagent
+ mode=755
+ type=checksum
+ typecheck=off
+ linktype=copy
+
+ ${cfbindir}/cfservd dest=${workdir}/bin/cfservd
+ mode=755
+ type=checksum
+ typecheck=off
+ linktype=copy
+
+ ${cfbindir}/cfexecd dest=${workdir}/bin/cfexecd
+ mode=755
+ type=checksum
+ typecheck=off
+ linktype=copy
+
+ ${workdir}/ppkeys/localhost.pub dest=/etc/cfkey.pub
+ mode=644
+ owner=root
+ group=root
+
+#---------------------------------------------------------------------------
+
+tidy:
+
+ ${workdir}/outputs pattern=* age=7
+
+#---------------------------------------------------------------------------
+#
+# END update.conf
+#
+#---------------------------------------------------------------------------
+]]></include_file>
+
+<!-- Replace this with the public key of your site's server -->
+<include_file name="var/ppkeys/root-9.33.83.114.pub" mode="0600"><![CDATA[
+-----BEGIN RSA PUBLIC KEY-----
+MIIBCAKCAQEA6JaIAIDdUnHy3/anrl/o2SVdLjUvk1rq9IBVZ6rH6aONA/LPoiqS
+XSbmIJEA5gpyMk2DOdb1nwLntBxqVOHpjKYRqLVfQUip7+xwllU6BMyB9us69Q9d
+mdzkx4pyVbfadJuXn+tu9rme2RH/hag/qAZ5k/NNLa+duju0b01yPPn6vsNv1OtE
+h+d/Q2gxKCSA78pGLA7rhDBEILIkdZXnsbamm4qlRDZZEl20DOfHneQ+Reb9n+1C
+ERXo1aucrQJ2lDkuh/Ei8RvRM7uWFQW6WzdUi+Zi6m/7pVDRNXBpCEeYVBn6hS1F
+53vaO4YCGqP/41o3doS7ZJboH9B0j7CbyQIBIw==
+-----END RSA PUBLIC KEY-----
+]]></include_file>
+
+<include_file name="postinstall" mode="0755"><![CDATA[
+#!/bin/sh
+
+WORKDIR="/var/cfengine"
+WORKDIRS="${WORKDIR} ${WORKDIR}/bin ${WORKDIR}/inputs ${WORKDIR}/outputs"
+CFBINS="cfagent cfdoc cfenvd cfenvgraph cfexecd cfkey cfrun cfservd"
+SERVERKEY="root-9.33.83.114.pub"
+
+#
+# Install cfengine binaries, update.conf and keys to ${WORKDIR}
+#
+
+# Make directories
+for dir in ${WORKDIRS}; do
+ if [ ! -d ${dir} ]; then
+ echo "Making directory ${dir}..."
+ mkdir ${dir}
+ chown 0 ${dir}
+ chgrp 0 ${dir}
+ chmod 0755 ${dir}
+ fi
+done
+
+# Install binaries
+for bin in ${CFBINS}; do
+ echo "Installing ${WORKDIR}/bin/${bin}..."
+ cp ${ENCAP_SOURCE}/${ENCAP_PKGNAME}/sbin/${bin} ${WORKDIR}/bin/${bin}
+ chown 0 ${WORKDIR}/bin/${bin}
+ chgrp 0 ${WORKDIR}/bin/${bin}
+ chmod 0755 ${WORKDIR}/bin/${bin}
+done
+
+# Install update.conf
+if [ ! -f ${WORKDIR}/inputs/update.conf ]; then
+ echo "Installing ${WORKDIR}/inputs/update.conf..."
+ rm -f ${WORKDIR}/inputs/update.conf
+ cp ${ENCAP_SOURCE}/${ENCAP_PKGNAME}/var/inputs/update.conf ${WORKDIR}/inputs/update.conf
+ chown 0 ${WORKDIR}/inputs/update.conf
+ chgrp 0 ${WORKDIR}/inputs/update.conf
+ chmod 0644 ${WORKDIR}/inputs/update.conf
+fi
+
+# Generate localhost keys if they don't exist
+if [ ! -f ${WORKDIR}/ppkeys/localhost.priv ]; then
+ echo "Generating cfengine2 host key pair..."
+ ${WORKDIR}/bin/cfkey
+fi
+
+# Copy over server public key to local install
+if [ ! -f ${WORKDIR}/ppkeys/${SERVERKEY} ]; then
+ echo "Copying over server public key..."
+ cp ${ENCAP_SOURCE}/${ENCAP_PKGNAME}/var/ppkeys/${SERVERKEY} ${WORKDIR}/ppkeys/${SERVERKEY}
+fi
+
+#
+# Make cfengine start in daemon mode at boot (in addtion to crontab method)
+#
+
+PLATFORM_IF_MATCH(linux)
+# TODO -
+# - look at config:/usr/local/src/cfengine2-2.0.9+2.1.0b5/debian/cfengine2.init
+PLATFORM_ENDIF
+
+PLATFORM_IF_MATCH(aix)
+grep cfexecd /etc/rc.tcpip > /dev/null 2>&1;
+if [ $? -ne 0 ]; then
+ echo "Adding cfexecd to /etc/rc.tcpip";
+ cp /etc/rc.tcpip /etc/rc.tcpip.pre.${ENCAP_PKGNAME};
+ sed "s:${WORKDIR}:${WORKDIR}:g" >> /etc/rc.tcpip <<EOF
+# start cfexecd
+${WORKDIR}/bin/cfexecd && echo "started cfexecd"
+
+EOF
+fi
+PLATFORM_ENDIF
+
+#
+# Run cfagent with update.conf to pull down latest config from master server,
+# and then again so that cfexecd get added to crontab.
+#
+
+echo "Getting inputs and installing cfexecd -F in crontab..."
+/var/cfengine/bin/cfexecd --no-fork --once --foreground
+/var/cfengine/bin/cfexecd && echo "started cfexecd daemon"
+
+]]></include_file>
+
+<encapinfo>
+description GNU Configuration Engine
+prereq pkgspec >= openssl-0.9.7d
+prereq pkgspec >= db-4.2.52
+PLATFORM_IF_MATCH(aix5\.2\|solaris8\|solaris9\|linux)
+PLATFORM_ELSE
+prereq pkgspec >= prngd-0.9.27
+PLATFORM_ENDIF
+exclude var
+</encapinfo>
+
+</encap_profile>
Changes to src/encap-profiles/depricated/cheetah-2.0rc8.ep
@@ -1,1 +1,97 @@
+<?xml version="1.0"?>
+
+<!-- $Id$ -->
+
+<encap_profile
+ profile_ver="1.0"
+ pkgspec="cheetah-2.0rc8"
+>
+
+<prereq package="m4-1.4.4" />
+<prereq package="python24-2.4.4" />
+
+<environment
+ variable="CC"
+ value="gcc -static-libgcc"
+ type="set"
+/>
+
+<environment
+ variable="PATH"
+PLATFORM_IF_MATCH(solaris)
+ value="/usr/local/bin:/usr/sfw/bin:/usr/ccs/bin:"
+PLATFORM_ELSE
+ value="/usr/local/bin:"
+PLATFORM_ENDIF
+ type="prepend"
+/>
+
+PLATFORM_IF_MATCH(linux)
+PLATFORM_ELSE
+<environment
+ variable="MAKE"
+ value="gmake"
+ type="set"
+/>
+PLATFORM_ENDIF
+
+<environment
+ variable="LDFLAGS"
+PLATFORM_IF_MATCH(linux)
+ value="-L/usr/local/lib -Wl,-rpath,/usr/local/lib -YP,/usr/local/lib:/lib:/usr/lib"
+PLATFORM_ELSE_IF_MATCH(aix)
+ value="-L/usr/local/lib -Wl,-blibpath:/usr/local/lib:/usr/lib"
+PLATFORM_ELSE_IF_MATCH(solaris)
+ value="-L/usr/local/lib -R/usr/local/lib:/usr/lib -YP,/usr/local/lib:/usr/lib"
+PLATFORM_ELSE
+PLATFORM_ENDIF
+ type="set"
+/>
+
+<environment
+ variable="CPPFLAGS"
+ value="-I/usr/local/include"
+ type="set"
+/>
+
+<source
+url="http://encapsrcdist/mirror/cheetah/Cheetah-2.0rc8.tar.gz
+ http://mirror.opensysadmin.com/cheetah/Cheetah-2.0rc8.tar.gz
+http://umn.dl.sourceforge.net/sourceforge/cheetahtemplate/Cheetah-2.0rc8.tar.gz"
+>
+
+<configure>
+/usr/local/bin/python2.4 setup.py build_ext \
+-I/usr/local/include \
+-L/usr/local/lib \
+-L/usr/local/lib/python2.4/site-packages
+</configure>
+
+<build>
+/usr/local/bin/python2.4 setup.py build \
+--build-base=${builddir}/build
+</build>
+
+<install>
+/usr/local/bin/python2.4 setup.py install \
+--prefix=${ENCAP_SOURCE}/${ENCAP_PKGNAME}
+</install>
+
+<clean>
+/usr/local/bin/python2.4 setup.py clean --all
+</clean>
+
+</source>
+
+<prepackage type="set">
+# Make "this encap is installed" sentinal file available in /usr/local/var/encap
+test -d var || mkdir var
+test -d var/encap || mkdir var/encap
+touch var/encap/${ENCAP_PKGNAME}
+</prepackage>
+
+<encapinfo>
+description cheetah - the python-powered template engine
+</encapinfo>
+</encap_profile>
Changes to src/encap-profiles/depricated/cheetah-doc-0.9.16a1.ep
@@ -1,1 +1,63 @@
+<?xml version="1.0"?>
+
+<!-- $Id$ -->
+
+<encap_profile
+ profile_ver="1.0"
+ pkgspec="cheetah-doc-0.9.16a1"
+>
+
+<prereq package="m4-1.4.4" />
+
+<environment
+ variable="PATH"
+PLATFORM_IF_MATCH(solaris)
+ value="/usr/local/bin:/usr/sfw/bin:/usr/ccs/bin:"
+PLATFORM_ELSE
+ value="/usr/local/bin:"
+PLATFORM_ENDIF
+ type="prepend"
+/>
+
+<source
+url="http://encapsrcdist/mirror/cheetah/CheetahDocs-0.9.16a1.tgz
+http://mirror.opensysadmin.com/cheetah/CheetahDocs-0.9.16a1.tgz
+http://umn.dl.sourceforge.net/sourceforge/cheetahtemplate/CheetahDocs-0.9.16a1.tgz"
+subdir="CheetahDocs"
+>
+
+<configure>
+:
+</configure>
+
+<build>
+:
+</build>
+
+<install>
+test -d ${ENCAP_SOURCE} || mkdir ${ENCAP_SOURCE}
+test -d ${ENCAP_SOURCE}/${ENCAP_PKGNAME} || mkdir ${ENCAP_SOURCE}/${ENCAP_PKGNAME}
+test -d ${ENCAP_SOURCE}/${ENCAP_PKGNAME}/share || mkdir ${ENCAP_SOURCE}/${ENCAP_PKGNAME}/share
+test -d ${ENCAP_SOURCE}/${ENCAP_PKGNAME}/share/doc || mkdir ${ENCAP_SOURCE}/${ENCAP_PKGNAME}/share/doc
+test -d ${ENCAP_SOURCE}/${ENCAP_PKGNAME}/share/doc/cheetah || mkdir ${ENCAP_SOURCE}/${ENCAP_PKGNAME}/share/doc/cheetah
+cp -R * ${ENCAP_SOURCE}/${ENCAP_PKGNAME}/share/doc/cheetah
+</install>
+
+<clean>
+:
+</clean>
+
+</source>
+
+<prepackage>
+# Make "this encap is installed" sentinal file available in /usr/local/var/encap
+test -d var || mkdir var
+test -d var/encap || mkdir var/encap
+touch var/encap/${ENCAP_PKGNAME}
+</prepackage>
+
+<encapinfo>
+description cheetah-doc - cheetah template system documentation
+</encapinfo>
+</encap_profile>
Changes to src/encap-profiles/depricated/db-4.2.52+1.profile
@@ -1,1 +1,54 @@
+<?xml version="1.0"?>
+
+<!-- $Id$ -->
+
+<encap_profile
+ profile_ver="1.0"
+ pkgspec="db-4.2.52"
+>
+
+<environment
+ variable="CC"
+ value="gcc"
+ type="set"
+/>
+
+<environment
+ variable="PATH"
+ value="/usr/local/bin:"
+ type="prepend"
+/>
+
+<source
+ url="http://ftp.teledanmark.no/pub/db/db-4.2.52.tar.gz"
+ use_objdir="no"
+ build_subdir="build_unix"
+>
+
+<configure>
+../dist/configure \
+ --prefix="${ENCAP_SOURCE}/${ENCAP_PKGNAME}" \
+PLATFORM_IF_MATCH(aix)
+ --disable-shared \
+PLATFORM_ENDIF
+PLATFORM_IF_MATCH(aix5\.2)
+ --with-mutex=AIX/_check_lock \
+PLATFORM_ENDIF
+ --sysconfdir="${ENCAP_TARGET}/etc" \
+ --enable-compat185 \
+ --with-uniquename
+</configure>
+
+</source>
+
+<prepackage type="set">
+mkdir doc
+mv docs doc/db
+chown -R 0:0 .
+</prepackage>
+
+<encapinfo>
+description Berkeley/Sleepycat DB library
+</encapinfo>
+</encap_profile>
Changes to src/encap-profiles/depricated/gettext-0.14.5.ep
@@ -1,1 +1,82 @@
+<?xml version="1.0"?>
+
+<!-- $Id$ -->
+
+<encap_profile
+ profile_ver="1.0"
+ pkgspec="gettext-0.14.5"
+>
+
+<prereq package="m4-1.4.4" />
+<prereq package="libiconv-1.9.2" />
+
+<environment
+ variable="CC"
+ value="gcc -static-libgcc"
+ type="set"
+/>
+
+<environment
+ variable="PATH"
+PLATFORM_IF_MATCH(solaris)
+ value="/usr/local/bin:/usr/sfw/bin:/usr/ccs/bin:"
+PLATFORM_ELSE
+ value="/usr/local/bin:"
+PLATFORM_ENDIF
+ type="prepend"
+/>
+
+PLATFORM_IF_MATCH(linux)
+PLATFORM_ELSE
+<environment
+ variable="MAKE"
+ value="gmake"
+ type="set"
+/>
+PLATFORM_ENDIF
+
+<environment
+ variable="LDFLAGS"
+PLATFORM_IF_MATCH(linux)
+ value="-L/usr/local/lib -Wl,-rpath,/usr/local/lib"
+PLATFORM_ELSE_IF_MATCH(aix)
+ value="-L/usr/local/lib -Wl,-blibpath:/usr/local/lib:/usr/lib"
+PLATFORM_ELSE_IF_MATCH(solaris)
+ value="-L/usr/local/lib -R/usr/local/lib:/usr/lib -YP,/usr/local/lib:/usr/lib"
+PLATFORM_ELSE
+PLATFORM_ENDIF
+ type="set"
+/>
+
+<environment
+ variable="CPPFLAGS"
+ value="-I/usr/local/include"
+ type="set"
+/>
+
+<source
+url="http://www.pobox.com/users/dclark/mirror/gettext/gettext-0.14.5.tar.gz
+ http://ftp.gnu.org/pub/gnu/gettext/gettext-0.14.5.tar.gz"
+>
+
+<configure>
+./configure \
+ --prefix="${ENCAP_SOURCE}/${ENCAP_PKGNAME}"
+</configure>
+
+</source>
+
+<prepackage type="set">
+# Make man pages available from /usr/local/man
+mv share/man .
+# Make "this encap is installed" sentinal file available in /usr/local/var/encap
+test -d var || mkdir var
+test -d var/encap || mkdir var/encap
+touch var/encap/${ENCAP_PKGNAME}
+</prepackage>
+
+<encapinfo>
+description gettext - tools to produce multi-lingual messages
+</encapinfo>
+</encap_profile>
Changes to src/encap-profiles/depricated/heimdal-0.7.2.ep
@@ -1,1 +1,105 @@
+<?xml version="1.0"?>
+
+<!-- $Id$ -->
+
+<!--
+ libncurses5-dev, lex/flex, and yacc/bison are needed to compile this
+ see http://www.stacken.kth.se/lists/heimdal-discuss/2004-01/msg00068.html
+-->
+
+<encap_profile
+ profile_ver="1.0"
+ pkgspec="heimdal-0.7.2"
+>
+
+<prereq package="m4-1.4.4" />
+<prereq package="pkg-config-0.22" />
+<prereq package="openssl8-0.9.8e" />
+
+<environment
+ variable="CC"
+ value="gcc -static-libgcc"
+ type="set"
+/>
+
+<environment
+ variable="PATH"
+PLATFORM_IF_MATCH(solaris)
+ value="/usr/local/lib/heimdal/bin:/usr/local/bin:/usr/sfw/bin:/usr/ccs/bin:"
+PLATFORM_ELSE
+ value="/usr/local/lib/heimdal/bin:/usr/local/bin:"
+PLATFORM_ENDIF
+ type="prepend"
+/>
+
+PLATFORM_IF_MATCH(linux)
+PLATFORM_ELSE
+<environment
+ variable="MAKE"
+ value="gmake"
+ type="set"
+/>
+PLATFORM_ENDIF
+
+<environment
+ variable="LDFLAGS"
+PLATFORM_IF_MATCH(linux)
+ value="-L/usr/local/lib/heimdal/lib -L/usr/local/lib -Wl,-rpath,/usr/local/lib/heimdal/lib -Wl,-rpath,/usr/local/lib -YP,/usr/local/lib/heimdal/lib:/usr/local/lib:/lib:/usr/lib"
+PLATFORM_ELSE_IF_MATCH(aix)
+ value="-L/usr/local/lib/heimdal/lib -L/usr/local/lib -Wl,-blibpath:/usr/local/lib/heimdal/lib:/usr/local/lib:/usr/lib"
+PLATFORM_ELSE_IF_MATCH(solaris)
+ value="-L/usr/local/lib/heimdal/lib -L/usr/local/lib -R/usr/local/lib/heimdal/lib:/usr/local/lib:/usr/lib -YP,/usr/local/lib/heimdal/lib:/usr/local/lib:/usr/lib"
+PLATFORM_ELSE
+PLATFORM_ENDIF
+ type="set"
+/>
+
+<environment
+ variable="CPPFLAGS"
+ value="-I/usr/local/lib/heimdal/include -I/usr/local/include"
+ type="set"
+/>
+
+<source
+ url="http://encapsrcdist/mirror/heimdal/heimdal-0.7.2.tar.gz
+ http://mirror.opensysadmin.com/heimdal/heimdal-0.7.2.tar.gz
+ ftp://ftp.pdc.kth.se/pub/heimdal/src/heimdal-0.7.2.tar.gz"
+>
+
+<configure>
+# We compile with a
+./configure \
+ --prefix="${ENCAP_SOURCE}/${ENCAP_PKGNAME}/lib/heimdal" \
+ --sysconfdir=/usr/local/etc \
+ --with-openssl=/usr/local \
+ --disable-berkeley-db \
+ --disable-ndbm-db \
+ --disable-otp \
+ --disable-shared \
+ --without-ipv6 \
+ --without-krb4 \
+ --without-openldap \
+ --without-readline \
+ --without-x
+</configure>
+
+</source>
+
+<prepackage type="set">
+# Make links so important binaries go in PATH...
+test -d bin || mkdir bin
+FILES="afslog compile_et kauth kdestroy kf kgetcred kinit klist kpasswd krb5-config login mk_cmds pagsh pfrom string2key verify_krb5_conf"; \
+for FILE in $FILES; do \
+ ln -sf ../lib/heimdal/bin/$FILE bin/$FILE; \
+done
+# Make "this encap is installed" sentinal file available in /usr/local/var/encap
+test -d var || mkdir var
+test -d var/encap || mkdir var/encap
+touch var/encap/${ENCAP_PKGNAME}
+</prepackage>
+
+<encapinfo>
+description heimdal - kerberos 5 implementation
+</encapinfo>
+</encap_profile>
Changes to src/encap-profiles/depricated/libgssapi-0.10.ep
@@ -1,1 +1,78 @@
+<?xml version="1.0"?>
+
+<!-- $Id$ -->
+
+<encap_profile
+ profile_ver="1.0"
+ pkgspec="libgssapi-0.10"
+>
+
+<prereq package="m4-1.4.4" />
+<prereq package="zlib-1.2.3" />
+<prereq package="gettext-0.14.5" />
+<prereq package="libiconv-1.9.2" />
+<prereq package="pkg-config-0.20" />
+<prereq package="openssl-0.9.8c" />
+<prereq package="python24-2.4.3" />
+
+<environment
+ variable="CC"
+ value="gcc"
+ type="set"
+/>
+
+<environment
+ variable="PATH"
+PLATFORM_IF_MATCH(solaris)
+ value="/usr/local/bin:/usr/sfw/bin:/usr/ccs/bin:"
+PLATFORM_ELSE
+ value="/usr/local/bin:"
+PLATFORM_ENDIF
+ type="prepend"
+/>
+
+PLATFORM_IF_MATCH(linux)
+PLATFORM_ELSE
+<environment
+ variable="MAKE"
+ value="gmake"
+ type="set"
+/>
+PLATFORM_ENDIF
+
+<environment
+ variable="LDFLAGS"
+PLATFORM_IF_MATCH(linux)
+ value="-L/usr/local/lib -Wl,-rpath,/usr/local/lib -YP,/usr/local/lib:/lib:/usr/lib"
+PLATFORM_ELSE_IF_MATCH(aix)
+ value="-L/usr/local/lib -Wl,-blibpath:/usr/local/lib:/usr/lib"
+PLATFORM_ELSE_IF_MATCH(solaris)
+ value="-L/usr/local/lib -R/usr/local/lib:/usr/lib -YP,/usr/local/lib:/usr/lib"
+PLATFORM_ELSE
+PLATFORM_ENDIF
+ type="set"
+/>
+
+<environment
+ variable="CPPFLAGS"
+ value="-I/usr/local/include"
+ type="set"
+/>
+
+<source
+ url="http://www.pobox.com/users/dclark/mirror/libgssapi/libgssapi-0.10.tar.gz
+ http://www.citi.umich.edu/projects/nfsv4/linux/libgssapi/libgssapi-0.10.tar.gz"
+/>
+
+<prepackage type="set">
+# Make "this encap is installed" sentinal file available in /usr/local/var/encap
+test -d var || mkdir var
+test -d var/encap || mkdir var/encap
+touch var/encap/${ENCAP_PKGNAME}
+</prepackage>
+
+<encapinfo>
+description libgssapi - mechanism-switch gssapi library
+</encapinfo>
+</encap_profile>
Changes to src/encap-profiles/depricated/libiconv-1.9.2.ep
@@ -1,1 +1,81 @@
+<?xml version="1.0"?>
+
+<!-- $Id$ -->
+
+<encap_profile
+ profile_ver="1.0"
+ pkgspec="libiconv-1.9.2"
+>
+
+<prereq package="m4-1.4.4" />
+
+<environment
+ variable="CC"
+ value="gcc"
+ type="set"
+/>
+
+<environment
+ variable="PATH"
+PLATFORM_IF_MATCH(solaris)
+ value="/usr/local/bin:/usr/sfw/bin:/usr/ccs/bin:"
+PLATFORM_ELSE
+ value="/usr/local/bin:"
+PLATFORM_ENDIF
+ type="prepend"
+/>
+
+PLATFORM_IF_MATCH(linux)
+PLATFORM_ELSE
+<environment
+ variable="MAKE"
+ value="gmake"
+ type="set"
+/>
+PLATFORM_ENDIF
+
+<environment
+ variable="LDFLAGS"
+PLATFORM_IF_MATCH(linux)
+ value="-L/usr/local/lib -Wl,-rpath,/usr/local/lib"
+PLATFORM_ELSE_IF_MATCH(aix)
+ value="-L/usr/local/lib -Wl,-blibpath:/usr/local/lib:/usr/lib"
+PLATFORM_ELSE_IF_MATCH(solaris)
+ value="-L/usr/local/lib -R/usr/local/lib:/usr/lib -YP,/usr/local/lib:/usr/lib"
+PLATFORM_ELSE
+PLATFORM_ENDIF
+ type="set"
+/>
+
+<environment
+ variable="CPPFLAGS"
+ value="-I/usr/local/include"
+ type="set"
+/>
+
+<source
+url="http://www.pobox.com/users/dclark/mirror/libiconv/libiconv-1.9.2.tar.gz
+ http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.9.2.tar.gz"
+>
+
+<configure>
+./configure \
+ --prefix="${ENCAP_SOURCE}/${ENCAP_PKGNAME}"
+</configure>
+
+</source>
+
+<prepackage type="set">
+# Make man pages available from /usr/local/man
+mv share/man .
+# Make "this encap is installed" sentinal file available in /usr/local/var/encap
+test -d var || mkdir var
+test -d var/encap || mkdir var/encap
+touch var/encap/${ENCAP_PKGNAME}
+</prepackage>
+
+<encapinfo>
+description libiconv - Converts between character encodings
+</encapinfo>
+</encap_profile>
Changes to src/encap-profiles/depricated/libxml2-2.6.26.ep
@@ -1,1 +1,93 @@
+<?xml version="1.0"?>
+
+<!-- $Id$ -->
+
+<encap_profile
+ profile_ver="1.0"
+ pkgspec="libxml2-2.6.26"
+>
+
+<prereq package="m4-1.4.4" />
+<prereq package="zlib-1.2.3" />
+<prereq package="libiconv-1.9.2" />
+<prereq package="gettext-0.14.5" />
+<prereq package="pkg-config-0.20" />
+<prereq package="python-2.5" />
+
+<environment
+ variable="CC"
+ value="gcc"
+ type="set"
+/>
+
+<environment
+ variable="PATH"
+PLATFORM_IF_MATCH(solaris)
+ value="/usr/local/bin:/usr/sfw/bin:/usr/ccs/bin:"
+PLATFORM_ELSE
+ value="/usr/local/bin:"
+PLATFORM_ENDIF
+ type="prepend"
+/>
+
+PLATFORM_IF_MATCH(linux)
+PLATFORM_ELSE
+<environment
+ variable="MAKE"
+ value="gmake"
+ type="set"
+/>
+PLATFORM_ENDIF
+
+<environment
+ variable="LDFLAGS"
+PLATFORM_IF_MATCH(linux)
+ value="-L/usr/local/lib -Wl,-rpath,/usr/local/lib"
+PLATFORM_ELSE_IF_MATCH(aix)
+ value="-L/usr/local/lib -Wl,-blibpath:/usr/local/lib:/usr/lib"
+PLATFORM_ELSE_IF_MATCH(solaris)
+ value="-L/usr/local/lib -R/usr/local/lib:/usr/lib -YP,/usr/local/lib:/usr/lib"
+PLATFORM_ELSE
+PLATFORM_ENDIF
+ type="set"
+/>
+
+<environment
+ variable="CPPFLAGS"
+ value="-I/usr/local/include"
+ type="set"
+/>
+
+<source
+url="http://www.pobox.com/users/dclark/mirror/libxml2/libxml2-sources-2.6.26.tar.gz
+ ftp://xmlsoft.org/libxml2/libxml2-sources-2.6.26.tar.gz"
+subdir="libxml2-2.6.26"
+>
+
+<configure>
+./configure \
+ --prefix="${ENCAP_SOURCE}/${ENCAP_PKGNAME}" \
+PLATFORM_IF_MATCH(aix)
+PLATFORM_ELSE
+ --enable-shared \
+PLATFORM_ENDIF
+ --enable-ipv6=no \
+ --with-python=/usr/local \
+ --with-zlib=/usr/local
+</configure>
+
+</source>
+
+<prepackage type="set">
+test -d bin || mkdir bin
+# Make "this encap is installed" sentinal file available in /usr/local/var/encap
+test -d var || mkdir var
+test -d var/encap || mkdir var/encap
+touch var/encap/${ENCAP_PKGNAME}
+</prepackage>
+
+<encapinfo>
+description libxml2 - XML C library for the Gnome project
+</encapinfo>
+</encap_profile>
Changes to src/encap-profiles/depricated/logpp-0.14.ep
@@ -1,1 +1,83 @@
+<?xml version="1.0"?>
+
+<!-- $Id$ -->
+
+<encap_profile
+ profile_ver="1.0"
+ pkgspec="logpp-0.14"
+>
+
+<prereq package="m4-1.4.4" />
+<prereq package="pkg-config-0.22" />
+
+<environment
+ variable="CC"
+ value="gcc -static-libgcc"
+ type="set"
+/>
+
+<environment
+ variable="PATH"
+PLATFORM_IF_MATCH(solaris)
+ value="/usr/local/bin:/usr/sfw/bin:/usr/ccs/bin:"
+PLATFORM_ELSE
+ value="/usr/local/bin:"
+PLATFORM_ENDIF
+ type="prepend"
+/>
+
+PLATFORM_IF_MATCH(linux)
+PLATFORM_ELSE
+<environment
+ variable="MAKE"
+ value="gmake"
+ type="set"
+/>
+PLATFORM_ENDIF
+
+<environment
+ variable="LDFLAGS"
+PLATFORM_IF_MATCH(linux)
+ value="-L/usr/local/lib -Wl,-rpath,/usr/local/lib -YP,/usr/local/lib:/lib:/usr/lib"
+PLATFORM_ELSE_IF_MATCH(aix)
+ value="-L/usr/local/lib -Wl,-blibpath:/usr/local/lib:/usr/lib"
+PLATFORM_ELSE_IF_MATCH(solaris)
+ value="-L/usr/local/lib -R/usr/local/lib:/usr/lib -YP,/usr/local/lib:/usr/lib"
+PLATFORM_ELSE
+PLATFORM_ENDIF
+ type="set"
+/>
+
+<environment
+ variable="CPPFLAGS"
+ value="-I/usr/local/include"
+ type="set"
+/>
+
+<source
+url="http://encapsrcdist/mirror/logpp/logpp-0.14.tar.gz
+ http://mirror.opensysadmin.com/logpp/logpp-0.14.tar.gz
+ http://superb-east.dl.sourceforge.net/sourceforge/logpp/logpp-0.14.tar.gz"
+>
+
+<configure>
+./configure \
+ --prefix="${ENCAP_SOURCE}/${ENCAP_PKGNAME}" \
+ --sysconfdir="${ENCAP_TARGET}/etc" \
+ --without--libpcre
+</configure>
+
+</source>
+
+<prepackage type="set">
+# Make "this encap is installed" sentinal file available in /usr/local/var/encap
+test -d var || mkdir var
+test -d var/encap || mkdir var/encap
+touch var/encap/${ENCAP_PKGNAME}
+</prepackage>
+
+<encapinfo>
+description logpp - log preprocessor
+</encapinfo>
+</encap_profile>
Changes to src/encap-profiles/depricated/ncurses-5.5.ep
@@ -1,1 +1,87 @@
+<?xml version="1.0"?>
+
+<!-- $Id$ -->
+
+<encap_profile
+ profile_ver="1.0"
+ pkgspec="ncurses-5.5"
+>
+
+<prereq package="m4-1.4.4" />
+<prereq package="pkg-config-0.20" />
+
+<environment
+ variable="CC"
+ value="gcc -static-libgcc"
+ type="set"
+/>
+
+<environment
+ variable="PATH"
+PLATFORM_IF_MATCH(solaris)
+ value="/usr/local/bin:/usr/sfw/bin:/usr/ccs/bin:"
+PLATFORM_ELSE
+ value="/usr/local/bin:"
+PLATFORM_ENDIF
+ type="prepend"
+/>
+
+PLATFORM_IF_MATCH(linux)
+PLATFORM_ELSE
+<environment
+ variable="MAKE"
+ value="gmake"
+ type="set"
+/>
+PLATFORM_ENDIF
+
+<environment
+ variable="LDFLAGS"
+PLATFORM_IF_MATCH(linux)
+ value="-L/usr/local/lib -Wl,-rpath,/usr/local/lib -YP,/usr/local/lib:/lib:/usr/lib"
+PLATFORM_ELSE_IF_MATCH(aix)
+ value="-L/usr/local/lib -Wl,-blibpath:/usr/local/lib:/usr/lib"
+PLATFORM_ELSE_IF_MATCH(solaris)
+ value="-L/usr/local/lib -R/usr/local/lib:/usr/lib -YP,/usr/local/lib:/usr/lib"
+PLATFORM_ELSE
+PLATFORM_ENDIF
+ type="set"
+/>
+
+<environment
+ variable="CPPFLAGS"
+ value="-I/usr/local/include"
+ type="set"
+/>
+
+<source
+url="ftp://encapsrcdist/mirror/ncurses/ncurses-5.5.tar.gz
+ http://www.pobox.com/users/dclark/mirror/ncurses/ncurses-5.5.tar.gz
+ http://ftp.gnu.org/pub/gnu/ncurses/ncurses-5.5.tar.gz"
+>
+
+<configure>
+./configure \
+ --prefix="${ENCAP_SOURCE}/${ENCAP_PKGNAME}" \
+ --enable-rpath \
+ --enable-symlinks \
+ --enable-termcap \
+ --with-build-cc=gcc \
+ --without-cxx \
+ --without-cxx-binding
+</configure>
+
+</source>
+
+<prepackage type="set">
+# Make "this encap is installed" sentinal file available in /usr/local/var/encap
+test -d var || mkdir var
+test -d var/encap || mkdir var/encap
+touch var/encap/${ENCAP_PKGNAME}
+</prepackage>
+
+<encapinfo>
+description ncurses - libraries for terminal handling
+</encapinfo>
+</encap_profile>
Changes to src/encap-profiles/depricated/neon-0.25.5.ep
@@ -1,1 +1,87 @@
+<?xml version="1.0"?>
+
+<!-- $Id$ -->
+
+<encap_profile
+ profile_ver="1.0"
+ pkgspec="neon-0.25.5"
+>
+
+<prereq package="m4-1.4.4" />
+<prereq package="zlib-1.2.3" />
+<prereq package="libiconv-1.9.2" />
+<prereq package="gettext-0.14.5" />
+<prereq package="pkg-config-0.20" />
+<prereq package="libxml2-2.6.26" />
+<prereq package="openssl-0.9.8b" />
+
+<environment
+ variable="CC"
+ value="gcc"
+ type="set"
+/>
+
+<environment
+ variable="PATH"
+PLATFORM_IF_MATCH(solaris)
+ value="/usr/local/bin:/usr/sfw/bin:/usr/ccs/bin:"
+PLATFORM_ELSE
+ value="/usr/local/bin:"
+PLATFORM_ENDIF
+ type="prepend"
+/>
+
+PLATFORM_IF_MATCH(linux)
+PLATFORM_ELSE
+<environment
+ variable="MAKE"
+ value="gmake"
+ type="set"
+/>
+PLATFORM_ENDIF
+
+<environment
+ variable="LDFLAGS"
+PLATFORM_IF_MATCH(linux)
+ value="-L/usr/local/lib -Wl,-rpath,/usr/local/lib"
+PLATFORM_ELSE_IF_MATCH(aix)
+ value="-L/usr/local/lib -Wl,-blibpath:/usr/local/lib:/usr/lib"
+PLATFORM_ELSE_IF_MATCH(solaris)
+ value="-L/usr/local/lib -R/usr/local/lib:/usr/lib -YP,/usr/local/lib:/usr/lib"
+PLATFORM_ELSE
+PLATFORM_ENDIF
+ type="set"
+/>
+
+<environment
+ variable="CPPFLAGS"
+ value="-I/usr/local/include"
+ type="set"
+/>
+
+<source
+ url="http://www.pobox.com/users/dclark/mirror/neon/neon-0.25.5.tar.gz
+ http://www.webdav.org/neon/neon-0.25.5.tar.gz"
+>
+
+<configure>
+./configure \
+ --prefix="${ENCAP_SOURCE}/${ENCAP_PKGNAME}" \
+ --with-ssl=openssl \
+ --with-libxml2
+</configure>
+
+</source>
+
+<prepackage type="set">
+# Make "this encap is installed" sentinal file available in /usr/local/var/encap
+test -d var || mkdir var
+test -d var/encap || mkdir var/encap
+touch var/encap/${ENCAP_PKGNAME}
+</prepackage>
+
+<encapinfo>
+description neon - HTTP and WebDAV client library
+</encapinfo>
+</encap_profile>
Changes to src/encap-profiles/depricated/nrpe-2.0.profile
@@ -1,1 +1,61 @@
+<?xml version="1.0"?>
+
+<!-- $Id$ -->
+
+<encap_profile
+ profile_ver="1.0"
+ pkgspec="nrpe-2.0"
+>
+
+<prereq package="openssl-0.9.7d" use_lib="yes" />
+
+<environment
+ variable="LD_RUN_PATH"
+ value="/usr/local/lib"
+ type="set"
+/>
+
+<environment
+ variable="CC"
+ value="gcc"
+ type="set"
+/>
+
+<environment
+ variable="PATH"
+ value="/usr/local/bin:"
+ type="prepend"
+/>
+
+<source
+ url="http://superb-east.dl.sourceforge.net/sourceforge/nagios/nrpe-2.0.tar.gz"
+>
+
+<configure>
+./configure \
+ --prefix="${ENCAP_SOURCE}/${ENCAP_PKGNAME}" \
+ --sysconfdir="${ENCAP_TARGET}/etc" \
+ --enable-ssl \
+ --with-ssl=/usr/local \
+ --with-ssl-lib=/usr/local/lib \
+ --with-ssl-inc=/usr/local/include
+</configure>
+
+<install>
+mkdir -p "${ENCAP_SOURCE}/${ENCAP_PKGNAME}/sbin";
+cp src/nrpe "${ENCAP_SOURCE}/${ENCAP_PKGNAME}/sbin";
+chmod 755 "${ENCAP_SOURCE}/${ENCAP_PKGNAME}/sbin/nrpe";
+</install>
+
+</source>
+
+<prepackage type="set">
+${STRIP} sbin/nrpe
+</prepackage>
+
+<encapinfo>
+description Nagios Remote Plugin Executor
+prereq pkgspec >= openssl-0.9.7d
+</encapinfo>
+</encap_profile>
Changes to src/encap-profiles/depricated/openldap-2.3.36.ep
@@ -1,1 +1,92 @@
+<?xml version="1.0"?>
+
+<!-- $Id: openldap-2.3.36.ep 60 2007-07-16 19:52:07Z dclark $ -->
+
+<encap_profile
+ profile_ver="1.0"
+ pkgspec="openldap-2.3.36"
+>
+
+<prereq package="m4-1.4.4" />
+<prereq package="pkg-config-0.22" />
+<prereq package="readline-5.2" />
+<prereq package="openssl8-0.9.8e" />
+
+<environment
+ variable="CC"
+ value="gcc -static-libgcc"
+ type="set"
+/>
+
+<environment
+ variable="PATH"
+PLATFORM_IF_MATCH(solaris)
+ value="/usr/local/bin:/usr/sfw/bin:/usr/ccs/bin:"
+PLATFORM_ELSE
+ value="/usr/local/bin:"
+PLATFORM_ENDIF
+ type="prepend"
+/>
+
+PLATFORM_IF_MATCH(linux)
+PLATFORM_ELSE
+<environment
+ variable="MAKE"
+ value="gmake"
+ type="set"
+/>
+PLATFORM_ENDIF
+
+<environment
+ variable="LDFLAGS"
+PLATFORM_IF_MATCH(linux)
+ value="-L/usr/local/lib -Wl,-rpath,/usr/local/lib -YP,/usr/local/lib:/lib:/usr/lib"
+PLATFORM_ELSE_IF_MATCH(aix)
+ value="-L/usr/local/lib -Wl,-blibpath:/usr/local/lib:/usr/lib"
+PLATFORM_ELSE_IF_MATCH(solaris)
+ value="-L/usr/local/lib -L/opt/sfw/lib -R/usr/local/lib:/opt/sfw/lib:/usr/lib -YP,/usr/local/lib:/opt/sfw/lib:/usr/lib"
+PLATFORM_ELSE
+PLATFORM_ENDIF
+ type="set"
+/>
+
+<environment
+ variable="CPPFLAGS"
+ value="-I/usr/local/include"
+ type="set"
+/>
+
+<source
+url="http://encapsrcdist/mirror/openldap/openldap-2.3.36.tgz
+ http://mirror.opensysadmin.com/openldap/openldap-2.3.36.tgz
+ http://www.openldap.org/software/download/OpenLDAP/openldap-release/openldap-2.3.36.tgz"
+>
+
+<configure>
+./configure \
+ --prefix="${ENCAP_SOURCE}/${ENCAP_PKGNAME}" \
+ --sysconfdir="${ENCAP_TARGET}/etc" \
+ --disable-ipv6 \
+ --disable-slapd \
+ --disable-slurpd \
+ --disable-libtool-lock \
+ --without-cyrus-sasl \
+ --without-fetch \
+ --without-threads \
+ --with-tls
+</configure>
+
+</source>
+
+<prepackage type="set">
+# Make "this encap is installed" sentinal file available in /usr/local/var/encap
+test -d var || mkdir var
+test -d var/encap || mkdir var/encap
+touch var/encap/${ENCAP_PKGNAME}
+</prepackage>
+
+<encapinfo>
+description openldap - community developed LDAP software
+</encapinfo>
+</encap_profile>
Changes to src/encap-profiles/depricated/openssh-4.6p1+1.ep
@@ -1,1 +1,409 @@
+<?xml version="1.0"?>
+
+<!-- $Id$ -->
+
+<encap_profile
+ profile_ver="1.0"
+ pkgspec="openssh-4.6p1+1"
+>
+
+<prereq package="m4-1.4.4" />
+<prereq package="pkg-config-0.22" />
+<prereq package="autoconf-2.61" />
+<prereq package="automake-1.10" />
+<prereq package="zlib-1.2.3" />
+<prereq package="openssl8-0.9.8e" />
+<prereq package="heimdal-0.7.2" />
+
+<environment
+ variable="CC"
+ value="gcc -static-libgcc"
+ type="set"
+/>
+
+<environment
+ variable="PATH"
+PLATFORM_IF_MATCH(solaris)
+ value="/usr/local/bin:/usr/sfw/bin:/usr/ccs/bin:"
+PLATFORM_ELSE
+ value="/usr/local/bin:"
+PLATFORM_ENDIF
+ type="prepend"
+/>
+
+PLATFORM_IF_MATCH(linux)
+PLATFORM_ELSE
+<environment
+ variable="MAKE"
+ value="gmake"
+ type="set"
+/>
+PLATFORM_ENDIF
+
+<environment
+ variable="LDFLAGS"
+PLATFORM_IF_MATCH(linux)
+ value="-L/usr/local/lib -Wl,-rpath,/usr/local/lib -YP,/usr/local/lib:/lib:/usr/lib"
+PLATFORM_ELSE_IF_MATCH(aix)
+ value="-L/usr/local/lib -Wl,-blibpath:/usr/local/lib:/usr/lib"
+PLATFORM_ELSE_IF_MATCH(solaris)
+ value="-L/usr/local/lib -R/usr/local/lib:/usr/lib -YP,/usr/local/lib:/usr/lib"
+PLATFORM_ELSE
+PLATFORM_ENDIF
+ type="set"
+/>
+
+<environment
+ variable="CPPFLAGS"
+PLATFORM_IF_MATCH(aix)
+ value="-I/usr/local/include -D_LINUX_SOURCE_COMPAT -DBROKEN_GETADDRINFO"
+PLATFORM_ELSE
+ value="-I/usr/local/include"
+PLATFORM_ENDIF
+ type="set"
+/>
+
+<source
+url="http://encapsrcdist/mirror/openssh/openssh-4.6p1.tar.gz
+http://mirror.opensysadmin.com/openssh/openssh-4.6p1.tar.gz
+http://mirror.mcs.anl.gov/openssh/portable/openssh-4.6p1.tar.gz"
+>
+
+<patch options="-p0"
+url="http://encapsrcdist/mirror/openssh/openssh-4.6p1-gsskex-20070312.patch
+http://mirror.opensysadmin.com/openssh/openssh-4.6p1-gsskex-20070312.patch
+http://www.sxw.org.uk/computing/patches/openssh-4.6p1-gsskex-20070312.patch"
+/>
+
+<configure>
+# The gsskex patch patches configure.ac, so we need to run autoreconf...
+/usr/local/bin/autoreconf
+# Now run configure...
+./configure \
+ --prefix="${ENCAP_SOURCE}/${ENCAP_PKGNAME}" \
+ --sysconfdir="/usr/local/etc" \
+PLATFORM_IF_MATCH(aix4)
+ --with-authenticate \
+PLATFORM_ELSE_IF_MATCH(solaris\|hpux11\|linux\|aix5)
+ --with-pam \
+PLATFORM_ENDIF
+ --with-ipaddr-display \
+ --with-md5-passwords \
+ --without-libedit \
+ --with-zlib=/usr/local \
+ --with-ssl-dir=/usr/local \
+ --with-kerberos5=/usr/local/lib/heimdal \
+ --with-privsep-path=/usr/local/var/empty \
+ --with-privsep-user=osasshd
+</configure>
+
+<install>
+${MAKE} install-nokeys sysconfdir="/usr/local/etc"
+PLATFORM_IF_MATCH(linux)
+cp ${srcdir}/contrib/redhat/sshd.pam "${ENCAP_SOURCE}/${ENCAP_PKGNAME}/sshd.pam-redhat"
+PLATFORM_ELSE_IF_MATCH(aix5)
+# Example /etc/pam.conf for AIX 5.2
+cp ${srcdir}/contrib/aix/pam.conf "${ENCAP_SOURCE}/${ENCAP_PKGNAME}/pam.conf-aix"
+PLATFORM_ENDIF
+test -d ${ENCAP_SOURCE}/${ENCAP_PKGNAME}/bin || mkdir ${ENCAP_SOURCE}/${ENCAP_PKGNAME}/bin
+cp ${srcdir}/contrib/ssh-copy-id ${ENCAP_SOURCE}/${ENCAP_PKGNAME}/bin/ssh-copy-id
+chmod 755 ${ENCAP_SOURCE}/${ENCAP_PKGNAME}/bin/ssh-copy-id
+test -d ${ENCAP_SOURCE}/${ENCAP_PKGNAME}/man || mkdir ${ENCAP_SOURCE}/${ENCAP_PKGNAME}/man
+test -d ${ENCAP_SOURCE}/${ENCAP_PKGNAME}/man/man1 || mkdir ${ENCAP_SOURCE}/${ENCAP_PKGNAME}/man/man1
+cp ${srcdir}/contrib/ssh-copy-id.1 ${ENCAP_SOURCE}/${ENCAP_PKGNAME}/man/man1/ssh-copy-id.1
+chmod 644 ${ENCAP_SOURCE}/${ENCAP_PKGNAME}/man/man1/ssh-copy-id.1
+</install>
+
+</source>
+
+
+<prepackage><![CDATA[
+# runit stuff
+test -d var || mkdir var
+test -d etc || mkdir etc
+test -d etc/sv || mkdir etc/sv
+test -d etc/sv/sshd || mkdir etc/sv/sshd
+test -d etc/sv/sshd/log || mkdir etc/sv/sshd/log
+
+# Make "this encap is installed" sentinal file available in /usr/local/var/encap
+test -d var || mkdir var
+test -d var/encap || mkdir var/encap
+touch var/encap/${ENCAP_PKGNAME}
+]]></prepackage>
+
+<include_file name="etc/sv/sshd/run" mode="0755"><![CDATA[
+#!/bin/sh
+exec 2>&1
+exec /usr/local/sbin/sshd -4 -D -e -p 222 -o "Protocol 2"
+]]></include_file>
+
+<include_file name="etc/sv/sshd/log/run" mode="0755"><![CDATA[
+#!/bin/sh
+exec 2>&1
+exec /usr/local/bin/svlogd -tt /usr/local/var/svlogd/sshd
+]]></include_file>
+
+<include_file name="preinstall" mode="0755"><![CDATA[
+#!/bin/sh -e
+
+# This makes the privsep user/group/home dir
+
+umask 002
+
+EMPTY="/usr/local/var/empty"
+test -d /usr/local || mkdir /usr/local
+test -d /usr/local/var || mkdir /usr/local/var
+
+if [ ! -d ${EMPTY} ]; then mkdir ${EMPTY}; fi
+chown 0 ${EMPTY}; chgrp 0 ${EMPTY}; chmod 0755 ${EMPTY}
+
+PLATFORM_IF_MATCH(linux\|solaris)
+ echo "Removing user osasshd if it exists..."
+ userdel osasshd || echo "User osasshd does not yet exist"
+ echo "Removing group osasshd if it exists..."
+ groupdel osasshd || echo "Group osasshd does not yet exist"
+ echo "Adding group osasshd..."
+ groupadd -g 222 osasshd
+ echo "Adding user osasshd..."
+ useradd -g osasshd -d ${EMPTY} -s /bin/false -u 222 osasshd
+PLATFORM_ELSE_IF_MATCH(aix)
+ echo "Removing user osasshd if it exists..."
+ rmuser -R files -p osasshd || echo "User osasshd does not yet exist"
+ echo "Removing group osasshd if it exists..."
+ rmgroup -R files osasshd || echo "Group osasshd does not yet exist"
+ echo "Adding group osasshd..."
+ mkgroup -R files id=222 osasshd
+ echo "Adding user osasshd..."
+ mkuser -R files home=${EMPTY} id=222 pgrp=osasshd login=false osasshd
+PLATFORM_ELSE
+ echo "Unknown platform, can't install this OpenSSH distro, exiting..."
+ exit 1
+PLATFORM_ENDIF
+
+exit 0
+]]></include_file>
+
+<include_file name="postinstall" mode="0755"><![CDATA[
+#!/bin/sh
+
+umask 002
+BASEDIR="`echo ${0} | xargs -n1 dirname`"
+LOG=${BASEDIR}/postinstall.log
+exec > $LOG 2>&1
+printf "Running sshd postinstall script...\n"
+date
+test -d /usr/local/var/svlogd || mkdir /usr/local/var/svlogd
+test -d /usr/local/var/svlogd/sshd || mkdir /usr/local/var/svlogd/sshd
+
+if [ -d /var/run ]; then
+ PIDDIR=/var/run;
+else
+ PIDDIR=/etc;
+fi
+
+if [ -f /usr/local/etc/ssh_host_key ]; then
+ echo "Removing SSH1 host key (/usr/local/etc/ssh_host_key)"
+ rm /usr/local/etc/ssh_host_key
+fi
+
+CHECKDIRS="/etc /etc/ssh /etc/sshd /etc/openssh /etc/opensshd /usr/local/etc/ssh /usr/local/etc/sshd /usr/local/etc/openssh /usr/local/etc/opensshd"
+
+if [ ! -f /usr/local/etc/ssh_host_rsa_key ]; then
+ for CHECKDIR in $CHECKDIRS; do
+ if [ -f ${CHECKDIR}/ssh_host_rsa_key ]; then
+ echo "Copying existing RSA keys from $CHECKDIR"
+ cp ${CHECKDIR}/ssh_host_rsa_key* /usr/local/etc/
+ break
+ fi
+ done
+fi
+if [ ! -f /usr/local/etc/ssh_host_rsa_key ]; then
+ echo "Generating SSH2 RSA host keys (/usr/local/etc/ssh_host_rsa_key*)";
+ ${ENCAP_TARGET}/bin/ssh-keygen -t rsa -f /usr/local/etc/ssh_host_rsa_key -N '';
+fi
+
+if [ ! -f /usr/local/etc/ssh_host_dsa_key ]; then
+ for CHECKDIR in $CHECKDIRS; do
+ if [ -f ${CHECKDIR}/ssh_host_dsa_key ]; then
+ echo "Copying existing DSA keys from $CHECKDIR"
+ cp ${CHECKDIR}/ssh_host_dsa_key* /usr/local/etc/
+ break
+ fi
+ done
+fi
+if [ ! -f /usr/local/etc/ssh_host_dsa_key ]; then
+ echo "Generating SSH2 DSA host keys (/usr/local/etc/ssh_host_dsa_key*)";
+ ${ENCAP_TARGET}/bin/ssh-keygen -t dsa -f /usr/local/etc/ssh_host_dsa_key -N '';
+fi
+
+PLATFORM_IF_MATCH(linux)
+if [ ! -f /etc/pam.d/sshd ]; then
+ if [ -f /etc/pam.d/ssh ]; then
+ echo "Copying /etc/pam.d/ssh to /etc/pam.d/sshd"
+ cp -p /etc/pam.d/ssh /etc/pam.d/sshd
+ else
+ echo "Copying /etc/pam.d/login to /etc/pam.d/sshd"
+ cp -p /etc/pam.d/login /etc/pam.d/sshd
+ fi
+fi
+PLATFORM_ENDIF
+
+PRIV="/usr/local/etc/ssh_host_rsa_key /usr/local/etc/ssh_host_dsa_key"
+PUB="/usr/local/etc/ssh_host_rsa_key.pub /usr/local/etc/ssh_host_dsa_key.pub"
+chmod 0600 $PRIV
+chmod 0644 $PUB
+chown 0 $PRIV $PUB
+chgrp 0 $PRIV $PUB
+
+echo "Installing /usr/local/etc/sshd_config"
+rm -f /usr/local/etc/sshd_config 2>/dev/null || true
+cp ${ENCAP_SOURCE}/${ENCAP_PKGNAME}/sshd_config /usr/local/etc/sshd_config
+chmod 0644 /usr/local/etc/sshd_config
+chown 0 /usr/local/etc/sshd_config
+chgrp 0 /usr/local/etc/sshd_config
+
+printf "Finished sshd postinstall script.\n"
+
+exit 0
+]]></include_file>
+
+<include_file name="preremove" mode="0755"><![CDATA[
+#!/bin/sh
+
+printf "Running sshd preremove script...\n"
+date
+
+if [ -h /usr/local/var/service/sshd ]; then
+ printf "INFO: Removing /usr/local/var/service/sshd...\n"
+ rm /usr/local/var/service/sshd
+fi
+
+printf "Finished sshd preremove script.\n"
+]]></include_file>
+
+<include_file name="sshd_config" mode="0644"><![CDATA[
+# $OpenBSD: sshd_config,v 1.74 2006/07/19 13:07:10 dtucker Exp $
+
+# This is the sshd server system-wide configuration file. See
+# sshd_config(5) for more information.
+
+# This sshd was compiled with PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/encap/openssh-4.4p1/bin
+
+# The strategy used for options in the default sshd_config shipped with
+# OpenSSH is to specify options with their default value where
+# possible, but leave them commented. Uncommented options change a
+# default value.
+
+Port 222
+Protocol 2
+#AddressFamily any
+#ListenAddress 0.0.0.0
+#ListenAddress ::
+
+# HostKey for protocol version 1
+#HostKey /usr/local/etc/ssh_host_key
+# HostKeys for protocol version 2
+#HostKey /usr/local/etc/ssh_host_rsa_key
+#HostKey /usr/local/etc/ssh_host_dsa_key
+
+# Lifetime and size of ephemeral version 1 server key
+#KeyRegenerationInterval 1h
+#ServerKeyBits 768
+
+# Logging
+# obsoletes QuietMode and FascistLogging
+#SyslogFacility AUTH
+#LogLevel INFO
+
+# Authentication:
+
+#LoginGraceTime 2m
+PermitRootLogin no
+#StrictModes yes
+MaxAuthTries 5
+
+#RSAAuthentication yes
+#PubkeyAuthentication yes
+#AuthorizedKeysFile .ssh/authorized_keys
+
+# For this to work you will also need host keys in /usr/local/etc/ssh_known_hosts
+#RhostsRSAAuthentication no
+# similar for protocol version 2
+#HostbasedAuthentication no
+# Change to yes if you don't trust ~/.ssh/known_hosts for
+# RhostsRSAAuthentication and HostbasedAuthentication
+#IgnoreUserKnownHosts no
+# Don't read the user's ~/.rhosts and ~/.shosts files
+#IgnoreRhosts yes
+
+# To disable tunneled clear text passwords, change to no here!
+#PasswordAuthentication yes
+#PermitEmptyPasswords no
+
+# Change to no to disable s/key passwords
+#ChallengeResponseAuthentication yes
+
+# Kerberos options
+KerberosAuthentication yes
+#KerberosOrLocalPasswd yes
+#KerberosTicketCleanup yes
+KerberosGetAFSToken yes
+
+# GSSAPI options
+GSSAPIAuthentication yes
+#GSSAPICleanupCredentials yes
+
+# Set this to 'yes' to enable PAM authentication, account processing,
+# and session processing. If this is enabled, PAM authentication will
+# be allowed through the ChallengeResponseAuthentication and
+# PasswordAuthentication. Depending on your PAM configuration,
+# PAM authentication via ChallengeResponseAuthentication may bypass
+# the setting of "PermitRootLogin without-password".
+# If you just want the PAM account and session checks to run without
+# PAM authentication, then enable this but set PasswordAuthentication
+# and ChallengeResponseAuthentication to 'no'.
+PLATFORM_IF_MATCH(aix4)
+# UsePAM no
+PLATFORM_ELSE_IF_MATCH(solaris\|hpux11\|linux\|aix5)
+UsePAM yes
+PLATFORM_ENDIF
+
+#AllowTcpForwarding yes
+#GatewayPorts no
+X11Forwarding yes
+#X11DisplayOffset 10
+#X11UseLocalhost yes
+#PrintMotd yes
+#PrintLastLog yes
+#TCPKeepAlive yes
+#UseLogin no
+#UsePrivilegeSeparation yes
+#PermitUserEnvironment no
+#Compression delayed
+#ClientAliveInterval 0
+#ClientAliveCountMax 3
+#UseDNS yes
+#PidFile /var/run/sshd.pid
+#MaxStartups 10
+#PermitTunnel no
+
+# no default banner path
+#Banner /some/path
+
+# override default of no subsystems
+Subsystem sftp /usr/local/encap/openssh-4.4p1/libexec/sftp-server
+
+# Example of overriding settings on a per-user basis
+#Match User anoncvs
+# X11Forwarding no
+# AllowTcpForwarding no
+# ForceCommand cvs server
+]]></include_file>
+
+
+<encapinfo>
+description openssh - SSH client and server programs
+exclude sshd_config
+</encapinfo>
+</encap_profile>
Changes to src/encap-profiles/depricated/perl-5.8.8.ep
@@ -1,1 +1,126 @@
+<?xml version="1.0"?>
+
+<!-- $Id$ -->
+
+<encap_profile
+ profile_ver="1.0"
+ pkgspec="perl-5.8.8"
+>
+
+<notes>
+You must build in a local directory. Building in an NFS-mounted directory
+will cause the Configure script to hang when it tries to check for
+fcntl-based file locking.
+</notes>
+
+<prereq package="m4-1.4.4" />
+<prereq package="zlib-1.2.3" />
+<prereq package="libiconv-1.9.2" />
+<prereq package="gettext-0.14.5" />
+<prereq package="pkg-config-0.20" />
+
+<environment
+ variable="CC"
+ value="gcc"
+ type="set"
+/>
+
+<environment
+ variable="PATH"
+PLATFORM_IF_MATCH(solaris)
+ value="/usr/local/bin:/usr/sfw/bin:/usr/ccs/bin:"
+PLATFORM_ELSE
+ value="/usr/local/bin:"
+PLATFORM_ENDIF
+ type="prepend"
+/>
+
+PLATFORM_IF_MATCH(linux)
+PLATFORM_ELSE
+<environment
+ variable="MAKE"
+ value="gmake"
+ type="set"
+/>
+PLATFORM_ENDIF
+
+<environment
+ variable="LDFLAGS"
+PLATFORM_IF_MATCH(linux)
+ value="-L/usr/local/lib -Wl,-rpath,/usr/local/lib"
+PLATFORM_ELSE_IF_MATCH(aix)
+ value="-L/usr/local/lib -Wl,-blibpath:/usr/local/lib:/usr/lib"
+PLATFORM_ELSE_IF_MATCH(solaris)
+ value="-L/usr/local/lib -R/usr/local/lib:/usr/lib -YP,/usr/local/lib:/usr/lib"
+PLATFORM_ELSE
+PLATFORM_ENDIF
+ type="set"
+/>
+
+<environment
+ variable="CPPFLAGS"
+ value="-I/usr/local/include"
+ type="set"
+/>
+
+<source
+ url="http://www.pobox.com/users/dclark/mirror/perl/perl-5.8.8.tar.gz
+ http://www.perl.com/CPAN/src/perl-5.8.8.tar.gz"
+>
+
+<!--
+ NOTE: for the -Dinc_version_list value, don't include the $archname
+ subdirectory for versions before 5.8.0, since XS modules
+ from before 5.8.0 will not work with 5.8.0 or newer.
+ (in other words, we add "$version/$archname $version" for every
+ version from 5.8.0 and up, but only "$version" for 5.6.1.)
+-->
+
+<configure>
+${srcdir}/Configure -de \
+ -Dmksymlinks \
+ -Dprefix="${ENCAP_TARGET}" \
+ -Dinstallprefix="${ENCAP_SOURCE}/${ENCAP_PKGNAME}" \
+ -Dsiteprefix="${ENCAP_TARGET}" \
+ -Dprivlib="${ENCAP_TARGET}/lib/perl/5.8.8" \
+ -Dsitelib="${ENCAP_TARGET}/lib/site_perl/5.8.8" \
+ -Dperladmin="none" \
+ -Dstartperl="#!${ENCAP_TARGET}/bin/perl" \
+PLATFORM_IF_MATCH(aix)
+ -Dinc_version_list="5.8.7/aix 5.8.7 5.8.6/aix 5.8.6 5.8.5/aix 5.8.5 5.8.4/aix 5.8.4 5.8.3/aix 5.8.3 5.8.2/aix 5.8.2 5.8.1/aix 5.8.1 5.8.0/aix 5.8.0 5.6.1" \
+PLATFORM_ELSE_IF_MATCH(solaris)
+ -Dinc_version_list="5.8.7/sun4-solaris 5.8.7 5.8.6/sun4-solaris 5.8.6 5.8.5/sun4-solaris 5.8.5 5.8.4/sun4-solaris 5.8.4 5.8.3/sun4-solaris 5.8.3 5.8.2/sun4-solaris 5.8.2 5.8.1/sun4-solaris 5.8.1 5.8.0/sun4-solaris 5.8.0 5.6.1" \
+PLATFORM_ELSE_IF_MATCH(linux)
+ -Dinc_version_list="5.8.7/i686-linux 5.8.7 5.8.6/i686-linux 5.8.6 5.8.5/i686-linux 5.8.5 5.8.4/i686-linux 5.8.4 5.8.3/i686-linux 5.8.3 5.8.2/i686-linux 5.8.2 5.8.1/i686-linux 5.8.1 5.8.0/i686-linux 5.8.0 5.6.1" \
+PLATFORM_ENDIF
+ -Dpager="/bin/more"
+</configure>
+
+<build type="append">
+${MAKE} test
+</build>
+
+</source>
+
+<prepackage><![CDATA[
+# this is ugly, but it's recommended by the perl INSTALL file
+./bin/perl -i -e "while (<>) { m/^install/ && s|${ENCAP_SOURCE}/`echo ${ENCAP_PKGNAME} | sed 's/[\\.\\+]/\\\\&/g'`|${ENCAP_TARGET}|; print; }" lib/perl/5.8.8/`./bin/perl -Ilib/perl -MConfig -e 'print $Config{archname};'`/Config.pm
+# Make man page location consistant across platforms
+mv share/man . || true
+rmdir share || true
+# Work around conflict with openssl
+mv man/man3/threads.3 man/man3/perlthreads.3
+# Make scripts be in PATH
+mv scripts/* bin/
+rmdir scripts
+# Make "this encap is installed" sentinal file available in /usr/local/var/encap
+test -d var || mkdir var
+test -d var/encap || mkdir var/encap
+touch var/encap/${ENCAP_PKGNAME}
+]]></prepackage>
+
+<encapinfo>
+description perl - scripting language
+</encapinfo>
+</encap_profile>
Changes to src/encap-profiles/depricated/prngd-0.9.29.profile
@@ -1,1 +1,168 @@
+<?xml version="1.0"?>
+
+<encap_profile
+ profile_ver="1.0"
+ pkgspec="prngd-0.9.29"
+>
+
+<source
+ url="ftp://ftp.aet.tu-cottbus.de/pub/postfix_tls/related/prngd/prngd-0.9.29.tar.gz"
+ use_objdir="no"
+>
+
+<configure type="unset" />
+
+<build>
+${MAKE} \
+PLATFORM_IF_MATCH(solaris)
+ CC=cc CFLAGS="-xO4 -DSOLARIS" SYSLIBS="-lsocket -lnsl" \
+PLATFORM_ENDIF
+ DEFS="-DRANDSAVENAME=\\\"/var/lib/prngd/prngd-seed\\\" -DCONFIGFILE=\\\"${ENCAP_TARGET}/etc/prngd.conf\\\""
+</build>
+
+<install>
+mkdir -p "${ENCAP_SOURCE}/${ENCAP_PKGNAME}/sbin";
+cp prngd "${ENCAP_SOURCE}/${ENCAP_PKGNAME}/sbin";
+chmod 755 "${ENCAP_SOURCE}/${ENCAP_PKGNAME}/sbin/prngd";
+cp \
+PLATFORM_IF_MATCH(aix)
+ contrib/AIX-4.3/prngd.conf.aix43 \
+PLATFORM_ELSE_IF_MATCH(solaris)
+ contrib/Solaris-7/prngd.conf.solaris-7 \
+PLATFORM_ELSE_IF_MATCH(hpux)
+ contrib/HPUX/prngd.conf.hpux-10 \
+PLATFORM_ELSE_IF_MATCH(linux)
+ contrib/Linux-2/prngd.conf.linux-2 \
+PLATFORM_ELSE_IF_MATCH(irix)
+ contrib/IRIX-65/prngd.conf.irix-65 \
+PLATFORM_ENDIF
+ "${ENCAP_SOURCE}/${ENCAP_PKGNAME}/prngd.conf";
+</install>
+
+</source>
+
+<include_file name="postinstall" mode="0755"><![CDATA[
+#!/bin/sh
+
+if [ ! -f "${ENCAP_TARGET}/etc/prngd.conf" ]; then
+ echo "Installing ${ENCAP_TARGET}/etc/prngd.conf";
+ mkdir -p "${ENCAP_TARGET}/etc";
+PLATFORM_IF_MATCH(solaris)
+ nawk \
+PLATFORM_ELSE
+ awk \
+PLATFORM_ENDIF
+ '/^[^#]/ { \
+ if (system("test -f " $(NF-1)) == 0) \
+ print; \
+ next; \
+ } \
+ { print; }' \
+ "${ENCAP_SOURCE}/${ENCAP_PKGNAME}/prngd.conf" \
+ > "${ENCAP_TARGET}/etc/prngd.conf";
+fi
+
+if [ ! -d "/var/lib/prngd" ]; then
+ echo "Creating directory /var/lib/prngd";
+ mkdir -p /var/lib/prngd;
+fi
+
+PLATFORM_IF_MATCH(aix)
+RC_DIR="/etc/rc.d";
+LINKS="rc2.d/S20prngd";
+RUNDIR="/etc";
+PLATFORM_ELSE_IF_MATCH(hpux)
+RC_DIR="/sbin";
+LINKS="rc0.d/K300prngd rc1.d/K300prngd rc2.d/S200prngd";
+RUNDIR="/var/run";
+PLATFORM_ELSE_IF_MATCH(linux)
+RC_DIR="/etc/rc.d";
+LINKS="rc0.d/K30prngd rc1.d/K30prngd rc5.d/S20prngd rc2.d/S20prngd";
+RUNDIR="/var/run";
+PLATFORM_ELSE_IF_MATCH(irix)
+RC_DIR="/etc";
+LINKS="rc0.d/K30prngd rc1.d/K30prngd rc2.d/S20prngd";
+RUNDIR="/etc";
+PLATFORM_ELSE_IF_MATCH(solaris)
+RC_DIR="/etc";
+LINKS="rc0.d/K30prngd rc1.d/K30prngd rcS.d/K30prngd rc2.d/S20prngd";
+RUNDIR="/var/run";
+PLATFORM_ENDIF
+
+SCRIPT="${RC_DIR}/init.d/prngd";
+
+PLATFORM_IF_MATCH(aix4)
+if [ -f "${SCRIPT}" ]; then
+ echo "Removing ${SCRIPT}";
+ rm -f "${SCRIPT}";
+fi
+for link in ${LINKS}; do
+ if [ -h "${RC_DIR}/${link}" ]; then
+ echo "Removing ${RC_DIR}/${link}";
+ rm -f "${RC_DIR}/${link}";
+ fi
+done
+
+grep prngd /etc/rc.tcpip > /dev/null 2>&1;
+if [ $? -ne 0 ]; then
+ echo "Updating /etc/rc.tcpip";
+ cp /etc/rc.tcpip "/etc/rc.tcpip.pre.${ENCAP_PKGNAME}";
+ awk '\
+ /Starting tcpip daemons:/ { state=1; } \
+ (state == 1 && /^$/) { \
+ printf "\n### start prngd\n"; \
+ printf "%s/sbin/prngd /etc/egd-pool && echo \"started prngd\"\n", ENVIRON["ENCAP_TARGET"]; \
+ state=2; \
+ } \
+ { print; }' \
+ /etc/rc.tcpip \
+ > /etc/rc.tcpip.new \
+ && cp /etc/rc.tcpip.new /etc/rc.tcpip \
+ && rm -f /etc/rc.tcpip.new
+fi
+
+PLATFORM_ELSE
+if [ ! -f "${SCRIPT}" ]; then
+ echo "Installing ${SCRIPT}";
+ mkdir -p "${RC_DIR}/init.d";
+ rm -f "${SCRIPT}";
+ sed \
+ -e "s|@ENCAP_TARGET@|${ENCAP_TARGET}|g" \
+ -e "s|@RUNDIR@|${RUNDIR}|g" \
+ "${ENCAP_SOURCE}/${ENCAP_PKGNAME}/prngd.rc.in" \
+ > "${SCRIPT}";
+ chmod 755 "${SCRIPT}";
+ for link in ${LINKS}; do
+ echo "Creating link ${RC_DIR}/${link} -> ${SCRIPT}";
+ ln -sf "${SCRIPT}" "${RC_DIR}/${link}";
+ done
+fi
+PLATFORM_ENDIF
+
+]]></include_file>
+
+<include_file name="prngd.rc.in"><![CDATA[
+#!/bin/sh
+
+case $1 in
+'start')
+ @ENCAP_TARGET@/sbin/prngd @RUNDIR@/egd-pool;
+ ;;
+'stop')
+ @ENCAP_TARGET@/sbin/prngd @RUNDIR@/egd-pool -k;
+ ;;
+*)
+ echo "Usage: $0 start|stop";
+ exit 1;
+ ;;
+esac
+
+]]></include_file>
+
+<encapinfo>
+description pseudo-random number generator daemon
+</encapinfo>
+
+</encap_profile>
+
Changes to src/encap-profiles/depricated/pyopenssl-0.6.ep
@@ -1,1 +1,99 @@
+<?xml version="1.0"?>
+
+<!-- $Id$ -->
+
+<encap_profile
+ profile_ver="1.0"
+ pkgspec="pyopenssl-0.6"
+>
+
+<prereq package="m4-1.4.4" />
+<prereq package="zlib-1.2.3" />
+<prereq package="pkg-config-0.21" />
+<prereq package="openssl8-0.9.8e" />
+<prereq package="python24-2.4.4" />
+
+<environment
+ variable="CC"
+ value="gcc -static-libgcc"
+ type="set"
+/>
+
+<environment
+ variable="PATH"
+PLATFORM_IF_MATCH(solaris)
+ value="/usr/local/bin:/usr/sfw/bin:/usr/ccs/bin:"
+PLATFORM_ELSE
+ value="/usr/local/bin:"
+PLATFORM_ENDIF
+ type="prepend"
+/>
+
+PLATFORM_IF_MATCH(linux)
+PLATFORM_ELSE
+<environment
+ variable="MAKE"
+ value="gmake"
+ type="set"
+/>
+PLATFORM_ENDIF
+
+<environment
+ variable="LDFLAGS"
+PLATFORM_IF_MATCH(linux)
+ value="-L/usr/local/lib -Wl,-rpath,/usr/local/lib -YP,/usr/local/lib:/lib:/usr/lib"
+PLATFORM_ELSE_IF_MATCH(aix)
+ value="-L/usr/local/lib -Wl,-blibpath:/usr/local/lib:/usr/lib"
+PLATFORM_ELSE_IF_MATCH(solaris)
+ value="-L/usr/local/lib -R/usr/local/lib:/usr/lib -YP,/usr/local/lib:/usr/lib"
+PLATFORM_ELSE
+PLATFORM_ENDIF
+ type="set"
+/>
+
+<environment
+ variable="CPPFLAGS"
+ value="-I/usr/local/include"
+ type="set"
+/>
+
+<source
+url="http://encapsrcdist/mirror/pyopenssl/pyOpenSSL-0.6.tar.gz
+ http://mirror.opensysadmin.com/pyopenssl/pyOpenSSL-0.6.tar.gz
+ http://umn.dl.sourceforge.net/sourceforge/pyopenssl/pyOpenSSL-0.6.tar.gz"
+>
+
+<configure>
+/usr/local/bin/python2.4 setup.py build_ext \
+-I/usr/local/include/openssl \
+-L/usr/local/lib/
+</configure>
+
+<build>
+/usr/local/bin/python2.4 setup.py build \
+--build-base=${builddir}/build
+</build>
+
+<install>
+/usr/local/bin/python2.4 setup.py install \
+--prefix=${ENCAP_SOURCE}/${ENCAP_PKGNAME}
+</install>
+
+<clean>
+/usr/local/bin/python2.4 setup.py clean
+</clean>
+
+</source>
+
+<prepackage type="set">
+# Make "this encap is installed" sentinal file available in /usr/local/var/encap
+test -d var || mkdir var
+test -d var/encap || mkdir var/encap
+touch var/encap/${ENCAP_PKGNAME}
+</prepackage>
+
+<encapinfo>
+description pyOpenSSL - Python interface to the OpenSSL library
+</encapinfo>
+</encap_profile>
Changes to src/encap-profiles/depricated/pyrex-0.9.4.1.ep
@@ -1,1 +1,95 @@
+<?xml version="1.0"?>
+
+<!-- $Id$ -->
+
+<encap_profile
+ profile_ver="1.0"
+ pkgspec="pyrex-0.9.4.1"
+>
+
+<prereq package="m4-1.4.4" />
+<prereq package="python24-2.4.3" />
+
+<environment
+ variable="CC"
+ value="gcc -static-libgcc"
+ type="set"
+/>
+
+<environment
+ variable="PATH"
+PLATFORM_IF_MATCH(solaris)
+ value="/usr/local/bin:/usr/sfw/bin:/usr/ccs/bin:"
+PLATFORM_ELSE
+ value="/usr/local/bin:"
+PLATFORM_ENDIF
+ type="prepend"
+/>
+
+PLATFORM_IF_MATCH(linux)
+PLATFORM_ELSE
+<environment
+ variable="MAKE"
+ value="gmake"
+ type="set"
+/>
+PLATFORM_ENDIF
+
+<environment
+ variable="LDFLAGS"
+PLATFORM_IF_MATCH(linux)
+ value="-L/usr/local/lib -Wl,-rpath,/usr/local/lib -YP,/usr/local/lib:/lib:/usr/lib"
+PLATFORM_ELSE_IF_MATCH(aix)
+ value="-L/usr/local/lib -Wl,-blibpath:/usr/local/lib:/usr/lib"
+PLATFORM_ELSE_IF_MATCH(solaris)
+ value="-L/usr/local/lib -R/usr/local/lib:/usr/lib -YP,/usr/local/lib:/usr/lib"
+PLATFORM_ELSE
+PLATFORM_ENDIF
+ type="set"
+/>
+
+<environment
+ variable="CPPFLAGS"
+ value="-I/usr/local/include"
+ type="set"
+/>
+
+<source
+url="ftp://encapsrcdist/mirror/pyrex/Pyrex-0.9.4.1.tar.gz
+ http://www.pobox.com/users/dclark/mirror/pyrex/Pyrex-0.9.4.1.tar.gz
+ http://www.cosc.canterbury.ac.nz/~greg/python/Pyrex/Pyrex-0.9.4.1.tar.gz"
+>
+
+<configure>
+:
+</configure>
+
+<build>
+/usr/local/bin/python2.4 setup.py build \
+--build-base=${builddir}/build
+</build>
+
+<install>
+/usr/local/bin/python2.4 setup.py install \
+--prefix=${ENCAP_SOURCE}/${ENCAP_PKGNAME}
+</install>
+
+<clean>
+/usr/local/bin/python2.4 setup.py clean
+</clean>
+
+</source>
+
+<prepackage type="set">
+chmod -R o+r .
+# Make "this encap is installed" sentinal file available in /usr/local/var/encap
+test -d var || mkdir var
+test -d var/encap || mkdir var/encap
+touch var/encap/${ENCAP_PKGNAME}
+</prepackage>
+
+<encapinfo>
+description pyrex - a language for writing python extension modules
+</encapinfo>
+</encap_profile>
Changes to src/encap-profiles/depricated/runit-1.7.2.ep
@@ -1,1 +1,283 @@
+<?xml version="1.0"?>
+
+<!-- $Id$ -->
+
+<encap_profile
+ profile_ver="1.0"
+ pkgspec="runit-1.7.2"
+>
+
+<prereq package="m4-1.4.4" />
+
+<environment
+ variable="CC"
+ value="gcc -static-libgcc"
+ type="set"
+/>
+
+<environment
+ variable="PATH"
+PLATFORM_IF_MATCH(solaris)
+ value="/usr/local/bin:/usr/sfw/bin:/usr/ccs/bin:"
+PLATFORM_ELSE
+ value="/usr/local/bin:"
+PLATFORM_ENDIF
+ type="prepend"
+/>
+
+PLATFORM_IF_MATCH(linux)
+PLATFORM_ELSE
+<environment
+ variable="MAKE"
+ value="gmake"
+ type="set"
+/>
+PLATFORM_ENDIF
+
+<source
+url="http://encapsrcdist/mirror/runit/runit-1.7.2.tar.gz
+ http://mirror.opensysadmin.com/runit/runit-1.7.2.tar.gz
+ http://smarden.org/runit/runit-1.7.2.tar.gz"
+use_objdir="no"
+subdir="admin/runit-1.7.2"
+>
+
+<configure type="unset" />
+
+<build>
+./package/compile
+./package/check
+</build>
+
+<install>
+test -d ${ENCAP_SOURCE} || mkdir ${ENCAP_SOURCE}
+test -d ${ENCAP_SOURCE}/${ENCAP_PKGNAME} || mkdir ${ENCAP_SOURCE}/${ENCAP_PKGNAME}
+test -d ${ENCAP_SOURCE}/${ENCAP_PKGNAME}/bin || mkdir ${ENCAP_SOURCE}/${ENCAP_PKGNAME}/bin
+test -d ${ENCAP_SOURCE}/${ENCAP_PKGNAME}/share || mkdir ${ENCAP_SOURCE}/${ENCAP_PKGNAME}/share
+test -d ${ENCAP_SOURCE}/${ENCAP_PKGNAME}/share/doc || mkdir ${ENCAP_SOURCE}/${ENCAP_PKGNAME}/share/doc
+test -d ${ENCAP_SOURCE}/${ENCAP_PKGNAME}/share/doc/runit || mkdir ${ENCAP_SOURCE}/${ENCAP_PKGNAME}/share/doc/runit
+test -d ${ENCAP_SOURCE}/${ENCAP_PKGNAME}/man || mkdir ${ENCAP_SOURCE}/${ENCAP_PKGNAME}/man
+test -d ${ENCAP_SOURCE}/${ENCAP_PKGNAME}/man/man8 || mkdir ${ENCAP_SOURCE}/${ENCAP_PKGNAME}/man/man8
+cp command/* ${ENCAP_SOURCE}/${ENCAP_PKGNAME}/bin
+cp -r doc/* ${ENCAP_SOURCE}/${ENCAP_PKGNAME}/share/doc/runit
+cp -r etc ${ENCAP_SOURCE}/${ENCAP_PKGNAME}/share/doc/runit
+cp -r package ${ENCAP_SOURCE}/${ENCAP_PKGNAME}/share/doc/runit
+cp man/* ${ENCAP_SOURCE}/${ENCAP_PKGNAME}/man/man8
+</install>
+
+<clean type="unset" />
+
+</source>
+
+<prepackage>
+# Make "this encap is installed" sentinal file available in /usr/local/var/encap
+test -d var || mkdir var
+test -d var/encap || mkdir var/encap
+touch var/encap/${ENCAP_PKGNAME}
+</prepackage>
+
+<include_file name="bin/runsvdir-usrlocal-start" mode="0755"><![CDATA[
+#!/bin/sh
+PATH=/usr/local/bin:/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin
+exec env - PATH=$PATH \
+runsvdir -P /usr/local/var/service 'log: ...........................................................................................................................................................................................................................................................................................................................................................................................................'
+]]></include_file>
+
+<include_file name="inittab.boot" mode="0644"><![CDATA[
+
+SV:123456:respawn:/usr/local/bin/runsvdir-usrlocal-start
+]]></include_file>
+
+<include_file name="upstart.boot" mode="0644"><![CDATA[
+# /etc/event.d/SV 0644
+#
+# for runit - manage /usr/local/bin/runsvdir-usrlocal-start
+#
+start on runlevel-2
+start on runlevel-3
+start on runlevel-4
+start on runlevel-5
+stop on shutdown
+respawn /usr/local/bin/runsvdir-usrlocal-start
+]]></include_file>
+
+<include_file name="inittab-install" mode="0755"><![CDATA[
+#!/bin/sh -e
+if grep SV: /etc/inittab >/dev/null
+then
+ echo 'inittab contains an SV: line. I assume that runsvdir is already running.
+'
+else
+ echo 'Adding runsvdir to inittab...'
+ rm -f /etc/inittab'{new}'
+ cat /etc/inittab inittab.boot > /etc/inittab'{new}'
+ mv -f /etc/inittab'{new}' /etc/inittab
+ kill -HUP 1
+ echo 'init should start runsvdir now.
+'
+fi
+]]></include_file>
+
+<include_file name="inittab-remove" mode="0755"><![CDATA[
+#!/bin/sh -e
+if grep SV: /etc/inittab >/dev/null
+then
+ echo 'Backing up inittab to .inittab.backup...'
+ rm -f /etc/.inittab.backup
+ cp -f /etc/inittab /etc/.inittab.backup
+ echo 'Removing svscan lines from inittab...'
+ rm -f /etc/inittab'{new}'
+ grep -v SV: /etc/inittab > /etc/inittab'{new}'
+ mv -f /etc/inittab'{new}' /etc/inittab
+ kill -HUP 1
+ echo 'init should stop runsvdir now.
+'
+else
+ echo 'inittab does not contain a runsvdir line.
+'
+fi
+]]></include_file>
+
+<include_file name="postinstall" mode="0755"><![CDATA[
+#!/bin/sh
+umask 002
+BASEDIR="`echo ${0} | xargs -n1 dirname`"
+LOG=${BASEDIR}/postinstall.log
+exec > $LOG 2>&1
+
+printf "Running runit postinstall script...\n"
+date
+
+case `uname` in
+ AIX|SunOS) PS="ps -ef" ;;
+ *) PS="ps auxw" ;;
+esac
+
+printf "1: Make sure required directories exist...\n"
+test -d /usr/local/var || mkdir /usr/local/var
+test -d /usr/local/var/svlogd || mkdir /usr/local/var/svlog
+test -d /usr/local/var/service || mkdir /usr/local/var/service
+test -d /usr/local/etc || mkdir /usr/local/etc
+test -d /usr/local/etc/default || mkdir /usr/local/etc/default
+test -d /usr/local/etc/sv || mkdir /usr/local/etc/sv
+
+printf "\n2: Currently running runsv and svlogd processes:\n"
+$PS | grep [r]unsv
+$PS | grep [s]vlogd
+
+printf "\n3: Killing any running runsv and svlogd processes...\n"
+$PS | grep [r]unsv | awk '{print $2}' | xargs -n1 -i{} kill -15 -{} 2>/dev/null
+$PS | grep [s]vlogd | awk '{print $2}' | xargs -n1 -i{} kill -15 -{} 2>/dev/null
+sleep 2
+$PS | grep [r]unsv | awk '{print $2}' | xargs -n1 -i{} kill -9 -{} 2>/dev/null
+$PS | grep [s]vlogd | awk '{print $2}' | xargs -n1 -i{} kill -9 -{} 2>/dev/null
+
+printf "\n4: Currently running runsv and svlogd processes:\n"
+$PS | grep [r]unsv
+$PS | grep [s]vlogd
+
+printf "\n5: Removing any stale state information in /usr/local/etc/sv...\n"
+for service in `ls /usr/local/etc/sv`; do
+ test -d /usr/local/etc/sv/$service/supervise && rm -rf /usr/local/etc/sv/$service/supervise
+ test -d /usr/local/etc/sv/$service/log/supervise && rm -rf /usr/local/etc/sv/$service/log/supervise
+done
+
+printf "\n6: Re-enabling services that were installed before package was removed...\n"
+if [ -d /usr/local/var/service/.disabled ]; then
+ for service in `ls /usr/local/var/service/.disabled`; do
+ if [ -h /usr/local/var/service/$service ]; then
+ printf "A new version of $service exists, removing old version...\n"
+ rm /usr/local/var/service/.disabled/$service
+ else
+ printf "Re-enabling service $service...\n"
+ mv /usr/local/var/service/.disabled/$service /usr/local/var/service/
+ fi
+ done
+fi
+
+printf "\n7: Making runsvdir run all the time...\n"
+if [ -f /etc/inittab ]; then
+ printf "Installing to /etc/inittab ...\n"
+ cd ${ENCAP_SOURCE}/${ENCAP_PKGNAME} && ./inittab-install
+fi
+
+if [ -d /etc/event.d ]; then
+ printf "Installing to /etc/event.d/SV (Upstart) ...\n"
+ initctl stop SV 2>/dev/null || true
+ cd ${ENCAP_SOURCE}/${ENCAP_PKGNAME} && cp upstart.boot /etc/event.d/SV
+ initctl start SV
+fi
+
+printf "\n8: Finished runit postinstall script.\n"
+]]></include_file>
+
+<include_file name="preremove" mode="0755"><![CDATA[
+#!/bin/sh
+printf "Running runit preremove script...\n"
+umask 002
+date
+
+case `uname` in
+ AIX|SunOS) PS="ps -ef" ;;
+ *) PS="ps auxw" ;;
+esac
+
+printf "1: All sv processes runnning before any actions...\n"
+$PS | grep [s]v
+
+printf "\n2: Running sv force-shutdown on all /usr/local/var/service services.\n"
+printf "We wait up to an hour for each service to die - if it takes more than a\n"
+printf "minute, your daemon probably doesn't properly support signals, and you\n"
+printf "will probably want to manually kill the service process in another window.\n"
+for service in `ls /usr/local/var/service`; do
+ printf "Trying to force-shutdown /usr/local/var/service/$service ...\n"
+ sv -v -w 3600 force-shutdown /usr/local/var/service/$service
+done
+sleep 2
+printf "All sv processes runnning now...\n"
+$PS | grep [s]v
+
+printf "\n3: Removing all services from /usr/local/var/service/ - runsvdir should now\n"
+printf "shut down any runsv processes...\n"
+test -d /usr/local/var/service/.disabled || mkdir /usr/local/var/service/.disabled
+mv /usr/local/var/service/* /usr/local/var/service/.disabled/ 2>/dev/null || printf "No services to disable.\n"
+printf "Waiting 10 seconds for runsv processes to die...\n"
+sleep 10
+printf "All sv processes runnning now...\n"
+$PS | grep [s]v
+printf "If there are any runsv or svlogd processes still running, you will need\n"
+printf "to kill them manually.\n"
+
+printf "\n4: Now shutting down the runsvdir processes...\n"
+# Stop the "runsvdir" process {
+if [ -f /etc/inittab ]; then
+ printf "Removing from /etc/inittab ...\n"
+ cd ${ENCAP_SOURCE}/${ENCAP_PKGNAME} && ./inittab-remove
+fi
+if [ -d /etc/event.d ]; then
+ if [ -f /etc/event.d/SV ]; then
+ printf "Removing /etc/event.d/SV (Upstart) ...\n"
+ initctl stop SV || printf "SV already stopped...\n"
+ rm /etc/event.d/SV
+ fi
+fi
+# } Stop the "runsvdir" process
+sleep 2
+printf "All sv processes runnning now...\n"
+$PS | grep [s]v
+printf "runsvdir should no longer be running.\n"
+
+printf "\n5: Removing any old state from /usr/local/etc/sv directories...\n"
+for service in `ls /usr/local/etc/sv`; do
+ test -d /usr/local/etc/sv/$service/supervise && rm -rf /usr/local/etc/sv/$service/supervise
+ test -d /usr/local/etc/sv/$service/log/supervise && rm -rf /usr/local/etc/sv/$service/log/supervise
+done
+
+printf "\n6: Finished runit preremove script.\n"
+]]></include_file>
+
+<encapinfo>
+description runit - a UNIX init scheme with service supervision
+</encapinfo>
+</encap_profile>
Changes to src/encap-profiles/depricated/screen-4.0.3.ep
@@ -1,1 +1,100 @@
+<?xml version="1.0"?>
+
+<!-- $Id$ -->
+
+<!-- Not implemented yet:
+(1) postinstall
+#!/bin/ksh
+
+if [[ ! -f /usr/share/lib/terminfo/s/screen ]]; then
+ echo 'Installing 'screen' terminfo entry...'
+ /usr/bin/tic ${ENCAP_SOURCE}/${ENCAP_PKGNAME}/screeninfo.src
+fi
+(2) Solaris doesn't work. Needs a patch to configure.
+-->
+
+<encap_profile
+ profile_ver="1.0"
+ pkgspec="screen-4.0.3"
+>
+
+<prereq package="m4-1.4.4" />
+<prereq package="pkg-config-0.22" />
+<prereq package="autoconf-2.61" />
+<prereq package="automake-1.10" />
+
+<environment
+ variable="CC"
+ value="gcc -static-libgcc"
+ type="set"
+/>
+
+<environment
+ variable="PATH"
+PLATFORM_IF_MATCH(solaris)
+ value="/usr/local/bin:/usr/sfw/bin:/usr/ccs/bin:"
+PLATFORM_ELSE
+ value="/usr/local/bin:"
+PLATFORM_ENDIF
+ type="prepend"
+/>
+
+PLATFORM_IF_MATCH(linux)
+PLATFORM_ELSE
+<environment
+ variable="MAKE"
+ value="gmake"
+ type="set"
+/>
+PLATFORM_ENDIF
+
+<environment
+ variable="LDFLAGS"
+PLATFORM_IF_MATCH(linux)
+ value="-L/usr/local/lib -Wl,-rpath,/usr/local/lib -YP,/usr/local/lib:/lib:/usr/lib"
+PLATFORM_ELSE_IF_MATCH(aix)
+ value="-L/usr/local/lib -Wl,-blibpath:/usr/local/lib:/usr/lib"
+PLATFORM_ELSE_IF_MATCH(solaris)
+ value="-L/usr/local/lib -R/usr/local/lib:/usr/lib -YP,/usr/local/lib:/usr/lib"
+PLATFORM_ELSE
+PLATFORM_ENDIF
+ type="set"
+/>
+
+<environment
+ variable="CPPFLAGS"
+ value="-I/usr/local/include"
+ type="set"
+/>
+
+<source
+url="http://encapsrcdist/mirror/screen/screen-4.0.3.tar.gz
+ http://mirror.opensysadmin.com/screen/screen-4.0.3.tar.gz
+ http://ftp.uni-erlangen.de/pub/utilities/screen/screen-4.0.3.tar.gz"
+>
+
+<configure>
+./configure \
+ --prefix="${ENCAP_SOURCE}/${ENCAP_PKGNAME}" \
+ --sysconfdir="${ENCAP_TARGET}/etc" \
+ --enable-colors256 \
+ --enable-rxvt_osc \
+ --with-socket-dir=/usr/local/var/run/screen \
+ --with-sys-screenrc=/usr/local/etc/screenrc \
+ --enable-pam
+</configure>
+
+</source>
+
+<prepackage type="set">
+# Make "this encap is installed" sentinal file available in /usr/local/var/encap
+test -d var || mkdir var
+test -d var/encap || mkdir var/encap
+touch var/encap/${ENCAP_PKGNAME}
+</prepackage>
+
+<encapinfo>
+description screen - terminal multiplexor with VT100 and ANSI terminal emulation
+</encapinfo>
+</encap_profile>
Changes to src/encap-profiles/depricated/smake-1.2a22.profile
@@ -1,1 +1,57 @@
+<?xml version="1.0"?>
+
+<!-- $Id$ -->
+
+<encap_profile
+ profile_ver="1.0"
+ pkgspec="smake-1.2a22"
+>
+
+<environment
+ variable="CC"
+ value="gcc"
+ type="set"
+/>
+
+<environment
+ variable="PATH"
+ value="/usr/local/bin:"
+ type="prepend"
+/>
+
+PLATFORM_IF_MATCH(linux)
+<environment
+ variable="MAKE"
+ value="/usr/local/src/smake-1.2a22/smake-1.2/Gmake.linux"
+ type="set"
+/>
+PLATFORM_ELSE
+<environment
+ variable="MAKE"
+ value="/usr/local/src/smake-1.2a22/smake-1.2/Gmake"
+ type="set"
+/>
+PLATFORM_ENDIF
+
+<source
+ url="http://www.ibiblio.org/pub/solaris/freeware/SOURCES/smake-1.2a22.tar.gz"
+ subdir="smake-1.2"
+>
+
+<configure type="unset" />
+
+<install>
+${MAKE} INS_BASE=${ENCAP_SOURCE}/${ENCAP_PKGNAME} install
+</install>
+
+</source>
+
+<prepackage>
+${STRIP} bin/smake
+</prepackage>
+
+<encapinfo>
+description smake - Schily SING makefile system
+</encapinfo>
+</encap_profile>
Changes to src/encap-profiles/depricated/socat-1.6.0.2.ep
@@ -1,1 +1,121 @@
+<?xml version="1.0"?>
+
+<!-- $Id: socat-1.6.0.2.ep 71 2007-07-18 01:06:26Z dclark $ -->
+
+<!-- Not implemented yet:
+platform specifics - aix
+
+The flock() prototype is not available but the function is. Thus, to enable the
+socat flock options, run configure and then change in config.h the line
+/* #undef HAVE_FLOCK */
+to
+#define HAVE_FLOCK 1
+and continue the build process.
+-->
+
+<encap_profile
+ profile_ver="1.0"
+ pkgspec="socat-1.6.0.2"
+>
+
+<prereq package="m4-1.4.4" />
+<prereq package="pkg-config-0.22" />
+<prereq package="readline-5.2" />
+<prereq package="patch-2.5.9" />
+<prereq package="openssl8-0.9.8e" />
+
+<environment
+ variable="CC"
+ value="gcc -static-libgcc"
+ type="set"
+/>
+
+<environment
+ variable="PATH"
+PLATFORM_IF_MATCH(solaris)
+ value="/usr/local/bin:/usr/sfw/bin:/usr/ccs/bin:/usr/xpg4/bin:"
+PLATFORM_ELSE
+ value="/usr/local/bin:"
+PLATFORM_ENDIF
+ type="prepend"
+/>
+
+PLATFORM_IF_MATCH(linux)
+PLATFORM_ELSE
+<environment
+ variable="MAKE"
+ value="gmake"
+ type="set"
+/>
+PLATFORM_ENDIF
+
+<environment
+ variable="LDFLAGS"
+PLATFORM_IF_MATCH(linux)
+ value="-L/usr/local/lib -Wl,-rpath,/usr/local/lib -YP,/usr/local/lib:/lib:/usr/lib"
+PLATFORM_ELSE_IF_MATCH(aix)
+ value="-L/usr/local/lib -Wl,-blibpath:/usr/local/lib:/usr/lib"
+PLATFORM_ELSE_IF_MATCH(solaris)
+ value="-L/usr/local/lib -L/opt/sfw/lib -R/usr/local/lib:/opt/sfw/lib:/usr/lib -YP,/usr/local/lib:/opt/sfw/lib:/usr/lib"
+PLATFORM_ELSE
+PLATFORM_ENDIF
+ type="set"
+/>
+
+<environment
+ variable="CPPFLAGS"
+ value="-I/usr/local/include"
+ type="set"
+/>
+
+<environment
+ variable="LIBS"
+PLATFORM_IF_MATCH(solaris)
+ value="-L/usr/local/lib -L/opt/sfw/lib"
+PLATFORM_ELSE
+ value="-L/usr/local/lib"
+PLATFORM_ENDIF
+ type="set"
+/>
+
+<source
+url="http://encapsrcdist/mirror/socat/socat-1.6.0.0.tar.gz
+ http://mirror.opensysadmin.com/socat/socat-1.6.0.0.tar.gz
+ http://www.dest-unreach.org/socat/download/socat-1.6.0.0.tar.gz"
+>
+
+<patch options="-p1"
+url="http://encapsrcdist/mirror/socat/socat-1.6.0.0-patches/socat-maxfds.patch.gz
+ http://mirror.opensysadmin.com/socat/socat-1.6.0.0-patches/socat-maxfds.patch.gz
+ http://www.dest-unreach.org/socat/contrib/socat-maxfds.patch.gz"
+/>
+
+<patch options="-p1"
+url="http://encapsrcdist/mirror/socat/socat-1.6.0.0-patches/socat-servicenames.patch
+ http://mirror.opensysadmin.com/socat/socat-1.6.0.0-patches/socat-servicenames.patch
+ http://www.dest-unreach.org/socat/contrib/socat-servicenames.patch"
+/>
+
+<configure>
+chmod 755 ./install-sh
+./configure \
+ --prefix="${ENCAP_SOURCE}/${ENCAP_PKGNAME}" \
+ --sysconfdir="${ENCAP_TARGET}/etc" \
+ --disable-ip6 \
+ --disable-libwrap
+</configure>
+
+</source>
+
+<prepackage type="set">
+# Make "this encap is installed" sentinal file available in /usr/local/var/encap
+test -d var || mkdir var
+test -d var/encap || mkdir var/encap
+touch var/encap/${ENCAP_PKGNAME}
+</prepackage>
+
+<encapinfo>
+description socat - multipurpose relay for bidirectional data transfer
+</encapinfo>
+</encap_profile>
Changes to src/encap-profiles/depricated/socklog-2.1.0.ep
@@ -1,1 +1,93 @@
+<?xml version="1.0"?>
+
+<!-- $Id$ -->
+
+<!-- Not implemented yet:
+Solaris: http://smarden.org/socklog/readme.solaris.html
+-->
+
+<encap_profile
+ profile_ver="1.0"
+ pkgspec="socklog-2.1.0"
+>
+
+<prereq package="m4-1.4.4" />
+
+<environment
+ variable="CC"
+ value="gcc -static-libgcc"
+ type="set"
+/>
+
+<environment
+ variable="PATH"
+PLATFORM_IF_MATCH(solaris)
+ value="/usr/local/lib/bcfg2/bin:/usr/local/bin:/usr/sfw/bin:/usr/ccs/bin:"
+PLATFORM_ELSE
+ value="/usr/local/lib/bcfg2/bin:/usr/local/bin:"
+PLATFORM_ENDIF
+ type="prepend"
+/>
+
+<environment
+ variable="CPPFLAGS"
+ value="-I/usr/local/lib"
+ type="set"
+/>
+
+PLATFORM_IF_MATCH(linux)
+PLATFORM_ELSE
+<environment
+ variable="MAKE"
+ value="gmake"
+ type="set"
+/>
+PLATFORM_ENDIF
+
+<source
+url="http://encapsrcdist/mirror/socklog/socklog-2.1.0.tar.gz
+ http://mirror.opensysadmin.com/socklog/socklog-2.1.0.tar.gz
+ http://smarden.org/socklog/socklog-2.1.0.tar.gz"
+use_objdir="no"
+subdir="admin/socklog-2.1.0"
+>
+
+<configure type="unset" />
+
+<build>
+./package/compile
+./package/check
+</build>
+
+<install>
+test -d ${ENCAP_SOURCE} || mkdir ${ENCAP_SOURCE}
+test -d ${ENCAP_SOURCE}/${ENCAP_PKGNAME} || mkdir ${ENCAP_SOURCE}/${ENCAP_PKGNAME}
+test -d ${ENCAP_SOURCE}/${ENCAP_PKGNAME}/bin || mkdir ${ENCAP_SOURCE}/${ENCAP_PKGNAME}/bin
+test -d ${ENCAP_SOURCE}/${ENCAP_PKGNAME}/share || mkdir ${ENCAP_SOURCE}/${ENCAP_PKGNAME}/share
+test -d ${ENCAP_SOURCE}/${ENCAP_PKGNAME}/share/doc || mkdir ${ENCAP_SOURCE}/${ENCAP_PKGNAME}/share/doc
+test -d ${ENCAP_SOURCE}/${ENCAP_PKGNAME}/share/doc/socklog || mkdir ${ENCAP_SOURCE}/${ENCAP_PKGNAME}/share/doc/socklog
+test -d ${ENCAP_SOURCE}/${ENCAP_PKGNAME}/man || mkdir ${ENCAP_SOURCE}/${ENCAP_PKGNAME}/man
+test -d ${ENCAP_SOURCE}/${ENCAP_PKGNAME}/man/man1 || mkdir ${ENCAP_SOURCE}/${ENCAP_PKGNAME}/man/man1
+test -d ${ENCAP_SOURCE}/${ENCAP_PKGNAME}/man/man8 || mkdir ${ENCAP_SOURCE}/${ENCAP_PKGNAME}/man/man8
+cp command/* ${ENCAP_SOURCE}/${ENCAP_PKGNAME}/bin
+cp -r doc/* ${ENCAP_SOURCE}/${ENCAP_PKGNAME}/share/doc/socklog
+cp man/*.1 ${ENCAP_SOURCE}/${ENCAP_PKGNAME}/man/man1
+cp man/*.8 ${ENCAP_SOURCE}/${ENCAP_PKGNAME}/man/man8
+</install>
+
+<clean type="unset" />
+
+</source>
+
+<prepackage>
+# Make "this encap is installed" sentinal file available in /usr/local/var/encap
+test -d var || mkdir var
+test -d var/encap || mkdir var/encap
+touch var/encap/${ENCAP_PKGNAME}
+</prepackage>
+
+<encapinfo>
+description socklog - system and kernel logging services
+</encapinfo>
+</encap_profile>
Changes to src/encap-profiles/depricated/subversion-1.4.4.ep
@@ -1,1 +1,124 @@
+<?xml version="1.0"?>
+
+<!-- $Id$ -->
+
+<encap_profile
+ profile_ver="1.0"
+ pkgspec="subversion-1.4.4"
+>
+
+<prereq package="m4-1.4.4" />
+<prereq package="zlib-1.2.3" />
+<prereq package="pkg-config-0.22" />
+<prereq package="openssl8-0.9.8e" use_lib="yes" />
+<prereq package="python24-2.4.4" />
+<prereq package="subversion-deps-1.4.4" />
+
+<environment
+ variable="CC"
+ value="gcc -static-libgcc -fPIC"
+ type="set"
+/>
+
+<environment
+ variable="CXX"
+ value="g++ -static-libgcc"
+ type="set"
+/>
+
+<environment
+ variable="PATH"
+PLATFORM_IF_MATCH(solaris)
+ value="/usr/local/bin:/usr/sfw/bin:/usr/ccs/bin:"
+PLATFORM_ELSE
+ value="/usr/local/bin:"
+PLATFORM_ENDIF
+ type="prepend"
+/>
+
+PLATFORM_IF_MATCH(linux)
+PLATFORM_ELSE
+<environment
+ variable="MAKE"
+ value="gmake"
+ type="set"
+/>
+PLATFORM_ENDIF
+
+<environment
+ variable="LDFLAGS"
+PLATFORM_IF_MATCH(linux)
+ value="-L/usr/local/lib -Wl,-rpath,/usr/local/lib -YP,/usr/local/lib:/lib:/usr/lib"
+PLATFORM_ELSE_IF_MATCH(aix)
+ value="-L/usr/local/lib -Wl,-blibpath:/usr/local/lib:/usr/lib"
+PLATFORM_ELSE_IF_MATCH(solaris)
+ value="-L/usr/local/lib -R/usr/local/lib:/usr/lib -YP,/usr/local/lib:/usr/lib"
+PLATFORM_ELSE
+PLATFORM_ENDIF
+ type="set"
+/>
+
+<environment
+ variable="CPPFLAGS"
+ value="-I/usr/local/include"
+ type="set"
+/>
+
+PLATFORM_IF_MATCH(solaris)
+<environment
+ variable="LD"
+ value="/usr/ccs/bin/ld -L/etc/lib -ldl"
+ type="set"
+/>
+
+<environment
+ variable="LDSO"
+ value="/usr/ccs/bin/ld -L/etc/lib -ldl -G"
+ type="set"
+/>
+PLATFORM_ELSE
+PLATFORM_ENDIF
+
+<source
+ url="http://encapsrcdist/mirror/subversion/subversion-1.4.4.tar.gz
+ http://mirror.opensysadmin.com/subversion/subversion-1.4.4.tar.gz
+ http://subversion.tigris.org/downloads/subversion-1.4.4.tar.gz"
+>
+
+<configure><![CDATA[
+cd ${MKENCAP_BUILD_TREE} && tar xvf subversion-deps-1.4.4.tar
+./configure \
+ --prefix="${ENCAP_SOURCE}/${ENCAP_PKGNAME}" \
+ --without-iconv \
+ --with-gcc \
+ --without-cxx \
+ --with-ssl \
+ --with-libs=/usr/local \
+ --disable-nls \
+ --without-berkeley-db \
+ --with-editor=vi \
+ --without-gssapi \
+ --disable-javahl
+]]></configure>
+
+<build type="set">
+${MAKE} external-all
+${MAKE} local-all
+# Make check, but don't die if some tests fail
+"${MAKE} check" || true
+</build>
+
+</source>
+
+<prepackage type="set">
+# Make "this encap is installed" sentinal file available in /usr/local/var/encap
+test -d var || mkdir var
+test -d var/encap || mkdir var/encap
+touch var/encap/${ENCAP_PKGNAME}
+</prepackage>
+
+<encapinfo>
+description subversion - version control system
+</encapinfo>
+</encap_profile>
Changes to src/encap-profiles/depricated/subversion-deps-1.4.4.ep
@@ -1,1 +1,168 @@
+<?xml version="1.0"?>
+
+<!-- $Id$ -->
+
+<encap_profile
+ profile_ver="1.0"
+ pkgspec="subversion-deps-1.4.4"
+>
+
+<prereq package="m4-1.4.4" />
+<prereq package="patch-2.5.9" />
+<prereq package="pkg-config-0.22" />
+
+<environment
+ variable="PATH"
+PLATFORM_IF_MATCH(solaris)
+ value="/usr/local/bin:/usr/sfw/bin:/usr/ccs/bin:"
+PLATFORM_ELSE
+ value="/usr/local/bin:"
+PLATFORM_ENDIF
+ type="prepend"
+/>
+
+<source
+url="http://encapsrcdist/mirror/subversion/subversion-deps-1.4.4.tar.gz
+ http://mirror.opensysadmin.com/subversion/subversion-deps-1.4.4.tar.gz
+ http://subversion.tigris.org/downloads/subversion-deps-1.4.4.tar.gz"
+subdir="subversion-1.4.4"
+>
+
+<patch options="-p0" from_dir="apr-util"><![CDATA[
+--- configure.orig 2006-09-29 10:42:54.792854671 -0400
++++ configure 2006-09-29 11:41:28.653855429 -0400
+@@ -25870,7 +25870,7 @@
+ cat >>conftest.$ac_ext <<_ACEOF
+ /* end confdefs.h. */
+ $ac_includes_default
+-#include <iconv.h>
++#include <DISABLEDiconv.h>
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+@@ -25914,7 +25914,7 @@
+ cat confdefs.h >>conftest.$ac_ext
+ cat >>conftest.$ac_ext <<_ACEOF
+ /* end confdefs.h. */
+-#include <iconv.h>
++#include <DISABLEDiconv.h>
+ _ACEOF
+ if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+@@ -25999,7 +25999,7 @@
+ /* end confdefs.h. */
+
+ #include <stdlib.h>
+-#include <iconv.h>
++#include <DISABLEDiconv.h>
+
+ int
+ main ()
+@@ -26072,7 +26072,7 @@
+ /* end confdefs.h. */
+
+ #include <stdlib.h>
+-#include <iconv.h>
++#include <DISABLEDiconv.h>
+
+ int
+ main ()
+@@ -26193,7 +26193,7 @@
+ fi
+
+
+-
++apu_iconv_dir="unknown"
+ if test "$apu_iconv_dir" != "unknown"; then
+ if test "$have_iconv" != "1"; then
+ { { echo "$as_me:$LINENO: error: iconv support requested, but not found" >&5
+@@ -26302,7 +26302,7 @@
+ #include "confdefs.h"
+
+ #include <stddef.h>
+- #include <iconv.h>
++ #include <DISABLEDiconv.h>
+
+ int main(int argc, const char * const *argv) {
+
+]]></patch>
+
+<patch options="-p0" from_dir="apr-util/include"><![CDATA[
+--- apu.h.in.orig 2006-09-29 07:55:00.000000000 -0400
++++ apu.h.in 2006-09-29 07:57:12.000000000 -0400
+@@ -78,8 +78,8 @@
+ #endif /* APU_HAVE_DB */
+
+ #define APU_HAVE_APR_ICONV 0
+-#define APU_HAVE_ICONV @have_iconv@
+-#define APR_HAS_XLATE (APU_HAVE_APR_ICONV || APU_HAVE_ICONV)
++#define APU_HAVE_ICONV 0
++#define APR_HAS_XLATE 0
+
+ #endif /* APU_H */
+ /** @} */
+--- apu.hnw.orig 2006-09-29 07:55:05.000000000 -0400
++++ apu.hnw 2006-09-29 07:57:28.000000000 -0400
+@@ -74,10 +74,10 @@
+ #define APU_HAVE_DB 0
+
+
+-#define HAVE_ICONV_H 1
++#define HAVE_ICONV_H 0
+ #define APU_HAVE_APR_ICONV 0
+-#define APU_HAVE_ICONV 1
+-#define APR_HAS_XLATE (APU_HAVE_APR_ICONV || APU_HAVE_ICONV)
++#define APU_HAVE_ICONV 0
++#define APR_HAS_XLATE 0
+
+ #endif /* APU_H */
+ /** @} */
+--- apu.hw.orig 2006-09-29 07:55:10.000000000 -0400
++++ apu.hw 2006-09-29 07:57:41.000000000 -0400
+@@ -112,9 +112,9 @@
+ #endif
+
+
+-#define APU_HAVE_APR_ICONV 1
++#define APU_HAVE_APR_ICONV 0
+ #define APU_HAVE_ICONV 0
+-#define APR_HAS_XLATE (APU_HAVE_APR_ICONV || APU_HAVE_ICONV)
++#define APR_HAS_XLATE 0
+
+ #endif /* APU_H */
+ #endif /* WIN32 */
+]]></patch>
+
+<configure type="unset" />
+
+<build type="set"><![CDATA[
+test -f ${MKENCAP_BUILD_TREE}/subversion-deps-1.4.4.tar && rm ${MKENCAP_BUILD_TREE}/subversion-deps-1.4.4.tar || true
+test -d ${MKENCAP_BUILD_TREE}/subversion-1.4.4 && rm -rf ${MKENCAP_BUILD_TREE}/subversion-1.4.4 || true
+cd ${MKENCAP_BUILD_TREE}/subversion-deps-1.4.4 && mv subversion-1.4.4 ..
+cd ${MKENCAP_BUILD_TREE} && tar cf subversion-deps-1.4.4.tar subversion-1.4.4
+]]></build>
+
+<install type="set">
+test -d ${ENCAP_SOURCE} || mkdir ${ENCAP_SOURCE}
+test -d ${ENCAP_SOURCE}/${ENCAP_PKGNAME} || mkdir ${ENCAP_SOURCE}/${ENCAP_PKGNAME}
+</install>
+
+<clean type="unset" />
+
+</source>
+
+<prepackage type="set"><![CDATA[
+# Get rid of subversion dir, so subversion ep works
+test -d ${MKENCAP_BUILD_TREE}/subversion-1.4.4 && rm -rf ${MKENCAP_BUILD_TREE}/subversion-1.4.4 || true
+test -d ${MKENCAP_BUILD_TREE}/subversion-deps-1.4.4 && rm -rf ${MKENCAP_BUILD_TREE}/subversion-deps-1.4.4 || true
+# Make "this encap is installed" sentinal file available in /usr/local/var/encap
+test -d var || mkdir var
+test -d var/encap || mkdir var/encap
+touch var/encap/${ENCAP_PKGNAME}
+]]></prepackage>
+
+<encapinfo>
+description subversion-deps - software that subversion depends on
+</encapinfo>
+</encap_profile>
Changes to src/encap-profiles/depricated/twisted-2.4.0.ep
@@ -1,1 +1,2 @@ - +http://www.dclark.us/mirror/twisted/Twisted-2.4.0.tar.gz +http://tmrc.mit.edu/mirror/twisted/Twisted/2.4/Twisted-2.4.0.tar.bz2
Changes to src/encap-profiles/depricated/zopeinterface-3.0.1.ep
@@ -1,1 +1,2 @@ - +http://www.dclark.us/mirror/zopeinterface/ZopeInterface-3.0.1.tgz +http://www.zope.org/Products/ZopeInterface/3.0.1final/ZopeInterface-3.0.1.tgz
Changes to src/mln/templates/locp
@@ -1,1 +1,39 @@
+#!/bin/bash
+
+# $Id: locp 23 2007-04-13 23:56:31Z dclark $
+#
+# locp: LOopback filesystem CoPy
+#
+# See http://www.opensysadmin.com/trac/wiki/VirtualMachines for more info
+
+if [ "$(id -u)x" != "0x" ]; then
+ printf "$0: This script must be run as root\n"
+ exit 1
+fi
+
+if [ "${1}x" == "x" -o "${2}x" == "x" -o "${3}x" == "x" -o "${4}x" != "x" ]; then
+ printf "Syntax: $0 mln_image.ext2 localfile imagefile\n"
+ exit 1
+fi
+
+WD=$(pwd)
+IMGSRC=$1
+IMGMNT=${IMGSRC}.loop
+
+if [ -d $IMGMNT ]; then
+ umount $IMGMNT 2> /dev/null
+ rmdir $IMGMNT
+else
+ mkdir $IMGMNT
+fi
+
+mount $IMGSRC $IMGMNT -o loop
+if [ "$?" -eq "0" ]; then
+ cp $2 $IMGMNT/$3
+fi
+
+cd $WD
+umount $IMGMNT 2> /dev/null
+rmdir $IMGMNT
+exit 0
Changes to src/mln/templates/lodo
@@ -1,1 +1,40 @@
+#!/bin/bash
+
+# $Id: lodo 23 2007-04-13 23:56:31Z dclark $
+#
+# lodo: LOopback filesystem DO
+#
+# See http://www.opensysadmin.com/trac/wiki/VirtualMachines for more info
+
+if [ "$(id -u)x" != "0x" ]; then
+ printf "$0: This script must be run as root\n"
+ exit 1
+fi
+
+if [ "${1}x" == "x" -o "${2}x" == "x" ]; then
+ printf "Syntax: $0 mln_image.ext2 command\n"
+ exit 1
+fi
+
+WD=$(pwd)
+IMGSRC=$1
+IMGMNT=${IMGSRC}.loop
+
+if [ -d $IMGMNT ]; then
+ umount $IMGMNT 2> /dev/null
+ rmdir $IMGMNT
+else
+ mkdir $IMGMNT
+fi
+
+mount $IMGSRC $IMGMNT -o loop
+if [ "$?" -eq "0" ]; then
+ shift
+ chroot $IMGMNT $*
+fi
+
+cd $WD
+umount $IMGMNT 2> /dev/null
+rmdir $IMGMNT
+exit 0
Changes to src/mln/templates/mln-debootstrap
@@ -1,1 +1,192 @@
+#!/bin/bash -e
+
+# $Id: mln-debootstrap 24 2007-04-13 23:59:42Z dclark $
+#
+# Designed to run from a debian-based x86_64 box
+#
+# See http://www.opensysadmin.com/trac/wiki/VirtualMachines for more info
+
+if [ "$(id -u)x" != "0x" ]; then
+ printf "$0: This script must be run as root.\n"
+ exit 1
+fi
+
+if [ ! -d scripts-debootstrap ]; then
+ printf "Can't find scripts-debootstrap directory, exiting...\n"
+ exit 1
+fi
+
+help() {
+ cat << EOF
+
+$0: Please provide exactly one of these arguments:
+
+gnulinux-debian-sarge-i386
+gnulinux-debian-etch-amd64
+gnulinux-debian-etch-i386
+gnulinux-debian-lenny-amd64
+gnulinux-debian-lenny-i386
+gnulinux-debian-sid-amd64
+gnulinux-debian-sid-i386
+gnulinux-ubuntu-dapper-amd64
+gnulinux-ubuntu-dapper-i386
+gnulinux-ubuntu-edgy-amd64
+gnulinux-ubuntu-edgy-i386
+
+EOF
+exit 1
+}
+
+if [ "${1}x" == "x" -o "${2}x" != "x" ]; then help; fi
+
+for PACKAGE in debootstrap ext2resize linux32 bzip2 rsync; do
+ II="$(dpkg -l $PACKAGE | tail -1 | awk '{print $1}')"
+ if [ "${II}x" != "iix" ]; then
+ echo "Package $PACKAGE not installed, installing..."
+ apt-get install $PACKAGE
+ fi
+done
+
+# Get revision as integer
+REV="$(printf '$Revision: 24 $' | sed s/[a-zA-Z$:\ ]//g)"
+
+# All of the information we need to make the image is in the image name
+IMAGE=${1}
+MLNVERSION="V$(date +%Y%m%d).${REV}"
+export IMG="${IMAGE}-${MLNVERSION}"
+DIST="$(printf $IMG | cut -d\- -f 2)"
+REL="$(printf $IMG | cut -d\- -f 3)"
+ARCH="$(printf $IMG | cut -d\- -f 4)"
+
+echo "Logging to ${IMG}.log , will exit when complete..."
+
+exec > ${IMG}.log
+exec 2>&1
+
+echo "===>>> Creating image $IMG ..."
+
+# Find out what apt-get repository we should use
+case $DIST in
+ debian) REPO="http://debian.lcs.mit.edu/debian" ;;
+ ubuntu) REPO="http://archive.ubuntu.com/ubuntu" ;;
+ *) help ;;
+esac
+
+# Make sure we have a script to build the specified release
+if [ ! -f scripts-debootstrap/$REL ]; then help; fi
+
+# Get the right 32/64 bit commands/strings
+case $ARCH in
+ i386) PREFIXCMD="linux32" ;;
+ amd64) PREFIXCMD="linux64" ;;
+ *) help ;;
+esac
+
+set -x
+# Make the image
+dd if=/dev/zero of=${IMG}.ext2 bs=1M count=250
+mke2fs -jF ${IMG}.ext2
+mkdir $IMG
+mount $IMG.ext2 $IMG -o loop
+$PREFIXCMD debootstrap --arch $ARCH $REL $IMG $REPO scripts-debootstrap/$REL
+
+# Make the image work under UML/MLN
+LIBTLS="/lib/tls /usr/lib/tls"
+for TLS in $LIBTLS; do
+ if [ -d ${IMG}${TLS} ]; then
+ echo "Disabling $TLS ..."
+ mv ${IMG}${TLS} ${IMG}${TLS}.disabled
+ mkdir ${IMG}${TLS}
+ chmod 0 ${IMG}${TLS}
+ chattr +i ${IMG}${TLS}
+ fi
+done
+
+echo "Creating /etc/fstab ..."
+cat > $IMG/etc/fstab << EOF
+# file system mount point type options dump pass
+/dev/ubd0 / ext3 defaults 0 1
+proc /proc proc defaults 0 0
+EOF
+
+echo "Making device nodes ..."
+(cd $IMG/dev && for i in 0 1 2 3 4 5 6 7; do mknod ubd$i b 98 $[ $i * 16 ]; done)
+ls -l $IMG/dev/ubd0
+
+if [ -f $IMG/etc/inittab ]; then
+ echo "Modifying /etc/inittab for UML/MLN..."
+ # Tweak the inittab to only use tty0 and add it to securetty
+ cp $IMG/etc/inittab $IMG/etc/inittab.orig
+ grep -v "ctrlaltdel" $IMG/etc/inittab.orig | grep -v "getty" > $IMG/etc/inittab
+ echo "# We have ctrl-alt-del shut down for MLN/UML:" >> $IMG/etc/inittab
+ echo "ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -h now" >> $IMG/etc/inittab
+ echo "# We launch just one console for MLN/UML:" >> $IMG/etc/inittab
+ echo "c0:1235:respawn:/sbin/getty 38400 tty0 linux" >> $IMG/etc/inittab
+elif [ -f $IMG/etc/event.d/control-alt-delete ]; then
+ echo "Modifying Upstart for UML/MLN..."
+ cat > $IMG/etc/event.d/control-alt-delete << EOF
+# control-alt-delete - emergency keypress handling
+#
+# This task is run whenever the Control-Alt-Delete key combination is
+# pressed. Usually used to shut down the machine.
+
+on ctrlaltdel
+
+exec /sbin/shutdown -h now "Control-Alt-Delete pressed"
+EOF
+ for TTY in 2 3 4 5 6; do
+ if [ -f $IMG/etc/event.d/tty${TTY} ]; then
+ rm $IMG/etc/event.d/tty${TTY}
+ fi
+ done
+else
+ echo "ERROR: Not using inittab or upstart? Exiting..."
+ exit 1
+fi
+
+echo "# UML modification: use tty0 or ttys/0 or vc/0" >> $IMG/etc/securetty
+echo "tty0" >> $IMG/etc/securetty
+echo "ttys/0" >> $IMG/etc/securetty
+echo "vc/0" >> $IMG/etc/securetty
+
+# Copy over the version of scripts we built the image with
+mkdir $IMG/tmp/mln-bootstrap
+rsync -a mln-debootstrap $IMG/tmp/mln-bootstrap/
+rsync -a locp $IMG/tmp/mln-bootstrap/
+rsync -a lodo $IMG/tmp/mln-bootstrap/
+rsync -a scripts-debootstrap $IMG/tmp/mln-bootstrap/
+
+# Note: The root password needs to be set to empty string for MLN; this is already
+# the case with debootstrap, but other (e.g. jailtime.org) images may need to
+# be modified to use empty string instead of "password" or some other string.
+
+# Get the size of the filesystem, so we can resize later - we make it as small as
+# possible, since mln takes care of expanding the base image for us later.
+SIZE="$(du -hs $IMG | awk '{print $1}' | sed s/M//g)"
+
+umount $IMG
+rmdir $IMG
+
+RESIZE="$(expr $SIZE + 20)"
+ext2resize ${IMG}.ext2 ${RESIZE}m
+dd if=/dev/zero of=${IMG}.ext2 bs=1M seek=$RESIZE count=0
+e2fsck -fy ${IMG}.ext2
+
+
+cat > ${IMG}.mln-bootstrap-tmp << EOF
+#!/bin/sh
+sleep 5
+./locp ${IMG}.ext2 ${IMG}.log /tmp/mln-bootstrap/${IMG}.log
+sleep 5
+md5sum ${IMG}.ext2 > ${IMG}.ext2.md5
+sha1sum ${IMG}.ext2 > ${IMG}.ext2.sha1
+bzip2 -k9 ${IMG}.ext2
+rm ${IMG}.mln-bootstrap-tmp
+EOF
+
+chmod 755 ./${IMG}.mln-bootstrap-tmp
+./${IMG}.mln-bootstrap-tmp &
+
+set +x
+exit 0
Changes to src/mln/templates/scripts-debootstrap/dapper
@@ -1,1 +1,162 @@
+mirror_style release
+download_style apt
+finddebs_style from-indices
+variants - buildd
+
+work_out_debs () {
+ LIBC6=libc6
+ if [ "$ARCH" = "alpha" -o "$ARCH" = "ia64" ]; then LIBC6="libc6.1"; fi
+
+ required="$(get_debs Priority: required)"
+
+ if doing_variant -; then
+ #required="$required $(get_debs Priority: important)"
+ # ^^ should be getting debconf here somehow maybe
+ base="$(get_debs Priority: important)"
+ elif doing_variant buildd; then
+ # TODO: add Build-Essential: yes extraoverrides
+ #base="$(get_debs Build-Essential: yes)"
+
+ add () { if [ "$ARCH" = "$1" ]; then eval "$2=\"\$$2 $3\""; fi; }
+
+ base="apt binutils cpio cpp cpp-4.0 dpkg-dev g++ g++-4.0 gcc gcc-4.0 ${LIBC6}-dev libgdbm3 libstdc++6 libstdc++6-4.0-dev linux-kernel-headers make patch perl perl-modules"
+
+ add ia64 base "libunwind7-dev"
+ add sparc base "lib64gcc1"
+ add sparc base "libc6-dev-sparc64"
+ add sparc base "libc6-sparc64"
+ fi
+}
+
+first_stage_install () {
+ extract $required
+
+ mkdir -p "$TARGET/var/lib/dpkg"
+ : >"$TARGET/var/lib/dpkg/status"
+ : >"$TARGET/var/lib/dpkg/available"
+
+ setup_etc
+ if [ ! -e "$TARGET/etc/fstab" ]; then
+ echo '# UNCONFIGURED FSTAB FOR BASE SYSTEM' > "$TARGET/etc/fstab"
+ chown 0.0 "$TARGET/etc/fstab"; chmod 644 "$TARGET/etc/fstab"
+ fi
+
+ setup_devices
+
+ x_feign_install () {
+ local pkg="$1"
+ local deb="$(debfor $pkg)"
+ local ver="$(
+ ar -p "$TARGET/$deb" control.tar.gz | zcat |
+ tar -O -xf - control ./control 2>/dev/null |
+ sed -ne 's/^Version: *//Ip' | head -n 1
+ )"
+
+ mkdir -p "$TARGET/var/lib/dpkg/info"
+
+ echo \
+"Package: $pkg
+Version: $ver
+Status: install ok installed" >> "$TARGET/var/lib/dpkg/status"
+
+ touch "$TARGET/var/lib/dpkg/info/${pkg}.list"
+ }
+
+ x_feign_install dpkg
+}
+
+second_stage_install () {
+ x_core_install () {
+ smallyes '' | in_target dpkg --force-depends --install $(debfor "$@")
+ }
+
+ p () {
+ baseprog="$(($baseprog + ${1:-1}))"
+ }
+
+ setup_proc
+ in_target /sbin/ldconfig
+
+ DEBIAN_FRONTEND=noninteractive
+ DEBCONF_NONINTERACTIVE_SEEN=true
+ export DEBIAN_FRONTEND DEBCONF_NONINTERACTIVE_SEEN
+
+ baseprog=0
+ bases=7
+
+ p; progress $baseprog $bases INSTCORE "Installing core packages" #1
+ info INSTCORE "Installing core packages..."
+
+ p; progress $baseprog $bases INSTCORE "Installing core packages" #2
+ ln -sf mawk $TARGET/usr/bin/awk
+ x_core_install base-files base-passwd
+ p; progress $baseprog $bases INSTCORE "Installing core packages" #3
+ x_core_install dpkg
+
+ if [ ! -e "$TARGET/etc/localtime" ]; then
+ ln -sf /usr/share/zoneinfo/UTC "$TARGET/etc/localtime"
+ fi
+
+ p; progress $baseprog $bases INSTCORE "Installing core packages" #4
+ x_core_install $LIBC6
+
+ p; progress $baseprog $bases INSTCORE "Installing core packages" #5
+ x_core_install perl-base
+
+ p; progress $baseprog $bases INSTCORE "Installing core packages" #6
+ rm $TARGET/usr/bin/awk
+ x_core_install mawk
+
+ p; progress $baseprog $bases INSTCORE "Installing core packages" #7
+ if doing_variant -; then
+ x_core_install debconf
+ fi
+
+ baseprog=0
+ bases=$(set -- $required; echo $#)
+
+ info UNPACKREQ "Unpacking required packages..."
+
+ smallyes '' |
+ (repeat 5 in_target_failmsg UNPACK_REQ_FAIL_FIVE "Failure while unpacking required packages. This will be attempted up to five times." "" \
+ dpkg --status-fd 8 --force-depends --unpack $(debfor $required) 8>&1 1>&7 |
+ dpkg_progress $baseprog $bases UNPACKREQ "Unpacking required packages" UNPACKING) 7>&1
+
+ info CONFREQ "Configuring required packages..."
+
+ mv "$TARGET/sbin/start-stop-daemon" "$TARGET/sbin/start-stop-daemon.REAL"
+ echo \
+"#!/bin/sh
+echo
+echo \"Warning: Fake start-stop-daemon called, doing nothing\"" > "$TARGET/sbin/start-stop-daemon"
+ chmod 755 "$TARGET/sbin/start-stop-daemon"
+
+ setup_dselect_method apt
+
+ smallyes '' |
+ (in_target_failmsg CONF_REQ_FAIL "Failure while configuring required packages." "" \
+ dpkg --status-fd 8 --configure --pending --force-configure-any --force-depends 8>&1 1>&7 |
+ dpkg_progress $baseprog $bases CONFREQ "Configuring required packages" CONFIGURING) 7>&1
+
+ baseprog=0
+ bases="$(set -- $base; echo $#)"
+
+ info UNPACKBASE "Unpacking the base system..."
+
+ smallyes '' |
+ (repeat 5 in_target_failmsg INST_BASE_FAIL_FIVE "Failure while installing base packages. This will be re-attempted up to five times." "" \
+ dpkg --status-fd 8 --force-auto-select --force-overwrite --force-confold --skip-same-version --unpack $(debfor $base) 8>&1 1>&7 |
+ dpkg_progress $baseprog $bases UNPACKBASE "Unpacking base system" UNPACKING) 7>&1
+
+ info CONFBASE "Configuring the base system..."
+
+ smallyes '' |
+ (repeat 5 in_target_failmsg CONF_BASE_FAIL_FIVE "Failure while configuring base packages. This will be attempted 5 times." "" \
+ dpkg --status-fd 8 --force-confold --skip-same-version --configure -a 8>&1 1>&7 |
+ dpkg_progress $baseprog $bases CONFBASE "Configuring base system" CONFIGURING) 7>&1
+
+ mv "$TARGET/sbin/start-stop-daemon.REAL" "$TARGET/sbin/start-stop-daemon"
+ progress $bases $bases CONFBASE "Configuring base system"
+ info BASESUCCESS "Base system installed successfully."
+}
Changes to src/mln/templates/scripts-debootstrap/edgy
@@ -1,1 +1,162 @@
+mirror_style release
+download_style apt
+finddebs_style from-indices
+variants - buildd
+
+work_out_debs () {
+ LIBC6=libc6
+ if [ "$ARCH" = "alpha" -o "$ARCH" = "ia64" ]; then LIBC6="libc6.1"; fi
+
+ required="$(get_debs Priority: required)"
+
+ if doing_variant -; then
+ #required="$required $(get_debs Priority: important)"
+ # ^^ should be getting debconf here somehow maybe
+ base="$(get_debs Priority: important)"
+ elif doing_variant buildd; then
+ # TODO: add Build-Essential: yes extraoverrides
+ #base="$(get_debs Build-Essential: yes)"
+
+ add () { if [ "$ARCH" = "$1" ]; then eval "$2=\"\$$2 $3\""; fi; }
+
+ base="apt binutils cpio cpp cpp-4.1 dpkg-dev g++ g++-4.1 gcc gcc-4.1 ${LIBC6}-dev libdb4.4 libgdbm3 libstdc++6 libstdc++6-4.1-dev linux-libc-dev make patch perl perl-modules"
+
+ add ia64 base "libunwind7-dev"
+ add sparc base "lib64gcc1"
+ add sparc base "libc6-dev-sparc64"
+ add sparc base "libc6-sparc64"
+ fi
+}
+
+first_stage_install () {
+ extract $required
+
+ mkdir -p "$TARGET/var/lib/dpkg"
+ : >"$TARGET/var/lib/dpkg/status"
+ : >"$TARGET/var/lib/dpkg/available"
+
+ setup_etc
+ if [ ! -e "$TARGET/etc/fstab" ]; then
+ echo '# UNCONFIGURED FSTAB FOR BASE SYSTEM' > "$TARGET/etc/fstab"
+ chown 0.0 "$TARGET/etc/fstab"; chmod 644 "$TARGET/etc/fstab"
+ fi
+
+ setup_devices
+
+ x_feign_install () {
+ local pkg="$1"
+ local deb="$(debfor $pkg)"
+ local ver="$(
+ ar -p "$TARGET/$deb" control.tar.gz | zcat |
+ tar -O -xf - control ./control 2>/dev/null |
+ sed -ne 's/^Version: *//Ip' | head -n 1
+ )"
+
+ mkdir -p "$TARGET/var/lib/dpkg/info"
+
+ echo \
+"Package: $pkg
+Version: $ver
+Status: install ok installed" >> "$TARGET/var/lib/dpkg/status"
+
+ touch "$TARGET/var/lib/dpkg/info/${pkg}.list"
+ }
+
+ x_feign_install dpkg
+}
+
+second_stage_install () {
+ x_core_install () {
+ smallyes '' | in_target dpkg --force-depends --install $(debfor "$@")
+ }
+
+ p () {
+ baseprog="$(($baseprog + ${1:-1}))"
+ }
+
+ setup_proc
+ in_target /sbin/ldconfig
+
+ DEBIAN_FRONTEND=noninteractive
+ DEBCONF_NONINTERACTIVE_SEEN=true
+ export DEBIAN_FRONTEND DEBCONF_NONINTERACTIVE_SEEN
+
+ baseprog=0
+ bases=7
+
+ p; progress $baseprog $bases INSTCORE "Installing core packages" #1
+ info INSTCORE "Installing core packages..."
+
+ p; progress $baseprog $bases INSTCORE "Installing core packages" #2
+ ln -sf mawk $TARGET/usr/bin/awk
+ x_core_install base-files base-passwd
+ p; progress $baseprog $bases INSTCORE "Installing core packages" #3
+ x_core_install dpkg
+
+ if [ ! -e "$TARGET/etc/localtime" ]; then
+ ln -sf /usr/share/zoneinfo/UTC "$TARGET/etc/localtime"
+ fi
+
+ p; progress $baseprog $bases INSTCORE "Installing core packages" #4
+ x_core_install $LIBC6
+
+ p; progress $baseprog $bases INSTCORE "Installing core packages" #5
+ x_core_install perl-base
+
+ p; progress $baseprog $bases INSTCORE "Installing core packages" #6
+ rm $TARGET/usr/bin/awk
+ x_core_install mawk
+
+ p; progress $baseprog $bases INSTCORE "Installing core packages" #7
+ if doing_variant -; then
+ x_core_install debconf
+ fi
+
+ baseprog=0
+ bases=$(set -- $required; echo $#)
+
+ info UNPACKREQ "Unpacking required packages..."
+
+ smallyes '' |
+ (repeat 5 in_target_failmsg UNPACK_REQ_FAIL_FIVE "Failure while unpacking required packages. This will be attempted up to five times." "" \
+ dpkg --status-fd 8 --force-depends --unpack $(debfor $required) 8>&1 1>&7 |
+ dpkg_progress $baseprog $bases UNPACKREQ "Unpacking required packages" UNPACKING) 7>&1
+
+ info CONFREQ "Configuring required packages..."
+
+ mv "$TARGET/sbin/start-stop-daemon" "$TARGET/sbin/start-stop-daemon.REAL"
+ echo \
+"#!/bin/sh
+echo
+echo \"Warning: Fake start-stop-daemon called, doing nothing\"" > "$TARGET/sbin/start-stop-daemon"
+ chmod 755 "$TARGET/sbin/start-stop-daemon"
+
+ setup_dselect_method apt
+
+ smallyes '' |
+ (in_target_failmsg CONF_REQ_FAIL "Failure while configuring required packages." "" \
+ dpkg --status-fd 8 --configure --pending --force-configure-any --force-depends 8>&1 1>&7 |
+ dpkg_progress $baseprog $bases CONFREQ "Configuring required packages" CONFIGURING) 7>&1
+
+ baseprog=0
+ bases="$(set -- $base; echo $#)"
+
+ info UNPACKBASE "Unpacking the base system..."
+
+ smallyes '' |
+ (repeat 5 in_target_failmsg INST_BASE_FAIL_FIVE "Failure while installing base packages. This will be re-attempted up to five times." "" \
+ dpkg --status-fd 8 --force-auto-select --force-overwrite --force-confold --skip-same-version --unpack $(debfor $base) 8>&1 1>&7 |
+ dpkg_progress $baseprog $bases UNPACKBASE "Unpacking base system" UNPACKING) 7>&1
+
+ info CONFBASE "Configuring the base system..."
+
+ smallyes '' |
+ (repeat 5 in_target_failmsg CONF_BASE_FAIL_FIVE "Failure while configuring base packages. This will be attempted 5 times." "" \
+ dpkg --status-fd 8 --force-confold --skip-same-version --configure -a 8>&1 1>&7 |
+ dpkg_progress $baseprog $bases CONFBASE "Configuring base system" CONFIGURING) 7>&1
+
+ mv "$TARGET/sbin/start-stop-daemon.REAL" "$TARGET/sbin/start-stop-daemon"
+ progress $bases $bases CONFBASE "Configuring base system"
+ info BASESUCCESS "Base system installed successfully."
+}
Changes to src/mln/templates/scripts-debootstrap/etch
@@ -1,1 +1,180 @@
+mirror_style release
+download_style apt
+finddebs_style from-indices
+variants - buildd fakechroot
+
+if doing_variant fakechroot; then
+ test "$FAKECHROOT" = "true" || error 1 FAKECHROOTREQ "This variant requires fakechroot environment to be started"
+fi
+
+work_out_debs () {
+ LIBC6=libc6
+ if [ "$ARCH" = "alpha" -o "$ARCH" = "ia64" ]; then LIBC6="libc6.1"; fi
+
+ required="$(get_debs Priority: required)"
+
+ if doing_variant - || doing_variant fakechroot; then
+ #required="$required $(get_debs Priority: important)"
+ # ^^ should be getting debconf here somehow maybe
+ base="$(get_debs Priority: important)"
+ elif doing_variant buildd; then
+ base="$(get_debs Build-Essential: yes)"
+ fi
+
+ if doing_variant fakechroot; then
+ # ldd.fake needs binutils
+ required="$required binutils"
+ fi
+}
+
+first_stage_install () {
+ extract $required
+
+ mkdir -p "$TARGET/var/lib/dpkg"
+ : >"$TARGET/var/lib/dpkg/status"
+ echo >"$TARGET/var/lib/dpkg/available"
+
+ setup_etc
+ if [ ! -e "$TARGET/etc/fstab" ]; then
+ echo '# UNCONFIGURED FSTAB FOR BASE SYSTEM' > "$TARGET/etc/fstab"
+ chown 0.0 "$TARGET/etc/fstab"; chmod 644 "$TARGET/etc/fstab"
+ fi
+
+ if [ -x $TARGET/usr/bin/md5sum.textutils -a \! -e $TARGET/usr/bin/md5sum ]; then
+ cp $TARGET/usr/bin/md5sum.textutils $TARGET/usr/bin/md5sum
+ fi
+
+ if doing_variant fakechroot; then
+ setup_devices_fakechroot
+ else
+ setup_devices
+ fi
+
+ x_feign_install () {
+ local pkg="$1"
+ local deb="$(debfor $pkg)"
+ local ver="$(
+ ar -p "$TARGET/$deb" control.tar.gz | zcat |
+ tar -O -xf - control ./control 2>/dev/null |
+ sed -ne 's/^Version: *//Ip' | head -n 1
+ )"
+
+ mkdir -p "$TARGET/var/lib/dpkg/info"
+
+ echo \
+"Package: $pkg
+Version: $ver
+Status: install ok installed" >> "$TARGET/var/lib/dpkg/status"
+
+ touch "$TARGET/var/lib/dpkg/info/${pkg}.list"
+ }
+
+ x_feign_install dpkg
+}
+
+second_stage_install () {
+ x_core_install () {
+ smallyes '' | in_target dpkg --force-depends --install $(debfor "$@")
+ }
+
+ p () {
+ baseprog="$(($baseprog + ${1:-1}))"
+ }
+
+ if doing_variant fakechroot; then
+ setup_proc_fakechroot
+ else
+ setup_proc
+ in_target /sbin/ldconfig
+ fi
+
+ DEBIAN_FRONTEND=noninteractive
+ DEBCONF_NONINTERACTIVE_SEEN=true
+ export DEBIAN_FRONTEND DEBCONF_NONINTERACTIVE_SEEN
+
+ baseprog=0
+ bases=7
+
+ p; progress $baseprog $bases INSTCORE "Installing core packages" #1
+ info INSTCORE "Installing core packages..."
+
+ p; progress $baseprog $bases INSTCORE "Installing core packages" #2
+ ln -sf mawk $TARGET/usr/bin/awk
+ x_core_install base-files base-passwd
+ p; progress $baseprog $bases INSTCORE "Installing core packages" #3
+ x_core_install dpkg
+
+ if [ ! -e "$TARGET/etc/localtime" ]; then
+ ln -sf /usr/share/zoneinfo/UTC "$TARGET/etc/localtime"
+ fi
+
+ if doing_variant fakechroot; then
+ install_fakechroot_tools
+ fi
+
+ p; progress $baseprog $bases INSTCORE "Installing core packages" #4
+ x_core_install $LIBC6
+
+ p; progress $baseprog $bases INSTCORE "Installing core packages" #5
+ x_core_install perl-base
+
+ p; progress $baseprog $bases INSTCORE "Installing core packages" #6
+ rm $TARGET/usr/bin/awk
+ x_core_install mawk
+
+ p; progress $baseprog $bases INSTCORE "Installing core packages" #7
+ if doing_variant -; then
+ x_core_install debconf
+ fi
+
+ baseprog=0
+ bases=$(set -- $required; echo $#)
+
+ info UNPACKREQ "Unpacking required packages..."
+
+ exec 7>&1
+
+ smallyes '' |
+ (repeat 5 in_target_failmsg UNPACK_REQ_FAIL_FIVE "Failure while unpacking required packages. This will be attempted up to five times." "" \
+ dpkg --status-fd 8 --force-depends --unpack $(debfor $required) 8>&1 1>&7 || echo EXITCODE $?) |
+ dpkg_progress $baseprog $bases UNPACKREQ "Unpacking required packages" UNPACKING
+
+ info CONFREQ "Configuring required packages..."
+
+ mv "$TARGET/sbin/start-stop-daemon" "$TARGET/sbin/start-stop-daemon.REAL"
+ echo \
+"#!/bin/sh
+echo
+echo \"Warning: Fake start-stop-daemon called, doing nothing\"" > "$TARGET/sbin/start-stop-daemon"
+ chmod 755 "$TARGET/sbin/start-stop-daemon"
+
+ setup_dselect_method apt
+
+ smallyes '' |
+ (in_target_failmsg CONF_REQ_FAIL "Failure while configuring required packages." "" \
+ dpkg --status-fd 8 --configure --pending --force-configure-any --force-depends 8>&1 1>&7 || echo EXITCODE $?) |
+ dpkg_progress $baseprog $bases CONFREQ "Configuring required packages" CONFIGURING
+
+ baseprog=0
+ bases="$(set -- $base; echo $#)"
+
+ info UNPACKBASE "Unpacking the base system..."
+
+ smallyes '' |
+ (repeat 5 in_target_failmsg INST_BASE_FAIL_FIVE "Failure while installing base packages. This will be re-attempted up to five times." "" \
+ dpkg --status-fd 8 --force-overwrite --force-confold --skip-same-version --unpack $(debfor $base) 8>&1 1>&7 || echo EXITCODE $?) |
+ dpkg_progress $baseprog $bases UNPACKBASE "Unpacking base system" UNPACKING
+
+ info CONFBASE "Configuring the base system..."
+
+ smallyes '' |
+ (repeat 5 \
+ in_target_failmsg CONF_BASE_FAIL "Failure while configuring base packages." "" \
+ dpkg --status-fd 8 --force-confold --skip-same-version --configure -a 8>&1 1>&7 || echo EXITCODE $?) |
+ dpkg_progress $baseprog $bases CONFBASE "Configuring base system" CONFIGURING
+
+ mv "$TARGET/sbin/start-stop-daemon.REAL" "$TARGET/sbin/start-stop-daemon"
+ progress $bases $bases CONFBASE "Configuring base system"
+ info BASESUCCESS "Base system installed successfully."
+}
Changes to src/mln/templates/scripts-debootstrap/feisty
@@ -1,1 +1,162 @@
+mirror_style release
+download_style apt
+finddebs_style from-indices
+variants - buildd
+
+work_out_debs () {
+ LIBC6=libc6
+ if [ "$ARCH" = "alpha" -o "$ARCH" = "ia64" ]; then LIBC6="libc6.1"; fi
+
+ required="$(get_debs Priority: required)"
+
+ if doing_variant -; then
+ #required="$required $(get_debs Priority: important)"
+ # ^^ should be getting debconf here somehow maybe
+ base="$(get_debs Priority: important)"
+ elif doing_variant buildd; then
+ # TODO: add Build-Essential: yes extraoverrides
+ #base="$(get_debs Build-Essential: yes)"
+
+ add () { if [ "$ARCH" = "$1" ]; then eval "$2=\"\$$2 $3\""; fi; }
+
+ base="apt binutils cpio cpp cpp-4.1 dpkg-dev g++ g++-4.1 gcc gcc-4.1 ${LIBC6}-dev libdb4.4 libgdbm3 libstdc++6 libstdc++6-4.1-dev linux-libc-dev make patch perl perl-modules"
+
+ add ia64 base "libunwind7-dev"
+ add sparc base "lib64gcc1"
+ add sparc base "libc6-dev-sparc64"
+ add sparc base "libc6-sparc64"
+ fi
+}
+
+first_stage_install () {
+ extract $required
+
+ mkdir -p "$TARGET/var/lib/dpkg"
+ : >"$TARGET/var/lib/dpkg/status"
+ : >"$TARGET/var/lib/dpkg/available"
+
+ setup_etc
+ if [ ! -e "$TARGET/etc/fstab" ]; then
+ echo '# UNCONFIGURED FSTAB FOR BASE SYSTEM' > "$TARGET/etc/fstab"
+ chown 0.0 "$TARGET/etc/fstab"; chmod 644 "$TARGET/etc/fstab"
+ fi
+
+ setup_devices
+
+ x_feign_install () {
+ local pkg="$1"
+ local deb="$(debfor $pkg)"
+ local ver="$(
+ ar -p "$TARGET/$deb" control.tar.gz | zcat |
+ tar -O -xf - control ./control 2>/dev/null |
+ sed -ne 's/^Version: *//Ip' | head -n 1
+ )"
+
+ mkdir -p "$TARGET/var/lib/dpkg/info"
+
+ echo \
+"Package: $pkg
+Version: $ver
+Status: install ok installed" >> "$TARGET/var/lib/dpkg/status"
+
+ touch "$TARGET/var/lib/dpkg/info/${pkg}.list"
+ }
+
+ x_feign_install dpkg
+}
+
+second_stage_install () {
+ x_core_install () {
+ smallyes '' | in_target dpkg --force-depends --install $(debfor "$@")
+ }
+
+ p () {
+ baseprog="$(($baseprog + ${1:-1}))"
+ }
+
+ setup_proc
+ in_target /sbin/ldconfig
+
+ DEBIAN_FRONTEND=noninteractive
+ DEBCONF_NONINTERACTIVE_SEEN=true
+ export DEBIAN_FRONTEND DEBCONF_NONINTERACTIVE_SEEN
+
+ baseprog=0
+ bases=7
+
+ p; progress $baseprog $bases INSTCORE "Installing core packages" #1
+ info INSTCORE "Installing core packages..."
+
+ p; progress $baseprog $bases INSTCORE "Installing core packages" #2
+ ln -sf mawk $TARGET/usr/bin/awk
+ x_core_install base-files base-passwd
+ p; progress $baseprog $bases INSTCORE "Installing core packages" #3
+ x_core_install dpkg
+
+ if [ ! -e "$TARGET/etc/localtime" ]; then
+ ln -sf /usr/share/zoneinfo/UTC "$TARGET/etc/localtime"
+ fi
+
+ p; progress $baseprog $bases INSTCORE "Installing core packages" #4
+ x_core_install $LIBC6
+
+ p; progress $baseprog $bases INSTCORE "Installing core packages" #5
+ x_core_install perl-base
+
+ p; progress $baseprog $bases INSTCORE "Installing core packages" #6
+ rm $TARGET/usr/bin/awk
+ x_core_install mawk
+
+ p; progress $baseprog $bases INSTCORE "Installing core packages" #7
+ if doing_variant -; then
+ x_core_install debconf
+ fi
+
+ baseprog=0
+ bases=$(set -- $required; echo $#)
+
+ info UNPACKREQ "Unpacking required packages..."
+
+ smallyes '' |
+ (repeat 5 in_target_failmsg UNPACK_REQ_FAIL_FIVE "Failure while unpacking required packages. This will be attempted up to five times." "" \
+ dpkg --status-fd 8 --force-depends --unpack $(debfor $required) 8>&1 1>&7 |
+ dpkg_progress $baseprog $bases UNPACKREQ "Unpacking required packages" UNPACKING) 7>&1
+
+ info CONFREQ "Configuring required packages..."
+
+ mv "$TARGET/sbin/start-stop-daemon" "$TARGET/sbin/start-stop-daemon.REAL"
+ echo \
+"#!/bin/sh
+echo
+echo \"Warning: Fake start-stop-daemon called, doing nothing\"" > "$TARGET/sbin/start-stop-daemon"
+ chmod 755 "$TARGET/sbin/start-stop-daemon"
+
+ setup_dselect_method apt
+
+ smallyes '' |
+ (in_target_failmsg CONF_REQ_FAIL "Failure while configuring required packages." "" \
+ dpkg --status-fd 8 --configure --pending --force-configure-any --force-depends 8>&1 1>&7 |
+ dpkg_progress $baseprog $bases CONFREQ "Configuring required packages" CONFIGURING) 7>&1
+
+ baseprog=0
+ bases="$(set -- $base; echo $#)"
+
+ info UNPACKBASE "Unpacking the base system..."
+
+ smallyes '' |
+ (repeat 5 in_target_failmsg INST_BASE_FAIL_FIVE "Failure while installing base packages. This will be re-attempted up to five times." "" \
+ dpkg --status-fd 8 --force-auto-select --force-overwrite --force-confold --skip-same-version --unpack $(debfor $base) 8>&1 1>&7 |
+ dpkg_progress $baseprog $bases UNPACKBASE "Unpacking base system" UNPACKING) 7>&1
+
+ info CONFBASE "Configuring the base system..."
+
+ smallyes '' |
+ (repeat 5 in_target_failmsg CONF_BASE_FAIL_FIVE "Failure while configuring base packages. This will be attempted 5 times." "" \
+ dpkg --status-fd 8 --force-confold --skip-same-version --configure -a 8>&1 1>&7 |
+ dpkg_progress $baseprog $bases CONFBASE "Configuring base system" CONFIGURING) 7>&1
+
+ mv "$TARGET/sbin/start-stop-daemon.REAL" "$TARGET/sbin/start-stop-daemon"
+ progress $bases $bases CONFBASE "Configuring base system"
+ info BASESUCCESS "Base system installed successfully."
+}
Changes to src/mln/templates/scripts-debootstrap/lenny
@@ -1,1 +1,180 @@
+mirror_style release
+download_style apt
+finddebs_style from-indices
+variants - buildd fakechroot
+
+if doing_variant fakechroot; then
+ test "$FAKECHROOT" = "true" || error 1 FAKECHROOTREQ "This variant requires fakechroot environment to be started"
+fi
+
+work_out_debs () {
+ LIBC6=libc6
+ if [ "$ARCH" = "alpha" -o "$ARCH" = "ia64" ]; then LIBC6="libc6.1"; fi
+
+ required="$(get_debs Priority: required)"
+
+ if doing_variant - || doing_variant fakechroot; then
+ #required="$required $(get_debs Priority: important)"
+ # ^^ should be getting debconf here somehow maybe
+ base="$(get_debs Priority: important)"
+ elif doing_variant buildd; then
+ base="$(get_debs Build-Essential: yes)"
+ fi
+
+ if doing_variant fakechroot; then
+ # ldd.fake needs binutils
+ required="$required binutils"
+ fi
+}
+
+first_stage_install () {
+ extract $required
+
+ mkdir -p "$TARGET/var/lib/dpkg"
+ : >"$TARGET/var/lib/dpkg/status"
+ echo >"$TARGET/var/lib/dpkg/available"
+
+ setup_etc
+ if [ ! -e "$TARGET/etc/fstab" ]; then
+ echo '# UNCONFIGURED FSTAB FOR BASE SYSTEM' > "$TARGET/etc/fstab"
+ chown 0.0 "$TARGET/etc/fstab"; chmod 644 "$TARGET/etc/fstab"
+ fi
+
+ if [ -x $TARGET/usr/bin/md5sum.textutils -a \! -e $TARGET/usr/bin/md5sum ]; then
+ cp $TARGET/usr/bin/md5sum.textutils $TARGET/usr/bin/md5sum
+ fi
+
+ if doing_variant fakechroot; then
+ setup_devices_fakechroot
+ else
+ setup_devices
+ fi
+
+ x_feign_install () {
+ local pkg="$1"
+ local deb="$(debfor $pkg)"
+ local ver="$(
+ ar -p "$TARGET/$deb" control.tar.gz | zcat |
+ tar -O -xf - control ./control 2>/dev/null |
+ sed -ne 's/^Version: *//Ip' | head -n 1
+ )"
+
+ mkdir -p "$TARGET/var/lib/dpkg/info"
+
+ echo \
+"Package: $pkg
+Version: $ver
+Status: install ok installed" >> "$TARGET/var/lib/dpkg/status"
+
+ touch "$TARGET/var/lib/dpkg/info/${pkg}.list"
+ }
+
+ x_feign_install dpkg
+}
+
+second_stage_install () {
+ x_core_install () {
+ smallyes '' | in_target dpkg --force-depends --install $(debfor "$@")
+ }
+
+ p () {
+ baseprog="$(($baseprog + ${1:-1}))"
+ }
+
+ if doing_variant fakechroot; then
+ setup_proc_fakechroot
+ else
+ setup_proc
+ in_target /sbin/ldconfig
+ fi
+
+ DEBIAN_FRONTEND=noninteractive
+ DEBCONF_NONINTERACTIVE_SEEN=true
+ export DEBIAN_FRONTEND DEBCONF_NONINTERACTIVE_SEEN
+
+ baseprog=0
+ bases=7
+
+ p; progress $baseprog $bases INSTCORE "Installing core packages" #1
+ info INSTCORE "Installing core packages..."
+
+ p; progress $baseprog $bases INSTCORE "Installing core packages" #2
+ ln -sf mawk $TARGET/usr/bin/awk
+ x_core_install base-files base-passwd
+ p; progress $baseprog $bases INSTCORE "Installing core packages" #3
+ x_core_install dpkg
+
+ if [ ! -e "$TARGET/etc/localtime" ]; then
+ ln -sf /usr/share/zoneinfo/UTC "$TARGET/etc/localtime"
+ fi
+
+ if doing_variant fakechroot; then
+ install_fakechroot_tools
+ fi
+
+ p; progress $baseprog $bases INSTCORE "Installing core packages" #4
+ x_core_install $LIBC6
+
+ p; progress $baseprog $bases INSTCORE "Installing core packages" #5
+ x_core_install perl-base
+
+ p; progress $baseprog $bases INSTCORE "Installing core packages" #6
+ rm $TARGET/usr/bin/awk
+ x_core_install mawk
+
+ p; progress $baseprog $bases INSTCORE "Installing core packages" #7
+ if doing_variant -; then
+ x_core_install debconf
+ fi
+
+ baseprog=0
+ bases=$(set -- $required; echo $#)
+
+ info UNPACKREQ "Unpacking required packages..."
+
+ exec 7>&1
+
+ smallyes '' |
+ (repeat 5 in_target_failmsg UNPACK_REQ_FAIL_FIVE "Failure while unpacking required packages. This will be attempted up to five times." "" \
+ dpkg --status-fd 8 --force-depends --unpack $(debfor $required) 8>&1 1>&7 || echo EXITCODE $?) |
+ dpkg_progress $baseprog $bases UNPACKREQ "Unpacking required packages" UNPACKING
+
+ info CONFREQ "Configuring required packages..."
+
+ mv "$TARGET/sbin/start-stop-daemon" "$TARGET/sbin/start-stop-daemon.REAL"
+ echo \
+"#!/bin/sh
+echo
+echo \"Warning: Fake start-stop-daemon called, doing nothing\"" > "$TARGET/sbin/start-stop-daemon"
+ chmod 755 "$TARGET/sbin/start-stop-daemon"
+
+ setup_dselect_method apt
+
+ smallyes '' |
+ (in_target_failmsg CONF_REQ_FAIL "Failure while configuring required packages." "" \
+ dpkg --status-fd 8 --configure --pending --force-configure-any --force-depends 8>&1 1>&7 || echo EXITCODE $?) |
+ dpkg_progress $baseprog $bases CONFREQ "Configuring required packages" CONFIGURING
+
+ baseprog=0
+ bases="$(set -- $base; echo $#)"
+
+ info UNPACKBASE "Unpacking the base system..."
+
+ smallyes '' |
+ (repeat 5 in_target_failmsg INST_BASE_FAIL_FIVE "Failure while installing base packages. This will be re-attempted up to five times." "" \
+ dpkg --status-fd 8 --force-overwrite --force-confold --skip-same-version --unpack $(debfor $base) 8>&1 1>&7 || echo EXITCODE $?) |
+ dpkg_progress $baseprog $bases UNPACKBASE "Unpacking base system" UNPACKING
+
+ info CONFBASE "Configuring the base system..."
+
+ smallyes '' |
+ (repeat 5 \
+ in_target_failmsg CONF_BASE_FAIL "Failure while configuring base packages." "" \
+ dpkg --status-fd 8 --force-confold --skip-same-version --configure -a 8>&1 1>&7 || echo EXITCODE $?) |
+ dpkg_progress $baseprog $bases CONFBASE "Configuring base system" CONFIGURING
+
+ mv "$TARGET/sbin/start-stop-daemon.REAL" "$TARGET/sbin/start-stop-daemon"
+ progress $bases $bases CONFBASE "Configuring base system"
+ info BASESUCCESS "Base system installed successfully."
+}
Changes to src/mln/templates/scripts-debootstrap/sarge
@@ -1,1 +1,219 @@
+mirror_style release
+download_style apt
+
+work_out_debs () {
+
+ required="base-files base-passwd bash bsdutils coreutils libacl1 libattr1 debconf debconf-i18n liblocale-gettext-perl libtext-wrapi18n-perl libtext-charwidth-perl debianutils diff dpkg dselect libblkid1 e2fsprogs e2fslibs libcomerr2 libss2 libuuid1 findutils grep gzip hostname libcap1 libc6 libdb1-compat libdb3 libncurses5 libnewt0.51 libpam-modules libpam-runtime libpam0g libperl5.8 libpopt0 login makedev mawk modutils mount ncurses-base ncurses-bin passwd perl-base procps sed slang1a-utf8 initscripts sysvinit sysv-rc tar util-linux whiptail libgcc1 gcc-3.3-base libstdc++5"
+
+ base="adduser apt apt-utils libdb4.2 at base-config aptitude libsigc++-1.2-5c102 bsdmainutils console-common console-tools libconsole console-data cpio cron dhcp-client ed exim4 exim4-base exim4-config exim4-daemon-light libgcrypt11 libgnutls11 libgpg-error0 libopencdk8 libtasn1-2 fdutils gettext-base groff-base ifupdown info klogd libssl0.9.7 liblzo1 zlib1g liblockfile1 libpcre3 libwrap0 logrotate mailx man-db libgdbm3 manpages nano net-tools netbase netkit-inetd iputils-ping nvi ppp pppconfig pppoe pppoeconf libpcap0.7 sysklogd tasksel libtextwrap1 tcpd telnet libtext-iconv-perl wget"
+
+ without_package () {
+ echo "$2" | tr ' ' '\n' | grep -v "^$1$" | tr '\n' ' '
+ }
+ subst_package () {
+ echo "$3" | tr ' ' '\n' | sed "s/^$1$/$2/" | tr '\n' ' '
+ }
+
+ LIBC6=libc6
+ IPFWTOOL=iptables
+
+ case $ARCH in
+ "alpha")
+ required="$(subst_package "libc6" "libc6.1" "$required")"
+ base="$base pciutils"
+ LIBC6="libc6.1"
+ IPFWTOOL="ipchains"
+ ;;
+ "arm")
+ base="$base libgpmg1"
+ IPFWTOOL="ipchains iptables"
+ ;;
+ "i386")
+ required="$(without_package "libperl5.8" "$required")"
+ base="$base pciutils psmisc"
+ IPFWTOOL="ipchains iptables"
+ ;;
+ "ia64")
+ required="$(subst_package "libc6" "libc6.1" "$required") libreadline4"
+ base="$base elilo efibootmgr dosfstools libparted1.6-12 parted"
+ LIBC6="libc6.1"
+ ;;
+ "m68k")
+ required="$required libreadline4"
+ base="$base atari-bootstrap atari-fdisk amiga-fdisk eject mac-fdisk pmac-fdisk-cross vmelilo"
+ IPFWTOOL="ipchains"
+ ;;
+ "powerpc")
+ required="$required libreadline4"
+ base="$base mac-fdisk amiga-fdisk psmisc powerpc-utils pciutils hfsutils"
+ IPFWTOOL="ipchains iptables"
+ ;;
+ "sparc")
+ base="$base silo eject pciutils sparc-utils"
+ IPFWTOOL="ipchains iptables"
+ ;;
+ "mips")
+ base="$base dvhtool pciutils"
+ ;;
+ "mipsel")
+ base="$base pciutils"
+ ;;
+ "hppa")
+ base="$base palo pciutils"
+ required="$(without_package "libstdc++2.10-glibc2.2" "$required")"
+ ;;
+ s390|s390x)
+ # base-config depends on console-tools and console-data
+ # so we can't exclude them although they are useless on s390
+ base="$base s390-tools telnetd devfsd"
+ base="$(without_package "console-tools-libs" "$base")"
+ base="$(without_package "fdutils" "$base")"
+ base="$(without_package "ppp" "$base")"
+ base="$(without_package "pppconfig" "$base")"
+ base="$(without_package "pppoe" "$base")"
+ base="$(without_package "pppoeconf" "$base")"
+ ;;
+ sh*)
+ base="$base libstdc++3 gcc-3.0-base"
+ base="$(without_package "fdutils" "$base")"
+ required="$required libgcc1"
+ required="$(without_package "libstdc++2.10-glibc2.2" "$required")"
+ ;;
+ "amd64")
+ base="$base pciutils psmisc"
+ IPFWTOOL="iptables"
+ ;;
+ *)
+ # who knows?
+ ;;
+ esac
+
+ base="$base $IPFWTOOL"
+}
+
+first_stage_install () {
+ extract $required
+
+ mkdir -p "$TARGET/var/lib/dpkg"
+ : >"$TARGET/var/lib/dpkg/status"
+ echo >"$TARGET/var/lib/dpkg/available"
+
+ setup_etc
+ if [ ! -e "$TARGET/etc/fstab" ]; then
+ echo '# UNCONFIGURED FSTAB FOR BASE SYSTEM' > "$TARGET/etc/fstab"
+ chown 0.0 "$TARGET/etc/fstab"; chmod 644 "$TARGET/etc/fstab"
+ fi
+
+ setup_devices
+
+ x_feign_install () {
+ local pkg="$1"
+ local deb="$(debfor $pkg)"
+ local ver="$(
+ ar -p "$TARGET/$deb" control.tar.gz | zcat |
+ tar -O -xf - control ./control 2>/dev/null |
+ sed -ne 's/^Version: *//Ip' | head -n 1
+ )"
+
+ mkdir -p "$TARGET/var/lib/dpkg/info"
+
+ echo \
+"Package: $pkg
+Version: $ver
+Status: install ok installed" >> "$TARGET/var/lib/dpkg/status"
+
+ touch "$TARGET/var/lib/dpkg/info/${pkg}.list"
+ }
+
+ x_feign_install dpkg
+}
+
+second_stage_install () {
+ x_core_install () {
+ smallyes '' | in_target dpkg --force-depends --install $(debfor "$@")
+ }
+
+ p () {
+ baseprog="$(($baseprog + ${1:-1}))"
+ }
+
+ setup_proc
+ in_target /sbin/ldconfig
+
+ DEBIAN_FRONTEND=noninteractive
+ DEBCONF_NONINTERACTIVE_SEEN=true
+ export DEBIAN_FRONTEND DEBCONF_NONINTERACTIVE_SEEN
+
+ baseprog=0
+ bases=40
+
+ p; progress $baseprog $bases INSTBASE "Installing base system" #1
+ info INSTCORE "Installing core packages..."
+
+ p; progress $baseprog $bases INSTBASE "Installing base system" #2
+ ln -sf mawk $TARGET/usr/bin/awk
+ x_core_install base-files base-passwd
+ p; progress $baseprog $bases INSTBASE "Installing base system" #3
+ x_core_install dpkg
+
+ if [ ! -e "$TARGET/etc/localtime" ]; then
+ ln -sf /usr/share/zoneinfo/UTC "$TARGET/etc/localtime"
+ fi
+
+ p; progress $baseprog $bases INSTBASE "Installing base system" #4
+ x_core_install $LIBC6
+
+ p; progress $baseprog $bases INSTBASE "Installing base system" #5
+ x_core_install perl-base
+ p; progress $baseprog $bases INSTBASE "Installing base system" #6
+ rm $TARGET/usr/bin/awk
+ x_core_install mawk
+ p; progress $baseprog $bases INSTBASE "Installing base system" #7
+ x_core_install debconf
+
+ info UNPACKREQ "Unpacking required packages..."
+
+ p; progress $baseprog $bases INSTBASE "Installing base system" #8
+ smallyes '' | repeat 5 in_target_failmsg UNPACK_REQ_FAIL_FIVE "Failure while unpacking required packages. This will be attempted up to five times." "" dpkg --force-depends --unpack $(debfor $required)
+ p 10; progress $baseprog $bases INSTBASE "Installing base system" #18
+
+ info CONFREQ "Configuring required packages..."
+
+ mv "$TARGET/sbin/start-stop-daemon" "$TARGET/sbin/start-stop-daemon.REAL"
+ echo \
+"#!/bin/sh
+echo
+echo \"Warning: Fake start-stop-daemon called, doing nothing\"" > "$TARGET/sbin/start-stop-daemon"
+ chmod 755 "$TARGET/sbin/start-stop-daemon"
+
+ setup_dselect_method apt
+
+ p; progress $baseprog $bases INSTBASE "Installing base system" #19
+ smallyes '' | in_target_failmsg CONF_REQ_FAIL "Failure while configuring required packages." "" dpkg --configure --pending --force-configure-any --force-depends
+ p 10; progress $baseprog $bases INSTBASE "Installing base system" #29
+
+# if [ ! -e "$TARGET/etc/exim/exim.conf" ]; then
+# mkdir -p "$TARGET/etc/exim"
+# touch "$TARGET/etc/exim/exim.conf"
+# fi
+
+ info INSTBASE "Installing base packages..."
+
+ p; progress $baseprog $bases INSTBASE "Installing base system" #30
+ smallyes '' | repeat 5 in_target_failmsg INST_BASE_FAIL_FIVE "Failure while installing base packages. This will be re-attempted up to five times." "" dpkg --force-auto-select --force-overwrite --force-confold --skip-same-version --unpack $(debfor $base)
+
+ rm -f "$TARGET/usr/sbin/sendmail"
+ ln -sf /bin/true "$TARGET/usr/sbin/sendmail"
+
+ smallyes '' | repeat 5 in_target_failmsg CONF_BASE_FAIL_FIVE "Failure while configuring base packages. This will be attempted 5 times." "" dpkg --force-confold --skip-same-version --configure -a
+
+ rm -f "$TARGET/usr/sbin/sendmail"
+ ln -sf exim4 "$TARGET/usr/sbin/sendmail"
+
+ p 9; progress $baseprog $bases INSTBASE "Installing base system" #39
+
+ mv "$TARGET/sbin/start-stop-daemon.REAL" "$TARGET/sbin/start-stop-daemon"
+ progress $bases $bases INSTBASE "Installing base system" #40
+ info BASESUCCESS "Base system installed successfully."
+}
Changes to src/mln/templates/scripts-debootstrap/sid
@@ -1,1 +1,180 @@
+mirror_style release
+download_style apt
+finddebs_style from-indices
+variants - buildd fakechroot
+
+if doing_variant fakechroot; then
+ test "$FAKECHROOT" = "true" || error 1 FAKECHROOTREQ "This variant requires fakechroot environment to be started"
+fi
+
+work_out_debs () {
+ LIBC6=libc6
+ if [ "$ARCH" = "alpha" -o "$ARCH" = "ia64" ]; then LIBC6="libc6.1"; fi
+
+ required="$(get_debs Priority: required)"
+
+ if doing_variant - || doing_variant fakechroot; then
+ #required="$required $(get_debs Priority: important)"
+ # ^^ should be getting debconf here somehow maybe
+ base="$(get_debs Priority: important)"
+ elif doing_variant buildd; then
+ base="$(get_debs Build-Essential: yes)"
+ fi
+
+ if doing_variant fakechroot; then
+ # ldd.fake needs binutils
+ required="$required binutils"
+ fi
+}
+
+first_stage_install () {
+ extract $required
+
+ mkdir -p "$TARGET/var/lib/dpkg"
+ : >"$TARGET/var/lib/dpkg/status"
+ echo >"$TARGET/var/lib/dpkg/available"
+
+ setup_etc
+ if [ ! -e "$TARGET/etc/fstab" ]; then
+ echo '# UNCONFIGURED FSTAB FOR BASE SYSTEM' > "$TARGET/etc/fstab"
+ chown 0.0 "$TARGET/etc/fstab"; chmod 644 "$TARGET/etc/fstab"
+ fi
+
+ if [ -x $TARGET/usr/bin/md5sum.textutils -a \! -e $TARGET/usr/bin/md5sum ]; then
+ cp $TARGET/usr/bin/md5sum.textutils $TARGET/usr/bin/md5sum
+ fi
+
+ if doing_variant fakechroot; then
+ setup_devices_fakechroot
+ else
+ setup_devices
+ fi
+
+ x_feign_install () {
+ local pkg="$1"
+ local deb="$(debfor $pkg)"
+ local ver="$(
+ ar -p "$TARGET/$deb" control.tar.gz | zcat |
+ tar -O -xf - control ./control 2>/dev/null |
+ sed -ne 's/^Version: *//Ip' | head -n 1
+ )"
+
+ mkdir -p "$TARGET/var/lib/dpkg/info"
+
+ echo \
+"Package: $pkg
+Version: $ver
+Status: install ok installed" >> "$TARGET/var/lib/dpkg/status"
+
+ touch "$TARGET/var/lib/dpkg/info/${pkg}.list"
+ }
+
+ x_feign_install dpkg
+}
+
+second_stage_install () {
+ x_core_install () {
+ smallyes '' | in_target dpkg --force-depends --install $(debfor "$@")
+ }
+
+ p () {
+ baseprog="$(($baseprog + ${1:-1}))"
+ }
+
+ if doing_variant fakechroot; then
+ setup_proc_fakechroot
+ else
+ setup_proc
+ in_target /sbin/ldconfig
+ fi
+
+ DEBIAN_FRONTEND=noninteractive
+ DEBCONF_NONINTERACTIVE_SEEN=true
+ export DEBIAN_FRONTEND DEBCONF_NONINTERACTIVE_SEEN
+
+ baseprog=0
+ bases=7
+
+ p; progress $baseprog $bases INSTCORE "Installing core packages" #1
+ info INSTCORE "Installing core packages..."
+
+ p; progress $baseprog $bases INSTCORE "Installing core packages" #2
+ ln -sf mawk $TARGET/usr/bin/awk
+ x_core_install base-files base-passwd
+ p; progress $baseprog $bases INSTCORE "Installing core packages" #3
+ x_core_install dpkg
+
+ if [ ! -e "$TARGET/etc/localtime" ]; then
+ ln -sf /usr/share/zoneinfo/UTC "$TARGET/etc/localtime"
+ fi
+
+ if doing_variant fakechroot; then
+ install_fakechroot_tools
+ fi
+
+ p; progress $baseprog $bases INSTCORE "Installing core packages" #4
+ x_core_install $LIBC6
+
+ p; progress $baseprog $bases INSTCORE "Installing core packages" #5
+ x_core_install perl-base
+
+ p; progress $baseprog $bases INSTCORE "Installing core packages" #6
+ rm $TARGET/usr/bin/awk
+ x_core_install mawk
+
+ p; progress $baseprog $bases INSTCORE "Installing core packages" #7
+ if doing_variant -; then
+ x_core_install debconf
+ fi
+
+ baseprog=0
+ bases=$(set -- $required; echo $#)
+
+ info UNPACKREQ "Unpacking required packages..."
+
+ exec 7>&1
+
+ smallyes '' |
+ (repeat 5 in_target_failmsg UNPACK_REQ_FAIL_FIVE "Failure while unpacking required packages. This will be attempted up to five times." "" \
+ dpkg --status-fd 8 --force-depends --unpack $(debfor $required) 8>&1 1>&7 || echo EXITCODE $?) |
+ dpkg_progress $baseprog $bases UNPACKREQ "Unpacking required packages" UNPACKING
+
+ info CONFREQ "Configuring required packages..."
+
+ mv "$TARGET/sbin/start-stop-daemon" "$TARGET/sbin/start-stop-daemon.REAL"
+ echo \
+"#!/bin/sh
+echo
+echo \"Warning: Fake start-stop-daemon called, doing nothing\"" > "$TARGET/sbin/start-stop-daemon"
+ chmod 755 "$TARGET/sbin/start-stop-daemon"
+
+ setup_dselect_method apt
+
+ smallyes '' |
+ (in_target_failmsg CONF_REQ_FAIL "Failure while configuring required packages." "" \
+ dpkg --status-fd 8 --configure --pending --force-configure-any --force-depends 8>&1 1>&7 || echo EXITCODE $?) |
+ dpkg_progress $baseprog $bases CONFREQ "Configuring required packages" CONFIGURING
+
+ baseprog=0
+ bases="$(set -- $base; echo $#)"
+
+ info UNPACKBASE "Unpacking the base system..."
+
+ smallyes '' |
+ (repeat 5 in_target_failmsg INST_BASE_FAIL_FIVE "Failure while installing base packages. This will be re-attempted up to five times." "" \
+ dpkg --status-fd 8 --force-overwrite --force-confold --skip-same-version --unpack $(debfor $base) 8>&1 1>&7 || echo EXITCODE $?) |
+ dpkg_progress $baseprog $bases UNPACKBASE "Unpacking base system" UNPACKING
+
+ info CONFBASE "Configuring the base system..."
+
+ smallyes '' |
+ (repeat 5 \
+ in_target_failmsg CONF_BASE_FAIL "Failure while configuring base packages." "" \
+ dpkg --status-fd 8 --force-confold --skip-same-version --configure -a 8>&1 1>&7 || echo EXITCODE $?) |
+ dpkg_progress $baseprog $bases CONFBASE "Configuring base system" CONFIGURING
+
+ mv "$TARGET/sbin/start-stop-daemon.REAL" "$TARGET/sbin/start-stop-daemon"
+ progress $bases $bases CONFBASE "Configuring base system"
+ info BASESUCCESS "Base system installed successfully."
+}
Changes to src/mln/templates/scripts-rpmstrap/centos4
@@ -1,1 +1,298 @@
+# Copyright 2005 Progeny Linux Systems, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# Authors: Sam Hart
+# Jake Tabke
+# Derrik Pates
+# Juraj Bednar (x86_64 support)
+
+suite_notes() {
+ cat <<EOF
+CentOS 4 Suite Script
+---------------------
+Builds a basic CentOS 4 bootstrap.
+
+Authors: Sam Hart, Jake Tabke, Derrik Pates, Juraj Bednar
+
+EOF
+}
+
+work_out_mirror() {
+ local big_mirror_list=""
+ case $ARCH in
+ i[3456]86)
+ big_mirror_list=$(cat <<EOF
+http://mirror.centos.org/centos/4/os/i386/CentOS/RPMS/
+http://centos.cs.ucr.edu/centos/centos/4.1/os/i386/CentOS/RPMS/
+http://ibiblio.org/pub/linux/distributions/caoslinux/centos/4/os/i386/CentOS/RPMS/
+http://centos.absinet.net/centos/4.1/os/i386/CentOS/RPMS/
+EOF
+ )
+ ;;
+ x86_64)
+ big_mirror_list=$(cat <<EOF
+http://mirror.centos.org/centos/4/os/x86_64/CentOS/RPMS/
+http://centos.cs.ucr.edu/centos/centos/4.1/os/x86_64/CentOS/RPMS/
+http://ibiblio.org/pub/linux/distributions/caoslinux/centos/4/os/x86_64/CentOS/RPMS/
+http://centos.absinet.net/centos/4.1/os/x86_64/CentOS/RPMS/
+EOF
+ )
+ ;;
+ *)
+ die "Arch $ARCH is unsupported"
+ ;;
+ esac
+
+ set_mirrors $big_mirror_list
+}
+
+work_out_rpms() {
+ case $ARCH in
+ i[3456]86)
+ RPMS=$(cat <<EOF
+0:setup-2.5.37-1.3.noarch.rpm
+1:filesystem-2.3.0-1.i386.rpm
+2:basesystem-8.0-4.noarch.rpm
+3:tzdata-2006a-1.EL4.noarch.rpm
+4:glibc-common-2.3.4-2.19.i386.rpm
+5:libgcc-3.4.5-2.i386.rpm
+6:glibc-2.3.4-2.19.i686.rpm
+7:mktemp-1.5-20.i386.rpm
+8:termcap-5.4-3.noarch.rpm
+9:libtermcap-2.0.8-39.i386.rpm
+10:bash-3.0-19.2.i386.rpm
+11:ncurses-5.4-13.i386.rpm
+12:zlib-1.2.1.2-1.2.i386.rpm
+13:info-4.7-5.i386.rpm
+14:libselinux-1.19.1-7.i386.rpm
+15:findutils-4.1.20-7.i386.rpm
+15:pcre-4.5-3.2.RHEL4.i386.rpm
+16:grep-2.5.1-31.i386.rpm
+16:words-3.0-3.noarch.rpm
+17:libattr-2.4.16-3.i386.rpm
+18:libacl-2.2.23-5.i386.rpm
+19:cracklib-dicts-2.7-29.i386.rpm
+19:cracklib-2.7-29.i386.rpm
+20:libstdc++-3.4.5-2.i386.rpm
+21:db4-4.2.52-7.1.i386.rpm
+22:glib-1.2.10-15.i386.rpm
+23:glib2-2.4.7-1.i386.rpm
+24:sed-4.1.2-4.i386.rpm
+25:gawk-3.1.3-10.1.i386.rpm
+26:centos-release-4-3.2.i386.rpm
+27:psmisc-21.4-4.i386.rpm
+28:iproute-2.6.9-3.i386.rpm
+29:iputils-20020927-18.EL4.2.i386.rpm
+30:chkconfig-1.3.13.3-2.i386.rpm
+31:e2fsprogs-1.35-12.3.EL4.i386.rpm
+32:ethtool-1.8-4.i386.rpm
+33:mingetty-1.07-3.i386.rpm
+34:net-tools-1.60-37.EL4.6.i386.rpm
+35:popt-1.9.1-13_nonptl.i386.rpm
+35:readline-4.3-13.i386.rpm
+36:audit-libs-1.0.12-1.EL4.i386.rpm
+36:audit-1.0.12-1.EL4.i386.rpm
+36:mkinitrd-4.2.1.6-1.i386.rpm
+36:kernel-2.6.9-34.EL.i686.rpm
+36:hotplug-2004_04_01-7.6.i386.rpm
+36:libsepol-1.1.1-2.i386.rpm
+36:device-mapper-1.02.02-3.0.RHEL4.i386.rpm
+36:hwdata-0.146.18.EL-1.noarch.rpm
+36:tar-1.14-9.RHEL4.i386.rpm
+36:cpio-2.5-8.RHEL4.i386.rpm
+36:gzip-1.3.3-15.rhel4.i386.rpm
+36:usbutils-0.11-6.1.i386.rpm
+36:lvm2-2.02.01-1.3.RHEL4.i386.rpm
+36:less-382-4.i386.rpm
+36:MAKEDEV-3.15.2-3.i386.rpm
+36:pam-0.77-66.14.i386.rpm
+36:initscripts-7.93.24.EL-1.1.centos4.i386.rpm
+36:coreutils-5.2.1-31.2.i386.rpm
+36:SysVinit-2.85-34.3.i386.rpm
+36:shadow-utils-4.0.3-60.RHEL4.i386.rpm
+36:udev-039-10.12.EL4.i386.rpm
+36:util-linux-2.12a-16.EL4.16.i386.rpm
+36:sysklogd-1.4.1-26_EL.i386.rpm
+36:which-2.16-4.i386.rpm
+36:module-init-tools-3.1-0.pre5.3.2.i386.rpm
+36:procps-3.2.3-8.3.i386.rpm
+37:beecrypt-3.1.0-6.i386.rpm
+38:bzip2-libs-1.0.2-13.EL4.3.i386.rpm
+39:bzip2-1.0.2-13.EL4.3.i386.rpm
+40:elfutils-libelf-0.97-5.i386.rpm
+40:binutils-2.15.92.0.2-18.i386.rpm
+41:elfutils-0.97-5.i386.rpm
+42:gdbm-1.8.0-24.i386.rpm
+43:gmp-4.1.4-3.i386.rpm
+44:krb5-libs-1.3.4-27.i386.rpm
+45:openssl-0.9.7a-43.8.i686.rpm
+46:libxml2-2.6.16-6.i386.rpm
+47:python-2.3.4-14.1.i386.rpm
+48:libxml2-python-2.6.16-6.i386.rpm
+48:file-4.10-2.EL4.3.i386.rpm
+48:perl-5.8.5-24.RHEL4.i386.rpm
+48:perl-Filter-1.30-6.i386.rpm
+48:patch-2.5.4-20.i386.rpm
+49:rpmdb-CentOS-4.3-0.20060314.i386.rpm
+49:rpm-build-4.3.3-13_nonptl.i386.rpm
+49:rpm-libs-4.3.3-13_nonptl.i386.rpm
+49:rpm-4.3.3-13_nonptl.i386.rpm
+50:rpm-python-4.3.3-13_nonptl.i386.rpm
+51:wget-1.10.2-0.40E.i386.rpm
+52:centos-yumconf-4-4.5.noarch.rpm
+52:python-elementtree-1.2.6-4.i386.rpm
+52:python-sqlite-1.1.6-1.i386.rpm
+52:python-urlgrabber-2.9.6-2.noarch.rpm
+52:expat-1.95.7-4.i386.rpm
+52:sqlite-3.2.2-1.i386.rpm
+52:yum-2.4.2-2.centos4.noarch.rpm
+53:nano-1.2.4-1.i386.rpm
+54:openldap-2.2.13-4.i386.rpm
+54:cyrus-sasl-2.1.19-5.EL4.i386.rpm
+54:cyrus-sasl-md5-2.1.19-5.EL4.i386.rpm
+55:libuser-0.52.5-1.el4.1.i386.rpm
+56:passwd-0.68-10.1.i386.rpm
+EOF
+ )
+ ;;
+ x86_64)
+ RPMS=$(cat <<EOF
+0:setup-2.5.37-1.3.noarch.rpm
+1:filesystem-2.3.0-1.x86_64.rpm
+2:basesystem-8.0-4.noarch.rpm
+3:tzdata-2006a-1.EL4.noarch.rpm
+4:glibc-common-2.3.4-2.19.x86_64.rpm
+5:libgcc-3.4.5-2.x86_64.rpm
+6:glibc-2.3.4-2.19.x86_64.rpm
+7:mktemp-1.5-20.x86_64.rpm
+8:termcap-5.4-3.noarch.rpm
+9:libtermcap-2.0.8-39.x86_64.rpm
+10:bash-3.0-19.2.x86_64.rpm
+11:ncurses-5.4-13.x86_64.rpm
+12:zlib-1.2.1.2-1.2.x86_64.rpm
+13:info-4.7-5.x86_64.rpm
+14:libselinux-1.19.1-7.x86_64.rpm
+15:findutils-4.1.20-7.x86_64.rpm
+15:pcre-4.5-3.2.RHEL4.x86_64.rpm
+16:grep-2.5.1-31.x86_64.rpm
+16:words-3.0-3.noarch.rpm
+17:libattr-2.4.16-3.x86_64.rpm
+18:libacl-2.2.23-5.x86_64.rpm
+19:cracklib-dicts-2.7-29.x86_64.rpm
+19:cracklib-2.7-29.x86_64.rpm
+20:libstdc++-3.4.5-2.x86_64.rpm
+21:db4-4.2.52-7.1.x86_64.rpm
+22:glib-1.2.10-15.x86_64.rpm
+23:glib2-2.4.7-1.x86_64.rpm
+24:sed-4.1.2-4.x86_64.rpm
+25:gawk-3.1.3-10.1.x86_64.rpm
+26:centos-release-4-3.2.x86_64.rpm
+27:psmisc-21.4-4.x86_64.rpm
+28:iproute-2.6.9-3.x86_64.rpm
+29:iputils-20020927-18.EL4.2.x86_64.rpm
+30:chkconfig-1.3.13.3-2.x86_64.rpm
+31:e2fsprogs-1.35-12.3.EL4.x86_64.rpm
+32:ethtool-1.8-4.x86_64.rpm
+33:mingetty-1.07-3.x86_64.rpm
+34:net-tools-1.60-37.EL4.6.x86_64.rpm
+35:popt-1.9.1-13_nonptl.x86_64.rpm
+35:readline-4.3-13.x86_64.rpm
+36:audit-libs-1.0.12-1.EL4.x86_64.rpm
+36:audit-1.0.12-1.EL4.x86_64.rpm
+36:mkinitrd-4.2.1.6-1.x86_64.rpm
+36:kernel-2.6.9-34.EL.x86_64.rpm
+36:hotplug-2004_04_01-7.6.x86_64.rpm
+36:libsepol-1.1.1-2.x86_64.rpm
+36:device-mapper-1.02.02-3.0.RHEL4.x86_64.rpm
+36:hwdata-0.146.18.EL-1.noarch.rpm
+36:tar-1.14-9.RHEL4.x86_64.rpm
+36:cpio-2.5-8.RHEL4.x86_64.rpm
+36:gzip-1.3.3-15.rhel4.x86_64.rpm
+36:usbutils-0.11-6.1.x86_64.rpm
+36:lvm2-2.02.01-1.3.RHEL4.x86_64.rpm
+36:less-382-4.x86_64.rpm
+36:MAKEDEV-3.15.2-3.x86_64.rpm
+36:pam-0.77-66.14.x86_64.rpm
+36:initscripts-7.93.24.EL-1.1.centos4.x86_64.rpm
+36:coreutils-5.2.1-31.2.x86_64.rpm
+36:SysVinit-2.85-34.3.x86_64.rpm
+36:shadow-utils-4.0.3-60.RHEL4.x86_64.rpm
+36:udev-039-10.12.EL4.x86_64.rpm
+36:util-linux-2.12a-16.EL4.16.x86_64.rpm
+36:sysklogd-1.4.1-26_EL.x86_64.rpm
+36:which-2.16-4.x86_64.rpm
+36:module-init-tools-3.1-0.pre5.3.2.x86_64.rpm
+36:procps-3.2.3-8.3.x86_64.rpm
+37:beecrypt-3.1.0-6.x86_64.rpm
+38:bzip2-libs-1.0.2-13.EL4.3.x86_64.rpm
+39:bzip2-1.0.2-13.EL4.3.x86_64.rpm
+40:elfutils-libelf-0.97-5.x86_64.rpm
+40:binutils-2.15.92.0.2-18.x86_64.rpm
+41:elfutils-0.97-5.x86_64.rpm
+42:gdbm-1.8.0-24.x86_64.rpm
+43:gmp-4.1.4-3.x86_64.rpm
+44:krb5-libs-1.3.4-27.x86_64.rpm
+45:openssl-0.9.7a-43.8.x86_64.rpm
+46:libxml2-2.6.16-6.x86_64.rpm
+47:python-2.3.4-14.1.x86_64.rpm
+48:libxml2-python-2.6.16-6.x86_64.rpm
+48:file-4.10-2.EL4.3.x86_64.rpm
+48:perl-5.8.5-24.RHEL4.x86_64.rpm
+48:perl-Filter-1.30-6.x86_64.rpm
+48:patch-2.5.4-20.x86_64.rpm
+49:rpmdb-CentOS-4.3-0.20060315.x86_64.rpm
+49:rpm-build-4.3.3-13_nonptl.x86_64.rpm
+49:rpm-libs-4.3.3-13_nonptl.x86_64.rpm
+49:rpm-4.3.3-13_nonptl.x86_64.rpm
+50:rpm-python-4.3.3-13_nonptl.x86_64.rpm
+51:wget-1.10.2-0.40E.x86_64.rpm
+52:centos-yumconf-4-4.5.noarch.rpm
+52:yum-2.4.2-2.centos4.noarch.rpm
+53:nano-1.2.4-1.x86_64.rpm
+54:openldap-2.2.13-4.x86_64.rpm
+54:cyrus-sasl-2.1.19-5.EL4.x86_64.rpm
+54:cyrus-sasl-md5-2.1.19-5.EL4.x86_64.rpm
+55:libuser-0.52.5-1.el4.1.x86_64.rpm
+56:passwd-0.68-10.1.x86_64.rpm
+EOF
+ )
+ ;;
+ *)
+ # No clue
+ ;;
+esac
+}
+
+print_rpms() {
+ local rpm_list=$(echo "$RPMS" | sed "s/[[:digit:]]\+://")
+
+ echo "RPMs for suite $RPMSUITE and arch $ARCH"
+ for a in $rpm_list
+ do
+ echo " : $a"
+ done
+}
+
+install_rpms() {
+ install_by_pass $RPMS
+}
+suite_details() {
+ for a in $RPMS
+ do
+ echo $a
+ done
+}
Changes to src/openafs/benchmarks/abperl-openssh.sh
@@ -1,1 +1,42 @@
+#!/bin/sh
+
+# Run the abperl.pl script using openssh source
+
+# Usage: abperl.pl <sourcepath> <testpath> <outputfile> <summaryfile> <count>
+# sourcepath - the directory with source code to compile in stage 5
+# testpath - the directory under which all of the operations should be
+# executed
+# outputfile - the file in which to put output in the Andrew Benchmark
+# style
+# summaryfile - the file in which to put much more concise output
+# count - the number of times to execute each phase in order to get
+# good statistics
+
+PATH=/usr/local/bin:/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin
+export PATH
+
+case $1 in
+ afs) FSPATH=/afs/opensysadmin.com/tdisk/abperl ;;
+ *) exit 1 ;;
+esac
+
+FSTYPE=$1
+
+./abperl.pl \
+ $FSPATH/openssh-4.3p2 \
+ $FSPATH/abperl-testpath \
+ $FSPATH/abperl-results/${FSTYPE}-outputfile \
+ $FSPATH/abperl-results/${FSTYPE}-summaryfile \
+ 3
+
+exit 0
+
+
+
+
+
+
+
+
+
Changes to src/openafs/benchmarks/abperl.pl
@@ -1,1 +1,210 @@
+#!/usr/bin/env perl
+
+# Andrew Benchmark in Perl.
+#
+# This perl script benchmarks a filesystem in the same way that the Andrew Benchmark does.
+# The script runs the same commands as the Andrew Benchmark, but it is in a Perl wrapper
+# instead of a makefile.
+#
+# Instead of the Sun only source code included in the original Andrew Benchmark, this script
+# uses the Ion window managare courtesy of Tuomo Valkonen, which is available at
+# http://iki.fi/tuomov/ion/
+#
+# Usage: abperl.pl <sourcepath> <testpath> <outputfile> <summaryfile> <count>
+# sourcepath - the directory with source code to compile in stage 5, Ion is recomended
+# testpath - the directory under which all of the operations should be executed
+# outputfile - the file in which to put output in the Andrew Benchmark styke
+# summaryfile - the file in which to put much more concise output
+# count - the number of times to execute each phase in order to get good statistics
+
+use strict;
+use Time::Local;
+
+# Definition of the five phases
+sub setphases {
+ my $sourcedir = shift;
+
+ my @phase = (
+ {
+ number => "I",
+ name => "Creating directories",
+ commands => [
+ map
+ {"mkdir testfs$_ testfs$_/" . join(" testfs$_/", grep {-d "$sourcedir/$_"} recursiveFileList("$sourcedir/", ""))}
+ (1, 2, 3, 4, 5)
+ ]
+ },
+ {
+ number => "II",
+ name => "Copying files",
+ commands => [
+ map
+ {"cp $sourcedir/$_ testfs1/$_"}
+ grep {not -d "$sourcedir/$_"} recursiveFileList("$sourcedir/", "")
+ ]
+ },
+ {
+ number => "III",
+ name => "Recursive directory stats",
+ commands => [
+ "find . -print -exec ls -l {} \\;",
+ "du -s *"
+ ]
+ },
+ {
+ number => "IV",
+ name => "Scanning each file",
+ commands => [
+ "find . -exec grep kangaroo {} \\;",
+ "find . -exec wc {} \\;"
+ ]
+ },
+ {
+ number => "V",
+ name => "Compilation",
+ commands => [
+ "cd testfs1; make"
+ ]
+ });
+
+ return @phase;
+}
+
+# Parse arguments
+
+if ($#ARGV != 4) {
+ print "Invalid arguments, see top of file for usage.\n";
+ exit 1;
+}
+
+my $sourcedir = $ARGV[0];
+my $testdir = $ARGV[1];
+my $logfile = $ARGV[2];
+my $statfile = $ARGV[3];
+my $count = $ARGV[4];
+
+# Initialize
+
+my $datecmd = 'date "+%a %b %e %H:%M:%S.%N %Z %Y"';
+my $stars = "*" x 9;
+my @phase = setphases($sourcedir);
+my @stats = ();
+
+open(LOGFILE, ">>$logfile") || die "Could not open output file $logfile ($!)";
+chdir $testdir;
+
+# Start the testing
+for (my $iteration = 1; $iteration <= $count; $iteration++) {
+ print "Iteration $iteration...\n";
+ print LOGFILE "hostname\n" . `hostname` . "pwd\n" . `pwd` . "w\n" . `w` . "ps axww\n" . `ps axww`;
+ $stats[$iteration]{'date'}[0] = `$datecmd`;
+ print LOGFILE "$stars Timing begins here $stars\n$datecmd\n" . $stats[$iteration]{'date'}[0];
+ for (my $phase = 0; $phase <= $#phase; $phase++) {
+ print LOGFILE "$stars Phase $phase[$phase]{number}: $phase[$phase]{name} $stars\n";
+ foreach my $command (@{$phase[$phase]{'commands'}}) {
+ print LOGFILE "$command\n";
+ print LOGFILE `$command`;
+ }
+ $stats[$iteration]{'date'}[$phase + 1] = `$datecmd`;
+ print LOGFILE "$datecmd\n" . $stats[$iteration]{'date'}[$phase + 1] . "\n";
+ }
+ print LOGFILE "$stars Timing ends here $stars\nw\n" . `w` . "ps axww\n" . `ps axww`;
+ `rm -rf testfs*`;
+ #`rm -rf /home/brian/versionfs/testing/testvfssrc/*`;
+}
+
+# Finish up
+close LOGFILE;
+
+# Calculate summary stats
+my @summary;
+for (my $i = 0; $i < $count; $i++) {
+ for (my $p = 0; $p <= $#phase; $p++) {
+ $summary[$p][$i] = datesubtract($stats[$i + 1]{'date'}[$p + 1], $stats[$i + 1]{'date'}[$p]);
+ }
+}
+my @mean;
+my @stddev;
+for (my $p = 0; $p <= $#phase; $p++) {
+ ($stddev[$p], $mean[$p]) = stats(@{$summary[$p]});
+}
+
+# Print summary
+open(SUMMARY, ">>$statfile") || die "Could not open summary file $statfile ($!)";
+
+print SUMMARY "Iter";
+print SUMMARY "\tPhase $_{number}" foreach @phase;
+for (my $iter = 1; $iter <= $count; $iter++) {
+ print SUMMARY "\n$iter";
+ for (my $p = 0; $p <= $#phase; $p++) {
+ print SUMMARY "\t" . $summary[$p][$iter - 1];
+ }
+}
+print SUMMARY "\nAvg";
+print SUMMARY "\t" . $_ foreach @mean;
+print SUMMARY "\nStddev";
+print SUMMARY "\t" . $_ foreach @stddev;
+print SUMMARY "\n";
+
+close SUMMARY;
+
+#Done
+print "Done\n";
+
+# Finds all files in a directory recursively returning filenames as if the root was a different directory
+sub recursiveFileList {
+ my $root = shift;
+ my $fakeroot = shift;
+ my @list = ();
+
+ opendir my $dir, $root;
+ @list = grep {$_ !~ /^\.\.?$/} readdir $dir;
+ closedir $dir;
+
+ my @dirlist = grep {-d ($root . $_)} @list;
+ @list = map {$fakeroot . $_} @list;
+ foreach my $subdir (@dirlist) {
+ @list = (@list, recursiveFileList($root . $subdir . "/", $fakeroot . $subdir . "/"));
+ }
+
+ return @list;
+}
+
+# Subtract two date strings from `date "+%a %b %e %H:%M:%S.%N %Z %Y"`
+sub datesubtract {
+ my $date1 = shift;
+ my $date2 = shift;
+
+ my %monthnum = (jan => 0, feb => 1, mar => 2, apr => 3, may => 4, jun => 5, jul => 6, aug => 7, sep => 8, 'oct' => 9, nov => 10, dec => 11);
+ my $ms1, my $ms2;
+
+ if ($date1 =~ /\S+\s+(\S+)\s+(\d+)\s+(\d+)\:(\d+)\:(\d+)\.(\d+)\s+\S+\s+(\d\d\d\d)/) {
+ $ms1 = timelocal($5, $4, $3, $2, $monthnum{lc($1)}, $7 - 1900) * 1000 + $6 / 1000000;
+ } else {
+ print "Date invalid $date1\n";
+ }
+ if ($date2 =~ /\S+\s+(\S+)\s+(\d+)\s+(\d+)\:(\d+)\:(\d+)\.(\d+)\s+\S+\s+(\d\d\d\d)/) {
+ $ms2 = timelocal($5, $4, $3, $2, $monthnum{lc($1)}, $7 - 1900) * 1000 + $6 / 1000000;
+ } else {
+ print "Date invalid $date2\n";
+ }
+
+ return $ms1 - $ms2;
+}
+
+# Return standard deviation and mean of a list
+sub stats {
+ my $mean = mean(@_);
+
+ my $variance = 0;
+ $variance += ($_ - $mean) ** 2 foreach @_;
+ $variance /= ($#_ + 1);
+
+ return (sqrt($variance), $mean);
+}
+sub mean {
+ my $mean = 0;
+ $mean += $_ foreach @_;
+ return $mean / ($#_ + 1);
+}
Changes to src/weechat/doc/weechat.en.html
@@ -1,1 +1,9084 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>WeeChat 0.2.1 - User guide</title>
+<link rel="stylesheet" href="weechat-doc.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.71.0">
+<meta name="description" content="This manual documents WeeChat IRC client, it is part of WeeChat. Latest version of this document can be found on this page: http://weechat.flashtux.org/doc.php">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="book" lang="en">
+<div class="titlepage">
+<div>
+<div><h1 class="title">
+<a name="id2425438"></a>WeeChat 0.2.1 - User guide</h1></div>
+<div><h2 class="subtitle">Fast, light and extensible IRC client</h2></div>
+<div><div class="author">
+<h3 class="author">
+<span class="firstname">Sébastien</span> <span class="surname">Helleu</span>
+</h3>
+<code class="email"><<a href="mailto:flashcode%20AT%20flashtux.org">flashcode AT flashtux.org</a>></code>
+</div></div>
+<div><p class="copyright">Copyright © 2006 Sébastien Helleu</p></div>
+<div><div class="legalnotice">
+<a name="id2517541"></a><p>
+ This manual is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+ </p>
+<p>
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+ </p>
+<p>
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA
+ </p>
+</div></div>
+<div><p class="pubdate">2006-10-01 10:24:06</p></div>
+<div><div class="abstract">
+<p class="title"><b>Abstract</b></p>
+<p>
+ This manual documents WeeChat IRC client, it is part of WeeChat.
+ </p>
+<p>
+ Latest version of this document can be found on this page:
+ <a href="http://weechat.flashtux.org/doc.php" target="_top">
+ http://weechat.flashtux.org/doc.php
+ </a>
+ </p>
+</div></div>
+</div>
+<hr>
+</div>
+<div class="toc">
+<p><b>Table of Contents</b></p>
+<dl>
+<dt><span class="chapter"><a href="#chapIntroduction">1. Introduction</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#secDescription">Description</a></span></dt>
+<dt><span class="section"><a href="#secPreRequis">Pre-requisites</a></span></dt>
+</dl></dd>
+<dt><span class="chapter"><a href="#chapInstallation">2. Installation</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#secBinaryPackages">Binary packages</a></span></dt>
+<dt><span class="section"><a href="#secSourcePackage">Source package</a></span></dt>
+<dt><span class="section"><a href="#secCVSSources">CVS sources</a></span></dt>
+</dl></dd>
+<dt><span class="chapter"><a href="#chapUsage">3. Usage</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#secRunningWeeChat">Running WeeChat</a></span></dt>
+<dt><span class="section"><a href="#secKeyboardShortcuts">Key bindings</a></span></dt>
+<dt><span class="section"><a href="#secCommandLine">Command line</a></span></dt>
+<dt><span class="section"><a href="#secWeeChatIRCCommands">WeeChat / IRC commands</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#secWeeChatCommands">WeeChat commands</a></span></dt>
+<dt><span class="section"><a href="#secKeyFunctions">Key functions</a></span></dt>
+<dt><span class="section"><a href="#secIRCCommands">IRC commands</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#secConfigurationFile">Configuration file</a></span></dt>
+<dt><span class="section"><a href="#secFIFOpipe">FIFO pipe</a></span></dt>
+</dl></dd>
+<dt><span class="chapter"><a href="#chapPlugins">4. Plugins</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#secPluginsInWeeChat">Plugins in WeeChat</a></span></dt>
+<dt><span class="section"><a href="#secWriteAPlugin">Write a plugin</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#secAPIFunctions">API functions</a></span></dt>
+<dt><span class="section"><a href="#secCompilePlugin">Compile plugin</a></span></dt>
+<dt><span class="section"><a href="#secLoadPlugin">Load plugin into WeeChat</a></span></dt>
+<dt><span class="section"><a href="#secPluginExample">Plugin example</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#secScriptsPlugins">Scripts plugins</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#secLoadUnloadScripts">Load / unload scripts</a></span></dt>
+<dt><span class="section"><a href="#secSyntaxByLanguage">Syntax by language</a></span></dt>
+<dt><span class="section"><a href="#secWeeChatScriptsAPI">WeeChat / scripts API</a></span></dt>
+</dl></dd>
+</dl></dd>
+<dt><span class="chapter"><a href="#chapAuthorsSupport">5. Authors / Support</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#secAuthors">Authors</a></span></dt>
+<dt><span class="section"><a href="#secContributors">Contributors</a></span></dt>
+<dt><span class="section"><a href="#secSupport">Get support</a></span></dt>
+</dl></dd>
+</dl>
+</div>
+<div class="chapter" lang="en">
+<div class="titlepage"><div><div><h2 class="title">
+<a name="chapIntroduction"></a>Chapter 1. Introduction</h2></div></div></div>
+<div class="toc">
+<p><b>Table of Contents</b></p>
+<dl>
+<dt><span class="section"><a href="#secDescription">Description</a></span></dt>
+<dt><span class="section"><a href="#secPreRequis">Pre-requisites</a></span></dt>
+</dl>
+</div>
+<p>
+ This chapter describes WeeChat and pre-requisites for its installation.
+ </p>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="secDescription"></a>Description</h2></div></div></div>
+<p>
+ WeeChat (Wee Enhanced Environment for Chat) is a free
+ <acronym class="acronym">IRC</acronym> client, fast and light, designed for many
+ operating systems.
+ </p>
+<p>
+ Main features are:
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li><p>
+ multi-servers connection (with SSL, IPv6, proxy)
+ </p></li>
+<li><p>
+ many GUI: Curses, wxWidgets, Gtk and Qt
+ </p></li>
+<li><p>
+ small, fast and light
+ </p></li>
+<li><p>
+ customizable and extensible with plugins and scripts
+ </p></li>
+<li><p>
+ compliant with <acronym class="acronym">RFC</acronym>s
+ <a href="http://www.ietf.org/rfc/rfc1459.txt" target="_top">1459</a>,
+ <a href="http://www.ietf.org/rfc/rfc2810.txt" target="_top">2810</a>,
+ <a href="http://www.ietf.org/rfc/rfc2811.txt" target="_top">2811</a>,
+ <a href="http://www.ietf.org/rfc/rfc2812.txt" target="_top">2812</a> and
+ <a href="http://www.ietf.org/rfc/rfc2813.txt" target="_top">2813</a>
+ </p></li>
+<li><p>
+ multi-platform (GNU/Linux, *BSD, MacOS X, Windows and other)
+ </p></li>
+<li><p>
+ 100% GPL, free software
+ </p></li>
+</ul></div>
+<p>
+ </p>
+<p>
+ WeeChat homepage is here:
+ <a href="http://weechat.flashtux.org" target="_top">
+ http://weechat.flashtux.org
+ </a>
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="secPreRequis"></a>Pre-requisites</h2></div></div></div>
+<p>
+ In order to install WeeChat, you <span class="emphasis"><em>need</em></span>:
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li><p>
+ a running GNU/Linux system (with compiler tools for source
+ package)
+ </p></li>
+<li><p>
+ "root" privileges (to install WeeChat)
+ </p></li>
+<li>
+<p>
+ according to GUI, one of the following libraries:
+ </p>
+<div class="itemizedlist"><ul type="circle">
+<li><p>
+ Curses: ncurses library
+ </p></li>
+<li><p>
+ Gtk: <span class="emphasis"><em>*** GUI not developed ***</em></span>
+ </p></li>
+<li><p>
+ WxWidgets: <span class="emphasis"><em>*** GUI not developed ***</em></span>
+ </p></li>
+<li><p>
+ Qt: <span class="emphasis"><em>*** GUI not developed ***</em></span>
+ </p></li>
+</ul></div>
+<p>
+ </p>
+</li>
+</ul></div>
+<p>
+ </p>
+</div>
+</div>
+<div class="chapter" lang="en">
+<div class="titlepage"><div><div><h2 class="title">
+<a name="chapInstallation"></a>Chapter 2. Installation</h2></div></div></div>
+<div class="toc">
+<p><b>Table of Contents</b></p>
+<dl>
+<dt><span class="section"><a href="#secBinaryPackages">Binary packages</a></span></dt>
+<dt><span class="section"><a href="#secSourcePackage">Source package</a></span></dt>
+<dt><span class="section"><a href="#secCVSSources">CVS sources</a></span></dt>
+</dl>
+</div>
+<p>
+ This chapter explains how to install WeeChat.
+ </p>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="secBinaryPackages"></a>Binary packages</h2></div></div></div>
+<p>
+ Binary packages are available for these distributions:
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li><p>
+ Debian (or any Debian compatible distribution):
+ <strong class="userinput"><code>apt-get install weechat</code></strong>
+ </p></li>
+<li><p>
+ Mandriva/RedHat (or any RPM compatible distribution):
+ <strong class="userinput"><code>
+ rpm -i /chemin/weechat-x.y.z-1.i386.rpm
+ </code></strong>
+ </p></li>
+<li><p>
+ Gentoo :
+ <strong class="userinput"><code>emerge weechat</code></strong>
+ </p></li>
+</ul></div>
+<p>
+
+ For other distributions, please look at your manual for
+ installation instructions.
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="secSourcePackage"></a>Source package</h2></div></div></div>
+<p>
+ All you have to do is to run in a console or a terminal:
+</p>
+<pre class="screen"><code class="prompt">$ </code><strong class="userinput"><code>./configure</code></strong>
+<code class="prompt">$ </code><strong class="userinput"><code>make</code></strong></pre>
+<p>
+ </p>
+<p>
+ Then get root privileges and install WeeChat:
+</p>
+<pre class="screen"><code class="prompt">$ </code><strong class="userinput"><code>su</code></strong>
+(enter root password)
+<code class="prompt"># </code><strong class="userinput"><code>make install</code></strong></pre>
+<p>
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="secCVSSources"></a>CVS sources</h2></div></div></div>
+<p>
+ Warning: CVS sources are for advanced users: it may not compile
+ or not be stable. You're warned!
+ </p>
+<p>
+ To get CVS sources, issue this command:
+</p>
+<pre class="screen"><code class="prompt">$ </code><strong class="userinput"><code>cvs -z3 -d:pserver:anonymous@cvs.savannah.nongnu.org:/sources/weechat co weechat</code></strong></pre>
+<p>
+ </p>
+<p>
+ Execute this script:
+ <strong class="userinput"><code>./autogen.sh</code></strong>
+ </p>
+<p>
+ Then follow instructions for source package
+ (see <a href="#secSourcePackage" title="Source package">the section called “Source package”</a>)
+ </p>
+</div>
+</div>
+<div class="chapter" lang="en">
+<div class="titlepage"><div><div><h2 class="title">
+<a name="chapUsage"></a>Chapter 3. Usage</h2></div></div></div>
+<div class="toc">
+<p><b>Table of Contents</b></p>
+<dl>
+<dt><span class="section"><a href="#secRunningWeeChat">Running WeeChat</a></span></dt>
+<dt><span class="section"><a href="#secKeyboardShortcuts">Key bindings</a></span></dt>
+<dt><span class="section"><a href="#secCommandLine">Command line</a></span></dt>
+<dt><span class="section"><a href="#secWeeChatIRCCommands">WeeChat / IRC commands</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#secWeeChatCommands">WeeChat commands</a></span></dt>
+<dt><span class="section"><a href="#secKeyFunctions">Key functions</a></span></dt>
+<dt><span class="section"><a href="#secIRCCommands">IRC commands</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#secConfigurationFile">Configuration file</a></span></dt>
+<dt><span class="section"><a href="#secFIFOpipe">FIFO pipe</a></span></dt>
+</dl>
+</div>
+<p>
+ This chapter explains how to run WeeChat, the default key bindings
+ used, internal and IRC commands, setup file, and FIFO pipe use.
+ </p>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="secRunningWeeChat"></a>Running WeeChat</h2></div></div></div>
+<p>
+ Command line arguments:
+ </p>
+<div class="informaltable"><table border="0">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th>Parameter</th>
+<th>Description</th>
+</tr></thead>
+<tbody>
+<tr>
+<td><code class="literal">-a, --no-connect</code></td>
+<td>
+ Disable auto-connect to servers at startup
+ </td>
+</tr>
+<tr class="oddrow">
+<td><code class="literal">-c, --config</code></td>
+<td>
+ Display config help (list of options)
+ </td>
+</tr>
+<tr>
+<td><code class="literal">-d, --dir <path></code></td>
+<td>
+ Set path as home for WeeChat (used for configuration files,
+ logs, user plugins and scripts). Default value is
+ "<code class="literal">~/.weechat</code>". Please note that directory
+ is created if not found by WeeChat.
+ </td>
+</tr>
+<tr class="oddrow">
+<td><code class="literal">-f, --key-functions</code></td>
+<td>
+ Display WeeChat internal functions for keys
+ </td>
+</tr>
+<tr>
+<td><code class="literal">-h, --help</code></td>
+<td>
+ Display help
+ </td>
+</tr>
+<tr class="oddrow">
+<td><code class="literal">-i, --irc-commands</code></td>
+<td>
+ Display IRC commands list
+ </td>
+</tr>
+<tr>
+<td><code class="literal">-k, --keys</code></td>
+<td>
+ Display WeeChat default keys
+ </td>
+</tr>
+<tr class="oddrow">
+<td><code class="literal">-l, --license</code></td>
+<td>
+ Display WeeChat license
+ </td>
+</tr>
+<tr>
+<td><code class="literal">-p, --no-plugin</code></td>
+<td>
+ Disable plugins auto-load
+ </td>
+</tr>
+<tr class="oddrow">
+<td><code class="literal">-v, --version</code></td>
+<td>
+ Display WeeChat version
+ </td>
+</tr>
+<tr>
+<td><code class="literal">-w, --weechat-commands</code></td>
+<td>
+ Display WeeChat commands list
+ </td>
+</tr>
+</tbody>
+</table></div>
+<p>
+ </p>
+<p>
+ It is also possible to give URL for one or many IRC servers, as
+ follow:
+ </p>
+<pre class="screen">irc[6][s]://[pseudo[:mot_passe]@]irc.example.org[:port][/channel][,channel[...]</pre>
+<p>
+ Example to join #weechat and #toto on
+ "<code class="literal">irc.freenode.net</code>" server, default port (6667),
+ with "nono" nick:
+ </p>
+<pre class="screen"><code class="prompt">$ </code><strong class="userinput"><code>weechat-curses irc://nono@irc.freenode.net/#weechat,#toto</code></strong></pre>
+<p>
+ </p>
+<p>
+ To start WeeChat, issue this command:
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li><p>
+ for Curses GUI: <strong class="userinput"><code>weechat-curses</code></strong>
+ </p></li>
+<li><p>
+ for Gtk GUI: <strong class="userinput"><code>weechat-gtk</code></strong>
+ </p></li>
+<li><p>
+ for wxWidgets GUI: <strong class="userinput"><code>weechat-wxwidgets</code></strong>
+ </p></li>
+<li><p>
+ for Qt GUI: <strong class="userinput"><code>weechat-qt</code></strong>
+ </p></li>
+</ul></div>
+<p>
+ </p>
+<p>
+ When you run WeeChat for the first time, a default configuration
+ file is created, with default options.
+ The default configuration file is:
+ "<code class="literal">~/.weechat/weechat.rc</code>"
+ </p>
+<p>
+ You can edit this file at your convenience to configure WeeChat
+ (ONLY if WeeChat is not running), or you can set parameters with
+ "<code class="literal">/set</code>" command in WeeChat
+ (see <a href="#secWeeChatCommands" title="WeeChat commands">the section called “WeeChat commands”</a>)
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="secKeyboardShortcuts"></a>Key bindings</h2></div></div></div>
+<p>
+ </p>
+<div class="informaltable"><table border="0">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th>Key</th>
+<th>Action</th>
+</tr></thead>
+<tbody>
+<tr>
+<td>Left arrow</td>
+<td>
+ Go to previous char in command line
+ </td>
+</tr>
+<tr class="oddrow">
+<td>Right arrow</td>
+<td>
+ Go to next char in command line
+ </td>
+</tr>
+<tr>
+<td>Ctrl + left arrow</td>
+<td>
+ Go to previous word in command line
+ </td>
+</tr>
+<tr class="oddrow">
+<td>Ctrl + right arrow</td>
+<td>
+ Go to next word in command line
+ </td>
+</tr>
+<tr>
+<td>Home / Ctrl + A</td>
+<td>
+ Go to the beginning of command line
+ </td>
+</tr>
+<tr class="oddrow">
+<td>End / Ctrl + E</td>
+<td>
+ Go to the end of command line
+ </td>
+</tr>
+<tr>
+<td>Ctrl + K</td>
+<td>
+ Delete from cursor until end of command line
+ </td>
+</tr>
+<tr class="oddrow">
+<td>Ctrl + L</td>
+<td>
+ Redraw whole window
+ </td>
+</tr>
+<tr>
+<td>Ctrl + U</td>
+<td>
+ Delete from cursor until beginning of command line
+ </td>
+</tr>
+<tr class="oddrow">
+<td>Ctrl + W</td>
+<td>
+ Delete previous word of command line
+ </td>
+</tr>
+<tr>
+<td>Backspace</td>
+<td>
+ Delete previous char in command line
+ </td>
+</tr>
+<tr class="oddrow">
+<td>Delete</td>
+<td>
+ Delete next char in command line
+ </td>
+</tr>
+<tr>
+<td>Tab</td>
+<td>
+ Complete command or nick
+ (Tab again: find next completion)
+ </td>
+</tr>
+<tr class="oddrow">
+<td>Any char</td>
+<td>
+ Insert char at cursor position in command line
+ </td>
+</tr>
+<tr>
+<td>Enter</td>
+<td>
+ Execute command or send message
+ </td>
+</tr>
+<tr class="oddrow">
+<td>Up arrow / Down arrow</td>
+<td>
+ Call again last commands/messages
+ </td>
+</tr>
+<tr>
+<td>Ctrl + up arrow / Ctrl + down arrow</td>
+<td>
+ Call again last commands/messages in global history
+ (common for all buffers)
+ </td>
+</tr>
+<tr class="oddrow">
+<td>PageUp / PageDown</td>
+<td>
+ Scroll up / down one page in buffer history
+ </td>
+</tr>
+<tr>
+<td>Alt + PageUp / Alt + PageDown</td>
+<td>
+ Scroll up / down a few lines in buffer history
+ </td>
+</tr>
+<tr class="oddrow">
+<td>Alt + Home / Alt + End</td>
+<td>
+ Scroll to top / bottom of buffer
+ </td>
+</tr>
+<tr>
+<td>F5 / Alt + left arrow</td>
+<td>
+ Switch to previous buffer
+ </td>
+</tr>
+<tr class="oddrow">
+<td>F6 / Alt + right arrow</td>
+<td>
+ Switch to next buffer
+ </td>
+</tr>
+<tr>
+<td>F7</td>
+<td>
+ Switch to previous window
+ </td>
+</tr>
+<tr class="oddrow">
+<td>F8</td>
+<td>
+ Switch to next window
+ </td>
+</tr>
+<tr>
+<td>F10</td>
+<td>
+ Remove last infobar message
+ </td>
+</tr>
+<tr class="oddrow">
+<td>F11 / F12</td>
+<td>
+ Scroll nicklist
+ </td>
+</tr>
+<tr>
+<td>Alt + F11 / Alt + F12</td>
+<td>
+ Go to the beginning / the end of nicklist
+ </td>
+</tr>
+<tr class="oddrow">
+<td>Alt + A</td>
+<td>
+ Switch to next buffer with activity
+ (with priority: highlight, message, other)
+ </td>
+</tr>
+<tr>
+<td>Alt + B</td>
+<td>
+ Go to previous word in command line
+ </td>
+</tr>
+<tr class="oddrow">
+<td>Alt + D</td>
+<td>
+ Delete next word in command line
+ </td>
+</tr>
+<tr>
+<td>Alt + F</td>
+<td>
+ Go to next word in command line
+ </td>
+</tr>
+<tr class="oddrow">
+<td>Alt + H</td>
+<td>
+ Clear hotlist
+ (activity notification on other buffers)
+ </td>
+</tr>
+<tr>
+<td>Alt + J then Alt + D</td>
+<td>
+ Display DCC buffer
+ </td>
+</tr>
+<tr class="oddrow">
+<td>Alt + J then Alt + L</td>
+<td>
+ Switch to last buffer
+ </td>
+</tr>
+<tr>
+<td>Alt + J then Alt + R</td>
+<td>
+ Switch to raw IRC data buffer
+ </td>
+</tr>
+<tr class="oddrow">
+<td>Alt + J then Alt + S</td>
+<td>
+ Switch to server buffer
+ </td>
+</tr>
+<tr>
+<td>Alt + J then Alt + X</td>
+<td>
+ Switch to first channel of next buffer
+ (or server buffer if no channel is opened)
+ </td>
+</tr>
+<tr class="oddrow">
+<td>Alt + digit (0-9)</td>
+<td>
+ Switch to buffer by number (0 = 10)
+ </td>
+</tr>
+<tr>
+<td>Alt + J then number (01-99)</td>
+<td>
+ Switch to buffer by number
+ </td>
+</tr>
+<tr class="oddrow">
+<td>Alt + K</td>
+<td>
+ Grab a key and insert its code in command line
+ </td>
+</tr>
+<tr>
+<td>Alt + N</td>
+<td>
+ Scroll to next highlight
+ </td>
+</tr>
+<tr class="oddrow">
+<td>Alt + P</td>
+<td>
+ Scroll to previous highlight
+ </td>
+</tr>
+<tr>
+<td>Alt + R</td>
+<td>
+ Delete entire command line
+ </td>
+</tr>
+<tr class="oddrow">
+<td>Alt + S</td>
+<td>
+ Switch servers on servers buffer
+ (if option "look_one_server_buffer" is enabled)
+ </td>
+</tr>
+<tr>
+<td>Alt + U</td>
+<td>
+ Scroll to first unread line in buffer
+ </td>
+</tr>
+<tr class="oddrow">
+<td>Alt + W then Alt + arrow</td>
+<td>
+ Switch to window with direction
+ </td>
+</tr>
+</tbody>
+</table></div>
+<p>
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="secCommandLine"></a>Command line</h2></div></div></div>
+<p>
+ WeeChat command line (at the bottom of window) lets you send text on
+ channels and execute WeeChat or IRC commands (see
+ <a href="#secWeeChatIRCCommands" title="WeeChat / IRC commands">the section called “WeeChat / IRC commands”</a>).
+ </p>
+<p>
+ Commands begin with "/" char, followed by name of command.
+ For example, to initiate a private chat with "<code class="literal">toto</code>":
+ </p>
+<pre class="screen"><strong class="userinput"><code>/query toto</code></strong></pre>
+<p>
+ </p>
+<p>
+ Text sent to a channel is any text that does not begin with "/" char.
+ For example, to send text "<code class="literal">hello</code>" on current
+ channel:
+ </p>
+<pre class="screen"><strong class="userinput"><code>hello</code></strong></pre>
+<p>
+ </p>
+<p>
+ However, it is possible to start with "/" char, by adding another.
+ For example, to send text "<code class="literal">/query toto</code>" on current
+ channel:
+ </p>
+<pre class="screen"><strong class="userinput"><code>//query toto</code></strong></pre>
+<p>
+ </p>
+<p>
+ If option for sending IRC colors ("<code class="literal">irc_colors_send</code>")
+ is enabled, you can use color codes and attributes, as follow:
+ </p>
+<div class="informaltable"><table border="0">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th>Code</th>
+<th>Description</th>
+</tr></thead>
+<tbody>
+<tr>
+<td>%B</td>
+<td>
+ bold text
+ </td>
+</tr>
+<tr class="oddrow">
+<td>%Cxx</td>
+<td>
+ text color "<code class="literal">xx</code>"
+ (see colors table below)
+ </td>
+</tr>
+<tr>
+<td>%Cxx,yy</td>
+<td>
+ text color "<code class="literal">xx</code>"
+ and background "<code class="literal">yy</code>"
+ (see colors table below)
+ </td>
+</tr>
+<tr class="oddrow">
+<td>%O</td>
+<td>
+ disable color and attributes
+ </td>
+</tr>
+<tr>
+<td>%R</td>
+<td>
+ reverse video (revert text color with background)
+ </td>
+</tr>
+<tr class="oddrow">
+<td>%U</td>
+<td>
+ underlined text
+ </td>
+</tr>
+<tr>
+<td>%%</td>
+<td>
+ display one "<code class="literal">%</code>"
+ </td>
+</tr>
+</tbody>
+</table></div>
+<p>
+ Note: the same code (without number for %C) may be used to stop the
+ attribute.
+ </p>
+<p>
+ Color codes for %C are:
+ </p>
+<div class="informaltable"><table border="0">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th>Code</th>
+<th>Color</th>
+</tr></thead>
+<tbody>
+<tr>
+<td>00</td>
+<td>white</td>
+</tr>
+<tr class="oddrow">
+<td>01</td>
+<td>black</td>
+</tr>
+<tr>
+<td>02</td>
+<td>dark blue</td>
+</tr>
+<tr class="oddrow">
+<td>03</td>
+<td>dark green</td>
+</tr>
+<tr>
+<td>04</td>
+<td>light red</td>
+</tr>
+<tr class="oddrow">
+<td>05</td>
+<td>dark red</td>
+</tr>
+<tr>
+<td>06</td>
+<td>magenta</td>
+</tr>
+<tr class="oddrow">
+<td>07</td>
+<td>orange</td>
+</tr>
+<tr>
+<td>08</td>
+<td>yellow</td>
+</tr>
+<tr class="oddrow">
+<td>09</td>
+<td>light green</td>
+</tr>
+<tr>
+<td>10</td>
+<td>cyan</td>
+</tr>
+<tr class="oddrow">
+<td>11</td>
+<td>light cyan</td>
+</tr>
+<tr>
+<td>12</td>
+<td>light blue</td>
+</tr>
+<tr class="oddrow">
+<td>13</td>
+<td>light magenta</td>
+</tr>
+<tr>
+<td>14</td>
+<td>gray</td>
+</tr>
+<tr class="oddrow">
+<td>15</td>
+<td>light gray (white)</td>
+</tr>
+</tbody>
+</table></div>
+<p>
+ </p>
+<p>
+ Example: display of "<code class="literal">hello everybody!</code>" with
+ "<code class="literal">hello</code>" in light blue bold, and
+ "<code class="literal">everybody</code>" in light red underlined:
+</p>
+<pre class="screen"><strong class="userinput"><code>%C12%Bhello%B%C04%U everybody%U%C!</code></strong></pre>
+<p>
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="secWeeChatIRCCommands"></a>WeeChat / IRC commands</h2></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="#secWeeChatCommands">WeeChat commands</a></span></dt>
+<dt><span class="section"><a href="#secKeyFunctions">Key functions</a></span></dt>
+<dt><span class="section"><a href="#secIRCCommands">IRC commands</a></span></dt>
+</dl></div>
+<p>
+ This chapter lists all WeeChat and IRC commands.
+ </p>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="secWeeChatCommands"></a>WeeChat commands</h3></div></div></div>
+<p>
+
+
+
+
+<span><strong class="command">alias [alias_name [command [arguments]]]</strong></span>
+</p>
+<pre class="programlisting">
+create an alias for a command
+
+alias_name: name of alias
+ command: command name (WeeChat or IRC command, many commands can be separated by semicolons)
+arguments: arguments for command
+
+</pre>
+<p>
+<span><strong class="command">is replaced by all arguments.</strong></span>
+</p>
+<pre class="programlisting">
+</pre>
+<p>
+<span><strong class="command">buffer [action [args] | number | [[server] [channel]]]</strong></span>
+</p>
+<pre class="programlisting">
+manage buffers
+
+ action: action to do:
+ move: move buffer in the list (may be relative, for example -1)
+ close: close buffer (optional arg is part message, for a channel)
+ list: list open buffers (no parameter implies this list)
+ notify: set notify level for buffer (0=never, 1=highlight, 2=1+msg, 3=2+join/part)
+ (when executed on server buffer, this sets default notify level for whole server)
+server,
+channel: jump to buffer by server and/or channel name
+ number: jump to buffer by number
+
+</pre>
+<p>
+<span><strong class="command">builtin command</strong></span>
+</p>
+<pre class="programlisting">
+launch WeeChat/IRC builtin command (do not look at plugins handlers or aliases)
+
+command: command to execute (a '/' is automatically added if not found at beginning of command)
+
+
+</pre>
+<p>
+<span><strong class="command">charset [(decode_iso | decode_utf | encode) charset]</strong></span>
+</p>
+<pre class="programlisting">
+change charset for server or channel
+
+decode_iso: charset used for decoding ISO
+decode_utf: charset used for decoding UTF
+ encode: charset used for encoding messages
+ charset: charset to use (for example: ISO-8859-15, UTF-8,..)
+
+</pre>
+<p>
+<span><strong class="command">clear [-all]</strong></span>
+</p>
+<pre class="programlisting">
+clear window(s)
+
+-all: clear all windows
+
+</pre>
+<p>
+<span><strong class="command">connect [servername]</strong></span>
+</p>
+<pre class="programlisting">
+connect to a server
+
+servername: server name to connect
+
+</pre>
+<p>
+<span><strong class="command">disconnect [servername]</strong></span>
+</p>
+<pre class="programlisting">
+disconnect from a server
+
+servername: server name to disconnect
+
+</pre>
+<p>
+<span><strong class="command">dcc action [nickname [file]]</strong></span>
+</p>
+<pre class="programlisting">
+starts DCC (file or chat) or close chat
+
+ action: 'send' (file) or 'chat' or 'close' (chat)
+nickname: nickname to send file or chat
+ file: filename (on local host)
+
+</pre>
+<p>
+<span><strong class="command">debug dump | windows</strong></span>
+</p>
+<pre class="programlisting">
+print debug messages
+
+ dump: save memory dump in WeeChat log file (same dump is written when WeeChat crashes)
+windows: display windows tree
+
+</pre>
+<p>
+<span><strong class="command">help [command]</strong></span>
+</p>
+<pre class="programlisting">
+display help about commands
+
+command: name of a WeeChat or IRC command
+
+</pre>
+<p>
+<span><strong class="command">history [clear | value]</strong></span>
+</p>
+<pre class="programlisting">
+show buffer command history
+
+clear: clear history
+value: number of history entries to show
+
+</pre>
+<p>
+<span><strong class="command">ignore [mask [[type | command] [channel [server]]]]</strong></span>
+</p>
+<pre class="programlisting">
+ignore IRC messages and/or hosts
+
+ mask: nick or host mask to ignore
+ type: type of message to ignore (action, ctcp, dcc, pv)
+command: IRC command
+channel: name of channel for ignore
+ server: name of server for ignore
+
+For each argument, '*' means all.
+Without argument, /ignore command lists all defined ignore.
+
+</pre>
+<p>
+<span><strong class="command">key [key [function/command]] [unbind key] [functions] [reset -yes]</strong></span>
+</p>
+<pre class="programlisting">
+bind/unbind keys
+
+ key: display or bind this key to an internal function or a command (beginning by "/")
+ unbind: unbind a key
+functions: list internal functions for key bindings
+ reset: restore bindings to the default values and delete ALL personal bindings (use carefully!)
+
+</pre>
+<p>
+<span><strong class="command">plugin [load filename] | [autoload] | [reload] | [unload]</strong></span>
+</p>
+<pre class="programlisting">
+list/load/unload plugins
+
+filename: WeeChat plugin (file) to load
+
+Without argument, /plugin command lists all loaded plugins.
+
+</pre>
+<p>
+<span><strong class="command">server [servername] | [servername hostname port [-auto | -noauto] [-ipv6] [-ssl] [-pwd password] [-nicks nick1 nick2 nick3] [-username username] [-realname realname] [-command command] [-autojoin channel[,channel]] ] | [del servername]</strong></span>
+</p>
+<pre class="programlisting">
+list, add or remove servers
+
+servername: server name, for internal and display use
+ hostname: name or IP address of server
+ port: port for server (integer)
+ ipv6: use IPv6 protocol
+ ssl: use SSL protocol
+ password: password for server
+ nick1: first nick for server
+ nick2: alternate nick for server
+ nick3: second alternate nick for server
+ username: user name
+ realname: real name of user
+
+</pre>
+<p>
+<span><strong class="command">save [file]</strong></span>
+</p>
+<pre class="programlisting">
+save config to disk
+
+file: filename for writing config
+
+</pre>
+<p>
+<span><strong class="command">set [option [ = value]]</strong></span>
+</p>
+<pre class="programlisting">
+set config options
+
+option: name of an option (if name is full and no value is given, then help is displayed on option)
+ value: value for option
+
+Option may be: servername.server_xxx where "servername" is an internal server name and "xxx" an option for this server.
+
+</pre>
+<p>
+<span><strong class="command">setp [option [ = value]]</strong></span>
+</p>
+<pre class="programlisting">
+set plugin config options
+
+option: name of a plugin option
+ value: value for option
+
+Option is format: plugin.option, example: perl.myscript.item1
+
+</pre>
+<p>
+<span><strong class="command">unalias alias_name</strong></span>
+</p>
+<pre class="programlisting">
+remove an alias
+
+alias_name: name of alias to remove
+
+</pre>
+<p>
+<span><strong class="command">unignore [number | [mask [[type | command] [channel [server]]]]]</strong></span>
+</p>
+<pre class="programlisting">
+unignore IRC messages and/or hosts
+
+ number: # of ignore to unignore (number is displayed by list of ignore)
+ mask: nick or host mask to unignore
+ type: type of message to unignore (action, ctcp, dcc, pv)
+command: IRC command
+channel: name of channel for unignore
+ server: name of server for unignore
+
+For each argument, '*' means all.
+Without argument, /unignore command lists all defined ignore.
+
+</pre>
+<p>
+<span><strong class="command">upgrade</strong></span>
+</p>
+<pre class="programlisting">
+upgrade WeeChat without disconnecting from servers
+
+This command run again WeeChat binary, so it should have been compiled or installed with a package manager before running this command.
+
+</pre>
+<p>
+<span><strong class="command">uptime [-o]</strong></span>
+</p>
+<pre class="programlisting">
+show WeeChat uptime
+
+-o: send uptime on current channel as an IRC message
+
+</pre>
+<p>
+<span><strong class="command">window [list | -1 | +1 | b# | up | down | left | right | splith [pct] | splitv [pct] | resize pct | merge [all]]</strong></span>
+</p>
+<pre class="programlisting">
+manage windows
+
+ list: list open windows (no parameter implies this list)
+ -1: jump to previous window
+ +1: jump to next window
+ b#: jump to next window displaying buffer number #
+ up: switch to window above current one
+ down: switch to window below current one
+ left: switch to window on the left
+ right: switch to window on the right
+splith: split current window horizontally
+splitv: split current window vertically
+resize: resize window size, new size is <pct> pourcentage of parent window
+ merge: merge window with another (all = keep only one window)
+
+For splith and splitv, pct is a pourcentage which represents size of new window, computed with current window as size reference. For example 25 means create a new window with size = current_size / 4
+
+</pre>
+<p>
+
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="secKeyFunctions"></a>Key functions</h3></div></div></div>
+<p>
+ </p>
+<div class="informaltable"><table border="0">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th>Function</th>
+<th>Description</th>
+</tr></thead>
+<tbody>
+<tr>
+<td><code class="literal">return</code></td>
+<td>terminate line</td>
+</tr>
+<tr class="oddrow">
+<td><code class="literal">tab</code></td>
+<td>complete word</td>
+</tr>
+<tr>
+<td><code class="literal">tab_previous</code></td>
+<td>find previous completion for word</td>
+</tr>
+<tr class="oddrow">
+<td><code class="literal">backspace</code></td>
+<td>delete previous char</td>
+</tr>
+<tr>
+<td><code class="literal">delete</code></td>
+<td>delete next char</td>
+</tr>
+<tr class="oddrow">
+<td><code class="literal">delete_end_line</code></td>
+<td>delete until end of line</td>
+</tr>
+<tr>
+<td><code class="literal">delete_beginning_line</code></td>
+<td>delete until beginning of line</td>
+</tr>
+<tr class="oddrow">
+<td><code class="literal">delete_line</code></td>
+<td>delete entire line</td>
+</tr>
+<tr>
+<td><code class="literal">delete_previous_word</code></td>
+<td>delete previous word</td>
+</tr>
+<tr class="oddrow">
+<td><code class="literal">delete_next_word</code></td>
+<td>delete next word</td>
+</tr>
+<tr>
+<td><code class="literal">clipboard_paste</code></td>
+<td>paste current clipboard content</td>
+</tr>
+<tr class="oddrow">
+<td><code class="literal">transpose_chars</code></td>
+<td>transpose chars</td>
+</tr>
+<tr>
+<td><code class="literal">home</code></td>
+<td>go to beginning of line</td>
+</tr>
+<tr class="oddrow">
+<td><code class="literal">end</code></td>
+<td>go to end of line</td>
+</tr>
+<tr>
+<td><code class="literal">left</code></td>
+<td>move one char left</td>
+</tr>
+<tr class="oddrow">
+<td><code class="literal">previous_word</code></td>
+<td>move to previous word</td>
+</tr>
+<tr>
+<td><code class="literal">right</code></td>
+<td>move one char right</td>
+</tr>
+<tr class="oddrow">
+<td><code class="literal">next_word</code></td>
+<td>move to next word</td>
+</tr>
+<tr>
+<td><code class="literal">up</code></td>
+<td>call previous command in history</td>
+</tr>
+<tr class="oddrow">
+<td><code class="literal">up_global</code></td>
+<td>call previous command in global history</td>
+</tr>
+<tr>
+<td><code class="literal">down</code></td>
+<td>call next command in history</td>
+</tr>
+<tr class="oddrow">
+<td><code class="literal">down_global</code></td>
+<td>call next command in global history</td>
+</tr>
+<tr>
+<td><code class="literal">page_up</code></td>
+<td>scroll one page up</td>
+</tr>
+<tr class="oddrow">
+<td><code class="literal">page_down</code></td>
+<td>scroll one page down</td>
+</tr>
+<tr>
+<td><code class="literal">scroll_up</code></td>
+<td>scroll a few lines up</td>
+</tr>
+<tr class="oddrow">
+<td><code class="literal">scroll_down</code></td>
+<td>scroll a few lines down</td>
+</tr>
+<tr>
+<td><code class="literal">scroll_top</code></td>
+<td>scroll to top of buffer</td>
+</tr>
+<tr class="oddrow">
+<td><code class="literal">scroll_bottom</code></td>
+<td>scroll to bottom of buffer</td>
+</tr>
+<tr>
+<td><code class="literal">nick_beginning</code></td>
+<td>display beginning of nicklist</td>
+</tr>
+<tr class="oddrow">
+<td><code class="literal">nick_end</code></td>
+<td>display end of nicklist</td>
+</tr>
+<tr>
+<td><code class="literal">nick_page_up</code></td>
+<td>scroll nicklist one page up</td>
+</tr>
+<tr class="oddrow">
+<td><code class="literal">nick_page_down</code></td>
+<td>scroll nicklist one page down</td>
+</tr>
+<tr>
+<td><code class="literal">jump_smart</code></td>
+<td>jump to buffer with activity</td>
+</tr>
+<tr class="oddrow">
+<td><code class="literal">jump_dcc</code></td>
+<td>jump to DCC buffer</td>
+</tr>
+<tr>
+<td><code class="literal">jump_raw_data</code></td>
+<td>jump to raw IRC data buffer</td>
+</tr>
+<tr class="oddrow">
+<td><code class="literal">jump_last_buffer</code></td>
+<td>jump to last buffer</td>
+</tr>
+<tr>
+<td><code class="literal">jump_server</code></td>
+<td>jump to server buffer</td>
+</tr>
+<tr class="oddrow">
+<td><code class="literal">jump_next_server</code></td>
+<td>jump to next server</td>
+</tr>
+<tr>
+<td><code class="literal">switch_server</code></td>
+<td>switch active server on servers buffer</td>
+</tr>
+<tr class="oddrow">
+<td><code class="literal">scroll_previous_highlight</code></td>
+<td>scroll to previous highlight in buffer</td>
+</tr>
+<tr>
+<td><code class="literal">scroll_next_highlight</code></td>
+<td>scroll to next highlight in buffer</td>
+</tr>
+<tr class="oddrow">
+<td><code class="literal">scroll_unread</code></td>
+<td>scroll to first unread line in buffer</td>
+</tr>
+<tr>
+<td><code class="literal">hotlist_clear</code></td>
+<td>clear hotlist</td>
+</tr>
+<tr class="oddrow">
+<td><code class="literal">infobar_clear</code></td>
+<td>clear infobar</td>
+</tr>
+<tr>
+<td><code class="literal">refresh</code></td>
+<td>refresh screen</td>
+</tr>
+<tr class="oddrow">
+<td><code class="literal">grab_key</code></td>
+<td>grab a key</td>
+</tr>
+</tbody>
+</table></div>
+<p>
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="secIRCCommands"></a>IRC commands</h3></div></div></div>
+<p>
+
+
+
+
+<span><strong class="command">admin [target]</strong></span>
+</p>
+<pre class="programlisting">
+find information about the administrator of the server
+
+target: server
+
+</pre>
+<p>
+<span><strong class="command">ame message</strong></span>
+</p>
+<pre class="programlisting">
+send a CTCP action to all channels of all connected servers
+
+message: message to send
+
+</pre>
+<p>
+<span><strong class="command">amsg text</strong></span>
+</p>
+<pre class="programlisting">
+send message to all channels of all connected servers
+
+text: text to send
+
+</pre>
+<p>
+<span><strong class="command">away [-all] [message]</strong></span>
+</p>
+<pre class="programlisting">
+toggle away status
+
+ -all: toggle away status on all connected servers
+message: message for away (if no message is given, away status is removed)
+
+</pre>
+<p>
+<span><strong class="command">ban [channel] [nickname [nickname ...]]</strong></span>
+</p>
+<pre class="programlisting">
+bans nicks or hosts
+
+ channel: channel for ban
+nickname: user or host to ban
+
+</pre>
+<p>
+<span><strong class="command">ctcp receiver type [arguments]</strong></span>
+</p>
+<pre class="programlisting">
+send a CTCP message (Client-To-Client Protocol)
+
+ receiver: nick or channel to send CTCP to
+ type: CTCP type (examples: "version", "ping", ..)
+arguments: arguments for CTCP
+
+</pre>
+<p>
+<span><strong class="command">cycle [channel[,channel]] [part_message]</strong></span>
+</p>
+<pre class="programlisting">
+leave and rejoin a channel
+
+ channel: channel name for cycle
+part_message: part message (displayed to other users)
+
+</pre>
+<p>
+<span><strong class="command">dehalfop [nickname [nickname]]</strong></span>
+</p>
+<pre class="programlisting">
+removes half channel operator status from nickname(s)
+
+</pre>
+<p>
+<span><strong class="command">deop [nickname [nickname]]</strong></span>
+</p>
+<pre class="programlisting">
+removes channel operator status from nickname(s)
+
+</pre>
+<p>
+<span><strong class="command">devoice [nickname [nickname]]</strong></span>
+</p>
+<pre class="programlisting">
+removes voice from nickname(s)
+
+</pre>
+<p>
+<span><strong class="command">die</strong></span>
+</p>
+<pre class="programlisting">
+shutdown the server
+
+</pre>
+<p>
+<span><strong class="command">halfop [nickname [nickname]]</strong></span>
+</p>
+<pre class="programlisting">
+gives half channel operator status to nickname(s)
+
+</pre>
+<p>
+<span><strong class="command">info [target]</strong></span>
+</p>
+<pre class="programlisting">
+get information describing the server
+
+target: server name
+
+</pre>
+<p>
+<span><strong class="command">invite nickname channel</strong></span>
+</p>
+<pre class="programlisting">
+invite a nick on a channel
+
+nickname: nick to invite
+ channel: channel to invite
+
+</pre>
+<p>
+<span><strong class="command">ison nickname [nickname ...]</strong></span>
+</p>
+<pre class="programlisting">
+check if a nickname is currently on IRC
+
+nickname: nickname
+
+</pre>
+<p>
+<span><strong class="command">join channel[,channel] [key[,key]]</strong></span>
+</p>
+<pre class="programlisting">
+join a channel
+
+channel: channel name to join
+ key: key to join the channel
+
+</pre>
+<p>
+<span><strong class="command">kick [channel] nickname [comment]</strong></span>
+</p>
+<pre class="programlisting">
+forcibly remove a user from a channel
+
+ channel: channel where user is
+nickname: nickname to kick
+ comment: comment for kick
+
+</pre>
+<p>
+<span><strong class="command">kickban [channel] nickname [comment]</strong></span>
+</p>
+<pre class="programlisting">
+kicks and bans a nick from a channel
+
+ channel: channel where user is
+nickname: nickname to kick and ban
+ comment: comment for kick
+
+</pre>
+<p>
+<span><strong class="command">kill nickname comment</strong></span>
+</p>
+<pre class="programlisting">
+close client-server connection
+
+nickname: nickname
+ comment: comment for kill
+
+</pre>
+<p>
+<span><strong class="command">links [[server] server_mask]</strong></span>
+</p>
+<pre class="programlisting">
+list all servernames which are known by the server answering the query
+
+ server: this server should answer the query
+server_mask: list of servers must match this mask
+
+</pre>
+<p>
+<span><strong class="command">list [channel[,channel] [server]]</strong></span>
+</p>
+<pre class="programlisting">
+list channels and their topic
+
+channel: channel to list (a regexp is allowed)
+server: server name
+
+</pre>
+<p>
+<span><strong class="command">lusers [mask [target]]</strong></span>
+</p>
+<pre class="programlisting">
+get statistics about the size of the IRC network
+
+ mask: servers matching the mask only
+target: server for forwarding request
+
+</pre>
+<p>
+<span><strong class="command">me message</strong></span>
+</p>
+<pre class="programlisting">
+send a CTCP action to the current channel
+
+message: message to send
+
+</pre>
+<p>
+<span><strong class="command">mode { channel {[+|-]|o|p|s|i|t|n|b|v} [limit] [user] [ban mask] } | { nickname {[+|-]|i|w|s|o} }</strong></span>
+</p>
+<pre class="programlisting">
+change channel or user mode
+
+channel modes:
+ channel: channel name to modify
+ o: give/take channel operator privileges
+ p: private channel flag
+ s: secret channel flag
+ i: invite-only channel flag
+ t: topic settable by channel operator only flag
+ n: no messages to channel from clients on the outside
+ m: moderated channel
+ l: set the user limit to channel
+ b: set a ban mask to keep users out
+ e: set exception mask
+ v: give/take the ability to speak on a moderated channel
+ k: set a channel key (password)
+user modes:
+ nickname: nickname to modify
+ i: mark a user as invisible
+ s: mark a user for receive server notices
+ w: user receives wallops
+ o: operator flag
+
+</pre>
+<p>
+<span><strong class="command">motd [target]</strong></span>
+</p>
+<pre class="programlisting">
+get the "Message Of The Day"
+
+target: server name
+
+</pre>
+<p>
+<span><strong class="command">msg receiver[,receiver] text</strong></span>
+</p>
+<pre class="programlisting">
+send message to a nick or channel
+
+receiver: nick or channel (may be mask, '*' = current channel)
+text: text to send
+
+</pre>
+<p>
+<span><strong class="command">names [channel[,channel]]</strong></span>
+</p>
+<pre class="programlisting">
+list nicknames on channels
+
+channel: channel name
+
+</pre>
+<p>
+<span><strong class="command">nick [-all] nickname</strong></span>
+</p>
+<pre class="programlisting">
+change current nickname
+
+ -all: set new nickname for all connected servers
+nickname: new nickname
+
+</pre>
+<p>
+<span><strong class="command">notice nickname text</strong></span>
+</p>
+<pre class="programlisting">
+send notice message to user
+
+nickname: user to send notice to
+ text: text to send
+
+</pre>
+<p>
+<span><strong class="command">op nickname [nickname]</strong></span>
+</p>
+<pre class="programlisting">
+gives channel operator status to nickname(s)
+
+</pre>
+<p>
+<span><strong class="command">oper user password</strong></span>
+</p>
+<pre class="programlisting">
+get operator privileges
+
+user/password: used to get privileges on current IRC server
+
+</pre>
+<p>
+<span><strong class="command">part [channel[,channel]] [part_message]</strong></span>
+</p>
+<pre class="programlisting">
+leave a channel
+
+ channel: channel name to leave
+part_message: part message (displayed to other users)
+
+</pre>
+<p>
+<span><strong class="command">ping server1 [server2]</strong></span>
+</p>
+<pre class="programlisting">
+ping server
+
+server1: server to ping
+server2: forward ping to this server
+
+</pre>
+<p>
+<span><strong class="command">pong daemon [daemon2]</strong></span>
+</p>
+<pre class="programlisting">
+answer to a ping message
+
+ daemon: daemon who has responded to Ping message
+daemon2: forward message to this daemon
+
+</pre>
+<p>
+<span><strong class="command">query nickname [text]</strong></span>
+</p>
+<pre class="programlisting">
+send a private message to a nick
+
+nickname: nickname for private conversation
+ text: text to send
+
+</pre>
+<p>
+<span><strong class="command">quit [quit_message]</strong></span>
+</p>
+<pre class="programlisting">
+close all connections and quit
+
+quit_message: quit message (displayed to other users)
+
+</pre>
+<p>
+<span><strong class="command">quote data</strong></span>
+</p>
+<pre class="programlisting">
+send raw data to server without parsing
+
+data: raw data to send
+
+</pre>
+<p>
+<span><strong class="command">rehash</strong></span>
+</p>
+<pre class="programlisting">
+tell the server to reload its config file
+
+</pre>
+<p>
+<span><strong class="command">restart</strong></span>
+</p>
+<pre class="programlisting">
+tell the server to restart itself
+
+</pre>
+<p>
+<span><strong class="command">service nickname reserved distribution type reserved info</strong></span>
+</p>
+<pre class="programlisting">
+register a new service
+
+distribution: visibility of service
+ type: reserved for future usage
+
+</pre>
+<p>
+<span><strong class="command">servlist [mask [type]]</strong></span>
+</p>
+<pre class="programlisting">
+list services currently connected to the network
+
+mask: list only services matching this mask
+type: list only services of this type
+
+</pre>
+<p>
+<span><strong class="command">squery service text</strong></span>
+</p>
+<pre class="programlisting">
+deliver a message to a service
+
+service: name of service
+text: text to send
+
+</pre>
+<p>
+<span><strong class="command">squit server comment</strong></span>
+</p>
+<pre class="programlisting">
+disconnect server links
+
+server: server name
+comment: comment for quit
+
+</pre>
+<p>
+<span><strong class="command">stats [query [server]]</strong></span>
+</p>
+<pre class="programlisting">
+query statistics about server
+
+ query: c/h/i/k/l/m/o/y/u (see RFC1459)
+server: server name
+
+</pre>
+<p>
+<span><strong class="command">summon user [target [channel]]</strong></span>
+</p>
+<pre class="programlisting">
+give users who are on a host running an IRC server a message asking them to please join IRC
+
+ user: username
+target: server name
+channel: channel name
+
+</pre>
+<p>
+<span><strong class="command">time [target]</strong></span>
+</p>
+<pre class="programlisting">
+query local time from server
+
+target: query time from specified server
+
+</pre>
+<p>
+<span><strong class="command">topic [channel] [topic]</strong></span>
+</p>
+<pre class="programlisting">
+get/set channel topic
+
+channel: channel name
+topic: new topic for channel (if topic is "-delete" then topic is deleted)
+
+</pre>
+<p>
+<span><strong class="command">trace [target]</strong></span>
+</p>
+<pre class="programlisting">
+find the route to specific server
+
+target: server
+
+</pre>
+<p>
+<span><strong class="command">unban [channel] nickname [nickname ...]</strong></span>
+</p>
+<pre class="programlisting">
+unbans nicks or hosts
+
+ channel: channel for unban
+nickname: user or host to unban
+
+</pre>
+<p>
+<span><strong class="command">userhost nickname [nickname ...]</strong></span>
+</p>
+<pre class="programlisting">
+return a list of information about nicknames
+
+nickname: nickname
+
+</pre>
+<p>
+<span><strong class="command">users [target]</strong></span>
+</p>
+<pre class="programlisting">
+list of users logged into the server
+
+target: server
+
+</pre>
+<p>
+<span><strong class="command">version [server | nickname]</strong></span>
+</p>
+<pre class="programlisting">
+gives the version info of nick or server (current or specified)
+
+ server: server name
+nickname: nickname
+
+</pre>
+<p>
+<span><strong class="command">voice [nickname [nickname]]</strong></span>
+</p>
+<pre class="programlisting">
+gives voice to nickname(s)
+
+</pre>
+<p>
+<span><strong class="command">wallops text</strong></span>
+</p>
+<pre class="programlisting">
+send a message to all currently connected users who have set the 'w' user mode for themselves
+
+text to send
+
+</pre>
+<p>
+<span><strong class="command">who [mask ["o"]]</strong></span>
+</p>
+<pre class="programlisting">
+generate a query which returns a list of information
+
+mask: only information which match this mask
+ o: only operators are returned according to the mask supplied
+
+</pre>
+<p>
+<span><strong class="command">whois [server] nickname[,nickname]</strong></span>
+</p>
+<pre class="programlisting">
+query information about user(s)
+
+ server: server name
+nickname: nickname (may be a mask)
+
+</pre>
+<p>
+<span><strong class="command">whowas nickname [,nickname [,nickname ...]] [count [target]]</strong></span>
+</p>
+<pre class="programlisting">
+ask for information about a nickname which no longer exists
+
+nickname: nickname to search
+ count: number of replies to return (full search if negative number)
+ target: reply should match this mask
+
+</pre>
+<p>
+
+ </p>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="secConfigurationFile"></a>Configuration file</h2></div></div></div>
+<p>
+ List of options for config file:
+ </p>
+<div class="informaltable"><table border="0">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th>Option</th>
+<th>Type</th>
+<th>Values</th>
+<th>Default</th>
+<th>Description</th>
+</tr></thead>
+<tbody>
+<tr>
+<td><code class="option">look_save_on_exit</code></td>
+<td>boolean</td>
+<td>'on' or 'off'</td>
+<td>'on'</td>
+<td>Save config file on exit</td>
+</tr>
+<tr class="oddrow">
+<td><code class="option">look_set_title</code></td>
+<td>boolean</td>
+<td>'on' or 'off'</td>
+<td>'on'</td>
+<td>Set title for window (terminal for Curses GUI) with name and version</td>
+</tr>
+<tr>
+<td><code class="option">look_startup_logo</code></td>
+<td>boolean</td>
+<td>'on' or 'off'</td>
+<td>'on'</td>
+<td>Display WeeChat logo at startup</td>
+</tr>
+<tr class="oddrow">
+<td><code class="option">look_startup_version</code></td>
+<td>boolean</td>
+<td>'on' or 'off'</td>
+<td>'on'</td>
+<td>Display WeeChat version at startup</td>
+</tr>
+<tr>
+<td><code class="option">look_weechat_slogan</code></td>
+<td>string</td>
+<td>any string</td>
+<td>'the geekest IRC client!'</td>
+<td>WeeChat slogan (if empty, slogan is not used)</td>
+</tr>
+<tr class="oddrow">
+<td><code class="option">look_charset_decode_iso</code></td>
+<td>string</td>
+<td>any string</td>
+<td>'ISO-8859-1'</td>
+<td>ISO charset for decoding messages from server (used only if locale is UTF-8) (if empty, messages are not converted if locale is UTF-8)</td>
+</tr>
+<tr>
+<td><code class="option">look_charset_decode_utf</code></td>
+<td>string</td>
+<td>any string</td>
+<td>'UTF-8'</td>
+<td>UTF charset for decoding messages from server (used only if locale is not UTF-8) (if empty, messages are not converted if locale is not UTF-8)</td>
+</tr>
+<tr class="oddrow">
+<td><code class="option">look_charset_encode</code></td>
+<td>string</td>
+<td>any string</td>
+<td>''</td>
+<td>Charset for encoding messages sent to server, examples: UTF-8, ISO-8859-1 (if empty, messages are not converted)</td>
+</tr>
+<tr>
+<td><code class="option">look_charset_internal</code></td>
+<td>string</td>
+<td>any string</td>
+<td>''</td>
+<td>Forces internal WeeChat charset (should be empty in most cases, that means detected charset is used)</td>
+</tr>
+<tr class="oddrow">
+<td><code class="option">look_one_server_buffer</code></td>
+<td>boolean</td>
+<td>'on' or 'off'</td>
+<td>'off'</td>
+<td>Use same buffer for all servers</td>
+</tr>
+<tr>
+<td><code class="option">look_open_near_server</code></td>
+<td>boolean</td>
+<td>'on' or 'off'</td>
+<td>'off'</td>
+<td>Open new channels/privates near server</td>
+</tr>
+<tr class="oddrow">
+<td><code class="option">look_scroll_amount</code></td>
+<td>integer</td>
+<td>between 1 and 2147483647</td>
+<td>3</td>
+<td>How many lines to scroll by with scroll_up and scroll_down</td>
+</tr>
+<tr>
+<td><code class="option">look_buffer_timestamp</code></td>
+<td>string</td>
+<td>any string</td>
+<td>'[%H:%M:%S]'</td>
+<td>Timestamp for buffers</td>
+</tr>
+<tr class="oddrow">
+<td><code class="option">look_color_nicks_number</code></td>
+<td>integer</td>
+<td>between 1 and 10</td>
+<td>10</td>
+<td>Number of colors to use for nicks colors</td>
+</tr>
+<tr>
+<td><code class="option">look_color_actions</code></td>
+<td>boolean</td>
+<td>'on' or 'off'</td>
+<td>'on'</td>
+<td>Display actions with different colors</td>
+</tr>
+<tr class="oddrow">
+<td><code class="option">look_nicklist</code></td>
+<td>boolean</td>
+<td>'on' or 'off'</td>
+<td>'on'</td>
+<td>Display nicklist window (for channel windows)</td>
+</tr>
+<tr>
+<td><code class="option">look_nicklist_position</code></td>
+<td>string</td>
+<td>'left', 'right', 'top', 'bottom'</td>
+<td>'right'</td>
+<td>Nicklist position (top, left, right (default), bottom)</td>
+</tr>
+<tr class="oddrow">
+<td><code class="option">look_nicklist_min_size</code></td>
+<td>integer</td>
+<td>between 0 and 100</td>
+<td>0</td>
+<td>Min size for nicklist (width or height, depending on look_nicklist_position (0 = no min size))</td>
+</tr>
+<tr>
+<td><code class="option">look_nicklist_max_size</code></td>
+<td>integer</td>
+<td>between 0 and 100</td>
+<td>0</td>
+<td>Max size for nicklist (width or height, depending on look_nicklist_position (0 = no max size; if min == max and > 0, then size is fixed))</td>
+</tr>
+<tr class="oddrow">
+<td><code class="option">look_no_nickname</code></td>
+<td>string</td>
+<td>any string</td>
+<td>'-cmd-'</td>
+<td>Text to display instead of nick when not connected</td>
+</tr>
+<tr>
+<td><code class="option">look_nickmode</code></td>
+<td>boolean</td>
+<td>'on' or 'off'</td>
+<td>'on'</td>
+<td>Display nick mode ((half)op/voice) before each nick</td>
+</tr>
+<tr class="oddrow">
+<td><code class="option">look_nickmode_empty</code></td>
+<td>boolean</td>
+<td>'on' or 'off'</td>
+<td>'off'</td>
+<td>Display space if nick mode is not (half)op/voice</td>
+</tr>
+<tr>
+<td><code class="option">look_nick_prefix</code></td>
+<td>string</td>
+<td>any string</td>
+<td>''</td>
+<td>Text to display before nick in chat window</td>
+</tr>
+<tr class="oddrow">
+<td><code class="option">look_nick_suffix</code></td>
+<td>string</td>
+<td>any string</td>
+<td>' |'</td>
+<td>Text to display after nick in chat window</td>
+</tr>
+<tr>
+<td><code class="option">look_align_nick</code></td>
+<td>string</td>
+<td>'none', 'left', 'right'</td>
+<td>'right'</td>
+<td>Nick alignment (fixed size for nicks in chat window (none, left, right))</td>
+</tr>
+<tr class="oddrow">
+<td><code class="option">look_align_other</code></td>
+<td>boolean</td>
+<td>'on' or 'off'</td>
+<td>'on'</td>
+<td>Alignment for other messages (not beginning with a nick)</td>
+</tr>
+<tr>
+<td><code class="option">look_align_size</code></td>
+<td>integer</td>
+<td>between 8 and 64</td>
+<td>14</td>
+<td>Size for aligning nick and other messages</td>
+</tr>
+<tr class="oddrow">
+<td><code class="option">look_align_size_max</code></td>
+<td>integer</td>
+<td>between 8 and 64</td>
+<td>20</td>
+<td>Max size for aligning nick and other messages (should be >= to look_align_size)</td>
+</tr>
+<tr>
+<td><code class="option">look_nick_completor</code></td>
+<td>string</td>
+<td>any string</td>
+<td>':'</td>
+<td>The string inserted after nick completion</td>
+</tr>
+<tr class="oddrow">
+<td><code class="option">look_nick_completion_ignore</code></td>
+<td>string</td>
+<td>any string</td>
+<td>'[]-^'</td>
+<td>Chars ignored for nick completion</td>
+</tr>
+<tr>
+<td><code class="option">look_nick_complete_first</code></td>
+<td>boolean</td>
+<td>'on' or 'off'</td>
+<td>'off'</td>
+<td>Complete only with first nick found</td>
+</tr>
+<tr class="oddrow">
+<td><code class="option">look_infobar</code></td>
+<td>boolean</td>
+<td>'on' or 'off'</td>
+<td>'on'</td>
+<td>Enable info bar</td>
+</tr>
+<tr>
+<td><code class="option">look_infobar_timestamp</code></td>
+<td>string</td>
+<td>any string</td>
+<td>'%B, %A %d %Y'</td>
+<td>Timestamp for time in infobar</td>
+</tr>
+<tr class="oddrow">
+<td><code class="option">look_infobar_seconds</code></td>
+<td>boolean</td>
+<td>'on' or 'off'</td>
+<td>'on'</td>
+<td>Display seconds in infobar time</td>
+</tr>
+<tr>
+<td><code class="option">look_infobar_delay_highlight</code></td>
+<td>integer</td>
+<td>between 0 and 2147483647</td>
+<td>7</td>
+<td>Delay (in seconds) for highlight messages in infobar (0 = disable highlight notifications in infobar)</td>
+</tr>
+<tr class="oddrow">
+<td><code class="option">look_hotlist_names_count</code></td>
+<td>integer</td>
+<td>between 0 and 32</td>
+<td>3</td>
+<td>Max number of names in hotlist (0 = no name displayed, only buffer numbers)</td>
+</tr>
+<tr>
+<td><code class="option">look_hotlist_names_level</code></td>
+<td>integer</td>
+<td>between 1 and 15</td>
+<td>12</td>
+<td>Level for displaying names in hotlist (combination of: 1=join/part, 2=message, 4=private, 8=highlight, for example: 12=private+highlight)</td>
+</tr>
+<tr class="oddrow">
+<td><code class="option">look_hotlist_names_length</code></td>
+<td>integer</td>
+<td>between 0 and 32</td>
+<td>0</td>
+<td>Max length of names in hotlist (0 = no limit)</td>
+</tr>
+<tr>
+<td><code class="option">look_day_change</code></td>
+<td>boolean</td>
+<td>'on' or 'off'</td>
+<td>'on'</td>
+<td>Display special message when day changes</td>
+</tr>
+<tr class="oddrow">
+<td><code class="option">look_day_change_timestamp</code></td>
+<td>string</td>
+<td>any string</td>
+<td>'%a, %d %b %Y'</td>
+<td>Timestamp for date displayed when day changed</td>
+</tr>
+<tr>
+<td><code class="option">look_read_marker</code></td>
+<td>string</td>
+<td>any string</td>
+<td>' '</td>
+<td>Use a marker on servers/channels to show first unread line</td>
+</tr>
+<tr class="oddrow">
+<td><code class="option">look_input_format</code></td>
+<td>string</td>
+<td>any string</td>
+<td>'[%n(%m)] '</td>
+<td>Format for input prompt ('%c' is replaced by channel or server, '%n' by nick and '%m' by nick modes)</td>
+</tr>
+<tr>
+<td><code class="option">col_real_white</code></td>
+<td>boolean</td>
+<td>'on' or 'off'</td>
+<td>'off'</td>
+<td>If set, uses real white color, disabled by default for terms with white background (if you never use white background, you should turn on this option to see real white instead of default term foreground color)</td>
+</tr>
+<tr class="oddrow">
+<td><code class="option">col_separator</code></td>
+<td>color</td>
+<td>Curses or Gtk color</td>
+<td>'blue'</td>
+<td>Color for window separators (when splited)</td>
+</tr>
+<tr>
+<td><code class="option">col_title</code></td>
+<td>color</td>
+<td>Curses or Gtk color</td>
+<td>'default'</td>
+<td>Color for title bar</td>
+</tr>
+<tr class="oddrow">
+<td><code class="option">col_title_bg</code></td>
+<td>color</td>
+<td>Curses or Gtk color</td>
+<td>'blue'</td>
+<td>Background for title bar</td>
+</tr>
+<tr>
+<td><code class="option">col_chat</code></td>
+<td>color</td>
+<td>Curses or Gtk color</td>
+<td>'default'</td>
+<td>Color for chat text</td>
+</tr>
+<tr class="oddrow">
+<td><code class="option">col_chat_time</code></td>
+<td>color</td>
+<td>Curses or Gtk color</td>
+<td>'default'</td>
+<td>Color for time in chat window</td>
+</tr>
+<tr>
+<td><code class="option">col_chat_time_sep</code></td>
+<td>color</td>
+<td>Curses or Gtk color</td>
+<td>'brown'</td>
+<td>Color for time separator (chat window)</td>
+</tr>
+<tr class="oddrow">
+<td><code class="option">col_chat_prefix1</code></td>
+<td>color</td>
+<td>Curses or Gtk color</td>
+<td>'lightcyan'</td>
+<td>Color for 1st and 3rd char of prefix</td>
+</tr>
+<tr>
+<td><code class="option">col_chat_prefix2</code></td>
+<td>color</td>
+<td>Curses or Gtk color</td>
+<td>'white'</td>
+<td>Color for middle char of prefix</td>
+</tr>
+<tr class="oddrow">
+<td><code class="option">col_chat_server</code></td>
+<td>color</td>
+<td>Curses or Gtk color</td>
+<td>'brown'</td>
+<td>Color for server name</td>
+</tr>
+<tr>
+<td><code class="option">col_chat_join</code></td>
+<td>color</td>
+<td>Curses or Gtk color</td>
+<td>'lightgreen'</td>
+<td>Color for join arrow (prefix)</td>
+</tr>
+<tr class="oddrow">
+<td><code class="option">col_chat_part</code></td>
+<td>color</td>
+<td>Curses or Gtk color</td>
+<td>'lightred'</td>
+<td>Color for part/quit arrow (prefix)</td>
+</tr>
+<tr>
+<td><code class="option">col_chat_nick</code></td>
+<td>color</td>
+<td>Curses or Gtk color</td>
+<td>'lightcyan'</td>
+<td>Color for nicks in actions (chat window)</td>
+</tr>
+<tr class="oddrow">
+<td><code class="option">col_chat_host</code></td>
+<td>color</td>
+<td>Curses or Gtk color</td>
+<td>'cyan'</td>
+<td>Color for hostnames (chat window)</td>
+</tr>
+<tr>
+<td><code class="option">col_chat_channel</code></td>
+<td>color</td>
+<td>Curses or Gtk color</td>
+<td>'white'</td>
+<td>Color for channel names in actions (chat window)</td>
+</tr>
+<tr class="oddrow">
+<td><code class="option">col_chat_dark</code></td>
+<td>color</td>
+<td>Curses or Gtk color</td>
+<td>'green'</td>
+<td>Color for dark separators (chat window)</td>
+</tr>
+<tr>
+<td><code class="option">col_chat_highlight</code></td>
+<td>color</td>
+<td>Curses or Gtk color</td>
+<td>'yellow'</td>
+<td>Color for highlighted nick (chat window)</td>
+</tr>
+<tr class="oddrow">
+<td><code class="option">col_chat_bg</code></td>
+<td>color</td>
+<td>Curses or Gtk color</td>
+<td>'default'</td>
+<td>Background for chat window</td>
+</tr>
+<tr>
+<td><code class="option">col_chat_read_marker</code></td>
+<td>color</td>
+<td>Curses or Gtk color</td>
+<td>'yellow'</td>
+<td>Color for unread data marker</td>
+</tr>
+<tr class="oddrow">
+<td><code class="option">col_chat_read_marker_bg</code></td>
+<td>color</td>
+<td>Curses or Gtk color</td>
+<td>'magenta'</td>
+<td>Background for unread data marker</td>
+</tr>
+<tr>
+<td><code class="option">col_status</code></td>
+<td>color</td>
+<td>Curses or Gtk color</td>
+<td>'default'</td>
+<td>Color for status bar</td>
+</tr>
+<tr class="oddrow">
+<td><code class="option">col_status_delimiters</code></td>
+<td>color</td>
+<td>Curses or Gtk color</td>
+<td>'cyan'</td>
+<td>Color for status bar delimiters</td>
+</tr>
+<tr>
+<td><code class="option">col_status_channel</code></td>
+<td>color</td>
+<td>Curses or Gtk color</td>
+<td>'white'</td>
+<td>Color for current channel in status bar</td>
+</tr>
+<tr class="oddrow">
+<td><code class="option">col_status_data_msg</code></td>
+<td>color</td>
+<td>Curses or Gtk color</td>
+<td>'yellow'</td>
+<td>Color for window with new messages (status bar)</td>
+</tr>
+<tr>
+<td><code class="option">col_status_private</code></td>
+<td>color</td>
+<td>Curses or Gtk color</td>
+<td>'lightmagenta'</td>
+<td>Color for window with private message (status bar)</td>
+</tr>
+<tr class="oddrow">
+<td><code class="option">col_status_highlight</code></td>
+<td>color</td>
+<td>Curses or Gtk color</td>
+<td>'lightred'</td>
+<td>Color for window with highlight (status bar)</td>
+</tr>
+<tr>
+<td><code class="option">col_status_data_other</code></td>
+<td>color</td>
+<td>Curses or Gtk color</td>
+<td>'default'</td>
+<td>Color for window with new data (not messages) (status bar)</td>
+</tr>
+<tr class="oddrow">
+<td><code class="option">col_status_more</code></td>
+<td>color</td>
+<td>Curses or Gtk color</td>
+<td>'white'</td>
+<td>Color for window with new data (status bar)</td>
+</tr>
+<tr>
+<td><code class="option">col_status_bg</code></td>
+<td>color</td>
+<td>Curses or Gtk color</td>
+<td>'blue'</td>
+<td>Background for status window</td>
+</tr>
+<tr class="oddrow">
+<td><code class="option">col_infobar</code></td>
+<td>color</td>
+<td>Curses or Gtk color</td>
+<td>'black'</td>
+<td>Color for info bar text</td>
+</tr>
+<tr>
+<td><code class="option">col_infobar_delimiters</code></td>
+<td>color</td>
+<td>Curses or Gtk color</td>
+<td>'blue'</td>
+<td>Color for infobar delimiters</td>
+</tr>
+<tr class="oddrow">
+<td><code class="option">col_infobar_highlight</code></td>
+<td>color</td>
+<td>Curses or Gtk color</td>
+<td>'white'</td>
+<td>Color for info bar highlight notification</td>
+</tr>
+<tr>
+<td><code class="option">col_infobar_bg</code></td>
+<td>color</td>
+<td>Curses or Gtk color</td>
+<td>'cyan'</td>
+<td>Background for info bar window</td>
+</tr>
+<tr class="oddrow">
+<td><code class="option">col_input</code></td>
+<td>color</td>
+<td>Curses or Gtk color</td>
+<td>'default'</td>
+<td>Color for input text</td>
+</tr>
+<tr>
+<td><code class="option">col_input_server</code></td>
+<td>color</td>
+<td>Curses or Gtk color</td>
+<td>'brown'</td>
+<td>Color for input text (server name)</td>
+</tr>
+<tr class="oddrow">
+<td><code class="option">col_input_channel</code></td>
+<td>color</td>
+<td>Curses or Gtk color</td>
+<td>'white'</td>
+<td>Color for input text (channel name)</td>
+</tr>
+<tr>
+<td><code class="option">col_input_nick</code></td>
+<td>color</td>
+<td>Curses or Gtk color</td>
+<td>'lightcyan'</td>
+<td>Color for input text (nick name)</td>
+</tr>
+<tr class="oddrow">
+<td><code class="option">col_input_delimiters</code></td>
+<td>color</td>
+<td>Curses or Gtk color</td>
+<td>'cyan'</td>
+<td>Color for input text (delimiters)</td>
+</tr>
+<tr>
+<td><code class="option">col_input_bg</code></td>
+<td>color</td>
+<td>Curses or Gtk color</td>
+<td>'default'</td>
+<td>Background for input window</td>
+</tr>
+<tr class="oddrow">
+<td><code class="option">col_nick</code></td>
+<td>color</td>
+<td>Curses or Gtk color</td>
+<td>'default'</td>
+<td>Color for nicknames</td>
+</tr>
+<tr>
+<td><code class="option">col_nick_away</code></td>
+<td>color</td>
+<td>Curses or Gtk color</td>
+<td>'cyan'</td>
+<td>Color for away nicknames</td>
+</tr>
+<tr class="oddrow">
+<td><code class="option">col_nick_chanowner</code></td>
+<td>color</td>
+<td>Curses or Gtk color</td>
+<td>'lightgreen'</td>
+<td>Color for chan owner symbol (specific to unrealircd)</td>
+</tr>
+<tr>
+<td><code class="option">col_nick_chanadmin</code></td>
+<td>color</td>
+<td>Curses or Gtk color</td>
+<td>'lightgreen'</td>
+<td>Color for chan admin symbol (specific to unrealircd)</td>
+</tr>
+<tr class="oddrow">
+<td><code class="option">col_nick_op</code></td>
+<td>color</td>
+<td>Curses or Gtk color</td>
+<td>'lightgreen'</td>
+<td>Color for operator symbol</td>
+</tr>
+<tr>
+<td><code class="option">col_nick_halfop</code></td>
+<td>color</td>
+<td>Curses or Gtk color</td>
+<td>'lightmagenta'</td>
+<td>Color for half-operator symbol</td>
+</tr>
+<tr class="oddrow">
+<td><code class="option">col_nick_voice</code></td>
+<td>color</td>
+<td>Curses or Gtk color</td>
+<td>'yellow'</td>
+<td>Color for voice symbol</td>
+</tr>
+<tr>
+<td><code class="option">col_nick_more</code></td>
+<td>color</td>
+<td>Curses or Gtk color</td>
+<td>'lightmagenta'</td>
+<td>Color for '+' when scrolling nicks</td>
+</tr>
+<tr class="oddrow">
+<td><code class="option">col_nick_sep</code></td>
+<td>color</td>
+<td>Curses or Gtk color</td>
+<td>'blue'</td>
+<td>Color for nick separator</td>
+</tr>
+<tr>
+<td><code class="option">col_nick_self</code></td>
+<td>color</td>
+<td>Curses or Gtk color</td>
+<td>'white'</td>
+<td>Color for local nick</td>
+</tr>
+<tr class="oddrow">
+<td><code class="option">col_nick_color1</code></td>
+<td>color</td>
+<td>Curses or Gtk color</td>
+<td>'cyan'</td>
+<td>Color for nick</td>
+</tr>
+<tr>
+<td><code class="option">col_nick_color2</code></td>
+<td>color</td>
+<td>Curses or Gtk color</td>
+<td>'magenta'</td>
+<td>Color for nick</td>
+</tr>
+<tr class="oddrow">
+<td><code class="option">col_nick_color3</code></td>
+<td>color</td>
+<td>Curses or Gtk color</td>
+<td>'green'</td>
+<td>Color for nick</td>
+</tr>
+<tr>
+<td><code class="option">col_nick_color4</code></td>
+<td>color</td>
+<td>Curses or Gtk color</td>
+<td>'brown'</td>
+<td>Color for nick</td>
+</tr>
+<tr class="oddrow">
+<td><code class="option">col_nick_color5</code></td>
+<td>color</td>
+<td>Curses or Gtk color</td>
+<td>'lightblue'</td>
+<td>Color for nick</td>
+</tr>
+<tr>
+<td><code class="option">col_nick_color6</code></td>
+<td>color</td>
+<td>Curses or Gtk color</td>
+<td>'default'</td>
+<td>Color for nick</td>
+</tr>
+<tr class="oddrow">
+<td><code class="option">col_nick_color7</code></td>
+<td>color</td>
+<td>Curses or Gtk color</td>
+<td>'lightcyan'</td>
+<td>Color for nick</td>
+</tr>
+<tr>
+<td><code class="option">col_nick_color8</code></td>
+<td>color</td>
+<td>Curses or Gtk color</td>
+<td>'lightmagenta'</td>
+<td>Color for nick</td>
+</tr>
+<tr class="oddrow">
+<td><code class="option">col_nick_color9</code></td>
+<td>color</td>
+<td>Curses or Gtk color</td>
+<td>'lightgreen'</td>
+<td>Color for nick</td>
+</tr>
+<tr>
+<td><code class="option">col_nick_color10</code></td>
+<td>color</td>
+<td>Curses or Gtk color</td>
+<td>'blue'</td>
+<td>Color for nick</td>
+</tr>
+<tr class="oddrow">
+<td><code class="option">col_nick_private</code></td>
+<td>color</td>
+<td>Curses or Gtk color</td>
+<td>'default'</td>
+<td>Color for other nick in private window</td>
+</tr>
+<tr>
+<td><code class="option">col_nick_bg</code></td>
+<td>color</td>
+<td>Curses or Gtk color</td>
+<td>'default'</td>
+<td>Background for nicknames</td>
+</tr>
+<tr class="oddrow">
+<td><code class="option">col_chat_dcc_selected</code></td>
+<td>color</td>
+<td>Curses or Gtk color</td>
+<td>'white'</td>
+<td>Color for selected DCC (chat window)</td>
+</tr>
+<tr>
+<td><code class="option">col_dcc_waiting</code></td>
+<td>color</td>
+<td>Curses or Gtk color</td>
+<td>'lightcyan'</td>
+<td>Color for "waiting" dcc status</td>
+</tr>
+<tr class="oddrow">
+<td><code class="option">col_dcc_connecting</code></td>
+<td>color</td>
+<td>Curses or Gtk color</td>
+<td>'yellow'</td>
+<td>Color for "connecting" dcc status</td>
+</tr>
+<tr>
+<td><code class="option">col_dcc_active</code></td>
+<td>color</td>
+<td>Curses or Gtk color</td>
+<td>'lightblue'</td>
+<td>Color for "active" dcc status</td>
+</tr>
+<tr class="oddrow">
+<td><code class="option">col_dcc_done</code></td>
+<td>color</td>
+<td>Curses or Gtk color</td>
+<td>'lightgreen'</td>
+<td>Color for "done" dcc status</td>
+</tr>
+<tr>
+<td><code class="option">col_dcc_failed</code></td>
+<td>color</td>
+<td>Curses or Gtk color</td>
+<td>'lightred'</td>
+<td>Color for "failed" dcc status</td>
+</tr>
+<tr class="oddrow">
+<td><code class="option">col_dcc_aborted</code></td>
+<td>color</td>
+<td>Curses or Gtk color</td>
+<td>'lightred'</td>
+<td>Color for "aborted" dcc status</td>
+</tr>
+<tr>
+<td><code class="option">history_max_lines</code></td>
+<td>integer</td>
+<td>between 0 and 2147483647</td>
+<td>4096</td>
+<td>Maximum number of lines in history for one server/channel/private window (0 = unlimited)</td>
+</tr>
+<tr class="oddrow">
+<td><code class="option">history_max_commands</code></td>
+<td>integer</td>
+<td>between 0 and 2147483647</td>
+<td>100</td>
+<td>Maximum number of user commands in history (0 = unlimited)</td>
+</tr>
+<tr>
+<td><code class="option">history_display_default</code></td>
+<td>integer</td>
+<td>between 0 and 2147483647</td>
+<td>5</td>
+<td>Maximum number of commands to display by default in history listing (0 = unlimited)</td>
+</tr>
+<tr class="oddrow">
+<td><code class="option">log_auto_server</code></td>
+<td>boolean</td>
+<td>'on' or 'off'</td>
+<td>'off'</td>
+<td>Automatically log server messages</td>
+</tr>
+<tr>
+<td><code class="option">log_auto_channel</code></td>
+<td>boolean</td>
+<td>'on' or 'off'</td>
+<td>'off'</td>
+<td>Automatically log channel chats</td>
+</tr>
+<tr class="oddrow">
+<td><code class="option">log_auto_private</code></td>
+<td>boolean</td>
+<td>'on' or 'off'</td>
+<td>'off'</td>
+<td>Automatically log private chats</td>
+</tr>
+<tr>
+<td><code class="option">log_plugin_msg</code></td>
+<td>boolean</td>
+<td>'on' or 'off'</td>
+<td>'off'</td>
+<td>Log messages from plugins (scripts)</td>
+</tr>
+<tr class="oddrow">
+<td><code class="option">log_path</code></td>
+<td>string</td>
+<td>any string</td>
+<td>'%h/logs/'</td>
+<td>Path for WeeChat log files ('%h' will be replaced by WeeChat home, ~/.weechat by default)</td>
+</tr>
+<tr>
+<td><code class="option">log_timestamp</code></td>
+<td>string</td>
+<td>any string</td>
+<td>'%Y %b %d %H:%M:%S'</td>
+<td>Timestamp for log (see man strftime for date/time specifiers)</td>
+</tr>
+<tr class="oddrow">
+<td><code class="option">log_hide_nickserv_pwd</code></td>
+<td>boolean</td>
+<td>'on' or 'off'</td>
+<td>'on'</td>
+<td>Hide password displayed by nickserv</td>
+</tr>
+<tr>
+<td><code class="option">irc_display_away</code></td>
+<td>string</td>
+<td>'off', 'local', 'channel'</td>
+<td>'off'</td>
+<td>Display message when (un)marking as away</td>
+</tr>
+<tr class="oddrow">
+<td><code class="option">irc_show_away_once</code></td>
+<td>boolean</td>
+<td>'on' or 'off'</td>
+<td>'on'</td>
+<td>Show remote away message only once in private</td>
+</tr>
+<tr>
+<td><code class="option">irc_default_msg_part</code></td>
+<td>string</td>
+<td>any string</td>
+<td>'WeeChat %v'</td>
+<td>Default part message (leaving channel) ('%v' will be replaced by WeeChat version in string)</td>
+</tr>
+<tr class="oddrow">
+<td><code class="option">irc_default_msg_quit</code></td>
+<td>string</td>
+<td>any string</td>
+<td>'WeeChat %v'</td>
+<td>Default quit message ('%v' will be replaced by WeeChat version in string)</td>
+</tr>
+<tr>
+<td><code class="option">irc_notice_as_pv</code></td>
+<td>boolean</td>
+<td>'on' or 'off'</td>
+<td>'off'</td>
+<td>Display notices as private messages</td>
+</tr>
+<tr class="oddrow">
+<td><code class="option">irc_away_check</code></td>
+<td>integer</td>
+<td>between 0 and 2147483647</td>
+<td>0</td>
+<td>Interval between two checks for away (in minutes, 0 = never check)</td>
+</tr>
+<tr>
+<td><code class="option">irc_away_check_max_nicks</code></td>
+<td>integer</td>
+<td>between 0 and 2147483647</td>
+<td>0</td>
+<td>Do not check away nicks on channels with high number of nicks (0 = unlimited)</td>
+</tr>
+<tr class="oddrow">
+<td><code class="option">irc_lag_check</code></td>
+<td>integer</td>
+<td>between 30 and 2147483647</td>
+<td>60</td>
+<td>Interval between two checks for lag (in seconds)</td>
+</tr>
+<tr>
+<td><code class="option">irc_lag_min_show</code></td>
+<td>integer</td>
+<td>between 0 and 2147483647</td>
+<td>1</td>
+<td>Minimum lag to show (in seconds)</td>
+</tr>
+<tr class="oddrow">
+<td><code class="option">irc_lag_disconnect</code></td>
+<td>integer</td>
+<td>between 0 and 2147483647</td>
+<td>5</td>
+<td>Disconnect after important lag (in minutes, 0 = never disconnect)</td>
+</tr>
+<tr>
+<td><code class="option">irc_fifo_pipe</code></td>
+<td>boolean</td>
+<td>'on' or 'off'</td>
+<td>'off'</td>
+<td>Create a FIFO pipe for remote control</td>
+</tr>
+<tr class="oddrow">
+<td><code class="option">irc_highlight</code></td>
+<td>string</td>
+<td>any string</td>
+<td>''</td>
+<td>Comma separated list of words to highlight (case insensitive comparison, words may begin or end with "*" for partial match)</td>
+</tr>
+<tr>
+<td><code class="option">irc_colors_receive</code></td>
+<td>boolean</td>
+<td>'on' or 'off'</td>
+<td>'on'</td>
+<td>When off, colors codes are ignored in incoming messages</td>
+</tr>
+<tr class="oddrow">
+<td><code class="option">irc_colors_send</code></td>
+<td>boolean</td>
+<td>'on' or 'off'</td>
+<td>'on'</td>
+<td>Allow user to send colors with special codes (%B=bold, %Cxx,yy=color, %U=underline, %R=reverse)</td>
+</tr>
+<tr>
+<td><code class="option">dcc_auto_accept_files</code></td>
+<td>boolean</td>
+<td>'on' or 'off'</td>
+<td>'off'</td>
+<td>Automatically accept incoming dcc files</td>
+</tr>
+<tr class="oddrow">
+<td><code class="option">dcc_auto_accept_chats</code></td>
+<td>boolean</td>
+<td>'on' or 'off'</td>
+<td>'off'</td>
+<td>Automatically accept dcc chats (use carefully!)</td>
+</tr>
+<tr>
+<td><code class="option">dcc_timeout</code></td>
+<td>integer</td>
+<td>between 5 and 2147483647</td>
+<td>300</td>
+<td>Timeout for dcc request (in seconds)</td>
+</tr>
+<tr class="oddrow">
+<td><code class="option">dcc_blocksize</code></td>
+<td>integer</td>
+<td>between 1024 and 102400</td>
+<td>65536</td>
+<td>Block size for dcc packets in bytes (default: 65536)</td>
+</tr>
+<tr>
+<td><code class="option">dcc_fast_send</code></td>
+<td>boolean</td>
+<td>'on' or 'off'</td>
+<td>'on'</td>
+<td>Does not wait for ACK when sending file</td>
+</tr>
+<tr class="oddrow">
+<td><code class="option">dcc_port_range</code></td>
+<td>string</td>
+<td>any string</td>
+<td>''</td>
+<td>Restricts outgoing dcc to use only ports in the given range (useful for NAT) (syntax: a single port, ie. 5000 or a port range, ie. 5000-5015, empty value means any port)</td>
+</tr>
+<tr>
+<td><code class="option">dcc_own_ip</code></td>
+<td>string</td>
+<td>any string</td>
+<td>''</td>
+<td>IP or DNS address used for outgoing dcc (if empty, local interface IP is used)</td>
+</tr>
+<tr class="oddrow">
+<td><code class="option">dcc_download_path</code></td>
+<td>string</td>
+<td>any string</td>
+<td>'%h/dcc'</td>
+<td>Path for writing incoming files with dcc (default: user home)</td>
+</tr>
+<tr>
+<td><code class="option">dcc_upload_path</code></td>
+<td>string</td>
+<td>any string</td>
+<td>'~'</td>
+<td>Path for reading files when sending thru dcc (when no path is specified)</td>
+</tr>
+<tr class="oddrow">
+<td><code class="option">dcc_convert_spaces</code></td>
+<td>boolean</td>
+<td>'on' or 'off'</td>
+<td>'on'</td>
+<td>Convert spaces to underscores when sending files</td>
+</tr>
+<tr>
+<td><code class="option">dcc_auto_rename</code></td>
+<td>boolean</td>
+<td>'on' or 'off'</td>
+<td>'on'</td>
+<td>Rename incoming files if already exists (add '.1', '.2', ...)</td>
+</tr>
+<tr class="oddrow">
+<td><code class="option">dcc_auto_resume</code></td>
+<td>boolean</td>
+<td>'on' or 'off'</td>
+<td>'on'</td>
+<td>Automatically resume dcc transfer if connection with remote host is loosed</td>
+</tr>
+<tr>
+<td><code class="option">proxy_use</code></td>
+<td>boolean</td>
+<td>'on' or 'off'</td>
+<td>'off'</td>
+<td>Use a proxy server to connect to irc server</td>
+</tr>
+<tr class="oddrow">
+<td><code class="option">proxy_type</code></td>
+<td>string</td>
+<td>'http', 'socks4', 'socks5'</td>
+<td>'http'</td>
+<td>Proxy type (http (default), socks4, socks5)</td>
+</tr>
+<tr>
+<td><code class="option">proxy_ipv6</code></td>
+<td>boolean</td>
+<td>'on' or 'off'</td>
+<td>'off'</td>
+<td>Connect to proxy in ipv6</td>
+</tr>
+<tr class="oddrow">
+<td><code class="option">proxy_address</code></td>
+<td>string</td>
+<td>any string</td>
+<td>''</td>
+<td>Proxy server address (IP or hostname)</td>
+</tr>
+<tr>
+<td><code class="option">proxy_port</code></td>
+<td>integer</td>
+<td>between 0 and 65535</td>
+<td>3128</td>
+<td>Port for connecting to proxy server</td>
+</tr>
+<tr class="oddrow">
+<td><code class="option">proxy_username</code></td>
+<td>string</td>
+<td>any string</td>
+<td>''</td>
+<td>Username for proxy server</td>
+</tr>
+<tr>
+<td><code class="option">proxy_password</code></td>
+<td>string</td>
+<td>any string</td>
+<td>''</td>
+<td>Password for proxy server</td>
+</tr>
+<tr class="oddrow">
+<td><code class="option">plugins_path</code></td>
+<td>string</td>
+<td>any string</td>
+<td>'%h/plugins'</td>
+<td>Path for searching plugins ('%h' will be replaced by WeeChat home, ~/.weechat by default)</td>
+</tr>
+<tr>
+<td><code class="option">plugins_autoload</code></td>
+<td>string</td>
+<td>any string</td>
+<td>'*'</td>
+<td>Comma separated list of plugins to load automatically at startup, "*" means all plugins found (names may be partial, for example "perl" is ok for "libperl.so")</td>
+</tr>
+<tr class="oddrow">
+<td><code class="option">plugins_extension</code></td>
+<td>string</td>
+<td>any string</td>
+<td>'.so'</td>
+<td>Standard plugins extension in filename, used for autoload (if empty, then all files are loaded when autoload is "*")</td>
+</tr>
+<tr>
+<td><code class="option">server_name</code></td>
+<td>string</td>
+<td>any string</td>
+<td>''</td>
+<td>Name associated to IRC server (for display only)</td>
+</tr>
+<tr class="oddrow">
+<td><code class="option">server_autoconnect</code></td>
+<td>boolean</td>
+<td>'on' or 'off'</td>
+<td>'on'</td>
+<td>Automatically connect to server when WeeChat is starting</td>
+</tr>
+<tr>
+<td><code class="option">server_autoreconnect</code></td>
+<td>boolean</td>
+<td>'on' or 'off'</td>
+<td>'on'</td>
+<td>Automatically reconnect to server when disconnected</td>
+</tr>
+<tr class="oddrow">
+<td><code class="option">server_autoreconnect_delay</code></td>
+<td>integer</td>
+<td>between 0 and 65535</td>
+<td>30</td>
+<td>Delay (in seconds) before trying again to reconnect to server</td>
+</tr>
+<tr>
+<td><code class="option">server_address</code></td>
+<td>string</td>
+<td>any string</td>
+<td>''</td>
+<td>IP address or hostname of IRC server</td>
+</tr>
+<tr class="oddrow">
+<td><code class="option">server_port</code></td>
+<td>integer</td>
+<td>between 0 and 65535</td>
+<td>6667</td>
+<td>Port for connecting to server</td>
+</tr>
+<tr>
+<td><code class="option">server_ipv6</code></td>
+<td>boolean</td>
+<td>'on' or 'off'</td>
+<td>'off'</td>
+<td>Use IPv6 protocol for server communication</td>
+</tr>
+<tr class="oddrow">
+<td><code class="option">server_ssl</code></td>
+<td>boolean</td>
+<td>'on' or 'off'</td>
+<td>'off'</td>
+<td>Use SSL for server communication</td>
+</tr>
+<tr>
+<td><code class="option">server_password</code></td>
+<td>string</td>
+<td>any string</td>
+<td>''</td>
+<td>Password for IRC server</td>
+</tr>
+<tr class="oddrow">
+<td><code class="option">server_nick1</code></td>
+<td>string</td>
+<td>any string</td>
+<td>''</td>
+<td>Nickname to use on IRC server</td>
+</tr>
+<tr>
+<td><code class="option">server_nick2</code></td>
+<td>string</td>
+<td>any string</td>
+<td>''</td>
+<td>Alternate nickname to use on IRC server (if nickname is already used)</td>
+</tr>
+<tr class="oddrow">
+<td><code class="option">server_nick3</code></td>
+<td>string</td>
+<td>any string</td>
+<td>''</td>
+<td>2nd alternate nickname to use on IRC server (if alternate nickname is already used)</td>
+</tr>
+<tr>
+<td><code class="option">server_username</code></td>
+<td>string</td>
+<td>any string</td>
+<td>''</td>
+<td>User name to use on IRC server</td>
+</tr>
+<tr class="oddrow">
+<td><code class="option">server_realname</code></td>
+<td>string</td>
+<td>any string</td>
+<td>''</td>
+<td>Real name to use on IRC server</td>
+</tr>
+<tr>
+<td><code class="option">server_hostname</code></td>
+<td>string</td>
+<td>any string</td>
+<td>''</td>
+<td>Custom hostname/IP for server (optional, if empty local hostname is used)</td>
+</tr>
+<tr class="oddrow">
+<td><code class="option">server_command</code></td>
+<td>string</td>
+<td>any string</td>
+<td>''</td>
+<td>Command(s) to run when connected to server (many commands should be separated by ';', use '\;' for a semicolon, special variables $nick, $channel and $server are replaced by their value)</td>
+</tr>
+<tr>
+<td><code class="option">server_command_delay</code></td>
+<td>integer</td>
+<td>between 0 and 5</td>
+<td>0</td>
+<td>Delay (in seconds) after command was executed (example: give some time for authentication)</td>
+</tr>
+<tr class="oddrow">
+<td><code class="option">server_autojoin</code></td>
+<td>string</td>
+<td>any string</td>
+<td>''</td>
+<td>Comma separated list of channels to join when connected to server (example: "#chan1,#chan2,#chan3 key1,key2")</td>
+</tr>
+<tr>
+<td><code class="option">server_autorejoin</code></td>
+<td>boolean</td>
+<td>'on' or 'off'</td>
+<td>'on'</td>
+<td>Automatically rejoin channels when kicked</td>
+</tr>
+<tr class="oddrow">
+<td><code class="option">server_notify_levels</code></td>
+<td>string</td>
+<td>any string</td>
+<td>''</td>
+<td>Comma separated list of notify levels for channels of this server (format: #channel:1,..), a channel name '*' is reserved for server default notify level</td>
+</tr>
+<tr>
+<td><code class="option">server_charset_decode_iso</code></td>
+<td>string</td>
+<td>any string</td>
+<td>''</td>
+<td>Comma separated list of charsets for server and channels, to decode ISO (format: server:charset,#channel:charset,..)</td>
+</tr>
+<tr class="oddrow">
+<td><code class="option">server_charset_decode_utf</code></td>
+<td>string</td>
+<td>any string</td>
+<td>''</td>
+<td>Comma separated list of charsets for server and channels, to decode UTF (format: server:charset,#channel:charset,..)</td>
+</tr>
+<tr>
+<td><code class="option">server_charset_encode</code></td>
+<td>string</td>
+<td>any string</td>
+<td>''</td>
+<td>Comma separated list of charsets for server and channels, to encode messages (format: server:charset,#channel:charset,..)</td>
+</tr>
+</tbody>
+</table></div>
+<p>
+ </p>
+<p>
+ Colors for Curses GUI are:
+ </p>
+<div class="informaltable"><table border="0">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th>Keyword</th>
+<th>Color</th>
+</tr></thead>
+<tbody>
+<tr>
+<td><code class="literal">default</code></td>
+<td>default color (transparent for background)</td>
+</tr>
+<tr class="oddrow">
+<td><code class="literal">black</code></td>
+<td>black</td>
+</tr>
+<tr>
+<td><code class="literal">red</code></td>
+<td>dark red</td>
+</tr>
+<tr class="oddrow">
+<td><code class="literal">lightred</code></td>
+<td>light red</td>
+</tr>
+<tr>
+<td><code class="literal">green</code></td>
+<td>dark green</td>
+</tr>
+<tr class="oddrow">
+<td><code class="literal">lightgreen</code></td>
+<td>light green</td>
+</tr>
+<tr>
+<td><code class="literal">brown</code></td>
+<td>brown</td>
+</tr>
+<tr class="oddrow">
+<td><code class="literal">yellow</code></td>
+<td>yellow</td>
+</tr>
+<tr>
+<td><code class="literal">blue</code></td>
+<td>dark blue</td>
+</tr>
+<tr class="oddrow">
+<td><code class="literal">lightblue</code></td>
+<td>light blue</td>
+</tr>
+<tr>
+<td><code class="literal">magenta</code></td>
+<td>dark magenta</td>
+</tr>
+<tr class="oddrow">
+<td><code class="literal">lightmagenta</code></td>
+<td>light magenta</td>
+</tr>
+<tr>
+<td><code class="literal">cyan</code></td>
+<td>dark cyan</td>
+</tr>
+<tr class="oddrow">
+<td><code class="literal">lightcyan</code></td>
+<td>light cyan</td>
+</tr>
+<tr>
+<td><code class="literal">white</code></td>
+<td>white</td>
+</tr>
+</tbody>
+</table></div>
+<p>
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="secFIFOpipe"></a>FIFO pipe</h2></div></div></div>
+<p>
+ You can remote control WeeChat, by sending commands or text to a
+ FIFO pipe (you have to enable option "irc_fifo_pipe", it is disabled
+ by default).
+ </p>
+<p>
+ The FIFO pipe is located in "<code class="literal">~/.weechat/</code>" and is
+ called "weechat_fifo_xxxxx" (where xxxxx is the process ID (PID) of
+ running WeeChat). So if many WeeChat are running, you have many FIFO
+ pipes, one for each session.
+ </p>
+<p>
+ The syntax for the FIFO pipe commands/text is:
+ </p>
+<pre class="screen">server,channel *text or command here</pre>
+<p>
+ where server and channel are optional, but if channel is here, server
+ should be too.
+ </p>
+<p>
+ Some examples:
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li>
+<p>
+ nick change on freenode to "mynick|out" :
+ </p>
+<pre class="screen"><code class="prompt">$ </code><strong class="userinput"><code>echo 'freenode */nick mynick|out' >~/.weechat/weechat_fifo_12345</code></strong></pre>
+<p>
+ </p>
+</li>
+<li>
+<p>
+ display text on #weechat channel:
+ </p>
+<pre class="screen"><code class="prompt">$ </code><strong class="userinput"><code>echo 'freenode,#weechat *hello everybody!' >~/.weechat/weechat_fifo_12345</code></strong></pre>
+<p>
+ </p>
+</li>
+<li>
+<p>
+ display text on current channel (buffer displayed by WeeChat):
+ </p>
+<pre class="screen"><code class="prompt">$ </code><strong class="userinput"><code>echo '*hello!' >~/.weechat/weechat_fifo_12345</code></strong></pre>
+<p>
+ <span class="emphasis"><em>Warning:</em></span> this is dangerous and you should
+ not do that except if you know what you do!
+ </p>
+</li>
+<li>
+<p>
+ send two commands to unload/reload Perl scripts (you have to
+ separate them with "\n"):
+ </p>
+<pre class="screen"><code class="prompt">$ </code><strong class="userinput"><code>echo -e "freenode */perl unload\nfreenode */perl autoload" >~/.weechat/weechat_fifo_12345</code></strong></pre>
+<p>
+ </p>
+</li>
+</ul></div>
+<p>
+ </p>
+<p>
+ You can write a script to send command to all running WeeChat at same
+ time, for example:
+</p>
+<pre class="screen">
+#!/bin/sh
+if [ $# -eq 1 ]; then
+ for fifo in $(/bin/ls ~/.weechat/weechat_fifo_* 2>/dev/null); do
+ echo -e "$1" >$fifo
+ done
+fi
+</pre>
+<p>
+ If the script is called "auto_weechat_command", you can run it with:
+ </p>
+<pre class="screen"><code class="prompt">$ </code><strong class="userinput"><code>./auto_weechat_command "freenode,#weechat *hello"</code></strong></pre>
+<p>
+ </p>
+</div>
+</div>
+<div class="chapter" lang="en">
+<div class="titlepage"><div><div><h2 class="title">
+<a name="chapPlugins"></a>Chapter 4. Plugins</h2></div></div></div>
+<div class="toc">
+<p><b>Table of Contents</b></p>
+<dl>
+<dt><span class="section"><a href="#secPluginsInWeeChat">Plugins in WeeChat</a></span></dt>
+<dt><span class="section"><a href="#secWriteAPlugin">Write a plugin</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#secAPIFunctions">API functions</a></span></dt>
+<dt><span class="section"><a href="#secCompilePlugin">Compile plugin</a></span></dt>
+<dt><span class="section"><a href="#secLoadPlugin">Load plugin into WeeChat</a></span></dt>
+<dt><span class="section"><a href="#secPluginExample">Plugin example</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="#secScriptsPlugins">Scripts plugins</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="#secLoadUnloadScripts">Load / unload scripts</a></span></dt>
+<dt><span class="section"><a href="#secSyntaxByLanguage">Syntax by language</a></span></dt>
+<dt><span class="section"><a href="#secWeeChatScriptsAPI">WeeChat / scripts API</a></span></dt>
+</dl></dd>
+</dl>
+</div>
+<p>
+ This chapter describes WeeChat plugins interface (API) and
+ the default scripts plugins (Perl, Python, Ruby, Lua), provided with
+ WeeChat.
+ </p>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="secPluginsInWeeChat"></a>Plugins in WeeChat</h2></div></div></div>
+<p>
+ A plugin is a C program which can call WeeChat functions defined in
+ an interface.
+ </p>
+<p>
+ This C program does not need WeeChat sources to compile and can be
+ dynamically loaded into WeeChat with command
+ <span><strong class="command">/plugin</strong></span>.
+ </p>
+<p>
+ The plugin has to be a dynamic library, for dynamic loading by
+ operating system.
+ Under GNU/Linux, the file has ".so" extension, ".dll" under
+ Windows.
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="secWriteAPlugin"></a>Write a plugin</h2></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="#secAPIFunctions">API functions</a></span></dt>
+<dt><span class="section"><a href="#secCompilePlugin">Compile plugin</a></span></dt>
+<dt><span class="section"><a href="#secLoadPlugin">Load plugin into WeeChat</a></span></dt>
+<dt><span class="section"><a href="#secPluginExample">Plugin example</a></span></dt>
+</dl></div>
+<p>
+ The plugin has to include "weechat-plugin.h" file (available in
+ WeeChat source code).
+ This file defines structures and types used to communicate with
+ WeeChat.
+ </p>
+<p>
+ The plugin must have some variables and functions (mandatory,
+ without them the plugin can't load):
+ </p>
+<div class="informaltable"><table border="0">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th>Variable</th>
+<th>Description</th>
+</tr></thead>
+<tbody>
+<tr>
+<td><code class="literal">char plugin_name[]</code></td>
+<td>plugin name</td>
+</tr>
+<tr class="oddrow">
+<td><code class="literal">char plugin_version[]</code></td>
+<td>plugin version</td>
+</tr>
+<tr>
+<td><code class="literal">char plugin_description[]</code></td>
+<td>short description of plugin</td>
+</tr>
+</tbody>
+</table></div>
+<p>
+
+ </p>
+<div class="informaltable"><table border="0">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th>Function</th>
+<th>Description</th>
+</tr></thead>
+<tbody>
+<tr>
+<td><code class="literal">int weechat_plugin_init (t_weechat_plugin *plugin)</code></td>
+<td>
+ function called when plugin is loaded, must return
+ PLUGIN_RC_OK if successful, PLUGIN_RC_KO if error
+ (if error, plugin will NOT be loaded)
+ </td>
+</tr>
+<tr class="oddrow">
+<td><code class="literal">void weechat_plugin_end (t_weechat_plugin *plugin)</code></td>
+<td>function called when plugin is unloaded</td>
+</tr>
+</tbody>
+</table></div>
+<p>
+ </p>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="secAPIFunctions"></a>API functions</h3></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="#secAPI_ascii_strcasecmp">ascii_strcasecmp</a></span></dt>
+<dt><span class="section"><a href="#secAPI_ascii_strncasecmp">ascii_strncasecmp</a></span></dt>
+<dt><span class="section"><a href="#secAPI_explode_string">explode_string</a></span></dt>
+<dt><span class="section"><a href="#secAPI_free_exploded_string">free_exploded_string</a></span></dt>
+<dt><span class="section"><a href="#secAPI_mkdir_home">mkdir_home</a></span></dt>
+<dt><span class="section"><a href="#secAPI_exec_on_files">exec_on_files</a></span></dt>
+<dt><span class="section"><a href="#secAPI_print">print</a></span></dt>
+<dt><span class="section"><a href="#secAPI_print_server">print_server</a></span></dt>
+<dt><span class="section"><a href="#secAPI_print_infobar">print_infobar</a></span></dt>
+<dt><span class="section"><a href="#secAPI_infobar_remove">infobar_remove</a></span></dt>
+<dt><span class="section"><a href="#secAPI_log">log</a></span></dt>
+<dt><span class="section"><a href="#secAPI_msg_handler_add">msg_handler_add</a></span></dt>
+<dt><span class="section"><a href="#secAPI_cmd_handler_add">cmd_handler_add</a></span></dt>
+<dt><span class="section"><a href="#secAPI_timer_handler_add">timer_handler_add</a></span></dt>
+<dt><span class="section"><a href="#secAPI_keyboard_handler_add">keyboard_handler_add</a></span></dt>
+<dt><span class="section"><a href="#secAPI_handler_remove">handler_remove</a></span></dt>
+<dt><span class="section"><a href="#secAPI_handler_remove_all">handler_remove_all</a></span></dt>
+<dt><span class="section"><a href="#secAPI_exec_command">exec_command</a></span></dt>
+<dt><span class="section"><a href="#secAPI_get_info">get_info</a></span></dt>
+<dt><span class="section"><a href="#secAPI_get_dcc_info">get_dcc_info</a></span></dt>
+<dt><span class="section"><a href="#secAPI_free_dcc_info">free_dcc_info</a></span></dt>
+<dt><span class="section"><a href="#secAPI_get_server_info">get_server_info</a></span></dt>
+<dt><span class="section"><a href="#secAPI_free_server_info">free_server_info</a></span></dt>
+<dt><span class="section"><a href="#secAPI_get_channel_info">get_channel_info</a></span></dt>
+<dt><span class="section"><a href="#secAPI_free_channel_info">free_channel_info</a></span></dt>
+<dt><span class="section"><a href="#secAPI_get_nick_info">get_nick_info</a></span></dt>
+<dt><span class="section"><a href="#secAPI_free_nick_info">free_nick_info</a></span></dt>
+<dt><span class="section"><a href="#secAPI_get_config">get_config</a></span></dt>
+<dt><span class="section"><a href="#secAPI_set_config">set_config</a></span></dt>
+<dt><span class="section"><a href="#secAPI_get_plugin_config">get_plugin_config</a></span></dt>
+<dt><span class="section"><a href="#secAPI_set_plugin_config">set_plugin_config</a></span></dt>
+<dt><span class="section"><a href="#secAPI_get_irc_color">get_irc_color</a></span></dt>
+<dt><span class="section"><a href="#secAPI_input_color">input_color</a></span></dt>
+<dt><span class="section"><a href="#secAPI_get_window_info">get_window_info</a></span></dt>
+<dt><span class="section"><a href="#secAPI_free_window_info">free_window_info</a></span></dt>
+<dt><span class="section"><a href="#secAPI_get_buffer_info">get_buffer_info</a></span></dt>
+<dt><span class="section"><a href="#secAPI_free_buffer_info">free_buffer_info</a></span></dt>
+<dt><span class="section"><a href="#secAPI_get_buffer_data">get_buffer_data</a></span></dt>
+<dt><span class="section"><a href="#secAPI_free_buffer_data">free_buffer_data</a></span></dt>
+</dl></div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="secAPI_ascii_strcasecmp"></a>ascii_strcasecmp</h4></div></div></div>
+<p>
+ Prototype:
+ <span><strong class="command">
+ int ascii_strcasecmp (t_weechat_plugin *plugin,
+ char *string1, char *string2)
+ </strong></span>
+ </p>
+<p>
+ Locale and case independent string comparison.
+ </p>
+<p>
+ Arguments:
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li><p>
+ <code class="option">plugin</code>: pointer to plugin structure
+ </p></li>
+<li><p>
+ <code class="option">string1</code>: first string for comparison
+ </p></li>
+<li><p>
+ <code class="option">string2</code>: second string for comparison
+ </p></li>
+</ul></div>
+<p>
+ </p>
+<p>
+ Return value: difference between two strings: negative if
+ string1 < string2, zero if string1 == string2, positive if
+ string1 > string2
+ </p>
+<p>
+ Example:
+ </p>
+<pre class="screen">if (plugin->ascii_strcasecmp (plugin, "abc", "def") != 0) ...</pre>
+<p>
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="secAPI_ascii_strncasecmp"></a>ascii_strncasecmp</h4></div></div></div>
+<p>
+ Prototype:
+ <span><strong class="command">
+ int ascii_strncasecmp (t_weechat_plugin *plugin,
+ char *string1, char *string2, int max)
+ </strong></span>
+ </p>
+<p>
+ Locale and case independent string comparison, for "max" chars.
+ </p>
+<p>
+ Arguments:
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li><p>
+ <code class="option">plugin</code>: pointer to plugin struct
+ </p></li>
+<li><p>
+ <code class="option">string1</code>: first string for comparison
+ </p></li>
+<li><p>
+ <code class="option">string2</code>: second string for comparison
+ </p></li>
+<li><p>
+ <code class="option">max</code>: max number of chars for comparison
+ </p></li>
+</ul></div>
+<p>
+ </p>
+<p>
+ Return value: difference between two strings: negative if
+ string1 < string2, zero if string1 == string2, positive if
+ string1 > string2
+ </p>
+<p>
+ Example:
+ </p>
+<pre class="screen">if (plugin->ascii_strncasecmp (plugin, "abc", "def", 2) != 0) ...</pre>
+<p>
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="secAPI_explode_string"></a>explode_string</h4></div></div></div>
+<p>
+ Prototype:
+ <span><strong class="command">
+ char **explode_string (t_weechat_plugin *plugin, char *string,
+ char *separators, int num_items_max, int *num_items)
+ </strong></span>
+ </p>
+<p>
+ Explode a string according to one or more delimiter(s).
+ </p>
+<p>
+ Arguments:
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li><p>
+ <code class="option">plugin</code>: pointer to plugin struct
+ </p></li>
+<li><p>
+ <code class="option">string</code>: string to explode
+ </p></li>
+<li><p>
+ <code class="option">separators</code>: delimiters used for explosion
+ </p></li>
+<li><p>
+ <code class="option">num_items_max</code>: maximum number of items
+ created (0 = no limit)
+ </p></li>
+<li><p>
+ <code class="option">num_items</code>: pointer to int which will
+ contain number of items created
+ </p></li>
+</ul></div>
+<p>
+ </p>
+<p>
+ Return value: array of strings, NULL if problem.
+ </p>
+<p>
+ Note: result has to be free by a call to "free_exloded_string"
+ after use.
+ </p>
+<p>
+ Example:
+</p>
+<pre class="screen">
+char **argv;
+int argc;
+argv = plugin->explode_string (plugin, string, " ", 0, &argc);
+...
+if (argv != NULL)
+ plugin->free_exploded_string (plugin, argv);
+</pre>
+<p>
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="secAPI_free_exploded_string"></a>free_exploded_string</h4></div></div></div>
+<p>
+ Prototype:
+ <span><strong class="command">
+ char **free_exploded_string (t_weechat_plugin *plugin,
+ char **string)
+ </strong></span>
+ </p>
+<p>
+ Free memory used by a string explosion.
+ </p>
+<p>
+ Arguments:
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li><p>
+ <code class="option">plugin</code>: pointer to plugin structure
+ </p></li>
+<li><p>
+ <code class="option">string</code>: string exploded by
+ "explode_string" function
+ </p></li>
+</ul></div>
+<p>
+ </p>
+<p>
+ Return value: none.
+ </p>
+<p>
+ Example:
+</p>
+<pre class="screen">
+char *argv;
+int argc;
+argv = plugin->explode_string (plugin, string, " ", 0, &argc);
+...
+if (argv != NULL)
+ plugin->free_exploded_string (plugin, argv);
+</pre>
+<p>
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="secAPI_mkdir_home"></a>mkdir_home</h4></div></div></div>
+<p>
+ Prototype:
+ <span><strong class="command">
+ int mkdir_home (t_weechat_plugin *plugin, char *directory)
+ </strong></span>
+ </p>
+<p>
+ Create a directory in WeeChat home.
+ </p>
+<p>
+ Arguments:
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li><p>
+ <code class="option">plugin</code>: pointer to plugin structure
+ </p></li>
+<li><p>
+ <code class="option">directory</code>: directory to create
+ </p></li>
+</ul></div>
+<p>
+ </p>
+<p>
+ Return value: 1 if directory was successfully created, 0 if an
+ error occurred.
+ </p>
+<p>
+ Example:
+</p>
+<pre class="screen">
+if (!plugin->mkdir_home (plugin, "temp"))
+ plugin->print_server(plugin, "Failed to create 'temp' directory in WeeChat home.");
+</pre>
+<p>
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="secAPI_exec_on_files"></a>exec_on_files</h4></div></div></div>
+<p>
+ Prototype:
+ <span><strong class="command">
+ void exec_on_files (t_weechat_plugin *plugin, char *directory,
+ int (*callback)(t_weechat_plugin *, char *))
+ </strong></span>
+ </p>
+<p>
+ Execute a function on all files of a directory.
+ </p>
+<p>
+ Arguments:
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li><p>
+ <code class="option">plugin</code>: pointer to plugin structure
+ </p></li>
+<li><p>
+ <code class="option">directory</code>: directory for searching files
+ </p></li>
+<li><p>
+ <code class="option">callback</code>: function called for each file
+ found
+ </p></li>
+</ul></div>
+<p>
+ </p>
+<p>
+ Return value: none.
+ </p>
+<p>
+ Example:
+</p>
+<pre class="screen">
+int callback (t_weechat_plugin *plugin, char *file)
+{
+ plugin->print_server (plugin, "file: %s", file);
+ return 1;
+}
+...
+plugin->exec_on_files (plugin, "/tmp", &callback);
+</pre>
+<p>
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="secAPI_print"></a>print</h4></div></div></div>
+<p>
+ Prototype:
+ <span><strong class="command">
+ void print (t_weechat_plugin *plugin,
+ char *server, char *channel, char *message, ...)
+ </strong></span>
+ </p>
+<p>
+ Display a message on a WeeChat buffer, identified by server and
+ channel (both may be NULL for current buffer).
+ </p>
+<p>
+ Arguments:
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li><p>
+ <code class="option">plugin</code>: pointer to plugin structure
+ </p></li>
+<li><p>
+ <code class="option">server</code>: internal name of server to find
+ buffer for message display (may be NULL)
+ </p></li>
+<li><p>
+ <code class="option">channel</code>: name of channel to find buffer
+ for message display (may be NULL)
+ </p></li>
+<li><p>
+ <code class="option">message</code>: message
+ </p></li>
+</ul></div>
+<p>
+ </p>
+<p>
+ Return value: none.
+ </p>
+<p>
+ Examples:
+</p>
+<pre class="screen">
+plugin->print (plugin, NULL, NULL, "hello");
+plugin->print (plugin, NULL, "#weechat", "hello");
+plugin->print (plugin, "freenode", "#weechat", "hello");
+</pre>
+<p>
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="secAPI_print_server"></a>print_server</h4></div></div></div>
+<p>
+ Prototype:
+ <span><strong class="command">
+ void print_server (t_weechat_plugin *plugin,
+ char *message, ...)
+ </strong></span>
+ </p>
+<p>
+ Display a message on current server buffer.
+ </p>
+<p>
+ Arguments:
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li><p>
+ <code class="option">plugin</code>: pointer to plugin structure
+ </p></li>
+<li><p>
+ <code class="option">message</code>: message
+ </p></li>
+</ul></div>
+<p>
+ </p>
+<p>
+ Return value: none.
+ </p>
+<p>
+ Example: </p>
+<pre class="screen">plugin->print_server (plugin, "hello");</pre>
+<p>
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="secAPI_print_infobar"></a>print_infobar</h4></div></div></div>
+<p>
+ Prototype:
+ <span><strong class="command">
+ void print_infobar (t_weechat_plugin *plugin,
+ int time, char *message, ...)
+ </strong></span>
+ </p>
+<p>
+ Display a message in infobar for a specified time.
+ </p>
+<p>
+ Arguments:
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li><p>
+ <code class="option">plugin</code>: pointer to plugin structure
+ </p></li>
+<li><p>
+ <code class="option">time</code>: time (in seconds) for displaying
+ message (0 = never erased)
+ </p></li>
+</ul></div>
+<p>
+ </p>
+<p>
+ Return value: none.
+ </p>
+<p>
+ Example:
+</p>
+<pre class="screen">
+plugin->print_infobar (plugin, 5, "hello");
+</pre>
+<p>
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="secAPI_infobar_remove"></a>infobar_remove</h4></div></div></div>
+<p>
+ Prototype:
+ <span><strong class="command">
+ void infobar_remove (t_weechat_plugin *plugin, int count)
+ </strong></span>
+ </p>
+<p>
+ Remove one or more messages in infobar stack.
+ </p>
+<p>
+ Arguments:
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li><p>
+ <code class="option">plugin</code>: pointer to plugin structure
+ </p></li>
+<li><p>
+ <code class="option">count</code>: number of messages to remove
+ (if argument is <= 0, then all messages are removed)
+ </p></li>
+</ul></div>
+<p>
+ </p>
+<p>
+ Return value: none.
+ </p>
+<p>
+ Example: </p>
+<pre class="screen">plugin->infobar_remove (1);</pre>
+<p>
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="secAPI_log"></a>log</h4></div></div></div>
+<p>
+ Prototype:
+ <span><strong class="command">
+ void log (t_weechat_plugin *plugin,
+ char *server, char *channel, char *message, ...)
+ </strong></span>
+ </p>
+<p>
+ Write a message in log file for a server or a channel.
+ </p>
+<p>
+ Arguments:
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li><p>
+ <code class="option">plugin</code>: pointer to plugin structure
+ </p></li>
+<li><p>
+ <code class="option">server</code>: internal name of server to find
+ buffer for log (may be NULL)
+ </p></li>
+<li><p>
+ <code class="option">channel</code>: name of channel to find buffer
+ for log (may be NULL)
+ </p></li>
+<li><p>
+ <code class="option">message</code>: message
+ </p></li>
+</ul></div>
+<p>
+ </p>
+<p>
+ Return value: none.
+ </p>
+<p>
+ Example:
+</p>
+<pre class="screen">
+plugin->log (plugin, "freenode", "#weechat", "test");
+</pre>
+<p>
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="secAPI_msg_handler_add"></a>msg_handler_add</h4></div></div></div>
+<p>
+ Prototype:
+ <span><strong class="command">
+ t_plugin_handler *msg_handler_add (t_weechat_plugin
+ *plugin, char *message, t_plugin_handler_func *function,
+ char *handler_args, void *handler_pointer)
+ </strong></span>
+ </p>
+<p>
+ Add an IRC message handler, called when an IRC message is
+ received.
+ </p>
+<p>
+ Arguments:
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li><p>
+ <code class="option">plugin</code>: pointer to plugin structure
+ </p></li>
+<li>
+<p>
+ <code class="option">message</code>: name of IRC message.
+ To know list of IRC messages, please consult
+ <acronym class="acronym">RFC</acronym>s
+ <a href="http://www.ietf.org/rfc/rfc1459.txt" target="_top">1459</a> and
+ <a href="http://www.ietf.org/rfc/rfc2812.txt" target="_top">2812</a>.
+ Moreover you can use a special name, prefixed by "weechat_" to catch
+ special events, as written in table below:
+ </p>
+<div class="informaltable"><table border="0">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th>Name</th>
+<th>Description</th>
+</tr></thead>
+<tbody>
+<tr>
+<td><code class="literal">weechat_pv</code></td>
+<td>private message received</td>
+</tr>
+<tr class="oddrow">
+<td><code class="literal">weechat_highlight</code></td>
+<td>
+ message with highlight (on a channel or pv)
+ </td>
+</tr>
+<tr>
+<td><code class="literal">weechat_ctcp</code></td>
+<td>
+ CTCP message received (VERSION, PING, ..)
+ </td>
+</tr>
+<tr class="oddrow">
+<td><code class="literal">weechat_dcc</code></td>
+<td>
+ DCC message received (chat or file)
+ </td>
+</tr>
+</tbody>
+</table></div>
+<p>
+ </p>
+</li>
+<li>
+<p>
+ <code class="option">function</code>: function called when message
+ is received
+ </p>
+<p>
+ It uses following prototype:
+ <span><strong class="command">
+ int my_function (t_weechat_plugin *plugin,
+ int argc, char **argv,
+ char *handler_args, void *handler_pointer)
+ </strong></span>
+ </p>
+<p>
+ Argument argc is set to 3, following values are set in
+ argv array:
+ </p>
+<div class="itemizedlist"><ul type="circle">
+<li><p>argv[0] = server name</p></li>
+<li><p>argv[1] = IRC message</p></li>
+<li><p>argv[2] = command arguments</p></li>
+</ul></div>
+<p>
+ </p>
+</li>
+<li><p>
+ <code class="option">handler_args</code>: arguments given to function
+ when called
+ </p></li>
+<li><p>
+ <code class="option">handler_pointer</code>: pointer given to function
+ when called
+ </p></li>
+</ul></div>
+<p>
+ </p>
+<p>
+ Return value: pointer to new message handler.
+ </p>
+<p>
+ Note: function called when message is received has to return
+ one of following values:
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li><p>
+ <code class="literal">PLUGIN_RC_KO</code>: function failed
+ </p></li>
+<li><p>
+ <code class="literal">PLUGIN_RC_OK</code>: function successfully
+ completed
+ </p></li>
+<li><p>
+ <code class="literal">PLUGIN_RC_OK_IGNORE_WEECHAT</code>: message
+ will not be sent to WeeChat
+ </p></li>
+<li><p>
+ <code class="literal">PLUGIN_RC_OK_IGNORE_PLUGINS</code>: message
+ will not be sent to other plugins
+ </p></li>
+<li><p>
+ <code class="literal">PLUGIN_RC_OK_IGNORE_ALL</code>: message
+ will not be sent to WeeChat neither other plugins
+ </p></li>
+</ul></div>
+<p>
+ </p>
+<p>
+ Example:
+</p>
+<pre class="screen">
+int msg_kick (t_weechat_plugin *plugin, int argc, char **argv,
+ char *handler_args, void *handler_pointer)
+{
+ plugin->print (plugin, argv[0], NULL, "KICK received");
+ return PLUGIN_RC_OK;
+}
+...
+plugin->msg_handler_add (plugin, "KICK", &msg_kick, NULL, NULL);
+</pre>
+<p>
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="secAPI_cmd_handler_add"></a>cmd_handler_add</h4></div></div></div>
+<p>
+ Prototype:
+ <span><strong class="command">
+ t_plugin_handler *cmd_handler_add (t_weechat_plugin
+ *plugin, char *command, char *description, char *arguments,
+ char *arguments_description, char *completion_template,
+ t_plugin_handler_func *fonction, char *handler_args,
+ void *handler_pointer)
+ </strong></span>
+ </p>
+<p>
+ Add a WeeChat command handler, called when user uses command
+ (for example /command).
+ </p>
+<p>
+ Arguments:
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li><p>
+ <code class="option">plugin</code>: pointer to plugin structure
+ </p></li>
+<li><p>
+ <code class="option">command</code>: the new command name, which
+ may be an existing command (be careful, replaced command
+ will not be available until plugin is unloaded)
+ </p></li>
+<li><p>
+ <code class="option">description</code>: short command description
+ (displayed by /help command)
+ </p></li>
+<li><p>
+ <code class="option">arguments</code>: short description of command
+ arguments (displayed by /help command)
+ </p></li>
+<li><p>
+ <code class="option">arguments_description</code>: long description
+ of command arguments (displayed by /help command)
+ </p></li>
+<li>
+<p>
+ <code class="option">completion_template</code>: template for
+ completion, like "<code class="literal">abc|%w def|%i</code>"
+ which means "abc" or a WeeChat command for first argument,
+ "def" or IRC command for second.
+ An empty string lets WeeChat complete any argument with
+ a nick from current channel, NULL or "-" disable completion
+ for all command arguments.
+ </p>
+<p>
+ Following codes can be used:
+ </p>
+<div class="informaltable"><table border="0">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th>Code</th>
+<th>Description</th>
+</tr></thead>
+<tbody>
+<tr>
+<td><code class="literal">%-</code></td>
+<td>no completion for argument</td>
+</tr>
+<tr class="oddrow">
+<td><code class="literal">%a</code></td>
+<td>alias</td>
+</tr>
+<tr>
+<td><code class="literal">%A</code></td>
+<td>
+ alias and commands (WeeChat, IRC and plugins)
+ </td>
+</tr>
+<tr class="oddrow">
+<td><code class="literal">%c</code></td>
+<td>current channel</td>
+</tr>
+<tr>
+<td><code class="literal">%C</code></td>
+<td>channels of current server</td>
+</tr>
+<tr class="oddrow">
+<td><code class="literal">%h</code></td>
+<td>plugins commands</td>
+</tr>
+<tr>
+<td><code class="literal">%i</code></td>
+<td>IRC commands (sent)</td>
+</tr>
+<tr class="oddrow">
+<td><code class="literal">%I</code></td>
+<td>IRC commands (received)</td>
+</tr>
+<tr>
+<td><code class="literal">%k</code></td>
+<td>key functions</td>
+</tr>
+<tr class="oddrow">
+<td><code class="literal">%m</code></td>
+<td>nick on current server</td>
+</tr>
+<tr>
+<td><code class="literal">%n</code></td>
+<td>nicks of current channel</td>
+</tr>
+<tr class="oddrow">
+<td><code class="literal">%N</code></td>
+<td>nicks and hostnames of current channel</td>
+</tr>
+<tr>
+<td><code class="literal">%o</code></td>
+<td>setup options</td>
+</tr>
+<tr class="oddrow">
+<td><code class="literal">%O</code></td>
+<td>plugin options</td>
+</tr>
+<tr>
+<td><code class="literal">%p</code></td>
+<td>default "part" message</td>
+</tr>
+<tr class="oddrow">
+<td><code class="literal">%q</code></td>
+<td>default "quit" message</td>
+</tr>
+<tr>
+<td><code class="literal">%s</code></td>
+<td>current server name</td>
+</tr>
+<tr class="oddrow">
+<td><code class="literal">%S</code></td>
+<td>all servers names</td>
+</tr>
+<tr>
+<td><code class="literal">%t</code></td>
+<td>topic of current channel</td>
+</tr>
+<tr class="oddrow">
+<td><code class="literal">%v</code></td>
+<td>setup option value</td>
+</tr>
+<tr>
+<td><code class="literal">%V</code></td>
+<td>plugin option value</td>
+</tr>
+<tr class="oddrow">
+<td><code class="literal">%w</code></td>
+<td>WeeChat commands</td>
+</tr>
+</tbody>
+</table></div>
+<p>
+ </p>
+</li>
+<li>
+<p>
+ <code class="option">function</code>: function called when command
+ is executed
+ </p>
+<p>
+ It uses following prototype:
+ <span><strong class="command">
+ int my_function (t_weechat_plugin *plugin,
+ int argc, char **argv,
+ char *handler_args, void *handler_pointer)
+ </strong></span>
+ </p>
+<p>
+ Argument argc is set to 3, following values are set in
+ argc array:
+ </p>
+<div class="itemizedlist"><ul type="circle">
+<li><p>argv[0] = server name</p></li>
+<li><p>argv[1] = command</p></li>
+<li><p>argv[2] = command arguments</p></li>
+</ul></div>
+<p>
+ </p>
+</li>
+<li><p>
+ <code class="option">handler_args</code>: arguments given to function
+ when called
+ </p></li>
+<li><p>
+ <code class="option">handler_pointer</code>: pointer given to function
+ when called
+ </p></li>
+</ul></div>
+<p>
+ </p>
+<p>
+ Return value: pointer to new command handler.
+ </p>
+<p>
+ Note: function called when command is executed has to return
+ one of following values:
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li><p>
+ <code class="literal">PLUGIN_RC_KO</code>: function failed
+ </p></li>
+<li><p>
+ <code class="literal">PLUGIN_RC_OK</code>: function successfully
+ completed
+ </p></li>
+</ul></div>
+<p>
+ </p>
+<p>
+ Example:
+</p>
+<pre class="screen">
+int cmd_test (t_weechat_plugin *plugin, int argc, char **argv,
+ char *handler_args, void *handler_pointer)
+{
+ plugin->print (plugin, argv[0], NULL,
+ "test command, nick: %s",
+ (argv[2]) ? argv[2] : "none");
+ return PLUGIN_RC_OK;
+}
+...
+plugin->cmd_handler_add (plugin, "test", "Test command",
+ "[nick]", "nick: nick of channel",
+ "%n", &cmd_test, NULL, NULL);
+</pre>
+<p>
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="secAPI_timer_handler_add"></a>timer_handler_add</h4></div></div></div>
+<p>
+ Prototype:
+ <span><strong class="command">
+ t_plugin_handler *timer_handler_add (t_weechat_plugin
+ *plugin, int interval, t_plugin_handler_func *function,
+ char *handler_args, void *handler_pointer)
+ </strong></span>
+ </p>
+<p>
+ Add a timer handler which periodically calls a function.
+ </p>
+<p>
+ Arguments:
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li><p>
+ <code class="option">plugin</code>: pointer to plugin structure
+ </p></li>
+<li><p>
+ <code class="option">interval</code>: interval (in seconds) between
+ two calls of function.
+ </p></li>
+<li>
+<p>
+ <code class="option">function</code>: function called
+ </p>
+<p>
+ It uses following prototype:
+ <span><strong class="command">
+ int my_function (t_weechat_plugin *plugin,
+ int argc, char **argv,
+ char *handler_args, void *handler_pointer)
+ </strong></span>
+ </p>
+<p>
+ Argument argc is set to 0, and argv is set to NULL.
+ </p>
+</li>
+<li><p>
+ <code class="option">handler_args</code>: arguments given to function
+ when called
+ </p></li>
+<li><p>
+ <code class="option">handler_pointer</code>: pointer given to function
+ when called
+ </p></li>
+</ul></div>
+<p>
+ </p>
+<p>
+ Return value: pointer to new timer handler.
+ </p>
+<p>
+ Note: function called has to return one of following values:
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li><p>
+ <code class="literal">PLUGIN_RC_KO</code>: function failed
+ </p></li>
+<li><p>
+ <code class="literal">PLUGIN_RC_OK</code>: function successfully
+ completed
+ </p></li>
+</ul></div>
+<p>
+ </p>
+<p>
+ Example:
+</p>
+<pre class="screen">
+int my_timer (t_weechat_plugin *plugin, int argc, char **argv,
+ char *handler_args, void *handler_pointer)
+{
+ plugin->print (plugin, NULL, NULL, "my timer");
+ return PLUGIN_RC_OK;
+}
+...
+plugin->timer_handler_add (plugin, 60, &my_timer);
+</pre>
+<p>
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="secAPI_keyboard_handler_add"></a>keyboard_handler_add</h4></div></div></div>
+<p>
+ Prototype:
+ <span><strong class="command">
+ t_plugin_handler *keyboard_handler_add (t_weechat_plugin
+ *plugin, t_plugin_handler_func *function,
+ char *handler_args, void *handler_pointer)
+ </strong></span>
+ </p>
+<p>
+ Add a keyboard handler, called for any key pressed.
+ </p>
+<p>
+ Arguments:
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li><p>
+ <code class="option">plugin</code>: pointer to plugin structure
+ </p></li>
+<li>
+<p>
+ <code class="option">function</code>: function called
+ </p>
+<p>
+ It uses following prototype:
+ <span><strong class="command">
+ int my_function (t_weechat_plugin *plugin,
+ int argc, char **argv,
+ char *handler_args, void *handler_pointer)
+ </strong></span>
+ </p>
+<p>
+ Argument argc is set to 3, following values are set in
+ argc array:
+ </p>
+<div class="itemizedlist"><ul type="circle">
+<li><p>
+ argv[0] = key pressed (name of internal function or
+ '*' followed by a key code)
+ </p></li>
+<li><p>
+ argv[1] = command line before key action
+ </p></li>
+<li><p>
+ argv[2] = command line after key action
+ </p></li>
+</ul></div>
+<p>
+ </p>
+</li>
+<li><p>
+ <code class="option">handler_args</code>: arguments given to function
+ when called
+ </p></li>
+<li><p>
+ <code class="option">handler_pointer</code>: pointer given to function
+ when called
+ </p></li>
+</ul></div>
+<p>
+ </p>
+<p>
+ Return value: pointer to new message handler.
+ </p>
+<p>
+ Note: function called has to return one of following values:
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li><p>
+ <code class="literal">PLUGIN_RC_KO</code>: function failed
+ </p></li>
+<li><p>
+ <code class="literal">PLUGIN_RC_OK</code>: function successfully
+ completed
+ </p></li>
+</ul></div>
+<p>
+ </p>
+<p>
+ Example:
+</p>
+<pre class="screen">
+int keyb_handler (t_weechat_plugin *plugin, int argc, char **argv,
+ char *handler_args, void *handler_pointer)
+{
+ if (argc == 2)
+ {
+ plugin->print (plugin, NULL, NULL, "key pressed: %s", argv[0]);
+ if (argv[1] && (argv[1][0] == '1'))
+ plugin->print (plugin, NULL, NULL, "input text changed");
+ else
+ plugin->print (plugin, NULL, NULL, "input text not changed");
+ }
+ return PLUGIN_RC_OK;
+}
+...
+plugin->keyboard_handler_add (plugin, &keyb_handler);
+</pre>
+<p>
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="secAPI_handler_remove"></a>handler_remove</h4></div></div></div>
+<p>
+ Prototype:
+ <span><strong class="command">
+ void handler_remove (t_weechat_plugin *plugin,
+ t_plugin_handler *handler)
+ </strong></span>
+ </p>
+<p>
+ Remove a command or message handler.
+ </p>
+<p>
+ Arguments:
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li><p>
+ <code class="option">plugin</code>: pointer to plugin structure
+ </p></li>
+<li><p>
+ <code class="option">handler</code>: handler to remove
+ </p></li>
+</ul></div>
+<p>
+ </p>
+<p>
+ Return value: none.
+ </p>
+<p>
+ Example:
+ </p>
+<pre class="screen">plugin->handler_remove (plugin, my_handler);</pre>
+<p>
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="secAPI_handler_remove_all"></a>handler_remove_all</h4></div></div></div>
+<p>
+ Prototype:
+ <span><strong class="command">
+ void handler_remove_all (t_weechat_plugin *plugin)
+ </strong></span>
+ </p>
+<p>
+ Remove all handlers for a plugin.
+ </p>
+<p>
+ Arguments:
+ </p>
+<div class="itemizedlist"><ul type="disc"><li><p>
+ <code class="option">plugin</code>: pointer to plugin structure
+ </p></li></ul></div>
+<p>
+ </p>
+<p>
+ Return value: none.
+ </p>
+<p>
+ Example:
+ </p>
+<pre class="screen">plugin->handler_remove_all (plugin);</pre>
+<p>
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="secAPI_exec_command"></a>exec_command</h4></div></div></div>
+<p>
+ Prototype:
+ <span><strong class="command">
+ void exec_command (t_weechat_plugin
+ *plugin, char *server, char *channel, char *command)
+ </strong></span>
+ </p>
+<p>
+ Execute a WeeChat command (or send a message to a channel).
+ </p>
+<p>
+ Arguments:
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li><p>
+ <code class="option">plugin</code>: pointer to plugin structure
+ </p></li>
+<li><p>
+ <code class="option">server</code>: internal name of server for
+ executing command (may be NULL)
+ </p></li>
+<li><p>
+ <code class="option">channel</code>: name of channel for executing
+ command (may be NULL)
+ </p></li>
+<li><p>
+ <code class="option">command</code>: command
+ </p></li>
+</ul></div>
+<p>
+ </p>
+<p>
+ Return value: none.
+ </p>
+<p>
+ Examples:
+</p>
+<pre class="screen">
+plugin->exec_command (plugin, NULL, NULL, "/help nick");
+plugin->exec_command (plugin, "freenode", "#weechat", "hello");
+</pre>
+<p>
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="secAPI_get_info"></a>get_info</h4></div></div></div>
+<p>
+ Prototype:
+ <span><strong class="command">
+ char *get_info (t_weechat_plugin *plugin,
+ char *info, char *server)
+ </strong></span>
+ </p>
+<p>
+ Return an info about WeeChat or a channel.
+ </p>
+<p>
+ Arguments:
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li><p>
+ <code class="option">plugin</code>: pointer to plugin structure
+ </p></li>
+<li>
+<p>
+ <code class="option">info</code> : name of info to read:
+ </p>
+<div class="informaltable"><table border="0">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th>Info</th>
+<th>Description</th>
+</tr></thead>
+<tbody>
+<tr>
+<td><code class="literal">version</code></td>
+<td>WeeChat's version</td>
+</tr>
+<tr class="oddrow">
+<td><code class="literal">nick</code></td>
+<td>nick</td>
+</tr>
+<tr>
+<td><code class="literal">channel</code></td>
+<td>
+ name of channel (NULL for a server or private)
+ </td>
+</tr>
+<tr class="oddrow">
+<td><code class="literal">server</code></td>
+<td>name of server</td>
+</tr>
+<tr>
+<td><code class="literal">away</code></td>
+<td>"away" flag</td>
+</tr>
+<tr class="oddrow">
+<td><code class="literal">inactivity</code></td>
+<td>
+ number of seconds since last key was pressed
+ </td>
+</tr>
+<tr>
+<td><code class="literal">input</code></td>
+<td>
+ content of command line for current window
+ </td>
+</tr>
+<tr class="oddrow">
+<td><code class="literal">input_mask</code></td>
+<td>
+ content of color mask for command line
+ </td>
+</tr>
+<tr>
+<td><code class="literal">input_pos</code></td>
+<td>
+ cursor position in command line
+ </td>
+</tr>
+<tr class="oddrow">
+<td><code class="literal">weechat_dir</code></td>
+<td>
+ WeeChat home directory
+ (by default: ~/.weechat/)
+ </td>
+</tr>
+<tr>
+<td><code class="literal">weechat_libdir</code></td>
+<td>WeeChat system lib directory</td>
+</tr>
+<tr class="oddrow">
+<td><code class="literal">weechat_sharedir</code></td>
+<td>WeeChat system share directory</td>
+</tr>
+</tbody>
+</table></div>
+<p>
+ </p>
+</li>
+<li><p>
+ <code class="option">server</code>: internal name of server for
+ reading info (if needed)
+ </p></li>
+</ul></div>
+<p>
+ </p>
+<p>
+ Return value: information asked, NULL if not found.
+ </p>
+<p>
+ Note: result has to be free by a call to "free" function after
+ use.
+ </p>
+<p>
+ Examples:
+</p>
+<pre class="screen">
+char *version = plugin->get_info (plugin, "version", NULL);
+char *nick = plugin->get_info (plugin, "nick", "freenode");
+char *inactivity = plugin->get_info (plugin, "inactivity", NULL);
+
+plugin->print (plugin, NULL, NULL,
+ "WeeChat version %s, you are %s on freenode "
+ "(inactive for %s seconds)",
+ version, nick, inactivity);
+
+if (version)
+ free (version);
+if (nick)
+ free (nick);
+if (inactivity)
+ free (inactivity);
+</pre>
+<p>
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="secAPI_get_dcc_info"></a>get_dcc_info</h4></div></div></div>
+<p>
+ Prototype:
+ <span><strong class="command">
+ t_plugin_info_dcc *get_dcc_info (t_weechat_plugin *plugin)
+ </strong></span>
+ </p>
+<p>
+ Return list of DCC currently active or finished.
+ </p>
+<p>
+ Arguments:
+ </p>
+<div class="itemizedlist"><ul type="disc"><li><p>
+ <code class="option">plugin</code>: pointer to plugin structure
+ </p></li></ul></div>
+<p>
+ </p>
+<p>
+ Return value: linked list of DCC.
+ </p>
+<div class="informaltable"><table border="0">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th>Type</th>
+<th>Field</th>
+<th>Description</th>
+</tr></thead>
+<tbody>
+<tr>
+<td>char *</td>
+<td><code class="literal">server</code></td>
+<td>IRC server</td>
+</tr>
+<tr class="oddrow">
+<td>char *</td>
+<td><code class="literal">channel</code></td>
+<td>IRC channel</td>
+</tr>
+<tr>
+<td>int</td>
+<td><code class="literal">type</code></td>
+<td>
+ DCC type:
+ 0 = chat received,
+ 1 = chat sent,
+ 2 = file received,
+ 3 = file sent
+ </td>
+</tr>
+<tr class="oddrow">
+<td>int*</td>
+<td><code class="literal">status</code></td>
+<td>
+ DCC status:
+ 0 = waiting,
+ 1 = connecting,
+ 2 = active,
+ 3 = finished,
+ 4 = failed,
+ 5 = interrupted by user
+ </td>
+</tr>
+<tr>
+<td>time_t</td>
+<td><code class="literal">start_time</code></td>
+<td>date/time of DCC creation</td>
+</tr>
+<tr class="oddrow">
+<td>time_t</td>
+<td><code class="literal">start_transfer</code></td>
+<td>date/time of DCC transfer start</td>
+</tr>
+<tr>
+<td>unsigned long</td>
+<td><code class="literal">addr</code></td>
+<td>IP address of remote user</td>
+</tr>
+<tr class="oddrow">
+<td>int</td>
+<td><code class="literal">port</code></td>
+<td>port used for DCC</td>
+</tr>
+<tr>
+<td>char *</td>
+<td><code class="literal">nick</code></td>
+<td>remote nick</td>
+</tr>
+<tr class="oddrow">
+<td>char *</td>
+<td><code class="literal">filename</code></td>
+<td>file name</td>
+</tr>
+<tr>
+<td>char *</td>
+<td><code class="literal">local_filename</code></td>
+<td>local file name</td>
+</tr>
+<tr class="oddrow">
+<td>int</td>
+<td><code class="literal">filename_suffix</code></td>
+<td>suffix if renaming file</td>
+</tr>
+<tr>
+<td>unsigned long</td>
+<td><code class="literal">size</code></td>
+<td>file size</td>
+</tr>
+<tr class="oddrow">
+<td>unsigned long</td>
+<td><code class="literal">pos</code></td>
+<td>position in file</td>
+</tr>
+<tr>
+<td>unsigned long</td>
+<td><code class="literal">start_resume</code></td>
+<td>start position after interruption</td>
+</tr>
+<tr class="oddrow">
+<td>unsigned long</td>
+<td><code class="literal">bytes_per_sec</code></td>
+<td>
+ number of bytes per second since transfer start
+ </td>
+</tr>
+<tr>
+<td>t_plugin_dcc_info *</td>
+<td><code class="literal">prev_dcc</code></td>
+<td>
+ pointer to previous DCC info
+ </td>
+</tr>
+<tr class="oddrow">
+<td>t_plugin_dcc_info *</td>
+<td><code class="literal">next_dcc</code></td>
+<td>
+ pointer to next DCC info
+ </td>
+</tr>
+</tbody>
+</table></div>
+<p>
+ </p>
+<p>
+ Note: result has to be free by a call to "free_dcc_info" function
+ after use.
+ </p>
+<p>
+ Examples:
+</p>
+<pre class="screen">
+t_plugin_dcc_info *dcc_info = plugin->get_dcc_info (plugin);
+for (ptr_dcc = dcc_info; ptr_dcc; ptr_dcc = ptr_dcc->next_dcc)
+{
+ plugin->print_server (plugin, "DCC type=%d, with: %s",
+ ptr_dcc->type, ptr_dcc->nick);
+}
+if (dcc_info)
+ plugin->free_dcc_info (plugin, dcc_info);
+</pre>
+<p>
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="secAPI_free_dcc_info"></a>free_dcc_info</h4></div></div></div>
+<p>
+ Prototype:
+ <span><strong class="command">
+ void free_dcc_info (t_weechat_plugin *plugin,
+ t_plugin_dcc_info *dcc_info)
+ </strong></span>
+ </p>
+<p>
+ Free memory used by a DCC list.
+ </p>
+<p>
+ Arguments:
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li><p>
+ <code class="option">plugin</code>: pointer to plugin structure
+ </p></li>
+<li><p>
+ <code class="option">dcc_info</code>: pointer to DCC list returned by
+ "get_dcc_info" function
+ </p></li>
+</ul></div>
+<p>
+ </p>
+<p>
+ Return value: none.
+ </p>
+<p>
+ Example:
+ </p>
+<pre class="screen">plugin->free_dcc_info (plugin, dcc_info);</pre>
+<p>
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="secAPI_get_server_info"></a>get_server_info</h4></div></div></div>
+<p>
+ Prototype:
+ <span><strong class="command">
+ t_plugin_server_info *get_server_info (t_weechat_plugin *plugin)
+ </strong></span>
+ </p>
+<p>
+ Return list of IRC servers (connected or not).
+ </p>
+<p>
+ Arguments:
+ </p>
+<div class="itemizedlist"><ul type="disc"><li><p>
+ <code class="option">plugin</code>: pointer to plugin structure
+ </p></li></ul></div>
+<p>
+ </p>
+<p>
+ Return value: linked list of IRC servers.
+ </p>
+<div class="informaltable"><table border="0">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th>Type</th>
+<th>Field</th>
+<th>Description</th>
+</tr></thead>
+<tbody>
+<tr>
+<td>char *</td>
+<td><code class="literal">name</code></td>
+<td>server internal name</td>
+</tr>
+<tr class="oddrow">
+<td>int</td>
+<td><code class="literal">autoconnect</code></td>
+<td>1 if autoconnect at start-up, 0 otherwise</td>
+</tr>
+<tr>
+<td>int</td>
+<td><code class="literal">autoreconnect</code></td>
+<td>
+ 1 if autoreconnect when disconnected,
+ 0 otherwise
+ </td>
+</tr>
+<tr class="oddrow">
+<td>int</td>
+<td><code class="literal">autoreconnect_delay</code></td>
+<td>delay before trying again connection</td>
+</tr>
+<tr>
+<td>int</td>
+<td><code class="literal">command_line</code></td>
+<td>
+ 1 if server was on command line (so it is temporary),
+ 0 otherwise
+ </td>
+</tr>
+<tr class="oddrow">
+<td>char *</td>
+<td><code class="literal">address</code></td>
+<td>server address (host or IP)</td>
+</tr>
+<tr>
+<td>int</td>
+<td><code class="literal">port</code></td>
+<td>port</td>
+</tr>
+<tr class="oddrow">
+<td>int</td>
+<td><code class="literal">ipv6</code></td>
+<td>IPv6 connection</td>
+</tr>
+<tr>
+<td>int</td>
+<td><code class="literal">ssl</code></td>
+<td>SSL connection</td>
+</tr>
+<tr class="oddrow">
+<td>char *</td>
+<td><code class="literal">password</code></td>
+<td>server password</td>
+</tr>
+<tr>
+<td>char *</td>
+<td><code class="literal">nick1</code></td>
+<td>first nickname</td>
+</tr>
+<tr class="oddrow">
+<td>char *</td>
+<td><code class="literal">nick2</code></td>
+<td>alternate nickname</td>
+</tr>
+<tr>
+<td>char *</td>
+<td><code class="literal">nick3</code></td>
+<td>second alternate nickname</td>
+</tr>
+<tr class="oddrow">
+<td>char *</td>
+<td><code class="literal">username</code></td>
+<td>user name</td>
+</tr>
+<tr>
+<td>char *</td>
+<td><code class="literal">real name</code></td>
+<td>real name</td>
+</tr>
+<tr class="oddrow">
+<td>char *</td>
+<td><code class="literal">command</code></td>
+<td>command run once connected</td>
+</tr>
+<tr>
+<td>int</td>
+<td><code class="literal">command_delay</code></td>
+<td>delay after execution of command</td>
+</tr>
+<tr class="oddrow">
+<td>char *</td>
+<td><code class="literal">autojoin</code></td>
+<td>channels joined automatically</td>
+</tr>
+<tr>
+<td>int</td>
+<td><code class="literal">autorejoin</code></td>
+<td>
+ 1 if channels are rejoined when kicked,
+ 0 otherwise
+ </td>
+</tr>
+<tr class="oddrow">
+<td>char *</td>
+<td><code class="literal">notify_levels</code></td>
+<td>channels notify levels</td>
+</tr>
+<tr>
+<td>char *</td>
+<td><code class="literal">charset_decode_iso</code></td>
+<td>channels charsets for decoding ISO</td>
+</tr>
+<tr class="oddrow">
+<td>char *</td>
+<td><code class="literal">charset_decode_utf</code></td>
+<td>channels charsets for decoding UTF</td>
+</tr>
+<tr>
+<td>char *</td>
+<td><code class="literal">charset_encode</code></td>
+<td>channels charsets for encoding messages</td>
+</tr>
+<tr class="oddrow">
+<td>int</td>
+<td><code class="literal">is_connected</code></td>
+<td>1 if connected to server, 0 otherwise</td>
+</tr>
+<tr>
+<td>int</td>
+<td><code class="literal">ssl_connected</code></td>
+<td>1 if connected with SSL, 0 otherwise</td>
+</tr>
+<tr class="oddrow">
+<td>char *</td>
+<td><code class="literal">nick</code></td>
+<td>current nickname</td>
+</tr>
+<tr>
+<td>int</td>
+<td><code class="literal">is_away</code></td>
+<td>1 if away, 0 otherwise</td>
+</tr>
+<tr class="oddrow">
+<td>time_t</td>
+<td><code class="literal">away_time</code></td>
+<td>time when user is marking as away</td>
+</tr>
+<tr>
+<td>int</td>
+<td><code class="literal">lag</code></td>
+<td>lag (in milliseconds)</td>
+</tr>
+<tr class="oddrow">
+<td>t_plugin_server_info *</td>
+<td><code class="literal">prev_server</code></td>
+<td>pointer to previous server info</td>
+</tr>
+<tr>
+<td>t_plugin_server_info *</td>
+<td><code class="literal">next_server</code></td>
+<td>pointer to next server info</td>
+</tr>
+</tbody>
+</table></div>
+<p>
+ </p>
+<p>
+ Note: result has to be free by a call to "free_server_info"
+ function after use.
+ </p>
+<p>
+ Example:
+</p>
+<pre class="screen">
+t_plugin_server_info *server_info, *ptr_server_info;
+server_info = plugin->get_server_info (plugin);
+if (server_info)
+{
+ for (ptr_server_info = server_info; ptr_server_info;
+ ptr_server_info = ptr_server_info->next_server)
+ {
+ plugin->print (plugin, NULL, NULL,
+ "server: %s, address: %s, port: %d %s",
+ ptr_server_info->name,
+ ptr_server_info->address,
+ ptr_server_info->port,
+ (ptr_server_info->is_connected) ? "(connected)" : "");
+ }
+ plugin->free_server_info (plugin, server_info);
+}
+</pre>
+<p>
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="secAPI_free_server_info"></a>free_server_info</h4></div></div></div>
+<p>
+ Prototype:
+ <span><strong class="command">
+ void free_server_info (t_weechat_plugin *plugin,
+ t_plugin_server_info *server_info)
+ </strong></span>
+ </p>
+<p>
+ Free memory used by server info list.
+ </p>
+<p>
+ Arguments:
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li><p>
+ <code class="option">plugin</code>: pointer to plugin structure
+ </p></li>
+<li><p>
+ <code class="option">server_info</code>: pointer to server list
+ returned by "get_server_info" function
+ </p></li>
+</ul></div>
+<p>
+ </p>
+<p>
+ Return value: none.
+ </p>
+<p>
+ Example:
+ </p>
+<pre class="screen">plugin->free_server_info (plugin, server_info);</pre>
+<p>
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="secAPI_get_channel_info"></a>get_channel_info</h4></div></div></div>
+<p>
+ Prototype:
+ <span><strong class="command">
+ t_plugin_channel_info *get_channel_info (t_weechat_plugin *plugin,
+ char *server)
+ </strong></span>
+ </p>
+<p>
+ Return list of IRC channels for a server.
+ </p>
+<p>
+ Arguments:
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li><p>
+ <code class="option">plugin</code>: pointer to plugin structure
+ </p></li>
+<li><p>
+ <code class="option">server</code>: internal server name
+ </p></li>
+</ul></div>
+<p>
+ </p>
+<p>
+ Return value: linked list of IRC channels for server.
+ </p>
+<div class="informaltable"><table border="0">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th>Type</th>
+<th>Field</th>
+<th>Description</th>
+</tr></thead>
+<tbody>
+<tr>
+<td>int</td>
+<td><code class="literal">type</code></td>
+<td>0 for a channel, 1 for a private</td>
+</tr>
+<tr class="oddrow">
+<td>char *</td>
+<td><code class="literal">name</code></td>
+<td>name of channel</td>
+</tr>
+<tr>
+<td>char *</td>
+<td><code class="literal">topic</code></td>
+<td>topic of channel</td>
+</tr>
+<tr class="oddrow">
+<td>char *</td>
+<td><code class="literal">modes</code></td>
+<td>channel modes</td>
+</tr>
+<tr>
+<td>int</td>
+<td><code class="literal">limit</code></td>
+<td>user limit</td>
+</tr>
+<tr class="oddrow">
+<td>char *</td>
+<td><code class="literal">key</code></td>
+<td>channel key</td>
+</tr>
+<tr>
+<td>int</td>
+<td><code class="literal">nicks_count</code></td>
+<td>number of nicks on channel</td>
+</tr>
+<tr class="oddrow">
+<td>t_plugin_channel_info *</td>
+<td><code class="literal">prev_channel</code></td>
+<td>pointer to previous channel info</td>
+</tr>
+<tr>
+<td>t_plugin_channel_info *</td>
+<td><code class="literal">next_channel</code></td>
+<td>pointer to next channel info</td>
+</tr>
+</tbody>
+</table></div>
+<p>
+ </p>
+<p>
+ Note: result has to be free by a call to "free_channel_info"
+ function after use.
+ </p>
+<p>
+ Example:
+</p>
+<pre class="screen">
+t_plugin_channel_info *channel_info, *ptr_chan_info;
+channel_info = plugin->get_channel_info (plugin, "freenode");
+if (channel_info)
+{
+ for (ptr_chan_info = channel_info; ptr_chan_info;
+ ptr_chan_info = ptr_chan_info->next_channel)
+ {
+ plugin->print (plugin, NULL, NULL,
+ " %s (type %d)",
+ ptr_chan_info->name,
+ ptr_chan_info->type);
+ }
+ plugin->free_channel_info (plugin, channel_info);
+}
+</pre>
+<p>
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="secAPI_free_channel_info"></a>free_channel_info</h4></div></div></div>
+<p>
+ Prototype:
+ <span><strong class="command">
+ void free_channel_info (t_weechat_plugin *plugin,
+ t_plugin_channel_info *channel_info)
+ </strong></span>
+ </p>
+<p>
+ Free memory used by channel info list.
+ </p>
+<p>
+ Arguments:
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li><p>
+ <code class="option">plugin</code>: pointer to plugin structure
+ </p></li>
+<li><p>
+ <code class="option">channel_info</code>: pointer to channel info list
+ returned by "get_channel_info" function
+ </p></li>
+</ul></div>
+<p>
+ </p>
+<p>
+ Return value: none.
+ </p>
+<p>
+ Example:
+ </p>
+<pre class="screen">plugin->free_channel_info (plugin, channel_info);</pre>
+<p>
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="secAPI_get_nick_info"></a>get_nick_info</h4></div></div></div>
+<p>
+ Prototype:
+ <span><strong class="command">
+ t_plugin_nick_info *get_nick_info (t_weechat_plugin *plugin,
+ char *server, char *channel)
+ </strong></span>
+ </p>
+<p>
+ Return list of nicks for a channel.
+ </p>
+<p>
+ Arguments:
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li><p>
+ <code class="option">plugin</code>: pointer to plugin structure
+ </p></li>
+<li><p>
+ <code class="option">server</code>: internal server name
+ </p></li>
+<li><p>
+ <code class="option">channel</code>: channel name
+ </p></li>
+</ul></div>
+<p>
+ </p>
+<p>
+ Return value: linked list of nicks on channel.
+ </p>
+<div class="informaltable"><table border="0">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th>Type</th>
+<th>Field</th>
+<th>Description</th>
+</tr></thead>
+<tbody>
+<tr>
+<td>char *</td>
+<td><code class="literal">nick</code></td>
+<td>nick name</td>
+</tr>
+<tr class="oddrow">
+<td>char *</td>
+<td><code class="literal">host</code></td>
+<td>hostname</td>
+</tr>
+<tr>
+<td>int</td>
+<td><code class="literal">flags</code></td>
+<td>
+ nick flags, binary "or" between values (1 = channel
+ owner, 2 = channel admin, 4 = op, 8 = halfop,
+ 16 = voice, 32 = away)
+ </td>
+</tr>
+<tr class="oddrow">
+<td>t_plugin_nick_info *</td>
+<td><code class="literal">prev_nick</code></td>
+<td>pointer to previous nick info</td>
+</tr>
+<tr>
+<td>t_plugin_nick_info *</td>
+<td><code class="literal">next_nick</code></td>
+<td>pointer to next nick info</td>
+</tr>
+</tbody>
+</table></div>
+<p>
+ </p>
+<p>
+ Note: result has to be free by a call to "free_nick_info"
+ function after use.
+ </p>
+<p>
+ Example:
+</p>
+<pre class="screen">
+t_plugin_nick_info *nick_info, *ptr_nick_info;
+nick_info = plugin->get_nick_info (plugin, "freenode", "#weechat");
+if (nick_info)
+{
+ for (ptr_nick_info = nick_info; ptr_nick_info;
+ ptr_nick_info = ptr_nick_info->next_nick)
+ {
+ plugin->print (plugin, NULL, NULL,
+ " %s (flags: %d)",
+ ptr_nick_info->nick,
+ ptr_nick_info->flags);
+ }
+ plugin->free_nick_info (plugin, nick_info);
+}
+</pre>
+<p>
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="secAPI_free_nick_info"></a>free_nick_info</h4></div></div></div>
+<p>
+ Prototype:
+ <span><strong class="command">
+ void free_nick_info (t_weechat_plugin *plugin,
+ t_plugin_nick_info *nick_info)
+ </strong></span>
+ </p>
+<p>
+ Free memory used by nick info list.
+ </p>
+<p>
+ Arguments:
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li><p>
+ <code class="option">plugin</code>: pointer to plugin structure
+ </p></li>
+<li><p>
+ <code class="option">nick_info</code>: pointer to nick info list
+ returned by "get_nick_info" function
+ </p></li>
+</ul></div>
+<p>
+ </p>
+<p>
+ Return value: none.
+ </p>
+<p>
+ Example:
+ </p>
+<pre class="screen">plugin->free_nick_info (plugin, nick_info);</pre>
+<p>
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="secAPI_get_config"></a>get_config</h4></div></div></div>
+<p>
+ Prototype:
+ <span><strong class="command">
+ char *get_config (t_weechat_plugin *plugin, char *option)
+ </strong></span>
+ </p>
+<p>
+ Return value of a WeeChat config option.
+ </p>
+<p>
+ Arguments:
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li><p>
+ <code class="option">plugin</code>: pointer to plugin structure
+ </p></li>
+<li><p>
+ <code class="option">option</code>: name of option to read
+ </p></li>
+</ul></div>
+<p>
+ </p>
+<p>
+ Return value: option value, NULL if not found.
+ </p>
+<p>
+ Note: result has to be free by a call to "free" function after
+ use.
+ </p>
+<p>
+ Examples:
+</p>
+<pre class="screen">
+char *value1 = plugin->get_config (plugin, "look_set_title");
+char *value2 = plugin->get_config (plugin, "freenode.server_autojoin");
+</pre>
+<p>
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="secAPI_set_config"></a>set_config</h4></div></div></div>
+<p>
+ Prototype:
+ <span><strong class="command">
+ int set_config (t_weechat_plugin *plugin,
+ char *option, char *value)
+ </strong></span>
+ </p>
+<p>
+ Update value of a WeeChat config option.
+ </p>
+<p>
+ Arguments:
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li><p>
+ <code class="option">plugin</code>: pointer to plugin structure
+ </p></li>
+<li><p>
+ <code class="option">option</code>: name of option to update
+ </p></li>
+<li><p>
+ <code class="option">value</code>: new value for option
+ </p></li>
+</ul></div>
+<p>
+ </p>
+<p>
+ Return value: 1 if option was successfully updated, 0 if an
+ error occurred.
+ </p>
+<p>
+ Example:
+</p>
+<pre class="screen">
+plugin->set_config (plugin, "look_nicklist", "off");
+</pre>
+<p>
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="secAPI_get_plugin_config"></a>get_plugin_config</h4></div></div></div>
+<p>
+ Prototype:
+ <span><strong class="command">
+ char *get_plugin_config (t_weechat_plugin *plugin, char *option)
+ </strong></span>
+ </p>
+<p>
+ Return value of a plugin option.
+ Option is read from file "<code class="literal">~/.weechat/plugins.rc</code>"
+ and is like: "<code class="literal">plugin.option=value</code>"
+ (note: plugin name is automatically added).
+ </p>
+<p>
+ Arguments:
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li><p>
+ <code class="option">plugin</code>: pointer to plugin structure
+ </p></li>
+<li><p>
+ <code class="option">option</code>: name of option to read
+ </p></li>
+</ul></div>
+<p>
+ </p>
+<p>
+ Return value: option value, NULL if not found.
+ </p>
+<p>
+ Note: result has to be free by a call to "free" function after
+ use.
+ </p>
+<p>
+ Example:
+</p>
+<pre class="screen">
+char *value = plugin->get_plugin_config (plugin, "my_var");
+</pre>
+<p>
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="secAPI_set_plugin_config"></a>set_plugin_config</h4></div></div></div>
+<p>
+ Prototype:
+ <span><strong class="command">
+ int set_plugin_config (t_weechat_plugin *plugin,
+ char *option, char *value)
+ </strong></span>
+ </p>
+<p>
+ Update value of a plugin option.
+ Option is written in file "<code class="literal">~/.weechat/plugins.rc</code>"
+ and is like: "<code class="literal">plugin.option=value</code>"
+ (note: plugin name is automatically added).
+ </p>
+<p>
+ Arguments:
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li><p>
+ <code class="option">plugin</code>: pointer to plugin structure
+ </p></li>
+<li><p>
+ <code class="option">option</code>: name of option to update
+ </p></li>
+<li><p>
+ <code class="option">value</code>: new value for option
+ </p></li>
+</ul></div>
+<p>
+ </p>
+<p>
+ Return value: 1 if option was successfully updated, 0 if an
+ error occurred.
+ </p>
+<p>
+ Example:
+</p>
+<pre class="screen">
+plugin->set_plugin_config (plugin, "my_var", "value");
+</pre>
+<p>
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="secAPI_get_irc_color"></a>get_irc_color</h4></div></div></div>
+<p>
+ Prototype:
+ <span><strong class="command">
+ int get_irc_color (t_weechat_plugin *plugin,
+ char *color_name)
+ </strong></span>
+ </p>
+<p>
+ Get IRC color index with name.
+ </p>
+<p>
+ Arguments:
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li><p>
+ <code class="option">plugin</code>: pointer to plugin structure
+ </p></li>
+<li>
+<p>
+ <code class="option">color_name</code>: color name
+ Allowed colors are:
+ </p>
+<div class="informaltable"><table border="0">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th>Color name</th>
+<th>Value</th>
+</tr></thead>
+<tbody>
+<tr>
+<td>white</td>
+<td>0</td>
+</tr>
+<tr class="oddrow">
+<td>black</td>
+<td>1</td>
+</tr>
+<tr>
+<td>blue</td>
+<td>2</td>
+</tr>
+<tr class="oddrow">
+<td>green</td>
+<td>3</td>
+</tr>
+<tr>
+<td>lightred</td>
+<td>4</td>
+</tr>
+<tr class="oddrow">
+<td>red</td>
+<td>5</td>
+</tr>
+<tr>
+<td>magenta</td>
+<td>6</td>
+</tr>
+<tr class="oddrow">
+<td>brown</td>
+<td>7</td>
+</tr>
+<tr>
+<td>yellow</td>
+<td>8</td>
+</tr>
+<tr class="oddrow">
+<td>lightgreen</td>
+<td>9</td>
+</tr>
+<tr>
+<td>cyan</td>
+<td>10</td>
+</tr>
+<tr class="oddrow">
+<td>lightcyan</td>
+<td>11</td>
+</tr>
+<tr>
+<td>lightblue</td>
+<td>12</td>
+</tr>
+<tr class="oddrow">
+<td>lightmagenta</td>
+<td>13</td>
+</tr>
+<tr>
+<td>gray</td>
+<td>14</td>
+</tr>
+<tr class="oddrow">
+<td>lightgray</td>
+<td>15</td>
+</tr>
+</tbody>
+</table></div>
+<p>
+ </p>
+</li>
+</ul></div>
+<p>
+ </p>
+<p>
+ Return value: IRC color index, -1 if color is not found.
+ </p>
+<p>
+ Example:
+</p>
+<pre class="screen">
+int color_blue = plugin->get_irc_color (plugin, "blue"); /* return 2 */
+</pre>
+<p>
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="secAPI_input_color"></a>input_color</h4></div></div></div>
+<p>
+ Prototype:
+ <span><strong class="command">
+ void input_color (t_weechat_plugin *plugin,
+ int color, int start, int length)
+ </strong></span>
+ </p>
+<p>
+ Add color in input buffer.
+ </p>
+<p>
+ Arguments:
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li><p>
+ <code class="option">plugin</code>: pointer to plugin structure
+ </p></li>
+<li><p>
+ <code class="option">color</code>: color for text (if < 0, then input
+ buffer is refresh, and there's no change in input buffer
+ content)
+ </p></li>
+<li><p>
+ <code class="option">start</code>: start position for color (if < 0,
+ then mask is reinitialized)
+ </p></li>
+<li><p>
+ <code class="option">length</code>: length for color (if <= 0,
+ then mask is reinitialized)
+ </p></li>
+</ul></div>
+<p>
+ </p>
+<p>
+ Return value: none.
+ </p>
+<p>
+ Example:
+</p>
+<pre class="screen">
+plugin->input_color (plugin, plugin->get_irc_color (plugin, "blue"), 10, 5);
+</pre>
+<p>
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="secAPI_get_window_info"></a>get_window_info</h4></div></div></div>
+<p>
+ Prototype:
+ <span><strong class="command">
+ t_plugin_window_info *get_window_info (t_weechat_plugin *plugin)
+ </strong></span>
+ </p>
+<p>
+ Return list of WeeChat windows.
+ </p>
+<p>
+ Arguments:
+ </p>
+<div class="itemizedlist"><ul type="disc"><li><p>
+ <code class="option">plugin</code>: pointer to plugin structure
+ </p></li></ul></div>
+<p>
+ </p>
+<p>
+ Return value: linked list of WeeChat windows.
+ </p>
+<div class="informaltable"><table border="0">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th>Type</th>
+<th>Field</th>
+<th>Description</th>
+</tr></thead>
+<tbody>
+<tr>
+<td>int</td>
+<td><code class="literal">win_x</code></td>
+<td>horizontal position of window</td>
+</tr>
+<tr class="oddrow">
+<td>int</td>
+<td><code class="literal">win_y</code></td>
+<td>vertical position of window</td>
+</tr>
+<tr>
+<td>int</td>
+<td><code class="literal">win_width</code></td>
+<td>width of window</td>
+</tr>
+<tr class="oddrow">
+<td>int</td>
+<td><code class="literal">win_height</code></td>
+<td>height of window</td>
+</tr>
+<tr>
+<td>int</td>
+<td><code class="literal">win_width_pct</code></td>
+<td>width % (compared to parent window)</td>
+</tr>
+<tr class="oddrow">
+<td>int</td>
+<td><code class="literal">win_height_pct</code></td>
+<td>height % (compared to parent window)</td>
+</tr>
+<tr>
+<td>int</td>
+<td><code class="literal">num_buffer</code></td>
+<td>number of displayed buffer</td>
+</tr>
+<tr class="oddrow">
+<td>t_plugin_window_info *</td>
+<td><code class="literal">prev_window</code></td>
+<td>pointer to previous window info</td>
+</tr>
+<tr>
+<td>t_plugin_window_info *</td>
+<td><code class="literal">next_window</code></td>
+<td>pointer to next window info</td>
+</tr>
+</tbody>
+</table></div>
+<p>
+ </p>
+<p>
+ Note: result has to be free by a call to "free_window_info"
+ function after use.
+ </p>
+<p>
+ Example:
+</p>
+<pre class="screen">
+t_plugin_window_info *window_info, *ptr_window;
+
+window_info = plugin->get_window_info (plugin);
+if (window_info)
+{
+ for (ptr_window = window_info; ptr_window; ptr_window = ptr_window->next_window)
+ {
+ plugin->print (plugin, NULL, NULL, "--- window info ---");
+ plugin->print (plugin, NULL, NULL, "(%d,%d), size: %dx%d, %%size: %d%%x%d%%",
+ ptr_window->win_x, ptr_window->win_y,
+ ptr_window->win_width, ptr_window->win_height,
+ ptr_window->win_width_pct, ptr_window->win_height_pct);
+ plugin->print (plugin, NULL, NULL, "num_buffer: %d", ptr_window->num_buffer);
+ }
+ plugin->free_window_info (plugin, window_info);
+}
+else
+ plugin->print (plugin, NULL, NULL, "no window info!");
+</pre>
+<p>
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="secAPI_free_window_info"></a>free_window_info</h4></div></div></div>
+<p>
+ Prototype:
+ <span><strong class="command">
+ void free_window_info (t_weechat_plugin *plugin,
+ t_plugin_window_info *window_info)
+ </strong></span>
+ </p>
+<p>
+ Free memory used by window info list.
+ </p>
+<p>
+ Arguments:
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li><p>
+ <code class="option">plugin</code>: pointer to plugin structure
+ </p></li>
+<li><p>
+ <code class="option">window_info</code>: pointer to window info list
+ returned by "get_window_info" function
+ </p></li>
+</ul></div>
+<p>
+ </p>
+<p>
+ Return value: none.
+ </p>
+<p>
+ Example:
+ </p>
+<pre class="screen">plugin->free_window_info (plugin, window_info);</pre>
+<p>
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="secAPI_get_buffer_info"></a>get_buffer_info</h4></div></div></div>
+<p>
+ Prototype:
+ <span><strong class="command">
+ t_plugin_buffer_info *get_buffer_info (t_weechat_plugin *plugin)
+ </strong></span>
+ </p>
+<p>
+ Return list of WeeChat buffers.
+ </p>
+<p>
+ Arguments:
+ </p>
+<div class="itemizedlist"><ul type="disc"><li><p>
+ <code class="option">plugin</code>: pointer to plugin structure
+ </p></li></ul></div>
+<p>
+ </p>
+<p>
+ Return value: linked list of WeeChat buffers.
+ </p>
+<div class="informaltable"><table border="0">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th>Type</th>
+<th>Field</th>
+<th>Description</th>
+</tr></thead>
+<tbody>
+<tr>
+<td>int</td>
+<td><code class="literal">type</code></td>
+<td>buffer type: 0=standard, 1=dcc, 2=raw IRC data</td>
+</tr>
+<tr class="oddrow">
+<td>int</td>
+<td><code class="literal">number</code></td>
+<td>buffer number</td>
+</tr>
+<tr>
+<td>int</td>
+<td><code class="literal">num_displayed</code></td>
+<td>number of windows displaying buffer</td>
+</tr>
+<tr class="oddrow">
+<td>char *</td>
+<td><code class="literal">server_name</code></td>
+<td>server name for buffer (may be NULL)</td>
+</tr>
+<tr>
+<td>char *</td>
+<td><code class="literal">channel_name</code></td>
+<td>channel name for buffer (may be NULL)</td>
+</tr>
+<tr class="oddrow">
+<td>int</td>
+<td><code class="literal">notify_level</code></td>
+<td>notify level for buffer</td>
+</tr>
+<tr>
+<td>char *</td>
+<td><code class="literal">log_filename</code></td>
+<td>log filename (NULL means not logging)</td>
+</tr>
+<tr class="oddrow">
+<td>t_plugin_buffer_info *</td>
+<td><code class="literal">prev_buffer</code></td>
+<td>pointer to previous buffer info</td>
+</tr>
+<tr>
+<td>t_plugin_buffer_info *</td>
+<td><code class="literal">next_buffer</code></td>
+<td>pointer to next buffer info</td>
+</tr>
+</tbody>
+</table></div>
+<p>
+ </p>
+<p>
+ Note: result has to be free by a call to "free_buffer_info"
+ function after use.
+ </p>
+<p>
+ Example:
+</p>
+<pre class="screen">
+t_plugin_buffer_info *buffer_info, *ptr_buffer;
+
+buffer_info = plugin->get_buffer_info (plugin);
+if (buffer_info)
+{
+ for (ptr_buffer = buffer_info; ptr_buffer; ptr_buffer = ptr_buffer->next_buffer)
+ {
+ plugin->print (plugin, NULL, NULL, "--- buffer info ---");
+ plugin->print (plugin, NULL, NULL, "type: %d", ptr_buffer->type);
+ plugin->print (plugin, NULL, NULL, "number: %d", ptr_buffer->number);
+ plugin->print (plugin, NULL, NULL, "num_displayed: %d", ptr_buffer->num_displayed);
+ plugin->print (plugin, NULL, NULL, "server: %s", ptr_buffer->server_name);
+ plugin->print (plugin, NULL, NULL, "channel: %s", ptr_buffer->channel_name);
+ plugin->print (plugin, NULL, NULL, "notify level: %d", ptr_buffer->notify_level);
+ plugin->print (plugin, NULL, NULL, "log filename: %s", ptr_buffer->log_filename);
+ }
+ plugin->free_buffer_info (plugin, buffer_info);
+}
+else
+ plugin->print (plugin, NULL, NULL, "no buffer info!");
+</pre>
+<p>
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="secAPI_free_buffer_info"></a>free_buffer_info</h4></div></div></div>
+<p>
+ Prototype:
+ <span><strong class="command">
+ void free_buffer_info (t_weechat_plugin *plugin,
+ t_plugin_buffer_info *buffer_info)
+ </strong></span>
+ </p>
+<p>
+ Free memory used by buffer info list.
+ </p>
+<p>
+ Arguments:
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li><p>
+ <code class="option">plugin</code>: pointer to plugin structure
+ </p></li>
+<li><p>
+ <code class="option">buffer_info</code>: pointer to buffer info list
+ returned by "get_buffer_info" function
+ </p></li>
+</ul></div>
+<p>
+ </p>
+<p>
+ Return value: none.
+ </p>
+<p>
+ Example:
+ </p>
+<pre class="screen">plugin->free_buffer_info (plugin, buffer_info);</pre>
+<p>
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="secAPI_get_buffer_data"></a>get_buffer_data</h4></div></div></div>
+<p>
+ Prototype:
+ <span><strong class="command">
+ t_plugin_buffer_data *get_buffer_info (t_weechat_plugin *plugin,
+ char *server, char *channel)
+ </strong></span>
+ </p>
+<p>
+ Return content of buffer.
+ </p>
+<p>
+ Arguments:
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li><p>
+ <code class="option">plugin</code>: pointer to plugin structure
+ </p></li>
+<li><p>
+ <code class="option">server</code>: internal name of server
+ </p></li>
+<li><p>
+ <code class="option">channel</code>: channel name
+ </p></li>
+</ul></div>
+<p>
+ </p>
+<p>
+ Return value: buffer content (linked list of lines).
+ </p>
+<div class="informaltable"><table border="0">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th>Type</th>
+<th>Field</th>
+<th>Description</th>
+</tr></thead>
+<tbody>
+<tr>
+<td>char *</td>
+<td><code class="literal">nick</code></td>
+<td>nick</td>
+</tr>
+<tr class="oddrow">
+<td>char *</td>
+<td><code class="literal">data</code></td>
+<td>line content (color codes are removed)</td>
+</tr>
+<tr>
+<td>t_plugin_buffer_line *</td>
+<td><code class="literal">prev_line</code></td>
+<td>pointer to previous line</td>
+</tr>
+<tr class="oddrow">
+<td>t_plugin_buffer_line *</td>
+<td><code class="literal">next_line</code></td>
+<td>pointer to next line</td>
+</tr>
+</tbody>
+</table></div>
+<p>
+ </p>
+<p>
+ Note: result has to be free by a call to "free_buffer_data"
+ function after use.
+ </p>
+<p>
+ Example:
+</p>
+<pre class="screen">
+t_plugin_buffer_line *buffer_line, *ptr_line;
+
+buffer_line = plugin->get_buffer_data (plugin);
+if (buffer_line)
+{
+ for (ptr_line = buffer_line; ptr_line; ptr_line = ptr_line->next_line)
+ {
+ plugin->print (plugin, NULL, NULL, "nick: %s, data: %s", ptr_line->nick, ptr_line->data);
+ }
+ plugin->free_buffer_data (plugin, buffer_line);
+}
+</pre>
+<p>
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="secAPI_free_buffer_data"></a>free_buffer_data</h4></div></div></div>
+<p>
+ Prototype:
+ <span><strong class="command">
+ void free_buffer_data (t_weechat_plugin *plugin,
+ t_plugin_buffer_line *buffer_line)
+ </strong></span>
+ </p>
+<p>
+ Free memory used by buffer line list.
+ </p>
+<p>
+ Arguments:
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li><p>
+ <code class="option">plugin</code>: pointer to plugin structure
+ </p></li>
+<li><p>
+ <code class="option">buffer_line</code>: pointer to buffer line list
+ returned by "get_buffer_data" function
+ </p></li>
+</ul></div>
+<p>
+ </p>
+<p>
+ Return value: none.
+ </p>
+<p>
+ Example:
+ </p>
+<pre class="screen">plugin->free_buffer_data (plugin, buffer_line);</pre>
+<p>
+ </p>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="secCompilePlugin"></a>Compile plugin</h3></div></div></div>
+<p>
+ Compile does not need WeeChat sources, only file
+ "<code class="literal">weechat-plugin.h</code>".
+ </p>
+<p>
+ To compile a plugin which has one file "toto.c" (under GNU/Linux):
+</p>
+<pre class="screen">
+<code class="prompt">$ </code><strong class="userinput"><code>gcc -fPIC -Wall -c toto.c</code></strong>
+<code class="prompt">$ </code><strong class="userinput"><code>gcc -shared -fPIC -o libtoto.so toto.o</code></strong>
+</pre>
+<p>
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="secLoadPlugin"></a>Load plugin into WeeChat</h3></div></div></div>
+<p>
+ Copy "libtoto.so" file into system plugins directory (for example
+ "<code class="literal">/usr/local/lib/weechat/plugins</code>") or into
+ user's plugins directory (for example
+ "<code class="literal">/home/xxxxx/.weechat/plugins</code>").
+ </p>
+<p>
+ Under WeeChat:
+ </p>
+<pre class="screen"><strong class="userinput"><code>/plugin load toto</code></strong></pre>
+<p>
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="secPluginExample"></a>Plugin example</h3></div></div></div>
+<p>
+ Full example of plugin, which adds a /double command, which displays
+ two times arguments on current channel (ok that's not very useful, but
+ that's just an example!):
+</p>
+<pre class="screen">
+#include <stdlib.h>
+
+#include "weechat-plugin.h"
+
+char plugin_name[] = "Double";
+char plugin_version[] = "0.1";
+char plugin_description[] = "Test plugin for WeeChat";
+
+/* "/double" command manager */
+
+int double_cmd (t_weechat_plugin *plugin, int argc, char **argv,
+ char *handler_args, void *handler_pointer)
+{
+ if (argv[2] && (argv[2][0] != '/'))
+ {
+ plugin->exec_command (plugin, NULL, NULL, argv[2]);
+ plugin->exec_command (plugin, NULL, NULL, argv[2]);
+ }
+ return PLUGIN_RC_OK;
+}
+
+int weechat_plugin_init (t_weechat_plugin *plugin)
+{
+ plugin->cmd_handler_add (plugin, "double",
+ "Display two times a message",
+ "msg",
+ "msg: message to display two times",
+ NULL,
+ &double_cmd,
+ NULL, NULL);
+ return PLUGIN_RC_OK;
+}
+
+void weechat_plugin_end (t_weechat_plugin *plugin)
+{
+ /* nothing done here */
+}
+</pre>
+<p>
+ </p>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="secScriptsPlugins"></a>Scripts plugins</h2></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="#secLoadUnloadScripts">Load / unload scripts</a></span></dt>
+<dt><span class="section"><a href="#secSyntaxByLanguage">Syntax by language</a></span></dt>
+<dt><span class="section"><a href="#secWeeChatScriptsAPI">WeeChat / scripts API</a></span></dt>
+</dl></div>
+<p>
+ Four plugins are provided with WeeChat to use script languages:
+ Perl, Python, Ruby and Lua.
+ </p>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="secLoadUnloadScripts"></a>Load / unload scripts</h3></div></div></div>
+<p>
+ Scripts are loaded and unloaded with <span><strong class="command">/perl</strong></span>,
+ <span><strong class="command">/python</strong></span>, <span><strong class="command">/ruby</strong></span> and
+ <span><strong class="command">/lua</strong></span> commands
+ (type <span><strong class="command">/help</strong></span> in WeeChat for help about commands).
+ </p>
+<p>
+ Examples:
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li><p>
+ Load a Perl script:
+ <span><strong class="command"><strong class="userinput"><code>/perl load /tmp/test.pl</code></strong></strong></span>
+ </p></li>
+<li><p>
+ List all loaded Perl scripts:
+ <span><strong class="command"><strong class="userinput"><code>/perl</code></strong></strong></span>
+ </p></li>
+<li><p>
+ Load a Python script:
+ <span><strong class="command"><strong class="userinput"><code>/python load /tmp/test.py</code></strong></strong></span>
+ </p></li>
+<li><p>
+ List all loaded Python scripts:
+ <span><strong class="command"><strong class="userinput"><code>/python</code></strong></strong></span>
+ </p></li>
+<li><p>
+ Load a Ruby script:
+ <span><strong class="command"><strong class="userinput"><code>/ruby load /tmp/test.rb</code></strong></strong></span>
+ </p></li>
+<li><p>
+ List all loaded Ruby scripts:
+ <span><strong class="command"><strong class="userinput"><code>/ruby</code></strong></strong></span>
+ </p></li>
+<li><p>
+ Load a Lua script:
+ <span><strong class="command"><strong class="userinput"><code>/lua load /tmp/test.lua</code></strong></strong></span>
+ </p></li>
+<li><p>
+ List all loaded Lua scripts:
+ <span><strong class="command"><strong class="userinput"><code>/lua</code></strong></strong></span>
+ </p></li>
+</ul></div>
+<p>
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="secSyntaxByLanguage"></a>Syntax by language</h3></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="#secScriptPerl">Perl</a></span></dt>
+<dt><span class="section"><a href="#secScriptPython">Python</a></span></dt>
+<dt><span class="section"><a href="#secScriptRuby">Ruby</a></span></dt>
+<dt><span class="section"><a href="#secScriptLua">Lua</a></span></dt>
+</dl></div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="secScriptPerl"></a>Perl</h4></div></div></div>
+<p>
+ In a WeeChat Perl script, all API functions and variables are
+ prefixed by "<code class="literal">weechat::</code>".
+ Example:
+</p>
+<pre class="screen">weechat::register("test", "1.0", "end_test", "WeeChat perl script");</pre>
+<p>
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="secScriptPython"></a>Python</h4></div></div></div>
+<p>
+ A WeeChat Python script has to start by importing weechat:
+ </p>
+<pre class="screen">import weechat</pre>
+<p>
+ </p>
+<p>
+ All API functions and variables are prefixed by
+ "<code class="literal">weechat.</code>".
+ Example:
+</p>
+<pre class="screen">weechat.register("test", "1.0", "end_test", "WeeChat python script")</pre>
+<p>
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="secScriptRuby"></a>Ruby</h4></div></div></div>
+<p>
+ In a WeeChat Ruby script, all code has to be in functions.
+ So for main code, you have to define a
+ "<code class="literal">weechat_init</code>" function, which is automatically
+ called when script is loaded by WeeChat. Example:
+</p>
+<pre class="screen">
+def weechat_init
+ Weechat.register("test", "1.0", "end_test", "WeeChat ruby script")
+ Weechat.add_command_handler("command", "my_command")
+ return Weechat::PLUGIN_RC_OK
+end
+
+def my_command(server, args)
+ Weechat.print("my command")
+ return Weechat::PLUGIN_RC_OK
+end
+</pre>
+<p>
+ </p>
+<p>
+ All API functions are prefixed by
+ "<code class="literal">Weechat.</code>" and variables by
+ "<code class="literal">Weechat::</code>".
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="secScriptLua"></a>Lua</h4></div></div></div>
+<p>
+ In a WeeChat Lua script, all API functions are prefixed by
+ "<code class="literal">weechat.</code>".
+ Variables are prefixed by "<code class="literal">weechat.</code>" and
+ suffixed by "<code class="literal">()</code>".
+ Example:
+</p>
+<pre class="screen">
+function message_handler(server, args)
+ weechat.print("I am a message handler")
+ return weechat.PLUGIN_RC_OK()
+end
+</pre>
+<p>
+ </p>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="secWeeChatScriptsAPI"></a>WeeChat / scripts API</h3></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="#secScript_register">register</a></span></dt>
+<dt><span class="section"><a href="#secScript_print">print</a></span></dt>
+<dt><span class="section"><a href="#secScript_print_infobar">print_infobar</a></span></dt>
+<dt><span class="section"><a href="#secScript_remove_infobar">remove_infobar</a></span></dt>
+<dt><span class="section"><a href="#secScript_log">log</a></span></dt>
+<dt><span class="section"><a href="#secScript_add_message_handler">add_message_handler</a></span></dt>
+<dt><span class="section"><a href="#secScript_add_command_handler">add_command_handler</a></span></dt>
+<dt><span class="section"><a href="#secScript_add_timer_handler">add_timer_handler</a></span></dt>
+<dt><span class="section"><a href="#secScript_add_keyboard_handler">add_keyboard_handler</a></span></dt>
+<dt><span class="section"><a href="#secScript_remode_handler">remove_handler</a></span></dt>
+<dt><span class="section"><a href="#secScript_remove_timer_handler">remove_timer_handler</a></span></dt>
+<dt><span class="section"><a href="#secScrip_remove_keyboard_handler">remove_keyboard_handler</a></span></dt>
+<dt><span class="section"><a href="#secScript_command">command</a></span></dt>
+<dt><span class="section"><a href="#secScript_get_info">get_info</a></span></dt>
+<dt><span class="section"><a href="#secScript_get_dcc_info">get_dcc_info</a></span></dt>
+<dt><span class="section"><a href="#secScript_get_server_info">get_server_info</a></span></dt>
+<dt><span class="section"><a href="#secScript_get_channel_info">get_channel_info</a></span></dt>
+<dt><span class="section"><a href="#secScript_get_nick_info">get_nick_info</a></span></dt>
+<dt><span class="section"><a href="#secScript_get_config">get_config</a></span></dt>
+<dt><span class="section"><a href="#secScript_set_config">set_config</a></span></dt>
+<dt><span class="section"><a href="#secScript_get_plugin_config">get_plugin_config</a></span></dt>
+<dt><span class="section"><a href="#secScript_set_plugin_config">set_plugin_config</a></span></dt>
+<dt><span class="section"><a href="#secScript_get_irc_color">get_irc_color</a></span></dt>
+<dt><span class="section"><a href="#secScript_input_color">input_color</a></span></dt>
+<dt><span class="section"><a href="#secScript_get_window_info">get_window_info</a></span></dt>
+<dt><span class="section"><a href="#secScript_get_buffer_info">get_buffer_info</a></span></dt>
+<dt><span class="section"><a href="#secScript_get_buffer_data">get_buffer_data</a></span></dt>
+</dl></div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="secScript_register"></a>register</h4></div></div></div>
+<p>
+ Perl prototype:
+ <span><strong class="command">
+ weechat::register(name, version, end_function, description);
+ </strong></span>
+ </p>
+<p>
+ Python prototype:
+ <span><strong class="command">
+ weechat.register(name, version, end_function, description)
+ </strong></span>
+ </p>
+<p>
+ Ruby prototype:
+ <span><strong class="command">
+ Weechat.register(name, version, end_function, description)
+ </strong></span>
+ </p>
+<p>
+ Lua prototype:
+ <span><strong class="command">
+ weechat.register(name, version, end_function, description)
+ </strong></span>
+ </p>
+<p>
+ This is first function to call in script.
+ All WeeChat scripts have to call this function.
+ </p>
+<p>
+ Arguments:
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li><p>
+ <code class="option">name</code>: unique name to identify script
+ (each script must have unique name)
+ </p></li>
+<li><p>
+ <code class="option">version</code>: script version
+ </p></li>
+<li><p>
+ <code class="option">end_function</code>: function called when script is
+ unloaded (optional parameter, empty string means nothing is
+ called at the end)
+ </p></li>
+<li><p>
+ <code class="option">description</code>: short description of script
+ </p></li>
+</ul></div>
+<p>
+ </p>
+<p>
+ Return value: 1 if script was registered, 0 if an error occured.
+ </p>
+<p>
+ Examples:
+</p>
+<pre class="screen">
+# perl
+weechat::register("test", "1.0", "end_test", "Test script!");
+
+# python
+weechat.register("test", "1.0", "end_test", "Test script!")
+
+# ruby
+Weechat.register("test", "1.0", "end_test", "Test script!")
+
+-- lua
+weechat.register("test", "1.0", "end_test", "Test script!")
+</pre>
+<p>
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="secScript_print"></a>print</h4></div></div></div>
+<p>
+ Perl prototype:
+ <span><strong class="command">
+ weechat::print(message, [channel, [server]])
+ </strong></span>
+ </p>
+<p>
+ Python prototype:
+ <span><strong class="command">
+ weechat.prnt(message, [channel, [server]])
+ </strong></span>
+ </p>
+<p>
+ Ruby prototype:
+ <span><strong class="command">
+ Weechat.print(message, [channel, [server]])
+ </strong></span>
+ </p>
+<p>
+ Lua prototype:
+ <span><strong class="command">
+ weechat.print(message, [channel, [server]])
+ </strong></span>
+ </p>
+<p>
+ Display a message on a WeeChat buffer, identified by server
+ and channel.
+ </p>
+<p>
+ Arguments:
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li><p>
+ <code class="option">message</code>: message
+ </p></li>
+<li><p>
+ <code class="option">channel</code>: name of channel to find buffer
+ for message display
+ </p></li>
+<li><p>
+ <code class="option">server</code>: internal name of server to find
+ buffer for message display
+ </p></li>
+</ul></div>
+<p>
+ </p>
+<p>
+ Return value: 1 if success, 0 if an error occurred.
+ </p>
+<p>
+ Examples:
+</p>
+<pre class="screen">
+# perl
+weechat::print("message");
+weechat::print("message", "#weechat");
+weechat::print("message", "#weechat", "freenode");
+
+# python
+weechat.prnt("message")
+weechat.prnt("message", "#weechat")
+weechat.prnt("message", "#weechat", "freenode")
+
+# ruby
+Weechat.print("message")
+Weechat.print("message", "#weechat")
+Weechat.print("message", "#weechat", "freenode")
+
+-- lua
+weechat.print("message")
+weechat.print("message", "#weechat")
+weechat.print("message", "#weechat", "freenode")
+</pre>
+<p>
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="secScript_print_infobar"></a>print_infobar</h4></div></div></div>
+<p>
+ Perl prototype:
+ <span><strong class="command">
+ weechat::print_infobar(time, message);
+ </strong></span>
+ </p>
+<p>
+ Python prototype:
+ <span><strong class="command">
+ weechat.print_infobar(time, message)
+ </strong></span>
+ </p>
+<p>
+ Ruby prototype:
+ <span><strong class="command">
+ Weechat.print_infobar(time, message)
+ </strong></span>
+ </p>
+<p>
+ Lua prototype:
+ <span><strong class="command">
+ weechat.print_infobar(time, message)
+ </strong></span>
+ </p>
+<p>
+ Display a message in infobar for a specified time.
+ </p>
+<p>
+ Arguments:
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li><p>
+ <code class="option">time</code>: time (in seconds) for displaying
+ message (0 = never erased)
+ </p></li>
+<li><p>
+ <code class="option">message</code>: message
+ </p></li>
+</ul></div>
+<p>
+ </p>
+<p>
+ Return value: 1 if success, 0 if an error occurred.
+ </p>
+<p>
+ Examples:
+</p>
+<pre class="screen">
+# perl
+weechat::print_infobar(5, "message");
+
+# python
+weechat.print_infobar(5, "message")
+
+# ruby
+Weechat.print_infobar(5, "message")
+
+-- lua
+weechat.print_infobar(5, "message")
+</pre>
+<p>
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="secScript_remove_infobar"></a>remove_infobar</h4></div></div></div>
+<p>
+ Perl prototype:
+ <span><strong class="command">
+ weechat::remove_infobar([count]);
+ </strong></span>
+ </p>
+<p>
+ Python prototype:
+ <span><strong class="command">
+ weechat.remove_infobar([count])
+ </strong></span>
+ </p>
+<p>
+ Ruby prototype:
+ <span><strong class="command">
+ Weechat.remove_infobar([count])
+ </strong></span>
+ </p>
+<p>
+ Lua prototype:
+ <span><strong class="command">
+ weechat.remove_infobar([count])
+ </strong></span>
+ </p>
+<p>
+ Remove one or more messages in infobar stack.
+ </p>
+<p>
+ Arguments:
+ </p>
+<div class="itemizedlist"><ul type="disc"><li><p>
+ <code class="option">count</code>: number of messages to remove
+ (if argument not given or <= 0, then all messages are
+ removed)
+ </p></li></ul></div>
+<p>
+ </p>
+<p>
+ Return value: 1 if success, 0 if an error occurred.
+ </p>
+<p>
+ Examples:
+</p>
+<pre class="screen">
+# perl
+weechat::remove_infobar(1);
+
+# python
+weechat.remove_infobar(1)
+
+# ruby
+Weechat.remove_infobar(1)
+
+-- lua
+weechat.remove_infobar(1)
+</pre>
+<p>
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="secScript_log"></a>log</h4></div></div></div>
+<p>
+ Perl prototype:
+ <span><strong class="command">
+ weechat::log(message, [channel, [server]]);
+ </strong></span>
+ </p>
+<p>
+ Python prototype:
+ <span><strong class="command">
+ weechat.log(message, [channel, [server]])
+ </strong></span>
+ </p>
+<p>
+ Ruby prototype:
+ <span><strong class="command">
+ Weechat.log(message, [channel, [server]])
+ </strong></span>
+ </p>
+<p>
+ Lua prototype:
+ <span><strong class="command">
+ weechat.log(message, [channel, [server]])
+ </strong></span>
+ </p>
+<p>
+ Write a message in log file for a server or a channel.
+ </p>
+<p>
+ Arguments:
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li><p>
+ <code class="option">message</code>: message
+ </p></li>
+<li><p>
+ <code class="option">channel</code>: name of channel to find buffer
+ for log
+ </p></li>
+<li><p>
+ <code class="option">server</code>: internal name of server to find
+ buffer for log
+ </p></li>
+</ul></div>
+<p>
+ </p>
+<p>
+ Return value: 1 if success, 0 if an error occurred.
+ </p>
+<p>
+ Examples:
+</p>
+<pre class="screen">
+# perl
+weechat::log("message", "#weechat", "freenode");
+
+# python
+weechat.log("message", "#weechat", "freenode")
+
+# ruby
+Weechat.log("message", "#weechat", "freenode")
+
+-- lua
+weechat.log("message", "#weechat", "freenode")
+</pre>
+<p>
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="secScript_add_message_handler"></a>add_message_handler</h4></div></div></div>
+<p>
+ Perl prototype:
+ <span><strong class="command">
+ weechat::add_message_handler(message, function);
+ </strong></span>
+ </p>
+<p>
+ Python prototype:
+ <span><strong class="command">
+ weechat.add_message_handler(message, function)
+ </strong></span>
+ </p>
+<p>
+ Ruby prototype:
+ <span><strong class="command">
+ Weechat.add_message_handler(message, function)
+ </strong></span>
+ </p>
+<p>
+ Lua prototype:
+ <span><strong class="command">
+ weechat.add_message_handler(message, function)
+ </strong></span>
+ </p>
+<p>
+ Add an IRC message handler, called when an IRC message is
+ received.
+ </p>
+<p>
+ Arguments:
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li><p>
+ <code class="option">message</code>: name of IRC message. To know list
+ of IRC messages, please consult <acronym class="acronym">RFC</acronym>s
+ <a href="http://www.ietf.org/rfc/rfc1459.txt" target="_top">1459</a> and
+ <a href="http://www.ietf.org/rfc/rfc2812.txt" target="_top">2812</a>.
+ Moreover you can use a special name, prefixed by "weechat_" to catch
+ special events (see <a href="#secAPI_msg_handler_add" title="msg_handler_add">the section called “msg_handler_add”</a>).
+ </p></li>
+<li><p>
+ <code class="option">function</code>: function called when message is
+ received
+ </p></li>
+</ul></div>
+<p>
+ </p>
+<p>
+ Return value: 1 if success, 0 if an error occurred.
+ </p>
+<p>
+ Examples:
+</p>
+<pre class="screen">
+# perl
+weechat::add_message_handler ("privmsg", "my_function");
+sub my_function
+{
+ weechat::print("server=$_[0]");
+ ($null, $channel, $message) = split ":",$_[1],3;
+ ($mask, $null, $channel) = split " ", $channel;
+ weechat::print("mask=$mask, channel=$channel, msg=$message");
+ return weechat::PLUGIN_RC_OK;
+}
+
+# python
+weechat.add_message_handler ("privmsg", "my_function")
+def my_function(server, args):
+ weechat.prnt("server="+server)
+ null, channel, message = string.split(args, ":", 2)
+ mask, null, channel = string.split(string.strip(channel), " ", 2)
+ weechat.prnt("mask="+mask+", canal="+channel+", message="+message)
+ return weechat.PLUGIN_RC_OK
+
+# ruby
+Weechat.add_message_handler("privmsg", "my_function")
+def my_function(server, args)
+ Weechat.print("server=#{server}, args=#{args}")
+ return Weechat::PLUGIN_RC_OK
+end
+
+-- lua
+weechat.add_message_handler ("privmsg", "my_function")
+function my_function(server, args)
+ weechat.print("server=" .. server .. ", args=" .. args)
+ return weechat.PLUGIN_RC_OK()
+end
+</pre>
+<p>
+ </p>
+<p>
+ Note: function called when message is received has to return
+ one of following values:
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li><p>
+ <code class="literal">PLUGIN_RC_KO</code>: function failed
+ </p></li>
+<li><p>
+ <code class="literal">PLUGIN_RC_OK</code>: function successfully
+ completed
+ </p></li>
+<li><p>
+ <code class="literal">PLUGIN_RC_OK_IGNORE_WEECHAT</code>: message
+ will not be sent to WeeChat
+ </p></li>
+<li><p>
+ <code class="literal">PLUGIN_RC_OK_IGNORE_PLUGINS</code>: message
+ will not be sent to other plugins
+ </p></li>
+<li><p>
+ <code class="literal">PLUGIN_RC_OK_IGNORE_ALL</code>: message
+ will not be sent to WeeChat neither other plugins
+ </p></li>
+</ul></div>
+<p>
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="secScript_add_command_handler"></a>add_command_handler</h4></div></div></div>
+<p>
+ Perl prototype:
+ <span><strong class="command">
+ weechat::add_command_handler(command, function,
+ [description, arguments, arguments_description,
+ completion_template]);
+ </strong></span>
+ </p>
+<p>
+ Python prototype:
+ <span><strong class="command">
+ weechat.add_command_handler(command, function,
+ [description, arguments, arguments_description,
+ completion_template])
+ </strong></span>
+ </p>
+<p>
+ Ruby prototype:
+ <span><strong class="command">
+ Weechat.add_command_handler(command, function,
+ [description, arguments, arguments_description,
+ completion_template])
+ </strong></span>
+ </p>
+<p>
+ Lua prototype:
+ <span><strong class="command">
+ weechat.add_command_handler(command, function,
+ [description, arguments, arguments_description,
+ completion_template])
+ </strong></span>
+ </p>
+<p>
+ Add a WeeChat command handler, called when user uses command
+ (for example /command).
+ </p>
+<p>
+ Arguments:
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li><p>
+ <code class="option">command</code>: the new command name, which
+ may be an existing command (be careful, replaced command
+ will not be available until script is unloaded)
+ </p></li>
+<li><p>
+ <code class="option">function</code>: function called when command
+ is executed
+ </p></li>
+<li><p>
+ <code class="option">arguments</code>: short description of command
+ arguments (displayed by /help command)
+ </p></li>
+<li><p>
+ <code class="option">arguments_description</code>: long description
+ of command arguments (displayed by /help command)
+ </p></li>
+<li><p>
+ <code class="option">completion_template</code>: template for
+ completion, like "<code class="literal">abc|%w def|%i</code>" which
+ means "abc" or a WeeChat command for first argument,
+ "def" or IRC command for second.
+ (see <a href="#secAPI_cmd_handler_add" title="cmd_handler_add">the section called “cmd_handler_add”</a>)
+ </p></li>
+</ul></div>
+<p>
+ </p>
+<p>
+ Return value: 1 if success, 0 if an error occurred.
+ </p>
+<p>
+ Examples:
+</p>
+<pre class="screen">
+# perl
+weechat::add_command_handler("command", "my_command");
+sub my_command
+{
+ weechat::print("server= $_[0], args: $_[1]");
+ return weechat::PLUGIN_RC_OK;
+}
+
+# python
+weechat.add_command_handler("command", "my_command")
+def my_command(server, args):
+ weechat.prnt("server="+server+", args="+args)
+ return weechat.PLUGIN_RC_OK
+
+# ruby
+Weechat.add_command_handler("command", "my_command")
+def my_command(server, args)
+ Weechat.print("server=#{server}, args=#{args}")
+ return Weechat::PLUGIN_RC_OK
+end
+
+-- lua
+weechat.add_command_handler("command", "my_command")
+def my_command(server, args)
+ weechat.print("server="..server..", args="..args)
+ return weechat.PLUGIN_RC_OK()
+end
+</pre>
+<p>
+ </p>
+<p>
+ Notes: function called when command is executed has to return
+ one of following values:
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li><p>
+ <code class="literal">PLUGIN_RC_KO</code> : function failed
+ </p></li>
+<li><p>
+ <code class="literal">PLUGIN_RC_OK</code> : function successfully
+ completed
+ </p></li>
+</ul></div>
+<p>
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="secScript_add_timer_handler"></a>add_timer_handler</h4></div></div></div>
+<p>
+ Perl prototype:
+ <span><strong class="command">
+ weechat::add_timer_handler(message, function);
+ </strong></span>
+ </p>
+<p>
+ Python prototype:
+ <span><strong class="command">
+ weechat.add_timer_handler(message, function)
+ </strong></span>
+ </p>
+<p>
+ Ruby prototype:
+ <span><strong class="command">
+ Weechat.add_timer_handler(message, function)
+ </strong></span>
+ </p>
+<p>
+ Lua prototype:
+ <span><strong class="command">
+ weechat.add_timer_handler(message, function)
+ </strong></span>
+ </p>
+<p>
+ Add a timer handler which periodically calls a function.
+ </p>
+<p>
+ Arguments:
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li><p>
+ <code class="option">interval</code>: interval (in seconds) between
+ two calls of function.
+ </p></li>
+<li><p>
+ <code class="option">function</code>: function called
+ </p></li>
+</ul></div>
+<p>
+ </p>
+<p>
+ Return value: 1 if success, 0 if an error occurred.
+ </p>
+<p>
+ Examples:
+</p>
+<pre class="screen">
+# perl
+weechat::add_timer_handler(60, "my_timer");
+sub my_timer
+{
+ weechat::print("this is timer handler");
+ return weechat::PLUGIN_RC_OK;
+}
+
+# python
+weechat.add_timer_handler(60, "my_timer")
+def my_timer():
+ weechat.prnt("this is timer handler")
+ return weechat.PLUGIN_RC_OK
+
+# ruby
+Weechat.add_timer_handler(60, "my_timer")
+def my_timer()
+ Weechat.print("this is timer handler")
+ return Weechat::PLUGIN_RC_OK
+end
+
+-- lua
+weechat.add_timer_handler(60, "my_timer")
+function my_timer()
+ weechat.print("this is timer handler)
+ return weechat.PLUGIN_RC_OK()
+end
+</pre>
+<p>
+ </p>
+<p>
+ Note: function called has to return one of following values:
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li><p>
+ <code class="literal">PLUGIN_RC_KO</code>: function failed
+ </p></li>
+<li><p>
+ <code class="literal">PLUGIN_RC_OK</code>: function successfully
+ completed
+ </p></li>
+</ul></div>
+<p>
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="secScript_add_keyboard_handler"></a>add_keyboard_handler</h4></div></div></div>
+<p>
+ Perl prototype:
+ <span><strong class="command">
+ weechat::add_keyboard_handler(message, function);
+ </strong></span>
+ </p>
+<p>
+ Python prototype:
+ <span><strong class="command">
+ weechat.add_keyboard_handler(message, function)
+ </strong></span>
+ </p>
+<p>
+ Ruby prototype:
+ <span><strong class="command">
+ Weechat.add_keyboard_handler(message, function)
+ </strong></span>
+ </p>
+<p>
+ Lua prototype:
+ <span><strong class="command">
+ weechat.add_keyboard_handler(message, function)
+ </strong></span>
+ </p>
+<p>
+ Add a keyboard handler, called for any key pressed.
+ </p>
+<p>
+ Arguments:
+ </p>
+<div class="itemizedlist"><ul type="disc"><li><p>
+ <code class="option">function</code>: function called
+ </p></li></ul></div>
+<p>
+ </p>
+<p>
+ Return value: 1 if success, 0 if an error occurred.
+ </p>
+<p>
+ Examples:
+</p>
+<pre class="screen">
+# perl
+weechat::add_keyboard_handler("my_keyboard");
+sub my_keyboard
+{
+ my $key = shift;
+ my $input_before = shift;
+ my $input_after = shift;
+ weechat::print("keyboard handler: key = '$key', "
+ ."input before = '$input_before' "
+ ."after = '$input_after'");
+ return weechat::PLUGIN_RC_OK;
+}
+
+# python
+weechat.add_keyboard_handler("my_keyboard")
+def my_keyboard(key, input_before, input_after):
+ weechat.prnt("keyboard handler: key = '%s', " \
+ "input before = '%s' after = '%s'"
+ %(key, input_before, input_after))
+ return weechat.PLUGIN_RC_OK
+
+# ruby
+Weechat.add_keyboard_handler("my_keyboard")
+def my_keyboard(server, input_before, input_after)
+ Weechat.print("keyboard handler: key = '#{key}', " \
+ "input before = '#{input_before}' " \
+ "after = '#{input_after}'")
+ return Weechat::PLUGIN_RC_OK
+end
+
+-- lua
+weechat.add_keyboard_handler("my_keyboard")
+function my_keyboard(server, input_before, input_after)
+ weechat.print("keyboard handler: key = '"..key..
+ "', input before = '"..input_before..
+ "' after = '"..input_after.."'")
+ return weechat.PLUGIN_RC_OK()
+end
+</pre>
+<p>
+ </p>
+<p>
+ Note: function called has to return one of following values:
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li><p>
+ <code class="literal">PLUGIN_RC_KO</code>: function failed
+ </p></li>
+<li><p>
+ <code class="literal">PLUGIN_RC_OK</code>: function successfully
+ completed
+ </p></li>
+</ul></div>
+<p>
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="secScript_remode_handler"></a>remove_handler</h4></div></div></div>
+<p>
+ Perl prototype:
+ <span><strong class="command">
+ weechat::remove_handler(name, function);
+ </strong></span>
+ </p>
+<p>
+ Python prototype:
+ <span><strong class="command">
+ weechat.remove_handler(name, function)
+ </strong></span>
+ </p>
+<p>
+ Ruby prototype:
+ <span><strong class="command">
+ Weechat.remove_handler(name, function)
+ </strong></span>
+ </p>
+<p>
+ Lua prototype:
+ <span><strong class="command">
+ weechat.remove_handler(name, function)
+ </strong></span>
+ </p>
+<p>
+ Remove a message or command handler.
+ </p>
+<p>
+ Arguments:
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li><p>
+ <code class="option">name</code>: name of IRC message or command
+ </p></li>
+<li><p>
+ <code class="option">function</code>: function
+ </p></li>
+</ul></div>
+<p>
+ </p>
+<p>
+ Return value: 1 if success, 0 if an error occurred.
+ </p>
+<p>
+ Examples:
+</p>
+<pre class="screen">
+# perl
+weechat::remove_handler("command", "my_command");
+
+# python
+weechat.remove_handler("command", "my_command")
+
+# ruby
+Weechat.remove_handler("command", "my_command")
+
+-- lua
+weechat.remove_handler("command", "my_command")
+</pre>
+<p>
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="secScript_remove_timer_handler"></a>remove_timer_handler</h4></div></div></div>
+<p>
+ Perl prototype:
+ <span><strong class="command">
+ weechat::remove_timer_handler(function);
+ </strong></span>
+ </p>
+<p>
+ Python prototype:
+ <span><strong class="command">
+ weechat.remove_timer_handler(function)
+ </strong></span>
+ </p>
+<p>
+ Ruby prototype:
+ <span><strong class="command">
+ Weechat.remove_timer_handler(function)
+ </strong></span>
+ </p>
+<p>
+ Lua prototype:
+ <span><strong class="command">
+ weechat.remove_timer_handler(function)
+ </strong></span>
+ </p>
+<p>
+ Remove a timer handler.
+ </p>
+<p>
+ Arguments:
+ </p>
+<div class="itemizedlist"><ul type="disc"><li><p>
+ <code class="option">function</code>: function
+ </p></li></ul></div>
+<p>
+ </p>
+<p>
+ Return value: 1 if success, 0 if an error occurred.
+ </p>
+<p>
+ Examples:
+</p>
+<pre class="screen">
+# perl
+weechat::remove_timer_handler("my_timer");
+
+# python
+weechat.remove_timer_handler("my_timer")
+
+# ruby
+Weechat.remove_timer_handler("my_timer")
+
+-- lua
+weechat.remove_timer_handler("my_timer")
+</pre>
+<p>
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="secScrip_remove_keyboard_handler"></a>remove_keyboard_handler</h4></div></div></div>
+<p>
+ Perl prototype:
+ <span><strong class="command">
+ weechat::remove_keyboard_handler(function);
+ </strong></span>
+ </p>
+<p>
+ Python prototype:
+ <span><strong class="command">
+ weechat.remove_keyboard_handler(function)
+ </strong></span>
+ </p>
+<p>
+ Ruby prototype:
+ <span><strong class="command">
+ Weechat.remove_keyboard_handler(function)
+ </strong></span>
+ </p>
+<p>
+ Lua prototype:
+ <span><strong class="command">
+ weechat.remove_keyboard_handler(function)
+ </strong></span>
+ </p>
+<p>
+ Remove a keyboard handler.
+ </p>
+<p>
+ Arguments:
+ </p>
+<div class="itemizedlist"><ul type="disc"><li><p>
+ <code class="option">function</code>: function
+ </p></li></ul></div>
+<p>
+ </p>
+<p>
+ Return value: 1 if success, 0 if an error occurred.
+ </p>
+<p>
+ Examples:
+</p>
+<pre class="screen">
+# perl
+weechat::remove_keyboard_handler("my_keyboard");
+
+# python
+weechat.remove_keyboard_handler("my_keyboard")
+
+# ruby
+Weechat.remove_keyboard_handler("my_keyboard")
+
+-- lua
+weechat.remove_keyboard_handler("my_keyboard")
+</pre>
+<p>
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="secScript_command"></a>command</h4></div></div></div>
+<p>
+ Perl prototype:
+ <span><strong class="command">
+ weechat::command(command, [channel, [server]]);
+ </strong></span>
+ </p>
+<p>
+ Python prototype:
+ <span><strong class="command">
+ weechat.command(command, [channel, [server]])
+ </strong></span>
+ </p>
+<p>
+ Ruby prototype:
+ <span><strong class="command">
+ Weechat.command(command, [channel, [server]])
+ </strong></span>
+ </p>
+<p>
+ Lua prototype:
+ <span><strong class="command">
+ weechat.command(command, [channel, [server]])
+ </strong></span>
+ </p>
+<p>
+ Execute a WeeChat command (or send a message to a channel).
+ </p>
+<p>
+ Arguments:
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li><p>
+ <code class="option">command</code>: command
+ </p></li>
+<li><p>
+ <code class="option">channel</code>: name of channel for executing
+ command
+ </p></li>
+<li><p>
+ <code class="option">server</code>: internal name of server for
+ executing command
+ </p></li>
+</ul></div>
+<p>
+ </p>
+<p>
+ Return value: 1 if success, 0 if an error occurred.
+ </p>
+<p>
+ Examples:
+</p>
+<pre class="screen">
+# perl
+weechat::command("hello everybody!");
+weechat::command("/kick toto please leave this channel", "#weechat");
+weechat::command("/nick newnick", "", "freenode");
+
+# python
+weechat.command("hello everybody!")
+weechat.command("/kick toto please leave this channel", "#weechat")
+weechat.command("/nick newnick", "", "freenode")
+
+# ruby
+Weechat.command("hello everybody!")
+Weechat.command("/kick toto please leave this channel", "#weechat")
+Weechat.command("/nick newnick", "", "freenode")
+
+-- lua
+weechat.command("hello everybody!")
+weechat.command("/kick toto please leave this channel", "#weechat")
+weechat.command("/nick newnick", "", "freenode")
+</pre>
+<p>
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="secScript_get_info"></a>get_info</h4></div></div></div>
+<p>
+ Perl prototype:
+ <span><strong class="command">
+ weechat::get_info(name, [server]);
+ </strong></span>
+ </p>
+<p>
+ Python prototype:
+ <span><strong class="command">
+ weechat.get_info(name, [server])
+ </strong></span>
+ </p>
+<p>
+ Ruby prototype:
+ <span><strong class="command">
+ Weechat.get_info(name, [server])
+ </strong></span>
+ </p>
+<p>
+ Lua prototype:
+ <span><strong class="command">
+ weechat.get_info(name, [server])
+ </strong></span>
+ </p>
+<p>
+ Return an info about WeeChat or a channel.
+ </p>
+<p>
+ Arguments:
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li><p>
+ <code class="option">name</code>: name of info to read
+ (see <a href="#secAPI_get_info" title="get_info">the section called “get_info”</a>)
+ </p></li>
+<li><p>
+ <code class="option">server</code>: internal name of server for
+ reading info (if needed)
+ </p></li>
+</ul></div>
+<p>
+ </p>
+<p>
+ Return value: information asked, empty string if an error
+ occurred.
+ </p>
+<p>
+ Examples:
+</p>
+<pre class="screen">
+# perl
+$version = get_info("version");
+$nick = get_info("nick", "freenode");
+
+# python
+version = weechat.get_info("version")
+nick = weechat.get_info("nick", "freenode")
+
+# ruby
+version = Weechat.get_info("version")
+nick = Weechat.get_info("nick", "freenode")
+
+-- lua
+version = weechat.get_info("version")
+nick = weechat.get_info("nick", "freenode")
+</pre>
+<p>
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="secScript_get_dcc_info"></a>get_dcc_info</h4></div></div></div>
+<p>
+ Perl prototype:
+ <span><strong class="command">
+ weechat::get_dcc_info();
+ </strong></span>
+ </p>
+<p>
+ Python prototype:
+ <span><strong class="command">
+ weechat.get_dcc_info()
+ </strong></span>
+ </p>
+<p>
+ Ruby prototype:
+ <span><strong class="command">
+ Weechat.get_dcc_info()
+ </strong></span>
+ </p>
+<p>
+ Lua prototype:
+ <span><strong class="command">
+ weechat.get_dcc_info()
+ </strong></span>
+ </p>
+<p>
+ Return list of DCC currently active or finished.
+ </p>
+<p>
+ Return value: list of DCC
+ (see <a href="#secAPI_get_dcc_info" title="get_dcc_info">the section called “get_dcc_info”</a>).
+ </p>
+<p>
+ Examples:
+</p>
+<pre class="screen">
+# perl
+my @dccs = weechat::get_dcc_info();
+if (@dccs)
+{
+ foreach my $dcc (@dccs)
+ {
+ while (my ($key, $value) = each %$dcc)
+ {
+ weechat::print("$key = '$value'");
+ }
+ }
+}
+else
+{
+ weechat::print("no DCC");
+}
+
+# python
+dccs = weechat.get_dcc_info()
+if dccs != None:
+ if dccs == []:
+ weechat.prnt("no DCC")
+ else:
+ for d in dccs:
+ for b in d.keys():
+ weechat.prnt("%s = '%s'" %(b, d[b]))
+else:
+ weechat.prnt("error while getting DCC")
+
+# ruby
+dccs = Weechat.get_dcc_info()
+if dccs != nil
+ if dccs == []
+ Weechat.print("no DCC")
+ else
+ dccs.each do |m|
+ m.each do |key, value|
+ Weechat.print("#{key} = '#{value}'")
+ end
+ end
+ end
+else
+ Weechat.print("error while getting DCC")
+end
+
+-- lua
+dccs = weechat.get_dcc_info()
+if dccs ~= nil then
+ if dccs then
+ dcc, dccinfos = next (dccs, nil)
+ while (dcc) do
+ key, value = next (dccinfos, nil)
+ while (key) do
+ weechat.print(key.." = '"..value.."'")
+ key, value = next (dccinfos, key)
+ end
+ dcc, dccinfos = next (dccs, dcc)
+ end
+ else
+ weechat.print("no DCC")
+ end
+else
+ weechat.print("error while getting DCC")
+end
+</pre>
+<p>
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="secScript_get_server_info"></a>get_server_info</h4></div></div></div>
+<p>
+ Perl prototype:
+ <span><strong class="command">
+ weechat::get_server_info();
+ </strong></span>
+ </p>
+<p>
+ Python prototype:
+ <span><strong class="command">
+ weechat.get_server_info()
+ </strong></span>
+ </p>
+<p>
+ Ruby prototype:
+ <span><strong class="command">
+ Weechat.get_server_info()
+ </strong></span>
+ </p>
+<p>
+ Lua prototype:
+ <span><strong class="command">
+ weechat.get_server_info()
+ </strong></span>
+ </p>
+<p>
+ Return list of IRC servers (connected or not).
+ </p>
+<p>
+ Return value: list of servers
+ (see <a href="#secAPI_get_server_info" title="get_server_info">the section called “get_server_info”</a>).
+ </p>
+<p>
+ Examples:
+</p>
+<pre class="screen">
+# perl
+my $servers = weechat::get_server_info();
+if ($servers)
+{
+ while (my ($srvname, $srvinfos) = each %$servers)
+ {
+ while ( my ($key, $value) = each %$srvinfos)
+ {
+ weechat::print("$srvname -> $key = '$value'");
+ }
+ }
+}
+else
+{
+ weechat::print("no server");
+}
+
+# python
+servers = weechat.get_server_info()
+if servers != None:
+ if servers == {}:
+ weechat.prnt("no server")
+ else:
+ for s in servers:
+ for i in servers[s]:
+ weechat.prnt("%s -> %s = '%s'" % (s, i, str(servers[s][i])))
+else:
+ weechat.prnt("error while getting servers")
+
+# ruby
+servers = Weechat.get_server_info()
+if servers != nil
+ if servers == []
+ Weechat.print("no server")
+ else
+ servers.each do |n, s|
+ s.each do |key, value|
+ Weechat.print("#{n} -> #{key} = '#{value}'")
+ end
+ end
+ end
+else
+ Weechat.print("error while getting servers")
+end
+
+-- lua
+servers = weechat.get_server_info()
+if servers ~= nil then
+ if servers then
+ srv, srvinfos = next (servers, nil)
+ while (srv) do
+ key, value = next (srvinfos, nil)
+ while (key) do
+ weechat.print(srv.." -> "..key.." = '"..value.."'")
+ key, value = next (srvinfos, key)
+ end
+ srv, srvinfos = next (servers, srv)
+ end
+ else
+ weechat.print("no server")
+ end
+else
+ weechat.print("error while getting servers")
+end
+</pre>
+<p>
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="secScript_get_channel_info"></a>get_channel_info</h4></div></div></div>
+<p>
+ Perl prototype:
+ <span><strong class="command">
+ weechat::get_channel_info(server);
+ </strong></span>
+ </p>
+<p>
+ Python prototype:
+ <span><strong class="command">
+ weechat.get_channel_info(server)
+ </strong></span>
+ </p>
+<p>
+ Ruby prototype:
+ <span><strong class="command">
+ Weechat.get_channel_info(server)
+ </strong></span>
+ </p>
+<p>
+ Lua prototype:
+ <span><strong class="command">
+ weechat.get_channel_info(server)
+ </strong></span>
+ </p>
+<p>
+ Return list of IRC channels for a server.
+ </p>
+<p>
+ Return value: list of IRC channels for server
+ (see <a href="#secAPI_get_channel_info" title="get_channel_info">the section called “get_channel_info”</a>).
+ </p>
+<p>
+ Examples:
+</p>
+<pre class="screen">
+# perl
+my $channels = weechat::get_channel_info(weechat::get_info("server"));
+if ($channels)
+{
+ while (my ($channame, $chaninfos) = each %$channels)
+ {
+ while (my ($key, $value) = each %$chaninfos)
+ {
+ weechat::print("$channame -> $key = '$value'");
+ }
+ }
+}
+else
+{
+ weechat::print("no channel");
+}
+
+# python
+chans = weechat.get_channel_info(weechat.get_info("server"))
+if chans != None:
+ if chans == {}:
+ weechat.prnt("no channel")
+ else:
+ for s in chans:
+ for i in chans[s]:
+ weechat.prnt("%s -> %s = '%s'" % (s, i, str(chans[s][i])))
+else:
+ weechat.prnt("error while getting channels")
+
+# ruby
+channels = Weechat.get_channel_info(Weechat.get_info("server"))
+if channels != nil
+ if channels == {}
+ Weechat.print("no channel")
+ else
+ channels.each do |n, c|
+ c.each do |key, value|
+ Weechat.print("#{n} -> #{key} = '#{value}'")
+ end
+ end
+ end
+else
+ Weechat.print("error while getting channels")
+end
+
+-- lua
+chans = weechat.get_channel_info(weechat.get_info("server"))
+if chans ~= nil then
+ if chans then
+ chan, chaninfos = next (chans, nil)
+ while (chan) do
+ key, value = next (chaninfos, nil)
+ while (key) do
+ weechat.print(chan.." -> "..key.." = '"..value.."'")
+ key, value = next (chaninfos, key)
+ end
+ chan, chaninfos = next (chans, chan)
+ end
+ else
+ weechat.print("no channel")
+ end
+else
+ weechat.print("error while getting channels")
+end
+</pre>
+<p>
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="secScript_get_nick_info"></a>get_nick_info</h4></div></div></div>
+<p>
+ Perl prototype:
+ <span><strong class="command">
+ weechat::get_nick_info(server, channel);
+ </strong></span>
+ </p>
+<p>
+ Python prototype:
+ <span><strong class="command">
+ weechat.get_nick_info(server, channel)
+ </strong></span>
+ </p>
+<p>
+ Ruby prototype:
+ <span><strong class="command">
+ Weechat.get_nick_info(server, channel)
+ </strong></span>
+ </p>
+<p>
+ Lua prototype:
+ <span><strong class="command">
+ weechat.get_nick_info(server, channel)
+ </strong></span>
+ </p>
+<p>
+ Return list of nicks for a channel.
+ </p>
+<p>
+ Return value: list of nicks on channel
+ (see <a href="#secAPI_get_nick_info" title="get_nick_info">the section called “get_nick_info”</a>).
+ </p>
+<p>
+ Examples:
+</p>
+<pre class="screen">
+# perl
+my $nicks = weechat::get_nick_info("freenode", "#weechat");
+if ($nicks)
+{
+ while (my ($nickname, $nickinfos) = each %$nicks)
+ {
+ while ( my ($key, $value) = each %$nickinfos)
+ {
+ weechat::print("$nickname -> $key = '$value'");
+ }
+ }
+}
+else
+{
+ weechat::print("no nick");
+}
+
+# python
+nicks = weechat.get_nick_info("freenode", "#weechat")
+if nicks != None:
+ if nicks == {}:
+ weechat.prnt("no nick")
+ else:
+ for n in nicks:
+ for f in nicks[n]:
+ weechat.prnt("%s -> %s = '%s'" % (n, f, str(nicks[n][f])))
+else:
+ weechat.prnt("error while getting nicks")
+
+# ruby
+nicks = Weechat.get_nick_info("freenode", "#weechat")
+if nicks != nil
+ if nicks == {}
+ Weechat.print("no nick")
+ else
+ nicks.each do |nk, nattr|
+ nattr.each do |key, value|
+ Weechat.print("#{nk} -> #{key} = '#{value}'")
+ end
+ end
+ end
+else
+ Weechat.print("error while getting nicks")
+end
+
+-- lua
+nicks = weechat.get_nick_info("freenode", "#weechat")
+if nicks ~= nil then
+ if nicks then
+ nick, nickinfos = next (nicks, nil)
+ while (nick) do
+ key, value = next (nickinfos, nil)
+ while (key) do
+ weechat.print(nick.." -> "..key.." = '"..value.."'")
+ key, value = next (nickinfos, key)
+ end
+ nick, nickinfos = next (nicks, nick)
+ end
+ else
+ weechat.print("no nick")
+ end
+else
+ weechat.print("error while getting nicks")
+end
+</pre>
+<p>
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="secScript_get_config"></a>get_config</h4></div></div></div>
+<p>
+ Perl prototype:
+ <span><strong class="command">
+ weechat::get_config(option);
+ </strong></span>
+ </p>
+<p>
+ Python prototype:
+ <span><strong class="command">
+ weechat.get_config(option)
+ </strong></span>
+ </p>
+<p>
+ Ruby prototype:
+ <span><strong class="command">
+ Weechat.get_config(option)
+ </strong></span>
+ </p>
+<p>
+ Lua prototype:
+ <span><strong class="command">
+ weechat.get_config(option)
+ </strong></span>
+ </p>
+<p>
+ Return value of a WeeChat config option.
+ </p>
+<p>
+ Arguments:
+ </p>
+<div class="itemizedlist"><ul type="disc"><li><p>
+ <code class="option">option</code>: name of option to read
+ </p></li></ul></div>
+<p>
+ </p>
+<p>
+ Return value: option value, empty string if not found.
+ </p>
+<p>
+ Examples:
+</p>
+<pre class="screen">
+# perl
+$value1 = weechat::get_config("look_nicklist");
+$value2 = weechat::get_config("freenode.server_autojoin");
+
+# python
+value1 = weechat.get_config("look_nicklist")
+value2 = weechat.get_config("freenode.server_autojoin")
+
+# ruby
+value1 = Weechat.get_config("look_nicklist")
+value2 = Weechat.get_config("freenode.server_autojoin")
+
+-- lua
+value1 = weechat.get_config("look_nicklist")
+value2 = weechat.get_config("freenode.server_autojoin")
+</pre>
+<p>
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="secScript_set_config"></a>set_config</h4></div></div></div>
+<p>
+ Perl prototype:
+ <span><strong class="command">
+ weechat::set_config(option, value);
+ </strong></span>
+ </p>
+<p>
+ Python prototype:
+ <span><strong class="command">
+ weechat.set_config(option, value)
+ </strong></span>
+ </p>
+<p>
+ Ruby prototype:
+ <span><strong class="command">
+ Weechat.set_config(option, value)
+ </strong></span>
+ </p>
+<p>
+ Lua prototype:
+ <span><strong class="command">
+ weechat.set_config(option, value)
+ </strong></span>
+ </p>
+<p>
+ Update value of a WeeChat config option.
+ </p>
+<p>
+ Arguments:
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li><p>
+ <code class="option">option</code>: name of option to update
+ </p></li>
+<li><p>
+ <code class="option">value</code>: new value for option
+ </p></li>
+</ul></div>
+<p>
+ </p>
+<p>
+ Return value: 1 if option was successfully updated, 0 if an error
+ occurred.
+ </p>
+<p>
+ Examples:
+</p>
+<pre class="screen">
+# perl
+weechat::set_config("look_nicklist", "off");
+weechat::set_config("freenode.server_autojoin, "#weechat");
+
+# python
+weechat.set_config("look_nicklist", "off")
+weechat.set_config("freenode.server_autojoin, "#weechat")
+
+# ruby
+Weechat.set_config("look_nicklist", "off")
+Weechat.set_config("freenode.server_autojoin, "#weechat")
+
+-- lua
+weechat.set_config("look_nicklist", "off")
+weechat.set_config("freenode.server_autojoin, "#weechat")
+</pre>
+<p>
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="secScript_get_plugin_config"></a>get_plugin_config</h4></div></div></div>
+<p>
+ Perl prototype:
+ <span><strong class="command">
+ weechat::get_plugin_config(option);
+ </strong></span>
+ </p>
+<p>
+ Python prototype:
+ <span><strong class="command">
+ weechat.get_plugin_config(option)
+ </strong></span>
+ </p>
+<p>
+ Ruby prototype:
+ <span><strong class="command">
+ Weechat.get_plugin_config(option)
+ </strong></span>
+ </p>
+<p>
+ Lua prototype:
+ <span><strong class="command">
+ weechat.get_plugin_config(option)
+ </strong></span>
+ </p>
+<p>
+ Return value of a plugin option. Option is read from file
+ "<code class="literal">~/.weechat/plugins.rc</code>" and is like:
+ "<code class="literal">plugin.option=value</code>" (note: plugin name
+ is automatically added).
+ </p>
+<p>
+ Arguments:
+ </p>
+<div class="itemizedlist"><ul type="disc"><li><p>
+ <code class="option">option</code>: name of option to read
+ </p></li></ul></div>
+<p>
+ </p>
+<p>
+ Return value: value of option, empty string if not found.
+ </p>
+<p>
+ Examples :
+</p>
+<pre class="screen">
+# perl
+$value = weechat::get_plugin_config("my_var");
+
+# python
+value = weechat.get_plugin_config("my_var")
+
+# ruby
+value = Weechat.get_plugin_config("my_var")
+
+-- lua
+value = weechat.get_plugin_config("my_var")
+</pre>
+<p>
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="secScript_set_plugin_config"></a>set_plugin_config</h4></div></div></div>
+<p>
+ Perl prototype:
+ <span><strong class="command">
+ weechat::set_plugin_config(option, value);
+ </strong></span>
+ </p>
+<p>
+ Python prototype:
+ <span><strong class="command">
+ weechat.set_plugin_config(option, value)
+ </strong></span>
+ </p>
+<p>
+ Ruby prototype:
+ <span><strong class="command">
+ Weechat.set_plugin_config(option, value)
+ </strong></span>
+ </p>
+<p>
+ Lua prototype:
+ <span><strong class="command">
+ weechat.set_plugin_config(option, value)
+ </strong></span>
+ </p>
+<p>
+ Update value of a plugin option. Option is written in file
+ "<code class="literal">~/.weechat/plugins.rc</code>" and is like:
+ "<code class="literal">plugin.option=value</code>" (note: plugin name
+ is automatically added).
+ </p>
+<p>
+ Arguments:
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li><p>
+ <code class="option">option</code>: name of option to update
+ </p></li>
+<li><p>
+ <code class="option">value</code>: new value for option
+ </p></li>
+</ul></div>
+<p>
+ </p>
+<p>
+ Return value: 1 if option was successfully updated, 0 if an error
+ occurred.
+ </p>
+<p>
+ Examples:
+</p>
+<pre class="screen">
+# perl
+weechat::set_plugin_config("my_var", "value");
+
+# python
+weechat.set_plugin_config("my_var", "value")
+
+# ruby
+Weechat.set_plugin_config("my_var", "value")
+
+-- lua
+weechat.set_plugin_config("my_var", "value")
+</pre>
+<p>
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="secScript_get_irc_color"></a>get_irc_color</h4></div></div></div>
+<p>
+ Perl prototype:
+ <span><strong class="command">
+ weechat::get_irc_color(color);
+ </strong></span>
+ </p>
+<p>
+ Python prototype:
+ <span><strong class="command">
+ weechat.get_irc_color(color)
+ </strong></span>
+ </p>
+<p>
+ Ruby prototype:
+ <span><strong class="command">
+ Weechat.get_irc_color(color)
+ </strong></span>
+ </p>
+<p>
+ Lua prototype:
+ <span><strong class="command">
+ weechat.get_irc_color(color)
+ </strong></span>
+ </p>
+<p>
+ Return IRC color index with name.
+ </p>
+<p>
+ Return value: IRC color index, -1 if color is not found
+ (see <a href="#secAPI_get_irc_color" title="get_irc_color">the section called “get_irc_color”</a>).
+ </p>
+<p>
+ Examples:
+</p>
+<pre class="screen">
+# perl
+my $color_blue = weechat::get_irc_color("blue");
+
+# python
+color_blue = weechat.get_irc_color("blue")
+
+# ruby
+color_blue = Weechat.get_irc_color("blue")
+
+-- lua
+color_blue = weechat.get_irc_color("blue")
+</pre>
+<p>
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="secScript_input_color"></a>input_color</h4></div></div></div>
+<p>
+ Perl prototype:
+ <span><strong class="command">
+ weechat::input_color(color);
+ </strong></span>
+ </p>
+<p>
+ Python prototype:
+ <span><strong class="command">
+ weechat.input_color(color)
+ </strong></span>
+ </p>
+<p>
+ Ruby prototype:
+ <span><strong class="command">
+ Weechat.input_color(color)
+ </strong></span>
+ </p>
+<p>
+ Lua prototype:
+ <span><strong class="command">
+ weechat.input_color(color)
+ </strong></span>
+ </p>
+<p>
+ Add color in input buffer.
+ </p>
+<p>
+ Return value: none.
+ </p>
+<p>
+ Examples:
+</p>
+<pre class="screen">
+# perl
+weechat::input_color(weechat::get_irc_color("blue"), 10, 5);
+
+# python
+weechat.input_color(weechat.get_irc_color("blue"), 10, 5)
+
+# ruby
+Weechat.input_color(Weechat.get_irc_color("blue"), 10, 5)
+
+-- lua
+weechat.input_color(weechat.get_irc_color("blue"), 10, 5)
+</pre>
+<p>
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="secScript_get_window_info"></a>get_window_info</h4></div></div></div>
+<p>
+ Perl prototype:
+ <span><strong class="command">
+ weechat::get_window_info();
+ </strong></span>
+ </p>
+<p>
+ Python prototype:
+ <span><strong class="command">
+ weechat.get_window_info()
+ </strong></span>
+ </p>
+<p>
+ Ruby prototype:
+ <span><strong class="command">
+ Weechat.get_window_info()
+ </strong></span>
+ </p>
+<p>
+ Lua prototype:
+ <span><strong class="command">
+ weechat.get_window_info()
+ </strong></span>
+ </p>
+<p>
+ Return list of WeeChat windows.
+ </p>
+<p>
+ Return value: list of WeeChat windows
+ (see <a href="#secAPI_get_window_info" title="get_window_info">the section called “get_window_info”</a>).
+ </p>
+<p>
+ Examples:
+</p>
+<pre class="screen">
+# perl
+my @wf = weechat::get_window_info();
+if (@wf)
+{
+ weechat::print("**** windows infos ****");
+ foreach my $w (@wf)
+ {
+ while ( my ($key, $value) = each %$w)
+ {
+ weechat::print(" > $key => $value");
+ }
+ weechat::print("----------------------");
+ }
+}
+else
+{
+ weechat::print("**** no window info ****");
+}
+
+# python
+wf = weechat.get_window_info()
+if wf != None and wf != []:
+ weechat.prnt ("**** windows infos ****")
+ for w in wf:
+ for i in w:
+ weechat.prnt (" > %s => %s" % (i, w[i]))
+ weechat.prnt ("----------------------")
+else:
+ weechat.prnt ("**** no window info ****")
+
+# ruby
+wf = Weechat.get_window_info()
+if wf != nil and wf != []
+ Weechat.print("**** windows infos ****")
+ wf.each do |w|
+ w.each do |key, value|
+ Weechat.print(" > #{key} => #{value}")
+ end
+ Weechat.print("----------------------")
+ end
+else
+ Weechat.print("**** no window info ****")
+end
+
+-- lua
+wf = weechat.get_window_info()
+if wf then
+ weechat.print ("**** windows infos ****")
+ w, winfos = next (wf, nil)
+ while (w) do
+ key, value = next (winfos, nil)
+ while (key) do
+ weechat.print(" > " .. key .. " => " .. value)
+ key, value = next (winfos, key)
+ end
+ weechat.print ("----------------------")
+ w, winfos = next (wf, w)
+ end
+else
+ weechat.print("**** no window info ****")
+end
+</pre>
+<p>
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="secScript_get_buffer_info"></a>get_buffer_info</h4></div></div></div>
+<p>
+ Perl prototype:
+ <span><strong class="command">
+ weechat::get_buffer_info();
+ </strong></span>
+ </p>
+<p>
+ Python prototype:
+ <span><strong class="command">
+ weechat.get_buffer_info()
+ </strong></span>
+ </p>
+<p>
+ Ruby prototype:
+ <span><strong class="command">
+ Weechat.get_buffer_info()
+ </strong></span>
+ </p>
+<p>
+ Lua prototype:
+ <span><strong class="command">
+ weechat.get_buffer_info()
+ </strong></span>
+ </p>
+<p>
+ Return list of WeeChat buffers.
+ </p>
+<p>
+ Return value: list of WeeChat buffers
+ (see <a href="#secAPI_get_buffer_info" title="get_buffer_info">the section called “get_buffer_info”</a>).
+ </p>
+<p>
+ Examples:
+</p>
+<pre class="screen">
+# perl
+my $bf = weechat::get_buffer_info();
+if ($bf)
+{
+ while ( my ($nobuf, $binfos) = each %$bf)
+ {
+ while ( my ($key, $value) = each %$binfos)
+ {
+ weechat::print(" > $key => $value");
+ }
+ weechat::print("----------------------");
+ }
+}
+else
+{
+ weechat::print("**** no buffer info ****");
+}
+
+# python
+bf = weechat.get_buffer_info()
+if bf != None and bf != {}:
+ for b in bf:
+ weechat.prnt ("**** info for buffer no %d ****" % b)
+ for c in bf[b]:
+ weechat.prnt (" > %s => %s" % (c, bf[b][c]))
+ weechat.prnt ("----------------------")
+else:
+ weechat.prnt ("**** no buffer info ****")
+
+# ruby
+bf = Weechat.get_buffer_info()
+if bf != nil and bf != {}
+ bf.each do |n, c|
+ Weechat.print("**** info for buffer no #{n} ****")
+ c.each do |key, value|
+ Weechat.print(" > #{key} => #{value}")
+ end
+ Weechat.print("----------------------")
+ end
+else
+ Weechat.print("**** no buffer info ****")
+end
+
+-- lua
+bf = weechat.get_buffer_info()
+if bf then
+ b, binfos = next (bf, nil)
+ while (b) do
+ weechat.print("**** info for buffer no " .. b .. " ****")
+ key, value = next (binfos, nil)
+ while (key) do
+ weechat.print(" > " .. key .. " => " .. value)
+ key, value = next (binfos, key)
+ end
+ weechat.print ("----------------------")
+ b, infos = next (bf, b)
+ end
+else
+ weechat.print("**** no buffer info ****")
+end
+</pre>
+<p>
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="secScript_get_buffer_data"></a>get_buffer_data</h4></div></div></div>
+<p>
+ Perl prototype:
+ <span><strong class="command">
+ weechat::get_buffer_data(server, channel);
+ </strong></span>
+ </p>
+<p>
+ Python prototype:
+ <span><strong class="command">
+ weechat.get_buffer_data(server, channel)
+ </strong></span>
+ </p>
+<p>
+ Ruby prototype:
+ <span><strong class="command">
+ Weechat.get_buffer_data(server, channel)
+ </strong></span>
+ </p>
+<p>
+ Lua prototype:
+ <span><strong class="command">
+ weechat.get_buffer_data(server, channel)
+ </strong></span>
+ </p>
+<p>
+ Return content of buffer.
+ </p>
+<p>
+ Return value: list of lines for buffer
+ (see <a href="#secAPI_get_buffer_data" title="get_buffer_data">the section called “get_buffer_data”</a>).
+ </p>
+<p>
+ Examples:
+</p>
+<pre class="screen">
+# perl
+my $server = weechat::get_info("server");
+my $channel = weechat::get_info("channel");
+my @bc = weechat::get_buffer_data($server, $channel);
+if (@bc)
+{
+ weechat::print("**** buffer data for '$channel'\@'$server' ****");
+ foreach my $l (@bc) {
+ while ( my ($key, $value) = each %$l) {
+ weechat::print(" > $key => $value");
+ }
+ weechat::print("----------------------");
+ }
+}
+else
+{
+ weechat::print("**** no buffer data ****");
+}
+
+# python
+server = weechat.get_info("server")
+channel = weechat.get_info("channel")
+bc = weechat.get_buffer_data(server, channel)
+if bc != None and bc != []:
+ weechat.prnt ("**** buffer data for '%s'@'%s' ****" % (channel, server))
+ for l in bc:
+ for i in l:
+ weechat.prnt (" > %s => %s" % (i, l[i]))
+ weechat.prnt ("----------------------")
+else:
+ weechat.prnt ("**** no buffer data ****")
+
+# ruby
+server = Weechat.get_info("server")
+channel = Weechat.get_info("channel")
+bc = Weechat.get_buffer_data(server, channel)
+if bc != nil and bc != []
+ Weechat.print("**** buffer data for '#{channel}'@'#{server}' ****")
+ bc.each do |l|
+ l.each do |key, value|
+ Weechat.print(" > #{key} => #{value}")
+ end
+ Weechat.print("----------------------")
+ end
+else
+ Weechat.print("**** no buffer data ****")
+end
+-- lua
+server = weechat.get_info("server")
+channel = weechat.get_info("channel")
+bc = weechat.get_buffer_data(server, channel)
+if bc then
+ b, bdatas = next (bc, nil)
+ weechat.print("**** buffer data for '" .. channel .. "'@'" .. server .. "' ****")
+ while (b) do
+ key, value = next (bdatas, nil)
+ while (key) do
+ weechat.print(" > " .. key .. " => " .. value)
+ key, value = next (bdatas, key)
+ end
+ weechat.print ("----------------------")
+ b, bdatas = next (bc, b)
+ end
+else
+ weechat.print("**** no buffer data ****")
+end
+</pre>
+<p>
+ </p>
+</div>
+</div>
+</div>
+</div>
+<div class="chapter" lang="en">
+<div class="titlepage"><div><div><h2 class="title">
+<a name="chapAuthorsSupport"></a>Chapter 5. Authors / Support</h2></div></div></div>
+<div class="toc">
+<p><b>Table of Contents</b></p>
+<dl>
+<dt><span class="section"><a href="#secAuthors">Authors</a></span></dt>
+<dt><span class="section"><a href="#secContributors">Contributors</a></span></dt>
+<dt><span class="section"><a href="#secSupport">Get support</a></span></dt>
+</dl>
+</div>
+<p>
+ This chapter lists authors and contributors for WeeChat, and
+ shows ways to get support.
+ </p>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="secAuthors"></a>Authors</h2></div></div></div>
+<p>
+ WeeChat is developed by:
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li><p>
+ <span class="emphasis"><em>FlashCode (Sébastien Helleu)</em></span>
+ <code class="email"><<a href="mailto:flashcode%20AT%20flashtux.org">flashcode AT flashtux.org</a>></code> -
+ main developer
+ </p></li>
+<li><p>
+ <span class="emphasis"><em>Kolter</em></span>
+ <code class="email"><<a href="mailto:kolter%20AT%20free.fr">kolter AT free.fr</a>></code> -
+ developer
+ </p></li>
+<li><p>
+ <span class="emphasis"><em>Ptitlouis</em></span>
+ <code class="email"><<a href="mailto:ptitlouis%20AT%20sysif.net">ptitlouis AT sysif.net</a>></code> -
+ Debian packager
+ </p></li>
+</ul></div>
+<p>
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="secContributors"></a>Contributors</h2></div></div></div>
+<p>
+ Following people contributed to WeeChat:
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li><p>
+ <span class="emphasis"><em>Jiri Golembiovsky</em></span> -
+ czech translation, patches
+ </p></li>
+<li><p>
+ <span class="emphasis"><em>Rudolf Polzer</em></span> -
+ patches
+ </p></li>
+<li><p>
+ <span class="emphasis"><em>Jim Ramsay</em></span> -
+ patches
+ </p></li>
+<li><p>
+ <span class="emphasis"><em>Odin</em></span> -
+ SuSE RPM
+ </p></li>
+<li><p>
+ <span class="emphasis"><em>Pistos</em></span> -
+ patches
+ </p></li>
+<li><p>
+ <span class="emphasis"><em>Gwenn</em></span> -
+ patches
+ </p></li>
+<li><p>
+ <span class="emphasis"><em>voroskoi</em></span> -
+ hungarian translation
+ </p></li>
+<li><p>
+ <span class="emphasis"><em>Frank Zacharias</em></span> -
+ german translation
+ </p></li>
+<li><p>
+ <span class="emphasis"><em>Pavel Shevchuk</em></span> -
+ russian translation
+ </p></li>
+</ul></div>
+<p>
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="secSupport"></a>Get support</h2></div></div></div>
+<p>
+ Before asking for support, be sure you've read documentation and FAQ
+ provided with WeeChat (documentation is this document, if you don't
+ read all lines until this sentence, you can start again!)
+ </p>
+<p>
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li><p>
+ IRC: server "<code class="literal">irc.freenode.net</code>",
+ channel "<code class="literal">#weechat</code>"
+ </p></li>
+<li><p>
+ WeeChat forum:
+ <a href="http://forums.flashtux.org" target="_top">
+ http://forums.flashtux.org
+ </a>
+ </p></li>
+<li>
+<p>
+ Mailing list:
+ </p>
+<div class="itemizedlist"><ul type="circle">
+<li><p>
+ To subscribe:
+ <a href="http://mail.nongnu.org/mailman/listinfo/weechat-support" target="_top">
+ http://mail.nongnu.org/mailman/listinfo/weechat-support
+ </a>
+ </p></li>
+<li><p>
+ To send a mail on mailing list:
+ <code class="email"><<a href="mailto:weechat-support@nongnu.org">weechat-support@nongnu.org</a>></code>
+ </p></li>
+</ul></div>
+<p>
+ Mailing list archives are available here:
+ <a href="http://mail.nongnu.org/archive/html/weechat-support" target="_top">
+ http://mail.nongnu.org/archive/html/weechat-support
+ </a>
+ </p>
+</li>
+</ul></div>
+<p>
+ </p>
+</div>
+</div>
+</div></body>
+</html>
Changes to src/weechat/irc2sms/NOTES.txt
@@ -1,1 +1,90 @@ +IRC to AIM bidirectional filtered relay? +======================================== + +Daniel Clark <dclark@pobox.com> Fri, Dec 29, 2006 at 11:26 AM +To: weechat-support@nongnu.org + +I'm wondering if anyone knows of software that implements this kind of +gateway/relay/bridge scheme (so I can just use it rather than write it +myself :-) or anything that achieves the same effect (receive selected +IRC messages via SMS, with the ability to reply): + +IRC #chan <-> (Filter) <-> AIM user_chan_server <-> AIM user_chan_client <-> SMS + +Where: + +IRC #chan: IRC channel to relay + +(Filter): User-programmable filter of what gets relayed, and how (e.g. +only messages with my nick, limit messages to X characters, limit rate +of messages etc.) + +AIM user_chan_server: An AIM screen name set up specifically to relay +messages from IRC #chan to other AIM screen names; anything sent to +this screen name gets relayed to IRC #chan, and anything that is sent +to this screen name gets sent to user_chan_client + +AIM user_chan_client: An AIM screen name set up specifically to +receive messages from user_chan_server and send them to SMS + +SMS: The user's mobile device which can send and receive SMS messages + +Also, do people think WeeChat would be a good platform to implement +this on? I'd want the messages to look like they are coming from a +user, not the bot; using WeeChat with an IRC bouncer like Bip this +looks like it would be possible. + +IMHO it would probably make more sense to integrate this function with +an IRC Bouncer, but none of them I found supported Python plugins +(ctrlproxy is supposed to in 3.1, but that release may be a ways off.) + +---------------------------------------------------------------------- + +> Hi Daniel, +> +> I don't understand exactly what you want to do. +> Did you heard about "bitlbee" ? It's an IRC server providing gateway +> for protocols like Jabber, AIM, ICQ, MSN, .. +> +> Anyway, you're welcome on irc.freenode.net, channel #weechat to +> discuss with us (developers) about any feature request. + +Thanks; just for the possible benefit of Google searchers: + +[15:04] <djbclark> FlashCode: Just got your response on the mailing +list... Basically I want to have AIM/Yahoo-style SMS functionality +with IRC (but with greater configurability of what messages get sent +to SMS). + +[15:05] <djbclark> The easiest way to do that to me would seem to be +to exploit the fact you can get an infinate number of AIM screen names +for free, and use their servers to get information to/from SMS (in +most cases you can also use email, but I'm guessing their gateway is +faster) + +[15:06] <FlashCode> and what do you want to do in weechat for that ? + +[15:06] <djbclark> The use case would be that a user is offline but +has a cell phone on them. When their nick is mentioned they get an SMS +of the message; they can then either reply via SMS, or start up an IRC +client on their device. + +[15:08] <djbclark> It looks like it would be possible using the +weechat plugin interface... It's not something you would want to use a +bot for as far as I can see, as you would want the messages to come +from the user, not a bot. + +[15:08] <FlashCode> I think you can do that, yes + +[15:09] <djbclark> The query was just to see (a) if anyone had heard +of something like that already existing, and (b) if weechat would be a +good platform to work from (vs supybot etc)... you just answered (b) +;-) + +[15:10] <FlashCode> never heard about something like that, I don't +know if that already exists + +[15:12] <djbclark> Thanks... Now off to code... I'm sure I'll be +pestering the channel more over the next few weeks. +[15:12] <FlashCode> ok :)
Changes to src/weechat/scripts/README
@@ -1,1 +1,2 @@ - +Copied from http://weechat.flashtux.org/scripts on 2006-12-30 for reference +value.
Changes to src/weechat/scripts/other/awaylog.pl
@@ -1,1 +1,68 @@
+##############################################################################
+# #
+# Away highlite loger #
+# #
+# Perl script for WeeChat. #
+# #
+# Log highlite/private msg when you are away #
+# #
+# #
+# #
+# Copyright (C) 2006 Jiri Golembiovsky <golemj@gmail.com> #
+# #
+# This program is free software; you can redistribute it and/or #
+# modify it under the terms of the GNU General Public License #
+# as published by the Free Software Foundation; either version 2 #
+# of the License, or (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program; if not, write to the Free Software #
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, #
+# MA 02110-1301, USA. #
+# #
+##############################################################################
+
+weechat::register( "AwayLog", "0.4", "", "Log privmsg/highlite when you are away" );
+
+weechat::add_message_handler( "PRIVMSG", "awaylog" );
+
+sub test_highlight {
+ $str = shift;
+ $irc_highlight = weechat::get_config( "irc_highlight" );
+ @arr = split( ",", $irc_highlight );
+ $b = 0;
+ $str = lc( $str );
+ while( $item = pop( @arr ) ) {
+ $item = lc( $item );
+ if( substr( $item, 0, 1 ) eq '*' ) { $item = '.' . $item; }
+ if( substr( $item, length( $item ) - 1, 1 ) eq '*' ) { $item = substr( $item, , 0, length( $item ) - 1 ) . ".*"; }
+ if( $str =~ /$item/ ) { $b++; }
+ }
+ return $b;
+}
+
+sub awaylog {
+ if( weechat::get_info( "away", $_[0] ) == 1 ) {
+ $i = index( $_[1], " PRIVMSG " );
+ $hostmask = substr( $_[1], 0, $i );
+ $str = substr( $_[1], $i + 9 );
+ $i = index( $str, ":" );
+ $channel = substr( $str, 0, $i - 1 );
+ $message = substr( $str, $i + 1 );
+ if( substr( $hostmask, 0, 1 ) eq ":" ) {
+ $hostmask = substr( $hostmask, 1 );
+ }
+ ($nick, $host) = split( "!", $hostmask );
+ $mynick = weechat::get_info( "nick", $_[0] );
+ if( ( index( $message, $mynick ) != -1 ) || ( $channel eq $mynick ) || ( test_highlight( $message ) > 0 ) ) {
+ weechat::print( "$channel -- $nick :: $message", "", $_[0] );
+ }
+ }
+ return 0;
+}
Changes to src/weechat/scripts/other/beep.pl
@@ -1,1 +1,56 @@
+#
+# Copyright (c) 2006 by FlashCode <flashcode@flashtux.org>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#
+
+#
+# Speaker beep on highlight/private msg.
+#
+# History:
+#
+# 2006-09-02, FlashCode <flashcode@flashtux.org>:
+# initial release
+#
+
+use strict;
+
+my $version = "0.1";
+my $beep_command = "echo -n \a";
+
+# default values in setup file (~/.weechat/plugins.rc)
+my $default_beep_highlight = "on";
+my $default_beep_pv = "on";
+
+weechat::register("Beep", $version, "", "Speaker beep on highlight/private msg");
+weechat::set_plugin_config("beep_highlight", $default_beep_highlight) if (weechat::get_plugin_config("beep_highlight") eq "");
+weechat::set_plugin_config("beep_pv", $default_beep_pv) if (weechat::get_plugin_config("beep_pv") eq "");
+
+weechat::add_message_handler("weechat_highlight", "highlight");
+weechat::add_message_handler("weechat_pv", "pv");
+
+sub highlight
+{
+ my $beep = weechat::get_plugin_config("beep_highlight");
+ system($beep_command) if ($beep eq "on");
+ return weechat::PLUGIN_RC_OK;
+}
+sub pv
+{
+ my $beep = weechat::get_plugin_config("beep_pv");
+ system($beep_command) if ($beep eq "on");
+ return weechat::PLUGIN_RC_OK;
+}
Changes to src/weechat/scripts/other/loadavg.lua
@@ -1,1 +1,27 @@
+-- Author: Julien Louis <ptitlouis@sysif.net>
+-- License: GPLv2
+-- Description: This lua script prints in the infobar the machine load average
+--
+weechat.register("loadavg", "0.1", "unload", "Print the load average in infobar")
+
+local refresh = weechat.get_config("loadavg_refresh")
+
+if refresh == "" then
+ refresh = 5
+ weechat.set_config("loadavg_refresh", 5)
+end
+
+weechat.add_timer_handler(refresh, "loadavg")
+
+function loadavg()
+ local load = io.open("/proc/loadavg"):read()
+ load = string.gsub(load, "^([%w.]+) ([%w.]+) ([%w.]+).*", "%1 %2 %3")
+ weechat.print_infobar(refresh, "load: "..load)
+ return weechat.PLUGIN_RC_OK;
+end
+
+function unload()
+ weechat.remove_timer_handler("loadavg")
+ return weechat.remove_infobar(1)
+end
Changes to src/weechat/scripts/other/logsearch.pl
@@ -1,1 +1,95 @@
+#
+# Copyright (c) 2006 by FlashCode <flashcode@flashtux.org>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#
+
+#
+# Search for text in WeeChat disk log files.
+#
+# History:
+# 2006-04-17, FlashCode <flashcode@flashtux.org>:
+# initial release
+#
+
+use strict;
+
+# default values in setup file (~/.weechat/plugins.rc)
+my $default_max = "8";
+my $default_server = "off";
+my $default_grep_options = "-i";
+
+# init script
+weechat::register("logsearch", "0.1", "", "Search for text in WeeChat disk log files");
+weechat::set_plugin_config("max", $default_max) if (weechat::get_plugin_config("max") eq "");
+weechat::set_plugin_config("server", $default_server) if (weechat::get_plugin_config("server") eq "");
+weechat::set_plugin_config("grep_options", $default_grep_options) if (weechat::get_plugin_config("grep_options") eq "");
+
+# add command handler /logsearch
+weechat::add_command_handler("logsearch", "logsearch",
+ "search for text in WeeChat disk log files",
+ "[-n#] text",
+ "-n#: max number or lines to display\n"
+ ."text: regular expression (used by grep)\n\n"
+ ."Plugins options (set with /setp):\n"
+ ." - perl.logsearch.max: max number of lines displayed by default\n"
+ ." - perl.logsearch.server: display result on server "
+ ."buffer (if on), otherwise on current buffer\n"
+ ." - perl.logsearch.grep_options: options to give to grep program",
+ "");
+
+# /logsearch command
+sub logsearch
+{
+ my $server = shift;
+ my $args = shift;
+ if ($args ne "")
+ {
+ # read settings
+ my $conf_max = weechat::get_plugin_config("max");
+ $conf_max = $default_max if ($conf_max eq "");
+ my $conf_server = weechat::get_plugin_config("server");
+ $conf_server = $default_server if ($conf_server eq "");
+ my $output_server = "";
+ $output_server = $server if (lc($conf_server) eq "on");
+ my $grep_options = weechat::get_plugin_config("grep_options");
+
+ # build log filename
+ my $buffer = weechat::get_info("channel", "");
+ $buffer = ".".$buffer if ($buffer ne "");
+ my $log_path = weechat::get_config("log_path");
+ $log_path =~ s/%h/~\/.weechat/g;
+ my $file = $log_path.$server.$buffer.".weechatlog";
+
+ # run grep in log file
+ if ($args =~ /-n([0-9]+) (.*)/)
+ {
+ $conf_max = $1;
+ $args = $2;
+ }
+ my $command = "grep ".$grep_options." '".$args."' ".$file." 2>/dev/null | tail -n".$conf_max;
+ my $result = `$command`;
+ # display result
+ if ($result eq "")
+ {
+ weechat::print("Text not found in $file", "", $output_server);
+ return weechat::PLUGIN_RC_OK;
+ }
+ my @result_array = split(/\n/, $result);
+ weechat::print($_, "", $output_server) foreach(@result_array);
+ }
+ return weechat::PLUGIN_RC_OK;
+}
Changes to src/weechat/scripts/other/sound.pl
@@ -1,1 +1,95 @@
+#
+# Copyright (c) 2006 by FlashCode <flashcode@flashtux.org>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#
+
+#
+# Play a sound when highlighted/private msg, or for ctcp sound event.
+#
+# History:
+#
+# 2006-05-30, FlashCode <flashcode@flashtux.org>:
+# added plugin options for commands
+# 2004-10-01, FlashCode <flashcode@flashtux.org>:
+# initial release
+#
+
+use strict;
+
+my $version = "0.3";
+my $command_suffix = " >/dev/null 2>&1 &";
+
+# default values in setup file (~/.weechat/plugins.rc)
+my $default_cmd_highlight = "alsaplay -i text ~/sound_highlight.wav";
+my $default_cmd_pv = "alsaplay -i text ~/sound_pv.wav";
+my $default_cmd_ctcp = "alsaplay -i text \$filename";
+
+weechat::register("Sound", $version, "", "Sound for highlights/privates & CTCP sound events");
+weechat::set_plugin_config("cmd_highlight", $default_cmd_highlight) if (weechat::get_plugin_config("cmd_highlight") eq "");
+weechat::set_plugin_config("cmd_pv", $default_cmd_pv) if (weechat::get_plugin_config("cmd_pv") eq "");
+weechat::set_plugin_config("cmd_ctcp", $default_cmd_ctcp) if (weechat::get_plugin_config("cmd_ctcp") eq "");
+
+weechat::add_message_handler("PRIVMSG", "sound");
+weechat::add_message_handler("weechat_highlight", "highlight");
+weechat::add_message_handler("weechat_pv", "pv");
+weechat::add_command_handler("sound", "sound_cmd");
+
+sub sound
+{
+ my $server = $_[0];
+ if ($_[1] =~ /(.*) PRIVMSG (.*)/)
+ {
+ my ($host, $msg) = ($1, $2);
+ if ($host ne "localhost")
+ {
+ if ($msg =~ /\001SOUND ([^ ]*)\001/)
+ {
+ my $filename = $1;
+ my $command = weechat::get_plugin_config("cmd_ctcp");
+ $command =~ s/(\$\w+)/$1/gee;
+ system($command.$command_suffix);
+ }
+ }
+ }
+ return weechat::PLUGIN_RC_OK;
+}
+
+sub highlight
+{
+ my $command = weechat::get_plugin_config("cmd_highlight");
+ system($command.$command_suffix);
+ return weechat::PLUGIN_RC_OK;
+}
+
+sub pv
+{
+ my $command = weechat::get_plugin_config("cmd_pv");
+ system($command.$command_suffix);
+ return weechat::PLUGIN_RC_OK;
+}
+sub sound_cmd
+{
+ if ($#_ == 1)
+ {
+ my $filename = $_[1].".wav";
+ my $command = weechat::get_plugin_config("cmd_ctcp");
+ $command =~ s/(\$\w+)/$1/gee;
+ system($command.$command_suffix);
+ weechat::command("/quote PRIVMSG ".weechat::get_info("channel")." :\001SOUND $filename\001") if (@_);
+ }
+ return weechat::PLUGIN_RC_OK;
+}
Changes to src/weechat/scripts/other/translate.pl
@@ -1,1 +1,128 @@
+#
+# Copyright (c) 2006 by FlashCode <flashcode@flashtux.org>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#
+
+#
+# Translate words and display result in infobar, local buffer or channel
+#
+# History:
+# 2006-07-03, FlashCode <flashcode@flashtux.org>:
+# initial release
+#
+
+use strict;
+
+# default values in setup file (~/.weechat/plugins.rc)
+my $default_output_infobar = "on";
+my $default_timeout = "2";
+
+# script internal settings
+my $languages = "de|el|en|es|fr|it|ja|ko|nl|pt|ru|zh|zt";
+
+# init script
+weechat::register("translate", "0.1", "", "Translation script");
+weechat::set_plugin_config("output_infobar", $default_output_infobar) if (weechat::get_plugin_config("output_infobar") eq "");
+weechat::set_plugin_config("timeout", $default_timeout) if (weechat::get_plugin_config("timeout") eq "");
+
+# add command handlers for all languages
+weechat::add_command_handler("translate", "translate", "translate text to other language",
+ "lang1 lang2 text [-o]",
+ "lang1: base language\n"
+ ."lang2: target language\n"
+ ." text: text to translate\n"
+ ." -o: result is written on channel (visible by all)",
+ $languages." ".$languages);
+
+# translate text with babelfish (altavista)
+sub babelfish
+{
+ my $timeout = weechat::get_plugin_config("timeout");
+ $timeout = $default_timeout if ($timeout eq "");
+
+ if (`wget -q --timeout=$timeout --user-agent "Mozilla" --output-document=- "http://babelfish.altavista.com/babelfish/tr?lp=$_[0]_$_[1]&urltext=$_[2]"` =~ /.*<td bgcolor=white class=s><div style=padding:10px;>(.*)<\/div><\/td>/)
+ {
+ return $1;
+ }
+ return "";
+}
+
+# translate output
+sub translate_output
+{
+ if ($_[1] == 1)
+ {
+ if (substr($_[0],0,1) eq "/")
+ {
+ weechat::command("/".$_[0], "", "");
+ }
+ else
+ {
+ weechat::command($_[0], "", "");
+ }
+ }
+ else
+ {
+ my $output_infobar = weechat::get_plugin_config("output_infobar");
+ $output_infobar = $default_output_infobar if ($output_infobar eq "");
+ if ($output_infobar eq "on")
+ {
+ weechat::print_infobar(5, $_[0]);
+ }
+ else
+ {
+ weechat::print($_[0], "", "");
+ }
+ }
+}
+
+# /translate command
+sub translate
+{
+ my $server = shift;
+ my $args = shift;
+
+ if ($args =~ /([a-zA-Z][a-zA-Z]) ([a-zA-Z][a-zA-Z]) (.*)/)
+ {
+ my $lang1 = $1;
+ my $lang2 = $2;
+ my $text = $3;
+
+ # output on channel?
+ my $output_chan = 0;
+ if ($text =~ /(.*) -[oO]$/)
+ {
+ $output_chan = 1;
+ $text = $1;
+ }
+
+ my $result = babelfish($lang1, $lang2, $text);
+ if ($result eq "")
+ {
+ translate_output("Error: unable to translate (bad language or timeout)", 0);
+ }
+ else
+ {
+ translate_output($result, $output_chan);
+ }
+ }
+ else
+ {
+ translate_output("Error: bad arguments", 0);
+ }
+ return weechat::PLUGIN_RC_OK;
+}
Changes to src/weechat/scripts/python/auto_op.py
@@ -1,1 +1,86 @@
+# --------------------------------------------------------------------
+#
+# Copyright (c) 2006 by Jean-Marie Favreau <jm@jmtrivial.info>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#
+# --------------------------------------------------------------------
+# This script automatically op and voice some nicks
+# --------------------------------------------------------------------
+#
+# 2006-12-14, FlashCode <flashcode@flashtux.org>:
+# fixed message split (for servers like quakenet with no ":" after "JOIN")
+
+import weechat
+import re
+
+
+# regexp list for /op
+U_OP = { "server": { "#chan" : [ "nick1@domain.com", "nick2.*@.*"] } }
+
+# chan list where all nicks are /voice
+C_VOICE = { "server": [ "#chan1", "#chan2" ] }
+
+
+def auto_op(server, args):
+ '''Handle connect'''
+ result = weechat.PLUGIN_RC_OK
+ # first, watch if need /op
+ if U_OP.has_key(server):
+ chans = U_OP[server]
+ try:
+ # find nick and channel
+ user, channel = args.split(" JOIN ")
+ nick, next = user.split("!")
+ if channel.startswith(':'):
+ channel = channel[1:]
+ except ValueError:
+ result = weechat.PLUGIN_RC_KO
+ else:
+ if chans.has_key(channel):
+ users = chans[channel]
+ for userExpr in users:
+ if re.search("^n=" + userExpr, next):
+ weechat.command("/op "+nick, channel, server) # op nick
+ weechat.prnt("[op] "+nick+" on "+channel+"("+server+")") # print
+ return result # exit
+
+
+ # then watch if need /voice
+ if C_VOICE.has_key(server):
+ chans = C_VOICE[server]
+ try:
+ # find nick and channel
+ user, channel = args.split(" JOIN ")
+ nick, next = user.split("!")
+ if channel.startswith(':'):
+ channel = channel[1:]
+ except ValueError:
+ result = weechat.PLUGIN_RC_KO
+ else:
+ if channel in chans:
+ weechat.command("/voice "+nick, channel, server) # voice nick
+ weechat.prnt("[voice] "+nick+" on "+channel+"("+server+")") # print info
+ return result # exit
+
+ # otherwise: nothing to do
+ return result
+
+
+# register and add function to weechat
+weechat.register("auto_op", "0.3", "", "auto op plug-in for weechat")
+weechat.add_message_handler ("join", "auto_op")
+
Changes to src/weechat/scripts/python/autoauth.py
@@ -1,1 +1,245 @@
+# -*- coding: iso-8859-1 -*-
+
+# =============================================================================
+# autoauth.py (c) October 2005 by kolter <kolter+dev@openics.org>
+# Python script for WeeChat.
+#
+# Licence : GPL v2
+# Description : Permits to auto-authenticate when changing nick
+# Syntax : try /auth help to get help on this script
+#
+#
+# ### changelog ###
+#
+# * version 0.5
+# - fix bug when script script is run for first time
+# - rewrite half script to improve access to settings
+# - add a feature to permit to run command(s) when identified
+# - add completion for commands
+# * version 0.4
+# - use set_plugin_config and get_plugin_config to read ans save settings
+# - remove deprecated import
+# * version 0.3
+# - add return codes
+# * version 0.2
+# - correct weechatdir with weechat_dir while using weechat.get_info
+# * version 0.1 :
+# - first release
+#
+# =============================================================================
+
+
+VERSION="0.5"
+NAME="autoauth"
+
+import weechat
+
+weechat.register (NAME, VERSION, "", "Auto authentification while changing nick")
+weechat.add_message_handler("NOTICE", "auth_notice_check")
+weechat.add_command_handler(
+ "auth",
+ "auth_command",
+ "Auto authentification while changing nick",
+ "{ add $nick $pass [$server=current] | del $nick [$server=current] | list | cmd [$command [$server=current]] }",
+ " add : add authorization for $nick with password $pass for $server\n"
+ " del : del authorization for $nick for $server\n"
+ " list : list all authorization settings\n"
+ " cmd : command(s) (separated by '|') to run when identified for $server\n"
+ " %n will be replaced by current nick in each command",
+ "add|del|list|cmd %- %S %S"
+ )
+
+def auth_cmdlist():
+ cmd = ''
+ cmds = weechat.get_plugin_config("commands")
+ if cmds == '':
+ weechat.prnt("[%s] commands (empty)" % (NAME))
+ else:
+ weechat.prnt("[%s] commands (list)" % (NAME))
+ for c in cmds.split("####"):
+ weechat.prnt(" --> %s : '%s' " % (c.split(":::")[0], c.split(":::")[1]))
+
+def auth_cmdget(server):
+ cmd = ''
+ cmds = weechat.get_plugin_config("commands")
+ if cmds != '':
+ for c in cmds.split("####"):
+ if c.find(":::") != -1:
+ if c.split(":::")[0] == server:
+ cmd = ":::".join(c.split(":::")[1:])
+ break
+ return cmd
+
+def auth_cmdset(server, command):
+ cmds = weechat.get_plugin_config("commands")
+
+ found = False
+ conf = []
+ if cmds != '':
+ for c in cmds.split("####"):
+ if c.find(":::") != -1:
+ if c.split(":::")[0] == server:
+ found = True
+ conf.append("%s:::%s" % (server, command))
+ else:
+ conf.append(c)
+ if not found:
+ conf.append("%s:::%s" % (server, command))
+
+ weechat.set_plugin_config("commands", "####".join(conf))
+ weechat.prnt("[%s] command '%s' successfully added for server %s" % (NAME, command, server))
+
+def auth_cmdunset(server):
+ cmds = weechat.get_plugin_config("commands")
+
+ found = False
+ conf = []
+ if cmds != '':
+ for c in cmds.split("####"):
+ if c.find(":::") != -1:
+ if c.split(":::")[0] != server:
+ conf.append(c)
+ else:
+ found = True
+ if found:
+ weechat.prnt("[%s] command for server '%s' successfully removed" % (NAME, server))
+ weechat.set_plugin_config("commands", "####".join(conf))
+
+def auth_cmd(args, server):
+ if server == '':
+ if args == '':
+ auth_cmdlist()
+ else:
+ weechat.prnt("[%s] error while setting command, can't find a server" % (NAME))
+ else:
+ if args == '':
+ auth_cmdunset(server)
+ else:
+ auth_cmdset(server, args)
+
+def auth_list():
+ data = weechat.get_plugin_config("data")
+
+ if data == "":
+ weechat.prnt("[%s] accounts (empty)" % (NAME))
+ else:
+ weechat.prnt("[%s] accounts (list)" % (NAME))
+ for e in data.split(","):
+ if e.find("=") == -1:
+ continue
+ (serv_nick, passwd) = e.split("=")
+ (server, nick) = serv_nick.split(".")
+ weechat.prnt(" --> %s@%s " % (nick, server))
+
+def auth_notice_check(server, args):
+ if args.find("If this is your nickname, type /msg NickServ") != -1 or args.find("This nickname is registered and protected.") != -1 :
+ passwd = auth_get(weechat.get_info("nick"), server)
+ if passwd != None:
+ weechat.command("/quote nickserv identify %s" % (passwd), "", server)
+ commands = auth_cmdget(server)
+ if commands != '':
+ for c in commands.split("|"):
+ weechat.command(c.strip().replace("%n", weechat.get_info('nick')))
+
+ return weechat.PLUGIN_RC_OK
+
+def auth_del(the_nick, the_server):
+ data = weechat.get_plugin_config("data")
+
+ found = False
+ conf = []
+ for e in data.split(","):
+ if e.find("=") == -1:
+ continue
+ (serv_nick, passwd) = e.split("=")
+ (server, nick) = serv_nick.split(".")
+ if the_nick == nick and the_server == server:
+ found = True
+ else:
+ conf.append("%s.%s=%s" % (server, nick, passwd))
+
+ if found:
+ weechat.set_plugin_config("data", ",".join(conf))
+ weechat.prnt("[%s] nick '%s@%s' successfully remove" % (NAME, the_nick, the_server))
+ else:
+ weechat.prnt("[%s] an error occured while removing nick '%s@%s' (not found)" % (NAME, the_nick, the_server))
+
+def auth_add(the_nick, the_passwd, the_server):
+ data = weechat.get_plugin_config("data")
+
+ found = False
+ conf = []
+ for e in data.split(","):
+ if e.find("=") == -1:
+ continue
+ (serv_nick, passwd) = e.split("=")
+ (server, nick) = serv_nick.split(".")
+ if the_nick == nick and the_server == server:
+ passwd = the_passwd
+ found = True
+ conf.append("%s.%s=%s" % (server, nick, passwd))
+
+ if not found:
+ conf.append("%s.%s=%s" % (the_server, the_nick, the_passwd))
+
+ weechat.set_plugin_config("data", ",".join(conf))
+ weechat.prnt("[%s] nick '%s@%s' successfully added" % (NAME, the_nick, the_server))
+
+def auth_get(the_nick, the_server):
+ data = weechat.get_plugin_config("data")
+
+ for e in data.split(","):
+ if e.find("=") == -1:
+ continue
+ (serv_nick, passwd) = e.split("=")
+ (server, nick) = serv_nick.split(".")
+ if the_nick == nick and the_server == server:
+ return passwd
+ return None
+
+def auth_command(server, args):
+ list_args = args.split(" ")
+
+ #strip spaces
+ while '' in list_args:
+ list_args.remove('')
+ while ' ' in list_args:
+ list_args.remove(' ')
+ if len(list_args) == 0:
+ weechat.command("/help auth")
+ elif list_args[0] not in ["add", "del", "list", "cmd"]:
+ weechat.prnt("[%s] bad option while using /auth command, try '/help auth' for more info" % (NAME))
+ elif list_args[0] == "cmd":
+ if len(list_args[1:]) == 1 and list_args[1] in weechat.get_server_info().keys():
+ auth_cmd("", list_args[1])
+ elif len(list_args[1:]) == 1:
+ auth_cmd(list_args[1], weechat.get_info('server'))
+ elif len(list_args[1:]) >= 2:
+ if list_args[-1] in weechat.get_server_info().keys():
+ auth_cmd(" ".join(list_args[1:-1]), list_args[-1])
+ else:
+ auth_cmd(" ".join(list_args[1:]), weechat.get_info('server'))
+ else:
+ auth_cmd(" ".join(list_args[1:]), weechat.get_info(server))
+ elif list_args[0] == "list":
+ auth_list()
+ elif list_args[0] == "add":
+ if len(list_args) < 3 or (len(list_args) == 3 and weechat.get_info("server") == ''):
+ weechat.prnt("[%s] bad option while using /auth command, try '/help auth' for more info" % (NAME))
+ else:
+ if len(list_args) == 3:
+ auth_add(list_args[1], list_args[2], weechat.get_info("server"))
+ else:
+ auth_add(list_args[1], list_args[2], list_args[3])
+ elif list_args[0] == "del":
+ if len(list_args) < 2:
+ weechat.prnt("[%s] bad option while using /auth command, try '/help auth' for more info" % (NAME))
+ else:
+ if len(list_args) == 2:
+ auth_del(list_args[1], weechat.get_info("server"))
+ else:
+ auth_del(list_args[1], list_args[2])
+ else:
+ pass
+ return weechat.PLUGIN_RC_OK
Changes to src/weechat/scripts/python/autoaway.py
@@ -1,1 +1,153 @@
+# --------------------------------------------------------------------
+#
+# Copyright (c) 2006 by Gwenn Gueguen <weechat@grumly.info>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#
+# --------------------------------------------------------------------
+# This script automatically sets away after a period of inactivity
+# --------------------------------------------------------------------
+
+
+import weechat
+
+
+"""
+/autoaway [time [message]]
+
+/autoaway whithout any parameter disables autoaway
+
+Script config:
+ time:
+ number of minutes of inactivity after which a user will be marked as away
+ message:
+ message that will be passed to the /away command
+ enabled:
+ is autoaway enabled ?
+"""
+
+
+SCRIPT_NAME="autoaway"
+SCRIPT_VERSION="0.2"
+SCRIPT_DESC="autoaway script for weechat"
+
+
+# Names of the settings
+CONFIG_TIME="time"
+CONFIG_MESSAGE="message"
+CONFIG_ENABLED="enabled"
+
+# Name of the command
+CMD_AUTOAWAY="autoaway"
+
+# Default settings
+DEFAULT_TIME="15"
+DEFAULT_MESSAGE="idle"
+
+# Interval (in seconds) between checks
+TIMER_VALUE=15
+
+
+def print_settings():
+ weechat.prnt("AutoAway settings:")
+ weechat.prnt(" time: %s minute(s)" % weechat.get_plugin_config(CONFIG_TIME))
+ weechat.prnt(" message: %s" % weechat.get_plugin_config(CONFIG_MESSAGE))
+ if weechat.get_plugin_config(CONFIG_ENABLED) == "true":
+ weechat.prnt(" enabled")
+ else:
+ weechat.prnt(" disabled")
+
+
+def autoaway(server, args):
+ weechat.remove_timer_handler("timer_handler")
+
+ params = args.split(None, 1)
+ if len(params) == 0:
+ weechat.set_plugin_config(CONFIG_ENABLED, "false")
+ else:
+ weechat.set_plugin_config(CONFIG_ENABLED, "true")
+ weechat.set_plugin_config(CONFIG_TIME, params[0])
+ if len(params) > 1:
+ weechat.set_plugin_config(CONFIG_MESSAGE, params[1])
+
+ previous_inactivity = int(weechat.get_info("inactivity"))
+ weechat.add_timer_handler(TIMER_VALUE, "timer_handler")
+
+ print_settings()
+
+ return weechat.PLUGIN_RC_OK
+
+
+def timer_handler():
+ global previous_inactivity, previous_state
+
+ # Get current away status
+ away_flag = int(weechat.get_info("away"))
+
+ # Get number of seconds of inactivity
+ idle_time = int(weechat.get_info("inactivity"))
+
+ if away_flag == previous_state:
+ # away flag was not changed outside this script
+ if away_flag and idle_time < previous_inactivity:
+ # Inactivity was reset (or overflowed ?)
+ weechat.command("/away -all")
+ elif not away_flag and idle_time >= (60 * int(weechat.get_plugin_config(CONFIG_TIME))):
+ # Time to go away
+ weechat.command("/away -all %s" % weechat.get_plugin_config(CONFIG_MESSAGE))
+
+ previous_state = int(weechat.get_info("away"))
+ previous_inactivity = idle_time
+
+ return weechat.PLUGIN_RC_OK
+
+
+if weechat.register(SCRIPT_NAME, SCRIPT_VERSION, "", SCRIPT_DESC):
+
+ try:
+ previous_state = int(weechat.get_info("away"))
+ except ValueError:
+ previous_state = 0
+
+ # Set config to default values if undefined
+ try:
+ idle_time = int(weechat.get_plugin_config(CONFIG_TIME))
+ except ValueError:
+ weechat.set_plugin_config(CONFIG_TIME, DEFAULT_TIME)
+
+ if weechat.get_plugin_config(CONFIG_MESSAGE) == None:
+ weechat.set_plugin_config(CONFIG_MESSAGE, DEFAULT_MESSAGE)
+
+ if weechat.get_plugin_config(CONFIG_ENABLED) == None:
+ weechat.set_plugin_config(CONFIG_ENABLED, "false")
+
+
+ # Display a summary of the settings
+ print_settings()
+
+
+ # Start the timer if necessary
+ if weechat.get_plugin_config(CONFIG_ENABLED) == "true":
+ previous_inactivity = int(weechat.get_info("inactivity"))
+ weechat.add_timer_handler(TIMER_VALUE, "timer_handler")
+
+
+ weechat.add_command_handler(CMD_AUTOAWAY, "autoaway", "Set autoaway",
+ "[time [message]]",
+ "time: number of minutes before being marked as away\n"
+ + "message: away message\n"
+ + "\n"
+ + "whithout any argument, autoaway will be disabled\n")
Changes to src/weechat/scripts/python/catapult.py
@@ -1,1 +1,429 @@
+#!/usr/bin/env python
+"""
+Catapult by Stalwart <stlwrt@gmail.com>
+Licensed under GNU GPL 2
+"""
+
+import weechat
+import random
+
+weechat.register("Catapult", "0.1", "", "Less ordinary abuse generator")
+weechat.add_command_handler("slap", "slapper", "Creative slapper", "<target>", "", "%n")
+weechat.add_command_handler("fortune", "fortune", "Fortune cookies!")
+weechat.add_command_handler("winjoke", "winjoke", "Windoze jokes")
+weechat.add_command_handler("linjoke", "linjoke", "Linux jokes")
+weechat.add_command_handler("give", "giver", "Creative giver", "<target>", "", "%n")
+weechat.add_command_handler("hate", "hater", "Creative hater", "<target>", "", "%n")
+weechat.add_command_handler("love", "lover", "Creative lover", "<target>", "", "%n")
+weechat.add_command_handler("dance", "dancer", "Creative dancer", "<target>", "", "%n")
+
+# slapper
+def slapper(server, args):
+ objects = [
+ "a rather large squid",
+ "a hydraulic pump",
+ "a book by Stephen King",
+ "a 10mbit network card",
+ "a ladies handbag",
+ "some girl scouts",
+ "a football team",
+ "a bottle",
+ "a yellow marshmellow",
+ "a match",
+ "the queen of England",
+ "a taxi",
+ "100 feet of wire",
+ "a bag of Cheerios",
+ "a hat",
+ "a fist",
+ "the back hand",
+ "with the forehead",
+ "a computer moniter",
+ "a coconut",
+ "a microfone",
+ "a cellphone",
+ "a snowplough",
+ "a doggy",
+ "Bill Clinton",
+ "a stone",
+ "a club. With a nail in it",
+ "a small asteroid, rich in iron",
+ "a small interstellar spaceship",
+ "a fresh zuccini",
+ "a laptop",
+ "a big dictionary",
+ "a baseball bat",
+ "NeverNet",
+ "some porn",
+ "a mIRC script",
+ "a canoe",
+ "a tortoise",
+ "a horse",
+ "the book of Kells",
+ "a whale",
+ "a rubber dildo",
+ "a well groomed poodle",
+ "a channel operator",
+ "a news paper (New York Times Sunday Edition)",
+ "a gnarly werewolf",
+ "a vampire. They really suck",
+ "a perl script",
+ "a bag of doggie chow",
+ "a fat walrus",
+ "an IP adress",
+ "a catholic priest",
+ "James Dean",
+ "Ronald MacDonald (he *IS* good for something)",
+ "Autoconf version 2.13",
+ "a PRIVMSG",
+ "an email adress",
+ "some ANSI color codes",
+ "a thermonuclear weapon. Yehaw",
+ "the hitch hikers guide to the galaxy, revised edition",
+ "Nessie, the Loch Ness monster",
+ "a tuna. Still in the can! *BONK* That will leave a mark",
+ "a few fluffy pillows",
+ "a red chinese dragon",
+ "a linux-manual (signed by L. Torvalds)",
+ "Stage1",
+ "Bill Gates underpants",
+ "GM Abraham and the whole OW-Staff",
+ "Sphere 1.0",
+ "a Linuxkernel",
+ "Lenin's Collected Works",
+ "Stalin's Collected Works",
+ "a iron Tux",
+ "a glowing 23",
+ "your mum (CLEAN YOUR ROOM!)",
+ "a complete GNOME-Documentation",
+ "a Portagetree",
+ "thand[Z]'s transparent Tanga",
+ "a Kernelpanic",
+ "Windoze XP",
+ "an AK-47 (die, you imperialist dog!)",
+ "a bag full with Michael Jacksons droped noses",
+ "an NBP-Manifesto (Hail Limonew! Hail our Leader! Hail!)",
+ "an NBP-Flag (Lead us to freedom, Leader Limonew!)",
+ "Mein Kampf (Doppelausgabe, Hardcover)",
+ "Invader Zim's iron fist",
+ "some ASCII-Arts",
+ "The Family Learning Channel",
+ "GOD",
+ "Dorian Grey's picture",
+ "some unlocked Grenades *BOOM*",
+ "the Win2k Buglist",
+ "a widescreen TV (it can damage your brain!)",
+ "a chain saw",
+ "a huge tree"
+ ]
+ if args <> "":
+ weechat.command("/me slaps %s with %s." % (args, random.choice(objects)))
+ return weechat.PLUGIN_RC_OK
+ else:
+ weechat.prnt("You must specify target")
+ return weechat.PLUGIN_RC_KO
+
+# fortune cookies
+def fortune(server, args):
+ objects = [
+ "There are three kinds of people: men, women, and unix.",
+ "BOFH Excuse #118: the router thinks its a printer.",
+ "CHUBBY CHECKER just had a CHICKEN SANDWICH in downtown DULUTH!",
+ "Think big. Pollute the Mississippi.",
+ "An optimist is a man who looks forward to marriage. A pessimist is a married optimist.",
+ "There are never any bugs you haven't found yet.",
+ "It don't mean a THING if you ain't got that SWING!!",
+ "Atomic batteries to power, turbines to speed. -- Robin, The Boy Wonder",
+ "Two wrongs don't make a right, but three lefts do.",
+ "A log may float in a river, but that does not make it a crocodile.",
+ "Art is Nature speeded up and God slowed down. -- Chazal",
+ "Texas law forbids anyone to have a pair of pliers in his possession.",
+ "UFOs are for real: the Air Force doesn't exist.",
+ "Expansion means complexity; and complexity decay.",
+ "I came, I saw, I deleted all your files.",
+ "The Magic of Windows: Turns a 486 back into a PC/XT.",
+ "Our vision is to speed up time, eventually eliminating it. -- Alex Schure",
+ "Breaking Windows isn't just for kids anymore...",
+ "Neckties strangle clear thinking. -- Lin Yutang",
+ "I'm prepared for all emergencies but totally unprepared for everyday life.",
+ "Yow! I just went below the poverty line!",
+ "Break into jail and claim police brutality.",
+ "BOFH Excuse #290: The CPU has shifted, and become decentralized.",
+ "Did you hear about the model who sat on a broken bottle and cut a nice figure?",
+ "We have a equal opportunity Calculus class -- it's fully integrated.",
+ "BOFH Excuse #170: popper unable to process jumbo kernel",
+ "It's later than you think.",
+ "My Aunt MAUREEN was a military advisor to IKE & TINA TURNER!!",
+ "Everyone hates me because I'm paranoid.",
+ "When you are in it up to your ears, keep your mouth shut.",
+ "Theory is gray, but the golden tree of life is green. -- Goethe",
+ "Most Texans think Hanukkah is some sort of duck call. -- Richard Lewis",
+ "grasshopotomaus: A creature that can leap to tremendous heights... once.",
+ "It takes both a weapon, and two people, to commit a murder.",
+ "Facts are the enemy of truth. -- Don Quixote",
+ "Forty two.",
+ "BOFH Excuse #424: operation failed because: there is no message for this error (#1014)",
+ "Never leave anything to chance; make sure all your crimes are premeditated.",
+ "BOFH Excuse #60: system has been recalled",
+ "Science and religion are in full accord but science and faith are in complete discord.",
+ "A likely impossibility is always preferable to an unconvincing possibility. -- Aristotle",
+ "The angry man always thinks he can do more than he can. -- Albertano of Brescia",
+ "Hello again, Peabody here... -- Mister Peabody",
+ "Nobody ever died from oven crude poisoning.",
+ "Dogs crawl under fences... software crawls under Windows 95.",
+ "Say something you'll be sorry for, I love receiving apologies.",
+ "NOTICE: -- THE ELEVATORS WILL BE OUT OF ORDER TODAY -- (The nearest working elevator is in the building across the street.)",
+ "THERE ARE PLENTY OF BUSINESSES LIKE SHOW BUSINESS -- Bart Simpson on chalkboard in episode 1F19",
+ "Life is what happens to you while you're busy making other plans. -- John Lennon, Beautiful Boy",
+ "While having never invented a sin, I'm trying to perfect several.",
+ "Emacs, n.: A slow-moving parody of a text editor.",
+ " ... with liberty and justice for all ... who can afford it.",
+ "Princess Leia: Aren't you a little short for a stormtrooper?",
+ "The Official Colorado State Vegetable is now the 'state legislator'",
+ "Abandon the search for Truth; settle for a good fantasy.",
+ "There's nothing to writing. All you do is sit at a typewriter and open a vein. -- Red Smith",
+ "Our OS who art in CPU, UNIX be thy name. Thy programs run, thy syscalls done, In kernel as it is in user!",
+ "All hope abandon, ye who enter here! -- Dante Alighieri",
+ "The human mind ordinarily operates at only ten percent of its capacity -- the rest is overhead for the operating system.",
+ "Professor: 'If a dog craps anywhere in the universe, you can bet I won't be out of loop.'",
+ "I WILL NOT MAKE FLATUENT NOISES IN CLASS -- Bart Simpson on chalkboard in episode 7F13",
+ "Listen you donkey raping shit eater.",
+ "In specifications, Murphy's Law supersedes Ohm's.",
+ "One of Bender's kids: Our dad is a giant toy!",
+ "I am a jelly donut. I am a jelly donut.",
+ "We are all in the gutter, but some of us are looking at the stars. -- Oscar Wilde",
+ "Bender to Zoidberg: 'You're looking less nuts, crabby.'",
+ "Things will be bright in P.M. A cop will shine a light in your face.",
+ "A journey of a thousand miles begins with a cash advance.",
+ "Everything that can be invented has been invented. -- Charles Duell, Director of U.S. Patent Office, 1899",
+ "Vote anarchist.",
+ "paranoia, n.: A healthy understanding of the way the universe works.",
+ "BOFH Excuse #401: Sales staff sold a product we don't offer.",
+ "BOFH Excuse #200: The monitor needs another box of pixels.",
+ "The important thing is not to stop questioning.",
+ "Not all men who drink are poets. Some of us drink because we aren't poets.",
+ "Oh my god, dude!",
+ "BOFH Excuse #441: Hash table has woodworm",
+ "BOFH Excuse #112: The monitor is plugged into the serial port",
+ "There's so much to say but your eyes keep interrupting me.",
+ "For the next hour, WE will control all that you see and hear.",
+ "Reality continues to ruin my life. -- Calvin",
+ "The shortest distance between two points is under construction. -- Noelie Alito",
+ "BOFH Excuse #192: runaway cat on system.",
+ "My haircut is totally traditional!",
+ "You! What PLANET is this! -- McCoy, 'The City on the Edge of Forever', stardate 3134.0",
+ "BOFH Excuse #433: error: one bad user found in front of screen",
+ "Dyslexics have more fnu.",
+ "I'm not stupid, I'm not expendable, and I'M NOT GOING!",
+ "It's clever, but is it art?",
+ "His life was formal; his actions seemed ruled with a ruler.",
+ "Yeah. Except for being entirely different, they're pretty much the same.",
+ "Oh, I get it!! 'The BEACH goes on', huh, SONNY??",
+ "Ban the bomb. Save the world for conventional warfare.",
+ "Everything that you know is wrong, but you can be straightened out.",
+ "If I pull this SWITCH I'll be RITA HAYWORTH!! Or a SCIENTOLOGIST!",
+ "Tex SEX! The HOME of WHEELS! The dripping of COFFEE!! Take me to Minnesota but don't EMBARRASS me!!",
+ "clovek, ktory si ako prvy kupil fax musel byt strasny kokot.",
+ "Are you a turtle?",
+ "You will be the last person to buy a Chrysler.",
+ "If in doubt, mumble.",
+ "Nice guys don't finish nice.",
+ "You cannot use your friends and have them too.",
+ "Microsoft is to Software as McDonalds is to Cuisine.",
+ "panic: can't find /",
+ "I used to be an agnostic, but now I'm not so sure.",
+ "May your SO always know when you need a hug.",
+ "We are MicroSoft. You will be assimilated. Resistance is futile. (Attributed to B.G., Gill Bates)",
+ "Life is a whim of several billion cells to be you for a while.",
+ "BOFH Excuse #347: The rubber band broke",
+ "Death has been proven to be 99% fatal in laboratory rats.",
+ "There are only two kinds of tequila. Good and better.",
+ "C for yourself.",
+ "Tact, n.: The unsaid part of what you're thinking.",
+ "Shit Happens."
+ ]
+ weechat.command(("Wanda the Fish says: %s") % random.choice(objects))
+ return weechat.PLUGIN_RC_OK
+
+# winjoke
+def winjoke(server, args):
+ objects = [
+ "Windows NT, from the people who invented EDLIN!",
+ "Windows: Microsoft's tax on computer illiterates.",
+ "The nice thing about Windows is - It does not just crash, it displays a dialog box and lets you press 'OK' first.",
+ "Why use Windows, since there is a door?",
+ "In a world without fences who needs Gates?",
+ "Another name for a Windows tutorial is crash course!",
+ "Failure is not an option -- it comes bundled with Windows.",
+ "NT... the last two letters of bowel movement",
+ "Some software money can't buy. For everything else there's Micros~1.",
+ "Sticks and Stones may break my bones but FUD will never concern me.",
+ "Every program expands until it can send mail. ...Except Exchange. ",
+ "Microsoft: 'You've got questions. We've got dancing paperclips.'",
+ ".vbs = Virus Bearing Script?",
+ "Technology is positive when the creators put the interests of their users before their bottom line.",
+ "Have you ever noticed that at trade shows Microsoft is always the one giving away stress balls?",
+ "Do you remember when you only had to pay for windows when *you* broke them? (Submitted by Noel Maddy)",
+ "National Weather Service advice for those threatened by severe thunderstorms: 'Go inside a sturdy building and stay away from WINDOWS!' (Submitted by Ben Bullock)",
+ "Microsoft is to Software as McDonalds is to Cuisine.",
+ "Microsoft should switch to the vacuum cleaner business where people actually want products that suck. (Submitted by Bruno Bratti)",
+ "Everyone seems so impatient and angry these days. I think it's because so many people use Windows at work -- do you think you'd be Politeness Man after working on Windows 8 hrs. or more? (Submitted by Chip Atkinson)",
+ "NT 5.0 so vaporous it's in danger of being added to the periodic table as a noble gas. (Spotted in a Slashdot discussion)",
+ "My Beowulf cluster will beat your Windows NT network any day. (Submitted by wbogardt[at]gte.net)",
+ "It's no wonder they call it WinNT; WNT = VMS++; (Submitted by Chris Abbey)",
+ "Double your disk space - delete Windows! (Submitted by Albert Dorofeev)",
+ "The Edsel. New Coke. Windows 2000. All mandatory case studies for bizschool students in 2020. (From a LinuxToday post by Bear Giles)",
+ "I will never trust someone called GATES that sells WINDOWS. (Submitted by Federico Roman)",
+ "'Microsoft technology' -- isn't that an oxymoron?",
+ "MCSE == Mentally Challenged Slave of the Empire.",
+ "Windows NT -- it'll drive you buggy!",
+ "Where do you want to go today? Don't ask Microsoft for directions.",
+ "MS and Y2K: Windows 95, 98, ... and back again to 01",
+ "There's the light at the end of the the Windows.",
+ "People use dummies for crash-tests. Windows is so difficult they had to educate the dummies first -- by giving them 'Windows for Dummies' books!",
+ "Windows: The first user interface where you click Start to turn it off.",
+ "NT == No Thanks",
+ "With Windows Millennium, Microsoft was able to get the boot time down to 25 seconds. That's almost as short as it's uptime.",
+ "Windows 2000: Designed for the Internet. The Internet: Designed for UNIX.",
+ "MCSE = Minesweeper Consultant, Solitaire Expert",
+ "MCSE = Meaningless Certificate, Software Expired",
+ "I'm not a programmer, but I play one at Microsoft.",
+ "Microsoft Zen - Become one with the blue screen.",
+ "The next hot technology from Microsoft will be object-oriented assembly."
+ ]
+ weechat.command(("Wanda the Fish says: %s") % random.choice(objects))
+ return weechat.PLUGIN_RC_OK
+
+# linjoke
+def linjoke(server, args):
+ objects = [
+ "Got Linux?",
+ "Microsoft gives you Windows... Linux gives you the whole house.",
+ "Linux, DOS, Windows NT -- The Good, the Bad, and the Ugly",
+ "Linux: the operating system with a CLUE... Command Line User Environment",
+ "If Bill Gates is the Devil then Linus Torvalds must be the Messiah.",
+ "Linux. Where do you want to go tomorrow?",
+ "Linux: The choice of a GNU generation",
+ "When you say I wrote a program that crashed Windows, people just stare at you blankly and say Hey, I got those with the system, *for free*. -- Linus Torvalds",
+ "We all know Linux is great...it does infinite loops in 5 seconds. -- Linus Torvalds",
+ "Some people have told me they dont think a fat penguin really embodies the grace of Linux, which just tells me they have never seen a angry penguin charging at them in excess of 100mph. Theyd be a lot more careful about what they say if they had. -- Linus Torvalds",
+ "Veni, vidi, Linux!",
+ "Type cat vmlinuz > /dev/audio to hear the Voice of God.",
+ "Linux: Because a PC is a terrible thing to waste.",
+ "Linux: Because rebooting is for adding new hardware",
+ "We are Linux. Resistance is measured in Ohms.",
+ "Free Software: the Software by the People, of the People and for the People. Develop! Share! Enhance! and Enjoy! (Submitted by Andy Tai)",
+ "Get it up, keep it up... LINUX: Viagra for the PC. (Submitted by Chris Abbey)",
+ "Peace, Love and Compile the kernel.... (Submitted by Justin L. Herreman)",
+ "Free your software, and your ass will follow",
+ "Reset button? Which reset button? - Linux, the OS that never sleeps.",
+ "Linux: Where do you want to GO... Oh, Im already there!",
+ "Windows contains FAT. Use Linux -- you wont ever have to worry about your weight.",
+ "Oh My God! They Killed init! You Bastards!",
+ "Unix: Where /sbin/init is still Job 1."
+ ]
+ weechat.command(("Wanda the Fish says: %s") % random.choice(objects))
+ return weechat.PLUGIN_RC_OK
+
+# giver
+def giver(server, args):
+ objects = [
+ "a binary four",
+ "a nice cup of SHUT THE FUCK UP",
+ "an asskick",
+ "a sign: 'Please kill yourself'",
+ "a sign: 'Please go home now'",
+ "an unlocked Grenade *tick tick BOOM*",
+ "a gun - do it for mankind!"
+
+ ]
+ if args <> "":
+ weechat.command("/me gives %s %s." % (args, random.choice(objects)))
+ return weechat.PLUGIN_RC_OK
+ else:
+ weechat.prnt("You must specify target")
+ return weechat.PLUGIN_RC_KO
+
+# hater
+def hater(server, args):
+ objects = [
+ "so much, that he spits hellfire",
+ "so much, that he want's to shoot someone",
+ "SOOOO MUUUUCH!!!"
+
+ ]
+ if args <> "":
+ weechat.command("/me hates %s %s." % (args, random.choice(objects)))
+ return weechat.PLUGIN_RC_OK
+ else:
+ weechat.prnt("You must specify target")
+ return weechat.PLUGIN_RC_KO
+
+# lover
+def lover(server, args):
+ actions = [
+ "a *mwah*",
+ "a wet kiss",
+ "a tight and long hug",
+ "an ass-squeeze",
+ "a tight hug",
+ "a wet kiss",
+ "a nice, tight hug",
+ "a kiss on the cheek",
+ "a wet, french kiss",
+ "a kiss",
+ "a hug",
+ "sex",
+ "sweet romance",
+ "some groping",
+ "bed actions",
+ "oral sex",
+ "a porn-tape",
+ "anal love",
+ ]
+ if args <> "":
+ weechat.command("/me cheers %s with %s.." % (args, random.choice(actions)))
+ return weechat.PLUGIN_RC_OK
+ else:
+ weechat.prnt("You must specify target")
+ return weechat.PLUGIN_RC_KO
+# dancer
+def dancer(server, args):
+ objects = [
+ "used condoms",
+ "condoms",
+ "used tampons",
+ "tampons",
+ "roses",
+ "rosebuds",
+ "rice",
+ "uncooked rice",
+ "bananas",
+ "little pieces of paper with the text *YAY!* on",
+ "little pieces of paper with the text *w00t!* on",
+ "little pieces of paper with the text *WOOHOO!* on",
+ "little pieces of paper with the text *Kiss my cheek!* on",
+ "coconuts with faces on",
+ "little pieces of paper with the text *LOVE ROCKS!* on",
+ "little pieces of paper with the text *LETS HAVE SEX!* on",
+ "little pieces of paper with the text *GOD BLESS AMERICA!* on",
+ "balloons with faces on",
+ "balloons",
+ "chocolate cakes",
+ "english teachers",
+ "pr0n magazines",
+ "vietnamese kids",
+ "snowballs",
+ "rocks",
+ "Michael Jackson (naked)",
+ "unlocked Grenades *BOOM*",
+ "Nine Inch Nails",
+ "Bodyparts (bloody, wet & sexy)",
+ ]
+ if args <> "":
+ weechat.command("/me dances around %s throwing %s.." % (args, random.choice(objects)))
+ return weechat.PLUGIN_RC_OK
+ else:
+ weechat.prnt("You must specify target")
+ return weechat.PLUGIN_RC_KO
Changes to src/weechat/scripts/python/clonescan.py
@@ -1,1 +1,168 @@
+#
+# Copyright (c) 2006 by SpideR <spider312@free.fr> http://spiderou.net
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#
+
+# WeeChat clone scanner
+# Scans clones on a chan when you ask it to do (/clones)
+# Able to scan for a nick's clones on each join, if you ask it to do (/autoclones)
+
+import weechat
+
+SCRIPT_NAME="clonescan"
+SCRIPT_VERSION="0.1"
+SCRIPT_DESC="clonescan script for weechat"
+SCRIPT_DISP=SCRIPT_NAME+" v"+SCRIPT_VERSION
+
+# Register, Handlers, config check/creation
+if weechat.register(SCRIPT_NAME, SCRIPT_VERSION, "unload", SCRIPT_DESC):
+ weechat.add_command_handler("clones","scanchan",
+ "Scans clones on specified or current chan",
+ "[#chan]")
+ weechat.add_command_handler("autoclones","toggleauto",
+ "Manage auto clone-scanning",
+ "[enable|disable|show]")
+ weechat.add_message_handler ("join", "scanjoin")
+ autoscan = weechat.get_plugin_config("autoscan")
+ if ( ( autoscan != "true" ) and ( autoscan != "false" ) ):
+ weechat.set_plugin_config("autoscan","false")
+ weechat.prnt("Unconfigured autoscan set to 'disabled', to enable : /autoclones enable")
+ weechat.prnt(SCRIPT_DISP+" loaded")
+else:
+ weechat.prnt(SCRIPT_DISP+" not loaded")
+
+# Unload handler
+def unload():
+ weechat.prnt("starting "+SCRIPT_DISP+" unload ...")
+ return 0
+
+# Auto scan on JOIN
+def scanjoin(server,args):
+ result = weechat.PLUGIN_RC_OK
+ if ( weechat.get_plugin_config("autoscan") == "true" ):
+ try: # Cut args because it contains nick, host and chan
+ nothing, user, chan = args.split(":") # :Mag!Magali@RS2I-35243B84.ipt.aol.com JOIN :#bringue
+ nick, next = user.split("!") # Mag!Magali@RS2I-35243B84.ipt.aol.com JOIN
+ userathost, nothing = next.split(" JOIN ") # Magali@RS2I-35243B84.ipt.aol.com JOIN
+ host = removeuser(userathost) # Magali@RS2I-35243B84.ipt.aol.com
+ # Problems with IPv6 hosts' ":" :
+ # [:higuita!n=higuita@2001:b18:400f:0:211:d8ff:fe82:b10e JOIN :#weechat]
+ except ValueError:
+ result = weechat.PLUGIN_RC_KO
+ weechat.prnt("Eror parsing args : ["+args+"]",server,server)
+ else:
+ clones = scannick(server,chan,nick,host) # Scan for that user's clones
+ if ( len(clones) > 0):
+ disp = "Clone sur "+chan+"@"+server+" : "+dispclones(nick,clones,host)
+ weechat.print_infobar(5,disp) # Display on infobar
+ weechat.prnt(disp) # Display on current buffer
+ weechat.prnt(disp,server,server) # Display on server buffer
+ return result
+
+# Config auto scan
+def toggleauto(server,args):
+ # Get current value
+ autoscan = weechat.get_plugin_config("autoscan")
+ # Testing / repairing
+ if ( autoscan == "true" ):
+ auto = True
+ elif ( autoscan == "false" ):
+ auto = False
+ else:
+ weechat.prnt("Unknown value ["+autoscan+"], disabling")
+ weechat.set_plugin_config("autoscan","false")
+ auto = False
+ # managing arg
+ if ( args == "enable" ):
+ if auto:
+ weechat.prnt("Auto clone scanning remain enabled")
+ else:
+ weechat.set_plugin_config("autoscan","true")
+ weechat.prnt("Auto clone scanning is now enabled")
+ elif ( args == "disable" ):
+ if auto:
+ weechat.set_plugin_config("autoscan","false")
+ weechat.prnt("Auto clone scanning is now disabled")
+ else:
+ weechat.prnt("Auto clone scanning remain disabled")
+ elif ( args == "break" ):
+ weechat.set_plugin_config("autoscan","blah")
+ else:
+ if auto:
+ weechat.prnt("Auto clone scanning enabled")
+ else:
+ weechat.prnt("Auto clone scanning disabled")
+ return weechat.PLUGIN_RC_OK
+
+# Manual channel scan
+def scanchan(server,args):
+ # Defining chan to scan (contained in args, current chan otherwise)
+ if ( args == "" ):
+ chan = weechat.get_info("channel",server)
+ else:
+ chan = args
+ # Scan
+ if ( chan != "" ):
+ nicks = weechat.get_nick_info(server,chan)
+ allclones = [] # List containing all detected clones, for not to re-scan them
+ nbclones = 0 # number of clones
+ if nicks != None:
+ if nicks != {}:
+ weechat.prnt("Scanning "+chan+" ...")
+ for nick in nicks:
+ if nick not in allclones:
+ host = removeuser(nicks[nick]["host"])
+ clones = scannick(server,chan,nick,host)
+ if ( len(clones) > 0 ):
+ allclones = allclones + clones
+ nbclones = nbclones+1
+ weechat.prnt(" - "+dispclones(nick,clones,host))
+ weechat.prnt(str(nbclones)+" clones found")
+ else:
+ weechat.prnt("Nobody on "+chan+", are you sure it's a chan and you are present on it ?")
+ else:
+ weechat.prnt("Eror reading nick list")
+ else:
+ weechat.prnt("Not on a chan")
+ return weechat.PLUGIN_RC_OK
+
+# Scan of a nick
+# Returns list of nick clones (not containing nick himself)
+def scannick(server,chan,nick,host):
+ cloneof = []
+ compares = weechat.get_nick_info(server,chan)
+ if compares != None:
+ if compares != {}:
+ for compare in compares:
+ if ( ( nick != compare ) and ( host == removeuser(compares[compare]["host"])) ):
+ cloneof.append(compare)
+ else:
+ weechat.prnt("pas de pseudo")
+
+ else:
+ weechat.prnt("erreur de lecture des pseudos")
+ return cloneof
+
+# Display of one clone line
+def dispclones(nick,clones,host):
+ clones.append(nick)
+ clones.sort()
+ return str(clones)+" ("+host+")"
+# Return host by user@host
+def removeuser(userathost):
+ splitted = userathost.split("@")
+ return splitted[1]
Changes to src/weechat/scripts/python/ctcp.py
@@ -1,1 +1,156 @@
+"""
+ :Author: Henning Hasemann <hhasemann [at] web [dot] de>
+ :Updated: Daga <daga [at] daga [dot] dyndns [dot] org>
+
+ :What it does:
+ With this script you can configure weechat
+ to give custom responses to CTCP-Requests.
+
+ :Usage:
+ Load this file somehow.
+ You can configure replies to CTCP-requests
+ with the /set_ctcp - command. (examples below)
+
+ Released under GPL license.
+
+ Hope you enjoy it :-)
+ -- Henning aka asmanian
+"""
+
+version = "0.8"
+history = """
+ 0.1 initial
+ 0.2
+ - now displays a "CTCP FOOBAR received from ..."
+ 0.3
+ - now /help set_ctcp is available
+ 0.4
+ - corrected a few typos
+ - made special variables (e.g. version) easier to use
+ 0.5
+ - removed debugging messages
+ 0.6
+ - bugfix (sometimes /set_ctcp did not work)
+ 0.7 (Daga)
+ - added multi-server support
+ 0.8
+ - fixed on_msg (occasionally caused a minor fault)
+"""
+
+short_syntax = """[REQUEST ANSWER]"""
+
+syntax = """ Examples:
+
+ /set_ctcp
+ show settings for common CTCP-Requests.
+ where "OFF" means "use weechat default behaviour.
+
+ /set_ctcp VERSION I prefer using weechat $version
+ Reply with a fancy message.
+ $version is substituted with weechats version.
+ Other variables are: $away, $nick and $server.
+ (If you find something else that could make sense
+ here, let me know!)
+
+ /set_ctcp HOW_ARE_YOU Good.
+ Set answer to a rather unusual CTCP-request.
+
+ /set_ctcp VERSION OFF
+ Disable special behavior when CTCP VERSION comes in.
+ atm this leaves an entry in plugins.rc which
+ can be safely removed.
+"""
+
+
+import weechat as wc
+import re
+
+wc.register("ctcp", version, "", "Customize CTCP replies")
+wc.add_command_handler("set_ctcp", "set", "", short_syntax, syntax)
+wc.add_message_handler("privmsg", "on_msg")
+
+if not wc.get_plugin_config("requests"):
+ wc.set_plugin_config("requests", " ".join(["VERSION", "USERINFO", "FINGER", "TIME", "PING"]))
+
+def get_answers():
+ # Strangely, get_plugin_config sometimes returns
+ # the integer 0
+ requests = wc.get_plugin_config("requests")
+ if requests:
+ requests = requests.split()
+ else:
+ requests = ["VERSION", "USERINFO", "FINGER", "TIME", "PING"]
+
+ d = {}
+ for r in requests:
+ d[r] = wc.get_plugin_config("CTCP_" + r)
+ return d
+
+def set_answer(k, v):
+ wc.set_plugin_config("CTCP_" + k, v)
+ requests = wc.get_plugin_config("requests").split()
+ if k.upper() not in requests:
+ requests.append(k.upper())
+ wc.set_plugin_config("requests", " ".join(requests))
+
+def show_syntax():
+ wc.prnt("usage: /set_ctcp %s" % short_syntax)
+ wc.prnt("(For more information type /help set_ctcp)")
+
+def on_msg(server, args):
+ nothing, info, message = args.split(":", 2)
+ hostmask = info.split(None, 2)[0]
+ source = hostmask.split("!")[0]
+
+ answers = get_answers()
+
+ try:
+ if message.startswith("\x01") and message.endswith("\x01"):
+ req = message[1:-1]
+ ans = answers[req]
+ if not ans or ans == "OFF":
+ raise ValueError
+
+ info = {
+ "version": wc.get_info("version"),
+ "nick": wc.get_info("nick"),
+ "away": wc.get_info("away") and "away" or "there",
+ "server": server,
+ }
+
+ while True:
+ match = re.search(r'[^\\]\$([a-z]+)\b', ans) #, r'--\1--', ans)
+ if match is None: break
+ else:
+ l, r = match.span()
+ ans = ans[:l+1] + info.get(match.group(1), "$" + match.group(1)) + ans[r:]
+
+ wc.prnt("CTCP %s received from %s (on %s)" % (req, source, server))
+ wc.command("/quote NOTICE %s :\x01%s %s\x01" % (
+ source, req, ans), "", server)
+ return wc.PLUGIN_RC_OK_IGNORE_ALL
+
+ except Exception, e:
+ pass
+
+ return wc.PLUGIN_RC_OK
+
+def set(server, args):
+ try:
+ argv = args.split(None, 1)
+ answers = get_answers()
+
+ if not len(argv):
+ for k, v in answers.items():
+ wc.prnt("%10s: %s" % (k, v or "OFF"))
+
+ elif len(argv) == 2:
+ set_answer(argv[0], argv[1])
+
+ else:
+ show_syntax()
+ except Exception, e:
+ pass
+
+ return wc.PLUGIN_RC_OK
Changes to src/weechat/scripts/python/gimmicks.py
@@ -1,1 +1,99 @@
+# -*- coding: iso-8859-15 -*-
+
+"""
+ :Author: Henning Hasemann <hhasemann [at] web [dot] de>
+
+ Usage:
+
+ - Load this plugin
+ - In a channel or query type "/flip foo something" to
+ send the reversed text "gnihtemos oof"
+ - In a channel or query type "/leet something else" to
+ send the h4x02-5r!pT - Version of your text.
+ (Please use with caution such crap is discouraged in most channels)
+
+ Released under GPL licence.
+"""
+
+__version__ = "0.1"
+__history__ = """
+ 0.1 initial
+"""
+
+short_syntax = """TEXT"""
+syntax_flip = """ Example:
+
+ /flip foo bar
+ sends "rab oof" to the channel
+"""
+syntax_leet = """ Example:
+
+ /leet eleet
+ sends "31337" (or similar) to the channel
+"""
+
+import weechat as wc
+import string, random
+
+wc.register("gimmicks", __version__, "", "string gimmicks")
+wc.add_command_handler("flip", "flip", "", short_syntax, syntax_flip)
+wc.add_command_handler("leet", "leet", "", short_syntax, syntax_leet)
+
+leet_dict = {
+ "e": ["3"],
+ "l": ["1", "!", "|"],
+ "r": ["|2"],
+ "b": ["8"],
+ "v": [r'\/'],
+ "t": ["7"],
+ "i": ["!"],
+ "w": [r'\/\/', 'vv'],
+ "a": ["/\\", "<|", "4"],
+ "k": ["x"],
+ "n": [r'|\|'],
+ "s": ["5","$"],
+ "q": ["O."],
+ "z": ["zZz", "7_"],
+ "u": ["(_)"],
+ "p": ["|°", "|*"],
+ "d": ["|)", "I>", "ol"],
+ "f": ["i="],
+ "g": ["@"],
+ "h": ["|-|"],
+ "j": ["_I"],
+ "y": ["`/"],
+ "x": ["><"],
+ "c": ["[", "(", "{"],
+ "m": ["|v|", "nn"],
+ "o": ["0", "()"],
+}
+
+def leet(server, args):
+ casechange = True
+ strange = True
+ stay = False
+
+ r = ""
+ luflag = 0
+ for x in list(args):
+ if stay:
+ alt = [x]
+ else:
+ alt = []
+ if casechange:
+ alt.append(luflag and x.lower() or x.upper())
+ luflag = not luflag
+ if strange:
+ alt += leet_dict.get(x.lower(), [])
+ r += random.choice(alt)
+ wc.command(r)
+ return 0
+
+def flip(server, args):
+ l = list(args)
+ l.reverse()
+ wc.command("".join(l))
+ return 0
+
+
Changes to src/weechat/scripts/python/keepnick.py
@@ -1,1 +1,204 @@
+# -*- encoding: iso-8859-1 -*-
+#
+# Copyright (c) 2006 by EgS <i@egs.name>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#
+
+
+#######################################################################
+# #
+# This script enables the user to keep their nicks and recover it in #
+# case it get's stolen. It uses the servers prefered nicks, so there #
+# is no need for any kind of setup. #
+# #
+# Name: Keepnick #
+# Licence: GPL v2 #
+# Author: Marcus Eggenberger <i@egs.name> #
+# #
+# Usage: #
+# /keepnick on|off|<positive number> #
+# #
+# use /help command for detailed information #
+# #
+# Changelog: #
+# 0.4: now starts on load and features user defined check intervals #
+# 0.3: Fixed major bug with continuous nickchanges #
+# 0.2: Fixed Bug: now only checks connected servers #
+# 0.1: first version released #
+# #
+#######################################################################
+
+# ====================
+# Imports
+# ====================
+import sys
+
+# ====================
+# Constants
+# ====================
+NAME = 'Keepnick'
+VERSION = '0.4'
+DESCRIPTION = "Plugin to keep your nick and recover it in case it's stolen"
+
+ISON = '/ison %s'
+NICK = '/nick %s'
+
+NICKSTEALER_LEFT = "Nickstealer left Network: %s!"
+KEEPNICK_ARG_ERROR = "\"%s\" is not a valid argument to /keepnick"
+KEEPNICK_ON = "Keepnick locked and loaded! (checking every %s seconds)"
+KEEPNICK_OFF = "Keepnick offline!"
+
+DELAY = 10
+
+# ====================
+# Exceptions
+# ====================
+
+# ====================
+# Helpers
+# ====================
+class WeePrint(object):
+ def write(self, text):
+ text = text.rstrip(' \0\n') # strip the null byte appended by pythons print
+ if text:
+ weechat.prnt(text,'')
+
+def registerFunction(function):
+ # Register a python function as a commandhandler
+ # Function needs to be named like weeFunction and
+ # is bound to /function
+ # docstring is used for weechat help
+ functionname = function.__name__ # guess what :)
+ weecommand = functionname[3:].lower() # strip the wee
+
+ doc = function.__doc__.splitlines()
+ arguments = doc[0] # First docstring line is the arguments string
+ description = doc[1][4:]
+ args_description = '\n'.join([line[4:] for line in doc[2:-1]]) # join rest and strip indentation
+
+ if not function.func_defaults: # use args default value as template
+ template = ''
+ elif len(function.func_defaults) == 1:
+ template = function.func_defaults[0]
+ elif len(function.func_defaults) == 2:
+ template = func.func_defaults[1]
+
+ weechat.add_command_handler(weecommand, functionname, description, arguments, args_description, template)
+
+def registerFunctions():
+ functions = [function for name, function in globals().iteritems() if name.startswith('wee') and callable(function)]
+ for func in functions:
+ registerFunction(func)
+
+# ====================
+# Functions
+# ====================
+def servernicks(servername):
+ server = weechat.get_server_info()[servername]
+ servernicks = [server['nick1'], server['nick2'], server['nick3']]
+ return servernicks
+
+def ison(server, nicklist):
+ weechat.command(ISON % ' '.join(nicklist), "", server)
+
+def gotnick(server):
+ server = weechat.get_server_info()[server]
+ return server['nick'].lower() == server['nick1'].lower()
+
+def checknicks():
+ for servername, server in weechat.get_server_info().iteritems():
+ if not gotnick(servername) and server['ssl_connected'] + server['is_connected']:
+ ison(servername, servernicks(servername))
+ return weechat.PLUGIN_RC_OK
+
+def grabnick(server, nick):
+ if not gotnick(server):
+ print NICKSTEALER_LEFT % server
+ weechat.command(NICK % nick, '', server)
+
+def isonhandler(server, args):
+ nothing, message, nicks = args.split(':')
+ nicks = [nick.lower() for nick in nicks.split()]
+ for nick in servernicks(server):
+ if nick.lower() == weechat.get_info("nick",server):
+ return weechat.PLUGIN_RC_OK_IGNORE_ALL
+ elif nick.lower() not in nicks:
+ grabnick(server, nick)
+ return weechat.PLUGIN_RC_OK_IGNORE_ALL
+
+ if 0 in [nick.lower() in [mynick.lower() for mynick in servernicks(server)] for nick in nicks]:
+ # if any nick wich is return by ison is not on our checklist we're not the caller
+ return weechat.PLUGIN_RC_OK
+ else:
+ # seems like we're the caller -> ignore the output
+ return weechat.PLUGIN_RC_OK_IGNORE_ALL
+
+def weeKeepnick(server, args="ON|OFF"):
+ """ON|OFF|<positive number>
+ Enables or Disables the use of keepnick.
+ When active Keepnick ensures that you keep your preferred nicks.
+ Keepnick checks for the preferred nicks of each server config,
+ so there is no need to configure anything. Using a number as the
+ argument it sets the checkperiod to that number in seconds.
+
+ Example:
+ /keepnick ON
+ """
+ VALIDARGS = ['ON','OFF']
+
+ weechat.remove_handler('303', "isonhandler")
+ weechat.remove_timer_handler("checknicks")
+
+ try:
+ delay = int(args)
+ if delay < 1:
+ raise ValueError
+ globals()['DELAY'] = delay
+ except ValueError:
+ if args.upper() not in VALIDARGS:
+ print KEEPNICK_ARG_ERROR % args
+ return weechat.PLUGIN_RC_OK
+
+ if args.upper() != 'OFF':
+ weechat.add_timer_handler(DELAY,"checknicks")
+ weechat.add_message_handler('303', "isonhandler")
+ print KEEPNICK_ON % DELAY
+ else:
+ print KEEPNICK_OFF
+
+ return weechat.PLUGIN_RC_OK
+
+# ====================
+# Let's Register!
+# ====================
+if __name__ == '__main__':
+ try:
+ import weechat
+ except ImportError:
+ print "This script is to be loaded as PythonScript in WeeChat"
+ print "Get WeeChat now at: http://weechat.flashtux.org/"
+ import sys
+ sys.exit(10)
+
+ # kick pythons print to weechat.prnt(msg, '')
+ sys.stdout = WeePrint()
+ weechat.register(NAME, VERSION, "", DESCRIPTION)
+ registerFunctions()
+ weeKeepnick('','ON')
+
+
+
Changes to src/weechat/scripts/python/mpdnp.py
@@ -1,1 +1,101 @@
+"""
+ :Author: Henning Hasemann <hhasemann [at] web [dot] de>
+
+ :What it does:
+ This plugin lets you inform all users in the current
+ channel about the song which music-player-daemon (MPD)
+ is currently playing.
+
+ :Usage:
+ /mpdnp - Display file mpd is playing to current channel.
+
+ :Configuration Variables:
+ ============= ==========================================
+ Variable name Meaning
+ ============= ==========================================
+ host The host where your mpd runs
+ port The port to connect to mpd (usually 6600)
+ format How this script should display
+ whats going on.
+ You may use the following variables here:
+ $artist, $title_or_file,
+ $length_min, $length_sec, $pct,
+ $pos_min, $pos_sec
+
+ Released under GPL licence.
+"""
+
+todo = """
+ - maybe support sending commands to mpd.
+ - maybe make condional display
+ (displaying some characters only
+ if preceding or trailing variables are set)
+"""
+
+import weechat as wc
+import mpdclient as mpd
+import re
+from os.path import basename, splitext
+
+default_fmt = "/me 's MPD plays: $artist - $title_or_file ($length_min:$length_sec)"
+
+wc.register("mpdnp", "0.3", "", "np for mpd")
+
+def subst(text, values):
+ out = ""
+ n = 0
+ for match in re.finditer(findvar, text):
+ if match is None: continue
+ else:
+ l, r = match.span()
+ nam = match.group(1)
+ out += text[n:l+1] + values.get(nam, "") #"$" + nam)
+ n = r
+ return out + text[n:]
+
+def np(server, args):
+ """
+ Send information about the currently
+ played song to the channel.
+ """
+ host = wc.get_plugin_config("host")
+ port = int(wc.get_plugin_config("port"))
+ cont = mpd.MpdController(host=host, port=port)
+ song = cont.getCurrentSong()
+ pos, length, pct = cont.getSongPosition()
+
+ # insert artist, title, album, track, path
+ d = song.__dict__
+ d.update({
+ "title_or_file": song.title or splitext(basename(song.path))[0],
+ "pos_sec": "%02d" % (pos / 60),
+ "pos_min": str(pos / 60),
+ "length_sec": "%02d" % (length % 60),
+ "length_min": str(length / 60),
+ "pct": "%2.0f" % pct,
+ })
+
+ wc.command(subst(wc.get_plugin_config("format"), d))
+ return 0
+
+def dbgnp(server, args):
+ try:
+ return np(server, args)
+ except Exception, e:
+ print e
+
+wc.add_command_handler("mpdnp", "np", "", "", np.__doc__)
+
+findvar = re.compile(r'[^\\]\$([a-z_]+)(\b|[^a-z_])')
+
+default = {
+ "host": "localhost",
+ "port": "6600",
+ "format": default_fmt,
+}
+
+for k, v in default.items():
+ if not wc.get_plugin_config(k):
+ wc.set_plugin_config(k, v)
+
Changes to src/weechat/scripts/python/onattach.py
@@ -1,1 +1,445 @@
+# -*- encoding: iso-8859-1 -*-
+#
+# Copyright (c) 2006 by EgS <i@egs.name>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#
+
+
+#######################################################################
+# #
+# This script enables the execution of events triggered commands #
+# where the events are attach or detach of the screen weechat #
+# is running in. #
+# #
+# Name: OnAttach #
+# Licence: GPL v2 #
+# Author: Marcus Eggenberger <i@egs.name> #
+# #
+# Usage: #
+# /onattach or /ondetach to add new events #
+# /screenevents to manage events #
+# #
+# use /help command for detailed information #
+# #
+# Changelog: #
+# 0.5: added screen guessing to backup screen-detection #
+# 0.4: fixed TypeError in weechat 0.1.9 #
+# 0.3: now checking on startup if weechat runs in a screen #
+# 0.2: added usage of get/set_plugin_config to store eventlist #
+# 0.1: first version released #
+# #
+#######################################################################
+
+
+
+# ====================
+# Imports
+# ====================
+import os
+import sys
+
+# ====================
+# Constants
+# ====================
+NAME = 'OnAttach'
+VERSION = '0.5'
+DESCRIPTION = "Executing commands on screen Attach/Detach"
+
+OFF = False
+ON = True
+
+# ====================
+# Exceptions
+# ====================
+class OnAttachError(Exception):
+ pass
+
+# ====================
+# Helpers
+# ====================
+class WeePrint(object):
+ def write(self, text):
+ text = text.rstrip(' \0\n') # strip the null byte appended by pythons print
+ if text:
+ weechat.prnt(text,'')
+
+def getScreenByPpid():
+ # the screen we are in should be our parents parent
+ # aka something like:
+ # SCREEN
+ # \_ -/bin/bash
+ # \_ weechat-curses
+ ppid = os.getppid()
+
+ # get SCREEN pid
+ pipe = os.popen("ps o ppid= -p %d" % ppid)
+ screenpid = pipe.read().strip()
+ pipe.close()
+
+ # check if screen pid really belongs to a screen
+ pipe = os.popen("ps o cmd= -p %s" % screenpid)
+ cmd = pipe.read().strip()
+ pipe.close()
+
+ if 'screen' not in cmd.lower():
+ raise OnAttachError
+ else:
+ return screenpid
+
+def getScreenByList():
+ # checks if there is only one attached screen
+ # if so use: it! ;)
+ pipe = os.popen("screen -list | grep -i attached")
+ screens = pipe.read().strip()
+ pipe.close()
+ screens = screens.splitlines()
+
+ if len(screens) > 1:
+ print "There are more then one screen currently attached."
+ print "Detach all other running screens and reload OnAttach"
+ print "to ensure correct screen detection."
+ raise OnAttachError
+
+ try:
+ socket, status = screens[0].split()
+ except:
+ # thats no common screen list...
+ print "failed!"
+ raise OnAttachError
+ else:
+ print "Using screen %s" % socket
+ return socket
+
+def getScreenPid():
+ try:
+ return getScreenByPpid()
+ except OnAttachError:
+ print "!!! Unable to determine screen by parentid!"
+ print "Trying to guess screen..."
+ return getScreenByList()
+
+def registerFunction(function):
+ # Register a python function as a commandhandler
+ # Function needs to be named like weeFunction and
+ # is bound to /function
+ # docstring is used for weechat help
+ functionname = function.__name__ # guess what :)
+ weecommand = functionname[3:].lower() # strip the wee
+
+ doc = function.__doc__.splitlines()
+ arguments = doc[0] # First docstring line is the arguments string
+ description = doc[1][4:]
+ args_description = '\n'.join([line[4:] for line in doc[2:-1]]) # join rest and strip indentation
+
+ if not function.func_defaults: # use args default value as template
+ template = ''
+ elif len(function.func_defaults) == 1:
+ template = function.func_defaults[0]
+ elif len(function.func_defaults) == 2:
+ template = func.func_defaults[1]
+
+ weechat.add_command_handler(weecommand, functionname, description, arguments, args_description, template)
+
+def registerFunctions():
+ functions = [function for name, function in globals().iteritems() if name.startswith('wee') and callable(function)]
+ for func in functions:
+ registerFunction(func)
+
+# ====================
+# Classes
+# ====================
+class Event(object):
+ ESCAPECHAR = '\\'
+ SEPARATOR = ';'
+
+ def __init__(self, delay, step, channel, server, command, activehigh=True):
+ self.delay = int(delay)
+ self.step = step
+ self.channel = channel
+ self.server = server
+ self.command = command
+ self.activestate = activehigh
+ self.reset()
+
+ #@classmethod
+ def unserialize(cls, step, serial):
+ try:
+ # let's try the easy way :)
+ delay, channel, server, command, activestate = serial.split()
+ except ValueError:
+ # ok we got an escaped separator... :/
+ data = serial.split(cls.SEPARATOR)
+ for i in range(len(data)):
+ if data[i].endswith(cls.ESCAPECHAR):
+ data[i+1] = data[i] + cls.SEPARATOR + data[i+1]
+ data = [item.replace(cls.ESCAPECHAR + cls.SEPARATOR, cls.SEPARATOR) for item in data if not item.endswith(cls.ESCAPECHAR)]
+ delay, channel, server, command, activestate = data
+
+
+ delay = int(delay)
+ activestate = activestate == 'True'
+
+ return cls(delay, step, channel, server, command, activestate)
+ # lets go for 2.3 compatiblity
+ unserialize = classmethod(unserialize)
+
+ #@property
+ def serialized(self):
+ data = [self.delay, self.channel, self.server, self.command, self.activestate]
+ data = [str(item).replace(self.SEPARATOR, self.ESCAPECHAR + self.SEPARATOR) for item in data]
+ return self.SEPARATOR.join(data)
+ # lets go for 2.3 compatiblity
+ serialized = property(serialized)
+
+ def reset(self):
+ self.currentdelay = self.delay
+ self.fired = False
+
+ def fire(self):
+ weechat.command(self.command, self.channel, self.server)
+ self.fired = True
+
+ def stimulus(self, state):
+ if state != self.activestate:
+ self.reset()
+ else:
+ self.currentdelay -= self.step
+ if self.currentdelay <= 0 and not self.fired:
+ self.fire()
+
+class CheckStatus(object):
+ ESCAPECHAR = '\\'
+ SEPARATOR = '|'
+
+ eventlist = []
+ step = 5
+ def __init__(self):
+ try:
+ self.screenpid = getScreenPid()
+ except OnAttachError:
+ raise
+
+ # try to read config data
+ serializedEvents = weechat.get_plugin_config("events")
+ if not serializedEvents:
+ return
+
+ events = serializedEvents.split(self.SEPARATOR)
+ for i in range(len(events)):
+ if events[i].endswith(self.ESCAPECHAR):
+ events[i+1] = events[i] + self.SEPARATOR + ss[i+1]
+ events = [event.replace(self.ESCAPECHAR + self.SEPARATOR, self.SEPARATOR) for event in events if not event.endswith(self.ESCAPECHAR)]
+ for event in events:
+ try:
+ self.eventlist.append(Event.unserialize(self.step, event))
+ except:
+ print "Unable to unserialize event!"
+ print "Try to add the event manualy and save config again."
+
+ def __call__(self, server="", args=""):
+ # check if the screen is attached or detatched
+ pipe = os.popen("screen -list | grep %s" % self.screenpid)
+ screenlist = pipe.read().strip()
+ pipe.close()
+
+ if 'attached' in screenlist.lower():
+ state = ON
+ elif 'detached' in screenlist.lower():
+ state = OFF
+ else:
+ print "Unable to determine screen status"
+ return weechat.PLUGIN_RC_KO
+
+ for event in self.eventlist:
+ event.stimulus(state)
+
+ return weechat.PLUGIN_RC_OK
+
+ def addEvent(self, delay, channel, server, command, activehigh=True):
+ event = Event(delay, self.step, channel, server, command, activehigh)
+ self.eventlist.append(event)
+
+ def showEvents(self):
+ format = "%2s | %-10s | %-10s | %-15s | %-7s | %-2s %s"
+ separator = "---+------------+------------+-----------------+---------+----"
+ print separator
+ print format % ("ID", "Server", "Channel", "Command", "Delay", "on", "")
+ print separator
+ for i in range(len(self.eventlist)):
+ event = self.eventlist[i]
+ if event.activestate:
+ atde = 'AT'
+ else:
+ atde = 'DE'
+
+ if event.fired:
+ fired = '*'
+ else:
+ fired = ''
+ print format % (i, event.server[:10], event.channel[:10], event.command[:15], "%3d sec" % event.delay, atde, fired)
+ print separator
+
+ def save(self):
+ weechat.set_plugin_config("events",self.serialized)
+
+ #@property
+ def serialized(self):
+ events = [str(event.serialized).replace(self.SEPARATOR, self.ESCAPECHAR + self.SEPARATOR) for event in self.eventlist]
+ return self.SEPARATOR.join(events)
+ # lets go for 2.3 compatiblity
+ serialized = property(serialized)
+
+ def dropEvent(self, eventid):
+ del self.eventlist[eventid]
+
+# ====================
+# Functions
+# ====================
+def addEvent(server, args, activehigh=True):
+ delay, channel, command = args.split(' ', 2)
+ delay = int(delay)
+
+ channel = channel.strip("'\"")
+ checkStatus.addEvent(delay, channel, server, command, activehigh)
+ if activehigh:
+ atde = "at"
+ else:
+ atde = "de"
+
+ print "Added %stach event '%s' for channel %s on network %s with %d seconds delay" % (atde, command, channel, server, delay)
+
+def weeOnAttach(server, args):
+ """delay channel command
+ Adds a command which is executed after attaching the screen
+ The command is executed <delay> seconds after the attach.
+ Use "" or '' as channel if the command should be executed in
+ the server buffer.
+
+ Example:
+ /onattach 180 &bitlbee account on 0
+ """
+ try:
+ addEvent(server, args)
+ except:
+ weechat.command("/help onattach", "", server)
+ return 0
+ else:
+ return 1
+
+def weeOnDetach(server, args):
+ """delay channel command
+ Adds a command which is executed after detaching the screen
+ The command is executed <delay> seconds after the detach.
+ Use "" or '' as channel if the command should be executed in
+ the server buffer.
+
+ Example:
+ /ondetach 180 &bitlbee account on 0
+ """
+ try:
+ addEvent(server, args, activehigh=False)
+ except:
+ weechat.command("/help onattach", "", server)
+ return 0
+ else:
+ return 1
+
+def weeScreenevents(server, args="show|save|drop"):
+ """show | save | drop eventid [eventid [...]]
+ shows, saves or drops events
+ show:
+ Shows all current active events
+
+ save:
+ Saves current events permanently
+
+ drop:
+ Delete event from onAttach/onDetach list.
+ Use /showevents to get eventid
+ """
+ try:
+ action, args = args.split(' ',1)
+ except ValueError:
+ action = args.strip()
+ args = ''
+
+ actions = {'show':showEvents,
+ 'drop':dropEvent,
+ 'save':saveEvents}
+ try:
+ action = actions[action]
+ except KeyError:
+ weechat.command("/help screenevents", "", server)
+ return 0
+ else:
+ return action(server, args)
+
+
+
+def showEvents(server, args):
+ checkStatus.showEvents()
+ return 1
+
+def dropEvent(server, args):
+ try:
+ eventids = [int(id) for id in args.split()]
+ except:
+ print "eventid musst be a number!"
+ return 0
+
+ eventids.sort()
+ eventids.reverse()
+ for eventid in eventids:
+ try:
+ checkStatus.dropEvent(eventid)
+ except:
+ print "Unable to drop Event %d" % eventid
+ return 0
+ print "dropped %d events!" % len(eventids)
+ return 1
+
+def saveEvents(server, args):
+ checkStatus.save()
+ return 1
+
+# ====================
+# Let's Register!
+# ====================
+if __name__ == '__main__':
+ try:
+ import weechat
+ except ImportError:
+ print "This script is to be loaded as PythonScript in WeeChat"
+ print "Get WeeChat now at: http://weechat.flashtux.org/"
+ import sys
+ sys.exit(10)
+
+ # kick pythons print to weechat.prnt(msg, '')
+ sys.stdout = WeePrint()
+ weechat.register(NAME, VERSION, "", DESCRIPTION)
+ try:
+ checkStatus = CheckStatus()
+ except OnAttachError:
+ print "!!! Requirements for %s not met:" % NAME
+ print "!!! - WeeChat is not running in a screen or not able to get screen PID"
+ print "!!! --> Run WeeChat in a screen to fix the problem!"
+ else:
+
+ weechat.add_timer_handler(checkStatus.step, "checkStatus")
+
+ registerFunctions()
+
Changes to src/weechat/scripts/python/pyexec.py
@@ -1,1 +1,62 @@
+"""
+ PyExec: Python code execution script for WeeChat
+ Author: Christian Taylor <cht@chello.at>
+ License: GPL version 2 or later
+"""
+
+version = "0.2"
+helptext = """ The WeeChat script-API is imported into the global namespace, you can
+ call all API functions (for instance "get_info") directly. The modules
+ "sys", "os" and "math" are imported by default.
+ Any occurance of ";; " is treated as a newline.
+
+ For automatic argument conversion to string, use:
+ "send" instead of "command"
+ "echo" instead of "prnt" (prints only to current buffer)
+ (also provided: "echo_server", "echo_infobar")
+
+ Additional shortcut functions:
+ "nicks()" returns a dictionary of nicknames for the current channel.
+ It takes a channelname and a servername as optional arguments.
+
+ Examples:
+ /pyexec for i in range(3): send(i+1);; echo("Done")
+ /pyexec for nick in nicks(): send("/voice " + nick)
+ /pyexec echo(2**64)
+"""
+
+
+from __future__ import division
+import sys, os, math
+from weechat import *
+
+register("PyExec", version, "", "Run Python code in WeeChat")
+add_command_handler("pyexec", "pyexec", " Runs Python code directly from the WeeChat command line.", "[Python code]", helptext)
+
+def echo(text):
+ return prnt(str(text))
+
+def echo_server(text):
+ return print_server(str(text))
+
+def echo_infobar(time, text):
+ return print_infobar(time, str(text))
+
+def send(text):
+ return command(str(text))
+
+def nicks(channel=None, server=None):
+ if not server:
+ server = get_info("server")
+ if not channel:
+ channel = get_info("channel")
+ return get_nick_info(server, channel)
+
+def pyexec(server, pycode):
+ try:
+ exec pycode.replace(";; ", "\n")
+ except:
+ (e_type, e_value, e_trace) = sys.exc_info()
+ prnt("PyExec: %s: %s" % (str(e_type).replace("exceptions.", ""), e_value))
+ return PLUGIN_RC_OK
Changes to src/weechat/scripts/python/samples/wpysample.py
@@ -1,1 +1,208 @@
+#
+# Copyright (c) 2006 by FlashCode <flashcode@flashtux.org>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#
+
+# WeeChat python script sample
+# This script uses whole WeeChat API functions, it may be used for
+# testing purposes.
+
+import weechat
+
+weechat.register("wpysample", "0.1", "wpyend", "WeeChat python script sample")
+
+# some command handlers
+weechat.add_command_handler("wpynothing", "wpynothing")
+weechat.add_command_handler("wpytest", "wpytest", "test command",
+ "channel", "a channel name", "%C")
+weechat.add_command_handler("wpyinfo", "wpyinfo", "display info with get_info()",
+ "version | nick | channel | server | away | weechat_dir | weechat_libdir | weechat_sharedir",
+ "info to read", "version|nick|channel|server|away|weechat_dir|weechat_libdir|weechat_sharedir")
+weechat.add_command_handler("wpycommand", "wpycommand", "execute a WeeChat comand", "weechat_cmd | text")
+weechat.add_command_handler("wpydcc", "wpydcc", "display DCC", "", "", "")
+weechat.add_command_handler("wpyserver", "wpyserver", "display server list", "", "", "")
+weechat.add_command_handler("wpychannel", "wpychannel", "display channel list", "", "", "")
+weechat.add_command_handler("wpynick", "wpynick", "display nick list", "", "", "")
+weechat.add_command_handler("wpygetconfig", "wpygetconfig", "get a config option value", "option", "", "")
+weechat.add_command_handler("wpysetconfig", "wpysetconfig", "set a config option value", "option value", "", "")
+weechat.add_command_handler("wpygetplugin", "wpygetplugin", "get a plugin config option value", "option", "", "")
+weechat.add_command_handler("wpysetplugin", "wpysetplugin", "set a plugin config option value", "option value", "", "")
+weechat.add_timer_handler(10, "wpytimer");
+
+# a message handler
+weechat.add_message_handler("privmsg", "wpyprivmsg")
+
+# command handlers for removing some handlers
+weechat.add_command_handler("wpydelmsg", "wpydelmsg", "delete privmsg message handler", "", "", "");
+weechat.add_command_handler("wpydelcmd", "wpydelcmd", "delete wpynothing command handler", "", "", "")
+weechat.add_command_handler("wpydeltimer", "wpydeltimer", "delete wpytimer timer handler", "", "", "")
+
+# command handler for clearing infobar
+weechat.add_command_handler("wpydelinfo", "wpydelinfo", "remove infobar message(s)", "", "", "");
+
+def wpynothing(server, args):
+ weechat.prnt("wpynothing: nothing done there!")
+ return weechat.PLUGIN_RC_OK
+
+def wpytest(server, args):
+ weechat.prnt("wpytest: server = '%s', args = '%s'" %(server, args))
+ weechat.print_infobar(10, "wpytest: test infobar")
+ weechat.log("wpytest: test log on photon/#abc", "#abc", "photon")
+ weechat.log("wpytest: test log on photon", "", "photon")
+ return weechat.PLUGIN_RC_OK
+
+def wpyinfo(server, args):
+ if args != "":
+ weechat.prnt("get_info(%s) = %s" %(args, weechat.get_info(args)))
+ else:
+ weechat.prnt("wpyinfo: missing info argument")
+ return weechat.PLUGIN_RC_OK
+
+def wpycommand(server, args):
+ if args != "":
+ weechat.command(args)
+ else:
+ weechat.prnt("wpycommand: missing command argument")
+ return weechat.PLUGIN_RC_OK
+
+def wpydcc(server, args):
+ dccs = weechat.get_dcc_info()
+ if dccs != None:
+ if dccs == []:
+ weechat.prnt("wpydcc: no DCC")
+ else:
+ for d in dccs:
+ for b in d.keys():
+ weechat.prnt("%s = %s" %(b, d[b]))
+ else:
+ weechat.prnt("wpydcc: error reading DCC")
+ return weechat.PLUGIN_RC_OK
+
+def wpyserver(server, args):
+ servers = weechat.get_server_info()
+ if servers != None:
+ if servers == {}:
+ weechat.prnt("wpyserver: no server")
+ else:
+ for s in servers:
+ for i in servers[s]:
+ weechat.prnt("%s -> %s = '%s'" %(s, i, str(servers[s][i])))
+ else:
+ weechat.prnt("wpyserver: error reading servers")
+ return weechat.PLUGIN_RC_OK
+
+
+def wpychannel(server, args):
+ chans = weechat.get_channel_info(weechat.get_info("server"))
+ if chans != None:
+ if chans == {}:
+ weechat.prnt("wpychannel: no channel")
+ else:
+ for s in chans:
+ for i in chans[s]:
+ weechat.prnt("%s -> %s = '%s'" %(s, i, str(chans[s][i])))
+ else:
+ weechat.prnt("wpychannel: error reading channels")
+ return weechat.PLUGIN_RC_OK
+
+
+def wpynick(server, args):
+ chans = weechat.get_channel_info(weechat.get_info("server"))
+ if chans != None:
+ if chans == {}:
+ weechat.prnt("wpynick: no nick")
+ else:
+ for c in chans:
+ nicks = weechat.get_nick_info(weechat.get_info("server"), c)
+ if nicks != None:
+ if nicks == {}:
+ weechat.prnt("wpynick: no nick")
+ else:
+ for n in nicks:
+ for f in nicks[n]:
+ weechat.prnt("%s -> %s -> %s = '%s'" %(c, n, f, str(nicks[n][f])))
+ else:
+ weechat.prnt("wpynick: error reading nicks")
+ else:
+ weechat.prnt("wpynick: error reading channels")
+ return weechat.PLUGIN_RC_OK
+
+def wpygetconfig(server, option):
+ if args != "":
+ weechat.prnt("%s = %s" %(option, weechat.get_config(option)))
+ else:
+ weechat.prnt("wpygetconfig: missing option")
+ return weechat.PLUGIN_RC_OK
+
+def wpysetconfig(server, args):
+ if args != "":
+ option = args[:args.find(" ")]
+ value = args[args.find(" "):]
+ weechat.set_config(option, value)
+ else:
+ weechat.prnt("wpysetconfig: missing option/value")
+ return weechat.PLUGIN_RC_OK
+
+def wpygetplugin(server, option):
+ if args != "":
+ weechat.prnt("%s = %s" %(option, weechat.get_plugin_config(option)))
+ else:
+ weechat.prnt("wpygetconfig: missing option")
+ return weechat.PLUGIN_RC_OK
+
+def wpysetplugin(server, args):
+ if args != "":
+ option = args[:args.find(" ")]
+ value = args[args.find(" "):]
+ weechat.set_plugin_config(option, value)
+ else:
+ weechat.prnt("wpysetplugin: missing option/value")
+ return weechat.PLUGIN_RC_OK
+
+def wpytimer(server, args):
+ weechat.prnt("wpytimer: this is the timer handler")
+ return weechat.PLUGIN_RC_OK
+
+def wpyprivmsg(server, args):
+ weechat.prnt("wpyprivmsg: privmsg received: server = '%s', args = '%s'" %(server, args))
+ return weechat.PLUGIN_RC_OK
+
+def wpydelmsg(server, args):
+ weechat.remove_handler("privmsg", "wpyprivmsg")
+ weechat.prnt("wpydelmsg: privmsg handler removed")
+ return weechat.PLUGIN_RC_OK
+
+def wpydelcmd(server, args):
+ weechat.remove_handler("wpynothing", "wpynothing")
+ weechat.prnt("wpydelcmd: wpynothing command handler removed")
+ return weechat.PLUGIN_RC_OK
+
+def wpydeltimer(server, args):
+ weechat.remove_timer_handler("wpytimer")
+ weechat.prnt("wpydeltimer: wpytimer timer handler removed")
+ return weechat.PLUGIN_RC_OK
+
+def wpydelinfo(server, args):
+ if args != "":
+ weechat.remove_infobar(args)
+ else:
+ weechat.remove_infobar()
+ weechat.prnt("wpydelinfo: infobar message(s) removed");
+ return weechat.PLUGIN_RC_OK
+def wpyend(server, args):
+ weechat.prnt("wpysample: ending...")
+ return weechat.PLUGIN_RC_OK
Changes to src/weechat/scripts/python/shell.py
@@ -1,1 +1,136 @@
+# =============================================================================
+# shell.py (c) March 2006 by Kolter <kolter+dev@openics.org>
+#
+# Licence : GPL v2
+# Description : running shell commands in WeeChat
+# Syntax : try /help shell to get some help on this script
+# Precond : needs weechat > 0.1.7 to run else it will crash WeeChat ;-)
+#
+#
+# ### changelog ###
+#
+# * version 0.1 :
+# - first release
+#
+# =============================================================================
+
+import weechat, os, popen2
+
+SHELL_CMD="shell"
+SHELL_PREFIX="[shell] "
+
+weechat.register ("Shell", "0.1", "", "Running shell commands in WeeChat")
+weechat.add_command_handler(
+ SHELL_CMD,
+ "shell",
+ "Running shell commands in WeeChat",
+ "[-o] <command line>",
+ " -o : print output on current server/channel\n"
+ "<command line> : shell command or builtin like cd, getenv, setenv, unsetenv",
+ "-o|cd|getenv|setenv|unsetenv cd|getenv|setenv|unsetenv"
+ )
+
+def shell_exec(command):
+ proc = popen2.Popen3(command, True)
+ status = proc.wait()
+ results = []
+ if status == 0:
+ results = proc.fromchild.readlines()
+ else:
+ results = proc.childerr.readlines()
+ return status, results
+
+def shell_output(command, inchan):
+ status, results = shell_exec(command)
+ if status == 0:
+ for line in results:
+ if inchan:
+ weechat.command(line.rstrip('\n'))
+ else:
+ weechat.prnt(line.rstrip('\n'))
+ else:
+ weechat.prnt("%san error occured while running command `%s'" % (SHELL_PREFIX, command))
+ for line in results:
+ weechat.prnt(line.rstrip('\n'))
+
+
+def shell_chdir(directory):
+ if directory == "":
+ if os.environ.has_key('HOME'):
+ directory = os.environ['HOME']
+ try:
+ os.chdir(directory)
+ except:
+ weechat.prnt("%san error occured while running command `cd %s'" % (SHELL_PREFIX, directory))
+ else:
+ pass
+
+def shell_getenv(var, inchan):
+ var = var.strip()
+ if var == "":
+ weechat.prnt("%swrong syntax, try 'getenv VAR'" % (SHELL_PREFIX))
+ return
+
+ value = os.getenv(var)
+ if value == None:
+ weechat.prnt("%s$%s is not set" % (SHELL_PREFIX, var))
+ else:
+ if inchan:
+ weechat.command("$%s=%s" % (var, os.getenv(var)))
+ else:
+ weechat.prnt("%s$%s=%s" % (SHELL_PREFIX, var, os.getenv(var)))
+
+def shell_setenv(expr, inchan):
+ expr = expr.strip()
+ lexpr = expr.split('=')
+
+ if (len(lexpr) < 2):
+ weechat.prnt("%swrong syntax, try 'setenv VAR=VALUE'" % (SHELL_PREFIX))
+ return
+
+ os.environ[lexpr[0].strip()] = "=".join(lexpr[1:])
+ if not inchan:
+ weechat.prnt("%s$%s is now set to '%s'" % (SHELL_PREFIX, lexpr[0], "=".join(lexpr[1:])))
+
+def shell_unsetenv(var, inchan):
+ var = var.strip()
+ if var == "":
+ weechat.prnt("%swrong syntax, try 'unsetenv VAR'" % (SHELL_PREFIX))
+ return
+
+ if os.environ.has_key(var):
+ del os.environ[var]
+ weechat.prnt("%s$%s is now unset" % (SHELL_PREFIX, var))
+ else:
+ weechat.prnt("%s$%s is not set" % (SHELL_PREFIX, var))
+
+def shell(server, args):
+ largs = args.split(" ")
+
+ #strip spaces
+ while '' in largs:
+ largs.remove('')
+ while ' ' in largs:
+ largs.remove(' ')
+
+ if len(largs) == 0:
+ weechat.command("/help %s" % SHELL_CMD)
+ else:
+ inchan = False
+ if largs[0] == '-o':
+ inchan = True
+ largs = largs[1:]
+
+ if largs[0] == 'cd':
+ shell_chdir(" ".join(largs[1:]), inchan)
+ elif largs[0] == 'getenv':
+ shell_getenv (" ".join(largs[1:]), inchan)
+ elif largs[0] == 'setenv':
+ shell_setenv (" ".join(largs[1:]), inchan)
+ elif largs[0] == 'unsetenv':
+ shell_unsetenv (" ".join(largs[1:]), inchan)
+ else:
+ shell_output(" ".join(largs), inchan)
+
+ return weechat.PLUGIN_RC_OK
Changes to src/weechat/scripts/python/theme.py
@@ -1,1 +1,197 @@
+#!/usr/bin/env python
+"""
+Theme manager for WeeChat.
+It loads configuration parameters from file
+and allows to create new theme out of current configuration.
+
+by Stalwart <stlwrt@gmail.com>
+
+Licensed under GNU GPL v2
+
+"""
+
+## ---------- Code starts here ----------
+import weechat
+import os
+
+VERSION = "0.2.3"
+
+weechat.register("theme", VERSION, "", "Theme manager for WeeChat")
+
+THEMEDIR = weechat.get_info("weechat_dir") + '/themes'
+
+weechat.add_command_handler("theme", "parameter_parser", "Apply and create themes", "[load <name> | save <name>]", "", "load|save")
+
+settings = [
+ 'look_startup_logo',
+ 'look_startup_version',
+ 'look_weechat_slogan',
+ 'look_buffer_timestamp',
+ 'look_color_nicks_number',
+ 'look_color_actions',
+ 'look_nicklist',
+ 'look_nicklist_position',
+ 'look_nicklist_min_size',
+ 'look_nicklist_max_size',
+ 'look_no_nickname',
+ 'look_nickmode',
+ 'look_nickmode_empty',
+ 'look_nick_prefix',
+ 'look_nick_suffix',
+ 'look_align_nick',
+ 'look_align_other',
+ 'look_align_size',
+ 'look_align_size_max',
+ 'look_infobar',
+ 'look_infobar_timestamp',
+ 'look_infobar_seconds',
+ 'look_infobar_delay_highlight',
+ 'look_hotlist_names_count',
+ 'look_hotlist_names_level',
+ 'look_hotlist_names_length',
+ 'look_read_marker',
+ 'look_input_format',
+ 'col_separator',
+ 'col_title',
+ 'col_title_bg',
+ 'col_chat',
+ 'col_chat_time',
+ 'col_chat_time_sep',
+ 'col_chat_prefix1',
+ 'col_chat_prefix2',
+ 'col_chat_server',
+ 'col_chat_join',
+ 'col_chat_part',
+ 'col_chat_nick',
+ 'col_chat_host',
+ 'col_chat_channel',
+ 'col_chat_dark',
+ 'col_chat_highlight',
+ 'col_chat_bg',
+ 'col_chat_read_marker',
+ 'col_chat_read_marker_bg',
+ 'col_status',
+ 'col_status_delimiters',
+ 'col_status_channel',
+ 'col_status_data_msg',
+ 'col_status_private',
+ 'col_status_highlight',
+ 'col_status_data_other',
+ 'col_status_more',
+ 'col_status_bg',
+ 'col_infobar',
+ 'col_infobar_delimiters',
+ 'col_infobar_highlight',
+ 'col_infobar_bg',
+ 'col_input',
+ 'col_input_server',
+ 'col_input_channel',
+ 'col_input_nick',
+ 'col_input_delimiters',
+ 'col_input_bg',
+ 'col_nick',
+ 'col_nick_away',
+ 'col_nick_chanowner',
+ 'col_nick_chanadmin',
+ 'col_nick_op',
+ 'col_nick_halfop',
+ 'col_nick_voice',
+ 'col_nick_more',
+ 'col_nick_sep',
+ 'col_nick_self',
+ 'col_nick_color1',
+ 'col_nick_color2',
+ 'col_nick_color3',
+ 'col_nick_color4',
+ 'col_nick_color5',
+ 'col_nick_color6',
+ 'col_nick_color7',
+ 'col_nick_color8',
+ 'col_nick_color9',
+ 'col_nick_color10',
+ 'col_nick_private',
+ 'col_nick_bg',
+ 'col_chat_dcc_selected',
+ 'col_dcc_waiting',
+ 'col_dcc_connecting',
+ 'col_dcc_active',
+ 'col_dcc_done',
+ 'col_dcc_failed',
+ 'col_dcc_aborted'
+]
+
+def themes_dir_available(writeable):
+ if not os.access(THEMEDIR, os.F_OK):
+ os.mkdir(THEMEDIR, 0700)
+ if writeable:
+ if os.access(THEMEDIR, os.W_OK):
+ return 1
+ else:
+ return 0
+ else:
+ if os.access(THEMEDIR, os.R_OK):
+ return 1
+ else:
+ return 0
+
+def save_theme(theme_filename):
+ if themes_dir_available(1):
+ try:
+ themefile = open("%s/%s" % (THEMEDIR, theme_filename), 'wU')
+ except:
+ weechat.print_infobar(3, "Bad theme name, try another")
+ else:
+ themefile.write("# This WeeChat theme has been generated by Themes v.%s\n" % VERSION)
+ for variable in settings:
+ try:
+ value = weechat.get_config(variable)
+ except:
+ weechat.prnt("Unable to get the value of %s" % variable)
+ else:
+ themefile.write("%s=%s\n" % (variable, value))
+ themefile.flush()
+ themefile.close()
+ weechat.print_infobar(3, "Theme %s saved" % theme_filename)
+
+def load_theme(theme_filename):
+ if themes_dir_available(0):
+ if os.access("%s/%s" % (THEMEDIR, theme_filename), os.F_OK):
+ themefile = open("%s/%s" % (THEMEDIR, theme_filename), 'rU')
+ lines = themefile.readlines()
+ for line in lines:
+ if ((len(line) > 3) and (line[0] != '#') and (line.find("="))):
+ try:
+ weechat.set_config(line[:line.find("=")], line[line.find("=")+1:].replace("\n", ""))
+ except:
+ weechat.prnt("Unable to set the value of %s" % variable)
+ weechat.print_infobar(3, "Theme %s applied" % theme_filename)
+ else:
+ weechat.print_infobar(3, "Theme %s doesn't exist" % theme_filename)
+ themefile.close()
+
+def list_themes():
+ if themes_dir_available(0):
+ files = os.listdir(THEMEDIR)
+ if len(files):
+ weechat.prnt('Available themes:')
+ for filename in files:
+ if filename[-9:] == '.weetheme':
+ weechat.prnt(" %s" % filename[:-9])
+ else:
+ weechat.prnt('Theme directory is empty, you can create new theme out of your current configuration by executing "/theme save <name>". Additional themes available on http://weechat.flashtux.org')
+ else:
+ weechat.prnt('Theme directory is not available. Please, check access rights')
+
+def parameter_parser(server, args):
+ if ((args != '') & (len(args.split()) == 2)):
+ if args.split()[0] == 'save':
+ save_theme(args.split()[1] + '.weetheme')
+ elif args.split()[0] == 'load':
+ load_theme(args.split()[1] + '.weetheme')
+ else:
+ weechat.prnt('Invalid parameter, must be "load" or "save"')
+ else:
+ list_themes()
+ return weechat.PLUGIN_RC_OK
+
Changes to src/weechat/scripts/python/tinyurl.py
@@ -1,1 +1,334 @@
+#!/bin/env python
+#
+# TinyUrl, version 3.3, for weechat version 0.1.9
+#
+# Listens to all channels for long URLs, and submits them to tinyurl.com
+# for easier links.
+#
+# Usage:
+#
+# By default, any URL longer than 30 characters in length is grabbed,
+# submitted to 'tinyurl', and printed in the channel for your eyes only.
+# For example, you may see something like this:
+#
+# [11:21] <@lack> http://www.cbc.ca/story/canada/national/2005/11/12/mcdona
+# lds-051112.html?ref=rss
+# [11:21] -P- [AKA] http://tinyurl.com/9dthl
+#
+# Now you can just cut&paste the easier, shorter URL into your favourite
+# browser.
+#
+# If you want to be extra-helpful (or annoying) to certain channels you
+# are in, you can actually have the script say the tinyurl.com equivalent
+# of all long URLs, by adding the channel to the 'activechans' list. In
+# that case, everyone in the channel would see the following:
+#
+# [11:25] <testuser> http://www.cbc.ca/story/canada/national/2005/11/12/mcdona
+# lds-051112.html?ref=rss
+# [11:25] <@lack> [AKA] http://tinyurl.com/9dthl
+#
+# Configuration:
+#
+# Run '/help tinyurl' for the actual usage for setting these options:
+#
+# activechans
+# A comma-delimited list of channels you will actually "say" the
+# tinyurl in. By default the list is empty. Be warned, some channels
+# won't appreciate extra help (or 'noise' as they like to call it), and
+# some channels already have bots that do this. Please only enable
+# this in channels where the ops have given you permission.
+#
+# urllength
+# An integer, default value 30. Any URL this long or longer will
+# trigger a tinyurl event.
+#
+# printall
+# Either "on" or "off", default "on". When ON, you will see the
+# tinyurl printed in your window for any channels not in your
+# activechans list. When OFF, you will not see any tinyurls except in
+# your activechans list.
+#
+# Requirements:
+#
+# - Designed to run with weechat version 0.1.9 or better.
+# http://weechat.flashtux.org/
+#
+# - Requires that 'curl' is in the path (tested with curl 7.15.0).
+# http://curl.haxx.se/
+#
+# Copyright (C) 2005 Jim Ramsay <i.am@jimramsay.com>
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+# USA.
+#
+# Changelog:
+#
+# Version 3.3, July 4, 2006
+# Catches possible error in os.waitpid
+# Properly prints tinyurls in query windows
+#
+# Version 3.2, June 15, 2006
+# Multiple configuration bugfixes, pointed out by Stalwart on #weechat.
+#
+# Version 3.1, June 15, 2006
+# Now kills any leftover curl processes when the script is unloaded.
+# Thanks again to kolter for the great idea!
+# Also cleaned up /tinyurl command, added comletion_template, updated
+# help text, improved option parsing logic, etc.
+#
+# Version 3.0, June 15, 2006
+# Fixes "tinyurl script sometimes makes weechat freeze" issue by using
+# the new timer handlers available in Weechat 0.1.9
+# Also includes URL detection fix from Raimund Specht
+# <raimund@spemaus.de>.
+#
+# Version 2.0, Dec 13, 2005
+# Also catches https, ftp, and ftps URLs, thanks to kolter for the
+# suggestion!
+#
+# Version 1.1, Dec 2, 2005
+# Fixed undefined 'urlend' thanks to kolter@irc.freenode.org#weechat
+#
+# TODO:
+#
+# - Handle outgoing messages and replace long urls with the tinyurl
+# equivalent automatically.
+# - On load, check that 'curl' is installed, and fail if not.
+#
+
+import os, tempfile, re
+try:
+ import urllib
+except:
+ raise ImportError("You need to reload the python plugin to reload urllib")
+import weechat
+
+# Register with weechat
+weechat.register( "TinyUrl", "3.3", "tinyurlShutdown", "Waits for URLs and sends them to 'tinyurl' for you" )
+
+# Global variables
+tinyurlParams = ("urllength","activechans","printall")
+tinyurlProcessList = {}
+
+# Set default settings values:
+if weechat.get_plugin_config('urllength') == "":
+ weechat.set_plugin_config('urllength', "30")
+if weechat.get_plugin_config('printall') != "on" and \
+ weechat.get_plugin_config('printall') != "off":
+ weechat.set_plugin_config('printall', "on")
+
+# Start the timer thread and register handlers
+weechat.add_timer_handler( 1, "tinyurlCheckComplete" )
+weechat.add_message_handler("privmsg", "tinyurlHandleMessage")
+weechat.add_command_handler("tinyurl", "tinyurlMain", \
+ "Sets/Gets 'tinyurl' settings.",
+ "[<variable> [[=] <value>]]",
+"""When run without arguments, displays all tinyurl settings
+
+<variable> : Sets or displays a single tinyurl setting. One of:
+ activechans [[=] #chan1[,#chan2...]]
+ List of channels where others will see your tinyurls.
+ Default: None
+ urllength [[=] length]
+ Will not create tinyurls for any URLs shorter than this.
+ Default: 30
+ printall [[=] on|off]
+ When off, will not display private tinyurls, just those
+ displayed publicly in your "active channels"
+ Default: on""",
+ "urllength|activechans|printall"
+ )
+
+def tinyurlShutdown():
+ """Cleanup - Kills any leftover child processes"""
+ if len(tinyurlProcessList.keys()) > 0:
+ weechat.prnt( "-TinyUrl- Cleaning up unfinished processes:" )
+ for pid in tinyurlProcessList.keys():
+ weechat.prnt( " Process %d" % pid )
+ try:
+ os.kill(pid, 9)
+ os.waitpid( pid, 0 )
+ except:
+ weechat.prnt( " Cleanup failed, skipping" )
+ return weechat.PLUGIN_RC_OK
+
+def tinyurlGet( name = "" ):
+ """Gets a variable value"""
+ if name == "":
+ weechat.prnt( "-TinyUrl- Get all:" )
+ for name in tinyurlParams:
+ weechat.prnt( " %s = %s" % (name, weechat.get_plugin_config(name)) )
+ else:
+ weechat.prnt( "-TinyUrl- Get:" )
+ if name in tinyurlParams:
+ weechat.prnt( " %s = %s" % (name, weechat.get_plugin_config(name)) )
+ else:
+ weechat.prnt( " Unknown parameter \"%s\", try '/help tinyurl'" % name )
+ return
+
+def tinyurlSet( name, value ):
+ """Sets a variable value"""
+ if value == "":
+ tinyurlGet( name )
+ else:
+ weechat.prnt( "-TinyUrl- Set:" )
+ if name in tinyurlParams:
+ if name == "printall":
+ if value == "0" or value.lower() == "no" or value.lower() == "off":
+ weechat.set_plugin_config(name, "off")
+ elif value == "1" or value.lower() == "yes" or value.lower() == "on":
+ weechat.set_plugin_config(name, "on")
+ else:
+ weechat.prnt( " printall must be one of 'on' or 'off'" )
+ weechat.prnt( " value = '%s'" % value )
+ return
+ else:
+ if name == "activechans":
+ vs = re.split(", |,| ", value)
+ values = []
+ for v in vs:
+ if v.startswith("#"):
+ values.append(v)
+ value = ",".join(values)
+ weechat.set_plugin_config(name, value)
+ weechat.prnt( " %s = %s" % (name, weechat.get_plugin_config(name)) )
+ else:
+ weechat.prnt( " Unknown parameter \'%s\'" % name )
+ return
+
+def tinyurlMain( server, args ):
+ """Main handler for the /tinyurl command"""
+ args = args.split( " " )
+ while '' in args:
+ args.remove('')
+ while ' ' in args:
+ args.remove(' ')
+ if len(args) == 0:
+ tinyurlGet()
+ else:
+ name = args[0]
+ value = ""
+ if len(args) > 1:
+ if args[1] == "=":
+ value = " ".join(args[2:])
+ else:
+ value = " ".join(args[1:])
+ tinyurlSet( args[0], value )
+ else:
+ tinyurlGet( name )
+ return weechat.PLUGIN_RC_OK
+
+def tinyurlGetUrl( url, channel, server ):
+ """Starts a background process which will query 'tinyurl.com' and put the
+ result in a file that the timer function 'tinyurlCheck' will find and
+ parse."""
+ global tinyurlProcessList
+ handle, filename = tempfile.mkstemp( prefix="weechat-tinyurl.py-" )
+ os.close(handle)
+ cmd = ("curl -d url=%s http://tinyurl.com/create.php --stderr /dev/null -o %s" % \
+ (urllib.quote(url), filename)).split()
+ try:
+ pid = os.spawnvp( os.P_NOWAIT, cmd[0], cmd )
+ tinyurlProcessList[pid] = (filename, channel, server)
+ except Exception, e:
+ weechat.prnt( "-TinyUrl- Error: Could not spawn curl: %s" % e )
+
+def tinyurlParsefile( filename ):
+ """Parses the given HTML file and pulls out the tinyurl."""
+ turl = None
+ try:
+ html = open(filename, "r")
+ for line in html:
+ if( line.startswith("<input type=hidden name=tinyurl value=\"") ):
+ turlend = line[39:].find("\"")
+ if turlend > -1:
+ turl = line[39:][:turlend]
+ break
+ html.close()
+ except Exception, e:
+ weechat.prnt( "-TinyUrl- Error: Could not open result file %s: %s" % (filename, e) )
+ return turl
+
+def tinyurlPrint( url, channel, server ):
+ """Prints the new tinyurl either to just you, or to the whole channel"""
+ activeChans = weechat.get_plugin_config('activechans').split(',')
+ if channel in activeChans:
+ weechat.command( "/msg %s [AKA] %s" % ( channel, url) )
+ else:
+ weechat.prnt( "[AKA] %s" % (url), channel, server )
+
+def tinyurlFindUrlstart( msg, start = 0 ):
+ """Finds the beginnings of URLs"""
+ index = -1
+ if start < 0 or start >= len(msg):
+ return index
+ for prefix in ( "http://", "https://", "ftp://", "ftps://" ):
+ index = msg.find( prefix, start )
+ if index > -1:
+ break
+ return index
+
+def tinyurlFindUrlend( msg, urlstart ):
+ """Finds the ends of URLs (Strips following punctuation)"""
+ m = msg[urlstart:]
+ index = m.find( " " )
+ if index == -1:
+ index = len(m)
+ while msg[index-1] in ( "?", ".", "!" ):
+ index -= 1
+ return index + urlstart
+
+def tinyurlCheckComplete():
+ """The periodic poll of all waiting processes"""
+ global tinyurlProcessList
+ for pid in tinyurlProcessList.keys():
+ (filename, channel, server) = tinyurlProcessList[pid]
+ try:
+ (p, er) = os.waitpid( pid, os.WNOHANG )
+ if p != 0:
+ if er == 0:
+ tinyurl = tinyurlParsefile(filename)
+ if tinyurl is not None:
+ tinyurlPrint( tinyurl, channel, server )
+ else:
+ weechat.prnt( "-TinyUrl- Error: 'curl' did not run properly" )
+ os.unlink(filename)
+ del tinyurlProcessList[pid]
+ except OSError, e:
+ weechat.prnt( "-TinyUrl- Error: 'curl' process not found: %s", e )
+ os.unlink(filename)
+ del tinyurlProcessList[pid]
+ return weechat.PLUGIN_RC_OK
+
+def tinyurlHandleMessage( server, args ):
+ """Handles IRC PRIVMSG and checks for URLs"""
+ maxlen = int(weechat.get_plugin_config( "urllength" ))
+ activeChans = weechat.get_plugin_config('activechans').split(',')
+ onlyActiveChans = weechat.get_plugin_config('printall') == "off"
+ (source, type, channel, msg) = args.split(" ", 3)
+ if onlyActiveChans and channel not in activeChans:
+ return weechat.PLUGIN_RC_OK
+ if not channel.startswith("#"):
+ channel = source.split("!", 2)[0][1:]
+ urlstart = tinyurlFindUrlstart( msg )
+ while urlstart > -1 and urlstart is not None:
+ urlend = tinyurlFindUrlend( msg, urlstart )
+ url = msg[urlstart:urlend]
+ if len(url) >= maxlen:
+ tinyurlGetUrl(url, channel, server)
+ # Check for more URLs
+ urlstart = tinyurlFindUrlstart( msg, urlend+1 )
+ return weechat.PLUGIN_RC_OK
Changes to src/weechat/scripts/python/todo.py
@@ -1,1 +1,69 @@
+"""
+ :Author: Henning Hasemann <hhasemann [at] web [dot] de>
+
+ :What it does:
+ This script listens for messages beginning
+ with a special token and appends these messages
+ to a file.
+ This way people can post you short assignments which
+ you cant forget and dont have to look up in your look.
+ (try appending "cat /path/to/mytodofile" at your .bashrc)
+
+ :Usage:
+ - Load this file
+ - Make sure to set suitable configuration values.
+ token: The piece of text that signals a TODO
+ file: The file where the TODOs should be appended
+ allowed_sources: A space-seperated list of nicknames
+ which are allowed to send TODOs to you.
+ - Whenever any allowed person sends a message beginning
+ with your desired token, the rest of that message is
+ append to the desired TODO-file.
+
+ Released under GPL licence.
+"""
+__version__ = "0.1"
+
+import weechat as wc
+
+wc.register("todo", __version__, "", "automatic TODO")
+wc.add_message_handler("privmsg", "on_msg")
+
+default = {
+ "token": "##todo ",
+ "file": "/home/USER/todo",
+ "allowed_sources": "",
+}
+
+for k, v in default.items():
+ if not wc.get_plugin_config(k):
+ wc.set_plugin_config(k, v)
+
+def source_allowed(src):
+ return src in wc.get_plugin_config("allowed_sources").split()
+
+def on_msg(server, args):
+ # args looks like:
+ # :foo!foo@host PRIVMSG #channel :Hello, how are you?
+
+ token = wc.get_plugin_config("token")
+ filename = wc.get_plugin_config("file")
+
+ try:
+ nothing, info, message = args.split(":", 2)
+ hostmask, privmsg, channel = info.split(None, 2)
+ source = hostmask.split("!")[0]
+ except ValueError:
+ # Parsing didnt work,
+ # this happens mostly when strange messages
+ # arrive that dont have the format described above
+ return 0
+
+ if source_allowed(source) and message.lower().startswith(token):
+ wc.print_infobar(5, "NEW TASK: " + str(message[7:]))
+ f = open(filename, "a")
+ f.write("%s (%s)\n" % (message[7:], source))
+ f.close()
+
+ return 0
Changes to src/weechat/scripts/python/toggle.py
@@ -1,1 +1,131 @@
+# -*- encoding: iso-8859-1 -*-
+#
+# Copyright (c) 2006 by EgS <i@egs.name>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#
+
+
+#######################################################################
+# #
+# This script adds a simple command to toggle weechat options #
+# #
+# Name: Toggle #
+# Licence: GPL v2 #
+# Author: Marcus Eggenberger <i@egs.name> #
+# #
+# Usage: #
+# /toggle look_nicklist #
+# #
+# use /help command for detailed information #
+# #
+# Changelog: #
+# 0.1: first version released #
+# #
+#######################################################################
+
+
+
+# ====================
+# Imports
+# ====================
+import sys
+
+# ====================
+# Constants
+# ====================
+NAME = 'Toggle'
+VERSION = '0.1'
+DESCRIPTION = "Simple tool to toggle ON/OFF settings"
+
+VALUES = ['OFF','ON']
+
+# ====================
+# Exceptions
+# ====================
+
+# ====================
+# Helpers
+# ====================
+class WeePrint(object):
+ def write(self, text):
+ text = text.rstrip(' \0\n') # strip the null byte appended by pythons print
+ if text:
+ weechat.prnt(text,'')
+
+def registerFunction(function):
+ # Register a python function as a commandhandler
+ # Function needs to be named like weeFunction and
+ # is bound to /function
+ # docstring is used for weechat help
+ functionname = function.__name__ # guess what :)
+ weecommand = functionname[3:].lower() # strip the wee
+
+ doc = function.__doc__.splitlines()
+ arguments = doc[0] # First docstring line is the arguments string
+ description = doc[1][4:]
+ args_description = '\n'.join([line[4:] for line in doc[2:-1]]) # join rest and strip indentation
+
+ if not function.func_defaults: # use args default value as template
+ template = ''
+ elif len(function.func_defaults) == 1:
+ template = function.func_defaults[0]
+ elif len(function.func_defaults) == 2:
+ template = func.func_defaults[1]
+
+ weechat.add_command_handler(weecommand, functionname, description, arguments, args_description, template)
+
+def registerFunctions():
+ functions = [function for name, function in globals().iteritems() if name.startswith('wee') and callable(function)]
+ for func in functions:
+ registerFunction(func)
+
+# ====================
+# Functions
+# ====================
+def weeToggle(server, args="%o"):
+ """<setting>
+ Toggles any setting from ON to OFF and vice versa.
+ Example:
+ /toggle look_nicklist
+ """
+ option = args
+ currentvalue = weechat.get_config(option).upper()
+ if currentvalue not in VALUES:
+ print "%s cannot be toggled!" % option
+ else:
+ newvalue = VALUES[VALUES.index(currentvalue) - 1]
+ weechat.set_config(option, newvalue)
+ print "%s = %s" % (option, newvalue)
+ return weechat.PLUGIN_RC_OK
+
+# ====================
+# Let's Register!
+# ====================
+if __name__ == '__main__':
+ try:
+ import weechat
+ except ImportError:
+ print "This script is to be loaded as PythonScript in WeeChat"
+ print "Get WeeChat now at: http://weechat.flashtux.org/"
+ import sys
+ sys.exit(10)
+
+ # kick pythons print to weechat.prnt(msg, '')
+ sys.stdout = WeePrint()
+ weechat.register(NAME, VERSION, "", DESCRIPTION)
+ registerFunctions()
+
Changes to src/weechat/scripts/python/uname.py
@@ -1,1 +1,18 @@
+# This script sends "uname -a" output to current channel.
+# Just type /uname while chatting on some channel ;)
+
+# by Stalwart <stlwrt doggy gmail.com>
+#
+# Released under GPL licence.
+
+import weechat
+from os import popen
+
+def senduname(server, args):
+ unameout = popen ('uname -a')
+ uname = unameout.readline()
+ weechat.command(uname[:-1])
+ return 0
+weechat.register ('uname', '1.0', '', """Sends "uname -a" output to current channel""")
+weechat.add_command_handler ('uname', 'senduname')
Changes to src/weechat/scripts/python/urlgrab.py
@@ -1,1 +1,447 @@
+#
+# UrlGrab, version 1.0, for weechat version 0.1.6
+#
+# Listens to all channels for URLs, collects them in a list, and launches
+# them in your favourite web server on the local host or a remote server.
+#
+# Usage:
+#
+# The /url command provides access to all UrlGrab functions. Run
+# '/url help' for complete command usage.
+#
+# In general, use '/url list' to list the entire url list for the current
+# channel, and '/url <n>' to launch the nth url in the list. For
+# example, to launch the first (and most-recently added) url in the list,
+# you would run '/url 1'
+#
+# From the server window, you must specify a specific channel for the
+# list and launch commands, for example:
+# /url list #weechat
+# /url 3 #weechat
+#
+# Configuration:
+#
+# The '/url set' command lets you get and set the following options:
+#
+# historysize
+# The maximum number of URLs saved per channel. Default is 10
+#
+# method
+# Must be one of 'local' or 'remote' - Defines how URLs are launched by
+# the script. If 'local', the script will run 'localcmd' on the host.
+# If 'remote', the script will run 'remotessh remotehost remotecmd' on
+# the local host which should normally use ssh to connect to another
+# host and run the browser command there.
+#
+# localcmd
+# The command to run on the local host to launch URLs in 'local' mode.
+# The string '%s' will be replaced with the URL. The default is
+# 'firefox %s'.
+#
+# remotessh
+# The command (and arguments) used to connect to the remote host for
+# 'remote' mode. The default is 'ssh -x' which will connect as the
+# current username via ssh and disable X11 forwarding.
+#
+# remotehost
+# The remote host to which we will connect in 'remote' mode. For ssh,
+# this can just be a hostname or 'user@host' to specify a username
+# other than your current login name. The default is 'localhost'.
+#
+# remotecmd
+# The command to execute on the remote host for 'remote' mode. The
+# default is 'bash -c "DISPLAY=:0.0 firefox %s"' Which runs bash, sets
+# up the environment to display on the remote host's main X display,
+# and runs firefox. As with 'localcmd', the string '%s' will be
+# replaced with the URL.
+#
+# cmdoutput
+# The file where the command output (if any) is saved. Overwritten
+# each time you launch a new URL. Default is ~/.weechat/urllaunch.log
+#
+# Requirements:
+#
+# - Designed to run with weechat version 1.0.6 or better.
+# http://weechat.flashtux.org/
+#
+# Acknowlegements:
+#
+# - Based on an earlier version called 'urlcollector.py' by 'kolter' of
+# irc.freenode.net/#weechat Honestly, I just cleaned up the code a bit and
+# made the settings a little more useful (to me).
+#
+# Copyright (C) 2005 Jim Ramsay <i.am@jimramsay.com>
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+# USA.
+#
+
+import os
+import weechat
+
+UC_NAME="UrlGrab"
+UC_VERSION="1.0"
+
+weechat.register (UC_NAME, UC_VERSION, "", "Url collector/launcher for weechat")
+weechat.add_message_handler("privmsg", "urlGrabCheck")
+weechat.add_command_handler("url", "urlGrabMain",
+ "Controls UrlGrab -> '/url help' for usage")
+
+def urlGrabPrint(message):
+ weechat.prnt("-[%s]- %s" % ( UC_NAME, message ) )
+
+class WeechatSetting:
+ def __init__(self, name, default, description = "" ):
+ self.name = name
+ self.default = default
+ self.description = description
+ test = weechat.get_plugin_config( name )
+ if test is None or test == "":
+ weechat.set_plugin_config( name, default )
+
+class UrlGrabSettings:
+ def __init__(self):
+ self.settings = {
+ 'historysize':WeechatSetting('historysize', '10',
+ "Number of URLs to keep per channel" ),
+ 'method':WeechatSetting('method', 'local',
+ """Where to launch URLs
+ If 'local', runs %localcmd%.
+ If 'remote' runs the following command:
+ `%remotessh% %remotehost% %remotecmd`"""),
+ 'localcmd':WeechatSetting('localcmd', 'firefox %s',
+ """Command to launch local URLs. '%s' becomes the URL.
+ Default 'firefox %s'"""),
+ 'remotessh':WeechatSetting('remotessh', 'ssh -x',
+ """Command (and arguments) to connect to a remote machine.
+ Default 'ssh -x'"""),
+ 'remotehost':WeechatSetting('remotehost', 'localhost',
+ """Hostname for remote launching
+ Default 'localhost'"""),
+ 'remotecmd':WeechatSetting('remotecmd',
+ 'bash -c \"DISPLAY=:0.0 firefox %s\"',
+ """Command to launch remote URLs. '%s' becomes the URL.
+ Default 'bash -c \"DISPLAY=:0.0 firefox %s\"'"""),
+ 'cmdlog':WeechatSetting('cmdlog',
+ '~/.weechat/urllaunch.log',
+ """File where command output is saved. Overwritten each
+ time an URL is launched
+ Default '~/.weechat/urllaunch.log'""" )
+ }
+
+ def has(self, name):
+ return self.settings.has_key(name)
+
+ def names(self):
+ return self.settings.keys()
+
+ def description(self, name):
+ return self.settings[name].description
+
+ def set(self, name, value):
+ # Force string values only
+ if type(value) != type("a"):
+ value = str(value)
+ if name == "method":
+ if value.lower() == "remote":
+ weechat.set_plugin_config( 'method', "remote" )
+ elif value.lower() == "local":
+ weechat.set_plugin_config( 'method', "local" )
+ else:
+ raise ValueError( "\'%s\' is not \'local\' or \'remote\'" % value )
+ elif name == "localcmd":
+ if value.find( "%s" ) == -1:
+ weechat.set_plugin_config( 'localcmd', value + " %s" )
+ else:
+ weechat.set_plugin_config( 'localcmd', value )
+ elif name == "remotecmd":
+ if value.find( "%s" ) == -1:
+ weechat.set_plugin_config( 'remotecmd', value + " %s" )
+ else:
+ weechat.set_plugin_config( 'remotecmd', value )
+ elif self.has(name):
+ weechat.set_plugin_config( name, value )
+ if name == "historysize":
+ urlGrab.setHistorysize(int(value))
+ else:
+ raise KeyError( name )
+
+ def get(self, name):
+ if self.has(name):
+ return weechat.get_plugin_config(name)
+ else:
+ raise KeyError( name )
+
+ def prnt(self, name, verbose = True):
+ weechat.prnt( " %s = %s" % (name.ljust(11), self.get(name)) )
+ if verbose:
+ weechat.prnt( " -> %s" % (self.settings[name].description) )
+
+ def prntall(self):
+ for key in self.names():
+ self.prnt(key, verbose = False)
+
+ def createCmdList(self, url):
+ if weechat.get_plugin_config( 'method' ) == 'remote':
+ tmplist = weechat.get_plugin_config( 'remotessh' ).split(" ")
+ tmplist.append(weechat.get_plugin_config( 'remotehost' ))
+ tmplist.append(weechat.get_plugin_config( 'remotecmd' ) % (url))
+ else:
+ tmplist = (weechat.get_plugin_config( 'localcmd' ) % (url) ).split(" ")
+ return tmplist
+
+class UrlGrabber:
+ def __init__(self, historysize):
+ # init
+ self.urls = {}
+ self.historysize = 5
+ # control
+ self.setHistorysize(historysize)
+
+ def setHistorysize(self, count):
+ if count > 1:
+ self.historysize = count
+
+ def getHistorysize(self):
+ return self.historysize
+
+ def addUrl(self, url, channel, server):
+ # check for server
+ if not self.urls.has_key(server):
+ self.urls[server] = {}
+ # check for chan
+ if not self.urls[server].has_key(channel):
+ self.urls[server][channel] = []
+ # add url
+ if url in self.urls[server][channel]:
+ self.urls[server][channel].remove(url)
+ self.urls[server][channel].insert(0, url)
+ # removing old urls
+ while len(self.urls[server][channel]) > self.historysize:
+ self.urls[server][channel].pop()
+
+ def hasIndex( self, index, channel, server ):
+ return self.urls.has_key(server) and \
+ self.urls[server].has_key(channel) and \
+ len(self.url[server][channel]) >= index
+
+ def hasChannel( self, channel, server ):
+ return self.urls.has_key(server) and \
+ self.urls[server].has_key(channel)
+
+ def hasServer( self, server ):
+ return self.urls.has_key(server)
+
+ def getUrl(self, index, channel, server):
+ url = ""
+ if self.urls.has_key(server):
+ if self.urls[server].has_key(channel):
+ if len(self.urls[server][channel]) >= index:
+ url = self.urls[server][channel][index-1]
+ return url
+
+
+ def prnt(self, channel, server):
+ found = True
+ if self.urls.has_key(server):
+ if self.urls[server].has_key(channel):
+ urlGrabPrint(channel + "@" + server)
+ if len(self.urls[server][channel]) > 0:
+ i = 1
+ for url in self.urls[server][channel]:
+ weechat.prnt(" --> " + str(i) + " : " + url)
+ i += 1
+ else:
+ found = False
+ elif channel == "*":
+ for channel in self.urls[server].keys():
+ self.prnt(channel, server)
+ else:
+ found = False
+ else:
+ found = False
+
+ if not found:
+ urlGrabPrint(channel + "@" + server + ": no entries")
+
+def urlGrabParsemsg(command):
+ infos = command.split(" ")
+ chan = infos[2]
+ message = " ".join(infos[3:])[1:]
+ return (chan, message)
+
+def urlGrabCheck(server, args):
+ global urlGrab
+ chan, message = urlGrabParsemsg(args)
+ # Ignore output from 'tinyurl.py'
+ if message.startswith( "[AKA] http://tinyurl.com" ):
+ return weechat.PLUGIN_RC_OK
+ # Check for URLs
+ for word in message.split(" "):
+ if word[0:7] == "http://" or \
+ word[0:8] == "https://" or \
+ word[0:6] == "ftp://":
+ urlGrab.addUrl(word, chan, server)
+ # check for any dead children and clean them up
+ while True:
+ try:
+ mypid, status = os.waitpid(0, os.WNOHANG)
+ except:
+ break
+ else:
+ if mypid <= 0:
+ break
+ return weechat.PLUGIN_RC_OK
+
+def urlGrabOpen(index, channel = None):
+ global urlGrab, urlGrabSettings
+
+ server = weechat.get_info("server")
+ if channel is None or channel == "":
+ channel = weechat.get_info("channel")
+
+ if channel == "":
+ urlGrabPrint( "No current channel, you must specify one" )
+ elif not urlGrab.hasChannel( channel, server ):
+ urlGrabPrint("No URL found - Invalid channel")
+ else:
+ if index <= 0:
+ urlGrabPrint("No URL found - Invalid index")
+ return
+ url = urlGrab.getUrl(index, channel, server)
+ if url == "":
+ urlGrabPrint("No URL found - Invalid index")
+ else:
+ urlGrabPrint("loading %s %sly" % (url, urlGrabSettings.get("method")))
+ logfile = os.path.expanduser( urlGrabSettings.get( 'cmdlog' ) )
+
+ argl = urlGrabSettings.createCmdList( url )
+ dout = open(logfile, "w")
+ dout.write( "UrlGrab: Running '%s'\n" % (" ".join(argl)) )
+ dout.close()
+ try:
+ childpid = os.fork()
+ except:
+ urlGrabPrint("Fork failed!")
+ if childpid == 0:
+ # in the child- Detach from tty and Exec the command
+ logfile = os.path.expanduser( urlGrabSettings.get( 'cmdlog' ) )
+ din = open("/dev/null", "r")
+ dout = open(logfile, "a")
+ try:
+ # Redirect IO for the child
+ os.dup2(din.fileno(), 0)
+ os.dup2(dout.fileno(), 1)
+ os.dup2(dout.fileno(), 2)
+ except:
+ dout.write( "UrlGrab: IO Redirection failed\n" )
+ dout.close()
+ din.close()
+ sys.exit(1)
+ try:
+ # Actually run the command
+ os.execvp( argl[0], argl )
+ except:
+ dout.write( "UrlGrab: Exec failed" )
+ dout.close()
+ din.close()
+ sys.exit(1)
+ else:
+ # In the parent - Don't wait now, wait later.
+ return
+
+def urlGrabList( args ):
+ global urlGrab
+ channel = ""
+ if len(args) == 0:
+ channel = weechat.get_info("channel")
+ else:
+ channel = args[0]
+
+ if channel == "" or channel == "all":
+ channel = "*"
+ urlGrab.prnt(channel, weechat.get_info("server"))
+
+def urlGrabHelp():
+ weechat.prnt("")
+ urlGrabPrint("Help")
+ weechat.prnt(" Usage : ")
+ weechat.prnt(" /url help")
+ weechat.prnt(" -> display this help")
+ weechat.prnt(" /url list [channel]")
+ weechat.prnt(" -> display list of recorded urls in the specified channel")
+ weechat.prnt(" If no channel is given, lists the current channel")
+ weechat.prnt(" /url set [name [[=] value]]")
+ weechat.prnt(" -> set or get one of the parameters")
+ weechat.prnt(" /url n [channel]")
+ weechat.prnt(" -> launch the nth url in `/url list`")
+ weechat.prnt(" or the nth url in the specified channel")
+ weechat.prnt("")
+
+def urlGrabMain(server, args):
+ largs = args.split(" ")
+ #strip spaces
+ while '' in largs:
+ largs.remove('')
+ while ' ' in largs:
+ largs.remove(' ')
+ if len(largs) == 0:
+ urlGrabHelp()
+ else:
+ if largs[0] == 'help':
+ urlGrabHelp()
+ elif largs[0] == 'list':
+ urlGrabList( largs[1:] )
+ elif largs[0] == 'set':
+ try:
+ if (len(largs) == 1):
+ urlGrabPrint( "Available settings:" )
+ urlGrabSettings.prntall()
+ elif (len(largs) == 2):
+ name = largs[1]
+ urlGrabPrint( "Get %s" % name )
+ urlGrabSettings.prnt( name )
+ elif (len(largs) > 2):
+ name = largs[1]
+ value = None
+ if( largs[2] != "="):
+ value = " ".join(largs[2:])
+ elif( largs > 3 and largs[2] == "=" ):
+ value = " ".join(largs[3:])
+ urlGrabPrint( "set %s = \'%s\'" % (name, value) )
+ if value is not None:
+ try:
+ urlGrabSettings.set( name, value )
+ urlGrabSettings.prnt( name, verbose=False )
+ except ValueError, msg:
+ weechat.prnt( " Failed: %s" % msg )
+ else:
+ weechat.prnt( " Failed: No value given" )
+ except KeyError:
+ weechat.prnt( " Failed: Unrecognized parameter '%s'" % name )
+ else:
+ try:
+ no = int(largs[0])
+ if len(largs) > 1:
+ urlGrabOpen(no, largs[1])
+ else:
+ urlGrabOpen(no)
+ except ValueError:
+ urlGrabPrint( "Unknown command '%s'. Try '/url help' for usage" % largs[0])
+ return weechat.PLUGIN_RC_OK
+# Initialize global variables
+urlGrabSettings = UrlGrabSettings()
+urlGrab = UrlGrabber( urlGrabSettings.get('historysize') )