diff options
130 files changed, 1385 insertions, 11707 deletions
diff --git a/community-staging/libvirt/PKGBUILD b/community-staging/libvirt/PKGBUILD new file mode 100644 index 000000000..f5f73cd0e --- /dev/null +++ b/community-staging/libvirt/PKGBUILD @@ -0,0 +1,88 @@ +# $Id: PKGBUILD 64468 2012-02-14 07:05:10Z spupykin $ +# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com> +# Contributor: Jonathan Wiersma <archaur at jonw dot org> + +pkgname=libvirt +pkgver=0.9.10 +pkgrel=1 +pkgdesc="API for controlling virtualization engines (openvz,kvm,qemu,virtualbox,xen,etc)" +arch=('i686' 'x86_64') +url="http://libvirt.org/" +license=('LGPL') +depends=('e2fsprogs' 'gnutls' 'iptables' 'libxml2' 'parted' 'polkit' 'python2' + 'avahi' 'yajl' 'libpciaccess' 'udev' 'dbus-core' 'libxau' 'libxdmcp' 'libpcap' + 'curl' 'libsasl' 'libgcrypt' 'libgpg-error' 'openssl' 'libxcb' 'gcc-libs' + 'iproute2' 'netcf' 'libnl1') +makedepends=('pkgconfig' 'lvm2') +optdepends=('bridge-utils: for briged networking (default)' + 'dnsmasq: for NAT/DHCP for guests' + 'kvm' + 'openbsd-netcat: for remote management over ssh' + 'qemu' + 'radvd' + 'dmidecode') +options=('emptydirs' '!libtool') +backup=('etc/conf.d/libvirtd' + 'etc/conf.d/libvirtd-guests' + 'etc/libvirt/libvirtd.conf' + 'etc/libvirt/libvirt.conf' + 'etc/libvirt/qemu.conf' + 'etc/sasl2/libvirt.conf') +install="libvirt.install" +source=("http://libvirt.org/sources/$pkgname-$pkgver.tar.gz" + libvirtd.rc.d + libvirtd.conf.d + libvirtd-guests.rc.d + libvirtd-guests.conf.d + openbsd-netcat-default.patch + unixperms.patch + yajl-2.x.patch) +md5sums=('a424bb793521e637349da47e93dd5fff' + 'c43244c40a0437038c82089618e7beaa' + '3ed0e24f5b5e25bf553f5427d64915e6' + '737ec24aa56871fbabfa892789457db4' + 'bc2971dacdbac967fc3474e50affc345' + 'b0be50eb9dfe4d133decf23b60880f7d' + 'db95aecdf2ccf3693fef5821cdcb7eba' + '5745bb8d0b254abb7a3528c66e03b0f9') + +build() { + cd "$srcdir/$pkgname-$pkgver" + + # python2 fix + export PYTHON=`which python2` + for file in $(find . -name '*.py' -print); do + sed -i 's_#!.*/usr/bin/python_#!/usr/bin/python2_' $file + sed -i 's_#!.*/usr/bin/env.*python_#!/usr/bin/env python2_' $file + done + +# for more information on authentication see http://libvirt.org/auth.html +# If you wish to have unix-permissions based access rather than only polkit +# access, create a group called libvirt and uncomment the line below: +# patch -Np1 -i "$srcdir"/unixperms.patch + + [ $NOEXTRACT -eq 1 ] || patch -Np1 -i "$srcdir"/openbsd-netcat-default.patch + + # fixes for yajl 2.0 API changes +# [ $NOEXTRACT -eq 1 ] || patch -Np1 -i "$srcdir/yajl-2.x.patch" + + export LDFLAGS=-lX11 + [ -f Makefile ] || ./configure --prefix=/usr --libexec=/usr/lib/"$pkgname" \ + --with-storage-lvm --without-xen --with-udev --without-hal --disable-static + find -name Makefile -exec sed -i 's#-L /usr#-L/usr#' {} \; + make -j1 +} + +package() { + cd "$srcdir/$pkgname-$pkgver" + + make DESTDIR="$pkgdir" install + + install -D -m755 "$srcdir"/libvirtd.rc.d "$pkgdir"/etc/rc.d/libvirtd + install -D -m644 "$srcdir"/libvirtd.conf.d "$pkgdir"/etc/conf.d/libvirtd + + install -D -m755 "$srcdir"/libvirtd-guests.rc.d "$pkgdir"/etc/rc.d/libvirtd-guests + install -D -m644 "$srcdir"/libvirtd-guests.conf.d "$pkgdir"/etc/conf.d/libvirtd-guests + + rm -rf $pkgdir/var/run +} diff --git a/community-staging/libvirt/libvirt.install b/community-staging/libvirt/libvirt.install new file mode 100644 index 000000000..3881386d2 --- /dev/null +++ b/community-staging/libvirt/libvirt.install @@ -0,0 +1,38 @@ +_libvirt_setup() { + rm -f /usr/lib/python?.?/site-packages/libvirt.pyc + echo ">>> To use libvirt as a non-root user:" + echo ">>> Use polkit to grant access." + echo ">>> ...or change the access model in /etc/libvirt/libvirtd.conf." + echo ">>> (see unixperms.patch in PKGBUILD for help)" + echo "" +} + +post_install() { + _libvirt_setup || return 1 + echo ">>> Be sure to see optdepends as you may find some of them helpfull." + echo ">>> Especially: bridge-utils, dnsmasq, and hal." + echo "" + echo ">>> To start libvirtd run: '/etc/rc.d/libvirtd start' as root." + echo ">>> Add 'libvirtd' to daemons in /etc/rc.conf if you want it to load upon" + echo ">>> booting." + echo "" + /bin/true +} + +post_upgrade() { + _libvirt_setup || return 1 + echo ">>> To finish the upgrade, restart libvirtd by running the command:" + echo ">>> '/etc/rc.d/libvirtd restart' as root or rebooting." + echo ">>> You may also need to run 'rm -rf ~/.libvirt'" + echo "" + /bin/true +} + +post_remove() { + rm -f /usr/lib/python[0-9].[0-9]/site-packages/libvirt.pyc + echo ">>> You may wish to delete the group 'libvirt' if it still exists." + echo ">>> It can be removed by running 'groupdel libvirt' as root." + echo "" + depmod -a + /bin/true +} diff --git a/community-staging/libvirt/libvirtd-guests.conf.d b/community-staging/libvirt/libvirtd-guests.conf.d new file mode 100644 index 000000000..02a933715 --- /dev/null +++ b/community-staging/libvirt/libvirtd-guests.conf.d @@ -0,0 +1,11 @@ +LIBVIRTD_STOP_ACTION=suspend + +#LIBVIRTD_URI="-c qemu+ssh://user@host/system" +LIBVIRTD_URI="" + +#LIBVIRTD_BYPASS_CACHE="--bypass-cache" +LIBVIRTD_BYPASS_CACHE="" + +LIBVIRTD_START_DELAY=0 + +LIBVIRTD_SHUTDOWN_TIMEOUT=3 diff --git a/community-staging/libvirt/libvirtd-guests.rc.d b/community-staging/libvirt/libvirtd-guests.rc.d new file mode 100644 index 000000000..b4331964a --- /dev/null +++ b/community-staging/libvirt/libvirtd-guests.rc.d @@ -0,0 +1,107 @@ +#!/bin/bash + +. /etc/conf.d/libvirtd-guests +. /etc/rc.conf +. /etc/rc.d/functions + +LIBVIRTD_LISTFILE="/var/state/libvirtd/vm-list" + +# get guest state by name +libvirt_get_guest_state() +{ + virsh $LIBVIRTD_URI dominfo "$1" | grep -E '^State:' | awk '{print $2}' +} + +# list IDs of running guests +libvirt_list() +{ + virsh $LIBVIRTD_URI list | awk 'NR > 2 {print $2}' +} + +# suspend guest by name +libvirt_suspend() +{ + virsh $LIBVIRTD_URI $LIBVIRTD_BYPASS_CACHE managedsave "$1" >/dev/null + timeout=$LIBVIRTD_SHUTDOWN_TIMEOUT + while [ "$timeout" -gt 0 ]; do + sleep 1 + timeout=$((timeout - 1)) + state=`libvirt_get_guest_state "$1"` + [ "x$state" == "xshut" ] && return 0 + done + return 1 +} + +# shutdown guest by name +libvirt_shutdown() +{ + virsh $LIBVIRTD_URI shutdown "$1" >/dev/null + timeout=$LIBVIRTD_SHUTDOWN_TIMEOUT + while [ "$timeout" -gt 0 ]; do + sleep 1 + timeout=$((timeout - 1)) + state=`libvirt_get_guest_state "$1"` + [ "x$state" != "xshut" ] && return 0 + done + return 1 +} + +# start guest by name +libvirt_start() +{ + virsh $LIBVIRTD_URI $LIBVIRTD_BYPASS_CACHE start "$1" >/dev/null +} + +# stop all guests +libvirt_stop_all() +{ + mkdir -p `dirname $LIBVIRTD_LISTFILE` + echo -n >$LIBVIRTD_LISTFILE + for i in `libvirt_list`; do + if [ "x$LIBVIRTD_STOP_ACTION" == "xsuspend" ]; then + stat_busy "Suspending libvirtd/$i guest" + libvirt_suspend "$i" + else + stat_busy "Shutting libvirtd/$i guest down" + libvirt_shutdown "$i" + fi + [ $? -eq 0 ] && stat_done || stat_fail + echo $i >>$LIBVIRTD_LISTFILE + done +} + +# start all guests +libvirt_start_all() +{ + if [ -f $LIBVIRTD_LISTFILE ]; then + for i in `cat $LIBVIRTD_LISTFILE`; do + stat_busy "Starting/resuming libvirtd/$i guest" + libvirt_start "$i" + [ $? -eq 0 ] && { sleep $LIBVIRTD_START_DELAY; stat_done; } || stat_fail + done + fi + rm -f $LIBVIRTD_LISTFILE +} + +# main +LC_ALL=C +LANG=C +case "$1" in + start) + libvirt_start_all + add_daemon libvirtd-guests + ;; + stop) + libvirt_stop_all + rm_daemon libvirtd-guests + ;; + restart) + $0 stop + sleep 1 + $0 start + ;; + *) + echo $"Usage: $0 {start|stop|restart}" + ;; +esac +exit 0 diff --git a/community-staging/libvirt/libvirtd.conf.d b/community-staging/libvirt/libvirtd.conf.d new file mode 100644 index 000000000..d4d25b47a --- /dev/null +++ b/community-staging/libvirt/libvirtd.conf.d @@ -0,0 +1,3 @@ +LIBVIRTD_CONFIG="/etc/libvirt/libvirtd.conf" +LIBVIRTD_ARGS="-p /var/run/libvirtd.pid" +KRB5_KTNAME="/etc/libvirt/krb5.tab" diff --git a/community-staging/libvirt/libvirtd.rc.d b/community-staging/libvirt/libvirtd.rc.d new file mode 100644 index 000000000..193bffa9c --- /dev/null +++ b/community-staging/libvirt/libvirtd.rc.d @@ -0,0 +1,66 @@ +#!/bin/bash + +. /etc/rc.conf +. /etc/conf.d/libvirtd +. /etc/rc.d/functions + +LIBVIRTD_CONFIG_ARGS= +if [ -n "$LIBVIRTD_CONFIG" ] +then + LIBVIRTD_CONFIG_ARGS="--config $LIBVIRTD_CONFIG" +fi + +PID=`pidof -o %PPID /usr/sbin/libvirtd` +case "$1" in + start) + stat_busy "Starting libvirtd" + export RADVD=/usr/sbin/radvd + for i in /var/run/libvirt/qemu /var/run/libvirt/lxc /var/run/libvirt/uml /var/run/libvirt/network; do + [ -d $i ] || mkdir -p $i + done + [ -z "$PID" ] && ( + mkdir -p /var/{cache,run}/libvirt + rm -rf /var/cache/libvirt/* + KRB5_KTNAME=$KRB5_KTNAME \ + /usr/sbin/libvirtd --daemon $LIBVIRTD_CONFIG_ARGS $LIBVIRTD_ARGS + ) + if [ $? -gt 0 ]; then + stat_fail + else + add_daemon libvirtd + stat_done + fi + ;; + stop) + stat_busy "Stopping libvirtd" + [ ! -z "$PID" ] && ( + kill $PID &> /dev/null + rm -rf /var/cache/libvirt/* + rm -f /var/run/libvirtd.pid + ) + if [ $? -gt 0 ]; then + stat_fail + else + rm_daemon libvirtd + stat_done + fi + ;; + restart) + $0 stop + sleep 1 + $0 start + ;; + reload) + stat_busy "Reloading libvirtd configuration" + [ ! -z "$PID" ] && kill -HUP $PID &> /dev/null + if [ $? -gt 0 ]; then + stat_fail + else + stat_done + fi + ;; + *) + echo $"Usage: $0 {start|stop|restart|reload}" + ;; +esac +exit 0 diff --git a/community-staging/libvirt/openbsd-netcat-default.patch b/community-staging/libvirt/openbsd-netcat-default.patch new file mode 100644 index 000000000..a01b4f14e --- /dev/null +++ b/community-staging/libvirt/openbsd-netcat-default.patch @@ -0,0 +1,36 @@ +diff -wbBur libvirt-0.9.7/src/qemu/qemu_migration.c libvirt-0.9.7.my/src/qemu/qemu_migration.c +--- libvirt-0.9.7/src/qemu/qemu_migration.c 2011-10-31 07:46:04.000000000 +0400 ++++ libvirt-0.9.7.my/src/qemu/qemu_migration.c 2011-11-08 15:46:10.000000000 +0400 +@@ -1589,7 +1589,7 @@ + spec->dest.unix_socket.file); + } else { + const char *args[] = { +- "nc", "-U", spec->dest.unix_socket.file, NULL ++ "nc.openbsd", "-U", spec->dest.unix_socket.file, NULL + }; + ret = qemuMonitorMigrateToCommand(priv->mon, migrate_flags, args); + } +diff -wbBur libvirt-0.9.7/src/remote/remote_driver.c libvirt-0.9.7.my/src/remote/remote_driver.c +--- libvirt-0.9.7/src/remote/remote_driver.c 2011-11-08 07:53:30.000000000 +0400 ++++ libvirt-0.9.7.my/src/remote/remote_driver.c 2011-11-08 15:46:10.000000000 +0400 +@@ -614,7 +614,7 @@ + username, + !tty, + !verify, +- netcat ? netcat : "nc", ++ netcat ? netcat : "nc.openbsd", + keyfile, + sockname))) + goto failed; +diff -wbBur libvirt-0.9.7/src/rpc/virnetsocket.c libvirt-0.9.7.my/src/rpc/virnetsocket.c +--- libvirt-0.9.7/src/rpc/virnetsocket.c 2011-11-08 07:53:30.000000000 +0400 ++++ libvirt-0.9.7.my/src/rpc/virnetsocket.c 2011-11-08 15:46:31.000000000 +0400 +@@ -642,7 +642,7 @@ + virCommandAddArgList(cmd, "-o", "StrictHostKeyChecking=no", NULL); + + if (!netcat) +- netcat = "nc"; ++ netcat = "nc.openbsd"; + + virCommandAddArgList(cmd, nodename, "sh", "-c", NULL); + diff --git a/community-staging/libvirt/unixperms.patch b/community-staging/libvirt/unixperms.patch new file mode 100644 index 000000000..b3fb86cf5 --- /dev/null +++ b/community-staging/libvirt/unixperms.patch @@ -0,0 +1,47 @@ +diff -ur libvirt-0.7.4-orig/daemon/libvirtd.conf libvirt-0.7.4-patched/daemon/libvirtd.conf +--- libvirt-0.7.4-orig/daemon/libvirtd.conf 2009-11-23 03:10:33.398655655 -0800 ++++ libvirt-0.7.4-patched/daemon/libvirtd.conf 2009-11-23 03:09:37.831189671 -0800 +@@ -78,14 +78,14 @@ + # without becoming root. + # + # This is restricted to 'root' by default. +-#unix_sock_group = "libvirt" ++unix_sock_group = "libvirt" + + # Set the UNIX socket permissions for the R/O socket. This is used + # for monitoring VM status only + # + # Default allows any user. If setting group ownership may want to + # restrict this to: +-#unix_sock_ro_perms = "0777" ++unix_sock_ro_perms = "0770" + + # Set the UNIX socket permissions for the R/W socket. This is used + # for full management of VMs +@@ -95,7 +95,7 @@ + # + # If not using PolicyKit and setting group ownership for access + # control then you may want to relax this to: +-#unix_sock_rw_perms = "0770" ++unix_sock_rw_perms = "0770" + + # Set the name of the directory in which sockets will be found/created. + #unix_sock_dir = "/var/run/libvirt" +@@ -126,7 +126,7 @@ + # + # To restrict monitoring of domains you may wish to enable + # an authentication mechanism here +-#auth_unix_ro = "none" ++auth_unix_ro = "none" + + # Set an authentication scheme for UNIX read-write sockets + # By default socket permissions only allow root. If PolicyKit +@@ -135,7 +135,7 @@ + # + # If the unix_sock_rw_perms are changed you may wish to enable + # an authentication mechanism here +-#auth_unix_rw = "none" ++auth_unix_rw = "none" + + # Change the authentication scheme for TCP sockets. + # diff --git a/community-staging/libvirt/yajl-2.x.patch b/community-staging/libvirt/yajl-2.x.patch new file mode 100644 index 000000000..80d3edce0 --- /dev/null +++ b/community-staging/libvirt/yajl-2.x.patch @@ -0,0 +1,66 @@ +--- a/src/util/json.c 2011-03-24 03:10:26.000000000 -0400 ++++ b/src/util/json.c 2011-04-25 20:01:29.354939116 -0400 +@@ -709,7 +709,7 @@ + + static int virJSONParserHandleNumber(void * ctx, + const char * s, +- unsigned int l) ++ size_t l) + { + virJSONParserPtr parser = ctx; + char *str = strndup(s, l); +@@ -735,7 +735,7 @@ + + static int virJSONParserHandleString(void * ctx, + const unsigned char * stringVal, +- unsigned int stringLen) ++ size_t stringLen) + { + virJSONParserPtr parser = ctx; + virJSONValuePtr value = virJSONValueNewStringLen((const char *)stringVal, +@@ -756,7 +756,7 @@ + + static int virJSONParserHandleMapKey(void * ctx, + const unsigned char * stringVal, +- unsigned int stringLen) ++ size_t stringLen) + { + virJSONParserPtr parser = ctx; + virJSONParserStatePtr state; +@@ -894,14 +894,14 @@ + /* XXX add an incremental streaming parser - yajl trivially supports it */ + virJSONValuePtr virJSONValueFromString(const char *jsonstring) + { +- yajl_parser_config cfg = { 1, 1 }; + yajl_handle hand; + virJSONParser parser = { NULL, NULL, 0 }; + virJSONValuePtr ret = NULL; + + VIR_DEBUG("string=%s", jsonstring); + +- hand = yajl_alloc(&parserCallbacks, &cfg, NULL, &parser); ++ hand = yajl_alloc(&parserCallbacks, NULL, &parser); ++ yajl_config(hand, yajl_allow_comments, 1); + + if (yajl_parse(hand, + (const unsigned char *)jsonstring, +@@ -1002,15 +1002,16 @@ + + char *virJSONValueToString(virJSONValuePtr object) + { +- yajl_gen_config conf = { 0, " " }; /* Turns off pretty printing since QEMU can't cope */ + yajl_gen g; + const unsigned char *str; + char *ret = NULL; +- unsigned int len; ++ size_t len; + + VIR_DEBUG("object=%p", object); + +- g = yajl_gen_alloc(&conf, NULL); ++ g = yajl_gen_alloc(NULL); ++ yajl_gen_config(g, yajl_gen_beautify, 0); ++ yajl_gen_config(g, yajl_gen_indent_string, " "); + + if (virJSONValueToStringOne(object, g) < 0) { + virReportOOMError(); diff --git a/community-staging/netcf/PKGBUILD b/community-staging/netcf/PKGBUILD new file mode 100644 index 000000000..cf8d6f053 --- /dev/null +++ b/community-staging/netcf/PKGBUILD @@ -0,0 +1,30 @@ +# $Id: PKGBUILD 64466 2012-02-14 06:53:16Z spupykin $ +# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com> +# Contributor: Aurélien Wailly <aurelien.wailly@gmail.com> + +pkgname=netcf +pkgver=0.1.7 +pkgrel=3 +pkgdesc="A library for configuring network interfaces" +arch=('i686' 'x86_64') +license=('LGPL') +url="https://fedorahosted.org/netcf/" +depends=('augeas>=0.7.4' 'netcfg' 'libxslt' 'libxml2' 'libnl1') +makedepends=('gcc') +options=(!libtool) +source=("https://fedorahosted.org/released/netcf/$pkgname-$pkgver.tar.gz" + netcf-0.1.7.patch) +md5sums=('8e313b623c907eb035cf3948b71fecc2' + '0e88ee6813219e9e75a943444fe439f5') + +build() { + cd "${srcdir}/${pkgname}-${pkgver}" + patch -Np1 -i ${srcdir}/netcf-0.1.7.patch + ./configure --prefix=/usr --disable-static + make +} + +package() { + cd "${srcdir}/${pkgname}-${pkgver}" + make DESTDIR=${pkgdir} install +} diff --git a/community-staging/netcf/netcf-0.1.7.patch b/community-staging/netcf/netcf-0.1.7.patch new file mode 100644 index 000000000..d4a4d31b7 --- /dev/null +++ b/community-staging/netcf/netcf-0.1.7.patch @@ -0,0 +1,426 @@ +diff -ur netcf-0.1.7.ori//data/xml/initscripts-get.xsl netcf-0.1.7/data/xml/initscripts-get.xsl +--- netcf-0.1.7.ori//data/xml/initscripts-get.xsl 2009-10-04 08:18:41.000000000 +0200 ++++ netcf-0.1.7/data/xml/initscripts-get.xsl 2010-12-08 14:54:28.891813397 +0100 +@@ -47,9 +47,12 @@ + <xsl:template name="vlan-interface-common"> + <xsl:variable name="iface" select="concat(vlan/interface/@name, '.', vlan/@tag)"/> + +- <xsl:attribute name="path">/files/etc/sysconfig/network-scripts/ifcfg-<xsl:value-of select="$iface"/></xsl:attribute> +- <node label="DEVICE" value="{$iface}"/> +- <node label="VLAN" value="yes"/> ++ <xsl:attribute name="path">/files/etc/network.d/ifcfg-<xsl:value-of select="$iface"/></xsl:attribute> ++ <node label="INTERFACE" value="{$iface}"/> ++ <node label="PHYS_INTERFACE" value="{vlan/interface/@name}"/> ++ <node label="VLAN" value="{vlan/@tag}"/> ++ <node label="CONNECTION" value="ethernet-iproute-vlan"/> ++ <node label="FLAG" value="false"/> + </xsl:template> + + <xsl:template name='bare-vlan-interface'> +@@ -68,6 +71,7 @@ + <xsl:call-template name="startmode"/> + <xsl:call-template name="mtu"/> + <node label="TYPE" value="Bridge"/> ++ <node label="CONNECTION" value="bridge"/> + <xsl:call-template name="interface-addressing"/> + <xsl:if test="bridge/@stp"> + <node label="STP" value="{bridge/@stp}"/> +@@ -75,7 +79,11 @@ + <xsl:if test="bridge/@delay"> + <node label="DELAY" value="{bridge/@delay}"/> + </xsl:if> ++ <node label="DHCP_TIMEOUT" value="0"/> ++ <!-- ++ We don't have to define interfaces separately + </tree> ++ + <xsl:for-each select='bridge/interface'> + <tree> + <xsl:if test="@type = 'ethernet'"> +@@ -87,12 +95,29 @@ + <xsl:if test="@type = 'bond'"> + <xsl:call-template name="bare-bond-interface"/> + </xsl:if> ++ ++ BRIDGE_INTERFACES= is defined with all interfaces + <node label="BRIDGE" value="{../../@name}"/> ++ ++ <xsl:variable name="bridgeifaces" select="concat($bridgeifaces, '.', @name)"/> + </tree> + <xsl:if test="@type = 'bond'"> + <xsl:call-template name="bond-slaves"/> + </xsl:if> + </xsl:for-each> ++ --> ++ <!-- <xsl:if test="count(ip) > 1"> --> ++ <node label="BRIDGE_INTERFACES"> ++ <xsl:attribute name="value"> ++ <xsl:text></xsl:text> ++ <xsl:for-each select="bridge/interface"> ++ <xsl:value-of select="@name"/><xsl:value-of select="string(' ')"/> ++ </xsl:for-each> ++ <xsl:text></xsl:text> ++ </xsl:attribute> ++ </node> ++ <!-- </xsl:if> --> ++ </tree> + </xsl:template> + + <!-- +@@ -138,8 +163,8 @@ + Named templates, following the Relax NG syntax + --> + <xsl:template name="name-attr"> +- <xsl:attribute name="path">/files/etc/sysconfig/network-scripts/ifcfg-<xsl:value-of select="@name"/></xsl:attribute> +- <node label="DEVICE" value="{@name}"/> ++ <xsl:attribute name="path">/files/etc/network.d/ifcfg-<xsl:value-of select="@name"/></xsl:attribute> ++ <node label="INTERFACE" value="{@name}"/> + </xsl:template> + + <xsl:template name="mtu"> +@@ -153,6 +178,7 @@ + <xsl:if test="mac"> + <node label="HWADDR" value="{mac/@address}"/> + </xsl:if> ++ <node label="CONNECTION" value="{@type}"/> + <xsl:call-template name="startmode"/> + <xsl:call-template name="mtu"/> + </xsl:template> +@@ -184,14 +210,14 @@ + <xsl:template name="protocol-ipv4"> + <xsl:choose> + <xsl:when test="dhcp"> +- <node label="BOOTPROTO" value="dhcp"/> ++ <node label="IP" value="dhcp"/> + <xsl:if test="dhcp/@peerdns"> + <node label="PEERDNS" value="{dhcp/@peerdns}"/> + </xsl:if> + </xsl:when> + <xsl:when test="ip"> +- <node label="BOOTPROTO" value="none"/> +- <node label="IPADDR" value="{ip/@address}"/> ++ <node label="IP" value="static"/> ++ <node label="ADDR" value="{ip/@address}"/> + <xsl:if test="ip/@prefix"> + <node label="NETMASK" value="{ipcalc:netmask(ip/@prefix)}"/> + </xsl:if> +diff -ur netcf-0.1.7.ori//data/xml/initscripts-put.xsl netcf-0.1.7/data/xml/initscripts-put.xsl +--- netcf-0.1.7.ori//data/xml/initscripts-put.xsl 2009-10-04 08:18:41.000000000 +0200 ++++ netcf-0.1.7/data/xml/initscripts-put.xsl 2010-11-26 10:44:46.133757628 +0100 +@@ -47,7 +47,7 @@ + </xsl:template> + + <xsl:template name="bare-vlan-interface"> +- <xsl:variable name="name" select="node[@label = 'DEVICE']/@value"/> ++ <xsl:variable name="name" select="node[@label = 'INTERFACE']/@value"/> + <interface type="vlan"> + <xsl:call-template name="name-attr"/> + <xsl:call-template name="vlan-device"/> +@@ -55,7 +55,7 @@ + </xsl:template> + + <xsl:template name="vlan-device"> +- <xsl:variable name="name" select="node[@label = 'DEVICE']/@value"/> ++ <xsl:variable name="name" select="node[@label = 'INTERFACE']/@value"/> + <xsl:variable name="device" select="substring-before($name, '.')"/> + <xsl:variable name="tag" select="substring-after($name, '.')"/> + <vlan tag="{$tag}"> +@@ -70,7 +70,7 @@ + match="tree[node[@label = 'TYPE' and @value = 'Bridge']]"> + <interface type="bridge"> + <!-- the bridge node itself --> +- <xsl:variable name="iface" select="node[@label= 'DEVICE']/@value"/> ++ <xsl:variable name="iface" select="node[@label= 'INTERFACE']/@value"/> + <xsl:call-template name="name-attr"/> + <xsl:call-template name="startmode"/> + <xsl:call-template name="mtu"/> +@@ -101,17 +101,17 @@ + Bond + --> + <xsl:template name="bond-element"> +- <xsl:variable name="iface" select="node[@label= 'DEVICE']/@value"/> ++ <xsl:variable name="iface" select="node[@label= 'INTERFACE']/@value"/> + <bond> + <xsl:variable name="opts" select="node[@label = 'BONDING_OPTS']/@value"/> + <xsl:call-template name="bonding-opts"> + <xsl:with-param name="opts" select="$opts"/> + </xsl:call-template> + <xsl:variable name="primary" select="bond:option($opts, 'primary')"/> +- <xsl:for-each select="/descendant-or-self::*[node[@label = 'MASTER' and @value = $iface]][node[@label = 'DEVICE' and @value = $primary]]"> ++ <xsl:for-each select="/descendant-or-self::*[node[@label = 'MASTER' and @value = $iface]][node[@label = 'INTERFACE' and @value = $primary]]"> + <xsl:call-template name='bare-ethernet-interface'/> + </xsl:for-each> +- <xsl:for-each select="/descendant-or-self::*[node[@label = 'MASTER' and @value = $iface]][node[@label = 'DEVICE' and @value != $primary]]"> ++ <xsl:for-each select="/descendant-or-self::*[node[@label = 'MASTER' and @value = $iface]][node[@label = 'INTERFACE' and @value != $primary]]"> + <xsl:call-template name='bare-ethernet-interface'/> + </xsl:for-each> + </bond> +@@ -125,7 +125,7 @@ + </xsl:template> + + <xsl:template name="bond-interface" +- match="tree[node[@label = 'DEVICE'][@value = //tree/node[@label = 'MASTER']/@value]][count(node[@label = 'BRIDGE']) = 0]"> ++ match="tree[node[@label = 'INTERFACE'][@value = //tree/node[@label = 'MASTER']/@value]][count(node[@label = 'BRIDGE']) = 0]"> + <interface type="bond"> + <xsl:call-template name="name-attr"/> + <xsl:call-template name="startmode"/> +@@ -154,7 +154,7 @@ + + <xsl:template name="name-attr"> + <xsl:attribute name="name"> +- <xsl:value-of select="node[@label= 'DEVICE']/@value"/> ++ <xsl:value-of select="node[@label= 'INTERFACE']/@value"/> + </xsl:attribute> + </xsl:template> + +@@ -173,7 +173,7 @@ + <xsl:variable name="uses_dhcp" + select="node[@label = 'BOOTPROTO']/@value = 'dhcp'"/> + <xsl:variable name="uses_static" +- select="count(node[@label = 'IPADDR']) > 0"/> ++ select="count(node[@label = 'ADDR']) > 0"/> + <xsl:variable name="uses_ipv4" select="$uses_dhcp or $uses_static"/> + <xsl:if test="$uses_ipv4"> + <protocol family="ipv4"> +@@ -186,7 +186,7 @@ + </dhcp> + </xsl:when> + <xsl:when test="$uses_static"> +- <ip address="{node[@label = 'IPADDR']/@value}"> ++ <ip address="{node[@label = 'ADDR']/@value}"> + <xsl:choose> + <xsl:when test="node[@label = 'PREFIX']"> + <xsl:attribute name="prefix"><xsl:value-of select="node[@label = 'PREFIX']/@value"/></xsl:attribute> +diff -ur netcf-0.1.7.ori//src/drv_initscripts.c netcf-0.1.7/src/drv_initscripts.c +--- netcf-0.1.7.ori//src/drv_initscripts.c 2010-09-23 14:13:13.000000000 +0200 ++++ netcf-0.1.7/src/drv_initscripts.c 2010-12-08 13:57:02.027361706 +0100 +@@ -49,17 +49,20 @@ + #include <libexslt/exslt.h> + + static const char *const network_scripts_path = +- "/files/etc/sysconfig/network-scripts"; ++ //"/files/etc/sysconfig/network-scripts"; ++ "/files/etc/network.d/*"; + + static const char *const ifcfg_path = +- "/files/etc/sysconfig/network-scripts/*"; ++ //"/files/etc/sysconfig/network-scripts/*"; ++ "/files/etc/network.d/*"; + + /* Augeas should only load the files we are interested in */ + static const struct augeas_pv augeas_xfm_common_pv[] = { + /* Ifcfg files */ + { "/augeas/load/Ifcfg/lens", "Sysconfig.lns" }, + { "/augeas/load/Ifcfg/incl", +- "/etc/sysconfig/network-scripts/ifcfg-*" }, ++ "/etc/network.d/ifcfg-*" }, ++ //"/etc/sysconfig/network-scripts/ifcfg-*" }, + { "/augeas/load/Ifcfg/excl[1]", "*~" }, + { "/augeas/load/Ifcfg/excl[2]", "*.bak" }, + { "/augeas/load/Ifcfg/excl[3]", "*.orig" }, +@@ -107,10 +110,10 @@ + int nmatches; + + nmatches = aug_fmt_match(ncf, NULL, +- "%s[ DEVICE = '%s'" ++ "%s[ INTERFACE = '%s'" + " or BRIDGE = '%s'" + " or MASTER = '%s'" +- " or MASTER = ../*[BRIDGE = '%s']/DEVICE ]/DEVICE", ++ " or MASTER = ../*[BRIDGE = '%s']/INTERFACE ]/INTERFACE", + ifcfg_path, name, name, name, name); + return nmatches > 0; + } +@@ -173,7 +176,7 @@ + aug = get_augeas(ncf); + ERR_BAIL(ncf); + +- ndevs = aug_fmt_match(ncf, &devs, "%s[DEVICE = '%s']", ++ ndevs = aug_fmt_match(ncf, &devs, "%s[INTERFACE = '%s']", + ifcfg_path, name); + ERR_COND_BAIL(ndevs < 0, ncf, EOTHER); + +@@ -296,7 +299,8 @@ + int result = 0, ndevs; + char **devs = NULL; + +- ndevs = aug_fmt_match(ncf, &devs, "%s/DEVICE", ifcfg_path); ++ ndevs = aug_fmt_match(ncf, &devs, "%s/INTERFACE", ifcfg_path); ++ printf("%i\n", ndevs); + ERR_COND_BAIL(ndevs < 0, ncf, EOTHER); + + result = uniq_ifcfg_paths(ncf, ndevs, devs, intf); +@@ -453,11 +457,11 @@ + + int drv_list_interfaces(struct netcf *ncf, int maxnames, char **names, + unsigned int flags) { +- return list_interface_ids(ncf, maxnames, names, flags, "DEVICE"); ++ return list_interface_ids(ncf, maxnames, names, flags, "INTERFACE"); + } + + int drv_num_of_interfaces(struct netcf *ncf, unsigned int flags) { +- return list_interface_ids(ncf, 0, NULL, flags, "DEVICE"); ++ return list_interface_ids(ncf, 0, NULL, flags, "INTERFACE"); + } + + struct netcf_if *drv_lookup_by_name(struct netcf *ncf, const char *name) { +@@ -599,8 +603,8 @@ + + ncf = nif->ncf; + ndevs = aug_fmt_match(ncf, &devs, +- "%s[ DEVICE = '%s' or BRIDGE = '%s' or MASTER = '%s'" +- " or MASTER = ../*[BRIDGE = '%s']/DEVICE ]/DEVICE", ++ "%s[ INTERFACE = '%s' or BRIDGE = '%s' or MASTER = '%s'" ++ " or MASTER = ../*[BRIDGE = '%s']/INTERFACE ]/INTERFACE", + ifcfg_path, nif->name, nif->name, nif->name, nif->name); + ERR_BAIL(ncf); + +@@ -745,7 +749,7 @@ + int nmatches = 0; + + nmatches = aug_fmt_match(ncf, NULL, +- "%s[ DEVICE = '%s' and TYPE = 'Bridge']", ++ "%s[ INTERFACE = '%s' and TYPE = 'Bridge']", + ifcfg_path, name); + return nmatches > 0; + } +@@ -758,7 +762,7 @@ + ERR_BAIL(ncf); + + nslaves = aug_fmt_match(ncf, slaves, +- "%s[ BRIDGE = '%s' ]/DEVICE", ifcfg_path, name); ++ "%s[ BRIDGE = '%s' ]/INTERFACE", ifcfg_path, name); + ERR_BAIL(ncf); + for (int i=0; i < nslaves; i++) { + char *p = (*slaves)[i]; +@@ -790,8 +794,8 @@ + /* The last or clause catches slaves of a bond that are enslaved to + * a bridge NAME */ + r = xasprintf(&path, +- "%s[ DEVICE = '%s' or BRIDGE = '%s' or MASTER = '%s' " +- " or MASTER = ../*[BRIDGE = '%s']/DEVICE ]", ++ "%s[ INTERFACE = '%s' or BRIDGE = '%s' or MASTER = '%s' " ++ " or MASTER = ../*[BRIDGE = '%s']/INTERFACE ]", + ifcfg_path, name, name, name, name); + ERR_NOMEM(r < 0, ncf); + +@@ -967,7 +971,7 @@ + for (int i = 0; i < nmatches; i++) { + if (!has_ifcfg_file(ncf, matches[i])) + continue; +- r = xasprintf(&ifcfg, "%s[DEVICE = '%s']", ifcfg_path, matches[i]); ++ r = xasprintf(&ifcfg, "%s[INTERFACE = '%s']", ifcfg_path, matches[i]); + ERR_NOMEM(r < 0, ncf); + + if (! is_slave(ncf, ifcfg)) +@@ -1023,7 +1027,10 @@ + */ + + int drv_if_up(struct netcf_if *nif) { +- static const char *const ifup = "ifup"; ++ //static const char *const ifup = "ifup"; ++ static const char *const ifup = "netcfg"; ++ static const char *const ifprefix = "ifcfg-"; ++ char ifname[strlen(nif->name) + sizeof(ifprefix)]; + struct netcf *ncf = nif->ncf; + char **slaves = NULL; + int nslaves = 0; +@@ -1035,11 +1042,24 @@ + ERR_BAIL(ncf); + + for (int i=0; i < nslaves; i++) { +- run1(ncf, ifup, slaves[i]); ++ //run1(ncf, ifup, slaves[i]); ++ const char *const argv[] = { ++ ifup, "-u", slaves[i], NULL ++ }; ++ ++ run_program(ncf, argv); + ERR_BAIL(ncf); + } + } +- run1(ncf, ifup, nif->name); ++ //run1(ncf, ifup, nif->name); ++ /* Interfaces name have to be equal to script under /etc/network.d */ ++ strcpy(ifname, ifprefix); ++ strcat(ifname, nif->name); ++ const char *const argv[] = { ++ ifup, "-u", ifname, NULL ++ }; ++ ++ run_program(ncf, argv); + ERR_BAIL(ncf); + result = 0; + error: +@@ -1048,13 +1068,23 @@ + } + + int drv_if_down(struct netcf_if *nif) { +- static const char *const ifdown = "ifdown"; ++ //static const char *const ifdown = "ifdown"; ++ static const char *const ifdown = "netcfg"; ++ static const char *const ifprefix = "ifcfg-"; ++ char ifname[strlen(nif->name) + sizeof(ifprefix)]; + struct netcf *ncf = nif->ncf; + char **slaves = NULL; + int nslaves = 0; + int result = -1; + +- run1(ncf, ifdown, nif->name); ++ //run1(ncf, ifdown, nif->name); ++ strcpy(ifname, ifprefix); ++ strcat(ifname, nif->name); ++ const char *const argv[] = { ++ ifdown, "-d", ifname, NULL ++ }; ++ ++ run_program(ncf, argv); + ERR_BAIL(ncf); + if (is_bridge(ncf, nif->name)) { + /* Bring up bridge slaves after the bridge */ +@@ -1062,7 +1092,12 @@ + ERR_BAIL(ncf); + + for (int i=0; i < nslaves; i++) { +- run1(ncf, ifdown, slaves[i]); ++ //run1(ncf, ifdown, slaves[i]); ++ const char *const argvs[] = { ++ ifdown, "-d", slaves[i], NULL ++ }; ++ ++ run_program(ncf, argvs); + ERR_BAIL(ncf); + } + } +diff -ur netcf-0.1.7.ori//tests/interface/bridge.xml~ netcf-0.1.7/tests/interface/bridge.xml~ +--- netcf-0.1.7.ori//tests/interface/bridge.xml~ 2009-10-13 19:14:53.000000000 +0200 ++++ netcf-0.1.7/tests/interface/bridge.xml~ 2009-10-14 05:09:05.000000000 +0200 +@@ -2,10 +2,12 @@ + <start mode="onboot"/> + <mtu size="1500"/> + <protocol family="ipv4"> +- <ip address="192.168.80.5" prefix="24"/> ++ <dhcp/> + </protocol> + <bridge stp="off" delay="0.01"> + <interface type="ethernet" name="eth0"> ++ <mac address="ab:bb:cc:dd:ee:ff"/> + </interface> ++ <interface type="ethernet" name="eth1"/> + </bridge> + </interface> +diff -ur netcf-0.1.7.ori//tests/interface/vlan.xml~ netcf-0.1.7/tests/interface/vlan.xml~ +--- netcf-0.1.7.ori//tests/interface/vlan.xml~ 2010-07-30 06:02:39.000000000 +0200 ++++ netcf-0.1.7/tests/interface/vlan.xml~ 2010-09-07 18:26:22.000000000 +0200 +@@ -1,9 +1,9 @@ +-<interface type="vlan" name="eth1.42"> ++<interface type="vlan" name="eth0.42"> + <start mode="onboot"/> + <protocol family="ipv4"> + <dhcp peerdns="no"/> + </protocol> + <vlan tag="42"> +- <interface name="eth1"/> ++ <interface name="eth0"/> + </vlan> + </interface> diff --git a/community/binutils-avr/PKGBUILD b/community/binutils-avr/PKGBUILD deleted file mode 100644 index d052033fd..000000000 --- a/community/binutils-avr/PKGBUILD +++ /dev/null @@ -1,72 +0,0 @@ -# $Id: PKGBUILD 60627 2011-12-15 18:55:59Z jelle $ -# Maintainer: Brad Fanella <bradfanella@archlinux.us> -# Contributor: Corrado Primier <bardo@aur.archlinux.org> -# Contributor: danst0 <danst0@west.de> - -pkgname=binutils-avr -pkgver=2.22 -pkgrel=1 -pkgdesc="A set of programs to assemble and manipulate binary and object files for the avr architecture" -arch=('i686' 'x86_64' 'mips64el') -url="http://www.gnu.org/software/binutils/" -license=('GPL') -depends=('glibc>=2.12-5' 'zlib') -options=('!libtool' '!distcc' '!ccache') -source=(http://ftp.gnu.org/gnu/${pkgname/-avr}/${pkgname/-avr}-${pkgver}.tar.bz2{,.sig}) -md5sums=('ee0f10756c84979622b992a4a61ea3f5' - '6aea2485019497583e5c3f5fc4a39cd5') - -build() { - cd ${srcdir}/${pkgname/-avr}-${pkgver} - - mkdir build - cd build - - CC="gcc -L$(pwd)/bfd/.libs/" - if [ "${CARCH}" = "x86_64" ]; then - ../configure --build=$(../config.guess) \ - --disable-multilib \ - --disable-nls \ - --enable-64-bit-bfd \ - --enable-install-libbfd \ - --includedir=/usr/$(../config.guess)/include \ - --infodir=/usr/share/info \ - --libdir=/usr/lib \ - --mandir=/usr/share/man \ - --prefix=/usr \ - --target=avr - else - ../configure --build=$(../config.guess) \ - --disable-nls \ - --enable-install-libbfd \ - --includedir=/usr/$(../config.guess)/include \ - --infodir=/usr/share/info \ - --libdir=/usr/lib \ - --mandir=/usr/share/man \ - --prefix=/usr \ - --target=avr - fi - - # This checks the host environment and makes sure all the necessary tools are available to compile Binutils. - make configure-host - - make tooldir=/usr -} - -package() { - cd ${srcdir}/${pkgname/-avr}-${pkgver} - - cd build - make DESTDIR=${pkgdir} tooldir=/usr install - - rm -f ${pkgdir}/usr/lib/libiberty.a - - for bin in addr2line ar as c++filt gprof ld nm objcopy objdump ranlib readelf size strings strip ; do - rm -f ${pkgdir}/usr/bin/${bin} || return 1 - done - - for info in as bfd binutils configure gprof ld standards; do - mv ${pkgdir}/usr/share/info/${info}.info ${pkgdir}/usr/share/info/avr-${info}.info - done -} - diff --git a/community/cuda-toolkit/PKGBUILD b/community/cuda-toolkit/PKGBUILD deleted file mode 100644 index e886b8a88..000000000 --- a/community/cuda-toolkit/PKGBUILD +++ /dev/null @@ -1,50 +0,0 @@ -# Maintainer: Sven-Hendrik Haase <sh@lutzhaase.com> -pkgname=cuda-toolkit -pkgver=4.1.28 -pkgrel=2 -_fedver=14 -pkgdesc="NVIDIA's GPU programming toolkit" -arch=('i686' 'x86_64') - -url="http://www.nvidia.com/object/cuda_home.html" -license=('custom') -depends=('gcc-libs' 'opencl-nvidia') -optdepends=('gdb: for cuda-gdb') -if [ "$CARCH" = "i686" ]; then - _arch=32 - md5sums=('835d403e86f4b014b348c587ffb23c0d' - '5af5226b36cd3f9993f762f85b5d236a' - 'c0781c63e726eaf03e10135b42b85729') -else - _arch=64 - md5sums=('c82103da07d0e96f3d65d7b308b74446' - '5af5226b36cd3f9993f762f85b5d236a' - 'c0781c63e726eaf03e10135b42b85729') -fi - -install=cuda-toolkit.install -source=(http://developer.download.nvidia.com/compute/cuda/4_1/rel/toolkit/cudatoolkit_${pkgver}_linux_${_arch}_fedora${_fedver}.run - cuda-toolkit.sh - cuda-toolkit.conf) - -build() { - cd "$srcdir" -} - -package() { - cd "$srcdir" - - mkdir -p $pkgdir/opt/cuda-toolkit - sh cudatoolkit_${pkgver}_linux_${_arch}_fedora${_fedver}.run --keep -- --prefix=$pkgdir/opt/cuda-toolkit - - sed -i "/unsupported GNU/d" $pkgdir/opt/cuda-toolkit/include/host_config.h - sed -i "s|/build/pkg||g" $pkgdir/opt/cuda-toolkit/bin/nvvp - - install -Dm755 cuda-toolkit.sh $pkgdir/etc/profile.d/cuda-toolkit.sh - install -Dm644 cuda-toolkit.conf $pkgdir/etc/ld.so.conf.d/cuda-toolkit.conf - install -Dm644 $pkgdir/opt/cuda-toolkit/doc/EULA.txt $pkgdir/usr/share/licenses/$pkgname/LICENSE - - mkdir -p $pkgdir/usr/lib - cd $pkgdir/usr/lib - ln -s /usr/lib/libncurses.so.5 libtinfo.so.5 -} diff --git a/community/cuda-toolkit/cuda-toolkit.conf b/community/cuda-toolkit/cuda-toolkit.conf deleted file mode 100644 index 0f55b39a7..000000000 --- a/community/cuda-toolkit/cuda-toolkit.conf +++ /dev/null @@ -1,2 +0,0 @@ -/opt/cuda-toolkit/lib64 -/opt/cuda-toolkit/lib diff --git a/community/cuda-toolkit/cuda-toolkit.install b/community/cuda-toolkit/cuda-toolkit.install deleted file mode 100644 index 4e1a1a6b7..000000000 --- a/community/cuda-toolkit/cuda-toolkit.install +++ /dev/null @@ -1,8 +0,0 @@ -post_install() { - echo "You need to relogin in order for the cuda-toolkit binaries to appear in your path." - post_upgrade -} - -post_upgrade() { - ldconfig -r . -} diff --git a/community/cuda-toolkit/cuda-toolkit.sh b/community/cuda-toolkit/cuda-toolkit.sh deleted file mode 100755 index 737eb1d3e..000000000 --- a/community/cuda-toolkit/cuda-toolkit.sh +++ /dev/null @@ -1 +0,0 @@ -export PATH=$PATH:/opt/cuda-toolkit/bin diff --git a/community/extremetuxracer/libpng14.patch b/community/extremetuxracer/libpng14.patch deleted file mode 100644 index 5c9999857..000000000 --- a/community/extremetuxracer/libpng14.patch +++ /dev/null @@ -1,57 +0,0 @@ -diff -Nur extremetuxracer-0.4.orig/src/ppgltk/images/png_reader.cpp extremetuxracer-0.4/src/ppgltk/images/png_reader.cpp ---- extremetuxracer-0.4.orig/src/ppgltk/images/png_reader.cpp 2007-09-01 19:38:12.000000000 +0300 -+++ extremetuxracer-0.4/src/ppgltk/images/png_reader.cpp 2010-01-25 03:47:21.000000000 +0200 -@@ -53,7 +53,7 @@ - if (!info_ptr) - { - png_destroy_read_struct(&png_ptr, -- (png_infopp)NULL, (png_infopp)NULL); -+ NULL, NULL); - fclose(fp); - return; - } -@@ -62,7 +62,7 @@ - if (!end_info) - { - png_destroy_read_struct(&png_ptr, &info_ptr, -- (png_infopp)NULL); -+ NULL); - fclose(fp); - return; - } -@@ -77,7 +77,7 @@ - - - png_get_IHDR(png_ptr, info_ptr, &width, &height, -- &bit_depth, &color_type, &interlace_type,int_p_NULL, int_p_NULL); -+ &bit_depth, &color_type, &interlace_type, NULL, NULL); - - if(bit_depth == 16) - png_set_strip_16(png_ptr); -@@ -88,7 +88,7 @@ - png_set_expand(png_ptr); - png_read_update_info(png_ptr, info_ptr); - png_get_IHDR(png_ptr, info_ptr, &width, &height, -- &bit_depth, &color_type, &interlace_type,int_p_NULL, int_p_NULL); -+ &bit_depth, &color_type, &interlace_type, NULL, NULL); - } - - if( color_type == PNG_COLOR_TYPE_GRAY || -@@ -96,7 +96,7 @@ - png_set_gray_to_rgb(png_ptr); - png_read_update_info(png_ptr, info_ptr); - png_get_IHDR(png_ptr, info_ptr, &width, &height, -- &bit_depth, &color_type, &interlace_type,int_p_NULL, int_p_NULL); -+ &bit_depth, &color_type, &interlace_type, NULL, NULL); - } - - this->width=width; -@@ -114,7 +114,7 @@ - } - - png_read_end(png_ptr, info_ptr); -- png_destroy_read_struct(&png_ptr, &info_ptr, png_infopp_NULL); -+ png_destroy_read_struct(&png_ptr, &info_ptr, NULL); - fclose(fp); - } - diff --git a/community/fltk2/libpng14.patch b/community/fltk2/libpng14.patch deleted file mode 100644 index f6c49228e..000000000 --- a/community/fltk2/libpng14.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -upr fltk-2.0.x-r6829.orig/images/fl_png.cxx fltk-2.0.x-r6829/images/fl_png.cxx ---- fltk-2.0.x-r6829.orig/images/fl_png.cxx 2010-01-23 04:42:12.000000000 +0200 -+++ fltk-2.0.x-r6829/images/fl_png.cxx 2010-01-23 04:58:31.000000000 +0200 -@@ -62,7 +62,7 @@ bool pngImage::test(const uchar* datas, - #if !HAVE_LIBPNG - return 0; - #else -- return png_check_sig((png_byte*)datas, (int)size)!=0; -+ return png_sig_cmp((png_byte*)datas, 0, (int)size)==0; - #endif - } - diff --git a/community/freecol/PKGBUILD b/community/freecol/PKGBUILD deleted file mode 100644 index a3dcccc95..000000000 --- a/community/freecol/PKGBUILD +++ /dev/null @@ -1,36 +0,0 @@ -# $Id: PKGBUILD 56049 2011-09-29 16:29:17Z svenstaro $ -# Maintainer: Sven-Hendrik Haase <sh@lutzhaase.com> -# Contributor: TDY <tdy@gmx.com> -# Contributor: Nelson Menon <nelsonmenon@gmail.com insanatorium.wordpress.com> - -pkgname=freecol -pkgver=0.10.3 -pkgrel=1 -pkgdesc="A turn-based strategy game based on Colonization" -arch=('i686' 'x86_64' 'mips64el') -url="http://www.freecol.org/" -license=('GPL') -depends=('java-runtime') -source=(http://downloads.sourceforge.net/$pkgname/$pkgname-$pkgver.zip - fc.desktop fc.sh) -md5sums=('9aafa286247470831cd322e688ed5103' - '55594d770904af3e3e3852d375085357' - 'ae473cd1d86f8f764250ee00b6fda90b') - -build() { - cd "$srcdir/$pkgname" -} - -package() { - cd "$srcdir/$pkgname" - - install -Dm644 FreeCol.jar "$pkgdir/usr/share/java/$pkgname/FreeCol.jar" - install -Dm644 FreeCol.pdf "$pkgdir/usr/share/doc/$pkgname/FreeCol.pdf" - install -Dm644 $pkgname.xpm "$pkgdir/usr/share/pixmaps/$pkgname.xpm" - install -Dm644 ../fc.desktop "$pkgdir/usr/share/applications/$pkgname.desktop" - install -Dm755 ../fc.sh "$pkgdir/usr/bin/$pkgname" - - cp -r data jars "$pkgdir/usr/share/java/$pkgname/" - find "$pkgdir/usr/share/java/$pkgname" -type d -exec chmod 755 '{}' \; - find "$pkgdir/usr/share/java/$pkgname" -type f -exec chmod 644 '{}' \; -} diff --git a/community/freecol/fc.desktop b/community/freecol/fc.desktop deleted file mode 100644 index 83ed6a97d..000000000 --- a/community/freecol/fc.desktop +++ /dev/null @@ -1,10 +0,0 @@ -[Desktop Entry] -Version=1.0 -Type=Application -Name=FreeCol -GenericName=Strategy Game -Comment=A free Colonization clone -TryExec=/usr/bin/freecol -Exec=freecol -Icon=/usr/share/pixmaps/freecol.xpm -Categories=Game;StrategyGame; diff --git a/community/freecol/fc.sh b/community/freecol/fc.sh deleted file mode 100644 index 0ce3dac3a..000000000 --- a/community/freecol/fc.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -FC_PATH=/usr/share/java/freecol -LOG_PATH=/tmp/freecol - -[ ! -d "$LOG_PATH" ] && install -dm755 $LOG_PATH -cd $LOG_PATH -java -Xmx256M -jar $FC_PATH/FreeCol.jar "$@" --freecol-data $FC_PATH/data \ - &> ./messages.log diff --git a/community/gcc-avr/PKGBUILD b/community/gcc-avr/PKGBUILD deleted file mode 100644 index 045c1f17f..000000000 --- a/community/gcc-avr/PKGBUILD +++ /dev/null @@ -1,59 +0,0 @@ -# $Id: PKGBUILD 57845 2011-11-03 12:26:59Z jelle $ -# Maintainer: Brad Fanella <bradfanella@archlinux.us> -# Contributor: Corrado Primier <bardo@aur.archlinux.org> -# Contributor: danst0 <danst0@west.de> - -pkgname=gcc-avr -pkgver=4.6.2 -pkgrel=1 -pkgdesc="The GNU avr Compiler Collection" -arch=('i686' 'x86_64' 'mips64el') -license=('GPL' 'LGPL' 'custom') -url="http://gcc.gnu.org/" -depends=('binutils-avr>=2.21' 'cloog' 'ppl' 'gcc-libs>=4.6.0' 'libmpc') -options=('!ccache' '!distcc' '!emptydirs' '!libtool' '!strip') -source=(http://ftp.gnu.org/gnu/gcc/${pkgname/-avr}-${pkgver}/gcc-{core,g++}-${pkgver}.tar.bz2) -md5sums=('0c0e7e35d2215e19de9c97efba507553' - '0d75ca7ca35b1e7f252223f9d23a6ad1') - -build() { - export CFLAGS="-O2 -pipe" - export CXXFLAGS="-O2 -pipe" - - cd "${srcdir}/${pkgname/-avr}-${pkgver}" - - mkdir build - cd build - ../configure --disable-libssp \ - --disable-nls \ - --enable-languages=c,c++ \ - --infodir=/usr/share/info \ - --libdir=/usr/lib \ - --libexecdir=/usr/lib \ - --mandir=/usr/share/man \ - --prefix=/usr \ - --target=avr \ - --with-gnu-as \ - --with-gnu-ld \ - --with-as=/usr/bin/avr-as \ - --with-ld=/usr/bin/avr-ld - - make -} - -package() { - cd "${srcdir}/${pkgname/-avr}-${pkgver}" - - cd build - make -j1 DESTDIR=${pkgdir} install - - install -Dm644 "${srcdir}/${pkgname/-avr}-${pkgver}/COPYING.RUNTIME" \ - "${pkgdir}/usr/share/licenses/${pkgname}/RUNTIME.LIBRARY.EXCEPTION" - - rm -f ${pkgdir}/usr/lib/libiberty.a - rm -rf ${pkgdir}/usr/share/man/man7 - rm -rf ${pkgdir}/usr/share/info -} - -md5sums=('780f614ab18c7a9066dec6387d7490b2' - '87ecd60431e41096419dd8a10f76e46b') diff --git a/community/geos/geos.changelog b/community/geos/geos.changelog deleted file mode 100644 index d0a376568..000000000 --- a/community/geos/geos.changelog +++ /dev/null @@ -1,5 +0,0 @@ -2010-11-14 Jaroslav Lichtblau <dragonlord@aur.archlinux.org> - * Update to major release 3.2.2 - -2010-04-04 Jaroslav Lichtblau <dragonlord@aur.archlinux.org> - * Update to major release 3.2.1 diff --git a/community/glpng/libglpng-1.45-debian.patch b/community/glpng/libglpng-1.45-debian.patch deleted file mode 100644 index 062bf6364..000000000 --- a/community/glpng/libglpng-1.45-debian.patch +++ /dev/null @@ -1,29 +0,0 @@ -diff -up libglpng-1.45.orig libglpng-1.45 -diff -up libglpng-1.45.orig/src/glpng.c.orig libglpng-1.45.orig/src/glpng.c ---- libglpng-1.45.orig/src/glpng.c.orig 2000-07-10 21:27:10.000000000 +0200 -+++ libglpng-1.45.orig/src/glpng.c 2009-05-17 23:02:38.000000000 +0200 -@@ -29,7 +29,7 @@ - #include <GL/gl.h>
- #include <stdlib.h> - #include <math.h> --#include "png/png.h" -+#include <png.h> -
- /* Used to decide if GL/gl.h supports the paletted extension */
- #ifdef GL_COLOR_INDEX1_EXT
-@@ -113,6 +113,7 @@ static void Resize(int components, const - } - } -
-+#ifdef _WIN32 - static int ExtSupported(const char *x) { - static const GLubyte *ext = NULL; - const char *c; -@@ -129,6 +130,7 @@ static int ExtSupported(const char *x) { - - return 0; - } -+#endif
-
- #define GET(o) ((int)*(data + (o)))
-
diff --git a/community/glpng/libpng14.patch b/community/glpng/libpng14.patch deleted file mode 100644 index b9fae8c2d..000000000 --- a/community/glpng/libpng14.patch +++ /dev/null @@ -1,21 +0,0 @@ -diff -Naur libglpng-1.45.orig-old/src/glpng.c libglpng-1.45.orig/src/glpng.c ---- libglpng-1.45.orig-old/src/glpng.c 2000-07-11 05:27:10.000000000 +1000 -+++ libglpng-1.45.orig/src/glpng.c 2010-02-13 22:53:53.000000000 +1000 -@@ -269,7 +269,7 @@ - if (pinfo == NULL) return 0; - - fread(header, 1, 8, fp); -- if (!png_check_sig(header, 8)) return 0; -+ if (png_sig_cmp(header, 0, 8)) return 0; - - png = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); - info = png_create_info_struct(png); -@@ -373,7 +373,7 @@ - png_uint_32 i; - - fread(header, 1, 8, fp); -- if (!png_check_sig(header, 8)) return 0; -+ if (png_sig_cmp(header, 0, 8)) return 0; - - png = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); - info = png_create_info_struct(png); diff --git a/community/lightspark/PKGBUILD b/community/lightspark/PKGBUILD deleted file mode 100644 index a49e2aa10..000000000 --- a/community/lightspark/PKGBUILD +++ /dev/null @@ -1,44 +0,0 @@ -# Maintainer: Thomas Dziedzic < gostrc at gmail > -# Contributor: Jan "heftig" Steffens <jan.steffens@gmail.com> - -pkgname=lightspark -pkgver=0.5.4 -pkgrel=1 -pkgdesc='An alternative Flash Player for Linux.' -arch=('i686' 'x86_64' 'mips64el') -url='http://lightspark.sourceforge.net' -license=('LGPL3') -conflicts=('lightspark-git') -depends=('mesa' 'ftgl' 'sdl' 'gtk2' 'curl' 'zlib' 'ffmpeg' 'glew' 'pcre' 'libpulse' 'libffi' 'boost-libs' 'glibmm' 'gtkglext' 'desktop-file-utils' 'libxml++' 'libxml2') -makedepends=('cmake' 'nasm' 'xulrunner' 'llvm' 'glproto' 'boost' 'fontconfig') -optdepends=('gnash-gtk: fallback support') -install="lightspark.install" -source=("http://launchpad.net/lightspark/trunk/lightspark-${pkgver}/+download/lightspark-${pkgver}.tar.gz" - 'llvm29.diff') -md5sums=('1101e1d1cb1b55b84b9214ef02217ec3' - '5f717d1d9ead478184ca68f6ac068099') - -build() { - #cd lightspark-${pkgver} - #patch -Np0 -i ${srcdir}/llvm29.diff - cd ${srcdir} - - rm -rf build - mkdir build - cd build - - cmake \ - -DCMAKE_INSTALL_PREFIX=/usr \ - -DCOMPILE_PLUGIN=1 \ - -DCMAKE_BUILD_TYPE=Release \ - -DGNASH_EXE_PATH=/usr/bin/gtk-gnash \ - ../lightspark-${pkgver} - - make -} - -package() { - cd build - - make DESTDIR=${pkgdir} install -} diff --git a/community/lightspark/lightspark.install b/community/lightspark/lightspark.install deleted file mode 100644 index 75e2b7b55..000000000 --- a/community/lightspark/lightspark.install +++ /dev/null @@ -1,13 +0,0 @@ -post_install() { - update-desktop-database -q - gtk-update-icon-cache -q -t -f usr/share/icons/hicolor -} - -post_upgrade() { - post_install $1 -} - -post_remove() { - update-desktop-database -q - gtk-update-icon-cache -q -t -f usr/share/icons/hicolor -} diff --git a/community/lightspark/llvm29.diff b/community/lightspark/llvm29.diff deleted file mode 100644 index f859852af..000000000 --- a/community/lightspark/llvm29.diff +++ /dev/null @@ -1,12 +0,0 @@ ---- CMakeLists.txt.old 2011-11-01 22:07:52.475608726 +0000 -+++ CMakeLists.txt 2011-11-01 22:08:52.046241925 +0000 -@@ -152,7 +152,8 @@ - MESSAGE(FATAL_ERROR "LLVM >=2.8 is required!") - ENDIF(${LLVM_STRING_VERSION} VERSION_LESS 2.8) - IF(${LLVM_STRING_VERSION} VERSION_EQUAL 2.9) -- MESSAGE(FATAL_ERROR "LLVM !=2.9 is required!") -+ #MESSAGE(FATAL_ERROR "LLVM !=2.9 is required!") -+ ADD_DEFINITIONS(-DLLVM_29) - ENDIF(${LLVM_STRING_VERSION} VERSION_EQUAL 2.9) - IF(${LLVM_STRING_VERSION} VERSION_EQUAL 2.8) - ADD_DEFINITIONS(-DLLVM_28) diff --git a/community/lorcon-old-svn/PKGBUILD b/community/lorcon-old-svn/PKGBUILD deleted file mode 100644 index 0a9fb9e0b..000000000 --- a/community/lorcon-old-svn/PKGBUILD +++ /dev/null @@ -1,27 +0,0 @@ -# $Id: PKGBUILD 60383 2011-12-12 18:03:48Z andrea $ -# Maintainer: -# Contributor: Brad Fanella <bradfanella@archlinux.us> -# Contributor: fnord0 [fnord0 <AT> riseup <DOT> net] - -pkgname=lorcon-old-svn -pkgver=224 -pkgrel=1 -pkgdesc="Loss Of Radio CONnectivity: A generic library for injecting 802.11 frames" -url='http://802.11ninja.net' -license=('GPL') -arch=('i686' 'x86_64' 'mips64el') -depends=('libnl') -options=('!libtool') -source=("ftp://ftp.archlinux.org/other/community/lorcon-old/lorcon-old-${pkgver}.tar.bz2") -md5sums=('7a939cc8ec0d70d1b312b9fe9f0dfaf8') - -build() { - cd "${srcdir}/lorcon-old-${pkgver}" - ./configure --prefix=/usr - make -} - -package() { - cd "${srcdir}/lorcon-old-${pkgver}" - make DESTDIR="${pkgdir}" install -} diff --git a/community/mdf2iso/ChangeLog b/community/mdf2iso/ChangeLog deleted file mode 100644 index c206c3cde..000000000 --- a/community/mdf2iso/ChangeLog +++ /dev/null @@ -1,9 +0,0 @@ -2007-06-29 tardo <tardo@nagi-fanboi.net> -* Rebuilt with LFS patch - -2007-06-29 Georg Grabler (STiAT) <ggrabler@gmail.com> -* Added lfs.patch (long file system support) for images > 4GB - -2007-06-28 tardo <tardo@nagi-fanboi.net> -* Built for x86_64 - diff --git a/community/mdf2iso/PKGBUILD b/community/mdf2iso/PKGBUILD deleted file mode 100644 index 2c8decc4c..000000000 --- a/community/mdf2iso/PKGBUILD +++ /dev/null @@ -1,29 +0,0 @@ -# $Id: PKGBUILD 25104 2010-08-30 23:20:53Z lcarlier $ -# Contributor: Jeff Mickey <j@codemac.net> -# Contributer: Henrik Ronellenfitsch <henrik at searinox dot de> -# Maintainer: Daniel J Griffiths <ghost1227@archlinux.us> - -pkgname=mdf2iso -pkgver=0.3.0 -pkgrel=4 -pkgdesc="Converts Alcohol 120% .mdf files into .iso files" -arch=('i686' 'x86_64' 'mips64el') -url="http://mdf2iso.berlios.de" -license=('GPL') -depends=('glibc') -source=(http://download.berlios.de/mdf2iso/${pkgname}-${pkgver}-src.tar.bz2 lfs.patch) -md5sums=('a190625318476a196930ac66acd8fd07' 'a7510b8bc36d468ace80df3ecf55a3a3') - -build() { - cd ${srcdir}/${pkgname} - - patch -p1 < ../lfs.patch - ./configure --prefix=/usr - make || return 1 -} - -package() { - cd ${srcdir}/${pkgname} - - make DESTDIR=${pkgdir} install -} diff --git a/community/mdf2iso/lfs.patch b/community/mdf2iso/lfs.patch deleted file mode 100644 index 5ff62c0ba..000000000 --- a/community/mdf2iso/lfs.patch +++ /dev/null @@ -1,683 +0,0 @@ -Only in mdf2iso/src: .deps -Only in mdf2iso.new/src: .kdbgrc.mdf2iso -diff -bur mdf2iso/src/Makefile.am mdf2iso.new/src/Makefile.am ---- mdf2iso/src/Makefile.am 2005-05-19 11:24:11.000000000 +0200 -+++ mdf2iso.new/src/Makefile.am 2005-07-31 17:47:36.000000000 +0200 -@@ -1,2 +1,3 @@ - bin_PROGRAMS = mdf2iso - mdf2iso_SOURCES = mdf2iso.c -+AM_CFLAGS = -D_FILE_OFFSET_BITS=64 -Wall -diff -bur mdf2iso/src/Makefile.in mdf2iso.new/src/Makefile.in ---- mdf2iso/src/Makefile.in 2005-05-22 21:42:09.000000000 +0200 -+++ mdf2iso.new/src/Makefile.in 2005-07-31 17:49:16.000000000 +0200 -@@ -136,6 +136,7 @@ - sysconfdir = @sysconfdir@ - target_alias = @target_alias@ - mdf2iso_SOURCES = mdf2iso.c -+AM_CFLAGS = -D_FILE_OFFSET_BITS=64 -Wall - all: all-am - - .SUFFIXES: -@@ -149,9 +150,9 @@ - exit 1;; \ - esac; \ - done; \ -- echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \ -+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \ - cd $(top_srcdir) && \ -- $(AUTOMAKE) --foreign src/Makefile -+ $(AUTOMAKE) --gnu src/Makefile - .PRECIOUS: Makefile - Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ -diff -bur mdf2iso/src/mdf2iso.c mdf2iso.new/src/mdf2iso.c ---- mdf2iso/src/mdf2iso.c 2005-05-22 21:52:08.000000000 +0200 -+++ mdf2iso.new/src/mdf2iso.c 2005-07-31 19:41:56.000000000 +0200 -@@ -1,4 +1,4 @@ -- /* $Id: mdf2iso.c, 22/05/05 -+/* $Id: mdf2iso.c, 22/05/05 - - Copyright (C) 2004,2005 Salvatore Santagati <salvatore.santagati@gmail.com> - -@@ -16,19 +16,14 @@ - along with this program; if not, write to the - Free Software Foundation, Inc., - 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -- */ -+*/ - - #include <stdio.h> - #include <stdlib.h> - #include <string.h> - #include <errno.h> - --#define VERSION "0.3.0" -- --/* Support Large File */ -- --#define _FILE_OFFSET_BITS 64 -- -+#define VERSION "0.3.1" - - - const char SYNC_HEADER[12] = { (char) 0x00, -@@ -83,14 +78,21 @@ - (char) 0x00 - }; - -+#define ISO9660 0 -+#define SYNC 1 -+#define SYNC_MDF 2 -+#define MDF_AUDIO 3 -+#define UNKNOWN -1 - --void --toc_file (char *destfilename, int sub) -+int toc_file (char *destfilename, int sub) - { -- char destfiletoc[1024], destfiledat[1024]; -+ int ret=0; -+ char *destfiletoc; -+ char *destfiledat; - FILE *ftoc; -- strcpy (destfiletoc, destfilename); -- strcpy (destfiledat, destfilename); -+ -+ destfiletoc=strdup(destfilename); -+ destfiledat=strdup(destfilename); - strcpy (destfiletoc + strlen (destfilename) - 4, ".toc"); - strcpy (destfiledat + strlen (destfilename) - 4, ".dat"); - -@@ -100,11 +102,8 @@ - fprintf (ftoc, "// Track 1\n"); - fprintf (ftoc, "TRACK MODE1_RAW"); - -- if (sub == 1) -- fprintf (ftoc, " RW_RAW\n"); -- -- else -- fprintf (ftoc, "\n"); -+ if (sub == 1) fprintf (ftoc, " RW_RAW\n"); -+ else fprintf (ftoc, "\n"); - - fprintf (ftoc, "NO COPY\n"); - fprintf (ftoc, "DATAFILE \"%s\"\n", destfiledat); -@@ -114,26 +113,27 @@ - } - else - { -- printf ("%s\n", strerror (errno)); -- exit (EXIT_FAILURE); -+ printf ("Error opening %s for output: %s\n",destfiletoc,strerror(errno)); -+ ret=-1; - }; -- -+ free(destfiletoc); -+ free(destfiledat); -+ return ret; - } - --int --number_file (char *destfilename) -+/* -+int number_file (char *destfilename) - { - int i = 1, test_mdf = 0; - int n_mdf; - char mdf[2], destfilemdf[2354]; - FILE *fsource; -+ - strcpy (destfilemdf, destfilename); - strcpy (destfilemdf + strlen (destfilename) - 1, ".0"); - for (i = 0; test_mdf == 0; i++) -- - { - if ((fsource = fopen (destfilemdf, "rb")) != NULL) -- - { - printf ("\nCheck : "); - sprintf (mdf, "md%d", i); -@@ -141,203 +141,219 @@ - printf ("%s, ", destfilemdf); - fclose (fsource); - } -- - else - { - test_mdf = 1; - } -- }; -+ } - printf ("\r \n"); - n_mdf = i - 1; - return (n_mdf); - } -+*/ - --void --cuesheets (char *destfilename) -+int cuesheets (char *destfilename) - { -- char destfilecue[1024], destfilebin[1024]; -+ int ret=0; -+ char *destfilecue; -+ char *destfilebin; - FILE *fcue; -- strcpy (destfilecue, destfilename); -- strcpy (destfilebin, destfilename); -+ -+ destfilecue=strdup(destfilename); -+ destfilebin=strdup(destfilename); - strcpy (destfilecue + strlen (destfilename) - 4, ".cue"); - strcpy (destfilebin + strlen (destfilename) - 4, ".bin"); -- fcue = fopen (destfilecue, "w"); -+ if ((fcue = fopen (destfilecue, "w"))!=NULL) -+ { - fprintf (fcue, "FILE \"%s\" BINARY\n", destfilebin); - fprintf (fcue, "TRACK 1 MODE1/2352\n"); - fprintf (fcue, "INDEX 1 00:00:00\n"); - rename (destfilename, destfilebin); - printf ("Create Cuesheets : %s\n", destfilecue); - fclose (fcue); -+ } -+ else -+ { -+ printf ("Error opening %s for output: %s\n",destfilecue,strerror(errno)); -+ ret=-1; -+ } -+ return ret; - } - --void --main_percent (int percent_bar) -+int previous_percent=-1; -+void main_percent (int percent_bar) -+// Prints a progress bar, takes a percentage as argument. - { -- int progress_bar, progress_space; -+ //int progress_bar, progress_space; -+ -+ if (percent_bar==previous_percent) return; // Nothing changed, don't waste CPU cycles. -+ -+ printf("%3d%% [:%.*s>%.*s:]\r",percent_bar,20-(percent_bar/5)," ", -+ percent_bar/5,"===================="); -+ /* - printf ("%d%% [:", percent_bar); -- for (progress_bar = 1; progress_bar <= (int) (percent_bar / 5); -- progress_bar++) -+ for (progress_bar = 1; progress_bar <= (int) (percent_bar / 5); progress_bar++) - printf ("="); - printf (">"); - -- for (progress_space = 0; progress_space < (20 - progress_bar); -- progress_space++) -- printf (" "); -+ for (; progress_bar <= 20; ++progress_bar) printf (" "); - printf (":]\r"); -+ */ - } - --void --usage () -+void usage () -+// Prints the command line syntax - { -- printf ("mdf2iso v%s by Salvatore Santagati\n", VERSION); -- printf ("Web : http//mdf2iso.berlios.de\n"); -- printf ("Email : salvatore.santagati@gmail.com\n"); -- printf ("Irc : irc.freenode.net #ignus\n"); -- printf ("Note : iodellavitanonhocapitouncazzo\n"); -- printf ("License : released under the GNU GPL v2 or later\n\n"); -+ printf (" Web : http//mdf2iso.berlios.de\n"); -+ printf (" Email : salvatore.santagati@gmail.com\n"); -+ printf (" Irc : irc.freenode.net #ignus\n"); -+ printf (" Note : iodellavitanonhocapitouncazzo\n\n"); - printf ("Usage :\n"); -- printf ("mdf2iso [OPTION] [BASENAME.MDF] [DESTINATION]\n\n"); -- printf ("OPTION\n"); -- printf ("\t--toc Generate toc file\n"); -- printf ("\t--cue Generate cue file\n"); -- printf ("\t--help display this notice\n\n"); -+ printf ("mdf2iso [--cue|--toc|--help] <sourcefile> [destfile]\n\n"); -+ printf ("Options:\n"); -+ printf (" --toc Generate toc/dat files\n"); -+ printf (" --cue Generate cue/bin files\n"); -+ printf (" --help Display this notice\n"); -+ printf (" sourcefile\tFilename of the .mdf file to be converted\n"); -+ printf (" destfile\tFilename of the target ISO9660 file.\n"\ -+ "\t\tIf none given, one is derived from sourcefile.\n\n"); - } - --int --main (int argc, char **argv) -+char mdftype(FILE *f) -+/* returns -+ -1 for unknown -+ 0 for ISO9660 -+ 1 for SYNC -+ 2 for SYNC MDF -+ 3 for MDF Audio -+ (see #defines above) -+*/ - { -- int seek_ecc, sector_size, seek_head, sector_data, n_mdf; -+ char buf[12]; -+ -+ fseek(f, 32768, SEEK_SET); -+ fread(buf, sizeof (char), 8, f); -+ if (!memcmp (ISO_9660, buf, 8)) return ISO9660; // File is ISO9660 -+ -+ fseek(f, 0L, SEEK_SET); -+ fread(buf, sizeof (char), 12, f); -+ -+ fseek (f, 2352, SEEK_SET); -+ -+ if (!memcmp (SYNC_HEADER, buf, 12)) // Has SYNC_HEADER -+ { -+ fread (buf, sizeof (char), 12, f); -+ if (!memcmp (SYNC_HEADER_MDF, buf, 12)) return SYNC_MDF; // File is SYNC MDF -+ if (!memcmp (SYNC_HEADER, buf, 12)) return SYNC; // File is SYNC -+ } -+ else // Does not have SYNC_HEADER -+ { -+ fread(buf, sizeof (char), 12, f); -+ if (!memcmp (SYNC_HEADER_MDF_AUDIO, buf, 12)) return MDF_AUDIO; // File is MDF Audio -+ } -+ -+ // Reached a point where nothing else matters. -+ return UNKNOWN; // Unknown format -+} -+ -+ -+// === Main program code === -+ -+int main (int argc, char **argv) -+{ -+ int seek_ecc, sector_size, seek_head, sector_data;//, n_mdf; - int cue = 0, cue_mode = 0, sub = 1, toc = 0, sub_toc = 0; - int opts = 0; -- double size_iso, write_iso; -- long percent = 0; -- long i, source_length, progressbar; -- char buf[2448], destfilename[2354]; -+ long i, source_length; -+ char buf[2448]; -+ char *destfilename=NULL; -+ char *basefilename=NULL; - FILE *fdest, *fsource; - -+ // Print identification -+ printf ("mdf2iso v%s by Salvatore Santagati\n", VERSION); -+ printf ("Licensed under GPL v2 or later\n"); - -- if (argc < 2) - -+ // *** Process command line options *** -+ -+ if (argc < 2) - { -- usage (); -- exit (EXIT_FAILURE); -+ // Not enough parameters; print help -+ usage(); -+ exit(EXIT_FAILURE); - } - -- else -- -- { -+ // Search for options --cue and --toc - for (i = 0; i < argc; i++) -- - { -- - if (!strcmp (argv[i], "--help")) -- - { - usage (); - exit (EXIT_SUCCESS); - } - if (!strcmp (argv[i], "--cue")) -- - { - cue = 1; - opts++; - } - if (!strcmp (argv[i], "--toc")) -- - { - toc = 1; - opts++; - } - } - -- if ((cue == 1) && (toc == 1)) -- -- { -- usage (); -- exit (EXIT_FAILURE); -- } -- if ((opts == 1) && (argc <= 2)) -- -+ // Catch impossible parameter combinations -+ if (((cue == 1) && (toc == 1)) || -+ ((opts == 1) && (argc <= 2))) - { -- usage (); -- exit (EXIT_FAILURE); -+ usage(); -+ exit(EXIT_FAILURE); - } - -+ // Get the base filename -+ basefilename=argv[1+opts]; // simple pointer, but makes life easier. - -+ // Get the destination filename - if (argc >= (3 + opts)) -- strcpy (destfilename, argv[2 + opts]); -- -- else -- -- { -- strcpy (destfilename, argv[1 + opts]); -- if (strlen (argv[1 + cue]) < 5 -- || strcmp (destfilename + strlen (argv[1 + opts]) - 4, ".mdf")) -- strcpy (destfilename + strlen (argv[1 + opts]), ".iso"); -- -+ // The destination filename is explicitly entered at the prompt -+ destfilename=strdup(argv[2 + opts]); - else -- strcpy (destfilename + strlen (argv[1 + opts]) - 4, ".iso"); -- } -- if ((fsource = fopen (argv[1 + opts], "rb")) != NULL) -- - { -- fseek (fsource, 32768, SEEK_CUR); -- fread (buf, sizeof (char), 8, fsource); -- if (memcmp (ISO_9660, buf, 8)) -- -+ // Derive destination filename from the basename: -+ // If basename is "*.mdf" use "*.iso" als destname -+ // otherwise simply append ".iso" to the basename to create destname. -+ destfilename=strdup(basefilename); -+ i=strlen(destfilename); // Reusing 'i' here as temporary variable -+ if (i < 5 || strcmp(destfilename + i - 4, ".mdf")) - { -- fseek (fsource, 0L, SEEK_SET); -- fread (buf, sizeof (char), 12, fsource); -- if (!memcmp (SYNC_HEADER, buf, 12)) -- -- { -- fseek (fsource, 0L, SEEK_SET); -- fseek (fsource, 2352, SEEK_CUR); -- fread (buf, sizeof (char), 12, fsource); -- if (!memcmp (SYNC_HEADER_MDF, buf, 12)) -- -- { -- if (cue == 1) -- { -- cue_mode = 1; -- -- /* BAD SECTOR TO NORMAL IMAGE */ -- seek_ecc = 96; -- sector_size = 2448; -- sector_data = 2352; -- seek_head = 0; -- } -- -- else if (toc == 0) -- -- { -- -- /*BAD SECTOR */ -- seek_ecc = 384; -- sector_size = 2448; -- sector_data = 2048; -- seek_head = 16; -+ destfilename=realloc(destfilename,i+5); -+ strcat(destfilename, ".iso"); - } -- - else -- -- { -- -- /*BAD SECTOR */ -- seek_ecc = 0; -- sector_size = 2448; -- sector_data = 2448; -- seek_head = 0; -- sub_toc = 1; -- } -+ strcpy(destfilename + i - 3, "iso"); - } - -- else -+ // *** Preprocess basefile *** - -+ // Try opening basefile -+ if ((fsource = fopen(basefilename, "rb")) == NULL) - { -- if (!memcmp (SYNC_HEADER, buf, 12)) -+ free(destfilename); -+ printf ("Could not open %s: %s\n", basefilename, strerror(errno)); -+ exit (EXIT_FAILURE); -+ } - -+ // Determine filetype & set some stuff accordingly (or exit) -+ switch (mdftype(fsource)) - { -+ case ISO9660: -+ printf("%s is already ISO9660.\n",basefilename); -+ fclose(fsource); -+ free(destfilename); -+ exit(EXIT_SUCCESS); -+ case SYNC: - if (cue == 1) - { - cue_mode = 1; -@@ -348,129 +364,134 @@ - seek_head = 0; - } - if (toc == 0) -- - { -- - /*NORMAL IMAGE */ - seek_ecc = 288; - sector_size = 2352; - sector_data = 2048; - seek_head = 16; - } -- - else -- - { - seek_ecc = 0; - sector_size = 2352; - sector_data = 2352; - seek_head = 0; - } -- } -- -- else -- -- { -- printf ("Sorry I don't know this format :(\n"); -- exit (EXIT_FAILURE); -- } -- } -- } -- -- else -- -+ break; -+ case SYNC_MDF: -+ if (cue == 1) - { -- fseek (fsource, 0L, SEEK_SET); -- fseek (fsource, 2352, SEEK_CUR); -- fread (buf, sizeof (char), 12, fsource); -- if (memcmp (SYNC_HEADER_MDF_AUDIO, buf, 12)) -+ cue_mode = 1; - -+ /* BAD SECTOR TO NORMAL IMAGE */ -+ seek_ecc = 96; -+ sector_size = 2448; -+ sector_data = 2352; -+ seek_head = 0; -+ } -+ else if (toc == 0) - { -- printf ("Sorry I don't know this format :(\n"); -- exit (EXIT_FAILURE); -+ /*BAD SECTOR */ -+ seek_ecc = 384; -+ sector_size = 2448; -+ sector_data = 2048; -+ seek_head = 16; - } -- - else -- - { -- -+ /*BAD SECTOR */ -+ seek_ecc = 0; -+ sector_size = 2448; -+ sector_data = 2448; -+ seek_head = 0; -+ sub_toc = 1; -+ } -+ break; -+ case MDF_AUDIO: - /*BAD SECTOR AUDIO */ - seek_head = 0; - sector_size = 2448; - seek_ecc = 96; - sector_data = 2352; - cue = 0; -+ break; -+ default:printf("Unknown format for %s.\n",basefilename); -+ fclose(fsource); -+ free(destfilename); -+ exit (EXIT_FAILURE); - } -- } -- if ((fdest = fopen (destfilename, "wb")) != NULL); - -- else -+ // *** Create destination file *** -+ -+ // Try opening the destination file for output -+ if ((fdest = fopen (destfilename, "wb")) == NULL) - { -- printf ("%s\n", strerror (errno)); -+ printf ("Unable to open %s for output: %s\n",destfilename,strerror(errno)); -+ free(destfilename); -+ fclose(fsource); - exit (EXIT_FAILURE); -- }; -+ } -+ -+ - fseek (fsource, 0L, SEEK_END); - source_length = ftell (fsource) / sector_size; -- size_iso = (int) (source_length * sector_data); -- progressbar = 100 / source_length; - fseek (fsource, 0L, SEEK_SET); -- - { - for (i = 0; i < source_length; i++) -- - { - fseek (fsource, seek_head, SEEK_CUR); -- if (fread (buf, sizeof (char), sector_data, fsource)); -- -- else -+ if (fread(buf, sizeof (char), sector_data, fsource)!=sector_data) - { -- printf ("%s\n", strerror (errno)); -+ printf ("Error reading from %s: %s\n",basefilename, strerror (errno)); -+ fclose(fsource); -+ fclose(fdest); -+ remove(destfilename); -+ free(destfilename); - exit (EXIT_FAILURE); -- }; -- if (fwrite (buf, sizeof (char), sector_data, fdest)); -- -- else -+ } -+ if (fwrite (buf, sizeof (char), sector_data, fdest)!=sector_data) - { -- printf ("%s\n", strerror (errno)); -+ printf ("Error writing to %s: %s\n",destfilename, strerror (errno)); -+ fclose(fsource); -+ fclose(fdest); -+ remove(destfilename); -+ free(destfilename); - exit (EXIT_FAILURE); -- }; -+ } - fseek (fsource, seek_ecc, SEEK_CUR); -- write_iso = (int) (sector_data * i); -- if (i != 0) -- percent = (int) (write_iso * 100 / size_iso); -- main_percent (percent); -- }} printf ("100%%[:====================:]\n"); -+ main_percent(i*100/source_length); -+ } -+ } printf ("100%% [:=====================:]\n"); - - fclose (fsource); - fclose (fdest); - -- if (cue == 1) -- cuesheets (destfilename); -- if (toc == 1) -- toc_file (destfilename, sub_toc); -+ // *** create Toc or Cue file is requested *** -+ if (cue == 1) if (cuesheets(destfilename)) -+ { -+ free(destfilename); -+ exit(EXIT_FAILURE); -+ } -+ if (toc == 1) if (toc_file(destfilename, sub_toc)) -+ { -+ free(destfilename); -+ exit(EXIT_FAILURE); -+ } - if ((toc == 0) && (cue == 0)) -- printf ("Create iso9660: %s\n", destfilename); -+ printf("Created iso9660: %s\n", destfilename); -+ -+ free(destfilename); - - exit (EXIT_SUCCESS); -- } - -- else -- printf ("This is file iso9660 ;)\n"); -+/* - n_mdf = number_file (destfilename) - 1; -- /* if (n_mdf > 1) -- -+ / * if (n_mdf > 1) - { - printf ("\rDetect %d md* file and now emerge this\n", n_mdf); - } -- */ -+ * / - fclose (fsource); -- exit (EXIT_SUCCESS); -- } -- -- else -- { -- printf ("%s\n", strerror (errno)); -- exit (EXIT_FAILURE); -- }; -- } -+ exit (EXIT_SUCCESS);*/ - } diff --git a/community/megaglest/megaglest.sh b/community/megaglest/megaglest.sh deleted file mode 100644 index 571a01be7..000000000 --- a/community/megaglest/megaglest.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/sh - # Wrapper script for Megaglest. - - MAINDIR=/usr/share/megaglest - BASEDIR="$HOME/.config" - DIR="$BASEDIR/megaglest" - if [ ! -d "$DIR" ]; then - mkdir -p $DIR - fi - cd $DIR - [ -f glest.ini ] || cp /usr/share/megaglest/glest.ini . - [ -h megaglest ] || ln -s /usr/share/megaglest/megaglest . - [ -f servers.ini ] || cp $MAINDIR/servers.ini . - [ -f glestkeys.ini ] || cp $MAINDIR/glestkeys.ini . - for i in data scenarios techs tilesets tutorials; do - [ -h $i ] || ln -s $MAINDIR/$i . - done - [ -d maps ] || mkdir maps - [ -d screens ] || mkdir screens - cd maps - for i in $MAINDIR/maps/*; do - [ -h `basename $i` ] || ln -s $i . - done - cd .. - - exec ./megaglest
\ No newline at end of file diff --git a/community/mtpaint/libpng14.patch b/community/mtpaint/libpng14.patch deleted file mode 100644 index 7df3b2127..000000000 --- a/community/mtpaint/libpng14.patch +++ /dev/null @@ -1,21 +0,0 @@ -diff -upr mtpaint-3.31.orig/src/png.c mtpaint-3.31/src/png.c ---- mtpaint-3.31.orig/src/png.c 2010-01-25 00:43:07.000000000 +0200 -+++ mtpaint-3.31/src/png.c 2010-01-25 00:43:39.000000000 +0200 -@@ -539,7 +539,7 @@ static int load_png(char *file_name, ls_ - if (settings->bpp == 3) - { - png_set_strip_16(png_ptr); -- png_set_gray_1_2_4_to_8(png_ptr); -+ png_set_expand_gray_1_2_4_to_8(png_ptr); - png_set_palette_to_rgb(png_ptr); - png_set_gray_to_rgb(png_ptr); - -@@ -644,7 +644,7 @@ static int load_png(char *file_name, ls_ - png_set_strip_alpha(png_ptr); - png_set_packing(png_ptr); - if ((color_type == PNG_COLOR_TYPE_GRAY) && (bit_depth < 8)) -- png_set_gray_1_2_4_to_8(png_ptr); -+ png_set_expand_gray_1_2_4_to_8(png_ptr); - for (i = 0; i < height; i++) - { - row_pointers[i] = settings->img[CHN_IMAGE] + i * width; diff --git a/community/ngspice/PKGBUILD b/community/ngspice/PKGBUILD index 54acc8f53..4e6fe8694 100644 --- a/community/ngspice/PKGBUILD +++ b/community/ngspice/PKGBUILD @@ -1,10 +1,10 @@ -# $Id: PKGBUILD 49542 2011-06-18 04:13:44Z kkeen $ +# $Id: PKGBUILD 64464 2012-02-14 05:45:33Z kkeen $ # Maintainer: Kyle Keen <keenerd@gmail.com> # Contributor: Abhishek Dasgupta <abhidg@gmail.com> # Contributor: Jason Taylor <jftaylor21@gmail.com> pkgname=ngspice -pkgver=23 +pkgver=24 pkgrel=1 pkgdesc='Mixed-level/Mixed-signal circuit simulator based on Spice3f5, Ciber1b1, and Xspice.' url='http://ngspice.sourceforge.net' @@ -12,7 +12,7 @@ license=('BSD') arch=('i686' 'x86_64' 'mips64el') depends=('libxaw' 'libedit') source=("http://downloads.sourceforge.net/$pkgname/$pkgver/ngspice-$pkgver.tar.gz") -sha1sums=('65fa23d1168cb3af7651b990344f763c77bf6132') +sha1sums=('a6bb0e65c1c07d48f1d3e4df44fc17f6262952eb') build() { cd "${srcdir}/${pkgname}-${pkgver}" diff --git a/community/pylorcon/PKGBUILD b/community/pylorcon/PKGBUILD deleted file mode 100644 index 55866fb71..000000000 --- a/community/pylorcon/PKGBUILD +++ /dev/null @@ -1,18 +0,0 @@ -# Maintainer: Brad Fanella <bradfanella@archlinux.us> -# Contributer: fnord0 <fnord0 AT riseup DOT net> - -pkgname=pylorcon -pkgver=3 -pkgrel=4 -pkgdesc="Python wrapper for the C LORCON (Loss Of Radio CONnectivity) library" -arch=('i686' 'x86_64' 'mips64el') -url="http://code.google.com/p/pylorcon/" -license=('GPLv2') -depends=('python2' 'lorcon-old-svn') -source="http://pylorcon.googlecode.com/files/${pkgname}-${pkgver}.tar.bz2" -md5sums=('214d97bdf84e47131f8b55445fea1def') - -package() { - cd ${srcdir}/${pkgname} - python2 setup.py install --root=${pkgdir} --optimize=1 -} diff --git a/community/python-bsddb/db_5.3.patch b/community/python-bsddb/db_5.3.patch deleted file mode 100644 index 6ea4d18bb..000000000 --- a/community/python-bsddb/db_5.3.patch +++ /dev/null @@ -1,20 +0,0 @@ -# HG changeset patch -# User Jesus Cea <jcea@jcea.es> -# Date 1324876054 -3600 -# Node ID b9ff8f6918a383ed4985e4a09ca36ed1776dba12 -# Parent 670b1ec4472908a9dc745a338a9f595f92aba667 -Support Berkeley DB 5.3.x - -diff -r 670b1ec44729 -r b9ff8f6918a3 setup2.py ---- a/setup2.py Mon Dec 26 06:04:34 2011 +0100 -+++ b/setup2.py Mon Dec 26 06:07:34 2011 +0100 -@@ -128,7 +128,7 @@ - incdir = libdir = None - if not BERKELEYDB_DIR and not BERKELEYDB_LIBDIR and not BERKELEYDB_INCDIR: - # Supported Berkeley DB versions, in order of preference. -- db_ver_list = ((5, 2), (5, 1), (5, 0), -+ db_ver_list = ((5, 3), (5, 2), (5, 1), (5, 0), - (4, 8), (4, 7), (4, 6), (4, 5), (4, 4), (4, 3), (4, 2)) - - # construct a list of paths to look for the header file in on - diff --git a/community/python2-pycuda/PKGBUILD b/community/python2-pycuda/PKGBUILD deleted file mode 100644 index 37049dea1..000000000 --- a/community/python2-pycuda/PKGBUILD +++ /dev/null @@ -1,35 +0,0 @@ -# $Id: PKGBUILD 62828 2012-01-27 14:09:50Z stephane $ -# Maintainer: Stéphane Gaudreault <stephane@archlinux.org> -pkgname=python2-pycuda -pkgver=2011.2.2 -pkgrel=1 -pkgdesc="Python wrapper for Nvidia CUDA" -arch=('i686' 'x86_64') -url="http://mathema.tician.de/software/pycuda" -license=('MIT/X Consortium') -source=(http://pypi.python.org/packages/source/p/pycuda/pycuda-${pkgver}.tar.gz) -depends=('cuda-toolkit' 'python2-numpy' 'python2-pytools' 'python2') -optdepends=('python2-pytest') -makedepends=('ctags' 'python2-distribute' 'mesa') -provides=('pycuda') -replaces=('pycuda') -conflicts=('pycuda') -sha1sums=('026ca33f66d35c82a087a5ef3f8e0f213575059b') - -build() { - cd "${srcdir}/pycuda-${pkgver}" - python2 ./configure.py \ - --cuda-root=/opt/cuda-toolkit \ - --boost-compiler=gcc \ - --cuda-enable-gl \ - --cuda-inc-dir=/opt/cuda-toolkit/include \ - --cudadrv-lib-dir=/opt/cuda-toolkit/lib \ - --cudart-lib-dir=/opt/cuda-toolkit/lib - - make -} - -package() { - cd "${srcdir}/pycuda-${pkgver}" - python2 setup.py install --prefix=/usr --root="${pkgdir}" --skip-build --optimize=1 -} diff --git a/community/qbittorrent/PKGBUILD b/community/qbittorrent/PKGBUILD deleted file mode 100644 index 73858f5e8..000000000 --- a/community/qbittorrent/PKGBUILD +++ /dev/null @@ -1,35 +0,0 @@ -# Maintainer: Thomas Dziedzic < gostrc at gmail > -# Contributor: Daniel J Griffiths <ghost1227@archlinux.us> -# Contributor: Geoffroy Carrier <geoffroy.carrier@koon.fr> - -pkgname=qbittorrent -pkgver=2.9.3 -pkgrel=1 -pkgdesc="A bittorrent client written in C++ / Qt4 using the good libtorrent library" -arch=('i686' 'x86_64' 'mips64el') -url="http://www.qbittorrent.org/" -license=('GPL') -depends=('qt' 'libtorrent-rasterbar' 'xdg-utils') -makedepends=('boost' 'geoip') -optdepends=('python: needed for search' - 'geoip: improves peer country resolution') -install='qbittorrent.install' -source=("http://downloads.sourceforge.net/sourceforge/qbittorrent/qbittorrent-${pkgver}.tar.gz") -md5sums=('bd35950260f633215db8acd7c22317dc') - -build() { - tar xf qbittorrent-${pkgver}.tar.gz - - cd qbittorrent-${pkgver} - - ./configure \ - --prefix=/usr - - make -} - -package() { - cd qbittorrent-${pkgver} - - make INSTALL_ROOT=${pkgdir} install -} diff --git a/community/qbittorrent/qbittorrent.install b/community/qbittorrent/qbittorrent.install deleted file mode 100644 index e70c054ec..000000000 --- a/community/qbittorrent/qbittorrent.install +++ /dev/null @@ -1,11 +0,0 @@ -post_install() { - xdg-icon-resource forceupdate --theme hicolor &> /dev/null -} - -post_upgrade() { - post_install -} - -post_remove() { - post_install -} diff --git a/community/remmina-plugins/PKGBUILD b/community/remmina-plugins/PKGBUILD deleted file mode 100644 index df1f52521..000000000 --- a/community/remmina-plugins/PKGBUILD +++ /dev/null @@ -1,29 +0,0 @@ -# $Id: PKGBUILD 63730 2012-02-05 12:09:50Z ibiru $ -# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com> -# Contributor: Stijn Segers <francesco dot borromini at gmail dot com> - -pkgname=remmina-plugins -pkgver=0.9.2 -pkgrel=3 -pkgdesc="Remina plugins" -#"Remmina supports multiple network protocols in an integrated and consistant user interface. -# Currently RDP, VNC, XDMCP and SSH are supported." -arch=(i686 x86_64 'mips64el') -url="http://sourceforge.net/projects/remmina/" -license=('GPL') -conflicts=(remmina-plugins-svn) -depends=("remmina>=0.9.0" freerdp libxkbfile telepathy-glib) -makedepends=(intltool pkgconfig gettext perl avahi) -install=remmina-plugins.install -options=('!libtool') -source=(http://downloads.sourceforge.net/project/remmina/0.9/$pkgname-$pkgver.tar.gz) -md5sums=('6f6b7cb18f7604f3f17eeda5173ede6a') - -build() { - cd $srcdir/${pkgname}-${pkgver} - ./configure --prefix=/usr --enable-ssh --enable-rdp \ - --enable-vnc --enable-xdmcp --enable-nx \ - --enable-telepathy - make - make DESTDIR=${pkgdir} install -} diff --git a/community/remmina-plugins/remmina-plugins.install b/community/remmina-plugins/remmina-plugins.install deleted file mode 100644 index 1a05f573e..000000000 --- a/community/remmina-plugins/remmina-plugins.install +++ /dev/null @@ -1,11 +0,0 @@ -post_install() { - gtk-update-icon-cache -q -t -f usr/share/icons/hicolor -} - -post_upgrade() { - post_install -} - -post_remove() { - post_install -} diff --git a/community/systemd/PKGBUILD b/community/systemd/PKGBUILD deleted file mode 100644 index 7ae0e15f8..000000000 --- a/community/systemd/PKGBUILD +++ /dev/null @@ -1,86 +0,0 @@ -# $Id: PKGBUILD 61447 2011-12-31 17:01:55Z dreisner $ -# Maintainer: Dave Reisner <dreisner@archlinux.org> - -pkgname=systemd -pkgver=37 -pkgrel=3 -pkgdesc="Session and Startup manager" -arch=('i686' 'x86_64' 'mips64el') -url="http://www.freedesktop.org/wiki/Software/systemd" -license=('GPL2') -depends=('dbus-core' 'kbd' 'libcap' 'util-linux>=2.19' 'udev>=172') -makedepends=('gperf' 'cryptsetup' 'gtk2' 'intltool' 'libnotify' 'linux-api-headers') -optdepends=('cryptsetup: required for encrypted block devices' - 'dbus-python: systemd-analyze' - 'gtk2: systemadm' - 'initscripts: legacy support for hostname and vconsole setup' - 'initscripts-systemd: native boot and initialization scripts' - 'libnotify: systemadm' - 'python2-cairo: systemd-analyze' - 'systemd-arch-units: collection of native unit files for Arch daemon/init scripts') -groups=('systemd') -options=('!libtool' '!strip') -backup=(etc/dbus-1/system.d/org.freedesktop.systemd1.conf - etc/dbus-1/system.d/org.freedesktop.hostname1.conf - etc/dbus-1/system.d/org.freedesktop.login1.conf - etc/dbus-1/system.d/org.freedesktop.locale1.conf - etc/dbus-1/system.d/org.freedesktop.timedate1.conf - etc/systemd/system.conf - etc/systemd/user.conf - etc/systemd/systemd-logind.conf) -install=systemd.install -source=("http://www.freedesktop.org/software/$pkgname/$pkgname-$pkgver.tar.bz2" - "os-release" - systemctl-completion.patch) -md5sums=('1435f23be79c8c38d1121c6b150510f3' - '752636def0db3c03f121f8b4f44a63cd' - '8acca6b7be4bfebe4174d89e4625b0ee') - -build() { - cd "$srcdir/$pkgname-$pkgver" - - # Don't unset locale in getty - # https://bugzilla.redhat.com/show_bug.cgi?id=663900 - sed -i -e '/^Environ.*LANG/s/^/#/' \ - -e '/^ExecStart/s/agetty/& -8/' units/getty@.service.m4 - - # fix bash completion - patch -Np1 < "$srcdir"/systemctl-completion.patch - - ./configure --prefix=/usr \ - --sysconfdir=/etc \ - --libexecdir=/usr/lib/systemd \ - --libdir=/usr/lib \ - --localstatedir=/var \ - --with-rootdir= \ - --with-rootlibdir=/lib - - make - - # fix .so links in manpages - sed -i 's|\.so halt\.8|.so man8/systemd.halt.8|' man/{halt,poweroff}.8 - sed -i 's|\.so systemd\.1|.so man1/systemd.1|' man/init.1 -} - -package() { - cd "$srcdir/$pkgname-$pkgver" - - make DESTDIR="$pkgdir" install - - install -Dm644 "$srcdir/os-release" "$pkgdir/etc/os-release" - printf "d /run/console 755 root root\n" > "$pkgdir/usr/lib/tmpfiles.d/console.conf" - - # fix systemd-analyze for python2 - sed -i '1s/python$/python2/' "$pkgdir/usr/bin/systemd-analyze" - - # rename man pages to avoid conflicts with sysvinit and initscripts - cd "$pkgdir/usr/share/man" - - manpages=(man8/{telinit,halt,reboot,poweroff,runlevel,shutdown}.8 - man5/{hostname,{vconsole,locale}.conf}.5) - - for manpage in "${manpages[@]}"; do - IFS='/' read section page <<< "$manpage" - mv "$manpage" "$section/systemd.$page" - done -} diff --git a/community/systemd/os-release b/community/systemd/os-release deleted file mode 100644 index 5e24a6031..000000000 --- a/community/systemd/os-release +++ /dev/null @@ -1,5 +0,0 @@ -NAME="Arch Linux" -ID=arch -PRETTY_NAME="Arch Linux" -ANSI_COLOR="1;36" - diff --git a/community/systemd/systemctl-completion.patch b/community/systemd/systemctl-completion.patch deleted file mode 100644 index afa1ae73f..000000000 --- a/community/systemd/systemctl-completion.patch +++ /dev/null @@ -1,77 +0,0 @@ -From 255e63837bc985ce6f3c3b5ce5d2856e2240138b Mon Sep 17 00:00:00 2001 -From: Dave Reisner <dreisner@archlinux.org> -Date: Tue, 11 Oct 2011 20:53:05 -0400 -Subject: [PATCH] systemctl-completion: always invoke with --no-legend - -In the case of completion for the 'restart' verb, passing the invalid -unit name (the colums header) causes completion to cease functioning -entirely, with the error: - - Failed to issue method call: Unit name UNIT is not valid. - -This adds a small wrapper function for systemctl which can have common -options added to it. - ---- - src/systemctl-bash-completion.sh | 20 ++++++++++++-------- - 1 files changed, 12 insertions(+), 8 deletions(-) - -diff --git a/src/systemctl-bash-completion.sh b/src/systemctl-bash-completion.sh -index 6369a6c..6ebb792 100644 ---- a/src/systemctl-bash-completion.sh -+++ b/src/systemctl-bash-completion.sh -@@ -15,6 +15,10 @@ - # You should have received a copy of the GNU General Public License - # along with systemd; If not, see <http://www.gnu.org/licenses/>. - -+__systemctl() { -+ systemctl --no-legend "$@" -+} -+ - __contains_word () { - local word=$1; shift - for w in $*; do [[ $w = $word ]] && return 0; done -@@ -24,7 +28,7 @@ __contains_word () { - __filter_units_by_property () { - local property=$1 value=$2 ; shift ; shift - local -a units=( $* ) -- local -a props=( $(systemctl show --property "$property" -- ${units[*]} | grep -v ^$) ) -+ local -a props=( $(__systemctl show --property "$property" -- ${units[*]} | grep -v ^$) ) - for ((i=0; $i < ${#units[*]}; i++)); do - if [[ "${props[i]}" = "$property=$value" ]]; then - echo "${units[i]}" -@@ -32,10 +36,10 @@ __filter_units_by_property () { - done - } - --__get_all_units () { systemctl list-units --full --all | awk ' {print $1}' ; } --__get_active_units () { systemctl list-units --full | awk ' {print $1}' ; } --__get_inactive_units () { systemctl list-units --full --all | awk '$3 == "inactive" {print $1}' ; } --__get_failed_units () { systemctl list-units --full | awk '$3 == "failed" {print $1}' ; } -+__get_all_units () { __systemctl list-units --full --all | awk ' {print $1}' ; } -+__get_active_units () { __systemctl list-units --full | awk ' {print $1}' ; } -+__get_inactive_units () { __systemctl list-units --full --all | awk '$3 == "inactive" {print $1}' ; } -+__get_failed_units () { __systemctl list-units --full | awk '$3 == "failed" {print $1}' ; } - - _systemctl () { - local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]} -@@ -134,13 +138,13 @@ _systemctl () { - comps='' - - elif __contains_word "$verb" ${VERBS[JOBS]}; then -- comps=$( systemctl list-jobs | awk '{print $1}' ) -+ comps=$( __systemctl list-jobs | awk '{print $1}' ) - - elif __contains_word "$verb" ${VERBS[SNAPSHOTS]}; then -- comps=$( systemctl list-units --type snapshot --full --all | awk '{print $1}' ) -+ comps=$( __systemctl list-units --type snapshot --full --all | awk '{print $1}' ) - - elif __contains_word "$verb" ${VERBS[ENVS]}; then -- comps=$( systemctl show-environment | sed 's_\([^=]\+=\).*_\1_' ) -+ comps=$( __systemctl show-environment | sed 's_\([^=]\+=\).*_\1_' ) - compopt -o nospace - fi - --- -1.7.7 - diff --git a/community/systemd/systemd.install b/community/systemd/systemd.install deleted file mode 100644 index 04b29688a..000000000 --- a/community/systemd/systemd.install +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/sh - -checkgroups() { - if ! usr/bin/getent group lock >/dev/null; then - usr/sbin/groupadd -g 54 lock - fi -} - -sd_booted() { - [ -e sys/fs/cgroups/systemd ] -} - -post_install() { - checkgroups - - if [ ! -f etc/machine-id ]; then - bin/systemd-machine-id-setup - fi - - echo "systemd has been installed to /bin/systemd. Please ensure you append" - echo "init=/bin/systemd to your kernel command line in your bootloader." -} - -post_upgrade() { - checkgroups - - if [ ! -f etc/machine-id ]; then - bin/systemd-machine-id-setup - fi - - if sd_booted; then - bin/systemctl daemon-reexec >/dev/null - fi - - newpkgver=${1%-*} - oldpkgver=${2%-*} - - # catch v31 need for restarting systemd-logind.service - if [ "$newpkgver" -ge 31 ] && [ "$oldpkgver" -lt 31 ]; then - # but only if systemd is running - if sd_booted; then - bin/systemctl try-restart systemd-logind.service - fi - fi -} - -post_remove() { - if usr/bin/getent group lock >/dev/null; then - usr/sbin/groupdel lock - fi -} - -# vim:set ts=2 sw=2 et: diff --git a/community/texmaker/PKGBUILD b/community/texmaker/PKGBUILD deleted file mode 100644 index ce71432bb..000000000 --- a/community/texmaker/PKGBUILD +++ /dev/null @@ -1,35 +0,0 @@ -# Maintainer: Thomas Dziedzic < gostrc at gmail > -# Contributor: Daniel J Griffiths <ghost1227@archlinux.us> -# Contributor: furester <xfurester@hotmail.com> -# Contributor: Firmicus <firmicus gmx net> -# Contributor: Paulo Matias <matiasΘarchlinux-br·org> - -pkgname=texmaker -pkgver=3.2.2 -pkgrel=1 -pkgdesc='Free cross-platform latex editor' -arch=('i686' 'x86_64' 'mips64el') -url="http://www.xm1math.net/texmaker/index.html" -license=('GPL') -install='texmaker.install' -depends=('poppler-qt' 'ghostscript' 'qtwebkit') -source=("http://www.xm1math.net/texmaker/texmaker-${pkgver}.tar.bz2") -md5sums=('aa04c37a0117a6f924c0f7eed5732fe2') - -build() { - cd texmaker-${pkgver} - - export INSTALL_ROOT=${pkgdir} - - qmake -unix PREFIX=//usr texmaker.pro - - make -} - -package() { - cd texmaker-${pkgver} - - export INSTALL_PATH=${pkgdir} - - make install -} diff --git a/community/texmaker/texmaker.install b/community/texmaker/texmaker.install deleted file mode 100644 index 9591f6c5d..000000000 --- a/community/texmaker/texmaker.install +++ /dev/null @@ -1,7 +0,0 @@ -post_install() { - update-desktop-database -q -} - -post_remove() { - update-desktop-database -q -} diff --git a/community/tuxpaint/desktop.patch b/community/tuxpaint/desktop.patch deleted file mode 100644 index 78d2ed397..000000000 --- a/community/tuxpaint/desktop.patch +++ /dev/null @@ -1,7 +0,0 @@ ---- tuxpaint.desktop2 2008-03-20 15:45:22.000000000 +0100 -+++ tuxpaint.desktop 2008-03-20 15:56:33.000000000 +0100 -@@ -205,3 +205,4 @@ - Comment[zh_cn]=孩子的绘图程序。 - Comment[zh_tw]=適合兒童的畫圖程式 - Comment[zw]=Diif program paar keé men Dibuj paar biét biss -+Categories=Game;KidsGame;Graphics;RasterGraphics; diff --git a/community/volumeicon/PKGBUILD b/community/volumeicon/PKGBUILD new file mode 100644 index 000000000..daa61ed5d --- /dev/null +++ b/community/volumeicon/PKGBUILD @@ -0,0 +1,29 @@ +# $Id: PKGBUILD 64486 2012-02-14 08:50:43Z arodseth $ +# Maintainer: Alexander Rødseth <rodseth@gmail.com> +# Contributor: Maato <maato softwarebakery com> + +pkgname=volumeicon +pkgver=0.4.6 +pkgrel=3 +pkgdesc="Volume control for your system tray" +arch=('x86_64' 'i686') +url="http://softwarebakery.com/maato/volumeicon.html" +license=('GPL3') +depends=('gtk2>=2.16.0' 'alsa-lib') +source=("http://softwarebakery.com/maato/files/volumeicon/$pkgname-$pkgver.tar.gz") +sha256sums=('32f94adc5f346404ae564405dd483ae4bd04212df08e46f18d369b4ba2cb6590') + +build() { + cd "$srcdir/$pkgname-$pkgver" + + ./configure --prefix=/usr + make +} + +package() { + cd "$srcdir/$pkgname-$pkgver" + + make DESTDIR="$pkgdir/" install +} + +# vim:set ts=2 sw=2 et: diff --git a/community/wesnoth/wesnoth-1.8.6-boost-foreach.patch b/community/wesnoth/wesnoth-1.8.6-boost-foreach.patch deleted file mode 100644 index 5aee3118c..000000000 --- a/community/wesnoth/wesnoth-1.8.6-boost-foreach.patch +++ /dev/null @@ -1,70 +0,0 @@ ---- wesnoth-1.8.6/src/gui/widgets/tree_view_node.cpp~ 2011-07-21 23:05:56.594879049 +0200 -+++ wesnoth-1.8.6/src/gui/widgets/tree_view_node.cpp 2011-07-21 23:28:07.540358742 +0200 -@@ -238,6 +238,17 @@ void ttree_view_node::clear() - - struct ttree_view_node_implementation - { -+ template<class W, class It> -+ static W* find_at_aux(It begin, It end, -+ const tpoint& coordinate, const bool must_be_active) { -+ for (It it = begin; it != end; ++it) { -+ if(W* widget = it->find_at(coordinate, must_be_active)) { -+ return widget; -+ } -+ } -+ return NULL; -+ } -+ - template<class W> - static W* find_at( - typename tconst_duplicator<W, ttree_view_node>::type& -@@ -255,13 +266,9 @@ struct ttree_view_node_implementation - } - - typedef typename tconst_duplicator<W, ttree_view_node>::type thack; -- foreach(thack& node, tree_view_node.children_) { -- if(W* widget = node.find_at(coordinate, must_be_active)) { -- return widget; -- } -- } -- -- return NULL; -+ return find_at_aux<W>(tree_view_node.children_.begin(), -+ tree_view_node.children_.end(), -+ coordinate, must_be_active); - } - }; - -@@ -313,7 +320,9 @@ tpoint ttree_view_node::get_current_size - return size; - } - -- foreach(const ttree_view_node& node, children_) { -+ for (boost::ptr_vector<ttree_view_node>::const_iterator it -+ = children_.begin (); it != children_.end (); ++it) { -+ const ttree_view_node& node = *it; - - if(node.grid_.get_visible() == twidget::INVISIBLE) { - continue; -@@ -344,7 +353,9 @@ tpoint ttree_view_node::get_unfolded_siz - size.x += (get_indention_level() - 1) * tree_view().indention_step_size_; - } - -- foreach(const ttree_view_node& node, children_) { -+ for (boost::ptr_vector<ttree_view_node>::const_iterator it -+ = children_.begin (); it != children_.end (); ++it) { -+ const ttree_view_node& node = *it; - - if(node.grid_.get_visible() == twidget::INVISIBLE) { - continue; -@@ -378,7 +389,9 @@ tpoint ttree_view_node::calculate_best_s - - DBG_GUI_L << LOG_HEADER << " own grid best size " << best_size << ".\n"; - -- foreach(const ttree_view_node& node, children_) { -+ for (boost::ptr_vector<ttree_view_node>::const_iterator it -+ = children_.begin (); it != children_.end (); ++it) { -+ const ttree_view_node& node = *it; - - if(node.grid_.get_visible() == twidget::INVISIBLE) { - continue; diff --git a/community/wesnoth/wesnoth-libpng-1.4.0.patch b/community/wesnoth/wesnoth-libpng-1.4.0.patch deleted file mode 100644 index 338f467af..000000000 --- a/community/wesnoth/wesnoth-libpng-1.4.0.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff -Nur wesnoth-1.8.orig/src/tools/exploder_utils.cpp wesnoth-1.8/src/tools/exploder_utils.cpp ---- wesnoth-1.8.orig/src/tools/exploder_utils.cpp 2010-01-01 15:16:49.000000000 +0200 -+++ wesnoth-1.8/src/tools/exploder_utils.cpp 2010-04-08 17:38:03.066201123 +0300 -@@ -174,8 +174,8 @@ - //TODO: review whether providing NULL error handlers is something - //sensible - png_struct* png_ptr = png_create_write_struct -- (PNG_LIBPNG_VER_STRING, reinterpret_cast<png_voidp>(png_voidp_NULL), -- png_error_ptr_NULL, png_error_ptr_NULL); -+ (PNG_LIBPNG_VER_STRING, reinterpret_cast<png_voidp>(NULL), -+ NULL, NULL); - if(!png_ptr) - throw exploder_failure("Unable to initialize the png write structure"); - ---- wesnoth-1.8.orig/src/tools/exploder_utils.cpp.libpng 2011-11-06 14:44:26.618711420 -0600 -+++ wesnoth-1.8/src/tools/exploder_utils.cpp 2011-11-06 14:57:12.150006511 -0600 -@@ -15,6 +15,7 @@ - #include "exploder_utils.hpp" - #include "game_config.hpp" - #include "serialization/string_utils.hpp" -+#include <zlib.h> - #include <png.h> - - exploder_point::exploder_point(const std::string &s) diff --git a/core/kmod/0001-partially-fix-parsing-of-alias-with-dots.patch b/core/kmod/0001-partially-fix-parsing-of-alias-with-dots.patch deleted file mode 100644 index b69d095d3..000000000 --- a/core/kmod/0001-partially-fix-parsing-of-alias-with-dots.patch +++ /dev/null @@ -1,34 +0,0 @@ -From cdaf4b2f3ef60365c6b8006a63410368a7b38f39 Mon Sep 17 00:00:00 2001 -From: Dave Reisner <dreisner@archlinux.org> -Date: Tue, 31 Jan 2012 00:12:32 -0500 -Subject: [PATCH 1/4] partially fix parsing of alias with dots - ---- - libkmod/libkmod-util.c | 4 +--- - 1 files changed, 1 insertions(+), 3 deletions(-) - -diff --git a/libkmod/libkmod-util.c b/libkmod/libkmod-util.c -index 7c2611b..6a9f697 100644 ---- a/libkmod/libkmod-util.c -+++ b/libkmod/libkmod-util.c -@@ -134,8 +134,7 @@ inline int alias_normalize(const char *alias, char buf[PATH_MAX], size_t *len) - case ']': - return -EINVAL; - case '[': -- while (alias[s] != ']' && -- alias[s] != '.' && alias[s] != '\0') -+ while (alias[s] != ']' && alias[s] != '\0') - s++; - - if (alias[s] != ']') -@@ -144,7 +143,6 @@ inline int alias_normalize(const char *alias, char buf[PATH_MAX], size_t *len) - s++; - break; - case '\0': -- case '.': - goto finish; - default: - buf[s] = c; --- -1.7.9 - diff --git a/core/kmod/0002-libkmod-module-used-shared-code-in-module-creation.patch b/core/kmod/0002-libkmod-module-used-shared-code-in-module-creation.patch deleted file mode 100644 index 76cc35049..000000000 --- a/core/kmod/0002-libkmod-module-used-shared-code-in-module-creation.patch +++ /dev/null @@ -1,196 +0,0 @@ -From 1d2f64689b2456ade81d6d489c4f5bfb5fdb92fd Mon Sep 17 00:00:00 2001 -From: Dave Reisner <dreisner@archlinux.org> -Date: Tue, 31 Jan 2012 00:13:43 -0500 -Subject: [PATCH 2/4] libkmod-module: used shared code in module creation - ---- - libkmod/libkmod-module.c | 135 ++++++++++++++++++++++++++------------------- - 1 files changed, 78 insertions(+), 57 deletions(-) - -diff --git a/libkmod/libkmod-module.c b/libkmod/libkmod-module.c -index 47b1709..48e4aa1 100644 ---- a/libkmod/libkmod-module.c -+++ b/libkmod/libkmod-module.c -@@ -162,6 +162,76 @@ fail: - return err; - } - -+/* -+ * Memory layout with alias: -+ * -+ * struct kmod_module { -+ * hashkey -----. -+ * alias -----. | -+ * name ----. | | -+ * } | | | -+ * name <----------' | | -+ * alias <-----------' | -+ * name\alias <--------' -+ * -+ * Memory layout without alias: -+ * -+ * struct kmod_module { -+ * hashkey ---. -+ * alias -----|----> NULL -+ * name ----. | -+ * } | | -+ * name <----------'-' -+ * -+ * @key is "name\alias" or "name" (in which case alias == NULL) -+ */ -+static int kmod_module_new(struct kmod_ctx *ctx, const char *key, -+ const char *name, size_t namelen, -+ const char *alias, size_t aliaslen, -+ struct kmod_module **mod) -+{ -+ struct kmod_module *m; -+ size_t keylen; -+ -+ m = kmod_pool_get_module(ctx, key); -+ if (m != NULL) { -+ *mod = kmod_module_ref(m); -+ return 0; -+ } -+ -+ if (alias == NULL) -+ keylen = namelen; -+ else -+ keylen = namelen + aliaslen + 1; -+ -+ m = malloc(sizeof(*m) + (alias == NULL ? 1 : 2) * (keylen + 1)); -+ if (m == NULL) { -+ free(m); -+ return -ENOMEM; -+ } -+ -+ memset(m, 0, sizeof(*m)); -+ -+ m->ctx = kmod_ref(ctx); -+ m->name = (char *)m + sizeof(*m); -+ memcpy(m->name, key, keylen + 1); -+ if (alias == NULL) { -+ m->hashkey = m->name; -+ m->alias = NULL; -+ } else { -+ m->name[namelen] = '\0'; -+ m->alias = m->name + namelen + 1; -+ m->hashkey = m->name + keylen + 1; -+ memcpy(m->hashkey, key, keylen + 1); -+ } -+ -+ m->refcount = 1; -+ kmod_pool_add_module(ctx, m, m->hashkey); -+ *mod = m; -+ -+ return 0; -+} -+ - /** - * kmod_module_new_from_name: - * @ctx: kmod library context -@@ -188,54 +258,15 @@ KMOD_EXPORT int kmod_module_new_from_name(struct kmod_ctx *ctx, - const char *name, - struct kmod_module **mod) - { -- struct kmod_module *m; - size_t namelen; - char name_norm[PATH_MAX]; -- char *namesep; - - if (ctx == NULL || name == NULL || mod == NULL) - return -ENOENT; - -- if (alias_normalize(name, name_norm, &namelen) < 0) { -- DBG(ctx, "invalid alias: %s\n", name); -- return -EINVAL; -- } -+ modname_normalize(name, name_norm, &namelen); - -- m = kmod_pool_get_module(ctx, name_norm); -- if (m != NULL) { -- *mod = kmod_module_ref(m); -- return 0; -- } -- -- namesep = strchr(name_norm, '/'); -- m = malloc(sizeof(*m) + (namesep == NULL ? 1 : 2) * namelen + 2); -- if (m == NULL) { -- free(m); -- return -ENOMEM; -- } -- -- memset(m, 0, sizeof(*m)); -- -- m->ctx = kmod_ref(ctx); -- m->name = (char *)m + sizeof(*m); -- memcpy(m->name, name_norm, namelen + 1); -- -- if (namesep) { -- size_t len = namesep - name_norm; -- -- m->name[len] = '\0'; -- m->alias = m->name + len + 1; -- m->hashkey = m->name + namelen + 1; -- memcpy(m->hashkey, name_norm, namelen + 1); -- } else { -- m->hashkey = m->name; -- } -- -- m->refcount = 1; -- kmod_pool_add_module(ctx, m, m->hashkey); -- *mod = m; -- -- return 0; -+ return kmod_module_new(ctx, name_norm, name_norm, namelen, NULL, 0, mod); - } - - int kmod_module_new_from_alias(struct kmod_ctx *ctx, const char *alias, -@@ -251,9 +282,9 @@ int kmod_module_new_from_alias(struct kmod_ctx *ctx, const char *alias, - - memcpy(key, name, namelen); - memcpy(key + namelen + 1, alias, aliaslen + 1); -- key[namelen] = '/'; -+ key[namelen] = '\\'; - -- err = kmod_module_new_from_name(ctx, key, mod); -+ err = kmod_module_new(ctx, key, name, namelen, alias, aliaslen, mod); - if (err < 0) - return err; - -@@ -323,7 +354,7 @@ KMOD_EXPORT int kmod_module_new_from_path(struct kmod_ctx *ctx, - free(abspath); - else { - ERR(ctx, "kmod_module '%s' already exists with different path: new-path='%s' old-path='%s'\n", -- name, abspath, m->path); -+ name, abspath, m->path); - free(abspath); - return -EEXIST; - } -@@ -332,21 +363,11 @@ KMOD_EXPORT int kmod_module_new_from_path(struct kmod_ctx *ctx, - return 0; - } - -- m = malloc(sizeof(*m) + namelen + 1); -- if (m == NULL) -- return -errno; -- -- memset(m, 0, sizeof(*m)); -+ err = kmod_module_new(ctx, name, name, namelen, NULL, 0, &m); -+ if (err < 0) -+ return err; - -- m->ctx = kmod_ref(ctx); -- m->name = (char *)m + sizeof(*m); -- memcpy(m->name, name, namelen + 1); - m->path = abspath; -- m->hashkey = m->name; -- m->refcount = 1; -- -- kmod_pool_add_module(ctx, m, m->hashkey); -- - *mod = m; - - return 0; --- -1.7.9 - diff --git a/core/kmod/0003-modprobe-handle-all-error-returns-from-init_module.patch b/core/kmod/0003-modprobe-handle-all-error-returns-from-init_module.patch deleted file mode 100644 index 5bbc93a90..000000000 --- a/core/kmod/0003-modprobe-handle-all-error-returns-from-init_module.patch +++ /dev/null @@ -1,34 +0,0 @@ -From fdf78d80d298353c29e1fe8c00602669dd9662bb Mon Sep 17 00:00:00 2001 -From: Dave Reisner <dreisner@archlinux.org> -Date: Mon, 30 Jan 2012 23:05:26 -0500 -Subject: [PATCH 3/4] modprobe: handle all error returns from init_module - ---- - tools/kmod-modprobe.c | 4 +++- - 1 files changed, 3 insertions(+), 1 deletions(-) - -diff --git a/tools/kmod-modprobe.c b/tools/kmod-modprobe.c -index 3e51506..c882856 100644 ---- a/tools/kmod-modprobe.c -+++ b/tools/kmod-modprobe.c -@@ -551,6 +551,8 @@ static int insmod_do_insert_module(struct kmod_module *mod, const char *opts) - - err = kmod_module_insert_module(mod, flags, opts); - switch (err) { -+ case 0: -+ break; - case -EEXIST: - /* - * We checked for EEXIST with an earlier call to -@@ -564,7 +566,7 @@ static int insmod_do_insert_module(struct kmod_module *mod, const char *opts) - ERR("Module %s already in kernel.\n", - kmod_module_get_name(mod)); - break; -- case -EPERM: -+ default: - ERR("could not insert '%s': %s\n", kmod_module_get_name(mod), - strerror(-err)); - break; --- -1.7.9 - diff --git a/core/kmod/0004-modprobe-remove-0-refcnt-deps.patch b/core/kmod/0004-modprobe-remove-0-refcnt-deps.patch deleted file mode 100644 index 80cc73130..000000000 --- a/core/kmod/0004-modprobe-remove-0-refcnt-deps.patch +++ /dev/null @@ -1,52 +0,0 @@ -From 4e3dd21aff55b5bbaa08b037fc2a5625bfffc0a5 Mon Sep 17 00:00:00 2001 -From: Dave Reisner <dreisner@archlinux.org> -Date: Mon, 30 Jan 2012 23:39:30 -0500 -Subject: [PATCH 4/4] modprobe: remove 0 refcnt deps - ---- - tools/kmod-modprobe.c | 15 +++++++++++++-- - 1 files changed, 13 insertions(+), 2 deletions(-) - -diff --git a/tools/kmod-modprobe.c b/tools/kmod-modprobe.c -index c882856..bd991a5 100644 ---- a/tools/kmod-modprobe.c -+++ b/tools/kmod-modprobe.c -@@ -381,7 +381,7 @@ static int rmmod_do_deps_list(struct kmod_list *list, bool stop_on_errors) - static int rmmod_do_module(struct kmod_module *mod, bool do_dependencies) - { - const char *modname = kmod_module_get_name(mod); -- struct kmod_list *pre = NULL, *post = NULL; -+ struct kmod_list *pre = NULL, *post = NULL, *deps, *itr; - const char *cmd = NULL; - int err; - -@@ -422,7 +422,7 @@ static int rmmod_do_module(struct kmod_module *mod, bool do_dependencies) - rmmod_do_deps_list(post, false); - - if (do_dependencies && remove_dependencies) { -- struct kmod_list *deps = kmod_module_get_dependencies(mod); -+ deps = kmod_module_get_dependencies(mod); - - err = rmmod_do_deps_list(deps, true); - if (err < 0) -@@ -451,6 +451,17 @@ static int rmmod_do_module(struct kmod_module *mod, bool do_dependencies) - - rmmod_do_deps_list(pre, false); - -+ deps = kmod_module_get_dependencies(mod); -+ if (deps != NULL) { -+ kmod_list_foreach_reverse(itr, deps) { -+ struct kmod_module *dep = kmod_module_get_module(itr); -+ if (kmod_module_get_refcnt(dep) == 0) -+ rmmod_do_remove_module(dep); -+ kmod_module_unref(dep); -+ } -+ kmod_module_unref_list(deps); -+ } -+ - error: - kmod_module_unref_list(pre); - kmod_module_unref_list(post); --- -1.7.9 - diff --git a/extra/brltty/brltty-4.2-S_ISCHR.patch b/extra/brltty/brltty-4.2-S_ISCHR.patch deleted file mode 100644 index eddac9616..000000000 --- a/extra/brltty/brltty-4.2-S_ISCHR.patch +++ /dev/null @@ -1,11 +0,0 @@ -diff -up brltty-4.2/Programs/sys_linux.c.BAD brltty-4.2/Programs/sys_linux.c ---- brltty-4.2/Programs/sys_linux.c.BAD 2010-05-21 09:04:10.003122084 -0400 -+++ brltty-4.2/Programs/sys_linux.c 2010-05-21 09:04:19.376198268 -0400 -@@ -23,6 +23,7 @@ - #include <errno.h> - #include <fcntl.h> - #include <sys/ioctl.h> -+#include <sys/stat.h> - #include <linux/kd.h> - - #ifdef HAVE_LINUX_INPUT_H diff --git a/extra/conky/PKGBUILD b/extra/conky/PKGBUILD index f96f8c71b..fa5098c03 100644 --- a/extra/conky/PKGBUILD +++ b/extra/conky/PKGBUILD @@ -1,4 +1,4 @@ -# $Id: PKGBUILD 142242 2011-11-07 05:35:59Z bisson $ +# $Id: PKGBUILD 150215 2012-02-15 03:04:18Z bisson $ # Contributor: Giovanni Scafora <giovanni@archlinux.org> # Contributor: James Rayner <james@archlinux.org> # Contributor: Partha Chowdhury <kira.laucas@gmail.com> @@ -6,7 +6,7 @@ pkgname=conky pkgver=1.8.2git20111107 -pkgrel=1 +pkgrel=2 pkgdesc='Lightweight system monitor for X' url='http://conky.sourceforge.net/' license=('BSD' 'GPL') @@ -44,5 +44,7 @@ build() { package() { cd "${srcdir}/${pkgname}-${pkgver}" make DESTDIR="${pkgdir}" install - install -D -m644 COPYING "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" + install -Dm644 COPYING "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" + install -Dm644 extras/vim/syntax/conkyrc.vim "${pkgdir}"/usr/share/vim/vimfiles/syntax/conkyrc.vim + install -Dm644 extras/vim/ftdetect/conkyrc.vim "${pkgdir}"/usr/share/vim/vimfiles/ftdetect/conkyrc.vim } diff --git a/extra/conky/PKGBUILD.cmake b/extra/conky/PKGBUILD.cmake index 7f980868f..a4d50d737 100644 --- a/extra/conky/PKGBUILD.cmake +++ b/extra/conky/PKGBUILD.cmake @@ -44,4 +44,6 @@ package() { make DESTDIR="${pkgdir}" install install -d "${pkgdir}/usr/share/licenses/${pkgname}" install -m644 ../conky/{COPYING,LICENSE}* "${pkgdir}/usr/share/licenses/${pkgname}" + install -Dm644 extras/vim/syntax/conkyrc.vim "${pkgdir}"/usr/share/vim/vimfiles/syntax/conkyrc.vim + install -Dm644 extras/vim/ftdetect/conkyrc.vim "${pkgdir}"/usr/share/vim/vimfiles/ftdetect/conkyrc.vim } diff --git a/extra/ddd/ChangeLog b/extra/ddd/ChangeLog deleted file mode 100644 index b3d8b00af..000000000 --- a/extra/ddd/ChangeLog +++ /dev/null @@ -1,19 +0,0 @@ -2010-08-11 Eric Belanger <eric@archlinux.org> - - * ddd 3.3.12-2 - * Built against elfutils - * Added gcc build patch - * Fixed install script - -2009-03-22 Eric Belanger <eric@archlinux.org> - - * ddd 3.3.12-1 - * Upstream update - * Updated license - -2008-11-11 Eric Belanger <eric@archlinux.org> - - * ddd 3.3.11-5 - * Rebuilt against libxaw 1.0.5 (close FS#12074) - * Added info file support - * Added ChangeLog diff --git a/extra/ecasound/ecasound.changelog b/extra/ecasound/ecasound.changelog deleted file mode 100644 index a735f70c1..000000000 --- a/extra/ecasound/ecasound.changelog +++ /dev/null @@ -1,49 +0,0 @@ -2011-05-14 Ray Rashif <schiv@archlinux.org> - - * ecasound 2.8.0 - * upstream release - -2010-08-22 Ray Rashif <schiv@archlinux.org> - - * ecasound 2.7.2-1 - * python(3) rebuild - * python(2) is optional [1] - * added new liboil depend [2] - * added some optdepends [1] - - [1] http://eca.cx/ecasound/README (or see source archive) - [2] http://eca.cx/relnotes/ecasound_v2_7_2_relnotes.txt - -2010-07-10 Ray Rashif <schiv@archlinux.org> - - * ecasound 2.7.1-2 - * added jack support [1] - * added OSC (liblo) support - - [1] http://bugs.archlinux.org/task/20113 - -2010-02-21 Eric Belanger <eric@archlinux.org> - - * ecasound 2.7.1-1 - * Upstream update - * Improved description - -2010-01-23 Eric Belanger <eric@archlinux.org> - - * ecasound 2.7.0-1 - * Upstream update - -2009-06-18 Eric Belanger <eric@archlinux.org> - - * ecasound 2.6.0-1 - * Upstream update - * Built against readline 6.0.00 - -2009-01-14 Eric Belanger <eric@archlinux.org> - - * ecasound 2.5.2-1 - * Upstream update - * Enabled alsa support - * Added ruby makedepends - * Corrected license - * Added ChangeLog diff --git a/extra/gimp/gimp-poppler-0.18.patch b/extra/gimp/gimp-poppler-0.18.patch deleted file mode 100644 index 0715460bc..000000000 --- a/extra/gimp/gimp-poppler-0.18.patch +++ /dev/null @@ -1,476 +0,0 @@ -From 69f69eed816b89be9a01a48a1f0643d1fd496118 Mon Sep 17 00:00:00 2001 -From: Nils Philippsen <nils@redhat.com> -Date: Fri, 6 May 2011 11:58:44 +0200 -Subject: [PATCH] patch: poppler-0.17 - -Squashed commit of the following: - -commit 529d940222dfc352d41fbf72de29134421aa4002 -Author: Nils Philippsen <nils@redhat.com> -Date: Fri May 6 11:50:30 2011 +0200 - - use code based on pixbufs instead of cairo surfaces - - this is done to avoid adding to libgimp, thanks to Mukund Sivaraman for - hints how to do this - -commit f8671d8767d4cdab830dc06310e96c63a88ec0fd -Author: Mukund Sivaraman <muks@banu.com> -Date: Thu Apr 21 13:57:13 2011 +0530 - - file-pdf-load: Update attribution, removing bogus copyright - (cherry picked from commit e999122e0b20b6ccd6bde3ce039bb64068fc0019) - -commit 89a78f2590d298dac2f42e6d9a3016fc5d672c70 -Author: Nils Philippsen <nils@redhat.com> -Date: Thu Apr 21 13:52:18 2011 +0200 - - file-pdf-load: Use better API + cleanups - - * fixes issues with poppler 0.17 completely - * uses new libgimp API to pass surfaces instead of pixbufs - * uses GTK+ 3 API to convert surfaces to pixbufs where available - (backported from commit 7bdadd80ba479d6ff904e276d805e16f6b940ee2) - -commit 4e92302c4a14a961f112587a0ad86696c88da2f8 -Author: Nils Philippsen <nils@redhat.com> -Date: Thu Apr 21 13:38:08 2011 +0200 - - file-pdf-load: Don't use deprecated API (bug #646947) - - (cherry picked from commit 9b3e1c91fd2eac69da6947ec9c7fbf10096ba237) - - Conflicts: - - plug-ins/common/file-pdf.c ---- - plug-ins/common/file-pdf.c | 323 ++++++++++++++++++++++++++++++++++++++------ - 1 files changed, 283 insertions(+), 40 deletions(-) - -diff --git a/plug-ins/common/file-pdf.c b/plug-ins/common/file-pdf.c -index a43b459..43c2b7d 100644 ---- a/plug-ins/common/file-pdf.c -+++ b/plug-ins/common/file-pdf.c -@@ -4,6 +4,9 @@ - * - * Copyright (C) 2005 Nathan Summers - * -+ * Some code in render_page_to_surface() borrowed from -+ * poppler.git/glib/poppler-page.cc. -+ * - * 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 -@@ -80,16 +83,20 @@ static gboolean load_dialog (PopplerDocument *doc, - static PopplerDocument * open_document (const gchar *filename, - GError **error); - --static GdkPixbuf * get_thumbnail (PopplerDocument *doc, -+static cairo_surface_t * get_thumb_surface (PopplerDocument *doc, -+ gint page, -+ gint preferred_size); -+ -+static GdkPixbuf * get_thumb_pixbuf (PopplerDocument *doc, - gint page, - gint preferred_size); - - static gint32 layer_from_pixbuf (gint32 image, -- const gchar *layer_name, -- gint position, -- GdkPixbuf *buf, -- gdouble progress_start, -- gdouble progress_scale); -+ const gchar *layer_name, -+ gint position, -+ GdkPixbuf *pixbuf, -+ gdouble progress_start, -+ gdouble progress_scale); - - /** - ** the following was formerly part of -@@ -433,11 +440,12 @@ run (const gchar *name, - } - else - { -- gdouble width = 0; -- gdouble height = 0; -- gdouble scale; -- gint32 image = -1; -- GdkPixbuf *pixbuf = NULL; -+ gdouble width = 0; -+ gdouble height = 0; -+ gdouble scale; -+ gint32 image = -1; -+ gint num_pages = 0; -+ GdkPixbuf *pixbuf = NULL; - - /* Possibly retrieve last settings */ - gimp_get_data (LOAD_PROC, &loadvals); -@@ -455,7 +463,10 @@ run (const gchar *name, - g_object_unref (page); - } - -- pixbuf = get_thumbnail (doc, 0, param[1].data.d_int32); -+ num_pages = poppler_document_get_n_pages (doc); -+ -+ pixbuf = get_thumb_pixbuf (doc, 0, param[1].data.d_int32); -+ - g_object_unref (doc); - } - -@@ -548,6 +559,187 @@ open_document (const gchar *filename, - return doc; - } - -+/* FIXME: Remove this someday when we depend fully on GTK+ >= 3 */ -+ -+#if (!GTK_CHECK_VERSION (3, 0, 0)) -+ -+static cairo_format_t -+gdk_cairo_format_for_content (cairo_content_t content) -+{ -+ switch (content) -+ { -+ case CAIRO_CONTENT_COLOR: -+ return CAIRO_FORMAT_RGB24; -+ case CAIRO_CONTENT_ALPHA: -+ return CAIRO_FORMAT_A8; -+ case CAIRO_CONTENT_COLOR_ALPHA: -+ default: -+ return CAIRO_FORMAT_ARGB32; -+ } -+} -+ -+static cairo_surface_t * -+gdk_cairo_surface_coerce_to_image (cairo_surface_t *surface, -+ cairo_content_t content, -+ int src_x, -+ int src_y, -+ int width, -+ int height) -+{ -+ cairo_surface_t *copy; -+ cairo_t *cr; -+ -+ copy = cairo_image_surface_create (gdk_cairo_format_for_content (content), -+ width, -+ height); -+ -+ cr = cairo_create (copy); -+ cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE); -+ cairo_set_source_surface (cr, surface, -src_x, -src_y); -+ cairo_paint (cr); -+ cairo_destroy (cr); -+ -+ return copy; -+} -+ -+static void -+convert_alpha (guchar *dest_data, -+ int dest_stride, -+ guchar *src_data, -+ int src_stride, -+ int src_x, -+ int src_y, -+ int width, -+ int height) -+{ -+ int x, y; -+ -+ src_data += src_stride * src_y + src_x * 4; -+ -+ for (y = 0; y < height; y++) { -+ guint32 *src = (guint32 *) src_data; -+ -+ for (x = 0; x < width; x++) { -+ guint alpha = src[x] >> 24; -+ -+ if (alpha == 0) -+ { -+ dest_data[x * 4 + 0] = 0; -+ dest_data[x * 4 + 1] = 0; -+ dest_data[x * 4 + 2] = 0; -+ } -+ else -+ { -+ dest_data[x * 4 + 0] = (((src[x] & 0xff0000) >> 16) * 255 + alpha / 2) / alpha; -+ dest_data[x * 4 + 1] = (((src[x] & 0x00ff00) >> 8) * 255 + alpha / 2) / alpha; -+ dest_data[x * 4 + 2] = (((src[x] & 0x0000ff) >> 0) * 255 + alpha / 2) / alpha; -+ } -+ dest_data[x * 4 + 3] = alpha; -+ } -+ -+ src_data += src_stride; -+ dest_data += dest_stride; -+ } -+} -+ -+static void -+convert_no_alpha (guchar *dest_data, -+ int dest_stride, -+ guchar *src_data, -+ int src_stride, -+ int src_x, -+ int src_y, -+ int width, -+ int height) -+{ -+ int x, y; -+ -+ src_data += src_stride * src_y + src_x * 4; -+ -+ for (y = 0; y < height; y++) { -+ guint32 *src = (guint32 *) src_data; -+ -+ for (x = 0; x < width; x++) { -+ dest_data[x * 3 + 0] = src[x] >> 16; -+ dest_data[x * 3 + 1] = src[x] >> 8; -+ dest_data[x * 3 + 2] = src[x]; -+ } -+ -+ src_data += src_stride; -+ dest_data += dest_stride; -+ } -+} -+ -+/** -+ * gdk_pixbuf_get_from_surface: -+ * @surface: surface to copy from -+ * @src_x: Source X coordinate within @surface -+ * @src_y: Source Y coordinate within @surface -+ * @width: Width in pixels of region to get -+ * @height: Height in pixels of region to get -+ * -+ * Transfers image data from a #cairo_surface_t and converts it to an RGB(A) -+ * representation inside a #GdkPixbuf. This allows you to efficiently read -+ * individual pixels from cairo surfaces. For #GdkWindows, use -+ * gdk_pixbuf_get_from_window() instead. -+ * -+ * This function will create an RGB pixbuf with 8 bits per channel. -+ * The pixbuf will contain an alpha channel if the @surface contains one. -+ * -+ * Return value: (transfer full): A newly-created pixbuf with a reference -+ * count of 1, or %NULL on error -+ */ -+static GdkPixbuf * -+gdk_pixbuf_get_from_surface (cairo_surface_t *surface, -+ gint src_x, -+ gint src_y, -+ gint width, -+ gint height) -+{ -+ cairo_content_t content; -+ GdkPixbuf *dest; -+ -+ /* General sanity checks */ -+ g_return_val_if_fail (surface != NULL, NULL); -+ g_return_val_if_fail (width > 0 && height > 0, NULL); -+ -+ content = cairo_surface_get_content (surface) | CAIRO_CONTENT_COLOR; -+ dest = gdk_pixbuf_new (GDK_COLORSPACE_RGB, -+ !!(content & CAIRO_CONTENT_ALPHA), -+ 8, -+ width, height); -+ -+ surface = gdk_cairo_surface_coerce_to_image (surface, content, -+ src_x, src_y, -+ width, height); -+ cairo_surface_flush (surface); -+ if (cairo_surface_status (surface) || dest == NULL) -+ { -+ cairo_surface_destroy (surface); -+ return NULL; -+ } -+ -+ if (gdk_pixbuf_get_has_alpha (dest)) -+ convert_alpha (gdk_pixbuf_get_pixels (dest), -+ gdk_pixbuf_get_rowstride (dest), -+ cairo_image_surface_get_data (surface), -+ cairo_image_surface_get_stride (surface), -+ 0, 0, -+ width, height); -+ else -+ convert_no_alpha (gdk_pixbuf_get_pixels (dest), -+ gdk_pixbuf_get_rowstride (dest), -+ cairo_image_surface_get_data (surface), -+ cairo_image_surface_get_stride (surface), -+ 0, 0, -+ width, height); -+ -+ cairo_surface_destroy (surface); -+ return dest; -+} -+ -+#endif -+ - static gint32 - layer_from_pixbuf (gint32 image, - const gchar *layer_name, -@@ -566,6 +758,54 @@ layer_from_pixbuf (gint32 image, - return layer; - } - -+static cairo_surface_t * -+render_page_to_surface (PopplerPage *page, -+ int width, -+ int height, -+ double scale) -+{ -+ cairo_surface_t *surface; -+ cairo_t *cr; -+ -+ surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, width, height); -+ cr = cairo_create (surface); -+ -+ cairo_save (cr); -+ cairo_translate (cr, 0.0, 0.0); -+ -+ if (scale != 1.0) -+ cairo_scale (cr, scale, scale); -+ -+ poppler_page_render (page, cr); -+ cairo_restore (cr); -+ -+ cairo_set_operator (cr, CAIRO_OPERATOR_DEST_OVER); -+ cairo_set_source_rgb (cr, 1.0, 1.0, 1.0); -+ cairo_paint (cr); -+ -+ cairo_destroy (cr); -+ -+ return surface; -+} -+ -+static GdkPixbuf * -+render_page_to_pixbuf (PopplerPage *page, -+ int width, -+ int height, -+ double scale) -+{ -+ GdkPixbuf *pixbuf; -+ cairo_surface_t *surface; -+ -+ surface = render_page_to_surface (page, width, height, scale); -+ pixbuf = gdk_pixbuf_get_from_surface (surface, 0, 0, -+ cairo_image_surface_get_width (surface), -+ cairo_image_surface_get_height (surface)); -+ cairo_surface_destroy (surface); -+ -+ return pixbuf; -+} -+ - static gint32 - load_image (PopplerDocument *doc, - const gchar *filename, -@@ -597,7 +837,7 @@ load_image (PopplerDocument *doc, - gdouble page_width; - gdouble page_height; - -- GdkPixbuf *buf; -+ GdkPixbuf *pixbuf; - gint width; - gint height; - -@@ -627,15 +867,13 @@ load_image (PopplerDocument *doc, - gimp_image_set_resolution (image_ID, resolution, resolution); - } - -- buf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, FALSE, 8, width, height); -- -- poppler_page_render_to_pixbuf (page, 0, 0, width, height, scale, 0, buf); -+ pixbuf = render_page_to_pixbuf (page, width, height, scale); - -- layer_from_pixbuf (image_ID, page_label, i, buf, -+ layer_from_pixbuf (image_ID, page_label, i, pixbuf, - doc_progress, 1.0 / pages->n_pages); - - g_free (page_label); -- g_object_unref (buf); -+ g_object_unref(pixbuf); - - doc_progress = (double) (i + 1) / pages->n_pages; - gimp_progress_update (doc_progress); -@@ -676,30 +914,22 @@ load_image (PopplerDocument *doc, - return image_ID; - } - --static GdkPixbuf * --get_thumbnail (PopplerDocument *doc, -- gint page_num, -- gint preferred_size) -+static cairo_surface_t * -+get_thumb_surface (PopplerDocument *doc, -+ gint page_num, -+ gint preferred_size) - { - PopplerPage *page; -- GdkPixbuf *pixbuf; -+ cairo_surface_t *surface; - - page = poppler_document_get_page (doc, page_num); - - if (! page) - return NULL; - -- /* XXX: Remove conditional when we depend on poppler 0.8.0, but also -- * add configure check to make sure POPPLER_WITH_GDK is enabled! -- */ --#ifdef POPPLER_WITH_GDK -- pixbuf = poppler_page_get_thumbnail_pixbuf (page); --#else -- pixbuf = poppler_page_get_thumbnail (page); --#endif -- -+ surface = poppler_page_get_thumbnail (page); - -- if (! pixbuf) -+ if (! surface) - { - gdouble width; - gdouble height; -@@ -712,15 +942,28 @@ get_thumbnail (PopplerDocument *doc, - width *= scale; - height *= scale; - -- pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, FALSE, 8, -- width, height); -- -- poppler_page_render_to_pixbuf (page, -- 0, 0, width, height, scale, 0, pixbuf); -+ surface = render_page_to_surface (page, width, height, scale); - } - - g_object_unref (page); - -+ return surface; -+} -+ -+static GdkPixbuf * -+get_thumb_pixbuf (PopplerDocument *doc, -+ gint page_num, -+ gint preferred_size) -+{ -+ cairo_surface_t *surface; -+ GdkPixbuf *pixbuf; -+ -+ surface = get_thumb_surface (doc, page_num, preferred_size); -+ pixbuf = gdk_pixbuf_get_from_surface (surface, 0, 0, -+ cairo_image_surface_get_width (surface), -+ cairo_image_surface_get_height (surface)); -+ cairo_surface_destroy (surface); -+ - return pixbuf; - } - -@@ -769,8 +1012,8 @@ thumbnail_thread (gpointer data) - idle_data->page_no = i; - - /* FIXME get preferred size from somewhere? */ -- idle_data->pixbuf = get_thumbnail (thread_data->document, i, -- THUMBNAIL_SIZE); -+ idle_data->pixbuf = get_thumb_pixbuf (thread_data->document, i, -+ THUMBNAIL_SIZE); - - g_idle_add (idle_set_thumbnail, idle_data); - --- -1.7.5 diff --git a/extra/git/PKGBUILD b/extra/git/PKGBUILD index 34552f494..be706a15c 100644 --- a/extra/git/PKGBUILD +++ b/extra/git/PKGBUILD @@ -1,9 +1,9 @@ -# $Id: PKGBUILD 149948 2012-02-11 23:30:42Z allan $ +# $Id: PKGBUILD 150206 2012-02-14 20:14:21Z dan $ # Maintainer: Dan McGee <dan@archlinux.org> pkgname=git -pkgver=1.7.9 -pkgrel=2 +pkgver=1.7.9.1 +pkgrel=1 pkgdesc="the fast distributed version control system" arch=(i686 x86_64 'mips64el') url="http://git-scm.com/" @@ -22,8 +22,6 @@ optdepends=('tk: gitk and git gui' replaces=('git-core') provides=('git-core') backup=('etc/conf.d/git-daemon.conf') -#source=("http://kernel.org/pub/software/scm/git/${pkgname}-${pkgver}.tar.bz2" -# "http://kernel.org/pub/software/scm/git/git-manpages-$pkgver.tar.bz2" source=("http://git-core.googlecode.com/files/git-$pkgver.tar.gz" "http://git-core.googlecode.com/files/git-manpages-$pkgver.tar.gz" git-daemon @@ -80,7 +78,7 @@ package() { install -D -m644 "$srcdir"/git-daemon.conf "$pkgdir"/etc/conf.d/git-daemon.conf } -sha1sums=('ed51ef5ef250daaa6e98515cf2641820cd268d4c' - '1ca1fc430b2814f9e9cf82ec3bf7f2eaf5209b7a' +sha1sums=('bd85327627f96c4e98071a4d1d32c30f210aa54a' + '8c6ee031b39da5c5e53f927952838796e0959ce9' 'f2b41828bd912b72e2cb3e14677739c4f370de66' '149e2da1ecb48872ddb31c0945afeaad1f9653d7') diff --git a/extra/gnugo/gnugo.install b/extra/gnugo/gnugo.install deleted file mode 100644 index b0271070c..000000000 --- a/extra/gnugo/gnugo.install +++ /dev/null @@ -1,18 +0,0 @@ -infodir=/usr/share/info -filelist=(gnugo.info.gz gnugo.info-1.gz gnugo.info-2.gz gnugo.info-3.gz) - -post_install() { - for file in ${filelist[@]}; do - install-info $infodir/$file $infodir/dir 2> /dev/null - done -} - -post_upgrade() { - post_install $1 -} - -pre_remove() { - for file in ${filelist[@]}; do - install-info --delete $infodir/$file $infodir/dir 2> /dev/null - done -} diff --git a/extra/gpsd/PKGBUILD b/extra/gpsd/PKGBUILD index 6a15d34cf..295bf5e8a 100644 --- a/extra/gpsd/PKGBUILD +++ b/extra/gpsd/PKGBUILD @@ -1,11 +1,11 @@ -# $Id: PKGBUILD 142040 2011-11-04 20:43:48Z andrea $ +# $Id: PKGBUILD 150180 2012-02-14 08:19:26Z andrea $ # Maintainer: # Contributor: Andrea Scarpino <andrea@archlinux.org> # Contributor: Sergej Pupykin <pupykin.s+arch@gmail.com> # Contributor: Giacomo Rizzo <alt@free-os.it> pkgname=gpsd -pkgver=3.3 +pkgver=3.4 pkgrel=1 pkgdesc="GPS daemon and library to support USB/serial GPS devices" arch=('i686' 'x86_64' 'mips64el') @@ -21,8 +21,8 @@ options=('!libtool') install="${pkgname}.install" source=("http://download.savannah.gnu.org/releases/${pkgname}/${pkgname}-${pkgver}.tar.gz"{,.sig} 'gpsd' 'gpsd.conf.d') -md5sums=('4cfdcfd88e925f4d0d6c2272fc573ab5' - '90086315ed6f266748b9acb338b903a5' +md5sums=('c01353459faa68834309109d4e868460' + '8aea27e1b0c23f254f94861f7d898106' '1f3402f8e33a7032b9ae6dfd077234f7' '3e963df3f9f7ef3572ecc648ae829315') diff --git a/extra/gtk2/cups-custom-print.patch b/extra/gtk2/cups-custom-print.patch deleted file mode 100644 index ffc89aa32..000000000 --- a/extra/gtk2/cups-custom-print.patch +++ /dev/null @@ -1,104 +0,0 @@ -From 8170436e61ea68c713d75ad374d22c3261be9203 Mon Sep 17 00:00:00 2001 -From: Benjamin Berg <benjamin@sipsolutions.net> -Date: Sat, 24 Dec 2011 16:26:32 +0000 -Subject: Set cups Custom print options correctly (bug #543520, patch by Marek Kašík) - -This patch fixes the cups print backend to pass Custom options with -the "Custom." prefix to cups if neccessary. ---- -diff --git a/modules/printbackends/cups/gtkprintbackendcups.c b/modules/printbackends/cups/gtkprintbackendcups.c -index 14a1b5d..2751ee4 100644 ---- a/modules/printbackends/cups/gtkprintbackendcups.c -+++ b/modules/printbackends/cups/gtkprintbackendcups.c -@@ -483,22 +483,44 @@ cups_print_cb (GtkPrintBackendCups *print_backend, - GDK_THREADS_LEAVE (); - } - -+typedef struct { -+ GtkCupsRequest *request; -+ GtkPrinterOptionSet *options; -+} CupsOptionsData; -+ - static void - add_cups_options (const gchar *key, - const gchar *value, - gpointer user_data) - { -- GtkCupsRequest *request = user_data; -+ CupsOptionsData *data = (CupsOptionsData *) user_data; -+ GtkCupsRequest *request = data->request; -+ GtkPrinterOptionSet *options = data->options; -+ GtkPrinterOption *option = NULL; -+ gchar *new_value = NULL; - - if (!g_str_has_prefix (key, "cups-")) - return; - - if (strcmp (value, "gtk-ignore-value") == 0) - return; -+ -+ option = gtk_printer_option_set_lookup (options, key); - - key = key + strlen ("cups-"); - -- gtk_cups_request_encode_option (request, key, value); -+ /* Add "Custom." prefix to custom values */ -+ if (value && option && -+ !gtk_printer_option_has_choice (option, value)) -+ new_value = g_strdup_printf ("Custom.%s", value); -+ -+ if (new_value) -+ { -+ gtk_cups_request_encode_option (request, key, new_value); -+ g_free (new_value); -+ } -+ else -+ gtk_cups_request_encode_option (request, key, value); - } - - static void -@@ -511,8 +533,12 @@ gtk_print_backend_cups_print_stream (GtkPrintBackend *print_backend, - { - GtkPrinterCups *cups_printer; - CupsPrintStreamData *ps; -+ CupsOptionsData *options_data; - GtkCupsRequest *request; - GtkPrintSettings *settings; -+ GtkPrinterOptionSet *options; -+ GtkPrintCapabilities capabilities; -+ GtkPageSetup *page_setup; - const gchar *title; - char printer_absolute_uri[HTTP_MAX_URI]; - -@@ -521,6 +547,8 @@ gtk_print_backend_cups_print_stream (GtkPrintBackend *print_backend, - - cups_printer = GTK_PRINTER_CUPS (gtk_print_job_get_printer (job)); - settings = gtk_print_job_get_settings (job); -+ capabilities = cups_printer_get_capabilities (GTK_PRINTER (cups_printer)); -+ page_setup = gtk_printer_get_default_page_size (GTK_PRINTER (cups_printer)); - - request = gtk_cups_request_new_with_username (NULL, - GTK_CUPS_POST, -@@ -558,8 +586,18 @@ gtk_print_backend_cups_print_stream (GtkPrintBackend *print_backend, - IPP_TAG_NAME, "job-name", - NULL, title); - -- gtk_print_settings_foreach (settings, add_cups_options, request); -- -+ options = cups_printer_get_options (GTK_PRINTER (cups_printer), settings, page_setup, capabilities); -+ -+ options_data = g_new0 (CupsOptionsData, 1); -+ options_data->request = request; -+ options_data->options = options; -+ -+ gtk_print_settings_foreach (settings, add_cups_options, options_data); -+ -+ g_object_unref (page_setup); -+ g_object_unref (options); -+ g_free (options_data); -+ - ps = g_new0 (CupsPrintStreamData, 1); - ps->callback = callback; - ps->user_data = user_data; --- -cgit v0.9.0.2 diff --git a/extra/imlib/libpng14.patch b/extra/imlib/libpng14.patch deleted file mode 100644 index 2cc174e29..000000000 --- a/extra/imlib/libpng14.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -Naur imlib-1.9.15-orig/Imlib/load.c imlib-1.9.15/Imlib/load.c ---- imlib-1.9.15-orig/Imlib/load.c 2010-01-18 20:58:27.000000000 -0500 -+++ imlib-1.9.15/Imlib/load.c 2010-01-18 21:02:04.000000000 -0500 -@@ -1619,7 +1619,7 @@ - return 0; - fread(buf, 1, 8, f); - rewind(f); -- return (int)png_check_sig(buf, 8); -+ return (int)png_sig_cmp(buf, 0, 8)==0; - #else - return 0; - #endif diff --git a/extra/kdebindings-python/PKGBUILD b/extra/kdebindings-python/PKGBUILD index f3f0e26c6..979641624 100644 --- a/extra/kdebindings-python/PKGBUILD +++ b/extra/kdebindings-python/PKGBUILD @@ -1,9 +1,9 @@ -# $Id: PKGBUILD 147780 2012-01-28 10:32:45Z andrea $ +# $Id: PKGBUILD 150178 2012-02-14 07:57:40Z andrea $ # Maintainer: Andrea Scarpino <andrea@archlinux.org> pkgname=kdebindings-python pkgver=4.8.0 -pkgrel=1 +pkgrel=2 pkgdesc="KDE bindings for Python" url="http://kde.org/" arch=('i686' 'x86_64' 'mips64el') diff --git a/extra/ksensors/PKGBUILD b/extra/ksensors/PKGBUILD deleted file mode 100644 index 6db8e7e85..000000000 --- a/extra/ksensors/PKGBUILD +++ /dev/null @@ -1,23 +0,0 @@ -# $Id: PKGBUILD 64746 2010-01-22 03:14:29Z eric $ -# Contributor: Torsten Evers <tevers@onlinehome.de> -# Maintainer: Thomas Baechler <thomas@archlinux.org> -pkgname=ksensors -pkgver=0.7.3 -pkgrel=5 -pkgdesc="ksensors is nice lm_sensors frontend for KDE" -arch=('i686' 'x86_64') -url="http://ksensors.sourceforge.net/" -license=("GPL") -depends=("lm_sensors>=3.0.0" 'kdelibs3') -source=(#http://mesh.dl.sourceforge.net/sourceforge/ksensors/$pkgname-$pkgver.tar.gz \ - http://people.atrpms.net/~hdegoede/ksensors-0.7.3-fedora-14.tar.gz) -md5sums=('7c64a2ef836c13d72b5711791819072e') - -build() { - cd $startdir/src/$pkgname-$pkgver - . /etc/profile.d/qt3.sh - . /etc/profile.d/kde3.sh - ./configure --prefix=/opt/kde --without-arts - make || return 1 - make DESTDIR=$startdir/pkg install -} diff --git a/extra/ksensors/ksensors.patch b/extra/ksensors/ksensors.patch deleted file mode 100644 index 299458f0d..000000000 --- a/extra/ksensors/ksensors.patch +++ /dev/null @@ -1,79 +0,0 @@ ---- admin/cvs.sh 2003-07-11 23:00:30.000000000 +0800 -+++ admin/cvs.sh 2006-08-28 14:54:23.000000000 +0800 -@@ -29,7 +29,7 @@ - { - AUTOCONF_VERSION=`$AUTOCONF --version | head -n 1` - case $AUTOCONF_VERSION in -- Autoconf*2.5* | autoconf*2.5* ) : ;; -+ Autoconf*2.[56]* | autoconf*2.[56]* ) : ;; - "" ) - echo "*** AUTOCONF NOT FOUND!." - echo "*** KDE requires autoconf 2.52, 2.53 or 2.54" -@@ -44,7 +44,7 @@ - - AUTOHEADER_VERSION=`$AUTOHEADER --version | head -n 1` - case $AUTOHEADER_VERSION in -- Autoconf*2.5* | autoheader*2.5* ) : ;; -+ Autoconf*2.[56]* | autoheader*2.[56]* ) : ;; - "" ) - echo "*** AUTOHEADER NOT FOUND!." - echo "*** KDE requires autoheader 2.52 or 2.53 (part of autoconf)" ---- src/hdsensorslist.cpp 2004-08-09 02:30:05.000000000 +0800 -+++ src/hdsensorslist.cpp 2006-08-28 15:27:02.000000000 +0800 -@@ -206,13 +206,17 @@ - - bool HDSensorsList::getDisks(QStringList &disks ) - { -- DIR *dir= opendir("/proc/ide"); -- if(!dir) return false; -+ DIR *dir; -+ -+ /* Get a listing of the hard drives looking under sysfs first before falling back to /proc/ide */ -+ if((dir = opendir ("/sys/block")) == NULL) -+ if ((dir = opendir ("/proc/ide")) == NULL) -+ return false; - QString str; - struct dirent *ptr; - while((ptr= readdir(dir))) { -- if(ptr->d_name[0]=='h' && ptr->d_name[1]=='d') { -- str.sprintf("/dev/hd%c",ptr->d_name[2]); -+ if((ptr->d_name[0] == 'h' || ptr->d_name[0] == 's') && ptr->d_name[1] == 'd') { -+ str.sprintf("/dev/%s", ptr->d_name); - disks << str; - } - } ---- src/lmsensorscfgdesign.ui 2004-08-11 22:36:54.000000000 +0800 -+++ src/lmsensorscfgdesign.ui 2006-08-28 14:54:23.000000000 +0800 -@@ -748,29 +748,13 @@ - <property name="name"> - <cstring>unnamed</cstring> - </property> -- <widget class="QLabel"> -+ <widget class="QButtonGroup"> - <property name="name"> -- <cstring>TextLabel1_3_2_2_2_2</cstring> -+ <cstring>ButtonGroup9</cstring> - </property> -- <property name="text"> -+ <property name="title"> - <string>On reach alarm value:</string> - </property> -- </widget> -- <widget class="QFrame"> -- <property name="name"> -- <cstring>Frame11_2_2_2</cstring> -- </property> -- <property name="frameShape"> -- <enum>HLine</enum> -- </property> -- <property name="frameShadow"> -- <enum>Sunken</enum> -- </property> -- </widget> -- <widget class="QLayoutWidget"> -- <property name="name"> -- <cstring>layout9</cstring> -- </property> - <grid> - <property name="name"> - <cstring>unnamed</cstring> diff --git a/extra/libksba/PKGBUILD b/extra/libksba/PKGBUILD deleted file mode 100644 index 20179c686..000000000 --- a/extra/libksba/PKGBUILD +++ /dev/null @@ -1,32 +0,0 @@ -# $Id: PKGBUILD 149501 2012-02-08 10:55:32Z tpowa $ -# Maintainer: damir <damir@archlinux.org> -# Contributor: Damir Perisa <damir.perisa@bluewin.ch> - -pkgname=libksba -pkgver=1.2.0 -pkgrel=2 -pkgdesc="A CMS and X.509 access library" -arch=(i686 x86_64) -license=('GPL') -url="ftp://ftp.gnupg.org/gcrypt/alpha/libksba" -depends=('bash' 'libgpg-error' 'glibc') -source=(ftp://ftp.gnupg.org/gcrypt/$pkgname/$pkgname-$pkgver.tar.bz2) -options=(!libtool) -install=libksba.install - -build() { - cd $srcdir/$pkgname-$pkgver - ./configure --prefix=/usr - make -} - -check() { - cd $srcdir/$pkgname-$pkgver - make check -} - -package() { - cd $srcdir/$pkgname-$pkgver - make DESTDIR=$pkgdir install -} -md5sums=('e797f370b69b4dc776499d6a071ae137') diff --git a/extra/libksba/libksba.install b/extra/libksba/libksba.install deleted file mode 100644 index 3715b8960..000000000 --- a/extra/libksba/libksba.install +++ /dev/null @@ -1,20 +0,0 @@ -infodir=usr/share/info -filelist=(ksba.info) - -post_install() { - [ -x usr/bin/install-info ] || return 0 - for file in ${filelist[@]}; do - install-info $infodir/$file.gz $infodir/dir 2> /dev/null - done -} - -post_upgrade() { - post_install $1 -} - -pre_remove() { - [ -x usr/bin/install-info ] || return 0 - for file in ${filelist[@]}; do - install-info --delete $infodir/$file.gz $infodir/dir 2> /dev/null - done -} diff --git a/extra/libwmf/libpng14.patch b/extra/libwmf/libpng14.patch deleted file mode 100644 index 3d38c717a..000000000 --- a/extra/libwmf/libpng14.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -Nur libwmf-0.2.8.4.orig/src/extra/gd/gd_png.c libwmf-0.2.8.4/src/extra/gd/gd_png.c ---- libwmf-0.2.8.4.orig/src/extra/gd/gd_png.c 2005-07-27 23:35:06.000000000 +0300 -+++ libwmf-0.2.8.4/src/extra/gd/gd_png.c 2010-01-17 01:33:58.000000000 +0200 -@@ -136,7 +136,7 @@ - /* first do a quick check that the file really is a PNG image; could - * have used slightly more general png_sig_cmp() function instead */ - gdGetBuf (sig, 8, infile); -- if (!png_check_sig (sig, 8)) -+ if (png_sig_cmp (sig, 0, 8)) - return NULL; /* bad signature */ - - #ifndef PNG_SETJMP_NOT_SUPPORTED diff --git a/extra/metalog/PKGBUILD b/extra/metalog/PKGBUILD index c83a6e685..427a66794 100644 --- a/extra/metalog/PKGBUILD +++ b/extra/metalog/PKGBUILD @@ -1,10 +1,10 @@ -# $Id: PKGBUILD 149960 2012-02-11 23:31:08Z allan $ +# $Id: PKGBUILD 150210 2012-02-14 21:34:23Z juergen $ # Maintainer: juergen <juergen@archlinux.org> # Contributor: Tom Newsom <Jeepster@gmx.co.uk> pkgname=metalog -pkgver=1.0 -pkgrel=3 +pkgver=2.0 +pkgrel=1 pkgdesc="Metalog is a modern replacement for syslogd and klogd" url="http://metalog.sourceforge.net" license=('GPL') @@ -12,21 +12,19 @@ arch=('i686' 'x86_64' 'mips64el') depends=('pcre') provides=('logger') backup=('etc/metalog.conf' 'etc/conf.d/metalog') -source=("http://downloads.sourceforge.net/sourceforge/${pkgname}/${pkgname}-1.tar.lzma" - 'metalog' - 'metalog.confd') -md5sums=('df4ec89f6a0df24a43f9592ee80ab6be' +source=("http://sourceforge.net/projects/metalog/files/metalog-2.tar.xz/download" 'metalog' 'metalog.confd') +md5sums=('e948d10d780205eae17645c89aee1361' 'cdd1d34eedbfbc2d9e659bf0a0f58f56' '86bccd5a02996921e29eff8a0394d11f') build() { - cd $srcdir/$pkgname-1 + cd $srcdir/$pkgname-2 ./configure --prefix=/usr --sysconfdir=/etc make } package() { - cd $srcdir/$pkgname-1 + cd $srcdir/$pkgname-2 make DESTDIR=$pkgdir install install -D -m755 $srcdir/metalog $pkgdir/etc/rc.d/metalog install -D -m644 $srcdir/metalog.confd $pkgdir/etc/conf.d/metalog diff --git a/extra/netpbm/libpng-1.4.patch b/extra/netpbm/libpng-1.4.patch deleted file mode 100644 index c02ded734..000000000 --- a/extra/netpbm/libpng-1.4.patch +++ /dev/null @@ -1,59 +0,0 @@ -diff -Naur netpbm-orig/converter/other/pnmtopng.c netpbm/converter/other/pnmtopng.c ---- netpbm-orig/converter/other/pnmtopng.c 2010-01-22 00:13:48.000000000 -0500 -+++ netpbm/converter/other/pnmtopng.c 2010-01-22 00:21:33.000000000 -0500 -@@ -2641,7 +2641,7 @@ - info_ptr->color_type == PNG_COLOR_TYPE_RGB) { - if (transparent > 0) { - info_ptr->valid |= PNG_INFO_tRNS; -- info_ptr->trans_values = -+ info_ptr->trans_color = - xelToPngColor_16(transcolor, maxval, png_maxval); - } - } else { -@@ -2653,10 +2653,10 @@ - if (info_ptr->valid && PNG_INFO_tRNS) - pm_message("Transparent color {gray, red, green, blue} = " - "{%d, %d, %d, %d}", -- info_ptr->trans_values.gray, -- info_ptr->trans_values.red, -- info_ptr->trans_values.green, -- info_ptr->trans_values.blue); -+ info_ptr->trans_color.gray, -+ info_ptr->trans_color.red, -+ info_ptr->trans_color.green, -+ info_ptr->trans_color.blue); - else - pm_message("No transparent color"); - } -diff -Naur netpbm-orig/converter/other/pngtopnm.c netpbm/converter/other/pngtopnm.c ---- netpbm-orig/converter/other/pngtopnm.c 2010-01-22 00:33:25.000000000 -0500 -+++ netpbm/converter/other/pngtopnm.c 2010-01-22 00:39:21.000000000 -0500 -@@ -569,8 +569,8 @@ - for (i = 0, foundGray = FALSE; - i < info_ptr->num_trans && !foundGray; - ++i) { -- if (info_ptr->trans[i] != 0 && -- info_ptr->trans[i] != maxval) { -+ if (info_ptr->trans_alpha[i] != 0 && -+ info_ptr->trans_alpha[i] != maxval) { - foundGray = TRUE; - } - } -@@ -641,7 +641,7 @@ - unsigned int i; - trans_mix = TRUE; - for (i = 0; i < info_ptr->num_trans; ++i) -- if (info_ptr->trans[i] != 0 && info_ptr->trans[i] != 255) { -+ if (info_ptr->trans_alpha[i] != 0 && info_ptr->trans_alpha[i] != 255) { - trans_mix = FALSE; - break; - } -@@ -1061,7 +1061,7 @@ - setXel(&xelrow[col], fgColor, bgColor, alphaHandling, - (pngxP->info_ptr->valid & PNG_INFO_tRNS) && - index < pngxP->info_ptr->num_trans ? -- pngxP->info_ptr->trans[index] : maxval); -+ pngxP->info_ptr->trans_alpha[index] : maxval); - } - break; - diff --git a/extra/ntfs-3g_ntfsprogs/25-ntfs-config-write-policy.fdi b/extra/ntfs-3g_ntfsprogs/25-ntfs-config-write-policy.fdi deleted file mode 100644 index 54195d8b3..000000000 --- a/extra/ntfs-3g_ntfsprogs/25-ntfs-config-write-policy.fdi +++ /dev/null @@ -1,42 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<deviceinfo version="0.2"> - <device> - <match key="volume.fstype" string="ntfs"> - <append key="volume.fstype.alternative" type="copy_property">volume.fstype</append> - <merge key="volume.mount.ntfs.valid_options" type="copy_property">volume.mount.valid_options</merge> - <merge key="volume.unmount.ntfs.valid_options" type="copy_property">volume.unmount.valid_options</merge> - <merge key="volume.fstype" type="string">ntfs-3g</merge> - <merge key="volume.mount.valid_options" type="strlist">ro</merge> - <append key="volume.mount.valid_options" type="strlist">atime</append> - <append key="volume.mount.valid_options" type="strlist">noatime</append> - <append key="volume.mount.valid_options" type="strlist">relatime</append> - <append key="volume.mount.valid_options" type="strlist">fake_rw</append> - <append key="volume.mount.valid_options" type="strlist">no_def_opts</append> - <append key="volume.mount.valid_options" type="strlist">default_permissions</append> - <append key="volume.mount.valid_options" type="strlist">umask=</append> - <append key="volume.mount.valid_options" type="strlist">fmask=</append> - <append key="volume.mount.valid_options" type="strlist">dmask=</append> - <append key="volume.mount.valid_options" type="strlist">uid=</append> - <append key="volume.mount.valid_options" type="strlist">gid=</append> - <append key="volume.mount.valid_options" type="strlist">show_sys_files</append> - <append key="volume.mount.valid_options" type="strlist">silent</append> - <append key="volume.mount.valid_options" type="strlist">force</append> - <append key="volume.mount.valid_options" type="strlist">remove_hiberfile</append> - <append key="volume.mount.valid_options" type="strlist">locale=</append> - <append key="volume.mount.valid_options" type="strlist">streams_interface=</append> - <append key="volume.mount.valid_options" type="strlist">debug</append> - <append key="volume.mount.valid_options" type="strlist">no_detatch</append> - <append key="volume.mount.valid_options" type="strlist">sync</append> - <append key="volume.mount.valid_options" type="strlist">dirsync</append> - <append key="volume.mount.valid_options" type="strlist">nodiratime</append> - <append key="volume.mount.valid_options" type="strlist">noexec</append> - <append key="volume.mount.valid_options" type="strlist">quiet</append> - <append key="volume.mount.valid_options" type="strlist">remount</append> - <append key="volume.mount.valid_options" type="strlist">exec</append> - <append key="volume.mount.valid_options" type="strlist">recover</append> - <append key="volume.mount.valid_options" type="strlist">norecover</append> - <merge key="volume.unmount.valid_options" type="strlist">lazy</merge> - <merge key="volume.policy.mount_filesystem" type="string">ntfs-3g</merge> - </match> - </device> -</deviceinfo> diff --git a/extra/ntrack/dead-loop-fix.patch b/extra/ntrack/dead-loop-fix.patch deleted file mode 100644 index 133bb4ace..000000000 --- a/extra/ntrack/dead-loop-fix.patch +++ /dev/null @@ -1,14 +0,0 @@ -=== modified file 'modules/ntrack-libnl.c' ---- modules/ntrack-libnl.c 2011-04-25 16:28:19 +0000 -+++ modules/ntrack-libnl.c 2011-04-25 17:25:24 +0000 -@@ -394,6 +394,9 @@ - if (rtnl_link_get_ifindex(link) > iindex) - break; - i = i->next; -+ -+ if (i == linklist) -+ break; - } - return result; - } - diff --git a/extra/openjdk6/glibc2_15.diff b/extra/openjdk6/glibc2_15.diff deleted file mode 100644 index 8fe1b077a..000000000 --- a/extra/openjdk6/glibc2_15.diff +++ /dev/null @@ -1,236 +0,0 @@ -# HG changeset patch -# User never -# Date 1319555835 25200 -# Node ID a6eef545f1a2ceca6aeadf688a965df600ffef28 -# Parent 2ec638646e86e455978c31a9d47fc0ec271ed926 -7103224: collision between __LEAF define in interfaceSupport.hpp and /usr/include/sys/cdefs.h with gcc -Reviewed-by: never -Contributed-by: Omair Majid <omajid@redhat.com> - -diff -r 2ec638646e86 -r a6eef545f1a2 src/share/vm/opto/addnode.cpp ---- openjdk/hotspot/src/share/vm/opto/addnode.cpp Tue Oct 25 04:07:20 2011 -0700 -+++ openjdk/hotspot/src/share/vm/opto/addnode.cpp Tue Oct 25 08:17:15 2011 -0700 -@@ -34,8 +34,6 @@ - - // Portions of code courtesy of Clifford Click - --#define MAXFLOAT ((float)3.40282346638528860e+38) -- - // Classic Add functionality. This covers all the usual 'add' behaviors for - // an algebraic ring. Add-integer, add-float, add-double, and binary-or are - // all inherited from this class. The various identity values are supplied -diff -r 2ec638646e86 -r a6eef545f1a2 src/share/vm/prims/jniCheck.cpp ---- openjdk/hotspot/src/share/vm/prims/jniCheck.cpp Tue Oct 25 04:07:20 2011 -0700 -+++ openjdk/hotspot/src/share/vm/prims/jniCheck.cpp Tue Oct 25 08:17:15 2011 -0700 -@@ -107,7 +107,7 @@ - if (env != xenv) { \ - NativeReportJNIFatalError(thr, warn_wrong_jnienv); \ - } \ -- __ENTRY(result_type, header, thr) -+ VM_ENTRY_BASE(result_type, header, thr) - - - #define UNCHECKED() (unchecked_jni_NativeInterface) -diff -r 2ec638646e86 -r a6eef545f1a2 src/share/vm/prims/jvmtiEnter.xsl ---- openjdk/hotspot/src/share/vm/prims/jvmtiEnter.xsl Tue Oct 25 04:07:20 2011 -0700 -+++ openjdk/hotspot/src/share/vm/prims/jvmtiEnter.xsl Tue Oct 25 08:17:15 2011 -0700 -@@ -426,7 +426,7 @@ - <xsl:value-of select="$space"/> - <xsl:text>ThreadInVMfromNative __tiv(current_thread);</xsl:text> - <xsl:value-of select="$space"/> -- <xsl:text>__ENTRY(jvmtiError, </xsl:text> -+ <xsl:text>VM_ENTRY_BASE(jvmtiError, </xsl:text> - <xsl:apply-templates select="." mode="functionid"/> - <xsl:text> , current_thread)</xsl:text> - <xsl:value-of select="$space"/> -diff -r 2ec638646e86 -r a6eef545f1a2 src/share/vm/prims/jvmtiEnv.cpp ---- openjdk/hotspot/src/share/vm/prims/jvmtiEnv.cpp Tue Oct 25 04:07:20 2011 -0700 -+++ openjdk/hotspot/src/share/vm/prims/jvmtiEnv.cpp Tue Oct 25 08:17:15 2011 -0700 -@@ -173,7 +173,7 @@ - // from native so as to resolve the jthread. - - ThreadInVMfromNative __tiv(current_thread); -- __ENTRY(jvmtiError, JvmtiEnv::GetThreadLocalStorage , current_thread) -+ VM_ENTRY_BASE(jvmtiError, JvmtiEnv::GetThreadLocalStorage , current_thread) - debug_only(VMNativeEntryWrapper __vew;) - - oop thread_oop = JNIHandles::resolve_external_guard(thread); -diff -r 2ec638646e86 -r a6eef545f1a2 src/share/vm/prims/jvmtiExport.cpp ---- openjdk/hotspot/src/share/vm/prims/jvmtiExport.cpp Tue Oct 25 04:07:20 2011 -0700 -+++ openjdk/hotspot/src/share/vm/prims/jvmtiExport.cpp Tue Oct 25 08:17:15 2011 -0700 -@@ -373,7 +373,7 @@ - JavaThread* current_thread = (JavaThread*) ThreadLocalStorage::thread(); - // transition code: native to VM - ThreadInVMfromNative __tiv(current_thread); -- __ENTRY(jvmtiEnv*, JvmtiExport::get_jvmti_interface, current_thread) -+ VM_ENTRY_BASE(jvmtiEnv*, JvmtiExport::get_jvmti_interface, current_thread) - debug_only(VMNativeEntryWrapper __vew;) - - JvmtiEnv *jvmti_env = JvmtiEnv::create_a_jvmti(version); -diff -r 2ec638646e86 -r a6eef545f1a2 src/share/vm/runtime/interfaceSupport.hpp ---- openjdk/hotspot/src/share/vm/runtime/interfaceSupport.hpp Tue Oct 25 04:07:20 2011 -0700 -+++ openjdk/hotspot/src/share/vm/runtime/interfaceSupport.hpp Tue Oct 25 08:17:15 2011 -0700 -@@ -72,9 +72,9 @@ - } - }; - --// InterfaceSupport provides functionality used by the __LEAF and __ENTRY --// macros. These macros are used to guard entry points into the VM and --// perform checks upon leave of the VM. -+// InterfaceSupport provides functionality used by the VM_LEAF_BASE and -+// VM_ENTRY_BASE macros. These macros are used to guard entry points into -+// the VM and perform checks upon leave of the VM. - - - class InterfaceSupport: AllStatic { -@@ -433,7 +433,7 @@ - - // LEAF routines do not lock, GC or throw exceptions - --#define __LEAF(result_type, header) \ -+#define VM_LEAF_BASE(result_type, header) \ - TRACE_CALL(result_type, header) \ - debug_only(NoHandleMark __hm;) \ - /* begin of body */ -@@ -441,7 +441,7 @@ - - // ENTRY routines may lock, GC and throw exceptions - --#define __ENTRY(result_type, header, thread) \ -+#define VM_ENTRY_BASE(result_type, header, thread) \ - TRACE_CALL(result_type, header) \ - HandleMarkCleaner __hm(thread); \ - Thread* THREAD = thread; \ -@@ -450,7 +450,7 @@ - - // QUICK_ENTRY routines behave like ENTRY but without a handle mark - --#define __QUICK_ENTRY(result_type, header, thread) \ -+#define VM_QUICK_ENTRY_BASE(result_type, header, thread) \ - TRACE_CALL(result_type, header) \ - debug_only(NoHandleMark __hm;) \ - Thread* THREAD = thread; \ -@@ -463,20 +463,20 @@ - #define IRT_ENTRY(result_type, header) \ - result_type header { \ - ThreadInVMfromJava __tiv(thread); \ -- __ENTRY(result_type, header, thread) \ -+ VM_ENTRY_BASE(result_type, header, thread) \ - debug_only(VMEntryWrapper __vew;) - - - #define IRT_LEAF(result_type, header) \ - result_type header { \ -- __LEAF(result_type, header) \ -+ VM_LEAF_BASE(result_type, header) \ - debug_only(No_Safepoint_Verifier __nspv(true);) - - - #define IRT_ENTRY_NO_ASYNC(result_type, header) \ - result_type header { \ - ThreadInVMfromJavaNoAsyncException __tiv(thread); \ -- __ENTRY(result_type, header, thread) \ -+ VM_ENTRY_BASE(result_type, header, thread) \ - debug_only(VMEntryWrapper __vew;) - - // Another special case for nmethod_entry_point so the nmethod that the -@@ -487,7 +487,7 @@ - result_type header { \ - nmethodLocker _nmlock(nm); \ - ThreadInVMfromJavaNoAsyncException __tiv(thread); \ -- __ENTRY(result_type, header, thread) -+ VM_ENTRY_BASE(result_type, header, thread) - - #define IRT_END } - -@@ -497,20 +497,20 @@ - #define JRT_ENTRY(result_type, header) \ - result_type header { \ - ThreadInVMfromJava __tiv(thread); \ -- __ENTRY(result_type, header, thread) \ -+ VM_ENTRY_BASE(result_type, header, thread) \ - debug_only(VMEntryWrapper __vew;) - - - #define JRT_LEAF(result_type, header) \ - result_type header { \ -- __LEAF(result_type, header) \ -+ VM_LEAF_BASE(result_type, header) \ - debug_only(JRT_Leaf_Verifier __jlv;) - - - #define JRT_ENTRY_NO_ASYNC(result_type, header) \ - result_type header { \ - ThreadInVMfromJavaNoAsyncException __tiv(thread); \ -- __ENTRY(result_type, header, thread) \ -+ VM_ENTRY_BASE(result_type, header, thread) \ - debug_only(VMEntryWrapper __vew;) - - // Same as JRT Entry but allows for return value after the safepoint -@@ -543,11 +543,11 @@ - assert( !VerifyJNIEnvThread || (thread == Thread::current()), "JNIEnv is only valid in same thread"); \ - ThreadInVMfromNative __tiv(thread); \ - debug_only(VMNativeEntryWrapper __vew;) \ -- __ENTRY(result_type, header, thread) -+ VM_ENTRY_BASE(result_type, header, thread) - - - // Ensure that the VMNativeEntryWrapper constructor, which can cause --// a GC, is called outside the NoHandleMark (set via __QUICK_ENTRY). -+// a GC, is called outside the NoHandleMark (set via VM_QUICK_ENTRY_BASE). - #define JNI_QUICK_ENTRY(result_type, header) \ - extern "C" { \ - result_type JNICALL header { \ -@@ -555,7 +555,7 @@ - assert( !VerifyJNIEnvThread || (thread == Thread::current()), "JNIEnv is only valid in same thread"); \ - ThreadInVMfromNative __tiv(thread); \ - debug_only(VMNativeEntryWrapper __vew;) \ -- __QUICK_ENTRY(result_type, header, thread) -+ VM_QUICK_ENTRY_BASE(result_type, header, thread) - - - #define JNI_LEAF(result_type, header) \ -@@ -563,7 +563,7 @@ - result_type JNICALL header { \ - JavaThread* thread=JavaThread::thread_from_jni_environment(env); \ - assert( !VerifyJNIEnvThread || (thread == Thread::current()), "JNIEnv is only valid in same thread"); \ -- __LEAF(result_type, header) -+ VM_LEAF_BASE(result_type, header) - - - // Close the routine and the extern "C" -@@ -579,7 +579,7 @@ - JavaThread* thread=JavaThread::thread_from_jni_environment(env); \ - ThreadInVMfromNative __tiv(thread); \ - debug_only(VMNativeEntryWrapper __vew;) \ -- __ENTRY(result_type, header, thread) -+ VM_ENTRY_BASE(result_type, header, thread) - - - #define JVM_ENTRY_NO_ENV(result_type, header) \ -@@ -588,7 +588,7 @@ - JavaThread* thread = (JavaThread*)ThreadLocalStorage::thread(); \ - ThreadInVMfromNative __tiv(thread); \ - debug_only(VMNativeEntryWrapper __vew;) \ -- __ENTRY(result_type, header, thread) -+ VM_ENTRY_BASE(result_type, header, thread) - - - #define JVM_QUICK_ENTRY(result_type, header) \ -@@ -597,14 +597,14 @@ - JavaThread* thread=JavaThread::thread_from_jni_environment(env); \ - ThreadInVMfromNative __tiv(thread); \ - debug_only(VMNativeEntryWrapper __vew;) \ -- __QUICK_ENTRY(result_type, header, thread) -+ VM_QUICK_ENTRY_BASE(result_type, header, thread) - - - #define JVM_LEAF(result_type, header) \ - extern "C" { \ - result_type JNICALL header { \ - VM_Exit::block_if_vm_exited(); \ -- __LEAF(result_type, header) -+ VM_LEAF_BASE(result_type, header) - - - #define JVM_END } }
\ No newline at end of file diff --git a/extra/pathological/ChangeLog b/extra/pathological/ChangeLog deleted file mode 100644 index 3cd114178..000000000 --- a/extra/pathological/ChangeLog +++ /dev/null @@ -1,14 +0,0 @@ -2010-08-24 Eric Belanger <eric@archlinux.org> - - * pathological 1.1.3-6 - * Rebuilt against python2 - -2009-07-10 Eric Belanger <eric@archlinux.org> - - * pathological 1.1.3-5 - * Removed binary from /usr/share (close FS#15302) - * Moved saved games to /var - * Fixed segmentation fault - * FHS man pages - * Added docs - * Added ChangeLog diff --git a/extra/pyqt/PKGBUILD b/extra/pyqt/PKGBUILD index e44555352..db25947aa 100644 --- a/extra/pyqt/PKGBUILD +++ b/extra/pyqt/PKGBUILD @@ -1,13 +1,12 @@ -# $Id: PKGBUILD 145605 2011-12-23 14:48:45Z andrea $ -# Maintainer: -# Contributor: Andrea Scarpino <andrea@archlinux.org> +# $Id: PKGBUILD 150176 2012-02-14 07:57:37Z andrea $ +# Maintainer: Andrea Scarpino <andrea@archlinux.org> # Contributor: Douglas Soares de Andrade <douglas@archlinux.org> # Contributor: riai <riai@bigfoot.com> Ben <ben@benmazer.net> pkgbase=pyqt pkgname=('pyqt' 'python2-pyqt') -pkgver=4.9 -pkgrel=2 +pkgver=4.9.1 +pkgrel=1 arch=('i686' 'x86_64' 'mips64el') url="http://riverbankcomputing.co.uk/software/pyqt/intro" license=('GPL') @@ -15,14 +14,15 @@ makedepends=('qt' 'python-sip' 'dbus-python' 'python2-sip' 'phonon' 'python-opengl' 'qt-assistant-compat' 'qtwebkit') source=("http://riverbankcomputing.co.uk/static/Downloads/PyQt4/PyQt-x11-gpl-${pkgver}.tar.gz" 'fix-qthelp-build.patch') -md5sums=('61619500d09d87b6c2a25bd3ea994504' - '356a453331a33c507b1baba4a9771764') +md5sums=('7f495dc49f71e3bfb64bf942e0d8bb3c' + '6acfe0a5a00779f946c29d5fac647ce1') build() { - cd "${srcdir}" - - patch -p0 -i "${srcdir}"/fix-qthelp-build.patch + # Build QtHelp (FS#27665) + cd "${srcdir}"/PyQt-x11-gpl-${pkgver} + patch -p1 -i "${srcdir}"/fix-qthelp-build.patch + cd "${srcdir}" cp -r PyQt-x11-gpl-${pkgver} Py2Qt-x11-gpl-${pkgver} cd "${srcdir}/PyQt-x11-gpl-${pkgver}" diff --git a/extra/pyqt/fix-qthelp-build.patch b/extra/pyqt/fix-qthelp-build.patch index cd565e646..6055f9f35 100644 --- a/extra/pyqt/fix-qthelp-build.patch +++ b/extra/pyqt/fix-qthelp-build.patch @@ -1,6 +1,6 @@ ---- PyQt-x11-gpl-4.9/configure.py~ 2011-12-23 14:53:07.981490550 +0100 -+++ PyQt-x11-gpl-4.9/configure.py 2011-12-23 14:52:38.384984221 +0100 -@@ -1264,7 +1264,7 @@ +--- PyQt-x11-gpl-4.9.1/configure.py~ 2012-02-13 20:16:11.418786488 +0000 ++++ PyQt-x11-gpl-4.9.1/configure.py 2012-02-13 20:16:50.561809527 +0000 +@@ -1261,7 +1261,7 @@ opengl = (mname == "QtOpenGL") qt = [mname] diff --git a/extra/qt3/mysql.patch b/extra/qt3/mysql.patch deleted file mode 100644 index 5f61edc67..000000000 --- a/extra/qt3/mysql.patch +++ /dev/null @@ -1,47 +0,0 @@ ---- src/sql/drivers/mysql/qsql_mysql.cpp -+++ src/sql/drivers/mysql/qsql_mysql.cpp -@@ -37,7 +37,6 @@ - #include "qsql_mysql.h" - #include <private/qsqlextension_p.h> - --#include <qapplication.h> - #include <qdatetime.h> - #include <qvaluevector.h> - #include <qsqlrecord.h> -@@ -341,14 +340,6 @@ int QMYSQLResult::numRowsAffected() - } - - ///////////////////////////////////////////////////////// --static void qServerEnd() --{ --#ifndef Q_NO_MYSQL_EMBEDDED --# if MYSQL_VERSION_ID >= 40000 -- mysql_server_end(); --# endif // MYSQL_VERSION_ID --#endif // Q_NO_MYSQL_EMBEDDED --} - - static void qServerInit() - { -@@ -366,9 +357,7 @@ static void qServerInit() - qWarning( "QMYSQLDriver::qServerInit: unable to start server." ); - # endif - } -- qAddPostRoutine(qServerEnd); - init = TRUE; -- - # endif // MYSQL_VERSION_ID - #endif // Q_NO_MYSQL_EMBEDDED - } -@@ -411,6 +400,11 @@ QMYSQLDriver::~QMYSQLDriver() - QSqlOpenExtension *ext = qSqlOpenExtDict()->take( this ); - delete ext; - } -+#ifndef Q_NO_MYSQL_EMBEDDED -+# if MYSQL_VERSION_ID > 40000 -+ mysql_server_end(); -+# endif -+#endif - } - - bool QMYSQLDriver::hasFeature( DriverFeature f ) const diff --git a/extra/qt3/qt-font-default-subst.diff b/extra/qt3/qt-font-default-subst.diff deleted file mode 100644 index 3e286f74e..000000000 --- a/extra/qt3/qt-font-default-subst.diff +++ /dev/null @@ -1,77 +0,0 @@ ---- src/kernel/qfontdatabase_x11.cpp -+++ src/kernel/qfontdatabase_x11.cpp -@@ -1589,15 +1589,6 @@ QFontEngine *loadEngine( QFont::Script s - if (script == QFont::Latin) - // add Euro character - FcCharSetAddChar(cs, 0x20ac); -- if (script == QFont::Han_SimplifiedChinese) -- FcCharSetAddChar(cs, 0x3400); -- if (script == QFont::Han_TraditionalChinese){ -- FcCharSetAddChar(cs, 0x3435); -- FcCharSetAddChar(cs, 0xE000); -- FcCharSetAddChar(cs, 0xF6B1); -- } -- if (script == QFont::MiscellaneousSymbols) -- FcCharSetAddChar(cs, 0x2714); - FcPatternAddCharSet(pattern, FC_CHARSET, cs); - FcCharSetDestroy(cs); - } -@@ -1813,7 +1804,11 @@ static QFontEngine *loadFontConfigFont(c - FcPatternPrint(pattern); - #endif - -+ // XftFontMatch calls the right ConfigSubstitute variants, but as we use -+ // FcFontMatch/Sort here we have to do it manually. - FcConfigSubstitute(0, pattern, FcMatchPattern); -+ XftDefaultSubstitute(QPaintDevice::x11AppDisplay(), QPaintDevice::x11AppScreen(), pattern); -+ - // qDebug("1: pattern contains:"); - // FcPatternPrint(pattern); - -@@ -1847,10 +1842,6 @@ static QFontEngine *loadFontConfigFont(c - value.u.s = (const FcChar8 *)cs.data(); - FcPatternAddWeak(pattern, FC_FAMILY, value, FcTrue); - } --#ifdef FONT_MATCH_DEBUG -- printf("final pattern contains:\n"); -- FcPatternPrint(pattern); --#endif - } - - if (script != QFont::Unicode) { -@@ -1860,19 +1851,15 @@ static QFontEngine *loadFontConfigFont(c - if (script == QFont::Latin) - // add Euro character - FcCharSetAddChar(cs, 0x20ac); -- if (script == QFont::Han_SimplifiedChinese) -- FcCharSetAddChar(cs, 0x3400); -- if (script == QFont::Han_TraditionalChinese) { -- FcCharSetAddChar(cs, 0x3435); -- FcCharSetAddChar(cs, 0xE000); -- FcCharSetAddChar(cs, 0xF6B1); -- } -- if (script == QFont::MiscellaneousSymbols) -- FcCharSetAddChar(cs, 0x2714); - FcPatternAddCharSet(pattern, FC_CHARSET, cs); - FcCharSetDestroy(cs); - } - -+#ifdef FONT_MATCH_DEBUG -+ printf("final pattern contains:\n"); -+ FcPatternPrint(pattern); -+#endif -+ - QFontEngine *fe = 0; - - for( int jj = (FcGetVersion() >= 20392 ? 0 : 1); jj < 2; ++jj ) { ---- src/kernel/qfontdatabase.cpp -+++ src/kernel/qfontdatabase.cpp -@@ -554,7 +554,7 @@ static const unsigned short sample_chars - // GeometricSymbols, - { 0x2500, 0x0 }, - // MiscellaneousSymbols, -- { 0x2640, 0x0 }, -+ { 0x2640, 0x2714, 0x0 }, - // EnclosedAndSquare, - { 0x2460, 0x0 }, - // Braille, diff --git a/extra/qt3/qt3-png14.patch b/extra/qt3/qt3-png14.patch deleted file mode 100644 index e8a194529..000000000 --- a/extra/qt3/qt3-png14.patch +++ /dev/null @@ -1,33 +0,0 @@ ---- src/kernel/qpngio.cpp.orig 2010-01-16 22:02:41.000000000 +0100 -+++ src/kernel/qpngio.cpp 2010-01-16 22:03:56.000000000 +0100 -@@ -159,7 +159,7 @@ - image.setColor( i, qRgba(c,c,c,0xff) ); - } - if ( png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS) ) { -- const int g = info_ptr->trans_values.gray; -+ const int g = info_ptr->trans_color.gray; - if (g < ncols) { - image.setAlphaBuffer(TRUE); - image.setColor(g, image.color(g) & RGB_MASK); -@@ -187,7 +187,7 @@ - info_ptr->palette[i].red, - info_ptr->palette[i].green, - info_ptr->palette[i].blue, -- info_ptr->trans[i] -+ info_ptr->trans_alpha[i] - ) - ); - i++; -@@ -321,9 +321,9 @@ - png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS) - if (image.depth()==32 && png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) { - QRgb trans = 0xFF000000 | qRgb( -- (info_ptr->trans_values.red << 8 >> bit_depth)&0xff, -- (info_ptr->trans_values.green << 8 >> bit_depth)&0xff, -- (info_ptr->trans_values.blue << 8 >> bit_depth)&0xff); -+ (info_ptr->trans_color.red << 8 >> bit_depth)&0xff, -+ (info_ptr->trans_color.green << 8 >> bit_depth)&0xff, -+ (info_ptr->trans_color.blue << 8 >> bit_depth)&0xff); - for (uint y=0; y<height; y++) { - for (uint x=0; x<info_ptr->width; x++) { - if (((uint**)jt)[y][x] == trans) { diff --git a/extra/qt3/utf8-bug-qt3.diff b/extra/qt3/utf8-bug-qt3.diff deleted file mode 100644 index 43e84a99f..000000000 --- a/extra/qt3/utf8-bug-qt3.diff +++ /dev/null @@ -1,101 +0,0 @@ ---- src/codecs/qutfcodec.cpp -+++ src/codecs/qutfcodec.cpp -@@ -154,6 +154,7 @@ - - class QUtf8Decoder : public QTextDecoder { - uint uc; -+ uint min_uc; - int need; - bool headerDone; - public: -@@ -167,8 +168,9 @@ - result.setLength( len ); // worst case - QChar *qch = (QChar *)result.unicode(); - uchar ch; -+ int error = -1; - for (int i=0; i<len; i++) { -- ch = *chars++; -+ ch = chars[i]; - if (need) { - if ( (ch&0xc0) == 0x80 ) { - uc = (uc << 6) | (ch & 0x3f); -@@ -182,6 +184,8 @@ - *qch++ = QChar(high); - *qch++ = QChar(low); - headerDone = TRUE; -+ } else if ((uc < min_uc) || (uc >= 0xd800 && uc <= 0xdfff) || (uc >= 0xfffe)) { -+ *qch++ = QChar::replacement; - } else { - if (headerDone || QChar(uc) != QChar::byteOrderMark) - *qch++ = uc; -@@ -190,6 +194,7 @@ - } - } else { - // error -+ i = error; - *qch++ = QChar::replacement; - need = 0; - } -@@ -200,12 +205,21 @@ - } else if ((ch & 0xe0) == 0xc0) { - uc = ch & 0x1f; - need = 1; -+ error = i; -+ min_uc = 0x80; - } else if ((ch & 0xf0) == 0xe0) { - uc = ch & 0x0f; - need = 2; -+ error = i; -+ min_uc = 0x800; - } else if ((ch&0xf8) == 0xf0) { - uc = ch & 0x07; - need = 3; -+ error = i; -+ min_uc = 0x10000; -+ } else { -+ // error -+ *qch++ = QChar::replacement; - } - } - } ---- src/tools/qstring.cpp -+++ src/tools/qstring.cpp -@@ -5805,6 +5805,7 @@ - result.setLength( len ); // worst case - QChar *qch = (QChar *)result.unicode(); - uint uc = 0; -+ uint min_uc = 0; - int need = 0; - int error = -1; - uchar ch; -@@ -5822,6 +5823,12 @@ - unsigned short low = uc%0x400 + 0xdc00; - *qch++ = QChar(high); - *qch++ = QChar(low); -+ } else if (uc < min_uc || (uc >= 0xd800 && uc <= 0xdfff) || (uc >= 0xfffe)) { -+ // overlong seqence, UTF16 surrogate or BOM -+ i = error; -+ qch = addOne(qch, result); -+ *qch++ = QChar(0xdbff); -+ *qch++ = QChar(0xde00+((uchar)utf8[i])); - } else { - *qch++ = uc; - } -@@ -5844,14 +5851,17 @@ - uc = ch & 0x1f; - need = 1; - error = i; -+ min_uc = 0x80; - } else if ((ch & 0xf0) == 0xe0) { - uc = ch & 0x0f; - need = 2; - error = i; -+ min_uc = 0x800; - } else if ((ch&0xf8) == 0xf0) { - uc = ch & 0x07; - need = 3; - error = i; -+ min_uc = 0x10000; - } else { - // Error - qch = addOne(qch, result); diff --git a/extra/scim-pinyin/scim-pinyin-0.5.91-cannot-build-against-scim-1.4.7 b/extra/scim-pinyin/scim-pinyin-0.5.91-cannot-build-against-scim-1.4.7 deleted file mode 100644 index 30a556acf..000000000 --- a/extra/scim-pinyin/scim-pinyin-0.5.91-cannot-build-against-scim-1.4.7 +++ /dev/null @@ -1,3 +0,0 @@ -if /bin/sh ../libtool --silent --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I. -I.. -I.. -I../src -I/opt/kde/include -I/opt/qt/include -I. -I/opt/kde/include/skim -I/usr/include/scim-1.0 -DQT_THREAD_SUPPORT -D_REENTRANT -Wnon-virtual-dtor -Wno-long-long -Wundef -ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wconversion -Wchar-subscripts -Wall -W -Wpointer-arith -Wwrite-strings -O2 -march=i686 -mtune=generic -O2 -pipe -Wformat-security -Wmissing-format-attribute -fno-exceptions -fno-check-new -fno-common -MT smartpinyinui.lo -MD -MP -MF ".deps/smartpinyinui.Tpo" -c -o smartpinyinui.lo smartpinyinui.cpp; \ - then mv -f ".deps/smartpinyinui.Tpo" ".deps/smartpinyinui.Plo"; else rm -f ".deps/smartpinyinui.Tpo"; exit 1; fi -smartpinyinui.cpp:26:36: error: skimeditshortcutbutton.h: No such file or directory diff --git a/extra/scim-pinyin/scim-pinyin-0.5.91-gcc43.patch b/extra/scim-pinyin/scim-pinyin-0.5.91-gcc43.patch deleted file mode 100644 index 91a948d5d..000000000 --- a/extra/scim-pinyin/scim-pinyin-0.5.91-gcc43.patch +++ /dev/null @@ -1,44 +0,0 @@ -diff -up scim-pinyin-0.5.91/src/scim_phrase.cpp.gcc43 scim-pinyin-0.5.91/src/scim_phrase.cpp ---- scim-pinyin-0.5.91/src/scim_phrase.cpp.gcc43 2008-02-25 16:27:05.000000000 +0800 -+++ scim-pinyin-0.5.91/src/scim_phrase.cpp 2008-02-25 16:26:41.000000000 +0800 -@@ -28,6 +28,7 @@ - #define SCIM_PHRASE_MAX_RELATION 1000 - - #include <scim.h> -+#include <cstring> - #include "scim_pinyin_private.h" - #include "scim_phrase.h" - -diff -up scim-pinyin-0.5.91/src/scim_special_table.cpp.gcc43 scim-pinyin-0.5.91/src/scim_special_table.cpp ---- scim-pinyin-0.5.91/src/scim_special_table.cpp.gcc43 2008-02-25 16:27:55.000000000 +0800 -+++ scim-pinyin-0.5.91/src/scim_special_table.cpp 2008-02-25 16:28:08.000000000 +0800 -@@ -22,6 +22,7 @@ - - #include <time.h> - #include <scim.h> -+#include <cstring> - #include "scim_pinyin_private.h" - #include "scim_special_table.h" - -diff -up scim-pinyin-0.5.91/src/scim_pinyin.cpp.gcc43 scim-pinyin-0.5.91/src/scim_pinyin.cpp ---- scim-pinyin-0.5.91/src/scim_pinyin.cpp.gcc43 2008-02-25 16:26:10.000000000 +0800 -+++ scim-pinyin-0.5.91/src/scim_pinyin.cpp 2008-02-25 16:26:26.000000000 +0800 -@@ -29,6 +29,7 @@ - #define Uses_SCIM_LOOKUP_TABLE - - #include <scim.h> -+#include <cstring> - #include "scim_pinyin.h" - - // Internal functions -diff -up scim-pinyin-0.5.91/src/scim_pinyin_phrase.cpp.gcc43 scim-pinyin-0.5.91/src/scim_pinyin_phrase.cpp ---- scim-pinyin-0.5.91/src/scim_pinyin_phrase.cpp.gcc43 2008-02-25 16:27:15.000000000 +0800 -+++ scim-pinyin-0.5.91/src/scim_pinyin_phrase.cpp 2008-02-25 16:27:28.000000000 +0800 -@@ -27,6 +27,7 @@ - #define Uses_SCIM_LOOKUP_TABLE - - #include <scim.h> -+#include <cstring> - #include "scim_pinyin_private.h" - #include "scim_phrase.h" - #include "scim_pinyin.h" diff --git a/extra/scim-uim/uim-1.5.5-header.diff b/extra/scim-uim/uim-1.5.5-header.diff deleted file mode 100644 index 0e6565827..000000000 --- a/extra/scim-uim/uim-1.5.5-header.diff +++ /dev/null @@ -1,13 +0,0 @@ ---- scim-uim-0.2.0.orig/src/scim_uim_imengine.cpp -+++ scim-uim-0.2.0/src/scim_uim_imengine.cpp -@@ -34,7 +34,8 @@ - - #include <scim.h> - #include "scim_uim_imengine.h" --#include <uim/uim-compat-scm.h> -+#include <uim/uim-scm.h> -+#include <uim/uim-util.h> - - #define scim_module_init uim_LTX_scim_module_init - #define scim_module_exit uim_LTX_scim_module_exit - diff --git a/extra/sip/PKGBUILD b/extra/sip/PKGBUILD index 9b061a986..0dd0920a3 100644 --- a/extra/sip/PKGBUILD +++ b/extra/sip/PKGBUILD @@ -1,19 +1,18 @@ -# $Id: PKGBUILD 145600 2011-12-23 10:58:52Z andrea $ -# Maintainer: -# Contributor: Andrea Scarpino <andrea@archlinux.org> +# $Id: PKGBUILD 150174 2012-02-14 07:57:34Z andrea $ +# Maintainer: Andrea Scarpino <andrea@archlinux.org> # Contributor: Douglas Soares de Andrade <douglas@archlinux.org> # Contributor: riai <riai@bigfoot.com>, Ben <ben@benmazer.net> pkgbase=sip pkgname=('sip' 'python2-sip') -pkgver=4.13.1 +pkgver=4.13.2 pkgrel=1 arch=('i686' 'x86_64' 'mips64el') url="http://www.riverbankcomputing.com/software/sip/" license=('custom:"sip"') makedepends=('python' 'python2') source=("http://www.riverbankcomputing.com/static/Downloads/sip4/${pkgbase}-${pkgver}.tar.gz") -md5sums=('3f61fd39d5b0c8fa9e43b59af04de924') +md5sums=('5a12ea8e8a09b879ed2b3817e30fbc84') build() { cd "${srcdir}" diff --git a/extra/slim/gcc44.patch b/extra/slim/gcc44.patch deleted file mode 100644 index 390ea8a86..000000000 --- a/extra/slim/gcc44.patch +++ /dev/null @@ -1,11 +0,0 @@ -diff -aur slim-1.3.2/switchuser.h slim-1.3.2.a/switchuser.h ---- slim-1.3.2/switchuser.h 2010-07-08 07:04:10.000000000 +0200 -+++ slim-1.3.2.a/switchuser.h 2010-08-21 15:10:34.306212393 +0200 -@@ -13,6 +13,7 @@ - #define _SWITCHUSER_H_ - - #include <stdlib.h> -+#include <stdio.h> /* remove */ - #include <unistd.h> - #include <string.h> - #include <pwd.h> diff --git a/extra/spassgen/PKGBUILD b/extra/spassgen/PKGBUILD deleted file mode 100644 index 653a51f57..000000000 --- a/extra/spassgen/PKGBUILD +++ /dev/null @@ -1,27 +0,0 @@ -# $Id: PKGBUILD 77993 2010-04-19 08:07:51Z dgriffiths $ -# Maintainer : Tobias Powalowski <tpowa@archlinux.org> - -pkgname=spassgen -pkgver=1.5 -pkgrel=7 -pkgdesc="A small program that generates passwords" -arch=(i686 x86_64) -url="http://spassgen.sourceforge.net/" -license=('GPL2') -depends=('qt3') -options=('!makeflags') -source=(http://downloads.sourceforge.net/sourceforge/${pkgname}/${pkgname}-${pkgver}.tar.bz2) -md5sums=('ed019dda56551fb860c74016baa91fa4') - -build() { - cd ${srcdir}/${pkgname} - . /etc/profile.d/qt3.sh - qmake -project spassgen.pro || return 1 - qmake || return 1 - make || return 1 - install -d ${pkgdir}/opt/kde/{bin,share/icons/crystalsvg} - install -m755 spassgen ${pkgdir}/opt/kde/bin/spassgen || return 1 - cd icons - cp -r * ${pkgdir}/opt/kde/share/icons/crystalsvg || return 1 - rm -r ${pkgdir}/opt/kde/share/icons/crystalsvg/16x16/.xvpics - } diff --git a/extra/transfig/ChangeLog b/extra/transfig/ChangeLog deleted file mode 100644 index c303c33c0..000000000 --- a/extra/transfig/ChangeLog +++ /dev/null @@ -1,36 +0,0 @@ -2010-05-26 Jan de Groot <jgc@archlinux.org> - * transfig 3.2.5c-3 - * Rebuilt for libpng 1.4.2, png_set_dither has been renamed - -2010-01-27 Eric Belanger <eric@archlinux.org> - - * transfig 3.2.5c-2 - * Rebuilt for libpng 1.4 and libjpeg 8 - -2010-01-11 Eric Belanger <eric@archlinux.org> - - * transfig 3.2.5c-1 - * Upstream update - * Removed force option - -2009-08-12 Eric Belanger <eric@archlinux.org> - - * transfig 3.2.5a-1 - * Upstream update - * Added force option - -2009-03-21 Eric Belanger <eric@archlinux.org> - - * transfig 3.2.5-2 - * Removed uneeded stderr message (close FS#13825) - -2008-12-14 Eric Belanger <eric@archlinux.org> - - * transfig 3.2.5-1 - * Upstream update - * Added arch tag - * Added license - * Added imake makedepends - * Added man pages - * Removed old patches - * Added ChangeLog diff --git a/extra/uim/PKGBUILD b/extra/uim/PKGBUILD index 5d26828ed..a15264513 100644 --- a/extra/uim/PKGBUILD +++ b/extra/uim/PKGBUILD @@ -1,14 +1,14 @@ -# $Id: PKGBUILD 146641 2012-01-15 08:38:24Z bisson $ +# $Id: PKGBUILD 150199 2012-02-14 13:39:03Z bisson $ # Maintainer: Gaetan Bisson <bisson@archlinux.org> # Contributor: damir <damir@archlinux.org> pkgname=uim -pkgver=1.7.2 +pkgver=1.7.3 pkgrel=1 pkgdesc='Multilingual input method library' -arch=('i686' 'x86_64' 'mips64el') url='http://code.google.com/p/uim/' license=('custom:BSD') +arch=('i686' 'x86_64' 'mips64el') depends=('libxft' 'libedit' 'anthy' 'm17n-lib') makedepends=('intltool' 'gettext' 'qt' 'gtk2' 'gtk3' 'gnome-panel') optdepends=('qt: immodule and helper applications' @@ -16,8 +16,8 @@ optdepends=('qt: immodule and helper applications' 'gtk3: immodules and helper applications' 'gnome-panel: gnome applet indicator') options=('!libtool') -source=("http://uim.googlecode.com/files/${pkgname}-${pkgver}.tar.bz2") -sha1sums=('4982178aca6ee1ae775fc2a9b4bbb7a66e97cbd4') +source=("http://uim.googlecode.com/files/${pkgname}-${pkgver}.tar.gz") +sha1sums=('1c7bb8c6c475dcbc4768bcabac540c42ccfd8185') install=install diff --git a/extra/vorbis-tools/ChangeLog b/extra/vorbis-tools/ChangeLog deleted file mode 100644 index 54e3adcb8..000000000 --- a/extra/vorbis-tools/ChangeLog +++ /dev/null @@ -1,26 +0,0 @@ -2010-04-10 Andrea Scarpino <andrea@archlinux.org> - - * vorbis-tools 1.4.0-2 - * libao 1.0 rebuild - -2010-04-10 Andrea Scarpino <andrea@archlinux.org> - - * vorbis-tools 1.4.0-1 - * Upstream release - -2009-10-04 Eric Belanger <eric@archlinux.org> - - * vorbis-tools 1.2.0-4 - * Added vcut tool (close FS#14749) - * Fixed license - -2008-03-15 Travis Willard <travis@archlinux.org> - - * vorbis-tools 1.2.0-3 - * Removed explicit /usr/man usage - -2008-03-15 Travis Willard <travis@archlinux.org> - - * vorbis-tools 1.2.0-1 - * New upstream release. - * Added ChangeLog diff --git a/extra/wesnoth/PKGBUILD b/extra/wesnoth/PKGBUILD deleted file mode 100644 index b8fc20c81..000000000 --- a/extra/wesnoth/PKGBUILD +++ /dev/null @@ -1,47 +0,0 @@ -# $Id: PKGBUILD 148958 2012-02-05 11:57:49Z ibiru $ -# Maintainer: Jan de Groot <jgc@archlinux.org> -# Contributor: Tobias Powalowski <tpowa@archlinux.org> -# Contributor: Jacobo Arvelo <unix4all@ya.com> -# Contributor: Douglas Soares de Andrade <douglas@archlinux.org> - -pkgname=wesnoth -pkgver=1.8.6 -pkgrel=4 -pkgdesc="A turn-based strategy game on a fantasy world" -arch=('i686' 'x86_64' 'mips64el') -license=('GPL') -url="http://www.wesnoth.org/" -depends=('sdl_ttf' 'sdl_net' 'sdl_mixer' 'sdl_image' 'fribidi' 'boost-libs' 'pango' 'lua' "wesnoth-data=${pkgver}" 'dbus-core' 'python2') -makedepends=('boost') -install=wesnoth.install -options=(!emptydirs) -source=(http://downloads.sourceforge.net/sourceforge/$pkgname/$pkgname-$pkgver.tar.bz2 - wesnoth-libpng-1.4.0.patch - wesnoth-1.8.6-boost-foreach.patch - wesnoth.tmpfiles.conf) -md5sums=('f1c3179869b01b61e253e74aeb241034' - '3b0d2edcb45e8ecc8c790f92bdcb0087' - 'dc414ab7e1334941548e9db6db9c2460' - 'b8122f5054e3895c9c054e87460869dc') - -build() { - cd "$srcdir/$pkgname-$pkgver" - patch -Np1 -i "$srcdir/wesnoth-libpng-1.4.0.patch" - patch -Np1 -i "$srcdir/wesnoth-1.8.6-boost-foreach.patch" - ./autogen.sh - ./configure --prefix=/usr --localstatedir=/var --enable-tools \ - --enable-editor --enable-server --with-fifodir=/run/wesnothd - make -} - -package() { - cd "$srcdir/$pkgname-$pkgver" - make DESTDIR="$pkgdir" install-exec - install -dm755 "$pkgdir/usr/lib/tmpfiles.d/" - install -m644 "$srcdir/wesnoth.tmpfiles.conf" "$pkgdir/usr/lib/tmpfiles.d/wesnoth.conf" - - sed -i "s|#!/usr/bin/env python|#!/usr/bin/env python2|" "$pkgdir/usr/bin/wesnoth_addon_manager" - sed -i "s|#!/usr/bin/env python|#!/usr/bin/env python2|" "$pkgdir/usr/bin/wmlindent" - sed -i "s|#!/usr/bin/env python|#!/usr/bin/env python2|" "$pkgdir/usr/bin/wmlscope" - sed -i "s|#!/usr/bin/env python|#!/usr/bin/env python2|" "$pkgdir/usr/bin/wmllint" -} diff --git a/extra/wesnoth/wesnoth-1.8.6-boost-foreach.patch b/extra/wesnoth/wesnoth-1.8.6-boost-foreach.patch deleted file mode 100644 index 5aee3118c..000000000 --- a/extra/wesnoth/wesnoth-1.8.6-boost-foreach.patch +++ /dev/null @@ -1,70 +0,0 @@ ---- wesnoth-1.8.6/src/gui/widgets/tree_view_node.cpp~ 2011-07-21 23:05:56.594879049 +0200 -+++ wesnoth-1.8.6/src/gui/widgets/tree_view_node.cpp 2011-07-21 23:28:07.540358742 +0200 -@@ -238,6 +238,17 @@ void ttree_view_node::clear() - - struct ttree_view_node_implementation - { -+ template<class W, class It> -+ static W* find_at_aux(It begin, It end, -+ const tpoint& coordinate, const bool must_be_active) { -+ for (It it = begin; it != end; ++it) { -+ if(W* widget = it->find_at(coordinate, must_be_active)) { -+ return widget; -+ } -+ } -+ return NULL; -+ } -+ - template<class W> - static W* find_at( - typename tconst_duplicator<W, ttree_view_node>::type& -@@ -255,13 +266,9 @@ struct ttree_view_node_implementation - } - - typedef typename tconst_duplicator<W, ttree_view_node>::type thack; -- foreach(thack& node, tree_view_node.children_) { -- if(W* widget = node.find_at(coordinate, must_be_active)) { -- return widget; -- } -- } -- -- return NULL; -+ return find_at_aux<W>(tree_view_node.children_.begin(), -+ tree_view_node.children_.end(), -+ coordinate, must_be_active); - } - }; - -@@ -313,7 +320,9 @@ tpoint ttree_view_node::get_current_size - return size; - } - -- foreach(const ttree_view_node& node, children_) { -+ for (boost::ptr_vector<ttree_view_node>::const_iterator it -+ = children_.begin (); it != children_.end (); ++it) { -+ const ttree_view_node& node = *it; - - if(node.grid_.get_visible() == twidget::INVISIBLE) { - continue; -@@ -344,7 +353,9 @@ tpoint ttree_view_node::get_unfolded_siz - size.x += (get_indention_level() - 1) * tree_view().indention_step_size_; - } - -- foreach(const ttree_view_node& node, children_) { -+ for (boost::ptr_vector<ttree_view_node>::const_iterator it -+ = children_.begin (); it != children_.end (); ++it) { -+ const ttree_view_node& node = *it; - - if(node.grid_.get_visible() == twidget::INVISIBLE) { - continue; -@@ -378,7 +389,9 @@ tpoint ttree_view_node::calculate_best_s - - DBG_GUI_L << LOG_HEADER << " own grid best size " << best_size << ".\n"; - -- foreach(const ttree_view_node& node, children_) { -+ for (boost::ptr_vector<ttree_view_node>::const_iterator it -+ = children_.begin (); it != children_.end (); ++it) { -+ const ttree_view_node& node = *it; - - if(node.grid_.get_visible() == twidget::INVISIBLE) { - continue; diff --git a/extra/wesnoth/wesnoth-libpng-1.4.0.patch b/extra/wesnoth/wesnoth-libpng-1.4.0.patch deleted file mode 100644 index 338f467af..000000000 --- a/extra/wesnoth/wesnoth-libpng-1.4.0.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff -Nur wesnoth-1.8.orig/src/tools/exploder_utils.cpp wesnoth-1.8/src/tools/exploder_utils.cpp ---- wesnoth-1.8.orig/src/tools/exploder_utils.cpp 2010-01-01 15:16:49.000000000 +0200 -+++ wesnoth-1.8/src/tools/exploder_utils.cpp 2010-04-08 17:38:03.066201123 +0300 -@@ -174,8 +174,8 @@ - //TODO: review whether providing NULL error handlers is something - //sensible - png_struct* png_ptr = png_create_write_struct -- (PNG_LIBPNG_VER_STRING, reinterpret_cast<png_voidp>(png_voidp_NULL), -- png_error_ptr_NULL, png_error_ptr_NULL); -+ (PNG_LIBPNG_VER_STRING, reinterpret_cast<png_voidp>(NULL), -+ NULL, NULL); - if(!png_ptr) - throw exploder_failure("Unable to initialize the png write structure"); - ---- wesnoth-1.8.orig/src/tools/exploder_utils.cpp.libpng 2011-11-06 14:44:26.618711420 -0600 -+++ wesnoth-1.8/src/tools/exploder_utils.cpp 2011-11-06 14:57:12.150006511 -0600 -@@ -15,6 +15,7 @@ - #include "exploder_utils.hpp" - #include "game_config.hpp" - #include "serialization/string_utils.hpp" -+#include <zlib.h> - #include <png.h> - - exploder_point::exploder_point(const std::string &s) diff --git a/extra/wesnoth/wesnoth.install b/extra/wesnoth/wesnoth.install deleted file mode 100644 index 4f1e419ae..000000000 --- a/extra/wesnoth/wesnoth.install +++ /dev/null @@ -1,9 +0,0 @@ -# arg 1: the new package version -post_install() { -cat << EOF -Note: -==> If you experience sound problems try setting your SDL_AUDIODRIVER environment variable to "dma" -==> eg. export SDL_AUDIODRIVER="dma" ; wesnoth -==> If "dma" doesn't work,other options are: dsp,alsa,artsc,esd,nas try to find the right output. -EOF -} diff --git a/extra/wesnoth/wesnoth.tmpfiles.conf b/extra/wesnoth/wesnoth.tmpfiles.conf deleted file mode 100644 index 3ec0f6013..000000000 --- a/extra/wesnoth/wesnoth.tmpfiles.conf +++ /dev/null @@ -1 +0,0 @@ -D /run/wesnothd 0700 root root - diff --git a/extra/windowmaker/PKGBUILD b/extra/windowmaker/PKGBUILD index 06f438f92..31389560e 100644 --- a/extra/windowmaker/PKGBUILD +++ b/extra/windowmaker/PKGBUILD @@ -1,8 +1,8 @@ -# $Id: PKGBUILD 149306 2012-02-06 18:35:19Z daniel $ +# $Id: PKGBUILD 150208 2012-02-14 20:50:29Z daniel $ # Maintainer: Daniel Isenmann <daniel@archlinux.org> # Contributor: Judd Vinet <jvinet@zeroflux.org> pkgname=windowmaker -pkgver=0.95.1 +pkgver=0.95.2 pkgrel=1 pkgdesc="An X11 window manager with a NEXTSTEP look and feel" arch=(i686 x86_64 'mips64el') @@ -10,14 +10,13 @@ url="http://www.windowmaker.org/" license=('GPL' 'custom') depends=('libxinerama' 'libxrandr' 'libxmu' 'libpng' 'libxpm' 'libxft' 'libtiff' 'giflib') options=('!libtool') -source=(ftp://ftp.archlinux.org/other/windowmaker/windowmaker-$pkgver.tar.gz wmaker.desktop) -md5sums=('1b0d0aa2ac53a7a98ef80a35e507b082' +source=(http://windowmaker.org/pub/source/release/WindowMaker-$pkgver.tar.gz wmaker.desktop) +md5sums=('ae62bad9c4dee504066e0f172b565ff0' '2fba97bebfd691836b92b8f0db79ff13') build() { - cd $srcdir/windowmaker-$pkgver + cd $srcdir/WindowMaker-$pkgver [ -z "$LINGUAS" ] && export LINGUAS="`ls po/*.po | sed 's:po/\(.*\)\.po$:\1:'`" - ./autogen.sh ./configure --prefix=/usr --sysconfdir=/etc --enable-xinerama \ --with-nlsdir=/usr/share/locale --with-gnustepdir=/usr/lib/GNUstep \ --enable-usermenu --enable-modelock --enable-xrandr @@ -25,7 +24,7 @@ build() { } package() { - cd $srcdir/windowmaker-$pkgver + cd $srcdir/WindowMaker-$pkgver make DESTDIR=$pkgdir install install -D -m644 COPYING.WTFPL $pkgdir/usr/share/licenses/$pkgname/COPYING.WTFPL diff --git a/extra/xaw3d/LICENSE b/extra/xaw3d/LICENSE deleted file mode 100644 index 395de2d9b..000000000 --- a/extra/xaw3d/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 1989 X Consortium - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of the X Consortium shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from the X Consortium. diff --git a/extra/xaw3d/Xaw3d-1.5-box.c.patch b/extra/xaw3d/Xaw3d-1.5-box.c.patch deleted file mode 100644 index 252238af8..000000000 --- a/extra/xaw3d/Xaw3d-1.5-box.c.patch +++ /dev/null @@ -1,27 +0,0 @@ -#! /bin/sh /usr/share/dpatch/dpatch-run -## box.c.dpatch by Francesco Paolo Lovergine <frankie@debian.org> -## -## All lines beginning with `## DP:' are a description of the patch. -## DP: No description. - -@DPATCH@ -diff -urNad xaw3d-1.5+E~/lib/Xaw3d/Box.c xaw3d-1.5+E/lib/Xaw3d/Box.c ---- Xaw3d-1.5E/xc/lib/Xaw3d/Box.c 1996-10-15 16:41:18.000000000 +0200 -+++ Xaw3d-1.5E/xc/lib/Xaw3d/Box.c 2007-04-24 15:28:39.000000000 +0200 -@@ -353,8 +353,16 @@ - else { - width = preferred_width; - do { /* find some width big enough to stay within this height */ -+#if 0 - width *= 2; - if (width > constraint->width) width = constraint->width; -+#endif -+ if (width > constraint->width/2) { /* avoid short int overflow */ -+ width = constraint->width; -+ } -+ else { -+ width *= 2; -+ } - DoLayout(w, width, 0, &preferred_width, &preferred_height, FALSE); - } while (preferred_height > constraint->height && - width < constraint->width); diff --git a/extra/xaw3d/Xaw3d-1.5-debian-fixes.patch b/extra/xaw3d/Xaw3d-1.5-debian-fixes.patch deleted file mode 100644 index 5593f249b..000000000 --- a/extra/xaw3d/Xaw3d-1.5-debian-fixes.patch +++ /dev/null @@ -1,647 +0,0 @@ -diff -up Xaw3d-1.5E/xc/lib/Xaw3d/AsciiSrc.c.debian Xaw3d-1.5E/xc/lib/Xaw3d/AsciiSrc.c ---- Xaw3d-1.5E/xc/lib/Xaw3d/AsciiSrc.c.debian 2000-11-27 14:19:36.000000000 +0100 -+++ Xaw3d-1.5E/xc/lib/Xaw3d/AsciiSrc.c 2008-10-06 11:42:13.000000000 +0200 -@@ -51,11 +51,17 @@ in this Software without prior written a - #include <X11/Xaw3d/MultiSrcP.h> - #endif - -+#include <sys/types.h> -+#include <sys/stat.h> -+#include <fcntl.h> - - #if (defined(ASCII_STRING) || defined(ASCII_DISK)) - # include <X11/Xaw3d/AsciiText.h> /* for Widget Classes. */ - #endif - -+#include <sys/types.h> -+#include <sys/stat.h> -+#include <fcntl.h> - - /**************************************************************** - * -@@ -1007,7 +1013,9 @@ InitStringOrFile(src, newString) - AsciiSrcObject src; - Boolean newString; - { -- char * open_mode = NULL; -+ mode_t open_mode = 0; -+ const char *fdopen_mode = NULL; -+ int fd; - FILE * file; - char fileName[TMPSIZ]; - -@@ -1049,7 +1057,8 @@ Boolean newString; - XtErrorMsg("NoFile", "asciiSourceCreate", "XawError", - "Creating a read only disk widget and no file specified.", - NULL, 0); -- open_mode = "r"; -+ open_mode = O_RDONLY; -+ fdopen_mode = "r"; - break; - case XawtextAppend: - case XawtextEdit: -@@ -1057,9 +1066,17 @@ Boolean newString; - src->ascii_src.string = fileName; - (void) tmpnam(src->ascii_src.string); - src->ascii_src.is_tempfile = TRUE; -- open_mode = "w"; -- } else -- open_mode = "r+"; -+ open_mode = O_WRONLY | O_CREAT | O_EXCL; -+ fdopen_mode = "w"; -+ } else { -+/* O_NOFOLLOW is a BSD & Linux extension */ -+#ifdef O_NOFOLLOW -+ open_mode = O_RDWR | O_NOFOLLOW; -+#else -+ open_mode = O_RDWR; /* unsafe; subject to race conditions */ -+#endif -+ fdopen_mode = "r+"; -+ } - break; - default: - XtErrorMsg("badMode", "asciiSourceCreate", "XawError", -@@ -1078,11 +1095,14 @@ Boolean newString; - } - - if (!src->ascii_src.is_tempfile) { -- if ((file = fopen(src->ascii_src.string, open_mode)) != 0) { -- (void) fseek(file, (Off_t)0, 2); -- src->ascii_src.length = (XawTextPosition) ftell(file); -- return file; -- } else { -+ if ((fd = open(src->ascii_src.string, open_mode, 0666))) { -+ if ((file = fdopen(fd, fdopen_mode)) != NULL) { -+ (void)fseek(file, 0, SEEK_END); -+ src->ascii_src.length = (XawTextPosition)ftell(file); -+ return (file); -+ } -+ } -+ { - String params[2]; - Cardinal num_params = 2; - -@@ -1094,7 +1114,7 @@ Boolean newString; - } - } - src->ascii_src.length = 0; -- return((FILE *)NULL); -+ return(NULL); - } - - static void -diff -up Xaw3d-1.5E/xc/lib/Xaw3d/AsciiSrcP.h.debian Xaw3d-1.5E/xc/lib/Xaw3d/AsciiSrcP.h ---- Xaw3d-1.5E/xc/lib/Xaw3d/AsciiSrcP.h.debian 1996-10-15 16:41:18.000000000 +0200 -+++ Xaw3d-1.5E/xc/lib/Xaw3d/AsciiSrcP.h 2008-10-06 11:42:13.000000000 +0200 -@@ -85,7 +85,11 @@ SOFTWARE. - #ifdef L_tmpnam - #define TMPSIZ L_tmpnam - #else --#define TMPSIZ 32 /* bytes to allocate for tmpnam */ -+#ifdef PATH_MAX -+#define TMPSIZ PATH_MAX -+#else -+#define TMPSIZ 1024 /* bytes to allocate for tmpnam */ -+#endif - #endif - - #define MAGIC_VALUE ((XawTextPosition) -1) /* Magic value. */ -diff -up Xaw3d-1.5E/xc/lib/Xaw3d/MenuButton.c.debian Xaw3d-1.5E/xc/lib/Xaw3d/MenuButton.c ---- Xaw3d-1.5E/xc/lib/Xaw3d/MenuButton.c.debian 1996-10-15 16:41:20.000000000 +0200 -+++ Xaw3d-1.5E/xc/lib/Xaw3d/MenuButton.c 2008-10-06 11:42:13.000000000 +0200 -@@ -53,6 +53,8 @@ in this Software without prior written a - #include <X11/Xaw3d/XawInit.h> - #include <X11/Xaw3d/MenuButtoP.h> - -+#include "XawAlloc.h" -+ - static void ClassInitialize(); - static void PopupMenu(); - -@@ -179,9 +181,16 @@ Cardinal * num_params; - - if (menu == NULL) { - char error_buf[BUFSIZ]; -- (void) sprintf(error_buf, "MenuButton: %s %s.", -- "Could not find menu widget named", mbw->menu_button.menu_name); -- XtAppWarning(XtWidgetToApplicationContext(w), error_buf); -+ char *err1 = "MenuButton: Could not find menu widget named "; -+ char *perr; -+ int len; -+ -+ len = strlen(err1) + strlen(mbw->menu_button.menu_name) + 1 + 1; -+ perr = XtStackAlloc(len, error_buf); -+ if (perr == NULL) return; -+ sprintf(perr, "%s%s.", err1, mbw->menu_button.menu_name); -+ XtAppWarning(XtWidgetToApplicationContext(w), perr); -+ XtStackFree(perr, error_buf); - return; - } - if (!XtIsRealized(menu)) -diff -up Xaw3d-1.5E/xc/lib/Xaw3d/MultiSrc.c.debian Xaw3d-1.5E/xc/lib/Xaw3d/MultiSrc.c ---- Xaw3d-1.5E/xc/lib/Xaw3d/MultiSrc.c.debian 2008-10-06 11:42:13.000000000 +0200 -+++ Xaw3d-1.5E/xc/lib/Xaw3d/MultiSrc.c 2008-10-06 11:42:13.000000000 +0200 -@@ -74,6 +74,9 @@ in this Software without prior written a - #include <stdio.h> - #include <ctype.h> - #include <errno.h> -+#include <sys/types.h> -+#include <sys/stat.h> -+#include <fcntl.h> - - /**************************************************************** - * -@@ -1077,7 +1080,9 @@ InitStringOrFile(src, newString) - MultiSrcObject src; - Boolean newString; - { -- char * open_mode = NULL; -+ mode_t open_mode = 0; -+ const char *fdopen_mode = NULL; -+ int fd; - FILE * file; - char fileName[TMPSIZ]; - Display *d = XtDisplayOfObject((Widget)src); -@@ -1128,7 +1133,8 @@ InitStringOrFile(src, newString) - XtErrorMsg("NoFile", "multiSourceCreate", "XawError", - "Creating a read only disk widget and no file specified.", - NULL, 0); -- open_mode = "r"; -+ open_mode = O_RDONLY; -+ fdopen_mode = "r"; - break; - case XawtextAppend: - case XawtextEdit: -@@ -1141,9 +1147,17 @@ InitStringOrFile(src, newString) - - (void) tmpnam(src->multi_src.string); - src->multi_src.is_tempfile = TRUE; -- open_mode = "w"; -- } else -- open_mode = "r+"; -+ open_mode = O_WRONLY | O_CREAT | O_EXCL; -+ fdopen_mode = "w"; -+ } else { -+/* O_NOFOLLOW is a BSD & Linux extension */ -+#ifdef O_NOFOLLOW -+ open_mode = O_RDWR | O_NOFOLLOW; -+#else -+ open_mode = O_RDWR; /* unsafe; subject to race conditions */ -+#endif -+ fdopen_mode = "r+"; -+ } - break; - default: - XtErrorMsg("badMode", "multiSourceCreate", "XawError", -@@ -1162,11 +1176,14 @@ InitStringOrFile(src, newString) - } - - if (!src->multi_src.is_tempfile) { -- if ((file = fopen(src->multi_src.string, open_mode)) != 0) { -- (void) fseek(file, (Off_t)0, 2); -- src->multi_src.length = ftell (file); -- return file; -- } else { -+ if ((fd = open(src->multi_src.string, open_mode, 0666))) { -+ if ((file = fdopen(fd, fdopen_mode)) != NULL) { -+ (void)fseek(file, 0, SEEK_END); -+ src->multi_src.length = (XawTextPosition)ftell(file); -+ return (file); -+ } -+ } -+ { - String params[2]; - Cardinal num_params = 2; - -@@ -1178,7 +1195,7 @@ InitStringOrFile(src, newString) - } - } - src->multi_src.length = 0; -- return((FILE *)NULL); -+ return(NULL); - #undef StrLen - } - -diff -up Xaw3d-1.5E/xc/lib/Xaw3d/MultiSrcP.h.debian Xaw3d-1.5E/xc/lib/Xaw3d/MultiSrcP.h ---- Xaw3d-1.5E/xc/lib/Xaw3d/MultiSrcP.h.debian 1996-10-15 16:41:21.000000000 +0200 -+++ Xaw3d-1.5E/xc/lib/Xaw3d/MultiSrcP.h 2008-10-06 11:42:13.000000000 +0200 -@@ -113,7 +113,11 @@ SOFTWARE. - #ifdef L_tmpnam - #define TMPSIZ L_tmpnam - #else --#define TMPSIZ 32 /* bytes to allocate for tmpnam */ -+#ifdef PATH_MAX -+#define TMPSIZ PATH_MAX -+#else -+#define TMPSIZ 1024 /* bytes to allocate for tmpnam */ -+#endif - #endif - - #define MAGIC_VALUE ((XawTextPosition) -1) /* Magic value. */ -diff -up Xaw3d-1.5E/xc/lib/Xaw3d/Simple.c.debian Xaw3d-1.5E/xc/lib/Xaw3d/Simple.c ---- Xaw3d-1.5E/xc/lib/Xaw3d/Simple.c.debian 2000-11-27 14:19:36.000000000 +0100 -+++ Xaw3d-1.5E/xc/lib/Xaw3d/Simple.c 2008-10-06 11:42:13.000000000 +0200 -@@ -56,6 +56,8 @@ SOFTWARE. - #include <X11/Xaw3d/SimpleP.h> - #include <X11/Xmu/Drawing.h> - -+#include "XawAlloc.h" -+ - #define offset(field) XtOffsetOf(SimpleRec, simple.field) - - static XtResource resources[] = { -@@ -148,11 +150,17 @@ static void ClassPartInitialize(class) - - if (c->simple_class.change_sensitive == NULL) { - char buf[BUFSIZ]; -- -- (void) sprintf(buf, -- "%s Widget: The Simple Widget class method 'change_sensitive' is undefined.\nA function must be defined or inherited.", -- c->core_class.class_name); -- XtWarning(buf); -+ char *pbuf; -+ char *msg1 = " Widget: The Simple Widget class method 'change_sensitive' is undefined.\nA function must be defined or inherited."; -+ int len; -+ -+ len = strlen(msg1) + strlen(c->core_class.class_name) + 1; -+ pbuf = XtStackAlloc(len, buf); -+ if (pbuf != NULL) { -+ sprintf(pbuf, "%s%s", c->core_class.class_name, msg1); -+ XtWarning(pbuf); -+ XtStackFree(pbuf, buf); -+ } - c->simple_class.change_sensitive = ChangeSensitive; - } - -diff -up Xaw3d-1.5E/xc/lib/Xaw3d/SimpleMenu.c.debian Xaw3d-1.5E/xc/lib/Xaw3d/SimpleMenu.c ---- Xaw3d-1.5E/xc/lib/Xaw3d/SimpleMenu.c.debian 2003-02-17 07:45:07.000000000 +0100 -+++ Xaw3d-1.5E/xc/lib/Xaw3d/SimpleMenu.c 2008-10-06 11:42:13.000000000 +0200 -@@ -51,6 +51,8 @@ in this Software without prior written a - #include <X11/Xmu/Initer.h> - #include <X11/Xmu/CharSet.h> - -+#include "XawAlloc.h" -+ - #define streq(a, b) ( strcmp((a), (b)) == 0 ) - - #define offset(field) XtOffsetOf(SimpleMenuRec, simple_menu.field) -@@ -755,9 +757,17 @@ Cardinal * num_params; - - if ( (menu = FindMenu(w, params[0])) == NULL) { - char error_buf[BUFSIZ]; -- (void) sprintf(error_buf, "%s '%s'", -- "Xaw - SimpleMenuWidget: could not find menu named: ", params[0]); -- XtAppWarning(XtWidgetToApplicationContext(w), error_buf); -+ char *err1 = "Xaw - SimpleMenuWidget: could not find menu named: "; -+ char *perr; -+ int len; -+ -+ len = strlen(err1) + strlen(params[0]) + 2 + 1; -+ perr = XtStackAlloc(len, error_buf); -+ if (perr == NULL) -+ return; -+ sprintf(perr, "%s'%s'", err1, params[0]); -+ XtAppWarning(XtWidgetToApplicationContext(w), perr); -+ XtStackFree(perr, error_buf); - return; - } - -diff -up Xaw3d-1.5E/xc/lib/Xaw3d/StripChart.c.debian Xaw3d-1.5E/xc/lib/Xaw3d/StripChart.c ---- Xaw3d-1.5E/xc/lib/Xaw3d/StripChart.c.debian 2003-02-10 18:18:00.000000000 +0100 -+++ Xaw3d-1.5E/xc/lib/Xaw3d/StripChart.c 2008-10-06 11:42:13.000000000 +0200 -@@ -315,7 +315,15 @@ XtIntervalId *id; /* unused */ - if (w->strip_chart.points != NULL) { - w->strip_chart.points[0].x = w->strip_chart.interval + s; - XDrawPoints(XtDisplay(w), XtWindow(w), w->strip_chart.hiGC, -- w->strip_chart.points, w->strip_chart.scale, -+ /* -+ * patch: -+ * -+ * w->strip_chart.points, w->strip_chart.scale, -+ * -+ * this to avoid a subdle bug of extra spurios scan -+ * line in this widget. -+ */ -+ w->strip_chart.points, w->strip_chart.scale - 1, - CoordModePrevious); - } - -diff -up Xaw3d-1.5E/xc/lib/Xaw3d/Text.c.debian Xaw3d-1.5E/xc/lib/Xaw3d/Text.c ---- Xaw3d-1.5E/xc/lib/Xaw3d/Text.c.debian 2008-10-06 11:42:13.000000000 +0200 -+++ Xaw3d-1.5E/xc/lib/Xaw3d/Text.c 2008-10-06 11:43:16.000000000 +0200 -@@ -76,6 +76,8 @@ SOFTWARE. - #include <ctype.h> /* for isprint() */ - #include <stdlib.h> - -+#include "XawAlloc.h" -+ - #ifndef MAX_LEN_CT - #define MAX_LEN_CT 6 /* for sequence: ESC $ ( A \xx \xx */ - #endif -@@ -521,6 +523,8 @@ Cardinal *num_args; /* unused */ - TextWidget ctx = (TextWidget) new; - char error_buf[BUFSIZ]; - int s; -+ char *perr; /* frankie */ -+ size_t len; /* frankie */ - - ctx->text.threeD = XtVaCreateWidget("threeD", threeDWidgetClass, new, - XtNx, 0, XtNy, 0, -@@ -569,10 +573,17 @@ Cardinal *num_args; /* unused */ - if (ctx->text.scroll_vert != XawtextScrollNever) - if ( (ctx->text.resize == XawtextResizeHeight) || - (ctx->text.resize == XawtextResizeBoth) ) { -- (void) sprintf(error_buf, "Xaw Text Widget %s:\n %s %s.", ctx->core.name, -- "Vertical scrolling not allowed with height resize.\n", -- "Vertical scrolling has been DEACTIVATED."); -- XtAppWarning(XtWidgetToApplicationContext(new), error_buf); -+ char *err1 = "Xaw Text Widget "; -+ char *err2 = ":\nVertical scrolling not allowed with height resize.\n"; -+ char *err3 = "Vertical scrolling has been DEACTIVATED."; -+ len = strlen(err1) + strlen(err2) + strlen(err3) + -+ strlen(ctx->core.name) + 1; -+ perr = XtStackAlloc(len, error_buf); -+ if (perr != NULL) { -+ (void) sprintf(perr, "%s%s%s%s", err1, ctx->core.name, err2, err3); -+ XtAppWarning(XtWidgetToApplicationContext(new), perr); -+ XtStackFree(perr, error_buf); -+ } - ctx->text.scroll_vert = XawtextScrollNever; - } - else if (ctx->text.scroll_vert == XawtextScrollAlways) -@@ -580,18 +591,32 @@ Cardinal *num_args; /* unused */ - - if (ctx->text.scroll_horiz != XawtextScrollNever) - if (ctx->text.wrap != XawtextWrapNever) { -- (void) sprintf(error_buf, "Xaw Text Widget %s:\n %s %s.", ctx->core.name, -- "Horizontal scrolling not allowed with wrapping active.\n", -- "Horizontal scrolling has been DEACTIVATED."); -- XtAppWarning(XtWidgetToApplicationContext(new), error_buf); -+ char *err1 = "Xaw Text Widget "; -+ char *err2 = ":\nHorizontal scrolling not allowed with wrapping active."; -+ char *err3 = "\nHorizontal scrolling has been DEACTIVATED."; -+ len = strlen(err1) + strlen(err2) + strlen(err3) + -+ strlen(ctx->core.name) + 1; -+ perr = XtStackAlloc(len, error_buf); -+ if (perr != NULL) { -+ (void) sprintf(perr, "%s%s%s%s", err1, ctx->core.name, err2, err3); -+ XtAppWarning(XtWidgetToApplicationContext(new), perr); -+ XtStackFree(perr, error_buf); -+ } - ctx->text.scroll_horiz = XawtextScrollNever; - } - else if ( (ctx->text.resize == XawtextResizeWidth) || - (ctx->text.resize == XawtextResizeBoth) ) { -- (void) sprintf(error_buf, "Xaw Text Widget %s:\n %s %s.", ctx->core.name, -- "Horizontal scrolling not allowed with width resize.\n", -- "Horizontal scrolling has been DEACTIVATED."); -- XtAppWarning(XtWidgetToApplicationContext(new), error_buf); -+ char *err1 = "Xaw Text Widget "; -+ char *err2 = ":\nHorizontal scrolling not allowed with width resize.\n"; -+ char *err3 = "Horizontal scrolling has been DEACTIVATED."; -+ len = strlen(err1) + strlen(err2) + strlen(err3) + -+ strlen(ctx->core.name) + 1; -+ perr = XtStackAlloc(len, error_buf); -+ if (perr != NULL) { -+ (void) sprintf(perr, "%s%s%s%s", err1, ctx->core.name, err2, err3); -+ XtAppWarning(XtWidgetToApplicationContext(new), perr); -+ XtStackFree(perr, error_buf); -+ } - ctx->text.scroll_horiz = XawtextScrollNever; - } - else if (ctx->text.scroll_horiz == XawtextScrollAlways) -diff -up Xaw3d-1.5E/xc/lib/Xaw3d/TextPop.c.debian Xaw3d-1.5E/xc/lib/Xaw3d/TextPop.c ---- Xaw3d-1.5E/xc/lib/Xaw3d/TextPop.c.debian 2000-11-27 14:19:36.000000000 +0100 -+++ Xaw3d-1.5E/xc/lib/Xaw3d/TextPop.c 2008-10-06 11:42:13.000000000 +0200 -@@ -66,6 +66,8 @@ in this Software without prior written a - #include <X11/Xos.h> /* for O_RDONLY */ - #include <errno.h> - -+#include "XawAlloc.h" -+ - #ifdef X_NOT_STDC_ENV - extern int errno; - #endif -@@ -809,6 +811,8 @@ DoSearch(search) - struct SearchAndReplace * search; - { - char msg[BUFSIZ]; -+ char *pmsg; -+ int len; - Widget tw = XtParent(search->search_popup); - XawTextPosition pos; - XawTextScanDirection dir; -@@ -835,9 +839,20 @@ struct SearchAndReplace * search; - /* The Raw string in find.ptr may be WC I can't use here, so I re - call - GetString to get a tame version. */ - -- if (pos == XawTextSearchError) -- (void) sprintf( msg, "Could not find string ``%s''.", GetString( search->search_text ) ); -- else { -+ if (pos == XawTextSearchError) { -+ char *msg1 = "Could not find string ``"; -+ char *msg2 = "''."; -+ len = strlen(msg1) + strlen(msg2) + -+ strlen(GetString( search->search_text )) + 1; -+ pmsg = XtStackAlloc(len, msg); -+ if (pmsg != NULL) { -+ (void) sprintf( pmsg, "%s%s%s", msg1, GetString( search->search_text ), -+ msg2); -+ } else { -+ pmsg = msg; -+ (void) sprintf( pmsg, "Could not find string"); -+ } -+ } else { - if (dir == XawsdRight) - XawTextSetInsertionPoint( tw, pos + text.length); - else -@@ -849,7 +864,8 @@ struct SearchAndReplace * search; - } - - XawTextUnsetSelection(tw); -- SetSearchLabels(search, msg, "", TRUE); -+ SetSearchLabels(search, pmsg, "", TRUE); -+ XtStackFree(pmsg, msg); - return(FALSE); - } - -@@ -982,13 +998,26 @@ Boolean once_only, show_current; - if ( (new_pos == XawTextSearchError) ) { - if (count == 0) { - char msg[BUFSIZ]; -+ char *pmsg; -+ int len; -+ char *msg1 = "*** Error: Could not find string ``"; -+ char *msg2 = "''. ***"; - - /* The Raw string in find.ptr may be WC I can't use here, - so I call GetString to get a tame version.*/ - -- (void) sprintf( msg, "%s %s %s", "*** Error: Could not find string ``", -- GetString( search->search_text ), "''. ***"); -- SetSearchLabels(search, msg, "", TRUE); -+ len = strlen(msg1) + strlen(msg2) + -+ strlen(GetString( search->search_text )) + 1; -+ pmsg = XtStackAlloc(len, msg); -+ if (pmsg != NULL) { -+ (void) sprintf( pmsg, "%s%s%s", msg1, -+ GetString( search->search_text ), msg2); -+ } else { -+ pmsg = msg; -+ (void) sprintf(pmsg, "*** Error: Could not find string ***"); -+ } -+ SetSearchLabels(search, pmsg, "", TRUE); -+ XtStackFree(pmsg, msg); - return(FALSE); - } - else -@@ -1011,9 +1040,22 @@ Boolean once_only, show_current; - - if (XawTextReplace(tw, pos, end_pos, &replace) != XawEditDone) { - char msg[BUFSIZ]; -- -- (void) sprintf( msg, "'%s' with '%s'. ***", find.ptr, replace.ptr); -+ char *pmsg; -+ int len; -+ char *msg1 = "' with '"; -+ char *msg2 = "'. ***"; -+ -+ len = 1 + strlen(msg1) + strlen(msg2) + strlen(find.ptr) + -+ strlen(replace.ptr) + 1; -+ pmsg = XtStackAlloc(len, msg); -+ if (pmsg != NULL) { -+ (void) sprintf( pmsg, "`%s%s%s%s", find.ptr, msg1, replace.ptr, msg2); -+ } else { -+ pmsg = msg; -+ (void) sprintf(pmsg, "string ***"); -+ } - SetSearchLabels(search, "*** Error while replacing", msg, TRUE); -+ XtStackFree(pmsg, msg); - return(FALSE); - } - -@@ -1164,13 +1206,20 @@ XtArgVal value; - { - Widget temp_widget; - char buf[BUFSIZ]; -+ char *pbuf; -+ int len; - -- (void) sprintf(buf, "%s.%s", FORM_NAME, name); -+ len = strlen(FORM_NAME) + strlen(name) + 2; -+ pbuf = XtStackAlloc(len, buf); -+ if (pbuf == NULL) return FALSE; -+ (void) sprintf(pbuf, "%s.%s", FORM_NAME, name); - -- if ( (temp_widget = XtNameToWidget(shell, buf)) != NULL) { -+ if ( (temp_widget = XtNameToWidget(shell, pbuf)) != NULL) { - SetResource(temp_widget, res_name, value); -+ XtStackFree(pbuf, buf); - return(TRUE); - } -+ XtStackFree(pbuf, buf); - return(FALSE); - } - -diff -up /dev/null Xaw3d-1.5E/xc/lib/Xaw3d/XawAlloc.h ---- /dev/null 2008-10-06 08:37:32.418005377 +0200 -+++ Xaw3d-1.5E/xc/lib/Xaw3d/XawAlloc.h 2008-10-06 11:42:13.000000000 +0200 -@@ -0,0 +1,10 @@ -+/* $XFree86: xc/lib/Xaw/XawAlloc.h,v 1.1.2.1 1998/05/16 09:05:23 dawes Exp $ */ -+ -+#define XtStackAlloc(size, stack_cache_array) \ -+ ((size) <= sizeof(stack_cache_array) \ -+ ? (XtPointer)(stack_cache_array) \ -+ : XtMalloc((unsigned)(size))) -+ -+#define XtStackFree(pointer, stack_cache_array) \ -+ if ((pointer) != ((XtPointer)(stack_cache_array))) XtFree(pointer); else -+ ---- xaw3d-1.5e/xc/lib/Xaw3d/SmeBSB.c 2003-08-04 17:27:58.000000000 +0200 -+++ xaw3d-1.5e/xc/lib/Xaw3d/SmeBSB.c 2003-08-07 15:02:39.000000000 +0200 -@@ -52,6 +52,8 @@ - #include <X11/Xaw3d/Cardinals.h> - #include <stdio.h> - -+#include "XawAlloc.h" -+ - /* needed for abs() */ - #ifndef X_NOT_STDC_ENV - #include <stdlib.h> -@@ -712,6 +714,8 @@ - int x, y; - unsigned int width, height, bw; - char buf[BUFSIZ]; -+ char *pbuf; -+ int len; - - if (is_left) { - width = height = 0; -@@ -720,18 +724,24 @@ - if (!XGetGeometry(XtDisplayOfObject(w), - entry->sme_bsb.left_bitmap, &root, &x, &y, - &width, &height, &bw, &entry->sme_bsb.left_depth)) { -- (void) sprintf(buf, "Xaw SmeBSB Object: %s %s \"%s\".", -- "Could not get Left Bitmap", -- "geometry information for menu entry", -- XtName(w)); -- XtAppError(XtWidgetToApplicationContext(w), buf); -+ char *err1 = "Xaw SmeBSB Object: Could not get Left Bitmap geometry information for menu entry "; -+ len = strlen(err1) + strlen(XtName(w)) + 3 + 1; -+ pbuf = XtStackAlloc(len, buf); -+ if (pbuf == NULL) return; -+ sprintf(pbuf, "%s\"%s\".", err1, XtName(w)); -+ XtAppError(XtWidgetToApplicationContext(w), pbuf); -+ XtStackFree(pbuf, buf); - } - #ifdef NEVER - if (entry->sme_bsb.left_depth != 1) { -- (void) sprintf(buf, "Xaw SmeBSB Object: %s \"%s\" %s.", -- "Left Bitmap of entry", XtName(w), -- "is not one bit deep"); -- XtAppError(XtWidgetToApplicationContext(w), buf); -+ char *err1 = "Xaw SmeBSB Object: Left Bitmap of entry "; -+ char *err2 = " is not one bit deep."; -+ len = strlen(err1) + strlen(err2) + strlen(XtName(w)) + 2 + 1; -+ pbuf = XtStackAlloc(len, buf); -+ if (pbuf == NULL) return; -+ sprintf(pbuf, "%s\"%s\"%s", err1, XtName(w), err2); -+ XtAppError(XtWidgetToApplicationContext(w), pbuf); -+ XtStackFree(pbuf, buf); - } - #endif - } -@@ -745,18 +755,24 @@ - if (!XGetGeometry(XtDisplayOfObject(w), - entry->sme_bsb.right_bitmap, &root, &x, &y, - &width, &height, &bw, &entry->sme_bsb.right_depth)) { -- (void) sprintf(buf, "Xaw SmeBSB Object: %s %s \"%s\".", -- "Could not get Right Bitmap", -- "geometry information for menu entry", -- XtName(w)); -- XtAppError(XtWidgetToApplicationContext(w), buf); -+ char *err1 = "Xaw SmeBSB Object: Could not get Right Bitmap geometry information for menu entry "; -+ len = strlen(err1) + strlen(XtName(w)) + 3 + 1; -+ pbuf = XtStackAlloc(len, buf); -+ if (pbuf == NULL) return; -+ sprintf(pbuf, "%s\"%s\".", err1, XtName(w)); -+ XtAppError(XtWidgetToApplicationContext(w), pbuf); -+ XtStackFree(pbuf, buf); - } - #ifdef NEVER - if (entry->sme_bsb.right_depth != 1) { -- (void) sprintf(buf, "Xaw SmeBSB Object: %s \"%s\" %s.", -- "Right Bitmap of entry", XtName(w), -- "is not one bit deep"); -- XtAppError(XtWidgetToApplicationContext(w), buf); -+ char *err1 = "Xaw SmeBSB Object: Right Bitmap of entry "; -+ char *err2 = " is not one bit deep."; -+ len = strlen(err1) + strlen(err2) + strlen(XtName(w)) + 2 + 1; -+ pbuf = XtStackAlloc(len, buf); -+ if (pbuf == NULL) return; -+ sprintf(pbuf, "%s\"%s\"%s", err1, XtName(w), err2); -+ XtAppError(XtWidgetToApplicationContext(w), pbuf); -+ XtStackFree(pbuf, buf); - } - #endif - } diff --git a/extra/xaw3d/Xaw3d-1.5-i18n.patch b/extra/xaw3d/Xaw3d-1.5-i18n.patch deleted file mode 100644 index aa4730238..000000000 --- a/extra/xaw3d/Xaw3d-1.5-i18n.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- Xaw3d-1.5/xc/lib/Xaw3d/MultiSrc.c.orig Tue Aug 6 22:51:08 2002 -+++ Xaw3d-1.5/xc/lib/Xaw3d/MultiSrc.c Tue Aug 6 22:51:16 2002 -@@ -735,6 +735,7 @@ - - if ( string_set || (old_src->multi_src.type != src->multi_src.type) ) { - RemoveOldStringOrFile(old_src, string_set); -+ src->multi_src.allocated_string = old_src->multi_src.allocated_string; - file = InitStringOrFile(src, string_set); - - /* Load pieces does this logic for us, but it shouldn't. Its messy.*/ diff --git a/extra/xaw3d/Xaw3d-1.5E-warnings.patch b/extra/xaw3d/Xaw3d-1.5E-warnings.patch deleted file mode 100644 index 8ffa7f8f9..000000000 --- a/extra/xaw3d/Xaw3d-1.5E-warnings.patch +++ /dev/null @@ -1,114 +0,0 @@ ---- Xaw3d-1.5E/xc/lib/Xaw3d/MultiSrc.c 2009-03-15 17:04:35.000000000 +0100 -+++ Xaw3d-1.5E.new/xc/lib/Xaw3d/MultiSrc.c 2009-03-15 14:22:05.000000000 +0100 -@@ -77,6 +77,7 @@ - #include <sys/types.h> - #include <sys/stat.h> - #include <fcntl.h> -+#include <wchar.h> - - /**************************************************************** - * ---- Xaw3d-1.5E/xc/lib/Xaw3d/Panner.c 2000-11-27 14:19:24.000000000 +0100 -+++ Xaw3d-1.5E.new/xc/lib/Xaw3d/Panner.c 2009-03-15 13:50:40.000000000 +0100 -@@ -36,7 +36,7 @@ - #include <X11/Xmu/Misc.h> /* for Min */ - #include <X11/Xmu/Drawing.h> - #include <ctype.h> /* for isascii() etc. */ --#include <math.h> /* for atof() */ -+#include <stdlib.h> /* for atof() */ - - extern Bool XmuDistinguishablePixels(); /* not defined in any Xmu headers */ - ---- Xaw3d-1.5E/xc/lib/Xaw3d/Text.c 2009-03-15 17:04:35.000000000 +0100 -+++ Xaw3d-1.5E.new/xc/lib/Xaw3d/Text.c 2009-03-15 13:54:10.000000000 +0100 -@@ -75,6 +75,7 @@ - #include <X11/Xfuncs.h> - #include <ctype.h> /* for isprint() */ - #include <stdlib.h> -+#include <wchar.h> - - #include "XawAlloc.h" - ---- Xaw3d-1.5E/xc/lib/Xaw3d/TextAction.c 2000-11-27 14:19:36.000000000 +0100 -+++ Xaw3d-1.5E.new/xc/lib/Xaw3d/TextAction.c 2009-03-15 14:19:27.000000000 +0100 -@@ -45,7 +45,9 @@ - #include "XawI18n.h" - #endif - #include <stdio.h> -+#include <stdlib.h> - #include <ctype.h> -+#include <wchar.h> - - #define SrcScan XawTextSourceScan - #define FindDist XawTextSinkFindDistance ---- Xaw3d-1.5E/xc/lib/Xaw3d/TextPop.c 2009-03-15 17:04:35.000000000 +0100 -+++ Xaw3d-1.5E.new/xc/lib/Xaw3d/TextPop.c 2009-03-15 14:19:44.000000000 +0100 -@@ -65,6 +65,7 @@ - #include <stdio.h> - #include <X11/Xos.h> /* for O_RDONLY */ - #include <errno.h> -+#include <wchar.h> - - #include "XawAlloc.h" - ---- Xaw3d-1.5E/xc/lib/Xaw3d/TextSrc.c 2000-11-27 14:19:36.000000000 +0100 -+++ Xaw3d-1.5E.new/xc/lib/Xaw3d/TextSrc.c 2009-03-15 14:19:13.000000000 +0100 -@@ -49,6 +49,7 @@ - #endif - #include <stdio.h> - #include <ctype.h> -+#include <wchar.h> - - /**************************************************************** - * ---- Xaw3d-1.5E/xc/lib/Xaw3d/ThreeD.c 2003-02-11 12:41:56.000000000 +0100 -+++ Xaw3d-1.5E.new/xc/lib/Xaw3d/ThreeD.c 2009-03-15 14:21:20.000000000 +0100 -@@ -39,6 +39,7 @@ - #include <X11/Xaw3d/XawInit.h> - #include <X11/Xaw3d/ThreeDP.h> - #include <X11/Xosdefs.h> -+#include <X11/Xmu/CharSet.h> - - /* Initialization of defaults */ - ---- Xaw3d-1.5E/xc/lib/Xaw3d/Tip.c 2003-03-09 01:31:49.000000000 +0100 -+++ Xaw3d-1.5E.new/xc/lib/Xaw3d/Tip.c 2009-03-15 14:21:36.000000000 +0100 -@@ -41,6 +41,7 @@ - #include <X11/Xmu/Converters.h> - #include <X11/Xaw3d/TipP.h> - #include <X11/Xaw3d/XawInit.h> -+#include <stdlib.h> - - #define TIP_EVENT_MASK (ButtonPressMask | \ - ButtonReleaseMask | \ ---- Xaw3d-1.5E/xc/lib/Xaw3d/XawI18n.c 1996-10-15 16:41:25.000000000 +0200 -+++ Xaw3d-1.5E.new/xc/lib/Xaw3d/XawI18n.c 2009-03-15 14:23:11.000000000 +0100 -@@ -55,6 +55,7 @@ - - */ - -+#include <stdlib.h> - #include <X11/IntrinsicP.h> - #include "XawI18n.h" - ---- Xaw3d-1.5E/xc/lib/Xaw3d/XawIm.c 1998-04-21 15:42:02.000000000 +0200 -+++ Xaw3d-1.5E.new/xc/lib/Xaw3d/XawIm.c 2009-03-15 14:22:41.000000000 +0100 -@@ -59,6 +59,7 @@ - #include <X11/Xos.h> - #include <X11/Xfuncs.h> - #include <X11/ShellP.h> -+#include <X11/ResourceI.h> - #include <X11/Xaw3d/TextP.h> - #include <X11/Xaw3d/MultiSrc.h> - #include <X11/Xaw3d/MultiSinkP.h> -diff -up Xaw3d-1.5E/xc/lib/Xaw3d/XawI18n.h~ Xaw3d-1.5E/xc/lib/Xaw3d/XawI18n.h ---- Xaw3d-1.5E/xc/lib/Xaw3d/XawI18n.h~ 1996-10-15 16:41:26.000000000 +0200 -+++ Xaw3d-1.5E/xc/lib/Xaw3d/XawI18n.h 2009-03-15 17:18:04.000000000 +0100 -@@ -72,7 +72,4 @@ extern wchar_t _Xaw_atowc ( - - #ifndef HAS_ISW_FUNCS - #include <ctype.h> --#ifndef iswspace --#define iswspace(c) (isascii(c) && isspace(toascii(c))) --#endif - #endif diff --git a/extra/xaw3d/Xaw3d-1.5E-xorg-imake.patch b/extra/xaw3d/Xaw3d-1.5E-xorg-imake.patch deleted file mode 100644 index 9d5312e33..000000000 --- a/extra/xaw3d/Xaw3d-1.5E-xorg-imake.patch +++ /dev/null @@ -1,35 +0,0 @@ ---- Imakefile.config 2003-03-08 15:55:18.000000000 +0100 -+++ Imakefile 2005-01-20 14:48:55.630795072 +0100 -@@ -5,24 +5,24 @@ - XCOMM Build options. Have you read the README.XAW3D file yet? - XCOMM - XCOMM For color pixmaps, define MULTIPLANE_PIXMAPS: --#undef MULTIPLANE_PIXMAPS -+#define MULTIPLANE_PIXMAPS - XCOMM For grayed stipple shadows, define GRAY_BLKWHT_STIPPLES: - #define GRAY_BLKWHT_STIPPLES - XCOMM For scrollbars with arrows, define ARROW_SCROLLBARS: --#undef ARROW_SCROLLBARS -+#define ARROW_SCROLLBARS - --#define DoNormalLib NormalLibXaw --#define DoSharedLib SharedLibXaw --#define DoDebugLib DebugLibXaw --#define DoProfileLib ProfileLibXaw -+#define DoNormalLib NormalLibXaw7 -+#define DoSharedLib SharedLibXaw7 -+#define DoDebugLib DebugLibXaw7 -+#define DoProfileLib ProfileLibXaw7 - #define HasSharedData YES - #define LibName Xaw3d --#define SoRev SOXAWREV -+#define SoRev SOXAW7REV - #define IncSubdir X11 - #define IncSubSubdir Xaw3d - - XCOMM When building outside an X11 source tree: --XCOMM EXTRA_INCLUDES = -I. -+EXTRA_INCLUDES = -I. - - #ifdef SharedXawReqs - REQUIREDLIBS = SharedXawReqs diff --git a/extra/xaw3d/Xaw3d-ia64.patch b/extra/xaw3d/Xaw3d-ia64.patch deleted file mode 100644 index 90ce711e9..000000000 --- a/extra/xaw3d/Xaw3d-ia64.patch +++ /dev/null @@ -1,33 +0,0 @@ -diff -up Xaw3d-1.5E/xc/lib/Xaw3d/List.c.prototypes Xaw3d-1.5E/xc/lib/Xaw3d/List.c ---- Xaw3d-1.5E/xc/lib/Xaw3d/List.c.prototypes 2000-11-27 14:19:36.000000000 +0100 -+++ Xaw3d-1.5E/xc/lib/Xaw3d/List.c 2008-10-06 10:11:28.000000000 +0200 -@@ -38,6 +38,7 @@ in this Software without prior written a - - #include "Xaw3dP.h" - #include <stdio.h> -+#include <stdlib.h> - #include <ctype.h> - #include <X11/IntrinsicP.h> - #include <X11/StringDefs.h> -diff -up Xaw3d-1.5E/xc/lib/Xaw3d/MultiSink.c.prototypes Xaw3d-1.5E/xc/lib/Xaw3d/MultiSink.c ---- Xaw3d-1.5E/xc/lib/Xaw3d/MultiSink.c.prototypes 1996-10-15 16:41:20.000000000 +0200 -+++ Xaw3d-1.5E/xc/lib/Xaw3d/MultiSink.c 2008-10-06 10:10:37.000000000 +0200 -@@ -81,6 +81,7 @@ SOFTWARE. - #include <X11/Xaw3d/TextP.h> - #include "XawI18n.h" - #include <stdio.h> -+#include <stdlib.h> - #include <ctype.h> - - #ifdef GETLASTPOS -diff -up Xaw3d-1.5E/xc/lib/Xaw3d/Text.c.prototypes Xaw3d-1.5E/xc/lib/Xaw3d/Text.c ---- Xaw3d-1.5E/xc/lib/Xaw3d/Text.c.prototypes 2003-02-10 18:28:13.000000000 +0100 -+++ Xaw3d-1.5E/xc/lib/Xaw3d/Text.c 2008-10-06 10:11:11.000000000 +0200 -@@ -74,6 +74,7 @@ SOFTWARE. - #include <X11/Xaw3d/ThreeDP.h> - #include <X11/Xfuncs.h> - #include <ctype.h> /* for isprint() */ -+#include <stdlib.h> - - #ifndef MAX_LEN_CT - #define MAX_LEN_CT 6 /* for sequence: ESC $ ( A \xx \xx */ diff --git a/extra/xfce4-systemload-plugin/missing_tooltip.diff b/extra/xfce4-systemload-plugin/missing_tooltip.diff deleted file mode 100644 index 96f5c1714..000000000 --- a/extra/xfce4-systemload-plugin/missing_tooltip.diff +++ /dev/null @@ -1,21 +0,0 @@ ---- panel-plugin/systemload.c 2007-01-17 18:01:09.000000000 +0000 -+++ panel-plugin/systemload.c.new 2009-05-14 17:17:24.001076632 +0000 -@@ -315,11 +315,18 @@ - { - int count; - t_global_monitor *global; -+ GtkSettings *settings; - - tooltips = gtk_tooltips_new (); - g_object_ref (tooltips); - gtk_object_sink (GTK_OBJECT (tooltips)); - -+ /* reduce the default tooltip timeout to be smaller than the update interval otherwise -+ * we won't see tooltips on GTK 2.16 or newer */ -+ settings = gtk_settings_get_default(); -+ if (g_object_class_find_property(G_OBJECT_GET_CLASS(settings), "gtk-tooltip-timeout")) -+ g_object_set(settings, "gtk-tooltip-timeout", UPDATE_TIMEOUT - 10, NULL); -+ - global = g_new(t_global_monitor, 1); - global->plugin = plugin; - global->timeout_id = 0; diff --git a/extra/xfce4-timer-plugin/panel48.patch b/extra/xfce4-timer-plugin/panel48.patch deleted file mode 100644 index 056023712..000000000 --- a/extra/xfce4-timer-plugin/panel48.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 03ff202f818fe3f075a6c864ab688b57b1bb1cb4 Mon Sep 17 00:00:00 2001 -From: Nick Schermer <nick@xfce.org> -Date: Thu, 27 Jan 2011 21:18:45 +0000 -Subject: Fix segfault when creating plugin in 4.8 panel. - -Used invalid function type to construct the plugin. ---- -diff --git a/src/xfcetimer.c b/src/xfcetimer.c -index c27d37a..de7bd2b 100644 ---- a/src/xfcetimer.c -+++ b/src/xfcetimer.c -@@ -42,7 +42,7 @@ - - #include "xfcetimer.h" - --static gboolean create_plugin_control (XfcePanelPlugin *plugin); -+static void create_plugin_control (XfcePanelPlugin *plugin); - XFCE_PANEL_PLUGIN_REGISTER_EXTERNAL(create_plugin_control); - - void make_menu(plugin_data *pd); -@@ -1366,7 +1366,7 @@ static void plugin_create_options (XfcePanelPlugin *plugin,plugin_data *pd) { - * - * Returns %TRUE on success, %FALSE on failure. - **/ --static gboolean -+static void - create_plugin_control (XfcePanelPlugin *plugin) - { - -@@ -1461,7 +1461,6 @@ create_plugin_control (XfcePanelPlugin *plugin) - xfce_panel_plugin_menu_show_configure (plugin); - g_signal_connect (plugin, "configure-plugin", - G_CALLBACK (plugin_create_options), pd); -- return(TRUE); - } - - --- -cgit v0.8.3.4 diff --git a/libre/cups-libre/cups-avahi.patch b/libre/cups-libre/cups-avahi.patch deleted file mode 100644 index 7e9c8ecea..000000000 --- a/libre/cups-libre/cups-avahi.patch +++ /dev/null @@ -1,3156 +0,0 @@ -Description: Avahi support -Bug: http://www.cups.org/str.php?L3066 -Author: Tim Waugh -Origin: git clone http://twaugh.fedorapeople.org/cups-avahi.git (Aug 11, 2011) - ---- a/backend/dnssd.c -+++ b/backend/dnssd.c -@@ -15,14 +15,21 @@ - * - * Contents: - * -+ * next_txt_record() - Get next TXT record from a cups_txt_records_t. -+ * parse_txt_record_pair() - Read key/value pair in cups_txt_records_t. - * main() - Browse for printers. - * browse_callback() - Browse devices. - * browse_local_callback() - Browse local devices. - * compare_devices() - Compare two devices. - * exec_backend() - Execute the backend that corresponds to the - * resolved service name. -+ * device_type() - Get DNS-SD type enumeration from string. - * get_device() - Create or update a device. - * query_callback() - Process query data. -+ * avahi_client_callback() - Avahi client callback function. -+ * avahi_query_callback() - Avahi query callback function. -+ * avahi_browse_callback() - Avahi browse callback function. -+ * find_device() - Find a device from its name and domain. - * sigterm_handler() - Handle termination signals... - * unquote() - Unquote a name string. - */ -@@ -33,7 +40,18 @@ - - #include "backend-private.h" - #include <cups/array.h> --#include <dns_sd.h> -+#ifdef HAVE_DNSSD -+# include <dns_sd.h> -+#endif /* HAVE_DNSSD */ -+#ifdef HAVE_AVAHI -+# include <avahi-client/client.h> -+# include <avahi-client/lookup.h> -+# include <avahi-common/simple-watch.h> -+# include <avahi-common/domain.h> -+# include <avahi-common/error.h> -+# include <avahi-common/malloc.h> -+#define kDNSServiceMaxDomainName AVAHI_DOMAIN_NAME_MAX -+#endif /* HAVE_AVAHI */ - - - /* -@@ -53,7 +71,12 @@ - - typedef struct - { -+#ifdef HAVE_DNSSD - DNSServiceRef ref; /* Service reference for resolve */ -+#endif /* HAVE_DNSSD */ -+#ifdef HAVE_AVAHI -+ int resolved; /* Did we resolve the device? */ -+#endif /* HAVE_AVAHI */ - char *name, /* Service name */ - *domain, /* Domain name */ - *fullName, /* Full name */ -@@ -65,6 +88,20 @@ - sent; /* Did we list the device? */ - } cups_device_t; - -+typedef struct -+{ -+ char key[256]; -+ char value[256]; -+ -+#ifdef HAVE_DNSSD -+ const uint8_t *data; -+ const uint8_t *datanext; -+ const uint8_t *dataend; -+#else /* HAVE_AVAHI */ -+ AvahiStringList *txt; -+#endif /* HAVE_DNSSD */ -+} cups_txt_records_t; -+ - - /* - * Local globals... -@@ -78,6 +115,7 @@ - * Local functions... - */ - -+#ifdef HAVE_DNSSD - static void browse_callback(DNSServiceRef sdRef, - DNSServiceFlags flags, - uint32_t interfaceIndex, -@@ -93,12 +131,6 @@ - const char *regtype, - const char *replyDomain, - void *context); --static int compare_devices(cups_device_t *a, cups_device_t *b); --static void exec_backend(char **argv); --static cups_device_t *get_device(cups_array_t *devices, -- const char *serviceName, -- const char *regtype, -- const char *replyDomain); - static void query_callback(DNSServiceRef sdRef, - DNSServiceFlags flags, - uint32_t interfaceIndex, -@@ -107,9 +139,118 @@ - uint16_t rrclass, uint16_t rdlen, - const void *rdata, uint32_t ttl, - void *context); -+#endif /* HAVE_DNSSD */ -+#ifdef HAVE_AVAHI -+static void avahi_client_callback (AvahiClient *client, -+ AvahiClientState state, -+ void *context); -+static void avahi_browse_callback (AvahiServiceBrowser *browser, -+ AvahiIfIndex interface, -+ AvahiProtocol protocol, -+ AvahiBrowserEvent event, -+ const char *serviceName, -+ const char *regtype, -+ const char *replyDomain, -+ AvahiLookupResultFlags flags, -+ void *context); -+#endif /* HAVE_AVAHI */ -+ -+static cups_device_t * find_device (cups_array_t *devices, -+ cups_txt_records_t *txt, -+ cups_device_t *dkey); -+static int compare_devices(cups_device_t *a, cups_device_t *b); -+static void exec_backend(char **argv); -+static cups_device_t *get_device(cups_array_t *devices, -+ const char *serviceName, -+ const char *regtype, -+ const char *replyDomain); - static void sigterm_handler(int sig); - static void unquote(char *dst, const char *src, size_t dstsize); - -+#ifdef HAVE_AVAHI -+static AvahiSimplePoll *simple_poll = NULL; -+static int avahi_got_callback; -+#endif /* HAVE_AVAHI */ -+ -+ -+/* -+ * 'next_txt_record()' - Get next TXT record from a cups_txt_records_t. -+ */ -+ -+static cups_txt_records_t * -+next_txt_record (cups_txt_records_t *txt) -+{ -+#ifdef HAVE_DNSSD -+ txt->data = txt->datanext; -+#else /* HAVE_AVAHI */ -+ txt->txt = avahi_string_list_get_next (txt->txt); -+ if (txt->txt == NULL) -+ return NULL; -+#endif /* HAVE_DNSSD */ -+ -+ return txt; -+} -+ -+ -+/* -+ * 'parse_txt_record_pair()' - Read key/value pair in cups_txt_records_t. -+ */ -+ -+static int -+parse_txt_record_pair (cups_txt_records_t *txt) -+{ -+#ifdef HAVE_DNSSD -+ uint8_t datalen; -+ uint8_t *data = txt->data; -+ char *ptr; -+ -+ /* -+ * Read a key/value pair starting with an 8-bit length. Since the -+ * length is 8 bits and the size of the key/value buffers is 256, we -+ * don't need to check for overflow... -+ */ -+ -+ datalen = *data++; -+ if (!datalen || (data + datalen) >= txt->dataend) -+ return NULL; -+ txt->datanext = data + datalen; -+ -+ for (ptr = txt->key; data < txt->datanext && *data != '='; data ++) -+ *ptr++ = *data; -+ *ptr = '\0'; -+ -+ if (data < txt->datanext && *data == '=') -+ { -+ data++; -+ -+ if (data < datanext) -+ memcpy (txt->value, data, txt->datanext - data); -+ value[txt->datanext - data] = '\0'; -+ } -+ else -+ return 1; -+#else /* HAVE_AVAHI */ -+ char *key, *value; -+ size_t len; -+ avahi_string_list_get_pair (txt->txt, &key, &value, &len); -+ if (len > sizeof (txt->value) - 1) -+ len = sizeof (txt->value) - 1; -+ -+ memcpy (txt->value, value, len); -+ txt->value[len] = '\0'; -+ len = strlen (key); -+ if (len > sizeof (txt->key) - 1) -+ len = sizeof (txt->key) - 1; -+ -+ memcpy (txt->key, key, len); -+ txt->key[len] = '\0'; -+ avahi_free (key); -+ avahi_free (value); -+#endif /* HAVE_AVAHI */ -+ -+ return 0; -+} -+ - - /* - * 'main()' - Browse for printers. -@@ -120,6 +261,13 @@ - char *argv[]) /* I - Command-line arguments */ - { - const char *name; /* Backend name */ -+ cups_array_t *devices; /* Device array */ -+ cups_device_t *device; /* Current device */ -+ char uriName[1024]; /* Unquoted fullName for URI */ -+#ifdef HAVE_DNSSD -+ int fd; /* Main file descriptor */ -+ fd_set input; /* Input set for select() */ -+ struct timeval timeout; /* Timeout for select() */ - DNSServiceRef main_ref, /* Main service reference */ - fax_ipp_ref, /* IPP fax service reference */ - ipp_ref, /* IPP service reference */ -@@ -133,12 +281,11 @@ - pdl_datastream_ref, /* AppSocket service reference */ - printer_ref, /* LPD service reference */ - riousbprint_ref; /* Remote IO service reference */ -- int fd; /* Main file descriptor */ -- fd_set input; /* Input set for select() */ -- struct timeval timeout; /* Timeout for select() */ -- cups_array_t *devices; /* Device array */ -- cups_device_t *device; /* Current device */ -- char uriName[1024]; /* Unquoted fullName for URI */ -+#endif /* HAVE_DNSSD */ -+#ifdef HAVE_AVAHI -+ AvahiClient *client; -+ int error; -+#endif /* HAVE_AVAHI */ - #if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET) - struct sigaction action; /* Actions for POSIX signals */ - #endif /* HAVE_SIGACTION && !HAVE_SIGSET */ -@@ -198,6 +345,49 @@ - * Browse for different kinds of printers... - */ - -+#ifdef HAVE_AVAHI -+ if ((simple_poll = avahi_simple_poll_new ()) == NULL) -+ { -+ perror ("ERROR: Unable to create avahi simple poll object"); -+ return (1); -+ } -+ -+ client = avahi_client_new (avahi_simple_poll_get (simple_poll), -+ 0, avahi_client_callback, NULL, &error); -+ if (!client) -+ { -+ perror ("DEBUG: Unable to create avahi client"); -+ return (0); -+ } -+ -+ avahi_service_browser_new (client, AVAHI_IF_UNSPEC, -+ AVAHI_PROTO_UNSPEC, -+ "_fax-ipp._tcp", NULL, 0, -+ avahi_browse_callback, devices); -+ avahi_service_browser_new (client, AVAHI_IF_UNSPEC, -+ AVAHI_PROTO_UNSPEC, -+ "_ipp._tcp", NULL, 0, -+ avahi_browse_callback, devices); -+ avahi_service_browser_new (client, AVAHI_IF_UNSPEC, -+ AVAHI_PROTO_UNSPEC, -+ "_ipp-tls._tcp", NULL, 0, -+ avahi_browse_callback, devices); -+ avahi_service_browser_new (client, AVAHI_IF_UNSPEC, -+ AVAHI_PROTO_UNSPEC, -+ "_pdl-datastream._tcp", -+ NULL, 0, -+ avahi_browse_callback, -+ devices); -+ avahi_service_browser_new (client, AVAHI_IF_UNSPEC, -+ AVAHI_PROTO_UNSPEC, -+ "_printer._tcp", NULL, 0, -+ avahi_browse_callback, devices); -+ avahi_service_browser_new (client, AVAHI_IF_UNSPEC, -+ AVAHI_PROTO_UNSPEC, -+ "_riousbprint._tcp", NULL, 0, -+ avahi_browse_callback, devices); -+#endif /* HAVE_AVAHI */ -+#ifdef HAVE_DNSSD - if (DNSServiceCreateConnection(&main_ref) != kDNSServiceErr_NoError) - { - perror("ERROR: Unable to create service connection"); -@@ -258,6 +448,7 @@ - riousbprint_ref = main_ref; - DNSServiceBrowse(&riousbprint_ref, kDNSServiceFlagsShareConnection, 0, - "_riousbprint._tcp", NULL, browse_callback, devices); -+#endif /* HAVE_DNSSD */ - - /* - * Loop until we are killed... -@@ -265,6 +456,9 @@ - - while (!job_canceled) - { -+ int announce = 0; -+ -+#ifdef HAVE_DNSSD - FD_ZERO(&input); - FD_SET(fd, &input); - -@@ -284,11 +478,35 @@ - } - else - { -+ announce = 1; -+ } -+#else /* HAVE_AVAHI */ -+ int r; -+ avahi_got_callback = 0; -+ r = avahi_simple_poll_iterate (simple_poll, 1); -+ if (r != 0 && r != EINTR) -+ { -+ /* -+ * We've been told to exit the loop. Perhaps the connection to -+ * avahi failed. -+ */ -+ -+ break; -+ } -+ -+ if (avahi_got_callback) -+ announce = 1; -+#endif /* HAVE_DNSSD */ -+ -+ if (announce) -+ { - /* - * Announce any devices we've found... - */ - -+#ifdef HAVE_DNSSD - DNSServiceErrorType status; /* DNS query status */ -+#endif /* HAVE_DNSSD */ - cups_device_t *best; /* Best matching device */ - char device_uri[1024]; /* Device URI */ - int count; /* Number of queries */ -@@ -302,6 +520,7 @@ - if (device->sent) - sent ++; - -+#ifdef HAVE_DNSSD - if (device->ref) - count ++; - -@@ -333,14 +552,23 @@ - count ++; - } - } -- else if (!device->sent) -+ else -+#endif /* HAVE_DNSSD */ -+#ifdef HAVE_AVAHI -+ if (!device->resolved) -+ continue; -+ else -+#endif /* HAVE_AVAHI */ -+ if (!device->sent) - { -+#ifdef HAVE_DNSSD - /* - * Got the TXT records, now report the device... - */ - - DNSServiceRefDeallocate(device->ref); - device->ref = 0; -+#endif /* HAVE_DNSSD */ - - if (!best) - best = device; -@@ -401,6 +629,7 @@ - } - - -+#ifdef HAVE_DNSSD - /* - * 'browse_callback()' - Browse devices. - */ -@@ -489,6 +718,7 @@ - device->fullName); - device->sent = 1; - } -+#endif /* HAVE_DNSSD */ - - - /* -@@ -569,6 +799,41 @@ - - - /* -+ * 'device_type()' - Get DNS-SD type enumeration from string. -+ */ -+ -+static int -+device_type (const char *regtype) -+{ -+#ifdef HAVE_AVAHI -+ if (!strcmp(regtype, "_ipp._tcp")) -+ return (CUPS_DEVICE_IPP); -+ else if (!strcmp(regtype, "_ipps._tcp") || -+ !strcmp(regtype, "_ipp-tls._tcp")) -+ return (CUPS_DEVICE_IPPS); -+ else if (!strcmp(regtype, "_fax-ipp._tcp")) -+ return (CUPS_DEVICE_FAX_IPP); -+ else if (!strcmp(regtype, "_printer._tcp")) -+ return (CUPS_DEVICE_PDL_DATASTREAM); -+#else -+ if (!strcmp(regtype, "_ipp._tcp.")) -+ return (CUPS_DEVICE_IPP); -+ else if (!strcmp(regtype, "_ipps._tcp.") || -+ !strcmp(regtype, "_ipp-tls._tcp.")) -+ return (CUPS_DEVICE_IPPS); -+ else if (!strcmp(regtype, "_fax-ipp._tcp.")) -+ return (CUPS_DEVICE_FAX_IPP); -+ else if (!strcmp(regtype, "_printer._tcp.")) -+ return (CUPS_DEVICE_PRINTER); -+ else if (!strcmp(regtype, "_pdl-datastream._tcp.")) -+ return (CUPS_DEVICE_PDL_DATASTREAM); -+#endif /* HAVE_AVAHI */ -+ -+ return (CUPS_DEVICE_RIOUSBPRINT); -+} -+ -+ -+/* - * 'get_device()' - Create or update a device. - */ - -@@ -589,20 +854,7 @@ - */ - - key.name = (char *)serviceName; -- -- if (!strcmp(regtype, "_ipp._tcp.")) -- key.type = CUPS_DEVICE_IPP; -- else if (!strcmp(regtype, "_ipps._tcp.") || -- !strcmp(regtype, "_ipp-tls._tcp.")) -- key.type = CUPS_DEVICE_IPPS; -- else if (!strcmp(regtype, "_fax-ipp._tcp.")) -- key.type = CUPS_DEVICE_FAX_IPP; -- else if (!strcmp(regtype, "_printer._tcp.")) -- key.type = CUPS_DEVICE_PRINTER; -- else if (!strcmp(regtype, "_pdl-datastream._tcp.")) -- key.type = CUPS_DEVICE_PDL_DATASTREAM; -- else -- key.type = CUPS_DEVICE_RIOUSBPRINT; -+ key.type = device_type (regtype); - - for (device = cupsArrayFind(devices, &key); - device; -@@ -622,8 +874,14 @@ - free(device->domain); - device->domain = strdup(replyDomain); - -+#ifdef HAVE_DNSSD - DNSServiceConstructFullName(fullName, device->name, regtype, - replyDomain); -+#else /* HAVE_AVAHI */ -+ avahi_service_name_join (fullName, kDNSServiceMaxDomainName, -+ serviceName, regtype, replyDomain); -+#endif /* HAVE_DNSSD */ -+ - free(device->fullName); - device->fullName = strdup(fullName); - } -@@ -643,6 +901,9 @@ - device->domain = strdup(replyDomain); - device->type = key.type; - device->priority = 50; -+#ifdef HAVE_AVAHI -+ device->resolved = 0; -+#endif /* HAVE_AVAHI */ - - cupsArrayAdd(devices, device); - -@@ -650,13 +911,20 @@ - * Set the "full name" of this service, which is used for queries... - */ - -+#ifdef HAVE_DNSSD - DNSServiceConstructFullName(fullName, serviceName, regtype, replyDomain); -+#else /* HAVE_AVAHI */ -+ avahi_service_name_join (fullName, kDNSServiceMaxDomainName, -+ serviceName, regtype, replyDomain); -+#endif /* HAVE_DNSSD */ -+ - device->fullName = strdup(fullName); - - return (device); - } - - -+#ifdef HAVE_DNSSD - /* - * 'query_callback()' - Process query data. - */ -@@ -680,7 +948,7 @@ - *ptr; /* Pointer into string */ - cups_device_t dkey, /* Search key */ - *device; /* Device */ -- -+ cups_txt_records_t txt; - - fprintf(stderr, "DEBUG2: query_callback(sdRef=%p, flags=%x, " - "interfaceIndex=%d, errorCode=%d, fullName=\"%s\", " -@@ -714,94 +982,233 @@ - if ((ptr = strstr(name, "._")) != NULL) - *ptr = '\0'; - -- if (strstr(fullName, "_ipp._tcp.")) -- dkey.type = CUPS_DEVICE_IPP; -- else if (strstr(fullName, "_ipps._tcp.") || -- strstr(fullName, "_ipp-tls._tcp.")) -- dkey.type = CUPS_DEVICE_IPPS; -- else if (strstr(fullName, "_fax-ipp._tcp.")) -- dkey.type = CUPS_DEVICE_FAX_IPP; -- else if (strstr(fullName, "_printer._tcp.")) -- dkey.type = CUPS_DEVICE_PRINTER; -- else if (strstr(fullName, "_pdl-datastream._tcp.")) -- dkey.type = CUPS_DEVICE_PDL_DATASTREAM; -+ dkey.type = device_type (fullName); -+ -+ txt.data = rdata; -+ txt.dataend = rdata + rdlen; -+ device = find_device ((cups_array_t *) context, &txt, &dkey); -+ if (!device) -+ fprintf(stderr, "DEBUG: Ignoring TXT record for \"%s\"...\n", fullName); -+} -+#endif /* HAVE_DNSSD */ -+ -+ -+#ifdef HAVE_AVAHI -+/* -+ * 'avahi_client_callback()' - Avahi client callback function. -+ */ -+ -+static void -+avahi_client_callback(AvahiClient *client, -+ AvahiClientState state, -+ void *context) -+{ -+ /* -+ * If the connection drops, quit. -+ */ -+ -+ if (state == AVAHI_CLIENT_FAILURE) -+ { -+ fprintf (stderr, "ERROR: Avahi connection failed\n"); -+ avahi_simple_poll_quit (simple_poll); -+ } -+} -+ -+ -+/* -+ * 'avahi_query_callback()' - Avahi query callback function. -+ */ -+ -+static void -+avahi_query_callback(AvahiServiceResolver *resolver, -+ AvahiIfIndex interface, -+ AvahiProtocol protocol, -+ AvahiResolverEvent event, -+ const char *name, -+ const char *type, -+ const char *domain, -+ const char *host_name, -+ const AvahiAddress *address, -+ uint16_t port, -+ AvahiStringList *txt, -+ AvahiLookupResultFlags flags, -+ void *context) -+{ -+ AvahiClient *client; -+ cups_device_t key, -+ *device; -+ char uqname[1024], -+ *ptr; -+ cups_txt_records_t txtr; -+ -+ client = avahi_service_resolver_get_client (resolver); -+ if (event != AVAHI_RESOLVER_FOUND) -+ { -+ if (event == AVAHI_RESOLVER_FAILURE) -+ { -+ fprintf (stderr, "ERROR: %s\n", -+ avahi_strerror (avahi_client_errno (client))); -+ } -+ -+ avahi_service_resolver_free (resolver); -+ return; -+ } -+ -+ /* -+ * Set search key for device. -+ */ -+ -+ key.name = uqname; -+ unquote (uqname, name, sizeof (uqname)); -+ if ((ptr = strstr(name, "._")) != NULL) -+ *ptr = '\0'; -+ -+ key.domain = (char *) domain; -+ key.type = device_type (type); -+ -+ /* -+ * Find the device and the the TXT information. -+ */ -+ -+ txtr.txt = txt; -+ device = find_device ((cups_array_t *) context, &txtr, &key); -+ if (device) -+ { -+ /* -+ * Let the main loop know to announce the device. -+ */ -+ -+ device->resolved = 1; -+ avahi_got_callback = 1; -+ } - else -- dkey.type = CUPS_DEVICE_RIOUSBPRINT; -+ fprintf (stderr, "DEBUG: Ignoring TXT record for \"%s\"...\n", name); -+ -+ avahi_service_resolver_free (resolver); -+} -+ -+ -+/* -+ * 'avahi_browse_callback()' - Avahi browse callback function. -+ */ -+ -+static void -+avahi_browse_callback(AvahiServiceBrowser *browser, -+ AvahiIfIndex interface, -+ AvahiProtocol protocol, -+ AvahiBrowserEvent event, -+ const char *name, -+ const char *type, -+ const char *domain, -+ AvahiLookupResultFlags flags, -+ void *context) -+{ -+ AvahiClient *client = avahi_service_browser_get_client (browser); -+ -+ switch (event) -+ { -+ case AVAHI_BROWSER_FAILURE: -+ fprintf (stderr, "ERROR: %s\n", -+ avahi_strerror (avahi_client_errno (client))); -+ avahi_simple_poll_quit (simple_poll); -+ return; -+ -+ case AVAHI_BROWSER_NEW: -+ /* -+ * This object is new on the network. -+ */ -+ -+ if (flags & AVAHI_LOOKUP_RESULT_LOCAL) -+ { -+ /* -+ * This comes from the local machine so ignore it. -+ */ -+ -+ fprintf (stderr, "DEBUG: ignoring local service %s\n", name); -+ } -+ else -+ { -+ /* -+ * Create a device entry for it if it doesn't yet exist. -+ */ -+ -+ get_device ((cups_array_t *)context, name, type, domain); -+ -+ /* -+ * Now look for a TXT entry. -+ */ -+ -+ if (avahi_service_resolver_new (client, interface, protocol, -+ name, type, domain, -+ AVAHI_PROTO_UNSPEC, 0, -+ avahi_query_callback, context) == NULL) -+ { -+ fprintf (stderr, "ERROR: failed to resolve service %s: %s\n", -+ name, avahi_strerror (avahi_client_errno (client))); -+ } -+ } -+ -+ break; -+ -+ case AVAHI_BROWSER_REMOVE: -+ case AVAHI_BROWSER_ALL_FOR_NOW: -+ case AVAHI_BROWSER_CACHE_EXHAUSTED: -+ break; -+ } -+} -+#endif /* HAVE_AVAHI */ -+ - -- for (device = cupsArrayFind(devices, &dkey); -+/* -+ * 'find_device()' - Find a device from its name and domain. -+ */ -+ -+static cups_device_t * -+find_device (cups_array_t *devices, -+ cups_txt_records_t *txt, -+ cups_device_t *dkey) -+{ -+ cups_device_t *device; -+ char *ptr; -+ -+ for (device = cupsArrayFind(devices, dkey); - device; - device = cupsArrayNext(devices)) - { -- if (_cups_strcasecmp(device->name, dkey.name) || -- _cups_strcasecmp(device->domain, dkey.domain)) -+ if (_cups_strcasecmp(device->name, dkey->name) || -+ _cups_strcasecmp(device->domain, dkey->domain)) - { - device = NULL; - break; - } -- else if (device->type == dkey.type) -+ else if (device->type == dkey->type) - { - /* - * Found it, pull out the priority and make and model from the TXT - * record and save it... - */ - -- const uint8_t *data, /* Pointer into data */ -- *datanext, /* Next key/value pair */ -- *dataend; /* End of entire TXT record */ -- uint8_t datalen; /* Length of current key/value pair */ -- char key[256], /* Key string */ -- value[256], /* Value string */ -- make_and_model[512], -+ char make_and_model[512], - /* Manufacturer and model */ - model[256], /* Model */ -- device_id[2048];/* 1284 device ID */ -- -+ device_id[2048]; /* 1284 device ID */ - - device_id[0] = '\0'; - make_and_model[0] = '\0'; - - strcpy(model, "Unknown"); - -- for (data = rdata, dataend = data + rdlen; -- data < dataend; -- data = datanext) -+ for (;;) - { -- /* -- * Read a key/value pair starting with an 8-bit length. Since the -- * length is 8 bits and the size of the key/value buffers is 256, we -- * don't need to check for overflow... -- */ -- -- datalen = *data++; -- -- if (!datalen || (data + datalen) >= dataend) -- break; -- -- datanext = data + datalen; -- -- for (ptr = key; data < datanext && *data != '='; data ++) -- *ptr++ = *data; -- *ptr = '\0'; -+ char *key; -+ char *value; - -- if (data < datanext && *data == '=') -- { -- data ++; -- -- if (data < datanext) -- memcpy(value, data, datanext - data); -- value[datanext - data] = '\0'; -+ if (parse_txt_record_pair (txt)) -+ goto next; - -- fprintf(stderr, "DEBUG2: query_callback: \"%s=%s\".\n", -- key, value); -- } -- else -- { -- fprintf(stderr, "DEBUG2: query_callback: \"%s\" with no value.\n", -- key); -- continue; -- } -- -- if (!_cups_strncasecmp(key, "usb_", 4)) -+ key = txt->key; -+ value = txt->value; -+ if (!strncasecmp(key, "usb_", 4)) - { - /* - * Add USB device ID information... -@@ -856,6 +1263,10 @@ - if (device->type == CUPS_DEVICE_PRINTER) - device->sent = 1; - } -+ -+ next: -+ if (next_txt_record (txt) == NULL) -+ break; - } - - if (device->device_id) -@@ -905,11 +1316,9 @@ - } - } - -- if (!device) -- fprintf(stderr, "DEBUG: Ignoring TXT record for \"%s\"...\n", fullName); -+ return device; - } - -- - /* - * 'sigterm_handler()' - Handle termination signals... - */ ---- a/config-scripts/cups-dnssd.m4 -+++ b/config-scripts/cups-dnssd.m4 -@@ -23,6 +23,21 @@ - DNSSDLIBS="" - DNSSD_BACKEND="" - -+AC_ARG_ENABLE(avahi, [ --enable-avahi turn on DNS Service Discovery support, default=no], -+ [if test x$enable_avahi = xyes; then -+ AC_MSG_CHECKING(for Avahi) -+ if $PKGCONFIG --exists avahi-client; then -+ AC_MSG_RESULT(yes) -+ CFLAGS="$CFLAGS `$PKGCONFIG --cflags avahi-client`" -+ DNSSDLIBS="`$PKGCONFIG --libs avahi-client`" -+ DNSSD_BACKEND="dnssd" -+ AC_DEFINE(HAVE_AVAHI) -+ enable_dnssd=no -+ else -+ AC_MSG_RESULT(no) -+ fi -+ fi]) -+ - if test x$enable_dnssd != xno; then - AC_CHECK_HEADER(dns_sd.h, [ - case "$uname" in ---- a/config.h.in -+++ b/config.h.in -@@ -390,6 +390,13 @@ - - - /* -+ * Do we have Avahi for DNS Service Discovery? -+ */ -+ -+#undef HAVE_AVAHI -+ -+ -+/* - * Do we have <sys/ioctl.h>? - */ - ---- a/cups/http-support.c -+++ b/cups/http-support.c -@@ -43,6 +43,10 @@ - * http_copy_decode() - Copy and decode a URI. - * http_copy_encode() - Copy and encode a URI. - * http_resolve_cb() - Build a device URI for the given service name. -+ * avahi_resolve_uri_client_cb() -+ * - Avahi client callback for resolving URI. -+ * avahi_resolve_uri_resolver_cb() -+ * - Avahi resolver callback for resolving URI. - */ - - /* -@@ -60,6 +64,11 @@ - # include <sys/select.h> - # endif /* WIN32 */ - #endif /* HAVE_DNSSD */ -+#ifdef HAVE_AVAHI -+# include <avahi-client/client.h> -+# include <avahi-client/lookup.h> -+# include <avahi-common/simple-watch.h> -+#endif /* HAVE_AVAHI */ - - - /* -@@ -127,6 +136,24 @@ - void *context); - #endif /* HAVE_DNSSD */ - -+#ifdef HAVE_AVAHI -+static void avahi_resolve_uri_client_cb(AvahiClient *client, -+ AvahiClientState state, -+ void *simple_poll); -+static void avahi_resolve_uri_resolver_cb(AvahiServiceResolver *resolver, -+ AvahiIfIndex interface, -+ AvahiProtocol protocol, -+ AvahiResolverEvent event, -+ const char *name, -+ const char *type, -+ const char *domain, -+ const char *host_name, -+ const AvahiAddress *address, -+ uint16_t port, -+ AvahiStringList *txt, -+ AvahiLookupResultFlags flags, -+ void *context); -+#endif /* HAVE_AVAHI */ - - /* - * 'httpAssembleURI()' - Assemble a uniform resource identifier from its -@@ -1431,6 +1458,9 @@ - - if (strstr(hostname, "._tcp")) - { -+#if defined(HAVE_DNSSD) || defined(HAVE_AVAHI) -+ char *regtype, /* Pointer to type in hostname */ -+ *domain; /* Pointer to domain in hostname */ - #ifdef HAVE_DNSSD - # ifdef WIN32 - # pragma comment(lib, "dnssd.lib") -@@ -1449,6 +1479,17 @@ - fd_set input_set; /* Input set for select() */ - struct timeval stimeout; /* Timeout value for select() */ - #endif /* HAVE_POLL */ -+#else /* HAVE_AVAHI */ -+ AvahiSimplePoll *simple_poll; -+ AvahiClient *client; -+ int error; -+ struct -+ { -+ AvahiSimplePoll *poll; -+ _http_uribuf_t uribuf; -+ } user_data; -+#endif /* HAVE_DNSSD */ -+ - - if (options & _HTTP_RESOLVE_STDERR) - fprintf(stderr, "DEBUG: Resolving \"%s\"...\n", hostname); -@@ -1485,9 +1526,16 @@ - if (domain) - *domain++ = '\0'; - -+#ifdef HAVE_DNSSD - uribuf.buffer = resolved_uri; - uribuf.bufsize = resolved_size; - uribuf.options = options; -+#else -+ user_data.uribuf.buffer = resolved_uri; -+ user_data.uribuf.bufsize = resolved_size; -+ user_data.uribuf.options = options; -+#endif -+ - resolved_uri[0] = '\0'; - - DEBUG_printf(("6_httpResolveURI: Resolving hostname=\"%s\", regtype=\"%s\", " -@@ -1501,6 +1549,7 @@ - - uri = NULL; - -+#ifdef HAVE_DNSSD - if (DNSServiceCreateConnection(&ref) == kDNSServiceErr_NoError) - { - localref = ref; -@@ -1608,6 +1657,36 @@ - - DNSServiceRefDeallocate(ref); - } -+#else /* HAVE_AVAHI */ -+ if ((simple_poll = avahi_simple_poll_new ()) != NULL) -+ { -+ if ((client = avahi_client_new (avahi_simple_poll_get (simple_poll), -+ 0, avahi_resolve_uri_client_cb, -+ &simple_poll, &error)) != NULL) -+ { -+ user_data.poll = simple_poll; -+ if (avahi_service_resolver_new (client, AVAHI_IF_UNSPEC, -+ AVAHI_PROTO_UNSPEC, hostname, -+ regtype, domain, AVAHI_PROTO_UNSPEC, 0, -+ avahi_resolve_uri_resolver_cb, -+ &user_data) != NULL) -+ { -+ avahi_simple_poll_loop (simple_poll); -+ -+ /* -+ * Collect the result. -+ */ -+ -+ if (resolved_uri[0]) -+ uri = resolved_uri; -+ } -+ -+ avahi_client_free (client); -+ } -+ -+ avahi_simple_poll_free (simple_poll); -+ } -+#endif /* HAVE_DNSSD */ - - if (options & _HTTP_RESOLVE_STDERR) - { -@@ -1619,13 +1698,13 @@ - fputs("STATE: -connecting-to-device,offline-report\n", stderr); - } - --#else -+#else /* HAVE_DNSSD || HAVE_AVAHI */ - /* - * No DNS-SD support... - */ - - uri = NULL; --#endif /* HAVE_DNSSD */ -+#endif /* HAVE_DNSSD || HAVE_AVAHI */ - - if ((options & _HTTP_RESOLVE_STDERR) && !uri) - _cupsLangPrintFilter(stderr, "ERROR", _("Unable to find printer.")); -@@ -1895,6 +1974,116 @@ - #endif /* HAVE_DNSSD */ - - -+#ifdef HAVE_AVAHI -+/* -+ * 'avahi_resolve_uri_client_cb()' - Avahi client callback for resolving URI. -+ */ -+ -+static void -+avahi_resolve_uri_client_cb (AvahiClient *client, -+ AvahiClientState state, -+ void *simple_poll) -+{ -+ DEBUG_printf(("avahi_resolve_uri_client_callback(client=%p, state=%d, " -+ "simple_poll=%p)\n", client, state, simple_poll)); -+ -+ /* -+ * If the connection drops, quit. -+ */ -+ -+ if (state == AVAHI_CLIENT_FAILURE) -+ avahi_simple_poll_quit (simple_poll); -+} -+ -+ -+/* -+ * 'avahi_resolve_uri_resolver_cb()' - Avahi resolver callback for resolving -+ * URI. -+ */ -+ -+static void -+avahi_resolve_uri_resolver_cb (AvahiServiceResolver *resolver, -+ AvahiIfIndex interface, -+ AvahiProtocol protocol, -+ AvahiResolverEvent event, -+ const char *name, -+ const char *type, -+ const char *domain, -+ const char *host_name, -+ const AvahiAddress *address, -+ uint16_t port, -+ AvahiStringList *txt, -+ AvahiLookupResultFlags flags, -+ void *context) -+{ -+ const char *scheme; /* URI scheme */ -+ char rp[256]; /* Remote printer */ -+ AvahiStringList *pair; -+ char *value; -+ size_t valueLen = 0; -+ char addr[AVAHI_ADDRESS_STR_MAX]; -+ struct -+ { -+ AvahiSimplePoll *poll; -+ _http_uribuf_t uribuf; -+ } *poll_uribuf = context; -+ -+ DEBUG_printf(("avahi_resolve_uri_resolver_callback(resolver=%p, " -+ "interface=%d, protocol=%d, event=%d, name=\"%s\", " -+ "type=\"%s\", domain=\"%s\", host_name=\"%s\", address=%p, " -+ "port=%d, txt=%p, flags=%d, context=%p)\n", -+ resolver, interface, protocol, event, name, type, domain, -+ host_name, address, port, txt, flags, context)); -+ -+ if (event != AVAHI_RESOLVER_FOUND) -+ { -+ avahi_service_resolver_free (resolver); -+ avahi_simple_poll_quit (poll_uribuf->poll); -+ return; -+ } -+ -+ /* -+ * Figure out the scheme from the full name... -+ */ -+ -+ if (strstr(type, "_ipp.")) -+ scheme = "ipp"; -+ else if (strstr(type, "_printer.")) -+ scheme = "lpd"; -+ else if (strstr(type, "_pdl-datastream.")) -+ scheme = "socket"; -+ else -+ scheme = "riousbprint"; -+ -+ /* -+ * Extract the "remote printer key from the TXT record... -+ */ -+ -+ if ((pair = avahi_string_list_find (txt, "rp")) != NULL) -+ { -+ avahi_string_list_get_pair (pair, NULL, &value, &valueLen); -+ rp[0] = '/'; -+ memcpy (rp + 1, value, valueLen); -+ rp[valueLen + 1] = '\0'; -+ } -+ else -+ rp[0] = '\0'; -+ -+ /* -+ * Assemble the final device URI... -+ */ -+ -+ avahi_address_snprint (addr, AVAHI_ADDRESS_STR_MAX, address); -+ httpAssembleURI(HTTP_URI_CODING_ALL, poll_uribuf->uribuf.buffer, -+ poll_uribuf->uribuf.bufsize, scheme, NULL, -+ addr, port, rp); -+ DEBUG_printf(("avahi_resolve_uri_resolver_callback: Resolved URI is \"%s\"\n", -+ poll_uribuf->uribuf.buffer)); -+ avahi_simple_poll_quit (poll_uribuf->poll); -+} -+#endif /* HAVE_AVAHI */ -+ -+ - /* - * End of "$Id: http-support.c 9820 2011-06-10 22:06:26Z mike $". - */ ---- a/scheduler/Makefile -+++ b/scheduler/Makefile -@@ -17,6 +17,7 @@ - - CUPSDOBJS = \ - auth.o \ -+ avahi.o \ - banners.o \ - cert.o \ - classes.o \ -@@ -39,7 +40,8 @@ - server.o \ - statbuf.o \ - subscriptions.o \ -- sysman.o -+ sysman.o \ -+ timeout.o - LIBOBJS = \ - filter.o \ - mime.o \ ---- /dev/null -+++ b/scheduler/avahi.c -@@ -0,0 +1,445 @@ -+/* -+ * "$Id$" -+ * -+ * Avahi poll implementation for the CUPS scheduler. -+ * -+ * Copyright (C) 2010 Red Hat, Inc. -+ * Authors: -+ * Tim Waugh <twaugh@redhat.com> -+ * -+ * Distribution and use rights are outlined in the file "LICENSE.txt" -+ * "LICENSE" which should have been included with this file. If this -+ * file is missing or damaged, see the license at "http://www.cups.org/". -+ * -+ * Contents: -+ * -+ * watch_read_cb - Read callback for file descriptor -+ * watch_write_cb - Write callback for file descriptor -+ * watched_fd_add_select() - Call cupsdAddSelect() as needed -+ * watch_new() - Create a new file descriptor watch -+ * watch_free() - Free a file descriptor watch -+ * watch_update() - Update watched events for a file descriptor -+ * watch_get_events() - Get events that happened for a file descriptor -+ * timeout_cb() - Run a timed Avahi callback -+ * timeout_new() - Set a wakeup time -+ * timeout_update() - Update the expiration time for a timeout -+ * timeout_free() - Free a timeout -+ * compare_watched_fds() - Compare watched file descriptors for array sorting -+ * compare_timeouts() - Compare timeouts for array sorting -+ * avahi_cups_poll_new() - Create a new Avahi main loop object for CUPS -+ * avahi_cups_poll_free() - Free an Avahi main loop object for CUPS -+ * avahi_cups_poll_get() - Get the abstract poll API structure -+ */ -+ -+#include <config.h> -+ -+#ifdef HAVE_AVAHI /* Applies to entire file... */ -+ -+/* -+ * Include necessary headers... -+ */ -+ -+#include "cupsd.h" -+ -+#if defined(HAVE_MALLOC_H) && defined(HAVE_MALLINFO) -+# include <malloc.h> -+#endif /* HAVE_MALLOC_H && HAVE_MALLINFO */ -+ -+#ifdef HAVE_AVAHI -+# include <avahi-common/timeval.h> -+#endif /* HAVE_AVAHI */ -+ -+ -+typedef struct -+{ -+ AvahiCupsPoll *cups_poll; -+ -+ int fd; -+ AvahiWatchEvent occurred; -+ cups_array_t *watches; -+} cupsd_watched_fd_t; -+ -+struct AvahiWatch -+{ -+ cupsd_watched_fd_t *watched_fd; -+ -+ AvahiWatchEvent events; -+ AvahiWatchCallback callback; -+ void *userdata; -+}; -+ -+struct AvahiTimeout -+{ -+ AvahiCupsPoll *cups_poll; -+ AvahiTimeoutCallback callback; -+ void *userdata; -+ cupsd_timeout_t *cupsd_timeout; -+}; -+ -+/* -+ * Local functions... -+ */ -+ -+static AvahiWatch * watch_new(const AvahiPoll *api, -+ int fd, -+ AvahiWatchEvent events, -+ AvahiWatchCallback callback, -+ void *userdata); -+static void watch_free(AvahiWatch *watch); -+static void watch_update(AvahiWatch *watch, -+ AvahiWatchEvent events); -+static AvahiWatchEvent watch_get_events(AvahiWatch *watch); -+static int compare_watches(AvahiWatch *p0, -+ AvahiWatch *p1); -+ -+ -+/* -+ * 'watch_read_cb' - Read callback for file descriptor -+ */ -+ -+static void -+watch_read_cb (void *userdata) -+{ -+ AvahiWatch *watch; -+ cupsd_watched_fd_t *watched_fd = userdata; -+ watched_fd->occurred |= AVAHI_WATCH_IN; -+ for (watch = (AvahiWatch *)cupsArrayFirst(watched_fd->watches); -+ watch; -+ watch = (AvahiWatch *)cupsArrayNext(watched_fd->watches)) { -+ if (watch->events & watched_fd->occurred) { -+ (watch->callback) (watch, watched_fd->fd, -+ AVAHI_WATCH_IN, watch->userdata); -+ watched_fd->occurred &= ~AVAHI_WATCH_IN; -+ break; -+ } -+ } -+} -+ -+ -+/* -+ * 'watch_write_cb' - Write callback for file descriptor -+ */ -+ -+static void -+watch_write_cb (void *userdata) -+{ -+ AvahiWatch *watch; -+ cupsd_watched_fd_t *watched_fd = userdata; -+ watched_fd->occurred |= AVAHI_WATCH_OUT; -+ for (watch = (AvahiWatch *)cupsArrayFirst(watched_fd->watches); -+ watch; -+ watch = (AvahiWatch *)cupsArrayNext(watched_fd->watches)) { -+ if (watch->events & watched_fd->occurred) { -+ (watch->callback) (watch, watched_fd->fd, -+ AVAHI_WATCH_OUT, watch->userdata); -+ watched_fd->occurred &= ~AVAHI_WATCH_OUT; -+ break; -+ } -+ } -+} -+ -+ -+/* -+ * 'watched_fd_add_select' - Call cupsdAddSelect() as needed -+ */ -+ -+static int /* O - Watches? */ -+watched_fd_add_select (cupsd_watched_fd_t *watched_fd) -+{ -+ AvahiWatch *watch; -+ cupsd_selfunc_t read_cb = NULL, write_cb = NULL; -+ -+ for (watch = (AvahiWatch *)cupsArrayFirst(watched_fd->watches); -+ watch; -+ watch = (AvahiWatch *)cupsArrayNext(watched_fd->watches)) { -+ if (watch->events & (AVAHI_WATCH_IN | -+ AVAHI_WATCH_ERR | -+ AVAHI_WATCH_HUP)) { -+ read_cb = (cupsd_selfunc_t)watch_read_cb; -+ if (write_cb != NULL) -+ break; -+ } -+ -+ if (watch->events & AVAHI_WATCH_OUT) { -+ write_cb = (cupsd_selfunc_t)watch_write_cb; -+ if (read_cb != NULL) -+ break; -+ } -+ } -+ -+ if (read_cb || write_cb) -+ cupsdAddSelect (watched_fd->fd, read_cb, write_cb, watched_fd); -+ else -+ cupsdRemoveSelect (watched_fd->fd); -+ -+ return (read_cb || write_cb); -+} -+ -+/* -+ * 'watch_new' - Create a new file descriptor watch -+ */ -+ -+static AvahiWatch * -+watch_new (const AvahiPoll *api, -+ int fd, -+ AvahiWatchEvent events, -+ AvahiWatchCallback callback, -+ void *userdata) -+{ -+ cupsd_watched_fd_t key, *watched_fd; -+ AvahiCupsPoll *cups_poll = api->userdata; -+ AvahiWatch *watch = malloc(sizeof(AvahiWatch)); -+ if (watch == NULL) -+ return (NULL); -+ -+ watch->events = events; -+ watch->callback = callback; -+ watch->userdata = userdata; -+ -+ key.fd = fd; -+ watched_fd = cupsArrayFind (cups_poll->watched_fds, &key); -+ if (watched_fd == NULL) { -+ watched_fd = malloc(sizeof(cupsd_watched_fd_t)); -+ if (watched_fd == NULL) { -+ free (watch); -+ return (NULL); -+ } -+ -+ watched_fd->fd = fd; -+ watched_fd->occurred = 0; -+ watched_fd->cups_poll = cups_poll; -+ watched_fd->watches = cupsArrayNew ((cups_array_func_t)compare_watches, -+ NULL); -+ } -+ -+ watch->watched_fd = watched_fd; -+ cupsArrayAdd(watched_fd->watches, watch); -+ watched_fd_add_select (watched_fd); -+ return (watch); -+} -+ -+ -+/* -+ * 'watch_free' - Free a file descriptor watch -+ */ -+ -+static void -+watch_free (AvahiWatch *watch) -+{ -+ cupsd_watched_fd_t *watched_fd = watch->watched_fd; -+ AvahiCupsPoll *cups_poll = watched_fd->cups_poll; -+ -+ cupsArrayRemove (watched_fd->watches, watch); -+ free (watch); -+ -+ if (!watched_fd_add_select (watched_fd)) { -+ /* No more watches */ -+ cupsArrayRemove (cups_poll->watched_fds, watched_fd); -+ free (watched_fd); -+ } -+} -+ -+ -+/* -+ * 'watch_update' - Update watched events for a file descriptor -+ */ -+ -+static void -+watch_update (AvahiWatch *watch, -+ AvahiWatchEvent events) -+{ -+ watch->events = events; -+ watched_fd_add_select (watch->watched_fd); -+} -+ -+ -+/* -+ * 'watch_get_events' - Get events that happened for a file descriptor -+ */ -+ -+static AvahiWatchEvent -+watch_get_events (AvahiWatch *watch) -+{ -+ return (watch->watched_fd->occurred); -+} -+ -+ -+/* -+ * 'compare_watches' - Compare watches for array sorting -+ */ -+ -+static int -+compare_watches (AvahiWatch *p0, -+ AvahiWatch *p1) -+{ -+ if (p0->watched_fd->fd < p1->watched_fd->fd) -+ return (-1); -+ -+ return ((p0->watched_fd->fd == p1->watched_fd->fd) ? 0 : 1); -+} -+ -+ -+/* -+ * 'timeout_cb()' - Run a timed Avahi callback -+ */ -+ -+static void -+timeout_cb (cupsd_timeout_t *cupsd_timeout, void *userdata) -+{ -+ AvahiTimeout *timeout = userdata; -+ (timeout->callback) (timeout, timeout->userdata); -+} -+ -+ -+/* -+ * 'timeout_new' - Set a wakeup time -+ */ -+ -+static AvahiTimeout * -+timeout_new (const AvahiPoll *api, -+ const struct timeval *tv, -+ AvahiTimeoutCallback callback, -+ void *userdata) -+{ -+ AvahiTimeout *timeout; -+ AvahiCupsPoll *cups_poll = api->userdata; -+ -+ timeout = malloc(sizeof(AvahiTimeout)); -+ if (timeout == NULL) -+ return (NULL); -+ -+ timeout->cups_poll = cups_poll; -+ timeout->callback = callback; -+ timeout->userdata = userdata; -+ timeout->cupsd_timeout = cupsdAddTimeout (tv, -+ (cupsd_timeoutfunc_t)timeout_cb, -+ timeout); -+ cupsArrayAdd (cups_poll->timeouts, timeout); -+ return (timeout); -+} -+ -+ -+/* -+ * 'timeout_update' - Update the expiration time for a timeout -+ */ -+ -+static void -+timeout_update (AvahiTimeout *timeout, -+ const struct timeval *tv) -+{ -+ cupsdUpdateTimeout (timeout->cupsd_timeout, tv); -+} -+ -+ -+/* -+ * ' timeout_free' - Free a timeout -+ */ -+ -+static void -+timeout_free (AvahiTimeout *timeout) -+{ -+ cupsArrayRemove (timeout->cups_poll->timeouts, timeout); -+ cupsdRemoveTimeout (timeout->cupsd_timeout); -+ free (timeout); -+} -+ -+ -+/* -+ * 'compare_watched_fds' - Compare watched file descriptors for array sorting -+ */ -+static int -+compare_watched_fds(cupsd_watched_fd_t *p0, -+ cupsd_watched_fd_t *p1) -+{ -+ if (p0->fd != p1->fd) -+ return (p0->fd < p1->fd ? -1 : 1); -+ -+ if (p0 == p1) -+ return (0); -+ -+ return (p0 < p1 ? -1 : 1); -+} -+ -+ -+/* -+ * 'compare_timeouts' - Compare timeouts for array sorting -+ */ -+static int -+compare_timeouts(AvahiTimeout *p0, -+ AvahiTimeout *p1) -+{ -+ /* -+ * Just compare pointers to make it a stable sort. -+ */ -+ -+ if (p0->cupsd_timeout < p1->cupsd_timeout) -+ return (-1); -+ return ((p0->cupsd_timeout == p1->cupsd_timeout) ? 0 : 1); -+} -+ -+ -+/* -+ * 'avahi_cups_poll_new' - Create a new Avahi main loop object for CUPS -+ */ -+ -+AvahiCupsPoll * -+avahi_cups_poll_new (void) -+{ -+ AvahiCupsPoll *cups_poll = malloc(sizeof(AvahiCupsPoll)); -+ if (cups_poll == NULL) -+ return (NULL); -+ -+ cups_poll->watched_fds = cupsArrayNew ((cups_array_func_t)compare_watched_fds, -+ NULL); -+ cups_poll->timeouts = cupsArrayNew ((cups_array_func_t)compare_timeouts, -+ NULL); -+ -+ cups_poll->api.userdata = cups_poll; -+ cups_poll->api.watch_new = watch_new; -+ cups_poll->api.watch_free = watch_free; -+ cups_poll->api.watch_update = watch_update; -+ cups_poll->api.watch_get_events = watch_get_events; -+ -+ cups_poll->api.timeout_new = timeout_new; -+ cups_poll->api.timeout_update = timeout_update; -+ cups_poll->api.timeout_free = timeout_free; -+ -+ return (cups_poll); -+} -+ -+ -+/* -+ * 'avahi_cups_poll_free' - Free an Avahi main loop object for CUPS -+ */ -+void -+avahi_cups_poll_free (AvahiCupsPoll *cups_poll) -+{ -+ cupsd_watched_fd_t *watched_fd; -+ -+ for (watched_fd = (cupsd_watched_fd_t*)cupsArrayFirst(cups_poll->watched_fds); -+ watched_fd; -+ watched_fd = (cupsd_watched_fd_t*)cupsArrayNext(cups_poll->watched_fds)){ -+ cupsArrayClear (watched_fd->watches); -+ } -+ -+ cupsArrayClear (cups_poll->watched_fds); -+ cupsArrayClear (cups_poll->timeouts); -+} -+ -+ -+/* -+ * 'avahi_cups_poll_get' - Get the abstract poll API structure -+ */ -+ -+const AvahiPoll * -+avahi_cups_poll_get (AvahiCupsPoll *cups_poll) -+{ -+ return (&cups_poll->api); -+} -+ -+ -+#endif /* HAVE_AVAHI ... from top of file */ -+ -+/* -+ * End of "$Id$". -+ */ ---- /dev/null -+++ b/scheduler/avahi.h -@@ -0,0 +1,49 @@ -+/* -+ * "$Id$" -+ * -+ * Avahi poll implementation for the CUPS scheduler. -+ * -+ * Copyright (C) 2010 Red Hat, Inc. -+ * Authors: -+ * Tim Waugh <twaugh@redhat.com> -+ * -+ * Distribution and use rights are outlined in the file "LICENSE.txt" -+ * which should have been included with this file. If this file is -+ * file is missing or damaged, see the license at "http://www.cups.org/". -+ */ -+ -+#include <config.h> -+ -+#ifdef HAVE_AVAHI -+# include <avahi-client/client.h> -+# include <avahi-client/publish.h> -+#endif /* HAVE_AVAHI */ -+ -+#ifdef HAVE_AUTHORIZATION_H -+# include <Security/Authorization.h> -+#endif /* HAVE_AUTHORIZATION_H */ -+ -+ -+#ifdef HAVE_AVAHI -+typedef struct -+{ -+ AvahiPoll api; -+ cups_array_t *watched_fds; -+ cups_array_t *timeouts; -+} AvahiCupsPoll; -+#endif /* HAVE_AVAHI */ -+ -+/* -+ * Prototypes... -+ */ -+ -+#ifdef HAVE_AVAHI -+extern AvahiCupsPoll * avahi_cups_poll_new(void); -+extern void avahi_cups_poll_free(AvahiCupsPoll *cups_poll); -+extern const AvahiPoll *avahi_cups_poll_get(AvahiCupsPoll *cups_poll); -+#endif /* HAVE_AVAHI */ -+ -+ -+/* -+ * End of "$Id$". -+ */ ---- a/scheduler/cupsd.h -+++ b/scheduler/cupsd.h -@@ -140,6 +140,15 @@ - - typedef void (*cupsd_selfunc_t)(void *data); - -+#ifdef HAVE_AVAHI -+/* -+ * Timeout callback function type... -+ */ -+ -+typedef struct _cupsd_timeout_s cupsd_timeout_t; -+typedef void (*cupsd_timeoutfunc_t)(cupsd_timeout_t *timeout, void *data); -+#endif /* HAVE_AVAHI */ -+ - - /* - * Globals... -@@ -173,6 +182,11 @@ - /* Running from launchd */ - #endif /* HAVE_LAUNCH_H */ - -+#ifdef HAVE_AVAHI -+VAR cups_array_t *Timeouts; /* Timed callbacks for main loop */ -+#endif /* HAVE_AVAHI */ -+ -+ - - /* - * Prototypes... -@@ -242,6 +256,20 @@ - extern void cupsdStartServer(void); - extern void cupsdStopServer(void); - -+#ifdef HAVE_AVAHI -+extern void cupsdInitTimeouts(void); -+extern cupsd_timeout_t *cupsdAddTimeout (const struct timeval *tv, -+ cupsd_timeoutfunc_t cb, -+ void *data); -+extern cupsd_timeout_t *cupsdNextTimeout (long *delay); -+extern void cupsdRunTimeout (cupsd_timeout_t *timeout); -+extern void cupsdUpdateTimeout (cupsd_timeout_t *timeout, -+ const struct timeval *tv); -+extern void cupsdRemoveTimeout (cupsd_timeout_t *timeout); -+#endif /* HAVE_AVAHI */ -+ -+extern int cupsdRemoveFile(const char *filename); -+ - - /* - * End of "$Id: cupsd.h 9766 2011-05-11 22:17:34Z mike $". ---- a/scheduler/main.c -+++ b/scheduler/main.c -@@ -122,6 +122,10 @@ - cupsd_listener_t *lis; /* Current listener */ - time_t current_time, /* Current time */ - activity, /* Client activity timer */ -+#ifdef HAVE_AVAHI -+ avahi_client_time, /* Time for next Avahi client -+ check */ -+#endif /* HAVE_AVAHI */ - browse_time, /* Next browse send time */ - senddoc_time, /* Send-Document time */ - expire_time, /* Subscription expire time */ -@@ -148,6 +152,10 @@ - int launchd_idle_exit; - /* Idle exit on select timeout? */ - #endif /* HAVE_LAUNCHD */ -+#ifdef HAVE_AVAHI -+ cupsd_timeout_t *tmo; /* Next scheduled timed callback */ -+ long tmo_delay; /* Time before it must be called */ -+#endif /* HAVE_AVAHI */ - - - #ifdef HAVE_GETEUID -@@ -527,6 +535,14 @@ - - httpInitialize(); - -+#ifdef HAVE_AVAHI -+ /* -+ * Initialize timed callback structures. -+ */ -+ -+ cupsdInitTimeouts(); -+#endif /* HAVE_AVAHI */ -+ - cupsdStartServer(); - - /* -@@ -657,6 +673,9 @@ - */ - - current_time = time(NULL); -+#ifdef HAVE_AVAHI -+ avahi_client_time = current_time; -+#endif /* HAVE_AVAHI */ - browse_time = current_time; - event_time = current_time; - expire_time = current_time; -@@ -871,6 +890,26 @@ - } - #endif /* __APPLE__ */ - -+#ifdef HAVE_AVAHI -+ /* -+ * If a timed callback is due, run it. -+ */ -+ -+ tmo = cupsdNextTimeout (&tmo_delay); -+ if (tmo && tmo_delay == 0) -+ cupsdRunTimeout (tmo); -+ -+ /* -+ * Try to restart the Avahi client every 10 seconds if needed... -+ */ -+ -+ if ((current_time - avahi_client_time) >= 10) -+ { -+ avahi_client_time = current_time; -+ cupsdStartAvahiClient(); -+ } -+#endif /* HAVE_AVAHI */ -+ - #ifndef __APPLE__ - /* - * Update the network interfaces once a minute... -@@ -1815,6 +1854,10 @@ - cupsd_job_t *job; /* Job information */ - cupsd_subscription_t *sub; /* Subscription information */ - const char *why; /* Debugging aid */ -+#ifdef HAVE_AVAHI -+ cupsd_timeout_t *tmo; /* Timed callback */ -+ long tmo_delay; /* Seconds before calling it */ -+#endif /* HAVE_AVAHI */ - - - /* -@@ -1857,6 +1900,19 @@ - } - #endif /* __APPLE__ */ - -+#ifdef HAVE_AVAHI -+ /* -+ * See if there are any scheduled timed callbacks to run. -+ */ -+ -+ tmo = cupsdNextTimeout (&tmo_delay); -+ if (tmo) -+ { -+ timeout = tmo_delay; -+ why = "run a timed callback"; -+ } -+#endif /* HAVE_AVAHI */ -+ - /* - * Check whether we are accepting new connections... - */ ---- /dev/null -+++ b/scheduler/timeout.c -@@ -0,0 +1,195 @@ -+/* -+ * "$Id$" -+ * -+ * Timeout functions for the Common UNIX Printing System (CUPS). -+ * -+ * Copyright (C) 2010 Red Hat, Inc. -+ * Authors: -+ * Tim Waugh <twaugh@redhat.com> -+ * -+ * Distribution and use rights are outlined in the file "LICENSE.txt" -+ * which should have been included with this file. If this file is -+ * file is missing or damaged, see the license at "http://www.cups.org/". -+ * -+ * Contents: -+ * -+ * cupsdInitTimeouts() - Initialise timeout structure. -+ * cupsdAddTimeout() - Add a timed callback. -+ * cupsdNextTimeout() - Find the next enabled timed callback. -+ * cupsdUpdateTimeout() - Adjust the time of a timed callback or disable it. -+ * cupsdRemoveTimeout() - Discard a timed callback. -+ * compare_timeouts() - Compare timed callbacks for array sorting. -+ */ -+ -+#include <config.h> -+ -+#ifdef HAVE_AVAHI /* Applies to entire file... */ -+ -+/* -+ * Include necessary headers... -+ */ -+ -+#include "cupsd.h" -+ -+#if defined(HAVE_MALLOC_H) && defined(HAVE_MALLINFO) -+# include <malloc.h> -+#endif /* HAVE_MALLOC_H && HAVE_MALLINFO */ -+ -+#ifdef HAVE_AVAHI -+# include <avahi-common/timeval.h> -+#endif /* HAVE_AVAHI */ -+ -+ -+struct _cupsd_timeout_s -+{ -+ struct timeval when; -+ int enabled; -+ cupsd_timeoutfunc_t callback; -+ void *data; -+}; -+ -+/* -+ * Local functions... -+ */ -+ -+/* -+ * 'compare_timeouts()' - Compare timed callbacks for array sorting. -+ */ -+ -+static int -+compare_timeouts (cupsd_timeout_t *p0, cupsd_timeout_t *p1) -+{ -+ if (!p0->enabled || !p1->enabled) -+ { -+ if (!p0->enabled && !p1->enabled) -+ return (0); -+ -+ return (p0->enabled ? -1 : 1); -+ } -+ -+ return (avahi_timeval_compare (&p0->when, &p1->when)); -+} -+ -+ -+/* -+ * 'cupsdInitTimeouts()' - Initialise timeout structures. -+ */ -+ -+void -+cupsdInitTimeouts(void) -+{ -+ Timeouts = cupsArrayNew ((cups_array_func_t)compare_timeouts, NULL); -+} -+ -+ -+/* -+ * 'cupsdAddTimeout()' - Add a timed callback. -+ */ -+ -+cupsd_timeout_t * /* O - Timeout handle */ -+cupsdAddTimeout(const struct timeval *tv, /* I - Absolute time */ -+ cupsd_timeoutfunc_t cb, /* I - Callback function */ -+ void *data) /* I - User data */ -+{ -+ cupsd_timeout_t *timeout; -+ -+ timeout = malloc (sizeof(cupsd_timeout_t)); -+ if (timeout != NULL) -+ { -+ timeout->enabled = (tv != NULL); -+ if (tv) -+ { -+ timeout->when.tv_sec = tv->tv_sec; -+ timeout->when.tv_usec = tv->tv_usec; -+ } -+ -+ timeout->callback = cb; -+ timeout->data = data; -+ cupsArrayAdd (Timeouts, timeout); -+ } -+ -+ return timeout; -+} -+ -+ -+/* -+ * 'cupsdNextTimeout()' - Find the next enabled timed callback. -+ */ -+ -+cupsd_timeout_t * /* O - Next enabled timeout or NULL */ -+cupsdNextTimeout(long *delay) /* O - Seconds before scheduled */ -+{ -+ cupsd_timeout_t *first = cupsArrayFirst (Timeouts); -+ struct timeval curtime; -+ -+ if (first && !first->enabled) -+ first = NULL; -+ -+ if (first && delay) -+ { -+ gettimeofday (&curtime, NULL); -+ if (avahi_timeval_compare (&curtime, &first->when) > 0) -+ { -+ *delay = 0; -+ } else { -+ *delay = 1 + first->when.tv_sec - curtime.tv_sec; -+ if (first->when.tv_usec < curtime.tv_usec) -+ (*delay)--; -+ } -+ } -+ -+ return (first); -+} -+ -+ -+/* -+ * 'cupsdRunTimeout()' - Run a timed callback. -+ */ -+ -+void -+cupsdRunTimeout(cupsd_timeout_t *timeout) /* I - Timeout */ -+{ -+ if (!timeout) -+ return; -+ timeout->enabled = 0; -+ if (!timeout->callback) -+ return; -+ timeout->callback (timeout, timeout->data); -+} -+ -+/* -+ * 'cupsdUpdateTimeout()' - Adjust the time of a timed callback or disable it. -+ */ -+ -+void -+cupsdUpdateTimeout(cupsd_timeout_t *timeout, /* I - Timeout */ -+ const struct timeval *tv) /* I - Absolute time or NULL */ -+{ -+ cupsArrayRemove (Timeouts, timeout); -+ timeout->enabled = (tv != NULL); -+ if (tv) -+ { -+ timeout->when.tv_sec = tv->tv_sec; -+ timeout->when.tv_usec = tv->tv_usec; -+ } -+ cupsArrayAdd (Timeouts, timeout); -+} -+ -+ -+/* -+ * 'cupsdRemoveTimeout()' - Discard a timed callback. -+ */ -+ -+void -+cupsdRemoveTimeout(cupsd_timeout_t *timeout) /* I - Timeout */ -+{ -+ cupsArrayRemove (Timeouts, timeout); -+ free (timeout); -+} -+ -+ -+#endif /* HAVE_AVAHI ... from top of file */ -+ -+/* -+ * End of "$Id$". -+ */ ---- a/cgi-bin/admin.c -+++ b/cgi-bin/admin.c -@@ -1643,7 +1643,7 @@ - else - local_protocols[0] = '\0'; - --#ifdef HAVE_DNSSD -+#if defined(HAVE_DNSSD) || defined(HAVE_AVAHI) - if (cgiGetVariable("BROWSE_LOCAL_DNSSD")) - { - if (local_protocols[0]) -@@ -1651,7 +1651,7 @@ - else - strcat(local_protocols, "dnssd"); - } --#endif /* HAVE_DNSSD */ -+#endif /* defined(HAVE_DNSSD) || defined(HAVE_AVAHI) */ - - #ifdef HAVE_LDAP - if (cgiGetVariable("BROWSE_LOCAL_LDAP")) -@@ -2718,9 +2718,9 @@ - #endif /* HAVE_GSSAPI */ - cgiSetVariable("KERBEROS", ""); - --#ifdef HAVE_DNSSD -+#if defined(HAVE_DNSSD) || defined(HAVE_AVAHI) - cgiSetVariable("HAVE_DNSSD", "1"); --#endif /* HAVE_DNSSD */ -+#endif /* defined(HAVE_DNSSD) || defined(HAVE_AVAHI) */ - - #ifdef HAVE_LDAP - cgiSetVariable("HAVE_LDAP", "1"); ---- a/scheduler/client.c -+++ b/scheduler/client.c -@@ -4987,7 +4987,7 @@ - !strncmp(host, "[::1]:", 6)); - } - --#ifdef HAVE_DNSSD -+#if defined(HAVE_DNSSD) || defined(HAVE_AVAHI) - /* - * Check if the hostname is something.local (Bonjour); if so, allow it. - */ -@@ -4996,7 +4996,7 @@ - (!_cups_strcasecmp(end, ".local") || !_cups_strncasecmp(end, ".local:", 7) || - !_cups_strcasecmp(end, ".local.") || !_cups_strncasecmp(end, ".local.:", 8))) - return (1); --#endif /* HAVE_DNSSD */ -+#endif /* defined(HAVE_DNSSD) || defined(HAVE_AVAHI) */ - - /* - * Check if the hostname is an IP address... ---- a/scheduler/dirsvc.c -+++ b/scheduler/dirsvc.c -@@ -27,6 +27,7 @@ - * ldap_connect() - Start new LDAP connection - * ldap_reconnect() - Reconnect to LDAP Server - * ldap_disconnect() - Disconnect from LDAP Server -+ * cupsdStartAvahiClient() - Start an Avahi client if needed - * cupsdStartBrowsing() - Start sending and receiving broadcast - * information. - * cupsdStartPolling() - Start polling servers as needed. -@@ -45,6 +46,8 @@ - * printer. - * dnssdPackTxtRecord() - Pack an array of key/value pairs into the TXT - * record format. -+ * avahiPackTxtRecord() - Pack an array of key/value pairs into an -+ * AvahiStringList. - * dnssdRegisterCallback() - DNSServiceRegister callback. - * dnssdRegisterPrinter() - Start sending broadcast information for a - * printer or update the broadcast contents. -@@ -83,6 +86,7 @@ - */ - - #include "cupsd.h" -+#include <assert.h> - #include <grp.h> - - #ifdef HAVE_DNSSD -@@ -97,6 +101,17 @@ - # endif /* HAVE_SYSTEMCONFIGURATION */ - # endif /* __APPLE__ */ - #endif /* HAVE_DNSSD */ -+#ifdef HAVE_AVAHI -+# include <avahi-common/domain.h> -+#endif /* HAVE_AVAHI */ -+ -+ -+#ifdef HAVE_DNSSD -+typedef char *cupsd_txt_record_t; -+#endif /* HAVE_DNSSD */ -+#ifdef HAVE_AVAHI -+typedef AvahiStringList *cupsd_txt_record_t; -+#endif /* HAVE_AVAHI */ - - - /* -@@ -159,27 +174,39 @@ - static void update_smb(int onoff); - - -+#if defined(HAVE_DNSSD) || defined(HAVE_AVAHI) -+static cupsd_txt_record_t dnssdBuildTxtRecord(int *txt_len, cupsd_printer_t *p, -+ int for_lpd); -+static int dnssdComparePrinters(cupsd_printer_t *a, cupsd_printer_t *b); -+static void dnssdDeregisterPrinter(cupsd_printer_t *p); -+static void dnssdRegisterPrinter(cupsd_printer_t *p); -+static void dnssdStop(void); -+#endif /* defined(HAVE_DNSSD) || defined(HAVE_AVAHI) */ -+ - #ifdef HAVE_DNSSD - # ifdef HAVE_COREFOUNDATION - static void dnssdAddAlias(const void *key, const void *value, - void *context); - # endif /* HAVE_COREFOUNDATION */ --static char *dnssdBuildTxtRecord(int *txt_len, cupsd_printer_t *p, -- int for_lpd); --static int dnssdComparePrinters(cupsd_printer_t *a, cupsd_printer_t *b); --static void dnssdDeregisterPrinter(cupsd_printer_t *p); --static char *dnssdPackTxtRecord(int *txt_len, char *keyvalue[][2], -- int count); - static void dnssdRegisterCallback(DNSServiceRef sdRef, - DNSServiceFlags flags, - DNSServiceErrorType errorCode, - const char *name, const char *regtype, - const char *domain, void *context); --static void dnssdRegisterPrinter(cupsd_printer_t *p); --static void dnssdStop(void); - static void dnssdUpdate(void); - #endif /* HAVE_DNSSD */ - -+#ifdef HAVE_AVAHI -+static AvahiStringList *avahiPackTxtRecord(char *keyvalue[][2], -+ int count); -+static void avahi_entry_group_cb (AvahiEntryGroup *group, -+ AvahiEntryGroupState state, -+ void *userdata); -+static void avahi_client_cb (AvahiClient *client, -+ AvahiClientState state, -+ void *userdata); -+#endif /* HAVE_AVAHI */ -+ - #ifdef HAVE_LDAP - static const char * const ldap_attrs[] =/* CUPS LDAP attributes */ - { -@@ -283,10 +310,10 @@ - ldap_dereg_printer(p); - #endif /* HAVE_LDAP */ - --#ifdef HAVE_DNSSD -- if (removeit && (BrowseLocalProtocols & BROWSE_DNSSD) && DNSSDRef) -+#if defined(HAVE_DNSSD) || defined(HAVE_AVAHI) -+ if (removeit && (BrowseLocalProtocols & BROWSE_DNSSD)) - dnssdDeregisterPrinter(p); --#endif /* HAVE_DNSSD */ -+#endif /* defined(HAVE_DNSSD) || defined(HAVE_AVAHI) */ - } - - -@@ -702,10 +729,10 @@ - slpRegisterPrinter(p); */ - #endif /* HAVE_LIBSLP */ - --#ifdef HAVE_DNSSD -- if ((BrowseLocalProtocols & BROWSE_DNSSD) && DNSSDRef) -+#if defined(HAVE_DNSSD) || defined(HAVE_AVAHI) -+ if ((BrowseLocalProtocols & BROWSE_DNSSD)) - dnssdRegisterPrinter(p); --#endif /* HAVE_DNSSD */ -+#endif /* defined(HAVE_DNSSD) || defined(HAVE_AVAHI) */ - } - - -@@ -1419,6 +1446,27 @@ - #endif /* HAVE_LDAP */ - - -+#ifdef HAVE_AVAHI -+/* -+ * 'cupsdStartAvahiClient()' - Start an Avahi client if needed -+ */ -+ -+void -+cupsdStartAvahiClient(void) -+{ -+ if (!AvahiCupsClient && !AvahiCupsClientConnecting) -+ { -+ if (!AvahiCupsPollHandle) -+ AvahiCupsPollHandle = avahi_cups_poll_new (); -+ -+ if (AvahiCupsPollHandle) -+ avahi_client_new (avahi_cups_poll_get (AvahiCupsPollHandle), -+ AVAHI_CLIENT_NO_FAIL, avahi_client_cb, NULL, NULL); -+ } -+} -+#endif /* HAVE_AVAHI */ -+ -+ - /* - * 'cupsdStartBrowsing()' - Start sending and receiving broadcast information. - */ -@@ -1542,13 +1590,16 @@ - else - BrowseSocket = -1; - --#ifdef HAVE_DNSSD -+#if defined(HAVE_DNSSD) || defined(HAVE_AVAHI) - if ((BrowseLocalProtocols | BrowseRemoteProtocols) & BROWSE_DNSSD) - { -+#ifdef HAVE_DNSSD - DNSServiceErrorType error; /* Error from service creation */ -+#endif /* HAVE_DNSSD */ - cupsd_listener_t *lis; /* Current listening socket */ - - -+#ifdef HAVE_DNSSD - /* - * First create a "master" connection for all registrations... - */ -@@ -1573,6 +1624,7 @@ - fcntl(fd, F_SETFD, fcntl(fd, F_GETFD) | FD_CLOEXEC); - - cupsdAddSelect(fd, (cupsd_selfunc_t)dnssdUpdate, NULL, NULL); -+#endif /* HAVE_DNSSD */ - - /* - * Then get the port we use for registrations. If we are not listening -@@ -1606,9 +1658,16 @@ - */ - - cupsdUpdateDNSSDName(); -+ -+#ifdef HAVE_AVAHI -+ cupsdStartAvahiClient (); -+#endif /* HAVE_AVAHI */ -+ -+#ifdef HAVE_DNSSD - } -- } - #endif /* HAVE_DNSSD */ -+ } -+#endif /* defined(HAVE_DNSSD) || defined(HAVE_AVAHI) */ - - #ifdef HAVE_LIBSLP - if ((BrowseLocalProtocols | BrowseRemoteProtocols) & BROWSE_SLP) -@@ -1834,10 +1893,10 @@ - BrowseSocket = -1; - } - --#ifdef HAVE_DNSSD -- if ((BrowseLocalProtocols & BROWSE_DNSSD) && DNSSDRef) -+#if defined(HAVE_DNSSD) || defined(HAVE_AVAHI) -+ if ((BrowseLocalProtocols & BROWSE_DNSSD)) - dnssdStop(); --#endif /* HAVE_DNSSD */ -+#endif /* defined(HAVE_DNSSD) || defined(HAVE_AVAHI) */ - - #ifdef HAVE_LIBSLP - if (((BrowseLocalProtocols | BrowseRemoteProtocols) & BROWSE_SLP) && -@@ -1902,7 +1961,7 @@ - } - - --#ifdef HAVE_DNSSD -+#if defined(HAVE_DNSSD) || defined(HAVE_AVAHI) - /* - * 'cupsdUpdateDNSSDName()' - Update the computer name we use for browsing... - */ -@@ -1910,8 +1969,14 @@ - void - cupsdUpdateDNSSDName(void) - { -+#ifdef HAVE_DNSSD - DNSServiceErrorType error; /* Error from service creation */ - char webif[1024]; /* Web interface share name */ -+#endif /* HAVE_DNSSD */ -+#ifdef HAVE_AVAHI -+ int ret; /* Error from service creation */ -+ char webif[AVAHI_LABEL_MAX]; /* Web interface share name */ -+#endif /* HAVE_AVAHI */ - # ifdef HAVE_SYSTEMCONFIGURATION - SCDynamicStoreRef sc; /* Context for dynamic store */ - CFDictionaryRef btmm; /* Back-to-My-Mac domains */ -@@ -2042,6 +2107,7 @@ - else - strlcpy(webif, "CUPS Web Interface", sizeof(webif)); - -+#ifdef HAVE_DNSSD - if (WebIFRef) - DNSServiceRefDeallocate(WebIFRef); - -@@ -2054,9 +2120,45 @@ - NULL)) != kDNSServiceErr_NoError) - cupsdLogMessage(CUPSD_LOG_ERROR, - "DNS-SD web interface registration failed: %d", error); -+#endif /* HAVE_DNSSD */ -+ -+#ifdef HAVE_AVAHI -+ if (!AvahiCupsClient) -+ /* -+ * Client not yet running. -+ */ -+ return; -+ -+ if (AvahiWebIFGroup) -+ avahi_entry_group_reset (AvahiWebIFGroup); -+ else -+ AvahiWebIFGroup = avahi_entry_group_new (AvahiCupsClient, -+ avahi_entry_group_cb, -+ NULL); -+ -+ if (AvahiWebIFGroup) -+ { -+ ret = avahi_entry_group_add_service (AvahiWebIFGroup, -+ AVAHI_IF_UNSPEC, -+ AVAHI_PROTO_UNSPEC, -+ 0, /* flags */ -+ webif, /* name */ -+ "_http._tcp", /* type */ -+ NULL, /* domain */ -+ NULL, /* host */ -+ DNSSDPort, /* port */ -+ "path=/", NULL); -+ if (ret == 0) -+ ret = avahi_entry_group_commit (AvahiWebIFGroup); -+ -+ if (ret != 0) -+ cupsdLogMessage (CUPSD_LOG_ERROR, -+ "Avahi web interface registration failed: %d", ret); -+ } -+#endif /* HAVE_AVAHI */ - } - } --#endif /* HAVE_DNSSD */ -+#endif /* defined(HAVE_DNSSD) || defined(HAVE_AVAHI) */ - - - #ifdef HAVE_LDAP -@@ -2334,13 +2436,15 @@ - "Bad Back to My Mac domain in dynamic store!"); - } - # endif /* HAVE_COREFOUNDATION */ -+#endif /* HAVE_DNSSD */ - - -+#if defined(HAVE_DNSSD) || defined(HAVE_AVAHI) - /* - * 'dnssdBuildTxtRecord()' - Build a TXT record from printer info. - */ - --static char * /* O - TXT record */ -+static cupsd_txt_record_t /* O - TXT record */ - dnssdBuildTxtRecord( - int *txt_len, /* O - TXT record length */ - cupsd_printer_t *p, /* I - Printer information */ -@@ -2379,7 +2483,12 @@ - keyvalue[i ][0] = "ty"; - keyvalue[i++][1] = p->make_model ? p->make_model : "Unknown"; - -- snprintf(admin_hostname, sizeof(admin_hostname), "%s.local.", DNSSDHostName); -+ snprintf(admin_hostname, sizeof(admin_hostname), -+ "%s.local" -+#ifdef HAVE_DNSSD -+ "." /* terminating dot no good for Avahi */ -+#endif /* HAVE_DNSSD */ -+ , DNSSDHostName); - httpAssembleURIf(HTTP_URI_CODING_ALL, adminurl_str, sizeof(adminurl_str), - "http", NULL, admin_hostname, DNSSDPort, "/%s/%s", - (p->type & CUPS_PRINTER_CLASS) ? "classes" : "printers", -@@ -2462,7 +2571,12 @@ - * Then pack them into a proper txt record... - */ - -+#ifdef HAVE_DNSSD - return (dnssdPackTxtRecord(txt_len, keyvalue, i)); -+#endif /* HAVE_DNSSD */ -+#ifdef HAVE_AVAHI -+ return (avahiPackTxtRecord(keyvalue, i)); -+#endif /* HAVE_AVAHI */ - } - - -@@ -2474,7 +2588,16 @@ - dnssdComparePrinters(cupsd_printer_t *a,/* I - First printer */ - cupsd_printer_t *b)/* I - Second printer */ - { -- return (_cups_strcasecmp(a->reg_name, b->reg_name)); -+ if (!a->reg_name) -+ if (!b->reg_name) -+ return 0; -+ else -+ return -1; -+ else -+ if (!b->reg_name) -+ return 1; -+ else -+ return (_cups_strcasecmp(a->reg_name, b->reg_name)); - } - - -@@ -2489,6 +2612,10 @@ - { - cupsdLogMessage(CUPSD_LOG_DEBUG2, "dnssdDeregisterPrinter(%s)", p->name); - -+#ifdef HAVE_DNSSD -+ if (!DNSSDRef) -+ return; -+ - /* - * Closing the socket deregisters the service - */ -@@ -2524,6 +2651,24 @@ - free(p->printer_txt); - p->printer_txt = NULL; - } -+#endif /* HAVE_DNSSD */ -+ -+#ifdef HAVE_AVAHI -+ if (p->avahi_group) -+ { -+ avahi_entry_group_reset (p->avahi_group); -+ avahi_entry_group_free (p->avahi_group); -+ p->avahi_group = NULL; -+ -+ if (p->ipp_txt) -+ avahi_string_list_free (p->ipp_txt); -+ -+ if (p->printer_txt) -+ avahi_string_list_free (p->printer_txt); -+ -+ p->ipp_txt = p->printer_txt = NULL; -+ } -+#endif /* HAVE_AVAHI */ - - /* - * Remove the printer from the array of DNS-SD printers, then clear the -@@ -2533,8 +2678,10 @@ - cupsArrayRemove(DNSSDPrinters, p); - cupsdClearString(&p->reg_name); - } -+#endif /* defined(HAVE_DNSSD) || defined(HAVE_AVAHI) */ - - -+#ifdef HAVE_DNSSD - /* - * 'dnssdPackTxtRecord()' - Pack an array of key/value pairs into the - * TXT record format. -@@ -2644,8 +2791,10 @@ - LastEvent |= CUPSD_EVENT_PRINTER_MODIFIED; - } - } -+#endif /* HAVE_DNSSD */ - - -+#if defined(HAVE_DNSSD) || defined(HAVE_AVAHI) - /* - * 'dnssdRegisterPrinter()' - Start sending broadcast information for a printer - * or update the broadcast contents. -@@ -2654,20 +2803,40 @@ - static void - dnssdRegisterPrinter(cupsd_printer_t *p)/* I - Printer */ - { -+#ifdef HAVE_DNSSD - DNSServiceErrorType se; /* dnssd errors */ - char *ipp_txt, /* IPP TXT record buffer */ - *printer_txt, /* LPD TXT record buffer */ -- name[1024], /* Service name */ -- *nameptr; /* Pointer into name */ -+ name[1024]; /* Service name */ - int ipp_len, /* IPP TXT record length */ - printer_len, /* LPD TXT record length */ - printer_port; /* LPD port number */ -+#endif /* HAVE_DNSSD */ -+#ifdef HAVE_AVAHI -+ int ret; /* Error code */ -+ AvahiStringList *ipp_txt, /* IPP TXT record */ -+ *printer_txt; /* LPD TXT record */ -+ char name[AVAHI_LABEL_MAX], /* Service name */ -+ fullsubtype[AVAHI_LABEL_MAX]; /* Full subtype */ -+ char *regtype_copy, /* Writeable copy of reg type */ -+ *subtype, /* Current service sub type */ -+ *nextsubtype; /* Next service sub type */ -+#endif /* HAVE_AVAHI */ -+ char *nameptr; /* Pointer into name */ - const char *regtype; /* Registration type */ - - -+#ifdef HAVE_DNSSD -+ if (!DNSSDRef) -+ return; -+ - cupsdLogMessage(CUPSD_LOG_DEBUG2, "dnssdRegisterPrinter(%s) %s", p->name, - !p->ipp_ref ? "new" : "update"); -- -+#endif /* HAVE_DNSSD */ -+#ifdef HAVE_AVAHI -+ cupsdLogMessage(CUPSD_LOG_DEBUG2, "dnssdRegisterPrinter(%s) %s", p->name, -+ !p->avahi_group ? "new" : "update"); -+#endif /* HAVE_AVAHI */ - /* - * If per-printer sharing was just disabled make sure we're not - * registered before returning. -@@ -2686,12 +2855,36 @@ - if (p->info && strlen(p->info) > 0) - { - if (DNSSDComputerName) -- snprintf(name, sizeof(name), "%s @ %s", p->info, DNSSDComputerName); -+ { -+ /* -+ * Make sure there is room for at least 15 characters of -+ * DNSSDComputerName. -+ */ -+ -+ assert(sizeof(name) >= 15 + 4); -+ nameptr = name + strlcpy(name, p->info, -+ sizeof(name) - 4 - -+ strnlen(DNSSDComputerName, 15)); -+ nameptr += strlcpy(nameptr, " @ ", sizeof(name) - (nameptr - name)); -+ strlcpy(nameptr, DNSSDComputerName, sizeof(name) - (nameptr - name)); -+ } - else - strlcpy(name, p->info, sizeof(name)); - } - else if (DNSSDComputerName) -- snprintf(name, sizeof(name), "%s @ %s", p->name, DNSSDComputerName); -+ { -+ /* -+ * Make sure there is room for at least 15 characters of -+ * DNSSDComputerName. -+ */ -+ -+ assert(sizeof(name) >= 15 + 4); -+ nameptr = name + strlcpy(name, p->info, -+ sizeof(name) - 4 - -+ strnlen(DNSSDComputerName, 15)); -+ nameptr += strlcpy(nameptr, " @ ", sizeof(name) - (nameptr - name)); -+ strlcpy(nameptr, DNSSDComputerName, sizeof(name) - (nameptr - name)); -+ } - else - strlcpy(name, p->name, sizeof(name)); - -@@ -2712,6 +2905,7 @@ - * Register IPP and (optionally) LPD... - */ - -+#ifdef HAVE_DNSSD - ipp_len = 0; /* anti-compiler-warning-code */ - ipp_txt = dnssdBuildTxtRecord(&ipp_len, p, 0); - -@@ -2884,6 +3078,209 @@ - - if (printer_txt) - free(printer_txt); -+#endif /* HAVE_DNSSD */ -+#ifdef HAVE_AVAHI -+ if (!AvahiCupsClient) -+ /* -+ * Client not running yet. The client callback will call us again later. -+ */ -+ return; -+ -+ ipp_txt = dnssdBuildTxtRecord(NULL, p, 0); -+ printer_txt = dnssdBuildTxtRecord(NULL, p, 1); -+ regtype = (p->type & CUPS_PRINTER_FAX) ? "_fax-ipp._tcp" : DNSSDRegType; -+ -+ if (p->avahi_group && p->ipp_txt && ipp_txt && -+ !avahi_string_list_equal (p->ipp_txt, ipp_txt)) -+ { -+ /* -+ * Update the existing registration... -+ */ -+ -+ avahi_string_list_free (p->ipp_txt); -+ -+ if (p->printer_txt) -+ avahi_string_list_free (p->printer_txt); -+ -+ /* -+ * Update the service group entry. -+ */ -+ -+ regtype_copy = strdup (regtype); -+ subtype = strchr (regtype_copy, ','); -+ if (subtype) -+ *subtype = '\0'; -+ -+ cupsdLogMessage (CUPSD_LOG_DEBUG, -+ "Updating TXT record for %s (%s)", name, regtype_copy); -+ ret = avahi_entry_group_update_service_txt_strlst (p->avahi_group, -+ AVAHI_IF_UNSPEC, -+ AVAHI_PROTO_UNSPEC, -+ 0, name, -+ regtype_copy, -+ NULL, ipp_txt); -+ free (regtype_copy); -+ -+ if (ret < 0) -+ goto update_failed; -+ -+ p->ipp_txt = ipp_txt; -+ ipp_txt = NULL; -+ -+ if (BrowseLocalProtocols & BROWSE_LPD) -+ { -+ ret = avahi_entry_group_update_service_txt_strlst (p->avahi_group, -+ AVAHI_IF_UNSPEC, -+ AVAHI_PROTO_UNSPEC, -+ 0, name, -+ "_printer._tcp", NULL, -+ printer_txt); -+ if (ret < 0) -+ goto update_failed; -+ -+ p->printer_txt = printer_txt; -+ printer_txt = NULL; -+ } -+ -+ ret = avahi_entry_group_commit (p->avahi_group); -+ if (ret < 0) -+ { -+ update_failed: -+ cupsdLogMessage (CUPSD_LOG_ERROR, -+ "Failed to update TXT record for %s: %d", -+ name, ret); -+ avahi_entry_group_reset (p->avahi_group); -+ avahi_entry_group_free (p->avahi_group); -+ p->avahi_group = NULL; -+ ipp_txt = p->ipp_txt; -+ p->ipp_txt = NULL; -+ } -+ } -+ -+ if (!p->avahi_group) -+ { -+ /* -+ * Initial registration. Use the _fax subtype for fax queues... -+ */ -+ -+ p->avahi_group = avahi_entry_group_new (AvahiCupsClient, -+ avahi_entry_group_cb, -+ p); -+ -+ cupsdLogMessage(CUPSD_LOG_DEBUG, -+ "Registering Avahi printer %s with name \"%s\" and " -+ "type \"%s\"", p->name, name, regtype); -+ -+ if (!p->avahi_group) -+ { -+ ret = 0; -+ goto add_failed; -+ } -+ -+ /* -+ * Add each service type (DNSSDRegType may contain several, -+ * separated by commas). -+ */ -+ -+ subtype = regtype_copy = strdup (regtype); -+ while (subtype && *subtype) -+ { -+ nextsubtype = strchr (subtype, ','); -+ if (nextsubtype) -+ *nextsubtype++ = '\0'; -+ -+ if (subtype == regtype_copy) -+ { -+ /* -+ * Main type entry. -+ */ -+ -+ cupsdLogMessage (CUPSD_LOG_DEBUG, -+ "Adding TXT record for %s (%s)", name, regtype_copy); -+ ret = avahi_entry_group_add_service_strlst (p->avahi_group, -+ AVAHI_IF_UNSPEC, -+ AVAHI_PROTO_UNSPEC, -+ 0, name, regtype_copy, -+ NULL, NULL, -+ DNSSDPort, -+ ipp_txt); -+ } -+ else -+ { -+ /* -+ * Sub-type entry. -+ */ -+ -+ snprintf (fullsubtype, sizeof(fullsubtype), -+ "%s._sub.%s", subtype, regtype_copy); -+ cupsdLogMessage (CUPSD_LOG_DEBUG, -+ "Adding TXT record for %s (%s)", name, fullsubtype); -+ ret = avahi_entry_group_add_service_subtype (p->avahi_group, -+ AVAHI_IF_UNSPEC, -+ AVAHI_PROTO_UNSPEC, -+ 0, name, -+ regtype_copy, -+ NULL, fullsubtype); -+ } -+ -+ if (ret < 0) -+ { -+ free (regtype_copy); -+ goto add_failed; -+ } -+ -+ subtype = nextsubtype; -+ } -+ -+ free (regtype_copy); -+ p->ipp_txt = ipp_txt; -+ ipp_txt = NULL; -+ -+ if (BrowseLocalProtocols & BROWSE_LPD) -+ { -+ cupsdLogMessage(CUPSD_LOG_DEBUG, -+ "Registering Avahi printer %s with name \"%s\" and " -+ "type \"_printer._tcp\"", p->name, name); -+ -+ ret = avahi_entry_group_add_service_strlst (p->avahi_group, -+ AVAHI_IF_UNSPEC, -+ AVAHI_PROTO_UNSPEC, -+ 0, name, -+ "_printer._tcp", NULL, NULL, -+ 515, -+ printer_txt); -+ if (ret < 0) -+ goto add_failed; -+ -+ p->printer_txt = printer_txt; -+ printer_txt = NULL; -+ } -+ -+ ret = avahi_entry_group_commit (p->avahi_group); -+ -+ if (ret < 0) -+ { -+ add_failed: -+ cupsdLogMessage (CUPSD_LOG_ERROR, -+ "Failed to add Avahi entry for %s: %d", -+ name, ret); -+ if (p->avahi_group) -+ { -+ avahi_entry_group_reset (p->avahi_group); -+ avahi_entry_group_free (p->avahi_group); -+ p->avahi_group = NULL; -+ } -+ ipp_txt = p->ipp_txt; -+ p->ipp_txt = NULL; -+ } -+ } -+ -+ if (ipp_txt) -+ avahi_string_list_free (ipp_txt); -+ -+ if (printer_txt) -+ avahi_string_list_free (printer_txt); -+#endif /* HAVE_AVAHI */ - } - - -@@ -2896,6 +3293,10 @@ - { - cupsd_printer_t *p; /* Current printer */ - -+#ifdef HAVE_DNSSD -+ if (!DNSSDRef) -+ return; -+#endif /* HAVE_DNSSD */ - - /* - * De-register the individual printers -@@ -2906,6 +3307,7 @@ - p = (cupsd_printer_t *)cupsArrayNext(Printers)) - dnssdDeregisterPrinter(p); - -+#ifdef HAVE_DNSSD - /* - * Shutdown the rest of the service refs... - */ -@@ -2926,14 +3328,17 @@ - - DNSServiceRefDeallocate(DNSSDRef); - DNSSDRef = NULL; -+#endif /* HAVE_DNSSD */ - - cupsArrayDelete(DNSSDPrinters); - DNSSDPrinters = NULL; - - DNSSDPort = 0; - } -+#endif /* defined(HAVE_DNSSD) || defined(HAVE_AVAHI) */ - - -+#ifdef HAVE_DNSSD - /* - * 'dnssdUpdate()' - Handle DNS-SD queries. - */ -@@ -2955,6 +3360,147 @@ - #endif /* HAVE_DNSSD */ - - -+#ifdef HAVE_AVAHI -+/* -+ * 'avahiPackTxtRecord()' - Pack an array of key/value pairs into an -+ * AvahiStringList. -+ */ -+ -+static AvahiStringList * /* O - new string list */ -+avahiPackTxtRecord(char *keyvalue[][2], /* I - Table of key value pairs */ -+ int count) /* I - Number of items in table */ -+{ -+ AvahiStringList *strlst = NULL; -+ char **elements; -+ size_t len; -+ int i = 0; -+ -+ elements = malloc ((1 + count) * sizeof (char *)); -+ if (!elements) -+ goto cleanup; -+ -+ for (i = 0; i < count; i++) -+ { -+ len = (1 + strlen (keyvalue[i][0]) + -+ (keyvalue[i][1] ? 1 + strlen (keyvalue[i][1]) : 1)); -+ elements[i] = malloc (len * sizeof (char)); -+ if (!elements[i]) -+ goto cleanup; -+ -+ snprintf (elements[i], len, "%s=%s", keyvalue[i][0], keyvalue[i][1]); -+ } -+ -+ strlst = avahi_string_list_new_from_array ((const char **) elements, count); -+ -+cleanup: -+ while (--i >= 0) -+ free (elements[i]); -+ -+ free (elements); -+ return (strlst); -+} -+ -+ -+/* -+ * 'avahi_entry_group_cb()' - Avahi entry group callback function. -+ */ -+static void -+avahi_entry_group_cb (AvahiEntryGroup *group, -+ AvahiEntryGroupState state, -+ void *userdata) -+{ -+ char *name; -+ -+ if (userdata) -+ name = ((cupsd_printer_t *) userdata)->reg_name; -+ else -+ name = "CUPS web interface"; -+ -+ switch (state) -+ { -+ case AVAHI_ENTRY_GROUP_UNCOMMITED: -+ case AVAHI_ENTRY_GROUP_REGISTERING: -+ break; -+ -+ case AVAHI_ENTRY_GROUP_ESTABLISHED: -+ cupsdLogMessage (CUPSD_LOG_DEBUG, -+ "Avahi entry group established for %s", name); -+ break; -+ -+ default: -+ cupsdLogMessage (CUPSD_LOG_DEBUG, -+ "Avahi entry group %s has state %d", -+ name, state); -+ break; -+ } -+} -+ -+ -+/* -+ * 'avahi_client_cb()' - Avahi client callback function. -+ */ -+static void -+avahi_client_cb (AvahiClient *client, -+ AvahiClientState state, -+ void *userdata) -+{ -+ cupsd_printer_t *printer; -+ switch (state) -+ { -+ case AVAHI_CLIENT_S_RUNNING: -+ /* -+ * Avahi client started successfully. -+ */ -+ AvahiCupsClient = client; -+ AvahiCupsClientConnecting = 0; -+ cupsdLogMessage (CUPSD_LOG_DEBUG, "Avahi client started"); -+ -+ cupsdUpdateDNSSDName (); -+ -+ for (printer = (cupsd_printer_t *)cupsArrayFirst(Printers); -+ printer; -+ printer = (cupsd_printer_t *)cupsArrayNext(Printers)) -+ if (Browsing && (BrowseLocalProtocols & BROWSE_DNSSD) && -+ (!(printer->type & (CUPS_PRINTER_REMOTE | CUPS_PRINTER_IMPLICIT | -+ CUPS_PRINTER_SCANNER))) && printer->shared) -+ dnssdRegisterPrinter (printer); -+ -+ break; -+ -+ case AVAHI_CLIENT_CONNECTING: -+ /* -+ * No Avahi daemon, client is waiting. -+ */ -+ AvahiCupsClientConnecting = 1; -+ cupsdLogMessage (CUPSD_LOG_DEBUG, "Avahi client connecting"); -+ break; -+ -+ case AVAHI_CLIENT_FAILURE: -+ /* -+ * Avahi client failed, close it to allow a clean restart. -+ */ -+ cupsdLogMessage (CUPSD_LOG_ERROR, -+ "Avahi client failed, " -+ "closing client to allow a clean restart"); -+ -+ for (printer = (cupsd_printer_t *)cupsArrayFirst(Printers); -+ printer; -+ printer = (cupsd_printer_t *)cupsArrayNext(Printers)) -+ dnssdDeregisterPrinter (printer); -+ -+ avahi_client_free(client); -+ AvahiCupsClientConnecting = 0; -+ AvahiCupsClient = NULL; -+ -+ break; -+ -+ default: -+ cupsdLogMessage (CUPSD_LOG_DEBUG, "Avahi client state: %d", state); -+ } -+} -+#endif /* HAVE_AVAHI */ -+ -+ - /* - * 'get_auth_info_required()' - Get the auth-info-required value to advertise. - */ ---- a/scheduler/dirsvc.h -+++ b/scheduler/dirsvc.h -@@ -31,6 +31,10 @@ - # endif /* HAVE_LDAP_SSL_H */ - #endif /* HAVE_LDAP */ - -+#ifdef HAVE_AVAHI -+# include <avahi-client/publish.h> -+#endif /* HAVE_AVAHI */ -+ - /* - * Browse protocols... - */ -@@ -131,19 +135,22 @@ - VAR cupsd_statbuf_t *PollStatusBuffer VALUE(NULL); - /* Status buffer for pollers */ - --#ifdef HAVE_DNSSD -+#if defined(HAVE_DNSSD) || defined(HAVE_AVAHI) - VAR char *DNSSDComputerName VALUE(NULL), - /* Computer/server name */ - *DNSSDHostName VALUE(NULL), - /* Hostname */ - *DNSSDRegType VALUE(NULL); - /* Bonjour registration type */ --VAR cups_array_t *DNSSDAlias VALUE(NULL); -- /* List of dynamic ServerAlias's */ - VAR int DNSSDPort VALUE(0); - /* Port number to register */ - VAR cups_array_t *DNSSDPrinters VALUE(NULL); - /* Printers we have registered */ -+#endif /* defined(HAVE_DNSSD) || defined(HAVE_AVAHI) */ -+ -+#ifdef HAVE_DNSSD -+VAR cups_array_t *DNSSDAlias VALUE(NULL); -+ /* List of dynamic ServerAlias's */ - VAR DNSServiceRef DNSSDRef VALUE(NULL), - /* Master DNS-SD service reference */ - WebIFRef VALUE(NULL), -@@ -152,6 +159,17 @@ - /* Remote printer browse reference */ - #endif /* HAVE_DNSSD */ - -+#ifdef HAVE_AVAHI -+VAR AvahiCupsPoll *AvahiCupsPollHandle VALUE(NULL); -+ /* AvahiCupsPoll object */ -+VAR AvahiClient *AvahiCupsClient VALUE(NULL); -+ /* AvahiClient object */ -+VAR int AvahiCupsClientConnecting VALUE(0); -+ /* Is AvahiClient object connecting? */ -+VAR AvahiEntryGroup *AvahiWebIFGroup VALUE(NULL); -+ /* Web interface entry group */ -+#endif /* HAVE_AVAHI */ -+ - #ifdef HAVE_LIBSLP - VAR SLPHandle BrowseSLPHandle VALUE(NULL); - /* SLP API handle */ -@@ -195,13 +213,14 @@ - extern void cupsdRestartPolling(void); - extern void cupsdSaveRemoteCache(void); - extern void cupsdSendBrowseList(void); -+extern void cupsdStartAvahiClient(void); - extern void cupsdStartBrowsing(void); - extern void cupsdStartPolling(void); - extern void cupsdStopBrowsing(void); - extern void cupsdStopPolling(void); --#ifdef HAVE_DNSSD -+#if defined(HAVE_DNSSD) || defined(HAVE_AVAHI) - extern void cupsdUpdateDNSSDName(void); --#endif /* HAVE_DNSSD */ -+#endif /* defined(HAVE_DNSSD) || defined(HAVE_AVAHI) */ - #ifdef HAVE_LDAP - extern void cupsdUpdateLDAPBrowse(void); - #endif /* HAVE_LDAP */ ---- a/scheduler/ipp.c -+++ b/scheduler/ipp.c -@@ -6087,7 +6087,7 @@ - ippAddDate(con->response, IPP_TAG_PRINTER, "printer-current-time", - ippTimeToDate(curtime)); - --#ifdef HAVE_DNSSD -+#if defined(HAVE_DNSSD) || defined(HAVE_AVAHI) - if (!ra || cupsArrayFind(ra, "printer-dns-sd-name")) - { - if (printer->reg_name) -@@ -6097,7 +6097,7 @@ - ippAddInteger(con->response, IPP_TAG_PRINTER, IPP_TAG_NOVALUE, - "printer-dns-sd-name", 0); - } --#endif /* HAVE_DNSSD */ -+#endif /* defined(HAVE_DNSSD) || defined(HAVE_AVAHI) */ - - if (!ra || cupsArrayFind(ra, "printer-error-policy")) - ippAddString(con->response, IPP_TAG_PRINTER, IPP_TAG_NAME, ---- a/scheduler/printers.c -+++ b/scheduler/printers.c -@@ -883,9 +883,9 @@ - cupsdClearString(&p->alert); - cupsdClearString(&p->alert_description); - --#ifdef HAVE_DNSSD -+#if defined(HAVE_DNSSD) || defined(HAVE_AVAHI) - cupsdClearString(&p->pdl); --#endif /* HAVE_DNSSD */ -+#endif /* defined(HAVE_DNSSD) || defined(HAVE_AVAHI) */ - - cupsArrayDelete(p->filetypes); - -@@ -3765,7 +3765,7 @@ - attr->values[i].string.text = _cupsStrAlloc(mimetype); - } - --#ifdef HAVE_DNSSD -+#if defined(HAVE_DNSSD) || defined(HAVE_AVAHI) - { - char pdl[1024]; /* Buffer to build pdl list */ - mime_filter_t *filter; /* MIME filter looping var */ -@@ -3821,7 +3821,7 @@ - - cupsdSetString(&p->pdl, pdl); - } --#endif /* HAVE_DNSSD */ -+#endif /* defined(HAVE_DNSSD) || defined(HAVE_AVAHI) */ - } - - ---- a/scheduler/printers.h -+++ b/scheduler/printers.h -@@ -16,6 +16,9 @@ - #ifdef HAVE_DNSSD - # include <dns_sd.h> - #endif /* HAVE_DNSSD */ -+#ifdef HAVE_AVAHI -+# include "avahi.h" -+#endif /* HAVE_AVAHI */ - #include <cups/pwg-private.h> - - -@@ -95,16 +98,23 @@ - time_t marker_time; /* Last time marker attributes were updated */ - _ppd_cache_t *pc; /* PPD cache and mapping data */ - --#ifdef HAVE_DNSSD -+#if defined(HAVE_DNSSD) || defined(HAVE_AVAHI) - char *reg_name, /* Name used for service registration */ -- *pdl, /* pdl value for TXT record */ -- *ipp_txt, /* IPP TXT record contents */ -+ *pdl; /* pdl value for TXT record */ -+#endif /* defined(HAVE_DNSSD) || defined(HAVE_AVAHI) */ -+#ifdef HAVE_DNSSD -+ char *ipp_txt, /* IPP TXT record contents */ - *printer_txt; /* LPD TXT record contents */ - int ipp_len, /* IPP TXT record length */ - printer_len; /* LPD TXT record length */ - DNSServiceRef ipp_ref, /* Reference for _ipp._tcp,_cups */ - printer_ref; /* Reference for _printer._tcp */ - #endif /* HAVE_DNSSD */ -+#ifdef HAVE_AVAHI -+ AvahiStringList *ipp_txt, /* IPP TXT record */ -+ *printer_txt; /* LPD TXT record */ -+ AvahiEntryGroup *avahi_group; /* Avahi entry group */ -+#endif /* HAVE_AVAHI */ - }; - - ---- a/scheduler/conf.c -+++ b/scheduler/conf.c -@@ -650,7 +650,7 @@ - Browsing = CUPS_DEFAULT_BROWSING; - DefaultShared = CUPS_DEFAULT_DEFAULT_SHARED; - --#ifdef HAVE_DNSSD -+#if defined(HAVE_DNSSD) || defined(HAVE_AVAHI) - cupsdSetString(&DNSSDRegType, "_ipp._tcp,_cups"); - #endif /* HAVE_DNSSD */ - diff --git a/libre/kdenetwork-libre/PKGBUILD b/libre/kdenetwork-libre/PKGBUILD index 2f4b4c21c..c6b7d2826 100644 --- a/libre/kdenetwork-libre/PKGBUILD +++ b/libre/kdenetwork-libre/PKGBUILD @@ -1,4 +1,4 @@ -# $Id: PKGBUILD 147895 2012-01-28 10:36:24Z andrea $ +# $Id: PKGBUILD 150223 2012-02-15 09:34:48Z andrea $ # Maintainer: Andrea Scarpino <andrea@archlinux.org> # Contributor: Pierre Schmitz <pierre@archlinux.de> @@ -11,7 +11,7 @@ pkgname=('kdenetwork-filesharing' 'kdenetwork-krdc' 'kdenetwork-krfb') pkgver=4.8.0 -pkgrel=1 +pkgrel=2 arch=('i686' 'x86_64' 'mips64el') url='http://www.kde.org' license=('GPL' 'LGPL' 'FDL') @@ -19,7 +19,7 @@ groups=('kde' 'kdenetwork') makedepends=('cmake' 'automoc4' 'boost' 'speex' 'ortp' 'libotr' 'ppp' 'qca-ossl' 'kdebase-workspace' 'kdebase-lib' 'libvncserver' 'libmsn' 'v4l-utils' 'libidn' 'rdesktop' 'qimageblitz' 'libxdamage' 'libgadu' - 'telepathy-qt4' 'libktorrent' 'libmms' 'mediastreamer') + 'libktorrent' 'libmms' 'mediastreamer') source=("http://repo.parabolagnulinux.org/other/${pkgbase}-libre-${pkgver}.tar.xz") sha1sums=('2472128aef671e3474505cf65397dfc7ef9f79bb') @@ -103,7 +103,7 @@ package_kdenetwork-kppp() { package_kdenetwork-krdc() { pkgdesc='Remote Desktop Client' - depends=('kdebase-runtime' 'libvncserver' 'rdesktop' 'telepathy-qt4') + depends=('kdebase-runtime' 'libvncserver' 'rdesktop') optdepends=('kdebase-keditbookmarks: to edit bookmarks') url="http://kde.org/applications/internet/krdc/" cd $srcdir/build/krdc diff --git a/libre/seamonkey-libre/seamonkey-appversion.patch b/libre/seamonkey-libre/seamonkey-appversion.patch deleted file mode 100644 index 0c34cf477..000000000 --- a/libre/seamonkey-libre/seamonkey-appversion.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -Nur comm-1.9.1.orig/suite/installer/Makefile.in comm-1.9.1/suite/installer/Makefile.in ---- comm-1.9.1.orig/suite/installer/Makefile.in 2010-01-04 23:01:34.000000000 +0200 -+++ comm-1.9.1/suite/installer/Makefile.in 2010-01-11 22:38:44.000000000 +0200 -@@ -42,6 +42,8 @@ - - include $(DEPTH)/config/autoconf.mk - -+MOZ_APP_VERSION="2.0" -+ - NO_PKG_FILES = \ - $(MOZ_APP_NAME)-config \ - xpcshell* \ diff --git a/libre/texlive-bin-libre/PKGBUILD b/libre/texlive-bin-libre/PKGBUILD index 7c0ad2d27..7c1a159b0 100644 --- a/libre/texlive-bin-libre/PKGBUILD +++ b/libre/texlive-bin-libre/PKGBUILD @@ -6,7 +6,7 @@ pkgname=texlive-bin-libre pkgver=2011.3 _luatex_ver=0.70.1 -pkgrel=4 +pkgrel=4.1 pkgdesc="TeX Live binaries" license=('GPL') arch=('i686' 'x86_64' 'mips64el') @@ -16,7 +16,7 @@ optdepends=('ed: for texconfig') provides=('lcdf-typetools' 'kpathsea' 'xindy' 'pdfjam' 'texlive-bin') conflicts=('pdfjam' 'texlive-bin') replaces=('texlive-bin') -options=('!libtool') +options=('!libtool' '!strip') url='http://tug.org/texlive/' install="texlive.install" source=('texmf.cnf' @@ -49,6 +49,11 @@ md5sums=('220a4f4cc0d915bf8fcbcb553dcee1ae' 'e7f0197559ef865d8c01683dab3b8526') build() { + if [ "${CARCH}" != "i686" ]; then + export CFLAGS="${CFLAGS} -fPIC" + export CXXFLAGS="${CXXFLAGS} -fPIC" + fi + cd "$srcdir" # Building LuaTeX # cd luatex-beta-${_luatex_ver} @@ -60,7 +65,7 @@ build() { ../source/configure --prefix=/usr -C \ --disable-native-texlive-build \ --with-banner-add="/Parabola GNU/Linux-libre" \ - --disable-cxx-runtime-hack \ + --enable-cxx-runtime-hack \ --disable-all-pkgs \ --disable-dump-share \ --disable-ptex \ @@ -215,12 +220,12 @@ package() { echo "--> Proceeding with make install ..." echo "-------------------------------------------------------" cd Work - make DESTDIR=${pkgdir} texmf="$pkgdir"/usr/share/texmf install + make DESTDIR="${pkgdir}" texmf="$pkgdir"/usr/share/texmf install rm -rf "${pkgdir}"/usr/{texmf,share/texmf-dist} # replace upstream texmf.cnf with ours rm -f "$pkgdir"/usr/share/texmf/web2c/texmf.cnf - install -m644 "$srcdir"/texmf.cnf $pkgdir/etc/texmf/web2c/texmf.cnf + install -m644 "$srcdir"/texmf.cnf "$pkgdir"/etc/texmf/web2c/texmf.cnf # since the location of texmf.cnf is hard-wired to be under /usr/share/texmf/web2c # we make a symlink from /etc/texmf/web2c/texmf.cnf to the latter ln -sf /etc/texmf/web2c/texmf.cnf "$pkgdir"/usr/share/texmf/web2c/texmf.cnf @@ -230,15 +235,15 @@ package() { sed -i -e '/aleph/d' "$pkgdir"/usr/share/texmf/web2c/fmtutil.cnf ## install luatex binary - cd "$srcdir"/luatex/build/texk/web2c - ./libtool --mode=install install -m755 luatex "$pkgdir"/usr/bin/ + #install -m755 "$srcdir"/luatex-beta-${_luatex_ver}/build/texk/web2c/luatex "$pkgdir"/usr/bin/ + install -m755 "$srcdir"/luatex/build/texk/web2c/luatex "$pkgdir"/usr/bin/ cd "$pkgdir"/usr/bin /bin/ln -s luatex texlua /bin/ln -s luatex texluac ## install Perl libraries - mkdir -p $pkgdir/usr/share/tlpkg/TeXLive - install -m644 ${srcdir}/source/utils/biber/TeXLive/*.pm $pkgdir/usr/share/tlpkg/TeXLive + mkdir -p "$pkgdir"/usr/share/tlpkg/TeXLive + install -m644 "${srcdir}"/source/utils/biber/TeXLive/*.pm "$pkgdir"/usr/share/tlpkg/TeXLive # create symlinks for formats echo "--> Create symlinks for TeX formats ..." diff --git a/libre/virtualbox-libre/18-system-xorg.patch b/libre/virtualbox-libre/18-system-xorg.patch deleted file mode 100644 index baca4bc5b..000000000 --- a/libre/virtualbox-libre/18-system-xorg.patch +++ /dev/null @@ -1,278 +0,0 @@ -Description: Build the X.Org driver only for the selected system X Server version. -Author: Michael Meskes <meskes@debian.org>, Felix Geyer <debfx-pkg@fobos.de> - -diff --git a/src/VBox/Additions/common/VBoxGuestLib/Makefile.kmk b/src/VBox/Additions/common/VBoxGuestLib/Makefile.kmk ---- a/src/VBox/Additions/common/VBoxGuestLib/Makefile.kmk -+++ b/src/VBox/Additions/common/VBoxGuestLib/Makefile.kmk -@@ -40,8 +40,8 @@ LIBRARIES += \ - VBoxGuestR3LibShared - ifndef VBOX_ONLY_TESTSUITE - if1of ($(KBUILD_TARGET), freebsd linux netbsd openbsd) -- LIBRARIES += \ -- VBoxGuestR3LibXFree86 -+# LIBRARIES += \ -+# VBoxGuestR3LibXFree86 - endif - endif - LIBRARIES.win.amd64 += VBoxGuestR3Lib-x86 VBoxGuestR3LibShared-x86 -diff --git a/src/VBox/Additions/common/crOpenGL/Makefile.kmk b/src/VBox/Additions/common/crOpenGL/Makefile.kmk ---- a/src/VBox/Additions/common/crOpenGL/Makefile.kmk -+++ b/src/VBox/Additions/common/crOpenGL/Makefile.kmk -@@ -63,16 +63,12 @@ VBoxOGL_TEMPLATE = VBOXCROGLR3GUESTDLL - VBoxOGL_INCS = . - if1of ($(KBUILD_TARGET), linux solaris freebsd) - VBoxOGL_INCS += \ -- $(VBOX_PATH_X11_ROOT)/libXdamage-1.1 \ -- $(VBOX_PATH_X11_ROOT)/libXcomposite-0.4.0 \ -- $(VBOX_PATH_X11_ROOT)/libXfixes-4.0.3 \ -- $(VBOX_PATH_X11_ROOT)/damageproto-1.1.0 \ -- $(VBOX_PATH_X11_ROOT)/compositeproto-0.4 \ -- $(VBOX_PATH_X11_ROOT)/fixesproto-4.0 \ -- $(VBOX_PATH_X11_ROOT)/libx11-1.1.5-other \ -- $(VBOX_PATH_X11_ROOT)/1.3/xorg \ -+ /usr/include/x11 \ -+ /usr/include/xorg \ -+ /usr/include/pixman-1 \ - $(VBOX_MESA_INCS) \ -- $(PATH_ROOT)/src/VBox/Additions/x11/x11include/libdrm-2.4.13 -+ /usr/include/drm \ -+ /usr/include/libdrm - VBoxOGL_DEFS += VBOX_NO_NATIVEGL - endif - -diff --git a/src/VBox/Additions/x11/Makefile.kmk b/src/VBox/Additions/x11/Makefile.kmk ---- a/src/VBox/Additions/x11/Makefile.kmk -+++ b/src/VBox/Additions/x11/Makefile.kmk -@@ -17,6 +17,10 @@ - SUB_DEPTH = ../../../.. - include $(KBUILD_PATH)/subheader.kmk - -+ifn1of ($(XSERVER_VERSION), 13 14 15 16 17 18 19 110) -+ XSERVER_VERSION := 17 -+endif -+ - # Include sub-makefiles. - if1of ($(KBUILD_TARGET), freebsd linux netbsd openbsd solaris) - include $(PATH_SUB_CURRENT)/VBoxClient/Makefile.kmk -diff --git a/src/VBox/Additions/x11/vboxmouse/Makefile.kmk b/src/VBox/Additions/x11/vboxmouse/Makefile.kmk ---- a/src/VBox/Additions/x11/vboxmouse/Makefile.kmk -+++ b/src/VBox/Additions/x11/vboxmouse/Makefile.kmk -@@ -23,7 +23,6 @@ include $(KBUILD_PATH)/subheader.kmk - # vboxmouse_drv - # - if1of ($(KBUILD_TARGET), linux) -- SYSMODS += vboxmouse_drv - vboxmouse_drv_TEMPLATE = VBOXGUESTR3XF86MOD - vboxmouse_drv_DEFS.linux = linux - vboxmouse_drv_DEFS.x86 += __i386__ -@@ -59,7 +58,6 @@ endif - # - # vboxmouse_drv_70 - # --DLLS += vboxmouse_drv_70 - vboxmouse_drv_70_TEMPLATE = VBOXGUESTR3XORGMOD - vboxmouse_drv_70_DEFS = \ - XFree86Server IN_MODULE XFree86Module XFree86LOADER XINPUT XORG_7X IN_XF86_MODULE -@@ -80,7 +78,6 @@ vboxmouse_drv_70_SOURCES = \ - # - # vboxmouse_drv_71 - # --DLLS += vboxmouse_drv_71 - vboxmouse_drv_71_TEMPLATE = VBOXGUESTR3XORGMOD - vboxmouse_drv_71_DEFS := $(vboxmouse_drv_70_DEFS) - vboxmouse_drv_71_INCS := \ -@@ -97,7 +94,6 @@ vboxmouse_drv_71_SOURCES = \ - # - # vboxmouse_drv_13 - # --DLLS += vboxmouse_drv_13 - vboxmouse_drv_13_TEMPLATE = VBOXGUESTR3XORGMOD - vboxmouse_drv_13_DEFS := $(vboxmouse_drv_70_DEFS) NO_ANSIC - vboxmouse_drv_13_INCS := \ -@@ -112,7 +108,6 @@ vboxmouse_drv_13_SOURCES = \ - # - # vboxmouse_drv_14 - # --DLLS += vboxmouse_drv_14 - vboxmouse_drv_14_TEMPLATE = VBOXGUESTR3XORGMOD - vboxmouse_drv_14_DEFS := $(vboxmouse_drv_70_DEFS) NO_ANSIC - vboxmouse_drv_14_INCS := \ -@@ -126,7 +121,6 @@ endif - # - # vboxmouse_drv_15 - # --DLLS += vboxmouse_drv_15 - vboxmouse_drv_15_TEMPLATE = VBOXGUESTR3XORGMOD - vboxmouse_drv_15_DEFS := $(vboxmouse_drv_70_DEFS) NO_ANSIC - vboxmouse_drv_15_INCS := \ -@@ -141,7 +135,6 @@ vboxmouse_drv_15_SOURCES = \ - # - # vboxmouse_drv_16 - # --DLLS += vboxmouse_drv_16 - vboxmouse_drv_16_TEMPLATE = VBOXGUESTR3XORGMOD - vboxmouse_drv_16_DEFS := $(vboxmouse_drv_70_DEFS) NO_ANSIC - vboxmouse_drv_16_INCS := \ -@@ -157,7 +150,6 @@ vboxmouse_drv_16_SOURCES = \ - # - # vboxmouse_drv_17 - # --DLLS += vboxmouse_drv_17 - vboxmouse_drv_17_TEMPLATE = VBOXGUESTR3XORGMOD - vboxmouse_drv_17_DEFS := $(vboxmouse_drv_70_DEFS) NO_ANSIC - ## @todo replace $(VBOX_PATH_X11_ROOT)/xorg-server-1.6.0-local -@@ -177,7 +169,6 @@ vboxmouse_drv_17_SOURCES = \ - # - # vboxmouse_drv_18 - # --DLLS += vboxmouse_drv_18 - vboxmouse_drv_18_TEMPLATE = VBOXGUESTR3XORGMOD - vboxmouse_drv_18_DEFS := $(vboxmouse_drv_70_DEFS) NO_ANSIC - ## @todo replace $(VBOX_PATH_X11_ROOT)/xorg-server-1.6.0-local -@@ -197,7 +188,6 @@ vboxmouse_drv_18_SOURCES = \ - # - # vboxmouse_drv_19 - # --DLLS += vboxmouse_drv_19 - vboxmouse_drv_19_TEMPLATE = VBOXGUESTR3XORGMOD - vboxmouse_drv_19_DEFS := $(vboxmouse_drv_70_DEFS) NO_ANSIC - ## @todo replace $(VBOX_PATH_X11_ROOT)/xorg-server-1.6.0-local -@@ -217,7 +207,6 @@ vboxmouse_drv_19_SOURCES = \ - # - # vboxmouse_drv_110 - # --DLLS += vboxmouse_drv_110 - vboxmouse_drv_110_TEMPLATE = VBOXGUESTR3XORGMOD - vboxmouse_drv_110_DEFS := $(vboxmouse_drv_70_DEFS) NO_ANSIC - ## @todo replace $(VBOX_PATH_X11_ROOT)/xorg-server-1.6.0-local -@@ -234,6 +224,14 @@ vboxmouse_drv_110_SOURCES = \ - vboxmouse_15.c - - -+vboxmouse_drv_$(XSERVER_VERSION)_NAME := vboxmouse_drv -+vboxmouse_drv_$(XSERVER_VERSION)_INCS := \ -+ /usr/include/x11 \ -+ /usr/include/xorg \ -+ /usr/include/pixman-1 -+DLLS += vboxmouse_drv_$(XSERVER_VERSION) -+ -+ - # Check the undefined symbols in the X.Org modules against lists of allowed - # symbols. Not very elegant, but it will catch problems early. - ifdef VBOX_WITH_TESTCASES -diff --git a/src/VBox/Additions/x11/vboxvideo/Makefile.kmk b/src/VBox/Additions/x11/vboxvideo/Makefile.kmk ---- a/src/VBox/Additions/x11/vboxvideo/Makefile.kmk -+++ b/src/VBox/Additions/x11/vboxvideo/Makefile.kmk -@@ -22,7 +22,6 @@ include $(KBUILD_PATH)/subheader.kmk - # vboxvideo_drv - # - if1of ($(KBUILD_TARGET), linux) -- SYSMODS += vboxvideo_drv - endif # target linux - vboxvideo_drv_TEMPLATE = VBOXGUESTR3XF86MOD - vboxvideo_drv_DEFS.linux = linux -@@ -89,7 +88,6 @@ endif # target linux - # base keywords instead of using .solaris or .linux. - # Also it is *important* to use := and not = when deriving a property. - # --DLLS += vboxvideo_drv_70 - vboxvideo_drv_70_TEMPLATE = VBOXGUESTR3XORGMOD - if1of ($(KBUILD_TARGET), linux) - vboxvideo_drv_70_CFLAGS += \ -@@ -112,7 +110,6 @@ vboxvideo_drv_70_SOURCES = $(vboxvideo_drv_SOURCES) - # - # vboxvideo_drv_71 - # --DLLS += vboxvideo_drv_71 - vboxvideo_drv_71_TEMPLATE = VBOXGUESTR3XORGMOD - vboxvideo_drv_71_CFLAGS := $(vboxvideo_drv_70_CFLAGS) - vboxvideo_drv_71_DEFS := $(vboxvideo_drv_70_DEFS) -@@ -127,7 +124,6 @@ vboxvideo_drv_71_SOURCES = $(vboxvideo_drv_SOURCES) - # - # vboxvideo_drv_13 - # --DLLS += vboxvideo_drv_13 - vboxvideo_drv_13_TEMPLATE = VBOXGUESTR3XORGMOD - vboxvideo_drv_13_CFLAGS := $(vboxvideo_drv_70_CFLAGS) - vboxvideo_drv_13_DEFS := $(vboxvideo_drv_70_DEFS) VBOXVIDEO_13 -@@ -146,7 +142,6 @@ vboxvideo_drv_13_SOURCES = \ - # - # vboxvideo_drv_14 - # --DLLS += vboxvideo_drv_14 - vboxvideo_drv_14_TEMPLATE = VBOXGUESTR3XORGMOD - vboxvideo_drv_14_CFLAGS := $(vboxvideo_drv_70_CFLAGS) - vboxvideo_drv_14_DEFS := $(vboxvideo_drv_13_DEFS) -@@ -165,7 +160,6 @@ vboxvideo_drv_14_SOURCES = $(vboxvideo_drv_13_SOURCES) - # - # vboxvideo_drv_15 - # --DLLS += vboxvideo_drv_15 - vboxvideo_drv_15_TEMPLATE = VBOXGUESTR3XORGMOD - vboxvideo_drv_15_CFLAGS := $(vboxvideo_drv_70_CFLAGS) - vboxvideo_drv_15_DEFS := $(vboxvideo_drv_13_DEFS) NO_ANSIC PCIACCESS \ -@@ -192,7 +186,6 @@ endif - # - # vboxvideo_drv_16 - # --DLLS += vboxvideo_drv_16 - vboxvideo_drv_16_TEMPLATE = VBOXGUESTR3XORGMOD - vboxvideo_drv_16_CFLAGS := $(vboxvideo_drv_70_CFLAGS) - vboxvideo_drv_16_DEFS := $(vboxvideo_drv_15_DEFS) -@@ -212,7 +205,6 @@ vboxvideo_drv_16_SOURCES := $(vboxvideo_drv_15_SOURCES) - # - # vboxvideo_drv_17 - # --DLLS += vboxvideo_drv_17 - vboxvideo_drv_17_TEMPLATE = VBOXGUESTR3XORGMOD - vboxvideo_drv_17_CFLAGS := $(vboxvideo_drv_70_CFLAGS) - vboxvideo_drv_17_DEFS := $(vboxvideo_drv_15_DEFS) -@@ -239,7 +231,6 @@ vboxvideo_drv_17_SOURCES := $(vboxvideo_drv_15_SOURCES) - # - # vboxvideo_drv_18 - # --DLLS += vboxvideo_drv_18 - vboxvideo_drv_18_TEMPLATE = VBOXGUESTR3XORGMOD - vboxvideo_drv_18_CFLAGS := $(vboxvideo_drv_70_CFLAGS) - vboxvideo_drv_18_DEFS := $(vboxvideo_drv_15_DEFS) -@@ -266,7 +257,6 @@ vboxvideo_drv_18_SOURCES := $(vboxvideo_drv_15_SOURCES) - # - # vboxvideo_drv_19 - # --DLLS += vboxvideo_drv_19 - vboxvideo_drv_19_TEMPLATE = VBOXGUESTR3XORGMOD - vboxvideo_drv_19_CFLAGS := $(vboxvideo_drv_70_CFLAGS) - vboxvideo_drv_19_DEFS := $(vboxvideo_drv_15_DEFS) -@@ -293,7 +282,6 @@ vboxvideo_drv_19_SOURCES := $(vboxvideo_drv_15_SOURCES) - # - # vboxvideo_drv_110 - # --DLLS += vboxvideo_drv_110 - vboxvideo_drv_110_TEMPLATE = VBOXGUESTR3XORGMOD - vboxvideo_drv_110_CFLAGS := $(vboxvideo_drv_70_CFLAGS) - vboxvideo_drv_110_DEFS := $(vboxvideo_drv_15_DEFS) -@@ -317,6 +306,23 @@ vboxvideo_drv_110_INCS = \ - vboxvideo_drv_110_SOURCES := $(vboxvideo_drv_15_SOURCES) - - -+vboxvideo_drv_$(XSERVER_VERSION)_NAME := vboxvideo_drv -+vboxvideo_drv_$(XSERVER_VERSION)_INCS := \ -+ /usr/include/xorg \ -+ /usr/include/x11 \ -+ /usr/include/pixman-1 \ -+ /usr/include/X11/dri \ -+ /usr/include/drm \ -+ /usr/include/libdrm -+vboxvideo_drv_$(XSERVER_VERSION)_INCS += $(PATH_ROOT)/src/VBox/Runtime/include -+DLLS += vboxvideo_drv_$(XSERVER_VERSION) -+ -+# required for lenny backports -+ifeq ($(XSERVER_VERSION),14) -+ vboxvideo_drv_$(XSERVER_VERSION)_INCS += $(VBOX_PATH_X11_XORG_1_4)/xorg -+endif -+ -+ - # Check the undefined symbols in the X.Org modules against lists of allowed - # symbols. Not very elegant, but it will catch problems early. - ifdef VBOX_WITH_TESTCASES - diff --git a/libre/virtualbox-libre/60-vboxguest.rules b/libre/virtualbox-libre/60-vboxguest.rules deleted file mode 100644 index d64575709..000000000 --- a/libre/virtualbox-libre/60-vboxguest.rules +++ /dev/null @@ -1,3 +0,0 @@ -ACTION=="add", KERNEL=="vboxguest", SUBSYSTEM=="misc", OWNER="root", MODE="0600" -ACTION=="add", KERNEL=="vboxuser", SUBSYSTEM=="misc", OWNER="root", MODE="0666" - diff --git a/libre/virtualbox-libre/virtualbox-4-makeself-check.patch b/libre/virtualbox-libre/virtualbox-4-makeself-check.patch deleted file mode 100644 index 57862b41e..000000000 --- a/libre/virtualbox-libre/virtualbox-4-makeself-check.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- VirtualBox-4.0.0_OSE/configure -+++ VirtualBox-4.0.0_OSE/configure -@@ -2527,7 +2527,6 @@ - check_compiler_h - [ "$BUILD_MACHINE" = "amd64" -a $WITH_VMMRAW -eq 1 ] && check_32bit - # tools/common/makeself* -- [ $OSE -ge 1 ] && check_makeself - fi - - [ -n "$SETUP_WINE" ] && setup_wine - diff --git a/libre/virtualbox-libre/virtualbox-4-mkisofs-check.patch b/libre/virtualbox-libre/virtualbox-4-mkisofs-check.patch deleted file mode 100644 index d43962148..000000000 --- a/libre/virtualbox-libre/virtualbox-4-mkisofs-check.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- VirtualBox-4.0.0_OSE/configure -+++ VirtualBox-4.0.0_OSE/configure -@@ -2499,7 +2499,6 @@ - # don't check for yasm for the time beeing as 0.40 and 0.50 both have known bugs - # [ "$OS" != "darwin" ] && check_yasm - [ "$OS" != "darwin" ] && check_xsltproc --[ "$OS" != "darwin" ] && check_mkisofs - - # the libraries - [ "$OS" != "darwin" ] && check_pthread - diff --git a/libre/virtualbox-libre/virtualbox-parabola-modules.install b/libre/virtualbox-libre/virtualbox-parabola-modules.install deleted file mode 100644 index 75d28784a..000000000 --- a/libre/virtualbox-libre/virtualbox-parabola-modules.install +++ /dev/null @@ -1,25 +0,0 @@ -KERNEL_VERSION='3.0-LIBRE' - -post_install() { - cat << EOM - -===> virtualbox-parabola-modules post-install message: -===> -===> You may want to load vboxguest, vboxsf and vboxvideo -===> -===> To load them automatically, add them -===> to the MODULES array in /etc/rc.conf. - -EOM - - depmod -v $KERNEL_VERSION >/dev/null 2>&1 -} - -post_remove() { - depmod -v $KERNEL_VERSION >/dev/null 2>&1 -} - -post_upgrade() { - depmod -v $KERNEL_VERSION >/dev/null 2>&1 -} - diff --git a/libre/virtualbox-parabola-modules/60-vboxguest.rules b/libre/virtualbox-parabola-modules/60-vboxguest.rules deleted file mode 100644 index 6285f7249..000000000 --- a/libre/virtualbox-parabola-modules/60-vboxguest.rules +++ /dev/null @@ -1,2 +0,0 @@ -ACTION=="add", KERNEL=="vboxguest", SUBSYSTEM=="misc", OWNER="root", MODE="0600" -ACTION=="add", KERNEL=="vboxuser", SUBSYSTEM=="misc", OWNER="root", MODE="0666" diff --git a/libre/virtualbox-parabola-modules/LocalConfig.kmk b/libre/virtualbox-parabola-modules/LocalConfig.kmk deleted file mode 100644 index af79f90cd..000000000 --- a/libre/virtualbox-parabola-modules/LocalConfig.kmk +++ /dev/null @@ -1,19 +0,0 @@ -VBOX_WITH_ADDITION_DRIVERS = -VBOX_WITH_INSTALLER = 1 -VBOX_WITH_LINUX_ADDITIONS = 1 -VBOX_WITH_X11_ADDITIONS = -VBOX_WITH_TESTCASES = -VBOX_WITH_TESTSUITE = -VBOX_WITH_ORIGIN := -VBOX_PATH_APP_PRIVATE_ARCH := /usr/lib/virtualbox -VBOX_PATH_SHARED_LIBS := $(VBOX_PATH_APP_PRIVATE_ARCH) -VBOX_WITH_RUNPATH := $(VBOX_PATH_APP_PRIVATE_ARCH) -VBOX_PATH_APP_PRIVATE := /usr/share/virtualbox -VBOX_PATH_APP_DOCS := /usr/share/virtualbox -VBOX_WITH_REGISTRATION_REQUEST = -VBOX_WITH_UPDATE_REQUEST = -VBOX_WITH_VNC := 1 -VBOX_BLD_PYTHON = python2 -VBOX_JAVA_HOME = /usr/lib/jvm/java-6-openjdk -VBOX_GCC_WERR = -VBOX_GCC_WARN = diff --git a/libre/virtualbox-parabola-modules/PKGBUILD b/libre/virtualbox-parabola-modules/PKGBUILD deleted file mode 100644 index d077c092a..000000000 --- a/libre/virtualbox-parabola-modules/PKGBUILD +++ /dev/null @@ -1,103 +0,0 @@ -# $Id: PKGBUILD 57345 2011-10-26 09:57:11Z ibiru $ -#Maintainer: Ionut Biru <ibiru@archlinux.org> - -pkgbase=virtualbox-modules -pkgname=('virtualbox-modules' 'virtualbox-parabola-modules') -pkgver=4.1.4 -pkgrel=3.1 -arch=('i686' 'x86_64') -url='http://virtualbox.org' -license=('GPL') -makedepends=('libstdc++5' 'bin86' 'dev86' 'iasl' 'libxslt' 'libxml2' 'libpng' 'libidl2' 'xalan-c' 'sdl' 'linux-headers' 'linux-libre') -[[ $CARCH == "x86_64" ]] && makedepends=("${makedepends[@]}" 'gcc-multilib' 'lib32-glibc') -source=(http://download.virtualbox.org/virtualbox/${pkgver}/VirtualBox-${pkgver}.tar.bz2 - LocalConfig.kmk 60-vboxguest.rules) -md5sums=('dc6e6801b3823332b6ca2e9915221aae' - '4c88bd122677a35f68abd76eb01b378b' - 'ed1341881437455d9735875ddf455fbe') - -_extramodules=extramodules-3.1-LIBRE - -build() { - _kernver="$(cat /lib/modules/${_extramodules}/version)" - - export KERN_DIR=/lib/modules/${_kernver}/build - export KERN_INCL=/usr/src/linux-${_kernver}/include/ - - cd "$srcdir/VirtualBox-${pkgver}_OSE" - - cp "$srcdir/LocalConfig.kmk" . - - ./configure \ - --with-linux=/usr/src/linux-${_kernver} \ - --disable-java \ - --disable-docs \ - --disable-xpcom \ - --disable-python \ - --disable-sdl-ttf \ - --disable-alsa \ - --disable-pulse \ - --disable-dbus \ - --disable-opengl \ - --build-headless \ - --nofatal - source ./env.sh - kmk all - - make -C "$srcdir/VirtualBox-${pkgver}_OSE/out/linux.$BUILD_PLATFORM_ARCH/release/bin/src" - make -C "$srcdir/VirtualBox-${pkgver}_OSE/out/linux.$BUILD_PLATFORM_ARCH/release/bin/additions/src" -} - -package_virtualbox-parabola-modules(){ - pkgdesc="Additions only for Parabola guests (kernel modules)" - license=('GPL') - install=virtualbox-parabola-modules.install - depends=('linux>=3.1' 'linux<3.2') - replaces=('virtualbox-guest-modules' 'virtualbox-archlinux-modules') - conflicts=('virtualbox-guest-modules' 'virtualbox-archlinux-modules') - provides=("virtualbox-archlinux-modules=$pkgver") - - source "$srcdir/VirtualBox-${pkgver}_OSE/env.sh" - - cd "$srcdir/VirtualBox-${pkgver}_OSE/out/linux.$BUILD_PLATFORM_ARCH/release/bin/additions/src" - - for module in vboxguest.ko vboxsf.ko vboxvideo.ko; do - install -D -m644 ${module} \ - "$pkgdir/lib/modules/${_extramodules}/${module}" - done - - install -D -m 0644 "$srcdir/60-vboxguest.rules" \ - "$pkgdir/lib/udev/rules.d/60-vboxguest.rules" - - find "${pkgdir}" -name '*.ko' -exec gzip -9 {} \; - - sed -i -e "s/EXTRAMODULES='.*'/EXTRAMODULES='${_extramodules}'/" "$startdir/virtualbox-parabola-modules.install" -} - -package_virtualbox-modules(){ - pkgdesc="Kernel modules for VirtualBox" - license=('GPL') - install=virtualbox-modules.install - depends=('linux>=3.1' 'linux<3.2') - - source "$srcdir/VirtualBox-${pkgver}_OSE/env.sh" - - - cd "$srcdir/VirtualBox-${pkgver}_OSE/out/linux.$BUILD_PLATFORM_ARCH/release/bin/src" - - install -D -m644 vboxdrv.ko \ - "$pkgdir/lib/modules/${_extramodules}/vboxdrv.ko" - - install -D -m644 vboxnetadp.ko \ - "$pkgdir/lib/modules/${_extramodules}/vboxnetadp.ko" - - install -D -m644 vboxnetflt.ko \ - "$pkgdir/lib/modules/${_extramodules}/vboxnetflt.ko" - - install -D -m644 vboxpci.ko \ - "$pkgdir/lib/modules/${_extramodules}/vboxpci.ko" - - find "${pkgdir}" -name '*.ko' -exec gzip -9 {} \; - - sed -i -e "s/EXTRAMODULES='.*'/EXTRAMODULES='${_extramodules}'/" "$startdir/virtualbox-modules.install" -} diff --git a/libre/virtualbox-parabola-modules/virtualbox-modules.install b/libre/virtualbox-parabola-modules/virtualbox-modules.install deleted file mode 100644 index b57135999..000000000 --- a/libre/virtualbox-parabola-modules/virtualbox-modules.install +++ /dev/null @@ -1,19 +0,0 @@ -post_install() { -/bin/cat << EOF -===> You must load vboxdrv module before starting VirtualBox: -===> # modprobe vboxdrv -EOF - EXTRAMODULES='extramodules-3.1-LIBRE' - depmod $(cat /lib/modules/$EXTRAMODULES/version) -} - -post_upgrade() { - EXTRAMODULES='extramodules-3.1-LIBRE' - depmod $(cat /lib/modules/$EXTRAMODULES/version) - rmmod vboxdrv || echo 'In order to use the new version, reload all virtualbox modules manually.' -} - -post_remove() { - EXTRAMODULES='extramodules-3.1-LIBRE' - depmod $(cat /lib/modules/$EXTRAMODULES/version) -} diff --git a/libre/virtualbox-parabola-modules/virtualbox-parabola-modules.install b/libre/virtualbox-parabola-modules/virtualbox-parabola-modules.install deleted file mode 100644 index 8801d8c49..000000000 --- a/libre/virtualbox-parabola-modules/virtualbox-parabola-modules.install +++ /dev/null @@ -1,17 +0,0 @@ -post_install() { -cat << EOF -===> You may want to load vboxguest, vboxsf and vboxvideo -EOF - EXTRAMODULES='extramodules-3.1-LIBRE' - depmod $(cat /lib/modules/$EXTRAMODULES/version) -} - -post_upgrade() { - EXTRAMODULES='extramodules-3.1-LIBRE' - depmod $(cat /lib/modules/$EXTRAMODULES/version) -} - -post_remove() { - EXTRAMODULES='extramodules-3.1-LIBRE' - depmod $(cat /lib/modules/$EXTRAMODULES/version) -} diff --git a/multilib-testing/lib32-glibc/glibc-2.15-arena.patch b/multilib-testing/lib32-glibc/glibc-2.15-arena.patch new file mode 100644 index 000000000..46f52e98d --- /dev/null +++ b/multilib-testing/lib32-glibc/glibc-2.15-arena.patch @@ -0,0 +1,29 @@ +diff --git a/malloc/arena.c b/malloc/arena.c +index d3cf4b9..b1c9469 100644 +--- a/malloc/arena.c ++++ b/malloc/arena.c +@@ -828,7 +828,7 @@ arena_get2(mstate a_tsd, size_t size) + { + if (mp_.arena_max != 0) + narenas_limit = mp_.arena_max; +- else ++ else if (narenas > mp_.arena_test) + { + int n = __get_nprocs (); + +@@ -842,7 +842,14 @@ arena_get2(mstate a_tsd, size_t size) + } + repeat:; + size_t n = narenas; +- if (__builtin_expect (n <= mp_.arena_test || n < narenas_limit, 0)) ++ /* NB: the following depends on the fact that (size_t)0 - 1 is a ++ very large number and that the underflow is OK. If arena_max ++ is set the value of arena_test is irrelevant. If arena_test ++ is set but narenas is not yet larger or equal to arena_test ++ narenas_limit is 0. There is no possibility for narenas to ++ be too big for the test to always fail since there is not ++ enough address space to create that many arenas. */ ++ if (__builtin_expect (n <= narenas_limit - 1, 0)) + { + if (catomic_compare_and_exchange_bool_acq (&narenas, n + 1, n)) + goto repeat; diff --git a/multilib-testing/lib32-glibc/glibc-2.15-negative-result-cache.patch b/multilib-testing/lib32-glibc/glibc-2.15-negative-result-cache.patch new file mode 100644 index 000000000..c09e79a17 --- /dev/null +++ b/multilib-testing/lib32-glibc/glibc-2.15-negative-result-cache.patch @@ -0,0 +1,138 @@ +diff --git a/nscd/aicache.c b/nscd/aicache.c +index aaaf80d..e1f1244 100644 +--- a/nscd/aicache.c ++++ b/nscd/aicache.c +@@ -1,5 +1,5 @@ + /* Cache handling for host lookup. +- Copyright (C) 2004-2008, 2009, 2010, 2011 Free Software Foundation, Inc. ++ Copyright (C) 2004-2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper <drepper@redhat.com>, 2004. + +@@ -514,8 +514,9 @@ next_nip: + if (fd != -1) + TEMP_FAILURE_RETRY (send (fd, ¬found, total, MSG_NOSIGNAL)); + +- /* If we cannot permanently store the result, so be it. */ +- if (__builtin_expect (db->negtimeout == 0, 0)) ++ /* If we have a transient error or cannot permanently store the ++ result, so be it. */ ++ if (rc4 == EAGAIN || __builtin_expect (db->negtimeout == 0, 0)) + { + /* Mark the old entry as obsolete. */ + if (dh != NULL) +diff --git a/nscd/grpcache.c b/nscd/grpcache.c +index e9607c6..a698f36 100644 +--- a/nscd/grpcache.c ++++ b/nscd/grpcache.c +@@ -1,5 +1,5 @@ + /* Cache handling for group lookup. +- Copyright (C) 1998-2008, 2009, 2011 Free Software Foundation, Inc. ++ Copyright (C) 1998-2008, 2009, 2011, 2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998. + +@@ -120,8 +120,9 @@ cache_addgr (struct database_dyn *db, int fd, request_header *req, + else + written = total; + +- /* If we cannot permanently store the result, so be it. */ +- if (db->negtimeout == 0) ++ /* If we have a transient error or cannot permanently store ++ the result, so be it. */ ++ if (errno == EAGAIN || __builtin_expect (db->negtimeout == 0, 0)) + { + /* Mark the old entry as obsolete. */ + if (dh != NULL) +diff --git a/nscd/hstcache.c b/nscd/hstcache.c +index 4d68ade..c72feaa 100644 +--- a/nscd/hstcache.c ++++ b/nscd/hstcache.c +@@ -1,5 +1,5 @@ + /* Cache handling for host lookup. +- Copyright (C) 1998-2008, 2009, 2011 Free Software Foundation, Inc. ++ Copyright (C) 1998-2008, 2009, 2011, 2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998. + +@@ -141,8 +141,9 @@ cache_addhst (struct database_dyn *db, int fd, request_header *req, + MSG_NOSIGNAL)) != total) + all_written = false; + +- /* If we cannot permanently store the result, so be it. */ +- if (__builtin_expect (db->negtimeout == 0, 0)) ++ /* If we have a transient error or cannot permanently store ++ the result, so be it. */ ++ if (errval == EAGAIN || __builtin_expect (db->negtimeout == 0, 0)) + { + /* Mark the old entry as obsolete. */ + if (dh != NULL) +diff --git a/nscd/initgrcache.c b/nscd/initgrcache.c +index 4ac9942..2019991 100644 +--- a/nscd/initgrcache.c ++++ b/nscd/initgrcache.c +@@ -1,5 +1,5 @@ + /* Cache handling for host lookup. +- Copyright (C) 2004-2006, 2008, 2009, 2011 Free Software Foundation, Inc. ++ Copyright (C) 2004-2006, 2008, 2009, 2011, 2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper <drepper@redhat.com>, 2004. + +@@ -202,8 +202,9 @@ addinitgroupsX (struct database_dyn *db, int fd, request_header *req, + written = TEMP_FAILURE_RETRY (send (fd, ¬found, total, + MSG_NOSIGNAL)); + +- /* If we cannot permanently store the result, so be it. */ +- if (__builtin_expect (db->negtimeout == 0, 0)) ++ /* If we have a transient error or cannot permanently store ++ the result, so be it. */ ++ if (all_tryagain || __builtin_expect (db->negtimeout == 0, 0)) + { + /* Mark the old entry as obsolete. */ + if (dh != NULL) +diff --git a/nscd/pwdcache.c b/nscd/pwdcache.c +index 49e130c..e2ba09d 100644 +--- a/nscd/pwdcache.c ++++ b/nscd/pwdcache.c +@@ -1,5 +1,5 @@ + /* Cache handling for passwd lookup. +- Copyright (C) 1998-2008, 2009, 2011 Free Software Foundation, Inc. ++ Copyright (C) 1998-2008, 2009, 2011, 2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998. + +@@ -124,8 +124,9 @@ cache_addpw (struct database_dyn *db, int fd, request_header *req, + written = TEMP_FAILURE_RETRY (send (fd, ¬found, total, + MSG_NOSIGNAL)); + +- /* If we cannot permanently store the result, so be it. */ +- if (__builtin_expect (db->negtimeout == 0, 0)) ++ /* If we have a transient error or cannot permanently store ++ the result, so be it. */ ++ if (errno == EAGAIN || __builtin_expect (db->negtimeout == 0, 0)) + { + /* Mark the old entry as obsolete. */ + if (dh != NULL) +diff --git a/nscd/servicescache.c b/nscd/servicescache.c +index d3d5dce..a6337e3 100644 +--- a/nscd/servicescache.c ++++ b/nscd/servicescache.c +@@ -1,5 +1,5 @@ + /* Cache handling for services lookup. +- Copyright (C) 2007, 2008, 2009, 2011 Free Software Foundation, Inc. ++ Copyright (C) 2007, 2008, 2009, 2011, 2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper <drepper@drepper.com>, 2007. + +@@ -108,8 +108,9 @@ cache_addserv (struct database_dyn *db, int fd, request_header *req, + written = TEMP_FAILURE_RETRY (send (fd, ¬found, total, + MSG_NOSIGNAL)); + +- /* If we cannot permanently store the result, so be it. */ +- if (__builtin_expect (db->negtimeout == 0, 0)) ++ /* If we have a transient error or cannot permanently store ++ the result, so be it. */ ++ if (errval == EAGAIN || __builtin_expect (db->negtimeout == 0, 0)) + { + /* Mark the old entry as obsolete. */ + if (dh != NULL) diff --git a/testing/glibc/glibc-2.15-arena.patch b/testing/glibc/glibc-2.15-arena.patch new file mode 100644 index 000000000..46f52e98d --- /dev/null +++ b/testing/glibc/glibc-2.15-arena.patch @@ -0,0 +1,29 @@ +diff --git a/malloc/arena.c b/malloc/arena.c +index d3cf4b9..b1c9469 100644 +--- a/malloc/arena.c ++++ b/malloc/arena.c +@@ -828,7 +828,7 @@ arena_get2(mstate a_tsd, size_t size) + { + if (mp_.arena_max != 0) + narenas_limit = mp_.arena_max; +- else ++ else if (narenas > mp_.arena_test) + { + int n = __get_nprocs (); + +@@ -842,7 +842,14 @@ arena_get2(mstate a_tsd, size_t size) + } + repeat:; + size_t n = narenas; +- if (__builtin_expect (n <= mp_.arena_test || n < narenas_limit, 0)) ++ /* NB: the following depends on the fact that (size_t)0 - 1 is a ++ very large number and that the underflow is OK. If arena_max ++ is set the value of arena_test is irrelevant. If arena_test ++ is set but narenas is not yet larger or equal to arena_test ++ narenas_limit is 0. There is no possibility for narenas to ++ be too big for the test to always fail since there is not ++ enough address space to create that many arenas. */ ++ if (__builtin_expect (n <= narenas_limit - 1, 0)) + { + if (catomic_compare_and_exchange_bool_acq (&narenas, n + 1, n)) + goto repeat; diff --git a/testing/glibc/glibc-2.15-negative-result-cache.patch b/testing/glibc/glibc-2.15-negative-result-cache.patch new file mode 100644 index 000000000..c09e79a17 --- /dev/null +++ b/testing/glibc/glibc-2.15-negative-result-cache.patch @@ -0,0 +1,138 @@ +diff --git a/nscd/aicache.c b/nscd/aicache.c +index aaaf80d..e1f1244 100644 +--- a/nscd/aicache.c ++++ b/nscd/aicache.c +@@ -1,5 +1,5 @@ + /* Cache handling for host lookup. +- Copyright (C) 2004-2008, 2009, 2010, 2011 Free Software Foundation, Inc. ++ Copyright (C) 2004-2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper <drepper@redhat.com>, 2004. + +@@ -514,8 +514,9 @@ next_nip: + if (fd != -1) + TEMP_FAILURE_RETRY (send (fd, ¬found, total, MSG_NOSIGNAL)); + +- /* If we cannot permanently store the result, so be it. */ +- if (__builtin_expect (db->negtimeout == 0, 0)) ++ /* If we have a transient error or cannot permanently store the ++ result, so be it. */ ++ if (rc4 == EAGAIN || __builtin_expect (db->negtimeout == 0, 0)) + { + /* Mark the old entry as obsolete. */ + if (dh != NULL) +diff --git a/nscd/grpcache.c b/nscd/grpcache.c +index e9607c6..a698f36 100644 +--- a/nscd/grpcache.c ++++ b/nscd/grpcache.c +@@ -1,5 +1,5 @@ + /* Cache handling for group lookup. +- Copyright (C) 1998-2008, 2009, 2011 Free Software Foundation, Inc. ++ Copyright (C) 1998-2008, 2009, 2011, 2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998. + +@@ -120,8 +120,9 @@ cache_addgr (struct database_dyn *db, int fd, request_header *req, + else + written = total; + +- /* If we cannot permanently store the result, so be it. */ +- if (db->negtimeout == 0) ++ /* If we have a transient error or cannot permanently store ++ the result, so be it. */ ++ if (errno == EAGAIN || __builtin_expect (db->negtimeout == 0, 0)) + { + /* Mark the old entry as obsolete. */ + if (dh != NULL) +diff --git a/nscd/hstcache.c b/nscd/hstcache.c +index 4d68ade..c72feaa 100644 +--- a/nscd/hstcache.c ++++ b/nscd/hstcache.c +@@ -1,5 +1,5 @@ + /* Cache handling for host lookup. +- Copyright (C) 1998-2008, 2009, 2011 Free Software Foundation, Inc. ++ Copyright (C) 1998-2008, 2009, 2011, 2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998. + +@@ -141,8 +141,9 @@ cache_addhst (struct database_dyn *db, int fd, request_header *req, + MSG_NOSIGNAL)) != total) + all_written = false; + +- /* If we cannot permanently store the result, so be it. */ +- if (__builtin_expect (db->negtimeout == 0, 0)) ++ /* If we have a transient error or cannot permanently store ++ the result, so be it. */ ++ if (errval == EAGAIN || __builtin_expect (db->negtimeout == 0, 0)) + { + /* Mark the old entry as obsolete. */ + if (dh != NULL) +diff --git a/nscd/initgrcache.c b/nscd/initgrcache.c +index 4ac9942..2019991 100644 +--- a/nscd/initgrcache.c ++++ b/nscd/initgrcache.c +@@ -1,5 +1,5 @@ + /* Cache handling for host lookup. +- Copyright (C) 2004-2006, 2008, 2009, 2011 Free Software Foundation, Inc. ++ Copyright (C) 2004-2006, 2008, 2009, 2011, 2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper <drepper@redhat.com>, 2004. + +@@ -202,8 +202,9 @@ addinitgroupsX (struct database_dyn *db, int fd, request_header *req, + written = TEMP_FAILURE_RETRY (send (fd, ¬found, total, + MSG_NOSIGNAL)); + +- /* If we cannot permanently store the result, so be it. */ +- if (__builtin_expect (db->negtimeout == 0, 0)) ++ /* If we have a transient error or cannot permanently store ++ the result, so be it. */ ++ if (all_tryagain || __builtin_expect (db->negtimeout == 0, 0)) + { + /* Mark the old entry as obsolete. */ + if (dh != NULL) +diff --git a/nscd/pwdcache.c b/nscd/pwdcache.c +index 49e130c..e2ba09d 100644 +--- a/nscd/pwdcache.c ++++ b/nscd/pwdcache.c +@@ -1,5 +1,5 @@ + /* Cache handling for passwd lookup. +- Copyright (C) 1998-2008, 2009, 2011 Free Software Foundation, Inc. ++ Copyright (C) 1998-2008, 2009, 2011, 2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998. + +@@ -124,8 +124,9 @@ cache_addpw (struct database_dyn *db, int fd, request_header *req, + written = TEMP_FAILURE_RETRY (send (fd, ¬found, total, + MSG_NOSIGNAL)); + +- /* If we cannot permanently store the result, so be it. */ +- if (__builtin_expect (db->negtimeout == 0, 0)) ++ /* If we have a transient error or cannot permanently store ++ the result, so be it. */ ++ if (errno == EAGAIN || __builtin_expect (db->negtimeout == 0, 0)) + { + /* Mark the old entry as obsolete. */ + if (dh != NULL) +diff --git a/nscd/servicescache.c b/nscd/servicescache.c +index d3d5dce..a6337e3 100644 +--- a/nscd/servicescache.c ++++ b/nscd/servicescache.c +@@ -1,5 +1,5 @@ + /* Cache handling for services lookup. +- Copyright (C) 2007, 2008, 2009, 2011 Free Software Foundation, Inc. ++ Copyright (C) 2007, 2008, 2009, 2011, 2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper <drepper@drepper.com>, 2007. + +@@ -108,8 +108,9 @@ cache_addserv (struct database_dyn *db, int fd, request_header *req, + written = TEMP_FAILURE_RETRY (send (fd, ¬found, total, + MSG_NOSIGNAL)); + +- /* If we cannot permanently store the result, so be it. */ +- if (__builtin_expect (db->negtimeout == 0, 0)) ++ /* If we have a transient error or cannot permanently store ++ the result, so be it. */ ++ if (errval == EAGAIN || __builtin_expect (db->negtimeout == 0, 0)) + { + /* Mark the old entry as obsolete. */ + if (dh != NULL) diff --git a/core/glibc/glibc-2.15-strcmp-disable-avx.patch b/testing/glibc/glibc-2.15-strcasecmp-disable-avx.patch index 7f1f5b8f2..4c104fa55 100644 --- a/core/glibc/glibc-2.15-strcmp-disable-avx.patch +++ b/testing/glibc/glibc-2.15-strcasecmp-disable-avx.patch @@ -3,33 +3,33 @@ index f93c83d..d8aa889 100644 --- a/sysdeps/x86_64/multiarch/strcmp.S +++ b/sysdeps/x86_64/multiarch/strcmp.S @@ -105,11 +105,6 @@ ENTRY(__strcasecmp) - jne 1f - call __init_cpu_features + jne 1f + call __init_cpu_features 1: -# ifdef HAVE_AVX_SUPPORT - leaq __strcasecmp_avx(%rip), %rax - testl $bit_AVX, __cpu_features+CPUID_OFFSET+index_AVX(%rip) - jnz 2f -# endif - leaq __strcasecmp_sse42(%rip), %rax - testl $bit_SSE4_2, __cpu_features+CPUID_OFFSET+index_SSE4_2(%rip) - jnz 2f + leaq __strcasecmp_sse42(%rip), %rax + testl $bit_SSE4_2, __cpu_features+CPUID_OFFSET+index_SSE4_2(%rip) + jnz 2f @@ -128,11 +123,6 @@ ENTRY(__strncasecmp) - jne 1f - call __init_cpu_features + jne 1f + call __init_cpu_features 1: -# ifdef HAVE_AVX_SUPPORT - leaq __strncasecmp_avx(%rip), %rax - testl $bit_AVX, __cpu_features+CPUID_OFFSET+index_AVX(%rip) - jnz 2f -# endif - leaq __strncasecmp_sse42(%rip), %rax - testl $bit_SSE4_2, __cpu_features+CPUID_OFFSET+index_SSE4_2(%rip) - jnz 2f + leaq __strncasecmp_sse42(%rip), %rax + testl $bit_SSE4_2, __cpu_features+CPUID_OFFSET+index_SSE4_2(%rip) + jnz 2f @@ -152,19 +142,6 @@ weak_alias (__strncasecmp, strncasecmp) # include "strcmp-sse42.S" - - + + -# ifdef HAVE_AVX_SUPPORT -# if defined USE_AS_STRCASECMP_L || defined USE_AS_STRNCASECMP_L -# define LABEL(l) .L##l##_avx @@ -45,4 +45,4 @@ index f93c83d..d8aa889 100644 - # undef ENTRY # define ENTRY(name) \ - .type STRCMP_SSE2, @function; \ + .type STRCMP_SSE2, @function; \ diff --git a/testing/shadow/nscd-error-reporting.patch b/testing/shadow/nscd-error-reporting.patch new file mode 100644 index 000000000..a4075756e --- /dev/null +++ b/testing/shadow/nscd-error-reporting.patch @@ -0,0 +1,17 @@ +diff --git a/upstream/trunk/lib/nscd.c b/upstream/trunk/lib/nscd.c +index 227c205..7adb58f 100644 +--- a/lib/nscd.c ++++ b/lib/nscd.c +@@ -39,8 +39,11 @@ int nscd_flush_cache (const char *service) + /* nscd is not installed, or it is installed but uses an + interpreter that is missing. Probably the former. */ + return 0; ++ } else if (code == 1) { ++ /* nscd is installed, but it isn't active. */ ++ return 0; + } else if (code != 0) { +- (void) fprintf (stderr, _("%s: nscd exited with status %d"), ++ (void) fprintf (stderr, _("%s: nscd exited with status %d\n"), + Prog, code); + (void) fprintf (stderr, _(MSG_NSCD_FLUSH_CACHE_FAILED), Prog); + return -1; diff --git a/~mtjm/cups-usblp/cups-avahi.patch b/~mtjm/cups-usblp/cups-avahi.patch deleted file mode 100644 index 7e9c8ecea..000000000 --- a/~mtjm/cups-usblp/cups-avahi.patch +++ /dev/null @@ -1,3156 +0,0 @@ -Description: Avahi support -Bug: http://www.cups.org/str.php?L3066 -Author: Tim Waugh -Origin: git clone http://twaugh.fedorapeople.org/cups-avahi.git (Aug 11, 2011) - ---- a/backend/dnssd.c -+++ b/backend/dnssd.c -@@ -15,14 +15,21 @@ - * - * Contents: - * -+ * next_txt_record() - Get next TXT record from a cups_txt_records_t. -+ * parse_txt_record_pair() - Read key/value pair in cups_txt_records_t. - * main() - Browse for printers. - * browse_callback() - Browse devices. - * browse_local_callback() - Browse local devices. - * compare_devices() - Compare two devices. - * exec_backend() - Execute the backend that corresponds to the - * resolved service name. -+ * device_type() - Get DNS-SD type enumeration from string. - * get_device() - Create or update a device. - * query_callback() - Process query data. -+ * avahi_client_callback() - Avahi client callback function. -+ * avahi_query_callback() - Avahi query callback function. -+ * avahi_browse_callback() - Avahi browse callback function. -+ * find_device() - Find a device from its name and domain. - * sigterm_handler() - Handle termination signals... - * unquote() - Unquote a name string. - */ -@@ -33,7 +40,18 @@ - - #include "backend-private.h" - #include <cups/array.h> --#include <dns_sd.h> -+#ifdef HAVE_DNSSD -+# include <dns_sd.h> -+#endif /* HAVE_DNSSD */ -+#ifdef HAVE_AVAHI -+# include <avahi-client/client.h> -+# include <avahi-client/lookup.h> -+# include <avahi-common/simple-watch.h> -+# include <avahi-common/domain.h> -+# include <avahi-common/error.h> -+# include <avahi-common/malloc.h> -+#define kDNSServiceMaxDomainName AVAHI_DOMAIN_NAME_MAX -+#endif /* HAVE_AVAHI */ - - - /* -@@ -53,7 +71,12 @@ - - typedef struct - { -+#ifdef HAVE_DNSSD - DNSServiceRef ref; /* Service reference for resolve */ -+#endif /* HAVE_DNSSD */ -+#ifdef HAVE_AVAHI -+ int resolved; /* Did we resolve the device? */ -+#endif /* HAVE_AVAHI */ - char *name, /* Service name */ - *domain, /* Domain name */ - *fullName, /* Full name */ -@@ -65,6 +88,20 @@ - sent; /* Did we list the device? */ - } cups_device_t; - -+typedef struct -+{ -+ char key[256]; -+ char value[256]; -+ -+#ifdef HAVE_DNSSD -+ const uint8_t *data; -+ const uint8_t *datanext; -+ const uint8_t *dataend; -+#else /* HAVE_AVAHI */ -+ AvahiStringList *txt; -+#endif /* HAVE_DNSSD */ -+} cups_txt_records_t; -+ - - /* - * Local globals... -@@ -78,6 +115,7 @@ - * Local functions... - */ - -+#ifdef HAVE_DNSSD - static void browse_callback(DNSServiceRef sdRef, - DNSServiceFlags flags, - uint32_t interfaceIndex, -@@ -93,12 +131,6 @@ - const char *regtype, - const char *replyDomain, - void *context); --static int compare_devices(cups_device_t *a, cups_device_t *b); --static void exec_backend(char **argv); --static cups_device_t *get_device(cups_array_t *devices, -- const char *serviceName, -- const char *regtype, -- const char *replyDomain); - static void query_callback(DNSServiceRef sdRef, - DNSServiceFlags flags, - uint32_t interfaceIndex, -@@ -107,9 +139,118 @@ - uint16_t rrclass, uint16_t rdlen, - const void *rdata, uint32_t ttl, - void *context); -+#endif /* HAVE_DNSSD */ -+#ifdef HAVE_AVAHI -+static void avahi_client_callback (AvahiClient *client, -+ AvahiClientState state, -+ void *context); -+static void avahi_browse_callback (AvahiServiceBrowser *browser, -+ AvahiIfIndex interface, -+ AvahiProtocol protocol, -+ AvahiBrowserEvent event, -+ const char *serviceName, -+ const char *regtype, -+ const char *replyDomain, -+ AvahiLookupResultFlags flags, -+ void *context); -+#endif /* HAVE_AVAHI */ -+ -+static cups_device_t * find_device (cups_array_t *devices, -+ cups_txt_records_t *txt, -+ cups_device_t *dkey); -+static int compare_devices(cups_device_t *a, cups_device_t *b); -+static void exec_backend(char **argv); -+static cups_device_t *get_device(cups_array_t *devices, -+ const char *serviceName, -+ const char *regtype, -+ const char *replyDomain); - static void sigterm_handler(int sig); - static void unquote(char *dst, const char *src, size_t dstsize); - -+#ifdef HAVE_AVAHI -+static AvahiSimplePoll *simple_poll = NULL; -+static int avahi_got_callback; -+#endif /* HAVE_AVAHI */ -+ -+ -+/* -+ * 'next_txt_record()' - Get next TXT record from a cups_txt_records_t. -+ */ -+ -+static cups_txt_records_t * -+next_txt_record (cups_txt_records_t *txt) -+{ -+#ifdef HAVE_DNSSD -+ txt->data = txt->datanext; -+#else /* HAVE_AVAHI */ -+ txt->txt = avahi_string_list_get_next (txt->txt); -+ if (txt->txt == NULL) -+ return NULL; -+#endif /* HAVE_DNSSD */ -+ -+ return txt; -+} -+ -+ -+/* -+ * 'parse_txt_record_pair()' - Read key/value pair in cups_txt_records_t. -+ */ -+ -+static int -+parse_txt_record_pair (cups_txt_records_t *txt) -+{ -+#ifdef HAVE_DNSSD -+ uint8_t datalen; -+ uint8_t *data = txt->data; -+ char *ptr; -+ -+ /* -+ * Read a key/value pair starting with an 8-bit length. Since the -+ * length is 8 bits and the size of the key/value buffers is 256, we -+ * don't need to check for overflow... -+ */ -+ -+ datalen = *data++; -+ if (!datalen || (data + datalen) >= txt->dataend) -+ return NULL; -+ txt->datanext = data + datalen; -+ -+ for (ptr = txt->key; data < txt->datanext && *data != '='; data ++) -+ *ptr++ = *data; -+ *ptr = '\0'; -+ -+ if (data < txt->datanext && *data == '=') -+ { -+ data++; -+ -+ if (data < datanext) -+ memcpy (txt->value, data, txt->datanext - data); -+ value[txt->datanext - data] = '\0'; -+ } -+ else -+ return 1; -+#else /* HAVE_AVAHI */ -+ char *key, *value; -+ size_t len; -+ avahi_string_list_get_pair (txt->txt, &key, &value, &len); -+ if (len > sizeof (txt->value) - 1) -+ len = sizeof (txt->value) - 1; -+ -+ memcpy (txt->value, value, len); -+ txt->value[len] = '\0'; -+ len = strlen (key); -+ if (len > sizeof (txt->key) - 1) -+ len = sizeof (txt->key) - 1; -+ -+ memcpy (txt->key, key, len); -+ txt->key[len] = '\0'; -+ avahi_free (key); -+ avahi_free (value); -+#endif /* HAVE_AVAHI */ -+ -+ return 0; -+} -+ - - /* - * 'main()' - Browse for printers. -@@ -120,6 +261,13 @@ - char *argv[]) /* I - Command-line arguments */ - { - const char *name; /* Backend name */ -+ cups_array_t *devices; /* Device array */ -+ cups_device_t *device; /* Current device */ -+ char uriName[1024]; /* Unquoted fullName for URI */ -+#ifdef HAVE_DNSSD -+ int fd; /* Main file descriptor */ -+ fd_set input; /* Input set for select() */ -+ struct timeval timeout; /* Timeout for select() */ - DNSServiceRef main_ref, /* Main service reference */ - fax_ipp_ref, /* IPP fax service reference */ - ipp_ref, /* IPP service reference */ -@@ -133,12 +281,11 @@ - pdl_datastream_ref, /* AppSocket service reference */ - printer_ref, /* LPD service reference */ - riousbprint_ref; /* Remote IO service reference */ -- int fd; /* Main file descriptor */ -- fd_set input; /* Input set for select() */ -- struct timeval timeout; /* Timeout for select() */ -- cups_array_t *devices; /* Device array */ -- cups_device_t *device; /* Current device */ -- char uriName[1024]; /* Unquoted fullName for URI */ -+#endif /* HAVE_DNSSD */ -+#ifdef HAVE_AVAHI -+ AvahiClient *client; -+ int error; -+#endif /* HAVE_AVAHI */ - #if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET) - struct sigaction action; /* Actions for POSIX signals */ - #endif /* HAVE_SIGACTION && !HAVE_SIGSET */ -@@ -198,6 +345,49 @@ - * Browse for different kinds of printers... - */ - -+#ifdef HAVE_AVAHI -+ if ((simple_poll = avahi_simple_poll_new ()) == NULL) -+ { -+ perror ("ERROR: Unable to create avahi simple poll object"); -+ return (1); -+ } -+ -+ client = avahi_client_new (avahi_simple_poll_get (simple_poll), -+ 0, avahi_client_callback, NULL, &error); -+ if (!client) -+ { -+ perror ("DEBUG: Unable to create avahi client"); -+ return (0); -+ } -+ -+ avahi_service_browser_new (client, AVAHI_IF_UNSPEC, -+ AVAHI_PROTO_UNSPEC, -+ "_fax-ipp._tcp", NULL, 0, -+ avahi_browse_callback, devices); -+ avahi_service_browser_new (client, AVAHI_IF_UNSPEC, -+ AVAHI_PROTO_UNSPEC, -+ "_ipp._tcp", NULL, 0, -+ avahi_browse_callback, devices); -+ avahi_service_browser_new (client, AVAHI_IF_UNSPEC, -+ AVAHI_PROTO_UNSPEC, -+ "_ipp-tls._tcp", NULL, 0, -+ avahi_browse_callback, devices); -+ avahi_service_browser_new (client, AVAHI_IF_UNSPEC, -+ AVAHI_PROTO_UNSPEC, -+ "_pdl-datastream._tcp", -+ NULL, 0, -+ avahi_browse_callback, -+ devices); -+ avahi_service_browser_new (client, AVAHI_IF_UNSPEC, -+ AVAHI_PROTO_UNSPEC, -+ "_printer._tcp", NULL, 0, -+ avahi_browse_callback, devices); -+ avahi_service_browser_new (client, AVAHI_IF_UNSPEC, -+ AVAHI_PROTO_UNSPEC, -+ "_riousbprint._tcp", NULL, 0, -+ avahi_browse_callback, devices); -+#endif /* HAVE_AVAHI */ -+#ifdef HAVE_DNSSD - if (DNSServiceCreateConnection(&main_ref) != kDNSServiceErr_NoError) - { - perror("ERROR: Unable to create service connection"); -@@ -258,6 +448,7 @@ - riousbprint_ref = main_ref; - DNSServiceBrowse(&riousbprint_ref, kDNSServiceFlagsShareConnection, 0, - "_riousbprint._tcp", NULL, browse_callback, devices); -+#endif /* HAVE_DNSSD */ - - /* - * Loop until we are killed... -@@ -265,6 +456,9 @@ - - while (!job_canceled) - { -+ int announce = 0; -+ -+#ifdef HAVE_DNSSD - FD_ZERO(&input); - FD_SET(fd, &input); - -@@ -284,11 +478,35 @@ - } - else - { -+ announce = 1; -+ } -+#else /* HAVE_AVAHI */ -+ int r; -+ avahi_got_callback = 0; -+ r = avahi_simple_poll_iterate (simple_poll, 1); -+ if (r != 0 && r != EINTR) -+ { -+ /* -+ * We've been told to exit the loop. Perhaps the connection to -+ * avahi failed. -+ */ -+ -+ break; -+ } -+ -+ if (avahi_got_callback) -+ announce = 1; -+#endif /* HAVE_DNSSD */ -+ -+ if (announce) -+ { - /* - * Announce any devices we've found... - */ - -+#ifdef HAVE_DNSSD - DNSServiceErrorType status; /* DNS query status */ -+#endif /* HAVE_DNSSD */ - cups_device_t *best; /* Best matching device */ - char device_uri[1024]; /* Device URI */ - int count; /* Number of queries */ -@@ -302,6 +520,7 @@ - if (device->sent) - sent ++; - -+#ifdef HAVE_DNSSD - if (device->ref) - count ++; - -@@ -333,14 +552,23 @@ - count ++; - } - } -- else if (!device->sent) -+ else -+#endif /* HAVE_DNSSD */ -+#ifdef HAVE_AVAHI -+ if (!device->resolved) -+ continue; -+ else -+#endif /* HAVE_AVAHI */ -+ if (!device->sent) - { -+#ifdef HAVE_DNSSD - /* - * Got the TXT records, now report the device... - */ - - DNSServiceRefDeallocate(device->ref); - device->ref = 0; -+#endif /* HAVE_DNSSD */ - - if (!best) - best = device; -@@ -401,6 +629,7 @@ - } - - -+#ifdef HAVE_DNSSD - /* - * 'browse_callback()' - Browse devices. - */ -@@ -489,6 +718,7 @@ - device->fullName); - device->sent = 1; - } -+#endif /* HAVE_DNSSD */ - - - /* -@@ -569,6 +799,41 @@ - - - /* -+ * 'device_type()' - Get DNS-SD type enumeration from string. -+ */ -+ -+static int -+device_type (const char *regtype) -+{ -+#ifdef HAVE_AVAHI -+ if (!strcmp(regtype, "_ipp._tcp")) -+ return (CUPS_DEVICE_IPP); -+ else if (!strcmp(regtype, "_ipps._tcp") || -+ !strcmp(regtype, "_ipp-tls._tcp")) -+ return (CUPS_DEVICE_IPPS); -+ else if (!strcmp(regtype, "_fax-ipp._tcp")) -+ return (CUPS_DEVICE_FAX_IPP); -+ else if (!strcmp(regtype, "_printer._tcp")) -+ return (CUPS_DEVICE_PDL_DATASTREAM); -+#else -+ if (!strcmp(regtype, "_ipp._tcp.")) -+ return (CUPS_DEVICE_IPP); -+ else if (!strcmp(regtype, "_ipps._tcp.") || -+ !strcmp(regtype, "_ipp-tls._tcp.")) -+ return (CUPS_DEVICE_IPPS); -+ else if (!strcmp(regtype, "_fax-ipp._tcp.")) -+ return (CUPS_DEVICE_FAX_IPP); -+ else if (!strcmp(regtype, "_printer._tcp.")) -+ return (CUPS_DEVICE_PRINTER); -+ else if (!strcmp(regtype, "_pdl-datastream._tcp.")) -+ return (CUPS_DEVICE_PDL_DATASTREAM); -+#endif /* HAVE_AVAHI */ -+ -+ return (CUPS_DEVICE_RIOUSBPRINT); -+} -+ -+ -+/* - * 'get_device()' - Create or update a device. - */ - -@@ -589,20 +854,7 @@ - */ - - key.name = (char *)serviceName; -- -- if (!strcmp(regtype, "_ipp._tcp.")) -- key.type = CUPS_DEVICE_IPP; -- else if (!strcmp(regtype, "_ipps._tcp.") || -- !strcmp(regtype, "_ipp-tls._tcp.")) -- key.type = CUPS_DEVICE_IPPS; -- else if (!strcmp(regtype, "_fax-ipp._tcp.")) -- key.type = CUPS_DEVICE_FAX_IPP; -- else if (!strcmp(regtype, "_printer._tcp.")) -- key.type = CUPS_DEVICE_PRINTER; -- else if (!strcmp(regtype, "_pdl-datastream._tcp.")) -- key.type = CUPS_DEVICE_PDL_DATASTREAM; -- else -- key.type = CUPS_DEVICE_RIOUSBPRINT; -+ key.type = device_type (regtype); - - for (device = cupsArrayFind(devices, &key); - device; -@@ -622,8 +874,14 @@ - free(device->domain); - device->domain = strdup(replyDomain); - -+#ifdef HAVE_DNSSD - DNSServiceConstructFullName(fullName, device->name, regtype, - replyDomain); -+#else /* HAVE_AVAHI */ -+ avahi_service_name_join (fullName, kDNSServiceMaxDomainName, -+ serviceName, regtype, replyDomain); -+#endif /* HAVE_DNSSD */ -+ - free(device->fullName); - device->fullName = strdup(fullName); - } -@@ -643,6 +901,9 @@ - device->domain = strdup(replyDomain); - device->type = key.type; - device->priority = 50; -+#ifdef HAVE_AVAHI -+ device->resolved = 0; -+#endif /* HAVE_AVAHI */ - - cupsArrayAdd(devices, device); - -@@ -650,13 +911,20 @@ - * Set the "full name" of this service, which is used for queries... - */ - -+#ifdef HAVE_DNSSD - DNSServiceConstructFullName(fullName, serviceName, regtype, replyDomain); -+#else /* HAVE_AVAHI */ -+ avahi_service_name_join (fullName, kDNSServiceMaxDomainName, -+ serviceName, regtype, replyDomain); -+#endif /* HAVE_DNSSD */ -+ - device->fullName = strdup(fullName); - - return (device); - } - - -+#ifdef HAVE_DNSSD - /* - * 'query_callback()' - Process query data. - */ -@@ -680,7 +948,7 @@ - *ptr; /* Pointer into string */ - cups_device_t dkey, /* Search key */ - *device; /* Device */ -- -+ cups_txt_records_t txt; - - fprintf(stderr, "DEBUG2: query_callback(sdRef=%p, flags=%x, " - "interfaceIndex=%d, errorCode=%d, fullName=\"%s\", " -@@ -714,94 +982,233 @@ - if ((ptr = strstr(name, "._")) != NULL) - *ptr = '\0'; - -- if (strstr(fullName, "_ipp._tcp.")) -- dkey.type = CUPS_DEVICE_IPP; -- else if (strstr(fullName, "_ipps._tcp.") || -- strstr(fullName, "_ipp-tls._tcp.")) -- dkey.type = CUPS_DEVICE_IPPS; -- else if (strstr(fullName, "_fax-ipp._tcp.")) -- dkey.type = CUPS_DEVICE_FAX_IPP; -- else if (strstr(fullName, "_printer._tcp.")) -- dkey.type = CUPS_DEVICE_PRINTER; -- else if (strstr(fullName, "_pdl-datastream._tcp.")) -- dkey.type = CUPS_DEVICE_PDL_DATASTREAM; -+ dkey.type = device_type (fullName); -+ -+ txt.data = rdata; -+ txt.dataend = rdata + rdlen; -+ device = find_device ((cups_array_t *) context, &txt, &dkey); -+ if (!device) -+ fprintf(stderr, "DEBUG: Ignoring TXT record for \"%s\"...\n", fullName); -+} -+#endif /* HAVE_DNSSD */ -+ -+ -+#ifdef HAVE_AVAHI -+/* -+ * 'avahi_client_callback()' - Avahi client callback function. -+ */ -+ -+static void -+avahi_client_callback(AvahiClient *client, -+ AvahiClientState state, -+ void *context) -+{ -+ /* -+ * If the connection drops, quit. -+ */ -+ -+ if (state == AVAHI_CLIENT_FAILURE) -+ { -+ fprintf (stderr, "ERROR: Avahi connection failed\n"); -+ avahi_simple_poll_quit (simple_poll); -+ } -+} -+ -+ -+/* -+ * 'avahi_query_callback()' - Avahi query callback function. -+ */ -+ -+static void -+avahi_query_callback(AvahiServiceResolver *resolver, -+ AvahiIfIndex interface, -+ AvahiProtocol protocol, -+ AvahiResolverEvent event, -+ const char *name, -+ const char *type, -+ const char *domain, -+ const char *host_name, -+ const AvahiAddress *address, -+ uint16_t port, -+ AvahiStringList *txt, -+ AvahiLookupResultFlags flags, -+ void *context) -+{ -+ AvahiClient *client; -+ cups_device_t key, -+ *device; -+ char uqname[1024], -+ *ptr; -+ cups_txt_records_t txtr; -+ -+ client = avahi_service_resolver_get_client (resolver); -+ if (event != AVAHI_RESOLVER_FOUND) -+ { -+ if (event == AVAHI_RESOLVER_FAILURE) -+ { -+ fprintf (stderr, "ERROR: %s\n", -+ avahi_strerror (avahi_client_errno (client))); -+ } -+ -+ avahi_service_resolver_free (resolver); -+ return; -+ } -+ -+ /* -+ * Set search key for device. -+ */ -+ -+ key.name = uqname; -+ unquote (uqname, name, sizeof (uqname)); -+ if ((ptr = strstr(name, "._")) != NULL) -+ *ptr = '\0'; -+ -+ key.domain = (char *) domain; -+ key.type = device_type (type); -+ -+ /* -+ * Find the device and the the TXT information. -+ */ -+ -+ txtr.txt = txt; -+ device = find_device ((cups_array_t *) context, &txtr, &key); -+ if (device) -+ { -+ /* -+ * Let the main loop know to announce the device. -+ */ -+ -+ device->resolved = 1; -+ avahi_got_callback = 1; -+ } - else -- dkey.type = CUPS_DEVICE_RIOUSBPRINT; -+ fprintf (stderr, "DEBUG: Ignoring TXT record for \"%s\"...\n", name); -+ -+ avahi_service_resolver_free (resolver); -+} -+ -+ -+/* -+ * 'avahi_browse_callback()' - Avahi browse callback function. -+ */ -+ -+static void -+avahi_browse_callback(AvahiServiceBrowser *browser, -+ AvahiIfIndex interface, -+ AvahiProtocol protocol, -+ AvahiBrowserEvent event, -+ const char *name, -+ const char *type, -+ const char *domain, -+ AvahiLookupResultFlags flags, -+ void *context) -+{ -+ AvahiClient *client = avahi_service_browser_get_client (browser); -+ -+ switch (event) -+ { -+ case AVAHI_BROWSER_FAILURE: -+ fprintf (stderr, "ERROR: %s\n", -+ avahi_strerror (avahi_client_errno (client))); -+ avahi_simple_poll_quit (simple_poll); -+ return; -+ -+ case AVAHI_BROWSER_NEW: -+ /* -+ * This object is new on the network. -+ */ -+ -+ if (flags & AVAHI_LOOKUP_RESULT_LOCAL) -+ { -+ /* -+ * This comes from the local machine so ignore it. -+ */ -+ -+ fprintf (stderr, "DEBUG: ignoring local service %s\n", name); -+ } -+ else -+ { -+ /* -+ * Create a device entry for it if it doesn't yet exist. -+ */ -+ -+ get_device ((cups_array_t *)context, name, type, domain); -+ -+ /* -+ * Now look for a TXT entry. -+ */ -+ -+ if (avahi_service_resolver_new (client, interface, protocol, -+ name, type, domain, -+ AVAHI_PROTO_UNSPEC, 0, -+ avahi_query_callback, context) == NULL) -+ { -+ fprintf (stderr, "ERROR: failed to resolve service %s: %s\n", -+ name, avahi_strerror (avahi_client_errno (client))); -+ } -+ } -+ -+ break; -+ -+ case AVAHI_BROWSER_REMOVE: -+ case AVAHI_BROWSER_ALL_FOR_NOW: -+ case AVAHI_BROWSER_CACHE_EXHAUSTED: -+ break; -+ } -+} -+#endif /* HAVE_AVAHI */ -+ - -- for (device = cupsArrayFind(devices, &dkey); -+/* -+ * 'find_device()' - Find a device from its name and domain. -+ */ -+ -+static cups_device_t * -+find_device (cups_array_t *devices, -+ cups_txt_records_t *txt, -+ cups_device_t *dkey) -+{ -+ cups_device_t *device; -+ char *ptr; -+ -+ for (device = cupsArrayFind(devices, dkey); - device; - device = cupsArrayNext(devices)) - { -- if (_cups_strcasecmp(device->name, dkey.name) || -- _cups_strcasecmp(device->domain, dkey.domain)) -+ if (_cups_strcasecmp(device->name, dkey->name) || -+ _cups_strcasecmp(device->domain, dkey->domain)) - { - device = NULL; - break; - } -- else if (device->type == dkey.type) -+ else if (device->type == dkey->type) - { - /* - * Found it, pull out the priority and make and model from the TXT - * record and save it... - */ - -- const uint8_t *data, /* Pointer into data */ -- *datanext, /* Next key/value pair */ -- *dataend; /* End of entire TXT record */ -- uint8_t datalen; /* Length of current key/value pair */ -- char key[256], /* Key string */ -- value[256], /* Value string */ -- make_and_model[512], -+ char make_and_model[512], - /* Manufacturer and model */ - model[256], /* Model */ -- device_id[2048];/* 1284 device ID */ -- -+ device_id[2048]; /* 1284 device ID */ - - device_id[0] = '\0'; - make_and_model[0] = '\0'; - - strcpy(model, "Unknown"); - -- for (data = rdata, dataend = data + rdlen; -- data < dataend; -- data = datanext) -+ for (;;) - { -- /* -- * Read a key/value pair starting with an 8-bit length. Since the -- * length is 8 bits and the size of the key/value buffers is 256, we -- * don't need to check for overflow... -- */ -- -- datalen = *data++; -- -- if (!datalen || (data + datalen) >= dataend) -- break; -- -- datanext = data + datalen; -- -- for (ptr = key; data < datanext && *data != '='; data ++) -- *ptr++ = *data; -- *ptr = '\0'; -+ char *key; -+ char *value; - -- if (data < datanext && *data == '=') -- { -- data ++; -- -- if (data < datanext) -- memcpy(value, data, datanext - data); -- value[datanext - data] = '\0'; -+ if (parse_txt_record_pair (txt)) -+ goto next; - -- fprintf(stderr, "DEBUG2: query_callback: \"%s=%s\".\n", -- key, value); -- } -- else -- { -- fprintf(stderr, "DEBUG2: query_callback: \"%s\" with no value.\n", -- key); -- continue; -- } -- -- if (!_cups_strncasecmp(key, "usb_", 4)) -+ key = txt->key; -+ value = txt->value; -+ if (!strncasecmp(key, "usb_", 4)) - { - /* - * Add USB device ID information... -@@ -856,6 +1263,10 @@ - if (device->type == CUPS_DEVICE_PRINTER) - device->sent = 1; - } -+ -+ next: -+ if (next_txt_record (txt) == NULL) -+ break; - } - - if (device->device_id) -@@ -905,11 +1316,9 @@ - } - } - -- if (!device) -- fprintf(stderr, "DEBUG: Ignoring TXT record for \"%s\"...\n", fullName); -+ return device; - } - -- - /* - * 'sigterm_handler()' - Handle termination signals... - */ ---- a/config-scripts/cups-dnssd.m4 -+++ b/config-scripts/cups-dnssd.m4 -@@ -23,6 +23,21 @@ - DNSSDLIBS="" - DNSSD_BACKEND="" - -+AC_ARG_ENABLE(avahi, [ --enable-avahi turn on DNS Service Discovery support, default=no], -+ [if test x$enable_avahi = xyes; then -+ AC_MSG_CHECKING(for Avahi) -+ if $PKGCONFIG --exists avahi-client; then -+ AC_MSG_RESULT(yes) -+ CFLAGS="$CFLAGS `$PKGCONFIG --cflags avahi-client`" -+ DNSSDLIBS="`$PKGCONFIG --libs avahi-client`" -+ DNSSD_BACKEND="dnssd" -+ AC_DEFINE(HAVE_AVAHI) -+ enable_dnssd=no -+ else -+ AC_MSG_RESULT(no) -+ fi -+ fi]) -+ - if test x$enable_dnssd != xno; then - AC_CHECK_HEADER(dns_sd.h, [ - case "$uname" in ---- a/config.h.in -+++ b/config.h.in -@@ -390,6 +390,13 @@ - - - /* -+ * Do we have Avahi for DNS Service Discovery? -+ */ -+ -+#undef HAVE_AVAHI -+ -+ -+/* - * Do we have <sys/ioctl.h>? - */ - ---- a/cups/http-support.c -+++ b/cups/http-support.c -@@ -43,6 +43,10 @@ - * http_copy_decode() - Copy and decode a URI. - * http_copy_encode() - Copy and encode a URI. - * http_resolve_cb() - Build a device URI for the given service name. -+ * avahi_resolve_uri_client_cb() -+ * - Avahi client callback for resolving URI. -+ * avahi_resolve_uri_resolver_cb() -+ * - Avahi resolver callback for resolving URI. - */ - - /* -@@ -60,6 +64,11 @@ - # include <sys/select.h> - # endif /* WIN32 */ - #endif /* HAVE_DNSSD */ -+#ifdef HAVE_AVAHI -+# include <avahi-client/client.h> -+# include <avahi-client/lookup.h> -+# include <avahi-common/simple-watch.h> -+#endif /* HAVE_AVAHI */ - - - /* -@@ -127,6 +136,24 @@ - void *context); - #endif /* HAVE_DNSSD */ - -+#ifdef HAVE_AVAHI -+static void avahi_resolve_uri_client_cb(AvahiClient *client, -+ AvahiClientState state, -+ void *simple_poll); -+static void avahi_resolve_uri_resolver_cb(AvahiServiceResolver *resolver, -+ AvahiIfIndex interface, -+ AvahiProtocol protocol, -+ AvahiResolverEvent event, -+ const char *name, -+ const char *type, -+ const char *domain, -+ const char *host_name, -+ const AvahiAddress *address, -+ uint16_t port, -+ AvahiStringList *txt, -+ AvahiLookupResultFlags flags, -+ void *context); -+#endif /* HAVE_AVAHI */ - - /* - * 'httpAssembleURI()' - Assemble a uniform resource identifier from its -@@ -1431,6 +1458,9 @@ - - if (strstr(hostname, "._tcp")) - { -+#if defined(HAVE_DNSSD) || defined(HAVE_AVAHI) -+ char *regtype, /* Pointer to type in hostname */ -+ *domain; /* Pointer to domain in hostname */ - #ifdef HAVE_DNSSD - # ifdef WIN32 - # pragma comment(lib, "dnssd.lib") -@@ -1449,6 +1479,17 @@ - fd_set input_set; /* Input set for select() */ - struct timeval stimeout; /* Timeout value for select() */ - #endif /* HAVE_POLL */ -+#else /* HAVE_AVAHI */ -+ AvahiSimplePoll *simple_poll; -+ AvahiClient *client; -+ int error; -+ struct -+ { -+ AvahiSimplePoll *poll; -+ _http_uribuf_t uribuf; -+ } user_data; -+#endif /* HAVE_DNSSD */ -+ - - if (options & _HTTP_RESOLVE_STDERR) - fprintf(stderr, "DEBUG: Resolving \"%s\"...\n", hostname); -@@ -1485,9 +1526,16 @@ - if (domain) - *domain++ = '\0'; - -+#ifdef HAVE_DNSSD - uribuf.buffer = resolved_uri; - uribuf.bufsize = resolved_size; - uribuf.options = options; -+#else -+ user_data.uribuf.buffer = resolved_uri; -+ user_data.uribuf.bufsize = resolved_size; -+ user_data.uribuf.options = options; -+#endif -+ - resolved_uri[0] = '\0'; - - DEBUG_printf(("6_httpResolveURI: Resolving hostname=\"%s\", regtype=\"%s\", " -@@ -1501,6 +1549,7 @@ - - uri = NULL; - -+#ifdef HAVE_DNSSD - if (DNSServiceCreateConnection(&ref) == kDNSServiceErr_NoError) - { - localref = ref; -@@ -1608,6 +1657,36 @@ - - DNSServiceRefDeallocate(ref); - } -+#else /* HAVE_AVAHI */ -+ if ((simple_poll = avahi_simple_poll_new ()) != NULL) -+ { -+ if ((client = avahi_client_new (avahi_simple_poll_get (simple_poll), -+ 0, avahi_resolve_uri_client_cb, -+ &simple_poll, &error)) != NULL) -+ { -+ user_data.poll = simple_poll; -+ if (avahi_service_resolver_new (client, AVAHI_IF_UNSPEC, -+ AVAHI_PROTO_UNSPEC, hostname, -+ regtype, domain, AVAHI_PROTO_UNSPEC, 0, -+ avahi_resolve_uri_resolver_cb, -+ &user_data) != NULL) -+ { -+ avahi_simple_poll_loop (simple_poll); -+ -+ /* -+ * Collect the result. -+ */ -+ -+ if (resolved_uri[0]) -+ uri = resolved_uri; -+ } -+ -+ avahi_client_free (client); -+ } -+ -+ avahi_simple_poll_free (simple_poll); -+ } -+#endif /* HAVE_DNSSD */ - - if (options & _HTTP_RESOLVE_STDERR) - { -@@ -1619,13 +1698,13 @@ - fputs("STATE: -connecting-to-device,offline-report\n", stderr); - } - --#else -+#else /* HAVE_DNSSD || HAVE_AVAHI */ - /* - * No DNS-SD support... - */ - - uri = NULL; --#endif /* HAVE_DNSSD */ -+#endif /* HAVE_DNSSD || HAVE_AVAHI */ - - if ((options & _HTTP_RESOLVE_STDERR) && !uri) - _cupsLangPrintFilter(stderr, "ERROR", _("Unable to find printer.")); -@@ -1895,6 +1974,116 @@ - #endif /* HAVE_DNSSD */ - - -+#ifdef HAVE_AVAHI -+/* -+ * 'avahi_resolve_uri_client_cb()' - Avahi client callback for resolving URI. -+ */ -+ -+static void -+avahi_resolve_uri_client_cb (AvahiClient *client, -+ AvahiClientState state, -+ void *simple_poll) -+{ -+ DEBUG_printf(("avahi_resolve_uri_client_callback(client=%p, state=%d, " -+ "simple_poll=%p)\n", client, state, simple_poll)); -+ -+ /* -+ * If the connection drops, quit. -+ */ -+ -+ if (state == AVAHI_CLIENT_FAILURE) -+ avahi_simple_poll_quit (simple_poll); -+} -+ -+ -+/* -+ * 'avahi_resolve_uri_resolver_cb()' - Avahi resolver callback for resolving -+ * URI. -+ */ -+ -+static void -+avahi_resolve_uri_resolver_cb (AvahiServiceResolver *resolver, -+ AvahiIfIndex interface, -+ AvahiProtocol protocol, -+ AvahiResolverEvent event, -+ const char *name, -+ const char *type, -+ const char *domain, -+ const char *host_name, -+ const AvahiAddress *address, -+ uint16_t port, -+ AvahiStringList *txt, -+ AvahiLookupResultFlags flags, -+ void *context) -+{ -+ const char *scheme; /* URI scheme */ -+ char rp[256]; /* Remote printer */ -+ AvahiStringList *pair; -+ char *value; -+ size_t valueLen = 0; -+ char addr[AVAHI_ADDRESS_STR_MAX]; -+ struct -+ { -+ AvahiSimplePoll *poll; -+ _http_uribuf_t uribuf; -+ } *poll_uribuf = context; -+ -+ DEBUG_printf(("avahi_resolve_uri_resolver_callback(resolver=%p, " -+ "interface=%d, protocol=%d, event=%d, name=\"%s\", " -+ "type=\"%s\", domain=\"%s\", host_name=\"%s\", address=%p, " -+ "port=%d, txt=%p, flags=%d, context=%p)\n", -+ resolver, interface, protocol, event, name, type, domain, -+ host_name, address, port, txt, flags, context)); -+ -+ if (event != AVAHI_RESOLVER_FOUND) -+ { -+ avahi_service_resolver_free (resolver); -+ avahi_simple_poll_quit (poll_uribuf->poll); -+ return; -+ } -+ -+ /* -+ * Figure out the scheme from the full name... -+ */ -+ -+ if (strstr(type, "_ipp.")) -+ scheme = "ipp"; -+ else if (strstr(type, "_printer.")) -+ scheme = "lpd"; -+ else if (strstr(type, "_pdl-datastream.")) -+ scheme = "socket"; -+ else -+ scheme = "riousbprint"; -+ -+ /* -+ * Extract the "remote printer key from the TXT record... -+ */ -+ -+ if ((pair = avahi_string_list_find (txt, "rp")) != NULL) -+ { -+ avahi_string_list_get_pair (pair, NULL, &value, &valueLen); -+ rp[0] = '/'; -+ memcpy (rp + 1, value, valueLen); -+ rp[valueLen + 1] = '\0'; -+ } -+ else -+ rp[0] = '\0'; -+ -+ /* -+ * Assemble the final device URI... -+ */ -+ -+ avahi_address_snprint (addr, AVAHI_ADDRESS_STR_MAX, address); -+ httpAssembleURI(HTTP_URI_CODING_ALL, poll_uribuf->uribuf.buffer, -+ poll_uribuf->uribuf.bufsize, scheme, NULL, -+ addr, port, rp); -+ DEBUG_printf(("avahi_resolve_uri_resolver_callback: Resolved URI is \"%s\"\n", -+ poll_uribuf->uribuf.buffer)); -+ avahi_simple_poll_quit (poll_uribuf->poll); -+} -+#endif /* HAVE_AVAHI */ -+ -+ - /* - * End of "$Id: http-support.c 9820 2011-06-10 22:06:26Z mike $". - */ ---- a/scheduler/Makefile -+++ b/scheduler/Makefile -@@ -17,6 +17,7 @@ - - CUPSDOBJS = \ - auth.o \ -+ avahi.o \ - banners.o \ - cert.o \ - classes.o \ -@@ -39,7 +40,8 @@ - server.o \ - statbuf.o \ - subscriptions.o \ -- sysman.o -+ sysman.o \ -+ timeout.o - LIBOBJS = \ - filter.o \ - mime.o \ ---- /dev/null -+++ b/scheduler/avahi.c -@@ -0,0 +1,445 @@ -+/* -+ * "$Id$" -+ * -+ * Avahi poll implementation for the CUPS scheduler. -+ * -+ * Copyright (C) 2010 Red Hat, Inc. -+ * Authors: -+ * Tim Waugh <twaugh@redhat.com> -+ * -+ * Distribution and use rights are outlined in the file "LICENSE.txt" -+ * "LICENSE" which should have been included with this file. If this -+ * file is missing or damaged, see the license at "http://www.cups.org/". -+ * -+ * Contents: -+ * -+ * watch_read_cb - Read callback for file descriptor -+ * watch_write_cb - Write callback for file descriptor -+ * watched_fd_add_select() - Call cupsdAddSelect() as needed -+ * watch_new() - Create a new file descriptor watch -+ * watch_free() - Free a file descriptor watch -+ * watch_update() - Update watched events for a file descriptor -+ * watch_get_events() - Get events that happened for a file descriptor -+ * timeout_cb() - Run a timed Avahi callback -+ * timeout_new() - Set a wakeup time -+ * timeout_update() - Update the expiration time for a timeout -+ * timeout_free() - Free a timeout -+ * compare_watched_fds() - Compare watched file descriptors for array sorting -+ * compare_timeouts() - Compare timeouts for array sorting -+ * avahi_cups_poll_new() - Create a new Avahi main loop object for CUPS -+ * avahi_cups_poll_free() - Free an Avahi main loop object for CUPS -+ * avahi_cups_poll_get() - Get the abstract poll API structure -+ */ -+ -+#include <config.h> -+ -+#ifdef HAVE_AVAHI /* Applies to entire file... */ -+ -+/* -+ * Include necessary headers... -+ */ -+ -+#include "cupsd.h" -+ -+#if defined(HAVE_MALLOC_H) && defined(HAVE_MALLINFO) -+# include <malloc.h> -+#endif /* HAVE_MALLOC_H && HAVE_MALLINFO */ -+ -+#ifdef HAVE_AVAHI -+# include <avahi-common/timeval.h> -+#endif /* HAVE_AVAHI */ -+ -+ -+typedef struct -+{ -+ AvahiCupsPoll *cups_poll; -+ -+ int fd; -+ AvahiWatchEvent occurred; -+ cups_array_t *watches; -+} cupsd_watched_fd_t; -+ -+struct AvahiWatch -+{ -+ cupsd_watched_fd_t *watched_fd; -+ -+ AvahiWatchEvent events; -+ AvahiWatchCallback callback; -+ void *userdata; -+}; -+ -+struct AvahiTimeout -+{ -+ AvahiCupsPoll *cups_poll; -+ AvahiTimeoutCallback callback; -+ void *userdata; -+ cupsd_timeout_t *cupsd_timeout; -+}; -+ -+/* -+ * Local functions... -+ */ -+ -+static AvahiWatch * watch_new(const AvahiPoll *api, -+ int fd, -+ AvahiWatchEvent events, -+ AvahiWatchCallback callback, -+ void *userdata); -+static void watch_free(AvahiWatch *watch); -+static void watch_update(AvahiWatch *watch, -+ AvahiWatchEvent events); -+static AvahiWatchEvent watch_get_events(AvahiWatch *watch); -+static int compare_watches(AvahiWatch *p0, -+ AvahiWatch *p1); -+ -+ -+/* -+ * 'watch_read_cb' - Read callback for file descriptor -+ */ -+ -+static void -+watch_read_cb (void *userdata) -+{ -+ AvahiWatch *watch; -+ cupsd_watched_fd_t *watched_fd = userdata; -+ watched_fd->occurred |= AVAHI_WATCH_IN; -+ for (watch = (AvahiWatch *)cupsArrayFirst(watched_fd->watches); -+ watch; -+ watch = (AvahiWatch *)cupsArrayNext(watched_fd->watches)) { -+ if (watch->events & watched_fd->occurred) { -+ (watch->callback) (watch, watched_fd->fd, -+ AVAHI_WATCH_IN, watch->userdata); -+ watched_fd->occurred &= ~AVAHI_WATCH_IN; -+ break; -+ } -+ } -+} -+ -+ -+/* -+ * 'watch_write_cb' - Write callback for file descriptor -+ */ -+ -+static void -+watch_write_cb (void *userdata) -+{ -+ AvahiWatch *watch; -+ cupsd_watched_fd_t *watched_fd = userdata; -+ watched_fd->occurred |= AVAHI_WATCH_OUT; -+ for (watch = (AvahiWatch *)cupsArrayFirst(watched_fd->watches); -+ watch; -+ watch = (AvahiWatch *)cupsArrayNext(watched_fd->watches)) { -+ if (watch->events & watched_fd->occurred) { -+ (watch->callback) (watch, watched_fd->fd, -+ AVAHI_WATCH_OUT, watch->userdata); -+ watched_fd->occurred &= ~AVAHI_WATCH_OUT; -+ break; -+ } -+ } -+} -+ -+ -+/* -+ * 'watched_fd_add_select' - Call cupsdAddSelect() as needed -+ */ -+ -+static int /* O - Watches? */ -+watched_fd_add_select (cupsd_watched_fd_t *watched_fd) -+{ -+ AvahiWatch *watch; -+ cupsd_selfunc_t read_cb = NULL, write_cb = NULL; -+ -+ for (watch = (AvahiWatch *)cupsArrayFirst(watched_fd->watches); -+ watch; -+ watch = (AvahiWatch *)cupsArrayNext(watched_fd->watches)) { -+ if (watch->events & (AVAHI_WATCH_IN | -+ AVAHI_WATCH_ERR | -+ AVAHI_WATCH_HUP)) { -+ read_cb = (cupsd_selfunc_t)watch_read_cb; -+ if (write_cb != NULL) -+ break; -+ } -+ -+ if (watch->events & AVAHI_WATCH_OUT) { -+ write_cb = (cupsd_selfunc_t)watch_write_cb; -+ if (read_cb != NULL) -+ break; -+ } -+ } -+ -+ if (read_cb || write_cb) -+ cupsdAddSelect (watched_fd->fd, read_cb, write_cb, watched_fd); -+ else -+ cupsdRemoveSelect (watched_fd->fd); -+ -+ return (read_cb || write_cb); -+} -+ -+/* -+ * 'watch_new' - Create a new file descriptor watch -+ */ -+ -+static AvahiWatch * -+watch_new (const AvahiPoll *api, -+ int fd, -+ AvahiWatchEvent events, -+ AvahiWatchCallback callback, -+ void *userdata) -+{ -+ cupsd_watched_fd_t key, *watched_fd; -+ AvahiCupsPoll *cups_poll = api->userdata; -+ AvahiWatch *watch = malloc(sizeof(AvahiWatch)); -+ if (watch == NULL) -+ return (NULL); -+ -+ watch->events = events; -+ watch->callback = callback; -+ watch->userdata = userdata; -+ -+ key.fd = fd; -+ watched_fd = cupsArrayFind (cups_poll->watched_fds, &key); -+ if (watched_fd == NULL) { -+ watched_fd = malloc(sizeof(cupsd_watched_fd_t)); -+ if (watched_fd == NULL) { -+ free (watch); -+ return (NULL); -+ } -+ -+ watched_fd->fd = fd; -+ watched_fd->occurred = 0; -+ watched_fd->cups_poll = cups_poll; -+ watched_fd->watches = cupsArrayNew ((cups_array_func_t)compare_watches, -+ NULL); -+ } -+ -+ watch->watched_fd = watched_fd; -+ cupsArrayAdd(watched_fd->watches, watch); -+ watched_fd_add_select (watched_fd); -+ return (watch); -+} -+ -+ -+/* -+ * 'watch_free' - Free a file descriptor watch -+ */ -+ -+static void -+watch_free (AvahiWatch *watch) -+{ -+ cupsd_watched_fd_t *watched_fd = watch->watched_fd; -+ AvahiCupsPoll *cups_poll = watched_fd->cups_poll; -+ -+ cupsArrayRemove (watched_fd->watches, watch); -+ free (watch); -+ -+ if (!watched_fd_add_select (watched_fd)) { -+ /* No more watches */ -+ cupsArrayRemove (cups_poll->watched_fds, watched_fd); -+ free (watched_fd); -+ } -+} -+ -+ -+/* -+ * 'watch_update' - Update watched events for a file descriptor -+ */ -+ -+static void -+watch_update (AvahiWatch *watch, -+ AvahiWatchEvent events) -+{ -+ watch->events = events; -+ watched_fd_add_select (watch->watched_fd); -+} -+ -+ -+/* -+ * 'watch_get_events' - Get events that happened for a file descriptor -+ */ -+ -+static AvahiWatchEvent -+watch_get_events (AvahiWatch *watch) -+{ -+ return (watch->watched_fd->occurred); -+} -+ -+ -+/* -+ * 'compare_watches' - Compare watches for array sorting -+ */ -+ -+static int -+compare_watches (AvahiWatch *p0, -+ AvahiWatch *p1) -+{ -+ if (p0->watched_fd->fd < p1->watched_fd->fd) -+ return (-1); -+ -+ return ((p0->watched_fd->fd == p1->watched_fd->fd) ? 0 : 1); -+} -+ -+ -+/* -+ * 'timeout_cb()' - Run a timed Avahi callback -+ */ -+ -+static void -+timeout_cb (cupsd_timeout_t *cupsd_timeout, void *userdata) -+{ -+ AvahiTimeout *timeout = userdata; -+ (timeout->callback) (timeout, timeout->userdata); -+} -+ -+ -+/* -+ * 'timeout_new' - Set a wakeup time -+ */ -+ -+static AvahiTimeout * -+timeout_new (const AvahiPoll *api, -+ const struct timeval *tv, -+ AvahiTimeoutCallback callback, -+ void *userdata) -+{ -+ AvahiTimeout *timeout; -+ AvahiCupsPoll *cups_poll = api->userdata; -+ -+ timeout = malloc(sizeof(AvahiTimeout)); -+ if (timeout == NULL) -+ return (NULL); -+ -+ timeout->cups_poll = cups_poll; -+ timeout->callback = callback; -+ timeout->userdata = userdata; -+ timeout->cupsd_timeout = cupsdAddTimeout (tv, -+ (cupsd_timeoutfunc_t)timeout_cb, -+ timeout); -+ cupsArrayAdd (cups_poll->timeouts, timeout); -+ return (timeout); -+} -+ -+ -+/* -+ * 'timeout_update' - Update the expiration time for a timeout -+ */ -+ -+static void -+timeout_update (AvahiTimeout *timeout, -+ const struct timeval *tv) -+{ -+ cupsdUpdateTimeout (timeout->cupsd_timeout, tv); -+} -+ -+ -+/* -+ * ' timeout_free' - Free a timeout -+ */ -+ -+static void -+timeout_free (AvahiTimeout *timeout) -+{ -+ cupsArrayRemove (timeout->cups_poll->timeouts, timeout); -+ cupsdRemoveTimeout (timeout->cupsd_timeout); -+ free (timeout); -+} -+ -+ -+/* -+ * 'compare_watched_fds' - Compare watched file descriptors for array sorting -+ */ -+static int -+compare_watched_fds(cupsd_watched_fd_t *p0, -+ cupsd_watched_fd_t *p1) -+{ -+ if (p0->fd != p1->fd) -+ return (p0->fd < p1->fd ? -1 : 1); -+ -+ if (p0 == p1) -+ return (0); -+ -+ return (p0 < p1 ? -1 : 1); -+} -+ -+ -+/* -+ * 'compare_timeouts' - Compare timeouts for array sorting -+ */ -+static int -+compare_timeouts(AvahiTimeout *p0, -+ AvahiTimeout *p1) -+{ -+ /* -+ * Just compare pointers to make it a stable sort. -+ */ -+ -+ if (p0->cupsd_timeout < p1->cupsd_timeout) -+ return (-1); -+ return ((p0->cupsd_timeout == p1->cupsd_timeout) ? 0 : 1); -+} -+ -+ -+/* -+ * 'avahi_cups_poll_new' - Create a new Avahi main loop object for CUPS -+ */ -+ -+AvahiCupsPoll * -+avahi_cups_poll_new (void) -+{ -+ AvahiCupsPoll *cups_poll = malloc(sizeof(AvahiCupsPoll)); -+ if (cups_poll == NULL) -+ return (NULL); -+ -+ cups_poll->watched_fds = cupsArrayNew ((cups_array_func_t)compare_watched_fds, -+ NULL); -+ cups_poll->timeouts = cupsArrayNew ((cups_array_func_t)compare_timeouts, -+ NULL); -+ -+ cups_poll->api.userdata = cups_poll; -+ cups_poll->api.watch_new = watch_new; -+ cups_poll->api.watch_free = watch_free; -+ cups_poll->api.watch_update = watch_update; -+ cups_poll->api.watch_get_events = watch_get_events; -+ -+ cups_poll->api.timeout_new = timeout_new; -+ cups_poll->api.timeout_update = timeout_update; -+ cups_poll->api.timeout_free = timeout_free; -+ -+ return (cups_poll); -+} -+ -+ -+/* -+ * 'avahi_cups_poll_free' - Free an Avahi main loop object for CUPS -+ */ -+void -+avahi_cups_poll_free (AvahiCupsPoll *cups_poll) -+{ -+ cupsd_watched_fd_t *watched_fd; -+ -+ for (watched_fd = (cupsd_watched_fd_t*)cupsArrayFirst(cups_poll->watched_fds); -+ watched_fd; -+ watched_fd = (cupsd_watched_fd_t*)cupsArrayNext(cups_poll->watched_fds)){ -+ cupsArrayClear (watched_fd->watches); -+ } -+ -+ cupsArrayClear (cups_poll->watched_fds); -+ cupsArrayClear (cups_poll->timeouts); -+} -+ -+ -+/* -+ * 'avahi_cups_poll_get' - Get the abstract poll API structure -+ */ -+ -+const AvahiPoll * -+avahi_cups_poll_get (AvahiCupsPoll *cups_poll) -+{ -+ return (&cups_poll->api); -+} -+ -+ -+#endif /* HAVE_AVAHI ... from top of file */ -+ -+/* -+ * End of "$Id$". -+ */ ---- /dev/null -+++ b/scheduler/avahi.h -@@ -0,0 +1,49 @@ -+/* -+ * "$Id$" -+ * -+ * Avahi poll implementation for the CUPS scheduler. -+ * -+ * Copyright (C) 2010 Red Hat, Inc. -+ * Authors: -+ * Tim Waugh <twaugh@redhat.com> -+ * -+ * Distribution and use rights are outlined in the file "LICENSE.txt" -+ * which should have been included with this file. If this file is -+ * file is missing or damaged, see the license at "http://www.cups.org/". -+ */ -+ -+#include <config.h> -+ -+#ifdef HAVE_AVAHI -+# include <avahi-client/client.h> -+# include <avahi-client/publish.h> -+#endif /* HAVE_AVAHI */ -+ -+#ifdef HAVE_AUTHORIZATION_H -+# include <Security/Authorization.h> -+#endif /* HAVE_AUTHORIZATION_H */ -+ -+ -+#ifdef HAVE_AVAHI -+typedef struct -+{ -+ AvahiPoll api; -+ cups_array_t *watched_fds; -+ cups_array_t *timeouts; -+} AvahiCupsPoll; -+#endif /* HAVE_AVAHI */ -+ -+/* -+ * Prototypes... -+ */ -+ -+#ifdef HAVE_AVAHI -+extern AvahiCupsPoll * avahi_cups_poll_new(void); -+extern void avahi_cups_poll_free(AvahiCupsPoll *cups_poll); -+extern const AvahiPoll *avahi_cups_poll_get(AvahiCupsPoll *cups_poll); -+#endif /* HAVE_AVAHI */ -+ -+ -+/* -+ * End of "$Id$". -+ */ ---- a/scheduler/cupsd.h -+++ b/scheduler/cupsd.h -@@ -140,6 +140,15 @@ - - typedef void (*cupsd_selfunc_t)(void *data); - -+#ifdef HAVE_AVAHI -+/* -+ * Timeout callback function type... -+ */ -+ -+typedef struct _cupsd_timeout_s cupsd_timeout_t; -+typedef void (*cupsd_timeoutfunc_t)(cupsd_timeout_t *timeout, void *data); -+#endif /* HAVE_AVAHI */ -+ - - /* - * Globals... -@@ -173,6 +182,11 @@ - /* Running from launchd */ - #endif /* HAVE_LAUNCH_H */ - -+#ifdef HAVE_AVAHI -+VAR cups_array_t *Timeouts; /* Timed callbacks for main loop */ -+#endif /* HAVE_AVAHI */ -+ -+ - - /* - * Prototypes... -@@ -242,6 +256,20 @@ - extern void cupsdStartServer(void); - extern void cupsdStopServer(void); - -+#ifdef HAVE_AVAHI -+extern void cupsdInitTimeouts(void); -+extern cupsd_timeout_t *cupsdAddTimeout (const struct timeval *tv, -+ cupsd_timeoutfunc_t cb, -+ void *data); -+extern cupsd_timeout_t *cupsdNextTimeout (long *delay); -+extern void cupsdRunTimeout (cupsd_timeout_t *timeout); -+extern void cupsdUpdateTimeout (cupsd_timeout_t *timeout, -+ const struct timeval *tv); -+extern void cupsdRemoveTimeout (cupsd_timeout_t *timeout); -+#endif /* HAVE_AVAHI */ -+ -+extern int cupsdRemoveFile(const char *filename); -+ - - /* - * End of "$Id: cupsd.h 9766 2011-05-11 22:17:34Z mike $". ---- a/scheduler/main.c -+++ b/scheduler/main.c -@@ -122,6 +122,10 @@ - cupsd_listener_t *lis; /* Current listener */ - time_t current_time, /* Current time */ - activity, /* Client activity timer */ -+#ifdef HAVE_AVAHI -+ avahi_client_time, /* Time for next Avahi client -+ check */ -+#endif /* HAVE_AVAHI */ - browse_time, /* Next browse send time */ - senddoc_time, /* Send-Document time */ - expire_time, /* Subscription expire time */ -@@ -148,6 +152,10 @@ - int launchd_idle_exit; - /* Idle exit on select timeout? */ - #endif /* HAVE_LAUNCHD */ -+#ifdef HAVE_AVAHI -+ cupsd_timeout_t *tmo; /* Next scheduled timed callback */ -+ long tmo_delay; /* Time before it must be called */ -+#endif /* HAVE_AVAHI */ - - - #ifdef HAVE_GETEUID -@@ -527,6 +535,14 @@ - - httpInitialize(); - -+#ifdef HAVE_AVAHI -+ /* -+ * Initialize timed callback structures. -+ */ -+ -+ cupsdInitTimeouts(); -+#endif /* HAVE_AVAHI */ -+ - cupsdStartServer(); - - /* -@@ -657,6 +673,9 @@ - */ - - current_time = time(NULL); -+#ifdef HAVE_AVAHI -+ avahi_client_time = current_time; -+#endif /* HAVE_AVAHI */ - browse_time = current_time; - event_time = current_time; - expire_time = current_time; -@@ -871,6 +890,26 @@ - } - #endif /* __APPLE__ */ - -+#ifdef HAVE_AVAHI -+ /* -+ * If a timed callback is due, run it. -+ */ -+ -+ tmo = cupsdNextTimeout (&tmo_delay); -+ if (tmo && tmo_delay == 0) -+ cupsdRunTimeout (tmo); -+ -+ /* -+ * Try to restart the Avahi client every 10 seconds if needed... -+ */ -+ -+ if ((current_time - avahi_client_time) >= 10) -+ { -+ avahi_client_time = current_time; -+ cupsdStartAvahiClient(); -+ } -+#endif /* HAVE_AVAHI */ -+ - #ifndef __APPLE__ - /* - * Update the network interfaces once a minute... -@@ -1815,6 +1854,10 @@ - cupsd_job_t *job; /* Job information */ - cupsd_subscription_t *sub; /* Subscription information */ - const char *why; /* Debugging aid */ -+#ifdef HAVE_AVAHI -+ cupsd_timeout_t *tmo; /* Timed callback */ -+ long tmo_delay; /* Seconds before calling it */ -+#endif /* HAVE_AVAHI */ - - - /* -@@ -1857,6 +1900,19 @@ - } - #endif /* __APPLE__ */ - -+#ifdef HAVE_AVAHI -+ /* -+ * See if there are any scheduled timed callbacks to run. -+ */ -+ -+ tmo = cupsdNextTimeout (&tmo_delay); -+ if (tmo) -+ { -+ timeout = tmo_delay; -+ why = "run a timed callback"; -+ } -+#endif /* HAVE_AVAHI */ -+ - /* - * Check whether we are accepting new connections... - */ ---- /dev/null -+++ b/scheduler/timeout.c -@@ -0,0 +1,195 @@ -+/* -+ * "$Id$" -+ * -+ * Timeout functions for the Common UNIX Printing System (CUPS). -+ * -+ * Copyright (C) 2010 Red Hat, Inc. -+ * Authors: -+ * Tim Waugh <twaugh@redhat.com> -+ * -+ * Distribution and use rights are outlined in the file "LICENSE.txt" -+ * which should have been included with this file. If this file is -+ * file is missing or damaged, see the license at "http://www.cups.org/". -+ * -+ * Contents: -+ * -+ * cupsdInitTimeouts() - Initialise timeout structure. -+ * cupsdAddTimeout() - Add a timed callback. -+ * cupsdNextTimeout() - Find the next enabled timed callback. -+ * cupsdUpdateTimeout() - Adjust the time of a timed callback or disable it. -+ * cupsdRemoveTimeout() - Discard a timed callback. -+ * compare_timeouts() - Compare timed callbacks for array sorting. -+ */ -+ -+#include <config.h> -+ -+#ifdef HAVE_AVAHI /* Applies to entire file... */ -+ -+/* -+ * Include necessary headers... -+ */ -+ -+#include "cupsd.h" -+ -+#if defined(HAVE_MALLOC_H) && defined(HAVE_MALLINFO) -+# include <malloc.h> -+#endif /* HAVE_MALLOC_H && HAVE_MALLINFO */ -+ -+#ifdef HAVE_AVAHI -+# include <avahi-common/timeval.h> -+#endif /* HAVE_AVAHI */ -+ -+ -+struct _cupsd_timeout_s -+{ -+ struct timeval when; -+ int enabled; -+ cupsd_timeoutfunc_t callback; -+ void *data; -+}; -+ -+/* -+ * Local functions... -+ */ -+ -+/* -+ * 'compare_timeouts()' - Compare timed callbacks for array sorting. -+ */ -+ -+static int -+compare_timeouts (cupsd_timeout_t *p0, cupsd_timeout_t *p1) -+{ -+ if (!p0->enabled || !p1->enabled) -+ { -+ if (!p0->enabled && !p1->enabled) -+ return (0); -+ -+ return (p0->enabled ? -1 : 1); -+ } -+ -+ return (avahi_timeval_compare (&p0->when, &p1->when)); -+} -+ -+ -+/* -+ * 'cupsdInitTimeouts()' - Initialise timeout structures. -+ */ -+ -+void -+cupsdInitTimeouts(void) -+{ -+ Timeouts = cupsArrayNew ((cups_array_func_t)compare_timeouts, NULL); -+} -+ -+ -+/* -+ * 'cupsdAddTimeout()' - Add a timed callback. -+ */ -+ -+cupsd_timeout_t * /* O - Timeout handle */ -+cupsdAddTimeout(const struct timeval *tv, /* I - Absolute time */ -+ cupsd_timeoutfunc_t cb, /* I - Callback function */ -+ void *data) /* I - User data */ -+{ -+ cupsd_timeout_t *timeout; -+ -+ timeout = malloc (sizeof(cupsd_timeout_t)); -+ if (timeout != NULL) -+ { -+ timeout->enabled = (tv != NULL); -+ if (tv) -+ { -+ timeout->when.tv_sec = tv->tv_sec; -+ timeout->when.tv_usec = tv->tv_usec; -+ } -+ -+ timeout->callback = cb; -+ timeout->data = data; -+ cupsArrayAdd (Timeouts, timeout); -+ } -+ -+ return timeout; -+} -+ -+ -+/* -+ * 'cupsdNextTimeout()' - Find the next enabled timed callback. -+ */ -+ -+cupsd_timeout_t * /* O - Next enabled timeout or NULL */ -+cupsdNextTimeout(long *delay) /* O - Seconds before scheduled */ -+{ -+ cupsd_timeout_t *first = cupsArrayFirst (Timeouts); -+ struct timeval curtime; -+ -+ if (first && !first->enabled) -+ first = NULL; -+ -+ if (first && delay) -+ { -+ gettimeofday (&curtime, NULL); -+ if (avahi_timeval_compare (&curtime, &first->when) > 0) -+ { -+ *delay = 0; -+ } else { -+ *delay = 1 + first->when.tv_sec - curtime.tv_sec; -+ if (first->when.tv_usec < curtime.tv_usec) -+ (*delay)--; -+ } -+ } -+ -+ return (first); -+} -+ -+ -+/* -+ * 'cupsdRunTimeout()' - Run a timed callback. -+ */ -+ -+void -+cupsdRunTimeout(cupsd_timeout_t *timeout) /* I - Timeout */ -+{ -+ if (!timeout) -+ return; -+ timeout->enabled = 0; -+ if (!timeout->callback) -+ return; -+ timeout->callback (timeout, timeout->data); -+} -+ -+/* -+ * 'cupsdUpdateTimeout()' - Adjust the time of a timed callback or disable it. -+ */ -+ -+void -+cupsdUpdateTimeout(cupsd_timeout_t *timeout, /* I - Timeout */ -+ const struct timeval *tv) /* I - Absolute time or NULL */ -+{ -+ cupsArrayRemove (Timeouts, timeout); -+ timeout->enabled = (tv != NULL); -+ if (tv) -+ { -+ timeout->when.tv_sec = tv->tv_sec; -+ timeout->when.tv_usec = tv->tv_usec; -+ } -+ cupsArrayAdd (Timeouts, timeout); -+} -+ -+ -+/* -+ * 'cupsdRemoveTimeout()' - Discard a timed callback. -+ */ -+ -+void -+cupsdRemoveTimeout(cupsd_timeout_t *timeout) /* I - Timeout */ -+{ -+ cupsArrayRemove (Timeouts, timeout); -+ free (timeout); -+} -+ -+ -+#endif /* HAVE_AVAHI ... from top of file */ -+ -+/* -+ * End of "$Id$". -+ */ ---- a/cgi-bin/admin.c -+++ b/cgi-bin/admin.c -@@ -1643,7 +1643,7 @@ - else - local_protocols[0] = '\0'; - --#ifdef HAVE_DNSSD -+#if defined(HAVE_DNSSD) || defined(HAVE_AVAHI) - if (cgiGetVariable("BROWSE_LOCAL_DNSSD")) - { - if (local_protocols[0]) -@@ -1651,7 +1651,7 @@ - else - strcat(local_protocols, "dnssd"); - } --#endif /* HAVE_DNSSD */ -+#endif /* defined(HAVE_DNSSD) || defined(HAVE_AVAHI) */ - - #ifdef HAVE_LDAP - if (cgiGetVariable("BROWSE_LOCAL_LDAP")) -@@ -2718,9 +2718,9 @@ - #endif /* HAVE_GSSAPI */ - cgiSetVariable("KERBEROS", ""); - --#ifdef HAVE_DNSSD -+#if defined(HAVE_DNSSD) || defined(HAVE_AVAHI) - cgiSetVariable("HAVE_DNSSD", "1"); --#endif /* HAVE_DNSSD */ -+#endif /* defined(HAVE_DNSSD) || defined(HAVE_AVAHI) */ - - #ifdef HAVE_LDAP - cgiSetVariable("HAVE_LDAP", "1"); ---- a/scheduler/client.c -+++ b/scheduler/client.c -@@ -4987,7 +4987,7 @@ - !strncmp(host, "[::1]:", 6)); - } - --#ifdef HAVE_DNSSD -+#if defined(HAVE_DNSSD) || defined(HAVE_AVAHI) - /* - * Check if the hostname is something.local (Bonjour); if so, allow it. - */ -@@ -4996,7 +4996,7 @@ - (!_cups_strcasecmp(end, ".local") || !_cups_strncasecmp(end, ".local:", 7) || - !_cups_strcasecmp(end, ".local.") || !_cups_strncasecmp(end, ".local.:", 8))) - return (1); --#endif /* HAVE_DNSSD */ -+#endif /* defined(HAVE_DNSSD) || defined(HAVE_AVAHI) */ - - /* - * Check if the hostname is an IP address... ---- a/scheduler/dirsvc.c -+++ b/scheduler/dirsvc.c -@@ -27,6 +27,7 @@ - * ldap_connect() - Start new LDAP connection - * ldap_reconnect() - Reconnect to LDAP Server - * ldap_disconnect() - Disconnect from LDAP Server -+ * cupsdStartAvahiClient() - Start an Avahi client if needed - * cupsdStartBrowsing() - Start sending and receiving broadcast - * information. - * cupsdStartPolling() - Start polling servers as needed. -@@ -45,6 +46,8 @@ - * printer. - * dnssdPackTxtRecord() - Pack an array of key/value pairs into the TXT - * record format. -+ * avahiPackTxtRecord() - Pack an array of key/value pairs into an -+ * AvahiStringList. - * dnssdRegisterCallback() - DNSServiceRegister callback. - * dnssdRegisterPrinter() - Start sending broadcast information for a - * printer or update the broadcast contents. -@@ -83,6 +86,7 @@ - */ - - #include "cupsd.h" -+#include <assert.h> - #include <grp.h> - - #ifdef HAVE_DNSSD -@@ -97,6 +101,17 @@ - # endif /* HAVE_SYSTEMCONFIGURATION */ - # endif /* __APPLE__ */ - #endif /* HAVE_DNSSD */ -+#ifdef HAVE_AVAHI -+# include <avahi-common/domain.h> -+#endif /* HAVE_AVAHI */ -+ -+ -+#ifdef HAVE_DNSSD -+typedef char *cupsd_txt_record_t; -+#endif /* HAVE_DNSSD */ -+#ifdef HAVE_AVAHI -+typedef AvahiStringList *cupsd_txt_record_t; -+#endif /* HAVE_AVAHI */ - - - /* -@@ -159,27 +174,39 @@ - static void update_smb(int onoff); - - -+#if defined(HAVE_DNSSD) || defined(HAVE_AVAHI) -+static cupsd_txt_record_t dnssdBuildTxtRecord(int *txt_len, cupsd_printer_t *p, -+ int for_lpd); -+static int dnssdComparePrinters(cupsd_printer_t *a, cupsd_printer_t *b); -+static void dnssdDeregisterPrinter(cupsd_printer_t *p); -+static void dnssdRegisterPrinter(cupsd_printer_t *p); -+static void dnssdStop(void); -+#endif /* defined(HAVE_DNSSD) || defined(HAVE_AVAHI) */ -+ - #ifdef HAVE_DNSSD - # ifdef HAVE_COREFOUNDATION - static void dnssdAddAlias(const void *key, const void *value, - void *context); - # endif /* HAVE_COREFOUNDATION */ --static char *dnssdBuildTxtRecord(int *txt_len, cupsd_printer_t *p, -- int for_lpd); --static int dnssdComparePrinters(cupsd_printer_t *a, cupsd_printer_t *b); --static void dnssdDeregisterPrinter(cupsd_printer_t *p); --static char *dnssdPackTxtRecord(int *txt_len, char *keyvalue[][2], -- int count); - static void dnssdRegisterCallback(DNSServiceRef sdRef, - DNSServiceFlags flags, - DNSServiceErrorType errorCode, - const char *name, const char *regtype, - const char *domain, void *context); --static void dnssdRegisterPrinter(cupsd_printer_t *p); --static void dnssdStop(void); - static void dnssdUpdate(void); - #endif /* HAVE_DNSSD */ - -+#ifdef HAVE_AVAHI -+static AvahiStringList *avahiPackTxtRecord(char *keyvalue[][2], -+ int count); -+static void avahi_entry_group_cb (AvahiEntryGroup *group, -+ AvahiEntryGroupState state, -+ void *userdata); -+static void avahi_client_cb (AvahiClient *client, -+ AvahiClientState state, -+ void *userdata); -+#endif /* HAVE_AVAHI */ -+ - #ifdef HAVE_LDAP - static const char * const ldap_attrs[] =/* CUPS LDAP attributes */ - { -@@ -283,10 +310,10 @@ - ldap_dereg_printer(p); - #endif /* HAVE_LDAP */ - --#ifdef HAVE_DNSSD -- if (removeit && (BrowseLocalProtocols & BROWSE_DNSSD) && DNSSDRef) -+#if defined(HAVE_DNSSD) || defined(HAVE_AVAHI) -+ if (removeit && (BrowseLocalProtocols & BROWSE_DNSSD)) - dnssdDeregisterPrinter(p); --#endif /* HAVE_DNSSD */ -+#endif /* defined(HAVE_DNSSD) || defined(HAVE_AVAHI) */ - } - - -@@ -702,10 +729,10 @@ - slpRegisterPrinter(p); */ - #endif /* HAVE_LIBSLP */ - --#ifdef HAVE_DNSSD -- if ((BrowseLocalProtocols & BROWSE_DNSSD) && DNSSDRef) -+#if defined(HAVE_DNSSD) || defined(HAVE_AVAHI) -+ if ((BrowseLocalProtocols & BROWSE_DNSSD)) - dnssdRegisterPrinter(p); --#endif /* HAVE_DNSSD */ -+#endif /* defined(HAVE_DNSSD) || defined(HAVE_AVAHI) */ - } - - -@@ -1419,6 +1446,27 @@ - #endif /* HAVE_LDAP */ - - -+#ifdef HAVE_AVAHI -+/* -+ * 'cupsdStartAvahiClient()' - Start an Avahi client if needed -+ */ -+ -+void -+cupsdStartAvahiClient(void) -+{ -+ if (!AvahiCupsClient && !AvahiCupsClientConnecting) -+ { -+ if (!AvahiCupsPollHandle) -+ AvahiCupsPollHandle = avahi_cups_poll_new (); -+ -+ if (AvahiCupsPollHandle) -+ avahi_client_new (avahi_cups_poll_get (AvahiCupsPollHandle), -+ AVAHI_CLIENT_NO_FAIL, avahi_client_cb, NULL, NULL); -+ } -+} -+#endif /* HAVE_AVAHI */ -+ -+ - /* - * 'cupsdStartBrowsing()' - Start sending and receiving broadcast information. - */ -@@ -1542,13 +1590,16 @@ - else - BrowseSocket = -1; - --#ifdef HAVE_DNSSD -+#if defined(HAVE_DNSSD) || defined(HAVE_AVAHI) - if ((BrowseLocalProtocols | BrowseRemoteProtocols) & BROWSE_DNSSD) - { -+#ifdef HAVE_DNSSD - DNSServiceErrorType error; /* Error from service creation */ -+#endif /* HAVE_DNSSD */ - cupsd_listener_t *lis; /* Current listening socket */ - - -+#ifdef HAVE_DNSSD - /* - * First create a "master" connection for all registrations... - */ -@@ -1573,6 +1624,7 @@ - fcntl(fd, F_SETFD, fcntl(fd, F_GETFD) | FD_CLOEXEC); - - cupsdAddSelect(fd, (cupsd_selfunc_t)dnssdUpdate, NULL, NULL); -+#endif /* HAVE_DNSSD */ - - /* - * Then get the port we use for registrations. If we are not listening -@@ -1606,9 +1658,16 @@ - */ - - cupsdUpdateDNSSDName(); -+ -+#ifdef HAVE_AVAHI -+ cupsdStartAvahiClient (); -+#endif /* HAVE_AVAHI */ -+ -+#ifdef HAVE_DNSSD - } -- } - #endif /* HAVE_DNSSD */ -+ } -+#endif /* defined(HAVE_DNSSD) || defined(HAVE_AVAHI) */ - - #ifdef HAVE_LIBSLP - if ((BrowseLocalProtocols | BrowseRemoteProtocols) & BROWSE_SLP) -@@ -1834,10 +1893,10 @@ - BrowseSocket = -1; - } - --#ifdef HAVE_DNSSD -- if ((BrowseLocalProtocols & BROWSE_DNSSD) && DNSSDRef) -+#if defined(HAVE_DNSSD) || defined(HAVE_AVAHI) -+ if ((BrowseLocalProtocols & BROWSE_DNSSD)) - dnssdStop(); --#endif /* HAVE_DNSSD */ -+#endif /* defined(HAVE_DNSSD) || defined(HAVE_AVAHI) */ - - #ifdef HAVE_LIBSLP - if (((BrowseLocalProtocols | BrowseRemoteProtocols) & BROWSE_SLP) && -@@ -1902,7 +1961,7 @@ - } - - --#ifdef HAVE_DNSSD -+#if defined(HAVE_DNSSD) || defined(HAVE_AVAHI) - /* - * 'cupsdUpdateDNSSDName()' - Update the computer name we use for browsing... - */ -@@ -1910,8 +1969,14 @@ - void - cupsdUpdateDNSSDName(void) - { -+#ifdef HAVE_DNSSD - DNSServiceErrorType error; /* Error from service creation */ - char webif[1024]; /* Web interface share name */ -+#endif /* HAVE_DNSSD */ -+#ifdef HAVE_AVAHI -+ int ret; /* Error from service creation */ -+ char webif[AVAHI_LABEL_MAX]; /* Web interface share name */ -+#endif /* HAVE_AVAHI */ - # ifdef HAVE_SYSTEMCONFIGURATION - SCDynamicStoreRef sc; /* Context for dynamic store */ - CFDictionaryRef btmm; /* Back-to-My-Mac domains */ -@@ -2042,6 +2107,7 @@ - else - strlcpy(webif, "CUPS Web Interface", sizeof(webif)); - -+#ifdef HAVE_DNSSD - if (WebIFRef) - DNSServiceRefDeallocate(WebIFRef); - -@@ -2054,9 +2120,45 @@ - NULL)) != kDNSServiceErr_NoError) - cupsdLogMessage(CUPSD_LOG_ERROR, - "DNS-SD web interface registration failed: %d", error); -+#endif /* HAVE_DNSSD */ -+ -+#ifdef HAVE_AVAHI -+ if (!AvahiCupsClient) -+ /* -+ * Client not yet running. -+ */ -+ return; -+ -+ if (AvahiWebIFGroup) -+ avahi_entry_group_reset (AvahiWebIFGroup); -+ else -+ AvahiWebIFGroup = avahi_entry_group_new (AvahiCupsClient, -+ avahi_entry_group_cb, -+ NULL); -+ -+ if (AvahiWebIFGroup) -+ { -+ ret = avahi_entry_group_add_service (AvahiWebIFGroup, -+ AVAHI_IF_UNSPEC, -+ AVAHI_PROTO_UNSPEC, -+ 0, /* flags */ -+ webif, /* name */ -+ "_http._tcp", /* type */ -+ NULL, /* domain */ -+ NULL, /* host */ -+ DNSSDPort, /* port */ -+ "path=/", NULL); -+ if (ret == 0) -+ ret = avahi_entry_group_commit (AvahiWebIFGroup); -+ -+ if (ret != 0) -+ cupsdLogMessage (CUPSD_LOG_ERROR, -+ "Avahi web interface registration failed: %d", ret); -+ } -+#endif /* HAVE_AVAHI */ - } - } --#endif /* HAVE_DNSSD */ -+#endif /* defined(HAVE_DNSSD) || defined(HAVE_AVAHI) */ - - - #ifdef HAVE_LDAP -@@ -2334,13 +2436,15 @@ - "Bad Back to My Mac domain in dynamic store!"); - } - # endif /* HAVE_COREFOUNDATION */ -+#endif /* HAVE_DNSSD */ - - -+#if defined(HAVE_DNSSD) || defined(HAVE_AVAHI) - /* - * 'dnssdBuildTxtRecord()' - Build a TXT record from printer info. - */ - --static char * /* O - TXT record */ -+static cupsd_txt_record_t /* O - TXT record */ - dnssdBuildTxtRecord( - int *txt_len, /* O - TXT record length */ - cupsd_printer_t *p, /* I - Printer information */ -@@ -2379,7 +2483,12 @@ - keyvalue[i ][0] = "ty"; - keyvalue[i++][1] = p->make_model ? p->make_model : "Unknown"; - -- snprintf(admin_hostname, sizeof(admin_hostname), "%s.local.", DNSSDHostName); -+ snprintf(admin_hostname, sizeof(admin_hostname), -+ "%s.local" -+#ifdef HAVE_DNSSD -+ "." /* terminating dot no good for Avahi */ -+#endif /* HAVE_DNSSD */ -+ , DNSSDHostName); - httpAssembleURIf(HTTP_URI_CODING_ALL, adminurl_str, sizeof(adminurl_str), - "http", NULL, admin_hostname, DNSSDPort, "/%s/%s", - (p->type & CUPS_PRINTER_CLASS) ? "classes" : "printers", -@@ -2462,7 +2571,12 @@ - * Then pack them into a proper txt record... - */ - -+#ifdef HAVE_DNSSD - return (dnssdPackTxtRecord(txt_len, keyvalue, i)); -+#endif /* HAVE_DNSSD */ -+#ifdef HAVE_AVAHI -+ return (avahiPackTxtRecord(keyvalue, i)); -+#endif /* HAVE_AVAHI */ - } - - -@@ -2474,7 +2588,16 @@ - dnssdComparePrinters(cupsd_printer_t *a,/* I - First printer */ - cupsd_printer_t *b)/* I - Second printer */ - { -- return (_cups_strcasecmp(a->reg_name, b->reg_name)); -+ if (!a->reg_name) -+ if (!b->reg_name) -+ return 0; -+ else -+ return -1; -+ else -+ if (!b->reg_name) -+ return 1; -+ else -+ return (_cups_strcasecmp(a->reg_name, b->reg_name)); - } - - -@@ -2489,6 +2612,10 @@ - { - cupsdLogMessage(CUPSD_LOG_DEBUG2, "dnssdDeregisterPrinter(%s)", p->name); - -+#ifdef HAVE_DNSSD -+ if (!DNSSDRef) -+ return; -+ - /* - * Closing the socket deregisters the service - */ -@@ -2524,6 +2651,24 @@ - free(p->printer_txt); - p->printer_txt = NULL; - } -+#endif /* HAVE_DNSSD */ -+ -+#ifdef HAVE_AVAHI -+ if (p->avahi_group) -+ { -+ avahi_entry_group_reset (p->avahi_group); -+ avahi_entry_group_free (p->avahi_group); -+ p->avahi_group = NULL; -+ -+ if (p->ipp_txt) -+ avahi_string_list_free (p->ipp_txt); -+ -+ if (p->printer_txt) -+ avahi_string_list_free (p->printer_txt); -+ -+ p->ipp_txt = p->printer_txt = NULL; -+ } -+#endif /* HAVE_AVAHI */ - - /* - * Remove the printer from the array of DNS-SD printers, then clear the -@@ -2533,8 +2678,10 @@ - cupsArrayRemove(DNSSDPrinters, p); - cupsdClearString(&p->reg_name); - } -+#endif /* defined(HAVE_DNSSD) || defined(HAVE_AVAHI) */ - - -+#ifdef HAVE_DNSSD - /* - * 'dnssdPackTxtRecord()' - Pack an array of key/value pairs into the - * TXT record format. -@@ -2644,8 +2791,10 @@ - LastEvent |= CUPSD_EVENT_PRINTER_MODIFIED; - } - } -+#endif /* HAVE_DNSSD */ - - -+#if defined(HAVE_DNSSD) || defined(HAVE_AVAHI) - /* - * 'dnssdRegisterPrinter()' - Start sending broadcast information for a printer - * or update the broadcast contents. -@@ -2654,20 +2803,40 @@ - static void - dnssdRegisterPrinter(cupsd_printer_t *p)/* I - Printer */ - { -+#ifdef HAVE_DNSSD - DNSServiceErrorType se; /* dnssd errors */ - char *ipp_txt, /* IPP TXT record buffer */ - *printer_txt, /* LPD TXT record buffer */ -- name[1024], /* Service name */ -- *nameptr; /* Pointer into name */ -+ name[1024]; /* Service name */ - int ipp_len, /* IPP TXT record length */ - printer_len, /* LPD TXT record length */ - printer_port; /* LPD port number */ -+#endif /* HAVE_DNSSD */ -+#ifdef HAVE_AVAHI -+ int ret; /* Error code */ -+ AvahiStringList *ipp_txt, /* IPP TXT record */ -+ *printer_txt; /* LPD TXT record */ -+ char name[AVAHI_LABEL_MAX], /* Service name */ -+ fullsubtype[AVAHI_LABEL_MAX]; /* Full subtype */ -+ char *regtype_copy, /* Writeable copy of reg type */ -+ *subtype, /* Current service sub type */ -+ *nextsubtype; /* Next service sub type */ -+#endif /* HAVE_AVAHI */ -+ char *nameptr; /* Pointer into name */ - const char *regtype; /* Registration type */ - - -+#ifdef HAVE_DNSSD -+ if (!DNSSDRef) -+ return; -+ - cupsdLogMessage(CUPSD_LOG_DEBUG2, "dnssdRegisterPrinter(%s) %s", p->name, - !p->ipp_ref ? "new" : "update"); -- -+#endif /* HAVE_DNSSD */ -+#ifdef HAVE_AVAHI -+ cupsdLogMessage(CUPSD_LOG_DEBUG2, "dnssdRegisterPrinter(%s) %s", p->name, -+ !p->avahi_group ? "new" : "update"); -+#endif /* HAVE_AVAHI */ - /* - * If per-printer sharing was just disabled make sure we're not - * registered before returning. -@@ -2686,12 +2855,36 @@ - if (p->info && strlen(p->info) > 0) - { - if (DNSSDComputerName) -- snprintf(name, sizeof(name), "%s @ %s", p->info, DNSSDComputerName); -+ { -+ /* -+ * Make sure there is room for at least 15 characters of -+ * DNSSDComputerName. -+ */ -+ -+ assert(sizeof(name) >= 15 + 4); -+ nameptr = name + strlcpy(name, p->info, -+ sizeof(name) - 4 - -+ strnlen(DNSSDComputerName, 15)); -+ nameptr += strlcpy(nameptr, " @ ", sizeof(name) - (nameptr - name)); -+ strlcpy(nameptr, DNSSDComputerName, sizeof(name) - (nameptr - name)); -+ } - else - strlcpy(name, p->info, sizeof(name)); - } - else if (DNSSDComputerName) -- snprintf(name, sizeof(name), "%s @ %s", p->name, DNSSDComputerName); -+ { -+ /* -+ * Make sure there is room for at least 15 characters of -+ * DNSSDComputerName. -+ */ -+ -+ assert(sizeof(name) >= 15 + 4); -+ nameptr = name + strlcpy(name, p->info, -+ sizeof(name) - 4 - -+ strnlen(DNSSDComputerName, 15)); -+ nameptr += strlcpy(nameptr, " @ ", sizeof(name) - (nameptr - name)); -+ strlcpy(nameptr, DNSSDComputerName, sizeof(name) - (nameptr - name)); -+ } - else - strlcpy(name, p->name, sizeof(name)); - -@@ -2712,6 +2905,7 @@ - * Register IPP and (optionally) LPD... - */ - -+#ifdef HAVE_DNSSD - ipp_len = 0; /* anti-compiler-warning-code */ - ipp_txt = dnssdBuildTxtRecord(&ipp_len, p, 0); - -@@ -2884,6 +3078,209 @@ - - if (printer_txt) - free(printer_txt); -+#endif /* HAVE_DNSSD */ -+#ifdef HAVE_AVAHI -+ if (!AvahiCupsClient) -+ /* -+ * Client not running yet. The client callback will call us again later. -+ */ -+ return; -+ -+ ipp_txt = dnssdBuildTxtRecord(NULL, p, 0); -+ printer_txt = dnssdBuildTxtRecord(NULL, p, 1); -+ regtype = (p->type & CUPS_PRINTER_FAX) ? "_fax-ipp._tcp" : DNSSDRegType; -+ -+ if (p->avahi_group && p->ipp_txt && ipp_txt && -+ !avahi_string_list_equal (p->ipp_txt, ipp_txt)) -+ { -+ /* -+ * Update the existing registration... -+ */ -+ -+ avahi_string_list_free (p->ipp_txt); -+ -+ if (p->printer_txt) -+ avahi_string_list_free (p->printer_txt); -+ -+ /* -+ * Update the service group entry. -+ */ -+ -+ regtype_copy = strdup (regtype); -+ subtype = strchr (regtype_copy, ','); -+ if (subtype) -+ *subtype = '\0'; -+ -+ cupsdLogMessage (CUPSD_LOG_DEBUG, -+ "Updating TXT record for %s (%s)", name, regtype_copy); -+ ret = avahi_entry_group_update_service_txt_strlst (p->avahi_group, -+ AVAHI_IF_UNSPEC, -+ AVAHI_PROTO_UNSPEC, -+ 0, name, -+ regtype_copy, -+ NULL, ipp_txt); -+ free (regtype_copy); -+ -+ if (ret < 0) -+ goto update_failed; -+ -+ p->ipp_txt = ipp_txt; -+ ipp_txt = NULL; -+ -+ if (BrowseLocalProtocols & BROWSE_LPD) -+ { -+ ret = avahi_entry_group_update_service_txt_strlst (p->avahi_group, -+ AVAHI_IF_UNSPEC, -+ AVAHI_PROTO_UNSPEC, -+ 0, name, -+ "_printer._tcp", NULL, -+ printer_txt); -+ if (ret < 0) -+ goto update_failed; -+ -+ p->printer_txt = printer_txt; -+ printer_txt = NULL; -+ } -+ -+ ret = avahi_entry_group_commit (p->avahi_group); -+ if (ret < 0) -+ { -+ update_failed: -+ cupsdLogMessage (CUPSD_LOG_ERROR, -+ "Failed to update TXT record for %s: %d", -+ name, ret); -+ avahi_entry_group_reset (p->avahi_group); -+ avahi_entry_group_free (p->avahi_group); -+ p->avahi_group = NULL; -+ ipp_txt = p->ipp_txt; -+ p->ipp_txt = NULL; -+ } -+ } -+ -+ if (!p->avahi_group) -+ { -+ /* -+ * Initial registration. Use the _fax subtype for fax queues... -+ */ -+ -+ p->avahi_group = avahi_entry_group_new (AvahiCupsClient, -+ avahi_entry_group_cb, -+ p); -+ -+ cupsdLogMessage(CUPSD_LOG_DEBUG, -+ "Registering Avahi printer %s with name \"%s\" and " -+ "type \"%s\"", p->name, name, regtype); -+ -+ if (!p->avahi_group) -+ { -+ ret = 0; -+ goto add_failed; -+ } -+ -+ /* -+ * Add each service type (DNSSDRegType may contain several, -+ * separated by commas). -+ */ -+ -+ subtype = regtype_copy = strdup (regtype); -+ while (subtype && *subtype) -+ { -+ nextsubtype = strchr (subtype, ','); -+ if (nextsubtype) -+ *nextsubtype++ = '\0'; -+ -+ if (subtype == regtype_copy) -+ { -+ /* -+ * Main type entry. -+ */ -+ -+ cupsdLogMessage (CUPSD_LOG_DEBUG, -+ "Adding TXT record for %s (%s)", name, regtype_copy); -+ ret = avahi_entry_group_add_service_strlst (p->avahi_group, -+ AVAHI_IF_UNSPEC, -+ AVAHI_PROTO_UNSPEC, -+ 0, name, regtype_copy, -+ NULL, NULL, -+ DNSSDPort, -+ ipp_txt); -+ } -+ else -+ { -+ /* -+ * Sub-type entry. -+ */ -+ -+ snprintf (fullsubtype, sizeof(fullsubtype), -+ "%s._sub.%s", subtype, regtype_copy); -+ cupsdLogMessage (CUPSD_LOG_DEBUG, -+ "Adding TXT record for %s (%s)", name, fullsubtype); -+ ret = avahi_entry_group_add_service_subtype (p->avahi_group, -+ AVAHI_IF_UNSPEC, -+ AVAHI_PROTO_UNSPEC, -+ 0, name, -+ regtype_copy, -+ NULL, fullsubtype); -+ } -+ -+ if (ret < 0) -+ { -+ free (regtype_copy); -+ goto add_failed; -+ } -+ -+ subtype = nextsubtype; -+ } -+ -+ free (regtype_copy); -+ p->ipp_txt = ipp_txt; -+ ipp_txt = NULL; -+ -+ if (BrowseLocalProtocols & BROWSE_LPD) -+ { -+ cupsdLogMessage(CUPSD_LOG_DEBUG, -+ "Registering Avahi printer %s with name \"%s\" and " -+ "type \"_printer._tcp\"", p->name, name); -+ -+ ret = avahi_entry_group_add_service_strlst (p->avahi_group, -+ AVAHI_IF_UNSPEC, -+ AVAHI_PROTO_UNSPEC, -+ 0, name, -+ "_printer._tcp", NULL, NULL, -+ 515, -+ printer_txt); -+ if (ret < 0) -+ goto add_failed; -+ -+ p->printer_txt = printer_txt; -+ printer_txt = NULL; -+ } -+ -+ ret = avahi_entry_group_commit (p->avahi_group); -+ -+ if (ret < 0) -+ { -+ add_failed: -+ cupsdLogMessage (CUPSD_LOG_ERROR, -+ "Failed to add Avahi entry for %s: %d", -+ name, ret); -+ if (p->avahi_group) -+ { -+ avahi_entry_group_reset (p->avahi_group); -+ avahi_entry_group_free (p->avahi_group); -+ p->avahi_group = NULL; -+ } -+ ipp_txt = p->ipp_txt; -+ p->ipp_txt = NULL; -+ } -+ } -+ -+ if (ipp_txt) -+ avahi_string_list_free (ipp_txt); -+ -+ if (printer_txt) -+ avahi_string_list_free (printer_txt); -+#endif /* HAVE_AVAHI */ - } - - -@@ -2896,6 +3293,10 @@ - { - cupsd_printer_t *p; /* Current printer */ - -+#ifdef HAVE_DNSSD -+ if (!DNSSDRef) -+ return; -+#endif /* HAVE_DNSSD */ - - /* - * De-register the individual printers -@@ -2906,6 +3307,7 @@ - p = (cupsd_printer_t *)cupsArrayNext(Printers)) - dnssdDeregisterPrinter(p); - -+#ifdef HAVE_DNSSD - /* - * Shutdown the rest of the service refs... - */ -@@ -2926,14 +3328,17 @@ - - DNSServiceRefDeallocate(DNSSDRef); - DNSSDRef = NULL; -+#endif /* HAVE_DNSSD */ - - cupsArrayDelete(DNSSDPrinters); - DNSSDPrinters = NULL; - - DNSSDPort = 0; - } -+#endif /* defined(HAVE_DNSSD) || defined(HAVE_AVAHI) */ - - -+#ifdef HAVE_DNSSD - /* - * 'dnssdUpdate()' - Handle DNS-SD queries. - */ -@@ -2955,6 +3360,147 @@ - #endif /* HAVE_DNSSD */ - - -+#ifdef HAVE_AVAHI -+/* -+ * 'avahiPackTxtRecord()' - Pack an array of key/value pairs into an -+ * AvahiStringList. -+ */ -+ -+static AvahiStringList * /* O - new string list */ -+avahiPackTxtRecord(char *keyvalue[][2], /* I - Table of key value pairs */ -+ int count) /* I - Number of items in table */ -+{ -+ AvahiStringList *strlst = NULL; -+ char **elements; -+ size_t len; -+ int i = 0; -+ -+ elements = malloc ((1 + count) * sizeof (char *)); -+ if (!elements) -+ goto cleanup; -+ -+ for (i = 0; i < count; i++) -+ { -+ len = (1 + strlen (keyvalue[i][0]) + -+ (keyvalue[i][1] ? 1 + strlen (keyvalue[i][1]) : 1)); -+ elements[i] = malloc (len * sizeof (char)); -+ if (!elements[i]) -+ goto cleanup; -+ -+ snprintf (elements[i], len, "%s=%s", keyvalue[i][0], keyvalue[i][1]); -+ } -+ -+ strlst = avahi_string_list_new_from_array ((const char **) elements, count); -+ -+cleanup: -+ while (--i >= 0) -+ free (elements[i]); -+ -+ free (elements); -+ return (strlst); -+} -+ -+ -+/* -+ * 'avahi_entry_group_cb()' - Avahi entry group callback function. -+ */ -+static void -+avahi_entry_group_cb (AvahiEntryGroup *group, -+ AvahiEntryGroupState state, -+ void *userdata) -+{ -+ char *name; -+ -+ if (userdata) -+ name = ((cupsd_printer_t *) userdata)->reg_name; -+ else -+ name = "CUPS web interface"; -+ -+ switch (state) -+ { -+ case AVAHI_ENTRY_GROUP_UNCOMMITED: -+ case AVAHI_ENTRY_GROUP_REGISTERING: -+ break; -+ -+ case AVAHI_ENTRY_GROUP_ESTABLISHED: -+ cupsdLogMessage (CUPSD_LOG_DEBUG, -+ "Avahi entry group established for %s", name); -+ break; -+ -+ default: -+ cupsdLogMessage (CUPSD_LOG_DEBUG, -+ "Avahi entry group %s has state %d", -+ name, state); -+ break; -+ } -+} -+ -+ -+/* -+ * 'avahi_client_cb()' - Avahi client callback function. -+ */ -+static void -+avahi_client_cb (AvahiClient *client, -+ AvahiClientState state, -+ void *userdata) -+{ -+ cupsd_printer_t *printer; -+ switch (state) -+ { -+ case AVAHI_CLIENT_S_RUNNING: -+ /* -+ * Avahi client started successfully. -+ */ -+ AvahiCupsClient = client; -+ AvahiCupsClientConnecting = 0; -+ cupsdLogMessage (CUPSD_LOG_DEBUG, "Avahi client started"); -+ -+ cupsdUpdateDNSSDName (); -+ -+ for (printer = (cupsd_printer_t *)cupsArrayFirst(Printers); -+ printer; -+ printer = (cupsd_printer_t *)cupsArrayNext(Printers)) -+ if (Browsing && (BrowseLocalProtocols & BROWSE_DNSSD) && -+ (!(printer->type & (CUPS_PRINTER_REMOTE | CUPS_PRINTER_IMPLICIT | -+ CUPS_PRINTER_SCANNER))) && printer->shared) -+ dnssdRegisterPrinter (printer); -+ -+ break; -+ -+ case AVAHI_CLIENT_CONNECTING: -+ /* -+ * No Avahi daemon, client is waiting. -+ */ -+ AvahiCupsClientConnecting = 1; -+ cupsdLogMessage (CUPSD_LOG_DEBUG, "Avahi client connecting"); -+ break; -+ -+ case AVAHI_CLIENT_FAILURE: -+ /* -+ * Avahi client failed, close it to allow a clean restart. -+ */ -+ cupsdLogMessage (CUPSD_LOG_ERROR, -+ "Avahi client failed, " -+ "closing client to allow a clean restart"); -+ -+ for (printer = (cupsd_printer_t *)cupsArrayFirst(Printers); -+ printer; -+ printer = (cupsd_printer_t *)cupsArrayNext(Printers)) -+ dnssdDeregisterPrinter (printer); -+ -+ avahi_client_free(client); -+ AvahiCupsClientConnecting = 0; -+ AvahiCupsClient = NULL; -+ -+ break; -+ -+ default: -+ cupsdLogMessage (CUPSD_LOG_DEBUG, "Avahi client state: %d", state); -+ } -+} -+#endif /* HAVE_AVAHI */ -+ -+ - /* - * 'get_auth_info_required()' - Get the auth-info-required value to advertise. - */ ---- a/scheduler/dirsvc.h -+++ b/scheduler/dirsvc.h -@@ -31,6 +31,10 @@ - # endif /* HAVE_LDAP_SSL_H */ - #endif /* HAVE_LDAP */ - -+#ifdef HAVE_AVAHI -+# include <avahi-client/publish.h> -+#endif /* HAVE_AVAHI */ -+ - /* - * Browse protocols... - */ -@@ -131,19 +135,22 @@ - VAR cupsd_statbuf_t *PollStatusBuffer VALUE(NULL); - /* Status buffer for pollers */ - --#ifdef HAVE_DNSSD -+#if defined(HAVE_DNSSD) || defined(HAVE_AVAHI) - VAR char *DNSSDComputerName VALUE(NULL), - /* Computer/server name */ - *DNSSDHostName VALUE(NULL), - /* Hostname */ - *DNSSDRegType VALUE(NULL); - /* Bonjour registration type */ --VAR cups_array_t *DNSSDAlias VALUE(NULL); -- /* List of dynamic ServerAlias's */ - VAR int DNSSDPort VALUE(0); - /* Port number to register */ - VAR cups_array_t *DNSSDPrinters VALUE(NULL); - /* Printers we have registered */ -+#endif /* defined(HAVE_DNSSD) || defined(HAVE_AVAHI) */ -+ -+#ifdef HAVE_DNSSD -+VAR cups_array_t *DNSSDAlias VALUE(NULL); -+ /* List of dynamic ServerAlias's */ - VAR DNSServiceRef DNSSDRef VALUE(NULL), - /* Master DNS-SD service reference */ - WebIFRef VALUE(NULL), -@@ -152,6 +159,17 @@ - /* Remote printer browse reference */ - #endif /* HAVE_DNSSD */ - -+#ifdef HAVE_AVAHI -+VAR AvahiCupsPoll *AvahiCupsPollHandle VALUE(NULL); -+ /* AvahiCupsPoll object */ -+VAR AvahiClient *AvahiCupsClient VALUE(NULL); -+ /* AvahiClient object */ -+VAR int AvahiCupsClientConnecting VALUE(0); -+ /* Is AvahiClient object connecting? */ -+VAR AvahiEntryGroup *AvahiWebIFGroup VALUE(NULL); -+ /* Web interface entry group */ -+#endif /* HAVE_AVAHI */ -+ - #ifdef HAVE_LIBSLP - VAR SLPHandle BrowseSLPHandle VALUE(NULL); - /* SLP API handle */ -@@ -195,13 +213,14 @@ - extern void cupsdRestartPolling(void); - extern void cupsdSaveRemoteCache(void); - extern void cupsdSendBrowseList(void); -+extern void cupsdStartAvahiClient(void); - extern void cupsdStartBrowsing(void); - extern void cupsdStartPolling(void); - extern void cupsdStopBrowsing(void); - extern void cupsdStopPolling(void); --#ifdef HAVE_DNSSD -+#if defined(HAVE_DNSSD) || defined(HAVE_AVAHI) - extern void cupsdUpdateDNSSDName(void); --#endif /* HAVE_DNSSD */ -+#endif /* defined(HAVE_DNSSD) || defined(HAVE_AVAHI) */ - #ifdef HAVE_LDAP - extern void cupsdUpdateLDAPBrowse(void); - #endif /* HAVE_LDAP */ ---- a/scheduler/ipp.c -+++ b/scheduler/ipp.c -@@ -6087,7 +6087,7 @@ - ippAddDate(con->response, IPP_TAG_PRINTER, "printer-current-time", - ippTimeToDate(curtime)); - --#ifdef HAVE_DNSSD -+#if defined(HAVE_DNSSD) || defined(HAVE_AVAHI) - if (!ra || cupsArrayFind(ra, "printer-dns-sd-name")) - { - if (printer->reg_name) -@@ -6097,7 +6097,7 @@ - ippAddInteger(con->response, IPP_TAG_PRINTER, IPP_TAG_NOVALUE, - "printer-dns-sd-name", 0); - } --#endif /* HAVE_DNSSD */ -+#endif /* defined(HAVE_DNSSD) || defined(HAVE_AVAHI) */ - - if (!ra || cupsArrayFind(ra, "printer-error-policy")) - ippAddString(con->response, IPP_TAG_PRINTER, IPP_TAG_NAME, ---- a/scheduler/printers.c -+++ b/scheduler/printers.c -@@ -883,9 +883,9 @@ - cupsdClearString(&p->alert); - cupsdClearString(&p->alert_description); - --#ifdef HAVE_DNSSD -+#if defined(HAVE_DNSSD) || defined(HAVE_AVAHI) - cupsdClearString(&p->pdl); --#endif /* HAVE_DNSSD */ -+#endif /* defined(HAVE_DNSSD) || defined(HAVE_AVAHI) */ - - cupsArrayDelete(p->filetypes); - -@@ -3765,7 +3765,7 @@ - attr->values[i].string.text = _cupsStrAlloc(mimetype); - } - --#ifdef HAVE_DNSSD -+#if defined(HAVE_DNSSD) || defined(HAVE_AVAHI) - { - char pdl[1024]; /* Buffer to build pdl list */ - mime_filter_t *filter; /* MIME filter looping var */ -@@ -3821,7 +3821,7 @@ - - cupsdSetString(&p->pdl, pdl); - } --#endif /* HAVE_DNSSD */ -+#endif /* defined(HAVE_DNSSD) || defined(HAVE_AVAHI) */ - } - - ---- a/scheduler/printers.h -+++ b/scheduler/printers.h -@@ -16,6 +16,9 @@ - #ifdef HAVE_DNSSD - # include <dns_sd.h> - #endif /* HAVE_DNSSD */ -+#ifdef HAVE_AVAHI -+# include "avahi.h" -+#endif /* HAVE_AVAHI */ - #include <cups/pwg-private.h> - - -@@ -95,16 +98,23 @@ - time_t marker_time; /* Last time marker attributes were updated */ - _ppd_cache_t *pc; /* PPD cache and mapping data */ - --#ifdef HAVE_DNSSD -+#if defined(HAVE_DNSSD) || defined(HAVE_AVAHI) - char *reg_name, /* Name used for service registration */ -- *pdl, /* pdl value for TXT record */ -- *ipp_txt, /* IPP TXT record contents */ -+ *pdl; /* pdl value for TXT record */ -+#endif /* defined(HAVE_DNSSD) || defined(HAVE_AVAHI) */ -+#ifdef HAVE_DNSSD -+ char *ipp_txt, /* IPP TXT record contents */ - *printer_txt; /* LPD TXT record contents */ - int ipp_len, /* IPP TXT record length */ - printer_len; /* LPD TXT record length */ - DNSServiceRef ipp_ref, /* Reference for _ipp._tcp,_cups */ - printer_ref; /* Reference for _printer._tcp */ - #endif /* HAVE_DNSSD */ -+#ifdef HAVE_AVAHI -+ AvahiStringList *ipp_txt, /* IPP TXT record */ -+ *printer_txt; /* LPD TXT record */ -+ AvahiEntryGroup *avahi_group; /* Avahi entry group */ -+#endif /* HAVE_AVAHI */ - }; - - ---- a/scheduler/conf.c -+++ b/scheduler/conf.c -@@ -650,7 +650,7 @@ - Browsing = CUPS_DEFAULT_BROWSING; - DefaultShared = CUPS_DEFAULT_DEFAULT_SHARED; - --#ifdef HAVE_DNSSD -+#if defined(HAVE_DNSSD) || defined(HAVE_AVAHI) - cupsdSetString(&DNSSDRegType, "_ipp._tcp,_cups"); - #endif /* HAVE_DNSSD */ - |