packages: Separate out most of the remaining packages into recipes

Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
This commit is contained in:
Richard Purdie
2010-09-01 19:09:11 +01:00
parent caab7fc509
commit d62ee7eaf2
569 changed files with 0 additions and 76 deletions

View File

@@ -0,0 +1,84 @@
--- client/scripts/bsdos
+++ client/scripts/bsdos
@@ -47,6 +47,11 @@
. /etc/dhcp/dhclient-exit-hooks
fi
# probably should do something with exit status of the local script
+ if [ x$dhc_dbus != x -a $exit_status -eq 0 ]; then
+ dbus-send --system --dest=com.redhat.dhcp \
+ --type=method_call /com/redhat/dhcp/$interface com.redhat.dhcp.set \
+ 'string:'"`env | grep -Ev '^(PATH|SHLVL|_|PWD|dhc_dbus)\='`"
+ fi
exit $exit_status
}
--- client/scripts/freebsd
+++ client/scripts/freebsd
@@ -57,6 +57,11 @@
. /etc/dhcp/dhclient-exit-hooks
fi
# probably should do something with exit status of the local script
+ if [ x$dhc_dbus != x -a $exit_status -eq 0 ]; then
+ dbus-send --system --dest=com.redhat.dhcp \
+ --type=method_call /com/redhat/dhcp/$interface com.redhat.dhcp.set \
+ 'string:'"`env | grep -Ev '^(PATH|SHLVL|_|PWD|dhc_dbus)\='`"
+ fi
exit $exit_status
}
--- client/scripts/linux
+++ client/scripts/linux
@@ -69,6 +69,11 @@
. /etc/dhcp/dhclient-exit-hooks
fi
# probably should do something with exit status of the local script
+ if [ x$dhc_dbus != x -a $exit_status -eq 0 ]; then
+ dbus-send --system --dest=com.redhat.dhcp \
+ --type=method_call /com/redhat/dhcp/$interface com.redhat.dhcp.set \
+ 'string:'"`env | grep -Ev '^(PATH|SHLVL|_|PWD|dhc_dbus)\='`"
+ fi
exit $exit_status
}
--- client/scripts/netbsd
+++ client/scripts/netbsd
@@ -47,6 +47,11 @@
. /etc/dhcp/dhclient-exit-hooks
fi
# probably should do something with exit status of the local script
+ if [ x$dhc_dbus != x -a $exit_status -eq 0 ]; then
+ dbus-send --system --dest=com.redhat.dhcp \
+ --type=method_call /com/redhat/dhcp/$interface com.redhat.dhcp.set \
+ 'string:'"`env | grep -Ev '^(PATH|SHLVL|_|PWD|dhc_dbus)\='`"
+ fi
exit $exit_status
}
--- client/scripts/openbsd
+++ client/scripts/openbsd
@@ -47,6 +47,11 @@
. /etc/dhcp/dhclient-exit-hooks
fi
# probably should do something with exit status of the local script
+ if [ x$dhc_dbus != x -a $exit_status -eq 0 ]; then
+ dbus-send --system --dest=com.redhat.dhcp \
+ --type=method_call /com/redhat/dhcp/$interface com.redhat.dhcp.set \
+ 'string:'"`env | grep -Ev '^(PATH|SHLVL|_|PWD|dhc_dbus)\='`"
+ fi
exit $exit_status
}
--- client/scripts/solaris
+++ client/scripts/solaris
@@ -47,6 +47,11 @@
. /etc/dhcp/dhclient-exit-hooks
fi
# probably should do something with exit status of the local script
+ if [ x$dhc_dbus != x -a $exit_status -eq 0 ]; then
+ dbus-send --system --dest=com.redhat.dhcp \
+ --type=method_call /com/redhat/dhcp/$interface com.redhat.dhcp.set \
+ 'string:'"`env | grep -Ev '^(PATH|SHLVL|_|PWD|dhc_dbus)\='`"
+ fi
exit $exit_status
}

View File

@@ -0,0 +1,21 @@
CLIENT_PATH is the only environment when executing dhclient-script,
without this patch, dhclient-script won't run properly because it
invokes ifconfig and route
7/28/2010 - qhe
diff -ru dhcp-4.1.1-P1.orig//client/Makefile.am dhcp-4.1.1-P1/client/Makefile.am
--- dhcp-4.1.1-P1.orig//client/Makefile.am 2010-07-29 13:20:05.000000000 +0800
+++ dhcp-4.1.1-P1/client/Makefile.am 2010-07-29 13:28:14.000000000 +0800
@@ -10,9 +10,9 @@
EXTRA_DIST = $(man_MANS)
dhclient.o: dhclient.c
- $(COMPILE) -DCLIENT_PATH='"$(sbindir)"' \
+ $(COMPILE) -DCLIENT_PATH='"PATH=$(sbindir):$(base_sbindir):$(bindir):$(base_bindir)"' \
-DLOCALSTATEDIR='"$(localstatedir)"' -c dhclient.c
dhc6.o: dhc6.c
- $(COMPILE) -DCLIENT_PATH='"$(sbindir)"' \
+ $(COMPILE) -DCLIENT_PATH='"PATH=$(sbindir):$(base_sbindir):$(bindir):$(base_bindir)"' \
-DLOCALSTATEDIR='"$(localstatedir)"' -c dhc6.c

View File

@@ -0,0 +1,10 @@
--- dhcp-3.0.2/common/tr.c~compile 2005-10-13 14:23:37.000000000 +0200
+++ dhcp-3.0.2/common/tr.c 2005-10-13 14:23:45.000000000 +0200
@@ -39,6 +39,7 @@
#include "includes/netinet/udp.h"
#include "includes/netinet/if_ether.h"
#include "netinet/if_tr.h"
+#include <asm/types.h>
#include <sys/time.h>
/*

View File

@@ -0,0 +1,20 @@
#
# Patch managed by http://www.holgerschurig.de/patcher.html
#
--- dhcp-3.0.1/includes/dhcpd.h~compile
+++ dhcp-3.0.1/includes/dhcpd.h
@@ -306,9 +306,9 @@
# define EPHEMERAL_FLAGS (MS_NULL_TERMINATION | \
UNICAST_BROADCAST_HACK)
- binding_state_t __attribute__ ((mode (__byte__))) binding_state;
- binding_state_t __attribute__ ((mode (__byte__))) next_binding_state;
- binding_state_t __attribute__ ((mode (__byte__))) desired_binding_state;
+ binding_state_t binding_state;
+ binding_state_t next_binding_state;
+ binding_state_t desired_binding_state;
struct lease_state *state;

View File

@@ -0,0 +1,21 @@
/*
* define config file location in ${S}/includes/site.h
* still need to take care of installation path (${sysconfdir}/dhcpd.conf)
*
* 7/22/2010 - qhe
*/
/* Define this if you want DNS update functionality to be available. */
#define NSUPDATE
/* Define this if you aren't debugging and you want to save memory
(potentially a _lot_ of memory) by allocating leases in chunks rather
than one at a time. */
#define COMPACT_LEASES
/* local */
#define _PATH_DHCPD_CONF "/etc/dhcp/dhcpd.conf"
#define _PATH_DHCLIENT_CONF "/etc/dhcp/dhclient.conf"

View File

@@ -0,0 +1,53 @@
SECTION = "console/network"
DESCRIPTION = "Internet Software Consortium DHCP package"
HOMEPAGE = "http://www.isc.org/"
LICENSE = "ISC"
LIC_FILES_CHKSUM = "file://LICENSE;beginline=4;md5=bb6fd41f5895b67088ebea61ad365e74"
SRC_URI = "ftp://ftp.isc.org/isc/dhcp/dhcp-${PV}.tar.gz \
file://init-relay file://default-relay \
file://init-server file://default-server \
file://dhclient.conf file://dhcpd.conf"
inherit autotools
TARGET_CFLAGS += "-D_GNU_SOURCE"
do_compile() {
make RANLIB=${RANLIB} PREDEFINES='-D_PATH_DHCPD_DB=\"/var/lib/dhcp/dhcpd.leases\" \
-D_PATH_DHCLIENT_DB=\"/var/lib/dhcp/dhclient.leases\" \
-D_PATH_DHCLIENT_SCRIPT=\"/sbin/dhclient-script\" \
-D_PATH_DHCPD_CONF=\"/etc/dhcp/dhcpd.conf\" \
-D_PATH_DHCLIENT_CONF=\"/etc/dhcp/dhclient.conf\"'
}
do_install() {
make -e DESTDIR=${D} USRMANDIR=${mandir}/man1 ADMMANDIR=${mandir}/man8 FFMANDIR=${mandir}/man5 LIBMANDIR=${mandir}/man3 LIBDIR=${libdir} INCDIR=${includedir} install
install -d ${D}${sysconfdir}/init.d
install -d ${D}${sysconfdir}/default
install -d ${D}${sysconfdir}/dhcp
install -m 0755 ${WORKDIR}/init-relay ${D}${sysconfdir}/init.d/dhcp-relay
install -m 0644 ${WORKDIR}/default-relay ${D}${sysconfdir}/default/dhcp-relay
install -m 0755 ${WORKDIR}/init-server ${D}${sysconfdir}/init.d/dhcp-server
install -m 0644 ${WORKDIR}/default-server ${D}${sysconfdir}/default/dhcp-server
install -m 0644 ${WORKDIR}/dhclient.conf ${D}${sysconfdir}/dhcp/dhclient.conf
install -m 0644 ${WORKDIR}/dhcpd.conf ${D}${sysconfdir}/dhcp/dhcpd.conf
install -d ${D}${base_sbindir}/
mv ${D}${sbindir}/dhclient ${D}${base_sbindir}/
install -m 0755 ${S}/client/scripts/linux ${D}${base_sbindir}/dhclient-script
}
PACKAGES += "dhcp-server dhcp-client dhcp-relay dhcp-omshell"
FILES_${PN} = ""
FILES_dhcp-server = "${sbindir}/dhcpd ${sysconfdir}/init.d/dhcp-server ${sysconfdir}/default/dhcp-server ${sysconfdir}/dhcp/dhcpd.conf"
FILES_dhcp-relay = "${sbindir}/dhcrelay ${sysconfdir}/init.d/dhcp-relay ${sysconfdir}/default/dhcp-relay"
FILES_dhcp-client = "${base_sbindir}/dhclient ${base_sbindir}/dhclient-script ${sysconfdir}/dhcp/dhclient.conf"
RDEPENDS_dhcp-client = "bash"
FILES_dhcp-omshell = "${bindir}/omshell"
CONFFILES_dhcp-server_nylon = "/etc/dhcp/dhcpd.conf"
CONFFILES_dhcp-relay_nylon = "/etc/default/dhcp-relay"
CONFFILES_dhcp-client_nylon = "/etc/dhcp/dhclient.conf"

View File

@@ -0,0 +1,57 @@
SECTION = "console/network"
DESCRIPTION = "Internet Software Consortium DHCP package"
HOMEPAGE = "http://www.isc.org/"
LICENSE = "ISC"
LIC_FILES_CHKSUM = "file://LICENSE;beginline=4;md5=bb6fd41f5895b67088ebea61ad365e74"
SRC_URI = "ftp://ftp.isc.org/isc/dhcp/dhcp-${PV}.tar.gz \
file://site.h \
file://init-relay file://default-relay \
file://init-server file://default-server \
file://dhclient.conf file://dhcpd.conf"
inherit autotools
TARGET_CFLAGS += "-D_GNU_SOURCE"
EXTRA_OECONF = "--with-srv-lease-file=${localstatedir}/lib/dhcp/dhcpd.leases \
--with-srv6-lease-file=${localstatedir}/lib/dhcp/dhcpd6.leases \
--with-cli-lease-file=${localstatedir}/lib/dhcp/dhclient.leases \
--with-cli6-lease-file=${localstatedir}/lib/dhcp/dhclient6.leases"
do_compile_prepend () {
cp -f ${WORKDIR}/site.h ${S}/includes
}
do_install_append () {
install -d ${D}${sysconfdir}/init.d
install -d ${D}${sysconfdir}/default
install -d ${D}${sysconfdir}/dhcp
install -m 0755 ${WORKDIR}/init-relay ${D}${sysconfdir}/init.d/dhcp-relay
install -m 0644 ${WORKDIR}/default-relay ${D}${sysconfdir}/default/dhcp-relay
install -m 0755 ${WORKDIR}/init-server ${D}${sysconfdir}/init.d/dhcp-server
install -m 0644 ${WORKDIR}/default-server ${D}${sysconfdir}/default/dhcp-server
rm -f ${D}${sysconfdir}/dhclient.conf
rm -f ${D}${sysconfdir}/dhcpd.conf
install -m 0644 ${WORKDIR}/dhclient.conf ${D}${sysconfdir}/dhcp/dhclient.conf
install -m 0644 ${WORKDIR}/dhcpd.conf ${D}${sysconfdir}/dhcp/dhcpd.conf
install -d ${D}${base_sbindir}/
mv ${D}${sbindir}/dhclient ${D}${base_sbindir}/
install -m 0755 ${S}/client/scripts/linux ${D}${base_sbindir}/dhclient-script
}
PACKAGES += "dhcp-server dhcp-client dhcp-relay dhcp-omshell"
FILES_${PN} = ""
FILES_dhcp-server = "${sbindir}/dhcpd ${sysconfdir}/init.d/dhcp-server ${sysconfdir}/default/dhcp-server ${sysconfdir}/dhcp/dhcpd.conf"
FILES_dhcp-relay = "${sbindir}/dhcrelay ${sysconfdir}/init.d/dhcp-relay ${sysconfdir}/default/dhcp-relay"
FILES_dhcp-client = "${base_sbindir}/dhclient ${base_sbindir}/dhclient-script ${sysconfdir}/dhcp/dhclient.conf"
RDEPENDS_dhcp-client = "bash"
FILES_dhcp-omshell = "${bindir}/omshell"
CONFFILES_dhcp-server_nylon = "/etc/dhcp/dhcpd.conf"
CONFFILES_dhcp-relay_nylon = "/etc/default/dhcp-relay"
CONFFILES_dhcp-client_nylon = "/etc/dhcp/dhclient.conf"

View File

@@ -0,0 +1,7 @@
require dhcp4.inc
PR = "r1"
SRC_URI += "file://fixincludes.patch \
file://dhcp-3.0.3-dhclient-dbus.patch;striplevel=0 \
file://fix-client-path.patch"

View File

@@ -0,0 +1,12 @@
# Defaults for dhcp-relay initscript
# sourced by /etc/init.d/dhcp-relay
# What servers should the DHCP relay forward requests to?
# e.g: SERVERS="192.168.0.1"
SERVERS=""
# On what interfaces should the DHCP relay (dhrelay) serve DHCP requests?
INTERFACES=""
# Additional options that are passed to the DHCP relay daemon?
OPTIONS=""

View File

@@ -0,0 +1,7 @@
# Defaults for dhcp initscript
# sourced by /etc/init.d/dhcp-server
# installed at /etc/default/dhcp-server by the maintainer scripts
# On what interfaces should the DHCP server (dhcpd) serve DHCP requests?
# Separate multiple interfaces with spaces, e.g. "eth0 eth1".
INTERFACES=""

View File

@@ -0,0 +1,50 @@
# Configuration file for /sbin/dhclient, which is included in Debian's
# dhcp3-client package.
#
# This is a sample configuration file for dhclient. See dhclient.conf's
# man page for more information about the syntax of this file
# and a more comprehensive list of the parameters understood by
# dhclient.
#
# Normally, if the DHCP server provides reasonable information and does
# not leave anything out (like the domain name, for example), then
# few changes must be made to this file, if any.
#
#send host-name "andare.fugue.com";
#send dhcp-client-identifier 1:0:a0:24:ab:fb:9c;
#send dhcp-lease-time 3600;
#supersede domain-name "fugue.com home.vix.com";
#prepend domain-name-servers 127.0.0.1;
request subnet-mask, broadcast-address, time-offset, routers,
domain-name, domain-name-servers, host-name,
netbios-name-servers, netbios-scope;
#require subnet-mask, domain-name-servers;
#timeout 60;
#retry 60;
#reboot 10;
#select-timeout 5;
#initial-interval 2;
#script "/etc/dhcp3/dhclient-script";
#media "-link0 -link1 -link2", "link0 link1";
#reject 192.33.137.209;
#alias {
# interface "eth0";
# fixed-address 192.5.5.213;
# option subnet-mask 255.255.255.255;
#}
#lease {
# interface "eth0";
# fixed-address 192.33.137.200;
# medium "link0 link1";
# option host-name "andare.swiftmedia.com";
# option subnet-mask 255.255.255.0;
# option broadcast-address 192.33.137.255;
# option routers 192.33.137.250;
# option domain-name-servers 127.0.0.1;
# renew 2 2000/1/12 00:00:01;
# rebind 2 2000/1/12 00:00:01;
# expire 2 2000/1/12 00:00:01;
#}

View File

@@ -0,0 +1,108 @@
#
# Sample configuration file for ISC dhcpd for Debian
#
# $Id: dhcpd.conf,v 1.1.1.1 2002/05/21 00:07:44 peloy Exp $
#
# The ddns-updates-style parameter controls whether or not the server will
# attempt to do a DNS update when a lease is confirmed. We default to the
# behavior of the version 2 packages ('none', since DHCP v2 didn't
# have support for DDNS.)
ddns-update-style none;
# option definitions common to all supported networks...
option domain-name "example.org";
option domain-name-servers ns1.example.org, ns2.example.org;
default-lease-time 600;
max-lease-time 7200;
# If this DHCP server is the official DHCP server for the local
# network, the authoritative directive should be uncommented.
#authoritative;
# Use this to send dhcp log messages to a different log file (you also
# have to hack syslog.conf to complete the redirection).
log-facility local7;
# No service will be given on this subnet, but declaring it helps the
# DHCP server to understand the network topology.
#subnet 10.152.187.0 netmask 255.255.255.0 {
#}
# This is a very basic subnet declaration.
#subnet 10.254.239.0 netmask 255.255.255.224 {
# range 10.254.239.10 10.254.239.20;
# option routers rtr-239-0-1.example.org, rtr-239-0-2.example.org;
#}
# This declaration allows BOOTP clients to get dynamic addresses,
# which we don't really recommend.
#subnet 10.254.239.32 netmask 255.255.255.224 {
# range dynamic-bootp 10.254.239.40 10.254.239.60;
# option broadcast-address 10.254.239.31;
# option routers rtr-239-32-1.example.org;
#}
# A slightly different configuration for an internal subnet.
#subnet 10.5.5.0 netmask 255.255.255.224 {
# range 10.5.5.26 10.5.5.30;
# option domain-name-servers ns1.internal.example.org;
# option domain-name "internal.example.org";
# option routers 10.5.5.1;
# option broadcast-address 10.5.5.31;
# default-lease-time 600;
# max-lease-time 7200;
#}
# Hosts which require special configuration options can be listed in
# host statements. If no address is specified, the address will be
# allocated dynamically (if possible), but the host-specific information
# will still come from the host declaration.
#host passacaglia {
# hardware ethernet 0:0:c0:5d:bd:95;
# filename "vmunix.passacaglia";
# server-name "toccata.fugue.com";
#}
# Fixed IP addresses can also be specified for hosts. These addresses
# should not also be listed as being available for dynamic assignment.
# Hosts for which fixed IP addresses have been specified can boot using
# BOOTP or DHCP. Hosts for which no fixed address is specified can only
# be booted with DHCP, unless there is an address range on the subnet
# to which a BOOTP client is connected which has the dynamic-bootp flag
# set.
#host fantasia {
# hardware ethernet 08:00:07:26:c0:a5;
# fixed-address fantasia.fugue.com;
#}
# You can declare a class of clients and then do address allocation
# based on that. The example below shows a case where all clients
# in a certain class get addresses on the 10.17.224/24 subnet, and all
# other clients get addresses on the 10.0.29/24 subnet.
#class "foo" {
# match if substring (option vendor-class-identifier, 0, 4) = "SUNW";
#}
#shared-network 224-29 {
# subnet 10.17.224.0 netmask 255.255.255.0 {
# option routers rtr-224.example.org;
# }
# subnet 10.0.29.0 netmask 255.255.255.0 {
# option routers rtr-29.example.org;
# }
# pool {
# allow members of "foo";
# range 10.17.224.10 10.17.224.250;
# }
# pool {
# deny members of "foo";
# range 10.0.29.10 10.0.29.230;
# }
#}

View File

@@ -0,0 +1,44 @@
#!/bin/sh
#
# $Id: dhcp3-relay,v 1.1 2004/04/16 15:41:08 ml Exp $
#
# It is not safe to start if we don't have a default configuration...
if [ ! -f /etc/default/dhcp-relay ]; then
echo "/etc/default/dhcp-relay does not exist! - Aborting..."
echo "create this file to fix the problem."
exit 1
fi
# Read init script configuration (interfaces the daemon should listen on
# and the DHCP server we should forward requests to.)
. /etc/default/dhcp-relay
# Build command line for interfaces (will be passed to dhrelay below.)
IFCMD=""
if test "$INTERFACES" != ""; then
for I in $INTERFACES; do
IFCMD=${IFCMD}"-i "${I}" "
done
fi
DHCRELAYPID=/var/run/dhcrelay.pid
case "$1" in
start)
start-stop-daemon -S -x /usr/sbin/dhcrelay -- -q $OPTIONS $IFCMD $SERVERS
;;
stop)
start-stop-daemon -K -x /usr/sbin/dhcrelay
;;
restart | force-reload)
$0 stop
sleep 2
$0 start
;;
*)
echo "Usage: /etc/init.d/dhcp-relay {start|stop|restart|force-reload}"
exit 1
esac
exit 0

View File

@@ -0,0 +1,44 @@
#!/bin/sh
#
# $Id: dhcp3-server.init.d,v 1.4 2003/07/13 19:12:41 mdz Exp $
#
test -f /usr/sbin/dhcpd || exit 0
# It is not safe to start if we don't have a default configuration...
if [ ! -f /etc/default/dhcp-server ]; then
echo "/etc/default/dhcp-server does not exist! - Aborting..."
exit 0
fi
# Read init script configuration (so far only interfaces the daemon
# should listen on.)
. /etc/default/dhcp-server
case "$1" in
start)
echo -n "Starting DHCP server: "
test -d /var/lib/dhcp/ || mkdir -p /var/lib/dhcp/
test -f /var/lib/dhcp/dhcpd.leases || touch /var/lib/dhcp/dhcpd.leases
start-stop-daemon -S -x /usr/sbin/dhcpd -- -q $INTERFACES
echo "."
;;
stop)
echo -n "Stopping DHCP server: dhcpd3"
start-stop-daemon -K -x /usr/sbin/dhcpd
echo "."
;;
restart | force-reload)
$0 stop
sleep 2
$0 start
if [ "$?" != "0" ]; then
exit 1
fi
;;
*)
echo "Usage: /etc/init.d/dhcp-server {start|stop|restart|force-reload}"
exit 1
esac
exit 0

View File

@@ -0,0 +1,24 @@
DESCRIPTION = "FarSight is an audio/video conferencing framework specifically designed for Instant Messengers."
HOMEPAGE = "http://farsight.sf.net"
SRC_URI = "http://farsight.freedesktop.org/releases/farsight2/${P}.tar.gz"
DEPENDS = "libnice glib-2.0 libxml2 zlib dbus gstreamer gst-plugins-base"
inherit autotools
AUTOTOOLS_STAGE_PKGCONFIG = "1"
PR = "r1"
EXTRA_OECONF = " \
--disable-debug \
--disable-gtk-doc \
--disable-python \
"
FILES_${PN} += "${libdir}/*/*.so"
FILES_${PN}-dev += "${libdir}/f*/*a ${libdir}/g*/*a"
FILES_${PN}-dbg += "${libdir}/*/.debug"

View File

@@ -0,0 +1,23 @@
DESCRIPTION = "Libnice is an implementation of the IETF's draft Interactice Connectivity Establishment standard (ICE)."
HOMEPAGE = "http://nice.freedesktop.org/wiki/"
SRC_URI = "http://nice.freedesktop.org/releases/libnice-${PV}.tar.gz"
LICENSE = "LGPL/MPL"
DEPENDS = "glib-2.0 gstreamer"
inherit autotools
AUTOTOOLS_STAGE_PKGCONFIG = "1"
FILES_${PN} += "${libdir}/gstreamer-0.10/*.so"
FILES_${PN}-dev += "${libdir}/gstreamer-0.10/*a"
FILES_${PN}-dbg += "${libdir}/gstreamer-0.10/.debug"
do_compile_append() {
for i in $(find ${S} -name "*.pc") ; do
sed -i -e s:${STAGING_DIR_TARGET}::g \
-e s:/${TARGET_SYS}::g \
$i
done
}

View File

@@ -0,0 +1,710 @@
From 516d67c679101d1503dbd4c0613bcd6ff1b604e4 Mon Sep 17 00:00:00 2001
From: Andrzej Zaborowski <balrog@zabor.org>
Date: Wed, 19 Sep 2007 14:03:28 +0200
Subject: [PATCH] Introduce ports.
---
include/gsmd/atcmd.h | 2 +-
include/gsmd/gsmd.h | 7 +-
include/gsmd/uart.h | 28 ++++++
include/gsmd/vendorplugin.h | 4 +-
src/gsmd/Makefile.am | 2 +-
src/gsmd/atcmd.c | 177 +++++++++++++++++---------------------
src/gsmd/gsmd.c | 64 ++------------
src/gsmd/uart.c | 202 +++++++++++++++++++++++++++++++++++++++++++
8 files changed, 328 insertions(+), 158 deletions(-)
create mode 100644 include/gsmd/uart.h
create mode 100644 src/gsmd/uart.c
diff --git a/include/gsmd/atcmd.h b/include/gsmd/atcmd.h
index 0d6c62a..a1af6a0 100644
--- a/include/gsmd/atcmd.h
+++ b/include/gsmd/atcmd.h
@@ -9,7 +9,7 @@ typedef int atcmd_cb_t(struct gsmd_atcmd *cmd, void *ctx, char *resp);
extern struct gsmd_atcmd *atcmd_fill(const char *cmd, int rlen, atcmd_cb_t *cb, void *ctx, u_int16_t id);
extern int atcmd_submit(struct gsmd *g, struct gsmd_atcmd *cmd);
-extern int atcmd_init(struct gsmd *g, int sockfd);
+extern int atcmd_init(struct gsmd *g, struct gsmd_port *port);
extern void atcmd_drain(int fd);
#endif /* __GSMD__ */
diff --git a/include/gsmd/gsmd.h b/include/gsmd/gsmd.h
index ed334f1..4afdf66 100644
--- a/include/gsmd/gsmd.h
+++ b/include/gsmd/gsmd.h
@@ -10,6 +10,7 @@
#include <gsmd/machineplugin.h>
#include <gsmd/vendorplugin.h>
#include <gsmd/select.h>
+#include <gsmd/uart.h>
#include <gsmd/state.h>
void *gsmd_tallocs;
@@ -52,6 +53,7 @@ enum llparse_state {
#define MLPARSE_BUF_SIZE 65535
struct llparser {
+ struct gsmd_port *port;
enum llparse_state state;
unsigned int len;
unsigned int flags;
@@ -70,7 +72,7 @@ struct gsmd;
struct gsmd {
unsigned int flags;
int interpreter_ready;
- struct gsmd_fd gfd_uart;
+ struct gsmd_uart uart;
struct gsmd_fd gfd_sock;
struct llparser llp;
struct llist_head users;
@@ -81,9 +83,10 @@ struct gsmd {
struct gsmd_device_state dev_state;
struct llist_head operators; /* cached list of operator names */
- unsigned char *mlbuf; /* ml_parse buffer */
+ char *mlbuf; /* ml_parse buffer */
unsigned int mlbuf_len;
int mlunsolicited;
+ int clear_to_send;
};
struct gsmd_user {
diff --git a/include/gsmd/uart.h b/include/gsmd/uart.h
new file mode 100644
index 0000000..a006fa7
--- /dev/null
+++ b/include/gsmd/uart.h
@@ -0,0 +1,28 @@
+#ifndef __GSMD_UART_H
+#define __GSMD_UART_H
+
+#ifdef __GSMD__
+
+struct gsmd_port {
+ int (*write)(struct gsmd_port *port, const char data[], int len);
+ int (*set_break)(struct gsmd_port *port, int state);
+ /* more parameters here */
+ int (*newdata_cb)(void *opaque, const char data[], int len);
+ void *newdata_opaque;
+};
+
+struct gsmd_uart {
+ struct gsmd_port port;
+ struct gsmd_fd gfd;
+ char txfifo[2048];
+ int tx_start;
+ int tx_len;
+};
+
+extern int set_baudrate(int fd, int baudrate, int hwflow);
+extern void uart_drain(int fd);
+extern int uart_init(struct gsmd_uart *uart, int sockfd);
+
+#endif /* __GSMD__ */
+
+#endif
diff --git a/include/gsmd/vendorplugin.h b/include/gsmd/vendorplugin.h
index 1911fef..1c82790 100644
--- a/include/gsmd/vendorplugin.h
+++ b/include/gsmd/vendorplugin.h
@@ -11,8 +11,8 @@ struct gsmd_unsolicit;
struct gsmd_vendor_plugin {
struct llist_head list;
- unsigned char *name;
- unsigned char *ext_chars;
+ char *name;
+ char *ext_chars;
unsigned int num_unsolicit;
const struct gsmd_unsolicit *unsolicit;
int (*detect)(struct gsmd *g);
diff --git a/src/gsmd/Makefile.am b/src/gsmd/Makefile.am
index 9ac45ee..110b757 100644
--- a/src/gsmd/Makefile.am
+++ b/src/gsmd/Makefile.am
@@ -13,7 +13,7 @@ sbin_PROGRAMS = gsmd
gsmd_CFLAGS = -D PLUGINDIR=\"$(plugindir)\"
gsmd_SOURCES = gsmd.c atcmd.c select.c machine.c vendor.c unsolicited.c log.c \
usock.c talloc.c timer.c operator_cache.c ext_response.c \
- sms_cb.c sms_pdu.c
+ sms_cb.c sms_pdu.c uart.c
gsmd_LDADD = -ldl
gsmd_LDFLAGS = -Wl,--export-dynamic
diff --git a/src/gsmd/atcmd.c b/src/gsmd/atcmd.c
index 2ef6a10..27dfa41 100644
--- a/src/gsmd/atcmd.c
+++ b/src/gsmd/atcmd.c
@@ -159,7 +159,8 @@ static int llparse_byte(struct llparser *llp, char byte)
return ret;
}
-static int llparse_string(struct llparser *llp, char *buf, unsigned int len)
+static int llparse_string(struct llparser *llp, const char *buf,
+ unsigned int len)
{
while (len--) {
int rc = llparse_byte(llp, *(buf++));
@@ -187,6 +188,55 @@ static int llparse_init(struct llparser *llp)
return 0;
}
+/* See if we can now send more commands to the port */
+static void atcmd_wake_queue(struct gsmd *g)
+{
+ int len, rc;
+ char *cr;
+
+ /* write pending commands to UART */
+ while (g->interpreter_ready && g->clear_to_send) {
+ struct gsmd_atcmd *pos, *pos2;
+ llist_for_each_entry_safe(pos, pos2, &g->pending_atcmds, list) {
+ cr = strchr(pos->cur, '\n');
+ if (cr)
+ len = cr - pos->cur;
+ else
+ len = pos->buflen;
+ rc = g->llp.port->write(g->llp.port, pos->cur, len);
+ if (rc == 0) {
+ gsmd_log(GSMD_ERROR,
+ "write returns 0, aborting\n");
+ break;
+ }
+ if (cr && rc == len)
+ rc ++; /* Skip the \n */
+ pos->buflen -= rc;
+ pos->cur += rc;
+ g->llp.port->write(g->llp.port, "\r", 1);
+
+ if (!pos->buflen) {
+ /* success: remove from global list of
+ * to-be-sent atcmds */
+ llist_del(&pos->list);
+ /* append to global list of executing atcmds */
+ llist_add_tail(&pos->list, &g->busy_atcmds);
+
+ /* we only send one cmd at the moment */
+ g->clear_to_send = 0;
+ break;
+ } else {
+ /* The write was short or the atcmd has more
+ * lines to send after a "> ". */
+ if (rc < len)
+ break;
+ g->clear_to_send = 0;
+ break;
+ }
+ }
+ }
+}
+
/* mid-level parser */
static int parse_final_result(const char *res)
@@ -216,6 +266,7 @@ static int ml_parse(const char *buf, int len, void *ctx)
g->interpreter_ready = 1;
gsmd_initsettings(g);
gmsd_alive_start(g);
+ atcmd_wake_queue(g);
return 0;
}
@@ -316,6 +367,7 @@ static int ml_parse(const char *buf, int len, void *ctx)
} else {
DEBUGP("Calling cmd->cb()\n");
cmd->resp = g->mlbuf;
+ g->mlbuf[g->mlbuf_len] = 0;
rc = cmd->cb(cmd, cmd->ctx, cmd->resp);
DEBUGP("Clearing mlbuf\n");
}
@@ -370,12 +422,15 @@ static int ml_parse(const char *buf, int len, void *ctx)
if (g->mlbuf_len)
g->mlbuf[g->mlbuf_len ++] = '\n';
DEBUGP("Appending buf to mlbuf\n");
- if (len > MLPARSE_BUF_SIZE - g->mlbuf_len)
+ if (len > MLPARSE_BUF_SIZE - g->mlbuf_len) {
len = MLPARSE_BUF_SIZE - g->mlbuf_len;
+ gsmd_log(GSMD_NOTICE, "g->mlbuf overrun\n");
+ }
memcpy(g->mlbuf + g->mlbuf_len, buf, len);
g->mlbuf_len += len;
if (g->mlunsolicited) {
+ g->mlbuf[g->mlbuf_len] = 0;
rc = unsolicited_parse(g, g->mlbuf, g->mlbuf_len,
strchr(g->mlbuf, ':') + 1);
if (rc == -EAGAIN) {
@@ -422,8 +477,11 @@ final_cb:
/* if we're finished with current commands, but still have pending
* commands: we want to WRITE again */
- if (llist_empty(&g->busy_atcmds) && !llist_empty(&g->pending_atcmds))
- g->gfd_uart.when |= GSMD_FD_WRITE;
+ if (llist_empty(&g->busy_atcmds)) {
+ g->clear_to_send = 1;
+ if (!llist_empty(&g->pending_atcmds))
+ atcmd_wake_queue(g);
+ }
return rc;
}
@@ -433,85 +491,23 @@ static int atcmd_prompt(void *data)
{
struct gsmd *g = data;
- g->gfd_uart.when |= GSMD_FD_WRITE;
+ g->clear_to_send = 1;
+ atcmd_wake_queue(g);
}
/* callback to be called if [virtual] UART has some data for us */
-static int atcmd_select_cb(int fd, unsigned int what, void *data)
+static int atcmd_newdata_cb(void *opaque, const char data[], int len)
{
- int len, rc;
- static char rxbuf[1024];
- struct gsmd *g = data;
- char *cr;
-
- if (what & GSMD_FD_READ) {
- memset(rxbuf, 0, sizeof(rxbuf));
- while ((len = read(fd, rxbuf, sizeof(rxbuf)))) {
- if (len < 0) {
- if (errno == EAGAIN)
- return 0;
- gsmd_log(GSMD_NOTICE, "ERROR reading from fd %u: %d (%s)\n", fd, len,
- strerror(errno));
- return len;
- }
- rc = llparse_string(&g->llp, rxbuf, len);
- if (rc < 0) {
- gsmd_log(GSMD_ERROR, "ERROR during llparse_string: %d\n", rc);
- return rc;
- }
- }
- }
-
- /* write pending commands to UART */
- if ((what & GSMD_FD_WRITE) && g->interpreter_ready) {
- struct gsmd_atcmd *pos, *pos2;
- llist_for_each_entry_safe(pos, pos2, &g->pending_atcmds, list) {
- cr = strchr(pos->cur, '\n');
- if (cr)
- len = cr - pos->cur;
- else
- len = pos->buflen - 1; /* assuming zero-terminated strings */
- rc = write(fd, pos->cur, len);
- if (rc == 0) {
- gsmd_log(GSMD_ERROR, "write returns 0, aborting\n");
- break;
- } else if (rc < 0) {
- gsmd_log(GSMD_ERROR, "error during write to fd %d: %d\n",
- fd, rc);
- return rc;
- }
- if (!cr || rc == len)
- rc ++; /* Skip the \n or \0 */
- pos->buflen -= rc;
- pos->cur += rc;
- write(fd, "\r", 1);
-
- if (!pos->buflen) {
- /* success: remove from global list of
- * to-be-sent atcmds */
- llist_del(&pos->list);
- /* append to global list of executing atcmds */
- llist_add_tail(&pos->list, &g->busy_atcmds);
-
- /* we only send one cmd at the moment */
- break;
- } else {
- /* The write was short or the atcmd has more
- * lines to send after a "> ". */
- if (rc < len)
- return 0;
- break;
- }
- }
+ struct gsmd *g = opaque;
+ int rc;
- /* Either pending_atcmds is empty or a command has to wait */
- g->gfd_uart.when &= ~GSMD_FD_WRITE;
- }
+ rc = llparse_string(&g->llp, data, len);
+ if (rc < 0)
+ gsmd_log(GSMD_ERROR, "ERROR during llparse_string: %d\n", rc);
- return 0;
+ return rc;
}
-
struct gsmd_atcmd *atcmd_fill(const char *cmd, int rlen,
atcmd_cb_t cb, void *ctx, u_int16_t id)
{
@@ -544,36 +540,18 @@ int atcmd_submit(struct gsmd *g, struct gsmd_atcmd *cmd)
{
DEBUGP("submitting command `%s'\n", cmd->buf);
- if (llist_empty(&g->pending_atcmds))
- g->gfd_uart.when |= GSMD_FD_WRITE;
+ llist_empty(&g->pending_atcmds);
llist_add_tail(&cmd->list, &g->pending_atcmds);
+ atcmd_wake_queue(g);
return 0;
}
-void atcmd_drain(int fd)
-{
- int rc;
- struct termios t;
- rc = tcflush(fd, TCIOFLUSH);
- rc = tcgetattr(fd, &t);
- DEBUGP("c_iflag = 0x%08x, c_oflag = 0x%08x, c_cflag = 0x%08x, c_lflag = 0x%08x\n",
- t.c_iflag, t.c_oflag, t.c_cflag, t.c_lflag);
- t.c_iflag = t.c_oflag = 0;
- cfmakeraw(&t);
- rc = tcsetattr(fd, TCSANOW, &t);
-}
-
/* init atcmd parser */
-int atcmd_init(struct gsmd *g, int sockfd)
+int atcmd_init(struct gsmd *g, struct gsmd_port *port)
{
__atcmd_ctx = talloc_named_const(gsmd_tallocs, 1, "atcmds");
- g->gfd_uart.fd = sockfd;
- g->gfd_uart.when = GSMD_FD_READ;
- g->gfd_uart.data = g;
- g->gfd_uart.cb = &atcmd_select_cb;
-
INIT_LLIST_HEAD(&g->pending_atcmds);
INIT_LLIST_HEAD(&g->busy_atcmds);
@@ -581,7 +559,9 @@ int atcmd_init(struct gsmd *g, int sockfd)
g->mlbuf_len = 0;
g->mlunsolicited = 0;
+ g->clear_to_send = 1;
+ g->llp.port = port;
g->llp.cur = g->llp.buf;
g->llp.len = sizeof(g->llp.buf);
g->llp.cb = &ml_parse;
@@ -589,5 +569,8 @@ int atcmd_init(struct gsmd *g, int sockfd)
g->llp.ctx = g;
g->llp.flags = LGSM_ATCMD_F_EXTENDED;
- return gsmd_register_fd(&g->gfd_uart);
+ port->newdata_opaque = g;
+ port->newdata_cb = atcmd_newdata_cb;
+
+ return 0;
}
diff --git a/src/gsmd/gsmd.c b/src/gsmd/gsmd.c
index 51b4f2c..846bd17 100644
--- a/src/gsmd/gsmd.c
+++ b/src/gsmd/gsmd.c
@@ -26,7 +26,6 @@
#include <string.h>
#include <errno.h>
#include <fcntl.h>
-#include <termios.h>
#include <signal.h>
#define _GNU_SOURCE
@@ -247,56 +246,6 @@ int gsmd_initsettings(struct gsmd *gsmd)
return atcmd_submit(gsmd, cmd);
}
-struct bdrt {
- int bps;
- u_int32_t b;
-};
-
-static struct bdrt bdrts[] = {
- { 0, B0 },
- { 9600, B9600 },
- { 19200, B19200 },
- { 38400, B38400 },
- { 57600, B57600 },
- { 115200, B115200 },
- { 230400, B230400 },
- { 460800, B460800 },
- { 921600, B921600 },
-};
-
-static int set_baudrate(int fd, int baudrate, int hwflow)
-{
- int i;
- u_int32_t bd = 0;
- struct termios ti;
-
- for (i = 0; i < ARRAY_SIZE(bdrts); i++) {
- if (bdrts[i].bps == baudrate)
- bd = bdrts[i].b;
- }
- if (bd == 0)
- return -EINVAL;
-
- i = tcgetattr(fd, &ti);
- if (i < 0)
- return i;
-
- i = cfsetispeed(&ti, B0);
- if (i < 0)
- return i;
-
- i = cfsetospeed(&ti, bd);
- if (i < 0)
- return i;
-
- if (hwflow)
- ti.c_cflag |= CRTSCTS;
- else
- ti.c_cflag &= ~CRTSCTS;
-
- return tcsetattr(fd, 0, &ti);
-}
-
static int gsmd_initialize(struct gsmd *g)
{
INIT_LLIST_HEAD(&g->users);
@@ -478,14 +427,19 @@ int main(int argc, char **argv)
if (wait >= 0)
g.interpreter_ready = !wait;
- if (atcmd_init(&g, fd) < 0) {
+ if (uart_init(&g.uart, fd) < 0) {
fprintf(stderr, "can't initialize UART device\n");
exit(1);
}
- write(fd, "\r", 1);
- sleep(1);
- atcmd_drain(fd);
+ if (atcmd_init(&g, &g.uart.port) < 0) {
+ fprintf(stderr, "can't initialize AT parser\n");
+ exit(1);
+ }
+ write(fd, "\r", 1);
+ sleep(1);
+
+ uart_drain(fd);
if (usock_init(&g) < 0) {
fprintf(stderr, "can't open unix socket\n");
diff --git a/src/gsmd/uart.c b/src/gsmd/uart.c
new file mode 100644
index 0000000..22a4a5c
--- /dev/null
+++ b/src/gsmd/uart.c
@@ -0,0 +1,202 @@
+/* Wrapper for the physical UART in a struct gsmd_port abstraction.
+ *
+ * Copyright (C) 2007 OpenMoko, Inc.
+ * Written by Andrzej Zaborowski <andrew@openedhand.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include <string.h>
+#include <fcntl.h>
+#include <termios.h>
+#include <unistd.h>
+#include <errno.h>
+
+#include "gsmd.h"
+
+#include <gsmd/gsmd.h>
+
+void uart_drain(int fd)
+{
+ int rc;
+ struct termios t;
+ rc = tcflush(fd, TCIOFLUSH);
+ rc = tcgetattr(fd, &t);
+ DEBUGP(
+ "c_iflag = 0x%08x, c_oflag = 0x%08x, "
+ "c_cflag = 0x%08x, c_lflag = 0x%08x\n",
+ t.c_iflag, t.c_oflag, t.c_cflag, t.c_lflag);
+ t.c_iflag = t.c_oflag = 0;
+ cfmakeraw(&t);
+ rc = tcsetattr(fd, TCSANOW, &t);
+}
+
+struct bdrt {
+ int bps;
+ u_int32_t b;
+};
+
+static struct bdrt bdrts[] = {
+ { 0, B0 },
+ { 9600, B9600 },
+ { 19200, B19200 },
+ { 38400, B38400 },
+ { 57600, B57600 },
+ { 115200, B115200 },
+ { 230400, B230400 },
+ { 460800, B460800 },
+ { 921600, B921600 },
+};
+
+int set_baudrate(int fd, int baudrate, int hwflow)
+{
+ int i;
+ u_int32_t bd = 0;
+ struct termios ti;
+
+ for (i = 0; i < ARRAY_SIZE(bdrts); i++) {
+ if (bdrts[i].bps == baudrate)
+ bd = bdrts[i].b;
+ }
+ if (bd == 0)
+ return -EINVAL;
+
+ i = tcgetattr(fd, &ti);
+ if (i < 0)
+ return i;
+
+ i = cfsetispeed(&ti, B0);
+ if (i < 0)
+ return i;
+
+ i = cfsetospeed(&ti, bd);
+ if (i < 0)
+ return i;
+
+ if (hwflow)
+ ti.c_cflag |= CRTSCTS;
+ else
+ ti.c_cflag &= ~CRTSCTS;
+
+ return tcsetattr(fd, 0, &ti);
+}
+
+static int uart_select_cb(int fd, unsigned int what, void *data)
+{
+ struct gsmd_uart *uart = (struct gsmd_uart *) data;
+ static char rxbuf[2048];
+ int rc, len;
+
+ if ((what & GSMD_FD_READ) && uart->port.newdata_cb) {
+ while ((len = read(fd, rxbuf, sizeof(rxbuf)))) {
+ if (len < 0) {
+ if (errno == EAGAIN || errno == EINTR)
+ return 0;
+ gsmd_log(GSMD_NOTICE, "ERROR reading from "
+ "fd %u: %d (%s)\n", fd, errno,
+ strerror(errno));
+ return -errno;
+ }
+
+ rc = uart->port.newdata_cb(
+ uart->port.newdata_opaque,
+ rxbuf,
+ len);
+ if (rc < 0)
+ return rc;
+ }
+ }
+
+ /* Write pending data to UART. */
+ if ((what & GSMD_FD_WRITE) && uart->tx_len) {
+ while (uart->tx_start + uart->tx_len >= sizeof(uart->txfifo)) {
+ len = sizeof(uart->txfifo) - uart->tx_start;
+ rc = write(fd, &uart->txfifo[uart->tx_start], len);
+ if (rc < 0 && errno != EINTR) {
+ if (errno == EAGAIN)
+ return 0;
+ gsmd_log(GSMD_NOTICE, "ERROR writing "
+ "fd %u: %d (%s)\n", fd, errno,
+ strerror(errno));
+ return -errno;
+ }
+
+ if (rc > 0) {
+ uart->tx_start += rc;
+ uart->tx_len -= rc;
+ }
+ }
+ uart->tx_start &= sizeof(uart->txfifo) - 1;
+
+ while (uart->tx_len) {
+ rc = write(fd, &uart->txfifo[uart->tx_start],
+ uart->tx_len);
+ if (rc < 0 && errno != EINTR) {
+ if (errno == EAGAIN)
+ return 0;
+ gsmd_log(GSMD_NOTICE, "ERROR writing "
+ "fd %u: %d (%s)\n", fd, errno,
+ strerror(errno));
+ return -errno;
+ }
+
+ if (rc > 0) {
+ uart->tx_start += rc;
+ uart->tx_len -= rc;
+ }
+ }
+
+ /* If we reached here, there's no more data for the moment. */
+ uart->gfd.when &= ~GSMD_FD_WRITE;
+ }
+
+ return 0;
+}
+
+static int uart_write(struct gsmd_port *port, const char data[], int len)
+{
+ struct gsmd_uart *uart = (struct gsmd_uart *) port;
+ int start = (uart->tx_start + uart->tx_len) &
+ (sizeof(uart->txfifo) - 1);
+ int space = sizeof(uart->txfifo) - start;
+
+ if (uart->tx_len + len > sizeof(uart->txfifo))
+ len = sizeof(uart->txfifo) - uart->tx_len;
+
+ if (len)
+ uart->gfd.when |= GSMD_FD_WRITE;
+
+ if (len > space) {
+ memcpy(uart->txfifo + start, data, space);
+ memcpy(uart->txfifo, data + space, len - space);
+ } else
+ memcpy(uart->txfifo + start, data, len);
+
+ uart->tx_len += len;
+ return len;
+}
+
+int uart_init(struct gsmd_uart *uart, int sockfd)
+{
+ uart->gfd.fd = sockfd;
+ uart->gfd.when = GSMD_FD_READ;
+ uart->gfd.data = uart;
+ uart->gfd.cb = &uart_select_cb;
+
+ uart->port.write = uart_write;
+
+ return gsmd_register_fd(&uart->gfd);
+}
--
1.5.2.1

View File

@@ -0,0 +1,74 @@
From 1078f7aced63c6216bffe649930b97c9ccf9a16e Mon Sep 17 00:00:00 2001
From: Andrzej Zaborowski <balrog@zabor.org>
Date: Wed, 19 Sep 2007 14:04:50 +0200
Subject: [PATCH] Flush all pending commands before restarting the modem initialisation.
---
include/gsmd/gsmd.h | 1 +
src/gsmd/atcmd.c | 21 +++++++++++++++++++++
src/gsmd/timer.c | 8 ++++++++
3 files changed, 30 insertions(+), 0 deletions(-)
diff --git a/include/gsmd/gsmd.h b/include/gsmd/gsmd.h
index 4afdf66..6ac9d8e 100644
--- a/include/gsmd/gsmd.h
+++ b/include/gsmd/gsmd.h
@@ -131,6 +131,7 @@ struct gsmd_timer {
int gsmd_timer_init(void);
void gmsd_timer_check_n_run(void);
+void gsmd_timer_reset(void);
struct gsmd_timer *gsmd_timer_alloc(void);
int gsmd_timer_register(struct gsmd_timer *timer);
diff --git a/src/gsmd/atcmd.c b/src/gsmd/atcmd.c
index 27dfa41..2f6cee2 100644
--- a/src/gsmd/atcmd.c
+++ b/src/gsmd/atcmd.c
@@ -264,6 +264,27 @@ static int ml_parse(const char *buf, int len, void *ctx)
if (strlen(buf) == 0 ||
!strcmp(buf, "AT-Command Interpreter ready")) {
g->interpreter_ready = 1;
+ g->clear_to_send = 1;
+
+ /* Flush current queue and reinitialise */
+ while (!llist_empty(&g->busy_atcmds)) {
+ cmd = llist_entry(g->busy_atcmds.next,
+ struct gsmd_atcmd, list);
+ gsmd_log(GSMD_NOTICE, "discarding busy cmd %s\n",
+ cmd->buf);
+ llist_del(&cmd->list);
+ talloc_free(cmd);
+ }
+ while (!llist_empty(&g->pending_atcmds)) {
+ cmd = llist_entry(g->pending_atcmds.next,
+ struct gsmd_atcmd, list);
+ gsmd_log(GSMD_NOTICE, "discarding pending cmd %s\n",
+ cmd->buf);
+ llist_del(&cmd->list);
+ talloc_free(cmd);
+ }
+
+ gsmd_timer_reset();
gsmd_initsettings(g);
gmsd_alive_start(g);
atcmd_wake_queue(g);
diff --git a/src/gsmd/timer.c b/src/gsmd/timer.c
index 5200690..8877275 100644
--- a/src/gsmd/timer.c
+++ b/src/gsmd/timer.c
@@ -215,3 +215,11 @@ void gsmd_timer_unregister(struct gsmd_timer *timer)
/* re-calculate next expiration */
calc_next_expiration();
}
+
+void gsmd_timer_reset(void)
+{
+ while (!llist_empty(&gsmd_timers))
+ /* TODO: free associated resources (e.g timer->cancel_cb()) */
+ llist_del(&llist_entry(gsmd_timers.next,
+ struct gsmd_timer, list)->list);
+}
--
1.5.2.1

View File

@@ -0,0 +1,77 @@
From 8af1bb4a0d0df9baa80859c5f7f56cbd7634aded Mon Sep 17 00:00:00 2001
From: Andrzej Zaborowski <balrog@zabor.org>
Date: Wed, 19 Sep 2007 14:06:19 +0200
Subject: [PATCH] Correctly segment incoming usock data into packets, handler short reads.
---
include/gsmd/gsmd.h | 2 ++
src/gsmd/usock.c | 20 ++++++++++++++++----
2 files changed, 18 insertions(+), 4 deletions(-)
diff --git a/include/gsmd/gsmd.h b/include/gsmd/gsmd.h
index 6ac9d8e..acec02a 100644
--- a/include/gsmd/gsmd.h
+++ b/include/gsmd/gsmd.h
@@ -95,6 +95,8 @@ struct gsmd_user {
struct gsmd *gsmd;
struct gsmd_fd gfd; /* the socket */
u_int32_t subscriptions; /* bitmaks of subscribed event groups */
+ char usock_fifo[1024];
+ int usock_len;
struct llist_head pb_readrg_list; /* our READRG phonebook list */
struct llist_head pb_find_list; /* our FIND phonebook list */
diff --git a/src/gsmd/usock.c b/src/gsmd/usock.c
index 32e98d0..bac5f0c 100644
--- a/src/gsmd/usock.c
+++ b/src/gsmd/usock.c
@@ -1529,14 +1529,15 @@ static int usock_rcv_pcmd(struct gsmd_user *gu, char *buf, int len)
static int gsmd_usock_user_cb(int fd, unsigned int what, void *data)
{
struct gsmd_user *gu = data;
+ struct gsmd_msg_hdr *gph;
/* FIXME: check some kind of backlog and limit it */
if (what & GSMD_FD_READ) {
- char buf[1024];
int rcvlen;
/* read data from socket, determine what he wants */
- rcvlen = read(fd, buf, sizeof(buf));
+ rcvlen = read(fd, gu->usock_fifo + gu->usock_len,
+ sizeof(gu->usock_fifo) - gu->usock_len);
if (rcvlen == 0) {
DEBUGP("EOF, this client has just vanished\n");
/* EOF, this client has just vanished */
@@ -1549,8 +1550,18 @@ static int gsmd_usock_user_cb(int fd, unsigned int what, void *data)
return 0;
} else if (rcvlen < 0)
return rcvlen;
- else
- return usock_rcv_pcmd(gu, buf, rcvlen);
+
+ gu->usock_len += rcvlen;
+ gph = (struct gsmd_msg_hdr *) gu->usock_fifo;
+ while (gu->usock_len >= sizeof(*gph) &&
+ gu->usock_len >= sizeof(*gph) + gph->len) {
+ usock_rcv_pcmd(gu, gu->usock_fifo, gu->usock_len);
+ gu->usock_len -= sizeof(*gph) + gph->len;
+ memmove(gu->usock_fifo,
+ gu->usock_fifo + sizeof(*gph) +
+ gph->len,
+ gu->usock_len);
+ }
}
if (what & GSMD_FD_WRITE) {
@@ -1609,6 +1620,7 @@ static int gsmd_usock_cb(int fd, unsigned int what, void *data)
newuser->gfd.cb = &gsmd_usock_user_cb;
newuser->gsmd = g;
newuser->subscriptions = 0xffffffff;
+ newuser->usock_len = 0;
INIT_LLIST_HEAD(&newuser->finished_ucmds);
INIT_LLIST_HEAD(&newuser->pb_readrg_list);
INIT_LLIST_HEAD(&newuser->pb_find_list);
--
1.5.2.1

View File

@@ -0,0 +1,176 @@
From 421b0fa14fefbd13a455c20380fecddda616b41a Mon Sep 17 00:00:00 2001
From: Andrzej Zaborowski <balrog@zabor.org>
Date: Wed, 19 Sep 2007 18:30:36 +0200
Subject: [PATCH] Handle read() and write() return values.
---
include/libgsmd/libgsmd.h | 3 +-
src/gsmd/usock.c | 38 ++++++++++++++++-----------
src/libgsmd/lgsm_internals.h | 2 +
src/libgsmd/libgsmd.c | 58 ++++++++++++++++++++++++++---------------
4 files changed, 63 insertions(+), 38 deletions(-)
diff --git a/include/libgsmd/libgsmd.h b/include/libgsmd/libgsmd.h
index fc56890..db15aa9 100644
--- a/include/libgsmd/libgsmd.h
+++ b/include/libgsmd/libgsmd.h
@@ -65,6 +65,7 @@ extern int lgsm_subscriptions(struct lgsm_handle *lh, u_int32_t subscriptions);
extern struct gsmd_msg_hdr *lgsm_gmh_fill(int type, int subtype, int payload_len);
extern int lgsm_send(struct lgsm_handle *lh, struct gsmd_msg_hdr *gmh);
-extern int lgsm_handle_packet(struct lgsm_handle *lh, char *buf, int len);
+extern int lgsm_handle_packet(struct lgsm_handle *lh,
+ const char *buf, int len);
#endif
diff --git a/src/gsmd/usock.c b/src/gsmd/usock.c
index bac5f0c..2283600 100644
--- a/src/gsmd/usock.c
+++ b/src/gsmd/usock.c
@@ -1569,23 +1569,29 @@ static int gsmd_usock_user_cb(int fd, unsigned int what, void *data)
struct gsmd_ucmd *ucmd, *uctmp;
llist_for_each_entry_safe(ucmd, uctmp, &gu->finished_ucmds,
list) {
- int rc;
-
- rc = write(fd, &ucmd->hdr, sizeof(ucmd->hdr) + ucmd->hdr.len);
- if (rc < 0) {
- DEBUGP("write return %d\n", rc);
- return rc;
- }
- if (rc == 0) {
- DEBUGP("write returns zero!!\n");
- break;
+ const void *pos = &ucmd->hdr;
+ size_t len = sizeof(ucmd->hdr) + ucmd->hdr.len;
+
+ while (len) {
+ ssize_t rc;
+
+ rc = write(fd, pos, len);
+ if (rc < 0 && errno != EINTR) {
+ DEBUGP("write returned %s\n",
+ strerror(errno));
+ return rc;
+ }
+ if (rc == 0 && pos == &ucmd->hdr) {
+ DEBUGP("write returns zero!!\n");
+ return 0;
+ }
+ if (rc > 0) {
+ len -= rc;
+ pos += rc;
+ }
}
- if (rc != sizeof(ucmd->hdr) + ucmd->hdr.len) {
- DEBUGP("short write\n");
- break;
- }
-
- DEBUGP("successfully sent cmd %p to user %p, freeing\n", ucmd, gu);
+ DEBUGP("successfully sent cmd %p to user %p, "
+ "freeing\n", ucmd, gu);
llist_del(&ucmd->list);
talloc_free(ucmd);
}
diff --git a/src/libgsmd/lgsm_internals.h b/src/libgsmd/lgsm_internals.h
index c826723..f1b1a23 100644
--- a/src/libgsmd/lgsm_internals.h
+++ b/src/libgsmd/lgsm_internals.h
@@ -8,6 +8,8 @@ struct lgsm_handle {
int fd;
lgsm_msg_handler *handler[__NUM_GSMD_MSGS];
enum lgsm_netreg_state netreg_state;
+ char usock_fifo[1024];
+ int usock_len;
};
int lgsm_send(struct lgsm_handle *lh, struct gsmd_msg_hdr *gmh);
diff --git a/src/libgsmd/libgsmd.c b/src/libgsmd/libgsmd.c
index 9906ea8..cc804ed 100644
--- a/src/libgsmd/libgsmd.c
+++ b/src/libgsmd/libgsmd.c
@@ -86,34 +86,37 @@ static int lgsm_open_backend(struct lgsm_handle *lh, const char *device)
}
/* handle a packet that was received on the gsmd socket */
-int lgsm_handle_packet(struct lgsm_handle *lh, char *buf, int len)
+int lgsm_handle_packet(struct lgsm_handle *lh, const char *buf, int len)
{
struct gsmd_msg_hdr *gmh;
lgsm_msg_handler *handler;
int rc = 0;
- while (len) {
- if (len < sizeof(*gmh))
- return -EINVAL;
- gmh = (struct gsmd_msg_hdr *) buf;
-
- if (len - sizeof(*gmh) < gmh->len)
- return -EINVAL;
- len -= sizeof(*gmh) + gmh->len;
- buf += sizeof(*gmh) + gmh->len;
-
- if (gmh->msg_type >= __NUM_GSMD_MSGS)
- return -EINVAL;
-
- handler = lh->handler[gmh->msg_type];
+ if (lh->usock_len + len > sizeof(lh->usock_fifo))
+ return -ENOMEM;
- if (handler)
+ memcpy(lh->usock_fifo + lh->usock_len, buf, len);
+ lh->usock_len += len;
+ gmh = (struct gsmd_msg_hdr *) lh->usock_fifo;
+ while (lh->usock_len >= sizeof(*gmh) &&
+ lh->usock_len >= sizeof(*gmh) + gmh->len) {
+ if (gmh->msg_type < __NUM_GSMD_MSGS &&
+ (handler = lh->handler[gmh->msg_type]))
rc |= handler(lh, gmh);
- else
- fprintf(stderr, "unable to handle packet type=%u\n",
- gmh->msg_type);
+ else {
+ fprintf(stderr, "unable to handle packet "
+ "type=%u id=%u\n",
+ gmh->msg_type, gmh->id);
+ rc |= EINVAL;
+ }
+
+ lh->usock_len -= gmh->len + sizeof(*gmh);
+ memmove(lh->usock_fifo,
+ lh->usock_fifo + gmh->len + sizeof(*gmh),
+ lh->usock_len);
}
- return rc;
+
+ return -rc;
}
int lgsm_register_handler(struct lgsm_handle *lh, int type, lgsm_msg_handler *handler)
@@ -193,8 +196,21 @@ static u_int16_t next_msg_id;
int lgsm_send(struct lgsm_handle *lh, struct gsmd_msg_hdr *gmh)
{
+ ssize_t rc;
+ size_t len = sizeof(*gmh) + gmh->len;
+ const void *pos = gmh;
+
gmh->id = next_msg_id++;
- return send(lh->fd, (char *) gmh, sizeof(*gmh) + gmh->len, 0);
+ while (len) {
+ rc = send(lh->fd, pos, len, 0);
+ if (rc < 0 && errno != EINTR)
+ return -errno;
+ if (rc > 0) {
+ len -= rc;
+ pos += rc;
+ }
+ }
+ return 0;
}
struct gsmd_msg_hdr *lgsm_gmh_fill(int type, int subtype, int payload_len)
--
1.5.2.1

View File

@@ -0,0 +1,130 @@
diff --git a/include/gsmd/usock.h b/include/gsmd/usock.h
index 236ad78..66cdf48 100644
--- a/include/gsmd/usock.h
+++ b/include/gsmd/usock.h
@@ -332,6 +332,7 @@ struct gsmd_sms {
struct gsmd_sms_submit {
struct gsmd_addr addr;
struct gsmd_sms payload;
+ int ask_ds;
};
/* Refer to GSM 07.05 subclause 4.4 */
diff --git a/include/libgsmd/sms.h b/include/libgsmd/sms.h
index 3ada62d..9808442 100644
--- a/include/libgsmd/sms.h
+++ b/include/libgsmd/sms.h
@@ -46,6 +46,7 @@ struct lgsm_sms {
enum gsmd_sms_alphabet alpha;
u_int8_t data[LGSM_SMS_DATA_MAXLEN+1];
int length;
+ int ask_ds;
};
/* GSM 03.40 subclause 9.2.2.2 and GSM 07.05 subclause 4.4 and subclause 3.1 */
diff --git a/src/gsmd/sms_pdu.c b/src/gsmd/sms_pdu.c
index d1235dd..d461999 100644
--- a/src/gsmd/sms_pdu.c
+++ b/src/gsmd/sms_pdu.c
@@ -247,7 +247,8 @@ int sms_pdu_make_smssubmit(char *dest, const struct gsmd_sms_submit *src)
GSMD_SMS_TP_MTI_SUBMIT |
(0 << 2) | /* Reject Duplicates: 0 */
GSMD_SMS_TP_VPF_NOT_PRESENT |
- GSMD_SMS_TP_SRR_STATUS_REQUEST |
+ (src->ask_ds ? GSMD_SMS_TP_SRR_STATUS_REQUEST :
+ GSMD_SMS_TP_SRR_NOT_REQUEST) |
(src->payload.has_header ? GSMD_SMS_TP_UDHI_WITH_HEADER :
GSMD_SMS_TP_UDHI_NO_HEADER) |
GSMD_SMS_TP_RP_NOT_SET;
diff --git a/src/libgsmd/libgsmd_sms.c b/src/libgsmd/libgsmd_sms.c
index 22d7dbf..bbc8689 100644
--- a/src/libgsmd/libgsmd_sms.c
+++ b/src/libgsmd/libgsmd_sms.c
@@ -126,6 +126,7 @@ int lgsm_sms_send(struct lgsm_handle *lh,
if (lgsm_number2addr(&gss->addr, sms->addr, 1))
return -EINVAL;
+ gss->ask_ds = sms->ask_ds;
gss->payload.has_header = 0;
gss->payload.length = sms->length;
gss->payload.coding_scheme = sms->alpha;
@@ -161,6 +162,7 @@ int lgsm_sms_write(struct lgsm_handle *lh,
if (lgsm_number2addr(&gsw->sms.addr, sms_write->sms.addr, 1))
return -EINVAL;
+ gsw->sms.ask_ds = sms_write->sms.ask_ds;
gsw->sms.payload.has_header = 0;
gsw->sms.payload.length = sms_write->sms.length;
gsw->sms.payload.coding_scheme = sms_write->sms.alpha;
diff --git a/src/util/shell.c b/src/util/shell.c
index f902126..f26e17e 100644
--- a/src/util/shell.c
+++ b/src/util/shell.c
@@ -355,7 +355,7 @@ static int shell_help(void)
"\tsd\tSMS Delete (sd=index,delflg)\n"
"\tsl\tSMS List (sl=stat)\n"
"\tsr\tSMS Read (sr=index)\n"
- "\tss\tSMS Send (ss=number,text|[\"text\"])\n"
+ "\tss\tSMS Send (ss=ask_ds,number,text|[\"text\"])\n"
"\tsw\tSMS Write (sw=stat,number,text)\n"
"\tsm\tSMS Storage stats\n"
"\tsM\tSMS Set preferred storage (sM=mem1,mem2,mem3)\n"
@@ -563,33 +563,29 @@ int shell_main(struct lgsm_handle *lgsmh)
struct lgsm_sms sms;
ptr = strchr(buf, '=');
+ sms.ask_ds = atoi(ptr+1);
fcomma = strchr(buf, ',');
- if (!ptr || !fcomma) {
- printf("Wrong command format\n");
- } else {
- strncpy(sms.addr, ptr+1, fcomma-ptr-1);
- sms.addr[fcomma-ptr-1] = '\0';
-
- /* todo define \" to allow " in text */
- if (fcomma[1] == '"' &&
- !strchr(fcomma+2, '"')) {
+ lcomma = strchr(fcomma+1, ',');
+ strncpy(sms.addr, fcomma+1, lcomma-fcomma-1);
+ sms.addr[lcomma-fcomma-1] = '\0';
+ /* todo define \" to allow " in text */
+ if (lcomma[1]=='"' &&
+ !strchr(lcomma+2, '"')) {
/* read until closing '"' */
rc = fscanf(stdin, "%[^\"]\"",
- fcomma+strlen(fcomma));
+ lcomma+strlen(lcomma));
if (rc == EOF) {
printf("EOF\n");
return -1;
}
/* remove brackets */
- fcomma++;
- fcomma[strlen(fcomma)] = '\0';
- }
-
- printf("Send SMS\n");
- packing_7bit_character(fcomma+1, &sms);
+ lcomma++;
+ lcomma[strlen(lcomma)] = '\0';
+ }
+ printf("Send SMS\n");
+ packing_7bit_character(lcomma+1, &sms);
- lgsm_sms_send(lgsmh, &sms);
- }
+ lgsm_sms_send(lgsmh, &sms);
} else if ( !strncmp(buf, "sw", 2)) {
printf("Write SMS\n");
struct lgsm_sms_write sms_write;
@@ -603,6 +599,7 @@ int shell_main(struct lgsm_handle *lgsmh)
sms_write.sms.addr[lcomma-fcomma-1] = '\0';
packing_7bit_character(
lcomma+1, &sms_write.sms);
+ sms_write.sms.ask_ds = 0;
lgsm_sms_write(lgsmh, &sms_write);
} else if (!strncmp(buf, "sm", 2)) {
--
1.5.2.1

View File

@@ -0,0 +1,70 @@
http://bugzilla.openmoko.org/cgi-bin/bugzilla/show_bug.cgi?id=834
From: Kristian Mueller <kristian@mput.de>
Subject: [PATCH] libgsmd-tool does not allow sms with more than one word
libgsmd-tool only allows for command strings without spaces.
SMS messages with more than one word will be parsed as multible commands.
The patch introduces SMS message text in bracket and fixes a NULL pointer
reference on mailformed "ss" commands.
Signed-off-by: Jim Huang <jserv@openmoko.org>
---
src/util/shell.c | 32 ++++++++++++++++++++++++++------
1 file changed, 26 insertions(+), 6 deletions(-)
Index: gsm/src/util/shell.c
===================================================================
--- gsm.orig/src/util/shell.c 2007-08-31 16:15:30.000000000 +0800
+++ gsm/src/util/shell.c 2007-09-17 23:35:31.000000000 +0800
@@ -389,7 +389,7 @@
"\tsd\tSMS Delete (sd=index,delflg)\n"
"\tsl\tSMS List (sl=stat)\n"
"\tsr\tSMS Read (sr=index)\n"
- "\tss\tSMS Send (ss=number,text)\n"
+ "\tss\tSMS Send (ss=number,text|[\"text\"])\n"
"\tsw\tSMS Write (sw=stat,number,text)\n"
"\tsm\tSMS Storage stats\n"
"\tsM\tSMS Set preferred storage (sM=mem1,mem2,mem3)\n"
@@ -612,16 +612,36 @@
lgsm_sms_read(lgsmh, atoi(ptr+1));
} else if ( !strncmp(buf, "ss", 2)) {
- printf("Send SMS\n");
struct lgsm_sms sms;
ptr = strchr(buf, '=');
fcomma = strchr(buf, ',');
- strncpy(sms.addr, ptr+1, fcomma-ptr-1);
- sms.addr[fcomma-ptr-1] = '\0';
- packing_7bit_character(fcomma+1, &sms);
+ if (!ptr || !fcomma) {
+ printf("Wrong command format\n");
+ } else {
+ strncpy(sms.addr, ptr+1, fcomma-ptr-1);
+ sms.addr[fcomma-ptr-1] = '\0';
+
+ /* todo define \" to allow " in text */
+ if (fcomma[1] == '"' &&
+ !strchr(fcomma+2, '"')) {
+ /* read until closing '"' */
+ rc = fscanf(stdin, "%[^\"]\"",
+ fcomma+strlen(fcomma));
+ if (rc == EOF) {
+ printf("EOF\n");
+ return -1;
+ }
+ /* remove brackets */
+ fcomma++;
+ fcomma[strlen(fcomma)] = '\0';
+ }
+
+ printf("Send SMS\n");
+ packing_7bit_character(fcomma+1, &sms);
- lgsm_sms_send(lgsmh, &sms);
+ lgsm_sms_send(lgsmh, &sms);
+ }
} else if ( !strncmp(buf, "sw", 2)) {
printf("Write SMS\n");
struct lgsm_sms_write sms_write;

View File

@@ -0,0 +1,133 @@
From: Erin Yueh <erin_yueh@openmoko.com>
Subject: [PATCH] SMS status report
I made a patch for SMS status report. It can change SMS-Submit messages
and ask for a status report. When the destination address receives our
message, the service center will send a SMS-STATUS-REPORT to us. We can
tell what messages we sent by TP-MR (message reference number) value and
can know the sending result by TP-ST (Status) value from status report
messages.
PS. if you don't want to ask a status report, you can change this value
back. Replace "GSMD_SMS_TP_SRR_STATUS_REQUEST" with
"GSMD_SMS_TP_SRR_NOT_REQUEST".
header[pos ++] =
GSMD_SMS_TP_MTI_SUBMIT |
(0 << 2) | /* Reject Duplicates: 0 */
GSMD_SMS_TP_VPF_NOT_PRESENT |
- GSMD_SMS_TP_SRR_NOT_REQUEST |
+ GSMD_SMS_TP_SRR_STATUS_REQUEST |
(src->payload.has_header ? GSMD_SMS_TP_UDHI_WITH_HEADER :
GSMD_SMS_TP_UDHI_NO_HEADER) |
GSMD_SMS_TP_RP_NOT_SET;
Signed-off-by: Jim Huang <jserv@openmoko.org>
---
src/gsmd/sms_pdu.c | 54 +++++++++++++++++++++++++++++++++++++++++++-----------
src/util/event.c | 6 +++++-
2 files changed, 48 insertions(+), 12 deletions(-)
Index: gsm/src/gsmd/sms_pdu.c
===================================================================
--- gsm.orig/src/gsmd/sms_pdu.c 2007-09-06 11:14:34.000000000 +0800
+++ gsm/src/gsmd/sms_pdu.c 2007-09-17 23:39:20.000000000 +0800
@@ -139,6 +139,17 @@
/* Skip TP-PID */
len -= 9;
src += 9;
+
+ /* TP-UDL */
+ dst->payload.length = src[0];
+ i = sms_data_bytelen(dst->payload.coding_scheme, src[0]);
+
+ /* TP-UD */
+ if (len < 1 + i || i > GSMD_SMS_DATA_MAXLEN)
+ return 1;
+ memcpy(dst->payload.data, src + 1, i);
+ dst->payload.data[i] = 0;
+
break;
case GSMD_SMS_TP_MTI_SUBMIT:
if (len < 4)
@@ -179,23 +190,44 @@
src += vpf ? 3 : 2;
memset(dst->time_stamp, 0, 7);
+
+ /* TP-UDL */
+ dst->payload.length = src[0];
+ i = sms_data_bytelen(dst->payload.coding_scheme, src[0]);
+
+ /* TP-UD */
+ if (len < 1 + i || i > GSMD_SMS_DATA_MAXLEN)
+ return 1;
+ memcpy(dst->payload.data, src + 1, i);
+ dst->payload.data[i] = 0;
break;
case GSMD_SMS_TP_MTI_STATUS_REPORT:
- /* TODO */
+ if (len < 3)
+ return 1;
+
+ /* TP-MR set it gsmd_sms_list.index*/
+ dst->index = (int) src[1];
+ /* TP-STATUS set it to coding_scheme */
+ dst->payload.coding_scheme = (int) src[len-1];
+ /* TP-RA */
+ i = sms_number_bytelen(src[3], src[2]);
+ if (len < 13 + i)
+ return 1;
+ if (sms_address2ascii(&dst->addr, src + 2))
+ return 1;
+ len -= 4 + i;
+ src += 4 + i;
+ /* TP-SCTS */
+ memcpy(dst->time_stamp, src, 7);
+ /* TP-UD */
+ dst->payload.length = 0;
+ dst->payload.data[0] = 0;
+ break;
default:
/* Unknown PDU type */
return 1;
}
- /* TP-UDL */
- dst->payload.length = src[0];
- i = sms_data_bytelen(dst->payload.coding_scheme, src[0]);
-
- /* TP-UD */
- if (len < 1 + i || i > GSMD_SMS_DATA_MAXLEN)
- return 1;
- memcpy(dst->payload.data, src + 1, i);
- dst->payload.data[i] = 0;
return 0;
}
@@ -215,7 +247,7 @@
GSMD_SMS_TP_MTI_SUBMIT |
(0 << 2) | /* Reject Duplicates: 0 */
GSMD_SMS_TP_VPF_NOT_PRESENT |
- GSMD_SMS_TP_SRR_NOT_REQUEST |
+ GSMD_SMS_TP_SRR_STATUS_REQUEST |
(src->payload.has_header ? GSMD_SMS_TP_UDHI_WITH_HEADER :
GSMD_SMS_TP_UDHI_NO_HEADER) |
GSMD_SMS_TP_RP_NOT_SET;
Index: gsm/src/util/event.c
===================================================================
--- gsm.orig/src/util/event.c 2007-09-06 11:14:34.000000000 +0800
+++ gsm/src/util/event.c 2007-09-17 23:39:47.000000000 +0800
@@ -128,8 +128,12 @@
static int inds_handler(struct lgsm_handle *lh, int evt,
struct gsmd_evt_auxdata *aux)
{
- if (aux->u.ds.inlined)
+ if (aux->u.ds.inlined) {
+ struct gsmd_sms_list *sms;
+ sms = (struct gsmd_sms_list *) aux->data;
printf("EVENT: Incoming Status Report\n");
+ printf("message ref = %d, status = %d\n", sms->index,sms->payload.coding_scheme);
+ }
else
printf("EVENT: Incoming Status Report stored at location %i\n",
aux->u.ds.index);

View File

@@ -0,0 +1,423 @@
From: Sean Chiang <sean_chiang@openmoko.com>
Subject: [PATCH] Improvement for find and read phonebooks in gsmd
This patch is an improvement for find and read phonebooks.
After clients make a request to find / read phonebooks, then clients
should make a request to retrieve all the records.
Signed-off-by: Jim Huang <jserv@openmoko.org>
---
include/gsmd/gsmd.h | 3
include/gsmd/usock.h | 20 +++-
include/libgsmd/phonebook.h | 6 +
src/gsmd/usock.c | 184 +++++++++++++++++++++++++++++++++++-----
src/libgsmd/libgsmd_phonebook.c | 48 ++++++++++
5 files changed, 238 insertions(+), 23 deletions(-)
Index: gsm/include/libgsmd/phonebook.h
===================================================================
--- gsm.orig/include/libgsmd/phonebook.h 2007-08-31 16:15:29.000000000 +0800
+++ gsm/include/libgsmd/phonebook.h 2007-09-17 23:48:41.000000000 +0800
@@ -106,4 +106,10 @@
/* Get the location range/nlength/tlength supported */
extern int lgsm_pb_get_support(struct lgsm_handle *lh);
+/* Retrieve the records of READRG request */
+extern int lgsm_pb_retrieve_readrg(struct lgsm_handle *lh, int num);
+
+/* Retrieve the records of FIND request */
+extern int lgsm_pb_retrieve_find(struct lgsm_handle *lh, int num);
+
#endif
Index: gsm/include/gsmd/gsmd.h
===================================================================
--- gsm.orig/include/gsmd/gsmd.h 2007-08-31 16:15:29.000000000 +0800
+++ gsm/include/gsmd/gsmd.h 2007-09-17 23:48:41.000000000 +0800
@@ -92,6 +92,9 @@
struct gsmd *gsmd;
struct gsmd_fd gfd; /* the socket */
u_int32_t subscriptions; /* bitmaks of subscribed event groups */
+
+ struct llist_head pb_readrg_list; /* our READRG phonebook list */
+ struct llist_head pb_find_list; /* our FIND phonebook list */
};
#define GSMD_DEBUG 1 /* debugging information */
Index: gsm/include/gsmd/usock.h
===================================================================
--- gsm.orig/include/gsmd/usock.h 2007-08-31 16:15:29.000000000 +0800
+++ gsm/include/gsmd/usock.h 2007-09-17 23:48:56.000000000 +0800
@@ -194,6 +194,8 @@
GSMD_PHONEBOOK_GET_SUPPORT = 6,
GSMD_PHONEBOOK_LIST_STORAGE = 7,
GSMD_PHONEBOOK_SET_STORAGE = 8,
+ GSMD_PHONEBOOK_RETRIEVE_READRG = 9,
+ GSMD_PHONEBOOK_RETRIEVE_FIND = 10,
};
/* Type-of-Address, Numbering-Plan-Identification field, GSM 03.40, 9.1.2.5 */
@@ -431,7 +433,6 @@
char text[GSMD_PB_TEXT_MAXLEN+1];
} __attribute__ ((packed));
-
/* Refer to GSM 07.07 subclause 8.13 */
/* FIXME: the tlength depends on SIM, use +CPBR=? to get */
struct gsmd_phonebook_find {
@@ -471,8 +472,18 @@
char opname_longalpha[16];
};
+/* Refer to GSM 07.07 subclause 8.11 */
+struct gsmd_phonebook_mem {
+ u_int8_t type[3];
+ u_int8_t pad;
+ u_int16_t used;
+ u_int16_t total;
+} __attribute__ ((packed));
+
struct gsmd_phonebook_storage {
- char storage[3];
+ /* FIXME the amount of phonebook storage should be dynamic */
+ u_int8_t num;
+ struct gsmd_phonebook_mem mem[20];
} __attribute__ ((packed));
/* Subscriber number information from 3GPP TS 07.07, Clause 7.1 */
@@ -517,6 +528,11 @@
char buf[];
} __attribute__ ((packed));
+struct gsmd_phonebooks {
+ struct llist_head list;
+ struct gsmd_phonebook pb;
+} __attribute__ ((packed));
+
extern struct gsmd_ucmd *ucmd_alloc(int extra_size);
extern int usock_init(struct gsmd *g);
extern void usock_cmd_enqueue(struct gsmd_ucmd *ucmd, struct gsmd_user *gu);
Index: gsm/src/libgsmd/libgsmd_phonebook.c
===================================================================
--- gsm.orig/src/libgsmd/libgsmd_phonebook.c 2007-08-31 16:15:29.000000000 +0800
+++ gsm/src/libgsmd/libgsmd_phonebook.c 2007-09-17 23:48:41.000000000 +0800
@@ -33,7 +33,7 @@
gmh->data[2] = '\0';
rc = lgsm_send(lh, gmh);
- if (rc < gmh->len + 3) {
+ if (rc < gmh->len + sizeof(*gmh)) {
lgsm_gmh_free(gmh);
return -EIO;
}
@@ -177,3 +177,49 @@
{
return lgsm_send_simple(lh, GSMD_MSG_PHONEBOOK, GSMD_PHONEBOOK_GET_SUPPORT);
}
+
+int lgsm_pb_retrieve_readrg(struct lgsm_handle *lh, int num)
+{
+ struct gsmd_msg_hdr *gmh;
+ int rc;
+
+ gmh = lgsm_gmh_fill(GSMD_MSG_PHONEBOOK,
+ GSMD_PHONEBOOK_RETRIEVE_READRG, sizeof(int));
+ if (!gmh)
+ return -ENOMEM;
+
+ *(int *)(gmh->data) = num;
+
+ rc = lgsm_send(lh, gmh);
+ if (rc < gmh->len + sizeof(*gmh)) {
+ lgsm_gmh_free(gmh);
+ return -EIO;
+ }
+
+ lgsm_gmh_free(gmh);
+
+ return 0;
+}
+
+int lgsm_pb_retrieve_find(struct lgsm_handle *lh, int num)
+{
+ struct gsmd_msg_hdr *gmh;
+ int rc;
+
+ gmh = lgsm_gmh_fill(GSMD_MSG_PHONEBOOK,
+ GSMD_PHONEBOOK_RETRIEVE_FIND, sizeof(int));
+ if (!gmh)
+ return -ENOMEM;
+
+ *(int *)(gmh->data) = num;
+
+ rc = lgsm_send(lh, gmh);
+ if (rc < gmh->len + sizeof(*gmh)) {
+ lgsm_gmh_free(gmh);
+ return -EIO;
+ }
+
+ lgsm_gmh_free(gmh);
+
+ return 0;
+}
Index: gsm/src/gsmd/usock.c
===================================================================
--- gsm.orig/src/gsmd/usock.c 2007-08-31 16:15:30.000000000 +0800
+++ gsm/src/gsmd/usock.c 2007-09-17 23:53:34.000000000 +0800
@@ -1035,21 +1035,56 @@
static int phonebook_find_cb(struct gsmd_atcmd *cmd, void *ctx, char *resp)
{
- struct gsmd_user *gu = ctx;
- struct gsmd_ucmd *ucmd;
-
+ struct gsmd_user *gu = ctx;
+ struct gsmd_ucmd *ucmd;
+ struct gsmd_phonebooks *gps;
+ char *fcomma, *lcomma, *ptr1, *ptr2 = NULL;
+ int *num;
+
DEBUGP("resp: %s\n", resp);
- /* FIXME: using link list, also we need to handle the case of
- * no query result */
- ucmd = gsmd_ucmd_fill(strlen(resp) + 1, GSMD_MSG_PHONEBOOK,
+ /*
+ * [+CPBF: <index1>,<number>,<type>,<text>[[...]
+ * <CR><LF>+CPBF: <index2>,<unmber>,<type>,<text>]]
+ */
+ ucmd = gsmd_ucmd_fill(sizeof(int), GSMD_MSG_PHONEBOOK,
GSMD_PHONEBOOK_FIND, 0);
if (!ucmd)
return -ENOMEM;
- strcpy(ucmd->buf, resp);
+ num = (int*) ucmd->buf;
+
+ *num = 0;
+
+ ptr1 = strtok(resp, "\n");
+
+ while (ptr1) {
+ gps = (struct gsmd_phonebooks *) malloc(sizeof(struct gsmd_phonebooks));
+ ptr2 = strchr(ptr1, ' ');
+ gps->pb.index = atoi(ptr2+1);
+
+ fcomma = strchr(ptr1, '"');
+ lcomma = strchr(fcomma+1, '"');
+ strncpy(gps->pb.numb, fcomma + 1, (lcomma-fcomma-1));
+ gps->pb.numb[(lcomma - fcomma) - 1] = '\0';
+
+ gps->pb.type = atoi(lcomma + 2);
+
+ ptr2 = strrchr(ptr1, ',');
+ fcomma = ptr2 + 1;
+ lcomma = strchr(fcomma + 1, '"');
+ strncpy(gps->pb.text, fcomma + 1, (lcomma - fcomma - 1));
+ gps->pb.text[(lcomma - fcomma) - 1] = '\0';
+
+ llist_add_tail(&gps->list, &gu->pb_find_list);
+
+ (*num)++;
+
+ ptr1 = strtok(NULL, "\n");
+ }
usock_cmd_enqueue(ucmd, gu);
+
return 0;
}
@@ -1102,22 +1137,51 @@
{
struct gsmd_user *gu = ctx;
struct gsmd_ucmd *ucmd;
+ struct gsmd_phonebooks *gps;
+ char *fcomma, *lcomma, *ptr1, *ptr2 = NULL;
+ int *num;
DEBUGP("resp: %s\n", resp);
/*
- * +CPBR: 4,"1234",129,"6C5F745E7965"
- * +CPBR: 5,"5678",129,"800062115BB6"
- * +CPBR: 6,"7890",129,"810280AA591A"
- * +CPBR: 8,"36874",129,"005300650061006E"
- *
+ * [+CPBR: <index1>,<number>,<type>,<text>[[...]
+ * <CR><LF>+CPBR: <index2>,<unmber>,<type>,<text>]]
*/
- ucmd = gsmd_ucmd_fill(strlen(resp)+1, GSMD_MSG_PHONEBOOK,
+ ucmd = gsmd_ucmd_fill(sizeof(int), GSMD_MSG_PHONEBOOK,
GSMD_PHONEBOOK_READRG, 0);
if (!ucmd)
return -ENOMEM;
- strcpy(ucmd->buf, resp);
+ num = (int*) ucmd->buf;
+
+ *num = 0;
+
+ ptr1 = strtok(resp, "\n");
+
+ while(ptr1) {
+ gps = (struct gsmd_phonebooks *) malloc(sizeof(struct gsmd_phonebooks));
+ ptr2 = strchr(ptr1, ' ');
+ gps->pb.index = atoi(ptr2+1);
+
+ fcomma = strchr(ptr1, '"');
+ lcomma = strchr(fcomma+1, '"');
+ strncpy(gps->pb.numb, fcomma + 1, (lcomma-fcomma-1));
+ gps->pb.numb[(lcomma - fcomma) - 1] = '\0';
+
+ gps->pb.type = atoi(lcomma + 2);
+
+ ptr2 = strrchr(ptr1, ',');
+ fcomma = ptr2 + 1;
+ lcomma = strchr(fcomma + 1, '"');
+ strncpy(gps->pb.text, fcomma + 1, (lcomma - fcomma - 1));
+ gps->pb.text[(lcomma - fcomma) - 1] = '\0';
+
+ llist_add_tail(&gps->list, &gu->pb_readrg_list);
+
+ (*num)++;
+
+ ptr1 = strtok(NULL, "\n");
+ }
usock_cmd_enqueue(ucmd, gu);
@@ -1209,22 +1273,38 @@
static int phonebook_list_storage_cb(struct gsmd_atcmd *cmd,
void *ctx, char *resp)
{
- /* +CPBS: ("EN","BD","FD","DC","LD","RC","LR","MT","AD",
- * "SM","SD","MC","LM","AF","ON","UD") */
/* TODO; using link list ; need to handle command error */
struct gsmd_user *gu = ctx;
struct gsmd_ucmd *ucmd;
+ struct gsmd_phonebook_storage *gps;
+ char *ptr;
DEBUGP("resp: %s\n", resp);
- ucmd = gsmd_ucmd_fill(strlen(resp) + 1,
+ /*
+ * +CPBS: (<storage>s)
+ */
+
+ ucmd = gsmd_ucmd_fill(sizeof(*gps),
GSMD_MSG_PHONEBOOK,
GSMD_PHONEBOOK_LIST_STORAGE, 0);
if (!ucmd)
return -ENOMEM;
- strcpy(ucmd->buf, resp);
+ gps = (struct gsmd_phonebook_storage *) ucmd->buf;
+ gps->num = 0;
+
+ if (!strncmp(resp, "+CPBS", 5)) {
+ char* delim = "(,";
+ ptr = strpbrk(resp, delim);
+ while ( ptr ) {
+ strncpy(gps->mem[gps->num].type, ptr+2, 2);
+ gps->mem[gps->num].type[2] = '\0';
+ ptr = strpbrk(ptr+2, delim);
+ gps->num++;
+ }
+ }
usock_cmd_enqueue(ucmd, gu);
@@ -1235,11 +1315,13 @@
struct gsmd_msg_hdr *gph,int len)
{
struct gsmd_atcmd *cmd = NULL;
+ struct gsmd_ucmd *ucmd = NULL;
struct gsmd_phonebook_readrg *gpr;
struct gsmd_phonebook *gp;
struct gsmd_phonebook_find *gpf;
- int *index;
- int atcmd_len;
+ struct gsmd_phonebooks *cur, *cur2;
+ int *index, *num;
+ int atcmd_len, i;
char *storage;
char buf[1024];
@@ -1343,6 +1425,66 @@
cmd = atcmd_fill("AT+CPBR=?", 9+1,
&phonebook_get_support_cb, gu, gph->id);
break;
+ case GSMD_PHONEBOOK_RETRIEVE_READRG:
+ if (len < sizeof(*gph) + sizeof(int))
+ return -EINVAL;
+
+ num = (int *) ((void *)gph + sizeof(*gph));
+
+ ucmd = gsmd_ucmd_fill(sizeof(struct gsmd_phonebook)*(*num),
+ GSMD_MSG_PHONEBOOK,
+ GSMD_PHONEBOOK_RETRIEVE_READRG, 0);
+ if (!ucmd)
+ return -ENOMEM;
+
+ gp = (struct gsmd_phonebook*) ucmd->buf;
+
+ if (!llist_empty(&gu->pb_readrg_list)) {
+
+ llist_for_each_entry_safe(cur, cur2,
+ &gu->pb_readrg_list, list) {
+ gp->index = cur->pb.index;
+ strcpy(gp->numb, cur->pb.numb);
+ gp->type = cur->pb.type;
+ strcpy(gp->text, cur->pb.text);
+ gp++;
+
+ llist_del(&cur->list);
+ free(cur);
+ }
+ }
+
+ usock_cmd_enqueue(ucmd, gu);
+
+ break;
+ case GSMD_PHONEBOOK_RETRIEVE_FIND:
+ if (len < sizeof(*gph) + sizeof(int))
+ return -EINVAL;
+
+ num = (int *) ((void *)gph + sizeof(*gph));
+
+ ucmd = gsmd_ucmd_fill(sizeof(struct gsmd_phonebook)*(*num), GSMD_MSG_PHONEBOOK,
+ GSMD_PHONEBOOK_RETRIEVE_FIND, 0);
+ if (!ucmd)
+ return -ENOMEM;
+
+ gp = (struct gsmd_phonebook*) ucmd->buf;
+
+ if (!llist_empty(&gu->pb_find_list)) {
+ llist_for_each_entry_safe(cur, cur2, &gu->pb_find_list, list) {
+ gp->index = cur->pb.index;
+ strcpy(gp->numb, cur->pb.numb);
+ gp->type = cur->pb.type;
+ strcpy(gp->text, cur->pb.text);
+ gp++;
+
+ llist_del(&cur->list);
+ free(cur);
+ }
+ }
+
+ usock_cmd_enqueue(ucmd, gu);
+ break;
default:
return -EINVAL;
}
@@ -1468,6 +1610,8 @@
newuser->gsmd = g;
newuser->subscriptions = 0xffffffff;
INIT_LLIST_HEAD(&newuser->finished_ucmds);
+ INIT_LLIST_HEAD(&newuser->pb_readrg_list);
+ INIT_LLIST_HEAD(&newuser->pb_find_list);
llist_add(&newuser->list, &g->users);
gsmd_register_fd(&newuser->gfd);

View File

@@ -0,0 +1,264 @@
From: Sean Chiang <sean_chiang@openmoko.com>
Subject: [PATCH] improvement for find and read phonebooks in shell
This patch improves the functions to find and read phonebooks in shell.
Besides prr and pf, I add two new commands pRr and pRf to retrieve the
phonebook.
Signed-off-by: Jim Huang <jserv@openmoko.org>
Index: gsm/src/util/shell.c
===================================================================
--- gsm.orig/src/util/shell.c 2007-09-17 23:57:51.000000000 +0800
+++ gsm/src/util/shell.c 2007-09-17 23:59:04.000000000 +0800
@@ -34,8 +34,6 @@
#include <gsmd/usock.h>
#include <gsmd/ts0705.h>
-#include <common/linux_list.h>
-
#ifndef __GSMD__
#define __GSMD__
#include <gsmd/talloc.h>
@@ -43,9 +41,8 @@
#endif
#define STDIN_BUF_SIZE 1024
-
-static LLIST_HEAD(storage_list);
-static LLIST_HEAD(phonebook_list);
+static int nFIND = 0;
+static int nREADRG = 0;
/* this is the handler for receiving passthrough responses */
static int pt_msghandler(struct lgsm_handle *lh, struct gsmd_msg_hdr *gmh)
@@ -62,46 +59,23 @@
struct gsmd_phonebook_storage *gpst;
char *payload;
char *fcomma, *lcomma, *ptr = NULL;
+ int *num;
char buf[128];
+ int i;
switch (gmh->msg_subtype) {
-#if 0
case GSMD_PHONEBOOK_FIND:
+ num = (int *) ((char *)gmh + sizeof(*gmh));
+ printf("Records:%d\n", *num);
+
+ nFIND = *num;
+ break;
case GSMD_PHONEBOOK_READRG:
- payload = (char *)gmh + sizeof(*gmh);
+ num = (int *) ((char *)gmh + sizeof(*gmh));
+ printf("Records:%d\n", *num);
- if (!strncmp(payload, "+CPBR", 5) ||
- !strncmp(payload, "+CPBF", 5)) {
- gp = (struct gsmd_phonebook *) malloc(sizeof(struct gsmd_phonebook));
- ptr = strchr(payload, ' ');
- gp->index = atoi(ptr+1);
-
- fcomma = strchr(payload, '"');
- lcomma = strchr(fcomma+1, '"');
- strncpy(gp->numb, fcomma + 1, (lcomma-fcomma-1));
- gp->numb[(lcomma - fcomma) - 1] = '\0';
-
- gp->type = atoi(lcomma + 2);
-
- ptr = strrchr(payload, ',');
- fcomma = ptr + 1;
- lcomma = strchr(fcomma + 1, '"');
- strncpy(gp->text, fcomma + 1, (lcomma - fcomma - 1));
- gp->text[(lcomma - fcomma) - 1] = '\0';
-
- llist_add_tail(&gp->list, &phonebook_list);
-
-#if 0
- llist_for_each_entry(gp, &phonebook_list, list) {
- printf("%d, %s, %d, %s\n", gp->index, gp->numb, gp->type, gp->text);
- }
-#endif
- printf("%d, %s, %d, %s\n", gp->index, gp->numb, gp->type, gp->text);
- }
- else
- printf("%s\n", payload);
+ nREADRG = *num;
break;
-#endif
case GSMD_PHONEBOOK_READ:
gp = (struct gsmd_phonebook *) ((char *)gmh + sizeof(*gmh));
if (gp->index)
@@ -115,48 +89,18 @@
gps = (struct gsmd_phonebook_support *) ((char *)gmh + sizeof(*gmh));
printf("(1-%d), %d, %d\n", gps->index, gps->nlength, gps->tlength);
break;
-#if 0
- case GSMD_PHONEBOOK_LIST_STORAGE:
- payload = (char *)gmh + sizeof(*gmh);
- if (!strncmp(payload, "+CPBS", 5)) {
- char* delim = "(,";
- struct gsmd_phonebook_storage *cur, *cur2;
-
- /* Remove previous record */
- if (!llist_empty(&storage_list)) {
- llist_for_each_entry_safe(cur, cur2,
- &storage_list, list) {
- llist_del(&cur->list);
- talloc_free(cur);
- }
- }
-
- ptr = strpbrk(payload, delim);
-
- while ( ptr ) {
- gpst = (struct gsmd_phonebook_storage *) malloc(sizeof(struct gsmd_phonebook_storage));
- strncpy(gpst->storage, ptr+2, 2);
- gpst->storage[2] = '\0';
-
- ptr = strpbrk(ptr+2, delim);
-
- llist_add_tail(&gpst->list, &storage_list);
- }
+ case GSMD_PHONEBOOK_LIST_STORAGE:
+ gpst = (struct gsmd_phonebook_storage *)((char *)gmh + sizeof(*gmh));
- if (llist_empty(&storage_list))
- return 0;
+ for (i = 0; i < gpst->num; i++) {
+ printf("%s, ", gpst->mem[i].type);
+ }
- llist_for_each_entry(cur, &storage_list, list) {
- printf("\n%s",cur->storage);
- }
+ printf("\n");
- printf("\n");
- }
- else
- printf("%s\n", payload);
break;
-#endif
+
case GSMD_PHONEBOOK_WRITE:
case GSMD_PHONEBOOK_DELETE:
case GSMD_PHONEBOOK_SET_STORAGE:
@@ -164,6 +108,26 @@
payload = (char *)gmh + sizeof(*gmh);
printf("%s\n", payload);
break;
+ case GSMD_PHONEBOOK_RETRIEVE_READRG:
+ gp = (struct gsmd_phonebook *) ((char *)gmh + sizeof(*gmh));
+
+ for (i=0; i<nREADRG; i++) {
+ printf("%d,%s,%d,%s\n", gp->index, gp->numb, gp->type, gp->text);
+ gp++;
+ }
+
+ nREADRG = 0;
+ break;
+ case GSMD_PHONEBOOK_RETRIEVE_FIND:
+ gp = (struct gsmd_phonebook *) ((char *)gmh + sizeof(*gmh));
+
+ for (i = 0; i < nFIND; i++) {
+ printf("%d,%s,%d,%s\n", gp->index, gp->numb, gp->type, gp->text);
+ gp++;
+ }
+
+ nFIND = 0;
+ break;
default:
return -EINVAL;
}
@@ -381,11 +345,13 @@
"\tpd\tPB Delete (pb=index)\n"
"\tpr\tPB Read (pr=index)\n"
"\tprr\tPB Read Range (prr=index1,index2)\n"
- "\tpf\tPB Find (pff=indtext)\n"
+ "\tpf\tPB Find (pf=indtext)\n"
"\tpw\tPB Write (pw=index,number,text)\n"
"\tps\tPB Support\n"
"\tpm\tPB Memory\n"
"\tpp\tPB Set Memory (pp=storage)\n"
+ "\tpRr\tRetrieve Readrg Records\n"
+ "\tpRf\tRetrieve Find Records\n"
"\tsd\tSMS Delete (sd=index,delflg)\n"
"\tsl\tSMS List (sl=stat)\n"
"\tsr\tSMS Read (sr=index)\n"
@@ -509,48 +475,21 @@
printf("Delete Phonebook Entry\n");
ptr = strchr(buf, '=');
lgsm_pb_del_entry(lgsmh, atoi(ptr+1));
-#if 0
} else if ( !strncmp(buf, "prr", 3)) {
printf("Read Phonebook Entries\n");
struct lgsm_phonebook_readrg pb_readrg;
- struct gsmd_phonebook *gp_cur, *gp_cur2;
-
- /* Remove records */
- if (!llist_empty(&phonebook_list)) {
- llist_for_each_entry_safe(gp_cur,
- gp_cur2,
- &phonebook_list,
- list) {
- llist_del(&gp_cur->list);
- talloc_free(gp_cur);
- }
- }
ptr = strchr(buf, '=');
pb_readrg.index1 = atoi(ptr+1);
ptr = strchr(buf, ',');
pb_readrg.index2 = atoi(ptr+1);
lgsm_pb_read_entries(lgsmh, &pb_readrg);
-#endif
} else if ( !strncmp(buf, "pr", 2)) {
ptr = strchr(buf, '=');
lgsm_pb_read_entry(lgsmh, atoi(ptr+1));
-#if 0
} else if ( !strncmp(buf, "pf", 2)) {
printf("Find Phonebook Entry\n");
struct lgsm_phonebook_find pb_find;
- struct gsmd_phonebook *gp_cur, *gp_cur2;
-
- /* Remove records */
- if (!llist_empty(&phonebook_list)) {
- llist_for_each_entry_safe(gp_cur,
- gp_cur2,
- &phonebook_list,
- list) {
- llist_del(&gp_cur->list);
- talloc_free(gp_cur);
- }
- }
ptr = strchr(buf, '=');
strncpy(pb_find.findtext,
@@ -559,7 +498,6 @@
pb_find.findtext[strlen(ptr+1)] = '\0';
lgsm_pb_find_entry(lgsmh, &pb_find);
-#endif
} else if ( !strncmp(buf, "pw", 2)) {
printf("Write Phonebook Entry\n");
struct lgsm_phonebook pb;
@@ -591,6 +529,16 @@
} else if ( !strncmp(buf, "ps", 2)) {
printf("Get Phonebook Support\n");
lgsm_pb_get_support(lgsmh);
+ } else if( !strncmp(buf, "pRr", 3) ) {
+ printf("Retrieve Readrg Records\n");
+
+ if ( nREADRG )
+ lgsm_pb_retrieve_readrg(lgsmh, nREADRG);
+ } else if( !strncmp(buf, "pRf", 3) ) {
+ printf("Retrieve Find Records\n");
+
+ if ( nFIND )
+ lgsm_pb_retrieve_find(lgsmh, nFIND);
} else if ( !strncmp(buf, "sd", 2)) {
printf("Delete SMS\n");
struct lgsm_sms_delete sms_del;

View File

@@ -0,0 +1,59 @@
# gsmd This shell script configures for the gsmd init script.
. /etc/init.d/functions
case `machine_id` in
"gta01"|"gta02")
GSMD_OPTS="-s 115200 -F"
if [ -d '/sys/bus/platform/devices/gta01-pm-gsm.0' ] ; then
GSM_POW="/sys/bus/platform/devices/gta01-pm-gsm.0/power_on"
GSM_RES="/sys/bus/platform/devices/gta01-pm-gsm.0/reset"
else
GSM_POW="/sys/bus/platform/devices/neo1973-pm-gsm.0/power_on"
GSM_RES="/sys/bus/platform/devices/neo1973-pm-gsm.0/reset"
fi
GSM_DEV="/dev/ttySAC0"
GSM_DL="/sys/devices/platform/neo1973-pm-gsm.0/download"
;;
"htc_apache"|"htc_blueangel"|"htc_universal")
GSMD_OPTS="-s 115200 -F"
GSM_DEV="/dev/ttyS0"
;;
"htc_himalaya")
GSMD_OPTS="-s 115200 -F"
GSM_DEV="/dev/ttyS2"
;;
"htc_magician")
GSMD_OPTS="-s 115200 -F"
GSM_DEV="/dev/ttyS1"
;;
"palm_treo_650")
GSMD_OPTS="-s 460800 -F -w 1"
GSM_DEV="/dev/ttyS0"
;;
"motorola_ezx_platform")
GSMD_OPTS="-s 115200 -F -v ti"
GSM_DEV="/dev/mux0"
;;
"omap3430_ldp_board")
# Need a machine for the Zoom modem, but this will do
GSMD_OPTS="-s 460800 -F -v ti -m gta01"
GSM_DEV="/dev/ttyS0"
;;
*)
# Unknown board
# If you must specify special options, uncomment and modify the next line
#GSMD_OPTS="-s 115200 -F"
# If your GSM device needs to be powered up, uncomment and modify the next line
#GSM_POW="/sys/bus/platform/devices/gta01-pm-gsm.0/power_on"
# If your GSM device then needs to be reset, uncomment and modify the next line
#GSM_RES="/sys/bus/platform/devices/gta01-pm-gsm.0/reset"
# This should be in a common /etc/default/serial, together with
# BT_DEV and IR_DEV for devices that have those on a serial port
#GSM_DEV="/dev/ttyS1"
;;
esac

View File

@@ -0,0 +1,23 @@
Index: src/gsmd/gsmd.c
===================================================================
--- a/src/gsmd/gsmd.c (revision 4304)
+++ b/src/gsmd/gsmd.c (working copy)
@@ -196,13 +196,13 @@
sms_cb_init(gsmd);
- if (gsmd->vendorpl && gsmd->vendorpl->initsettings){
+ if (gsmd->vendorpl && gsmd->vendorpl->initsettings)
rc |= gsmd->vendorpl->initsettings(gsmd);
+
+ if (gsmd->machinepl && gsmd->machinepl->initsettings)
rc |= gsmd->machinepl->initsettings(gsmd);
- return rc;
- }
- else
- return rc;
+
+ return rc;
}
static int firstcmd_response = 0;

View File

@@ -0,0 +1,47 @@
#! /bin/sh
#
# gsmd This shell script starts and stops gsmd.
#
# chkconfig: 345 90 40
# description: Gsmd manages access to a serial- or USB-connected GSM
# processname: gsmd
PATH=/bin:/usr/bin:/sbin:/usr/sbin
[ -f /etc/default/rcS ] && . /etc/default/rcS
[ -f /etc/default/gsmd ] && . /etc/default/gsmd
case "$1" in
start)
[ -n "$GSM_POW" ] && ( echo "0" >$GSM_POW; sleep 1 )
[ -n "$GSM_POW" ] && ( echo "1" >$GSM_POW; sleep 1 )
[ -n "$GSM_RES" ] && ( echo "1" >$GSM_RES; sleep 1 )
[ -n "$GSM_RES" ] && ( echo "0" >$GSM_RES; sleep 2 )
echo -n "Starting GSM daemon: "
start-stop-daemon -S -x /usr/sbin/gsmd -- gsmd -p $GSM_DEV $GSMD_OPTS -d -l syslog
if [ $? = 0 ]; then
echo "gsmd."
else
echo "(failed.)"
fi
;;
stop)
[ -n "$GSM_POW" ] && echo "0" >$GSM_POW
echo -n "Stopping GSM daemon: "
start-stop-daemon -K -x /usr/sbin/gsmd
echo "gsmd."
;;
restart|force-reload)
$0 stop
$0 start
;;
*)
echo "Usage: /etc/init.d/gsmd {start|stop|restart|force-reload}"
exit 1
;;
esac
exit 0

View File

@@ -0,0 +1,11 @@
Index: gsm/include/gsmd/Makefile.am
===================================================================
--- gsm.orig/include/gsmd/Makefile.am 2007-10-29 21:05:57.000000000 +0100
+++ gsm/include/gsmd/Makefile.am 2007-10-29 21:06:03.000000000 +0100
@@ -1,4 +1,4 @@
-pkginclude_HEADERS = event.h usock.h
+pkginclude_HEADERS = event.h ts0705.h ts0707.h usock.h
-noinst_HEADERS = atcmd.h gsmd.h select.h ts0705.h ts0707.h unsolicited.h usock.h vendorplugin.h
+noinst_HEADERS = atcmd.h gsmd.h select.h unsolicited.h usock.h vendorplugin.h

View File

@@ -0,0 +1,11 @@
--- gsm/src/libgsmd/libgsmd.c.orig 2007-09-25 00:41:56.000000000 -0500
+++ gsm/src/libgsmd/libgsmd.c 2007-09-25 00:43:44.000000000 -0500
@@ -210,7 +210,7 @@
pos += rc;
}
}
- return 0;
+ return (sizeof(*gmh) + gmh->len);
}
struct gsmd_msg_hdr *lgsm_gmh_fill(int type, int subtype, int payload_len)

View File

@@ -0,0 +1,93 @@
DESCRIPTION = "GSM libraries and daemons implementing the 07.10 specification"
HOMEPAGE = "http://www.openmoko.org"
LICENSE = "GPL LGPL"
SECTION = "libs/gsm"
PROVIDES += "gsmd"
RPROVIDES_${PN} = "libgsmd0 libgsmd gsmd gsmd-devel"
PV = "0.1+svnr${SRCREV}"
PR = "r47"
SRC_URI = "svn://svn.openmoko.org/trunk/src/target;module=gsm;proto=http \
file://fix_machine_init.patch;patch=1 \
file://gsmd \
file://default"
S = "${WORKDIR}/gsm"
inherit autotools pkgconfig update-rc.d
# handle update-rc.d RDEPENDS manually, we don't need it on
# anything but gsmd
RDEPENDS_append = ""
INITSCRIPT_NAME = "gsmd"
INITSCRIPT_PARAMS = "defaults 35"
do_install_append() {
install -d ${D}/${sysconfdir}/init.d
install -m 0755 ${WORKDIR}/gsmd ${D}/${sysconfdir}/init.d/
install -d ${D}/${sysconfdir}/default
install ${WORKDIR}/default ${D}/${sysconfdir}/default/gsmd
}
PACKAGES =+ "\
${PN}-tools \
${BASEPN}-plugins \
${BASEPN}-plugin-machine-generic \
${BASEPN}-plugin-machine-tihtc \
${BASEPN}-plugin-machine-gta01 \
${BASEPN}-plugin-vendor-bcm \
${BASEPN}-plugin-vendor-qc \
${BASEPN}-plugin-vendor-ti \
${BASEPN}-plugin-vendor-tihtc \
"
ALLOW_EMPTY_${BASEPN}-plugin-machine-gta01 = "1"
RDEPENDS_${BASEPN}-plugins = "\
${BASEPN}-plugin-machine-generic \
${BASEPN}-plugin-machine-tihtc \
${BASEPN}-plugin-machine-gta01 \
${BASEPN}-plugin-vendor-bcm \
${BASEPN}-plugin-vendor-qc \
${BASEPN}-plugin-vendor-ti \
${BASEPN}-plugin-vendor-tihtc \
"
RDEPENDS_${PN} += "update-rc.d initscripts"
RRECOMMENDS_${PN} += "${BASEPN}-plugins"
FILES_${PN}-dbg += "${libdir}/gsmd/.debug/*"
FILES_${PN}-tools = "${bindir}/*"
FILES_${BASEPN}-plugins = ""
FILES_${BASEPN}-plugin-machine-generic = "${libdir}/gsmd/libgsmd-machine_generic.so*"
FILES_${BASEPN}-plugin-machine-tihtc = "${libdir}/gsmd/libgsmd-machine_tihtc.so*"
FILES_${BASEPN}-plugin-machine-gta01 = "${libdir}/gsmd/libgsmd-machine_gta01.so*"
FILES_${BASEPN}-plugin-vendor-qc = "${libdir}/gsmd/libgsmd-vendor_qc.so*"
FILES_${BASEPN}-plugin-vendor-bcm = "${libdir}/gsmd/libgsmd-vendor_bcm.so*"
FILES_${BASEPN}-plugin-vendor-ti = "${libdir}/gsmd/libgsmd-vendor_ti.so*"
FILES_${BASEPN}-plugin-vendor-tihtc = "${libdir}/gsmd/libgsmd-vendor_tihtc.so*"
PACKAGES_DYNAMIC = "lib${BASEPN}* ${BASEPN}"
ALLOW_EMPTY_${BASEPN}-plugins = "1"
RCONFLICTS_lib${BASEPN} = "lib${CONFLICTNAME}"
RCONFLICTS_${BASEPN} = "${CONFLICTNAME}"
RCONFLICTS_${BASEPN}-plugins = "${CONFLICTNAME}-plugins"
RCONFLICTS_${BASEPN}-plugin-machine-generic = "${CONFLICTNAME}-plugin-machine-generic"
RCONFLICTS_${BASEPN}-plugin-machine-tihtc = "${CONFLICTNAME}-plugin-machine-tihtc"
RCONFLICTS_${BASEPN}-plugin-machine-gta01 = "${CONFLICTNAME}-plugin-machine-gta01"
RCONFLICTS_${BASEPN}-plugin-vendor-qc = "${CONFLICTNAME}-plugin-vendor-qc"
RCONFLICTS_${BASEPN}-plugin-vendor-bcm = "${CONFLICTNAME}-plugin-vendor-bcm"
RCONFLICTS_${BASEPN}-plugin-vendor-ti = "${CONFLICTNAME}-plugin-vendor-ti"
RCONFLICTS_${BASEPN}-plugin-vendor-tihtc = "${CONFLICTNAME}-plugin-vendor-tihtc"
RPROVIDES_lib${BASEPN} += "lib${CONFLICTNAME}"
RPROVIDES_${BASEPN} = "${CONFLICTNAME}"
RPROVIDES_${BASEPN}-plugins = "${CONFLICTNAME}-plugins"
RPROVIDES_${BASEPN}-plugin-machine-generic = "${CONFLICTNAME}-plugin-machine-generic"
RPROVIDES_${BASEPN}-plugin-machine-tihtc = "${CONFLICTNAME}-plugin-machine-tihtc"
RPROVIDES_${BASEPN}-plugin-machine-gta01 = "${CONFLICTNAME}-plugin-machine-gta01"
RPROVIDES_${BASEPN}-plugin-vendor-qc = "${CONFLICTNAME}-plugin-vendor-qc"
RPROVIDES_${BASEPN}-plugin-vendor-bcm = "${CONFLICTNAME}-plugin-vendor-bcm"
RPROVIDES_${BASEPN}-plugin-vendor-ti = "${CONFLICTNAME}-plugin-vendor-ti"
RPROVIDES_${BASEPN}-plugin-vendor-tihtc = "${CONFLICTNAME}-plugin-vendor-tihtc"

View File

@@ -0,0 +1,5 @@
BASEPN = "gsmd"
CONFLICTNAME = "gsmd-devel"
require gsmd.inc

View File

@@ -0,0 +1,61 @@
# borrow from OE, to handle cross compile mess
#
# ktian1, 06/28/2010
Index: iproute2-2.6.34/configure
===================================================================
--- iproute2-2.6.34.orig/configure
+++ iproute2-2.6.34/configure
@@ -4,7 +4,7 @@
INCLUDE=${1:-"$PWD/include"}
TABLES=
-
+SYSROOT=$1
check_atm()
{
cat >/tmp/atmtest.c <<EOF
@@ -15,7 +15,7 @@ int main(int argc, char **argv) {
return 0;
}
EOF
-gcc -I$INCLUDE -o /tmp/atmtest /tmp/atmtest.c -latm >/dev/null 2>&1
+$CC -I$INCLUDE -o /tmp/atmtest /tmp/atmtest.c -latm >/dev/null 2>&1
if [ $? -eq 0 ]
then
echo "TC_CONFIG_ATM:=y" >>Config
@@ -49,7 +49,7 @@ int main(int argc, char **argv)
EOF
-if gcc -I$INCLUDE $IPTC -o /tmp/ipttest /tmp/ipttest.c $IPTL -ldl -lxtables >/dev/null 2>&1
+if $CC -I$INCLUDE $IPTC -o /tmp/ipttest /tmp/ipttest.c $IPTL -ldl -lxtables >/dev/null 2>&1
then
echo "TC_CONFIG_XT:=y" >>Config
echo "using xtables"
@@ -86,7 +86,7 @@ int main(int argc, char **argv) {
}
EOF
-gcc -I$INCLUDE $IPTC -o /tmp/ipttest /tmp/ipttest.c $IPTL -ldl >/dev/null 2>&1
+$CC -I$INCLUDE $IPTC -o /tmp/ipttest /tmp/ipttest.c $IPTL -ldl >/dev/null 2>&1
if [ $? -eq 0 ]
then
@@ -126,7 +126,7 @@ int main(int argc, char **argv) {
}
EOF
-gcc -I$INCLUDE $IPTC -o /tmp/ipttest /tmp/ipttest.c $IPTL -ldl >/dev/null 2>&1
+$CC -I$INCLUDE $IPTC -o /tmp/ipttest /tmp/ipttest.c $IPTL -ldl >/dev/null 2>&1
if [ $? -eq 0 ]
then
@@ -150,7 +150,7 @@ check_ipt()
check_ipt_lib_dir()
{
IPT_LIB_DIR=""
- for dir in /lib /usr/lib /usr/local/lib
+ for dir in $SYSROOT/lib $SYSROOT/usr/lib $SYSROOT/usr/local/lib
do
for file in $dir/$TABLES/lib*t_*so ; do
if [ -f $file ]; then

View File

@@ -0,0 +1,27 @@
DESCRIPTION = "kernel routing and traffic control utilities"
HOMEPAGE = "http://www.linuxfoundation.org/collaborate/workgroups/networking/iproute2"
SECTION = "base"
LICENSE = "GPLv2+"
LIC_FILES_CHKSUM = "file://COPYING;md5=eb723b61539feef013de476e68b5c50a \
file://ip/ip.c;md5=186731afa4b42e30b9b37efa4ec90b93"
DEPENDS = "flex-native bison-native"
inherit update-alternatives
EXTRA_OEMAKE = "CC='${CC}' KERNEL_INCLUDE=${STAGING_KERNEL_DIR}/include DOCDIR=${docdir}/iproute2 SUBDIRS='lib tc ip' SBINDIR=/sbin"
do_install () {
oe_runmake DESTDIR=${D} install
mv ${D}${base_sbindir}/ip ${D}${base_sbindir}/ip.iproute2
install -d ${D}${datadir}
mv ${D}/share/* ${D}${datadir}/ || true
rm ${D}/share -rf || true
}
FILES_${PN} += "/usr/lib/tc/*"
FILES_${PN}-dbg += "/usr/lib/tc/.debug"
ALTERNATIVE_NAME = "ip"
ALTERNATIVE_PATH = "${base_sbindir}/ip.iproute2"
ALTERNATIVE_LINK = "${base_bindir}/ip"
ALTERNATIVE_PRIORITY = "100"

View File

@@ -0,0 +1,6 @@
require iproute2.inc
PR = "r0"
SRC_URI = "http://developer.osdl.org/dev/iproute2/download/${P}.tar.bz2 \
file://configure-cross.patch"

View File

@@ -0,0 +1,18 @@
---
configure.ac | 1 +
1 file changed, 1 insertion(+)
--- libetpan-0.54.orig/configure.ac
+++ libetpan-0.54/configure.ac
@@ -104,10 +104,11 @@ if test "$have_w32_system" = yes; then
fi
AM_CONDITIONAL(HAVE_MINGW32_SYSTEM, test "$have_w32_system" = yes)
# Check the C compiler.
AC_PROG_CC
+AC_PROG_CXX
# Compiler flags.
AC_ARG_ENABLE(debug, [ --enable-debug setup flags (gcc) for debugging (default=no)],
if test "x$GCC" = xyes; then
CFLAGS="$CFLAGS -O2 -g"

View File

@@ -0,0 +1,19 @@
DESCRIPTION = "libetpan is a library for communicating with mail and news servers. \
It supports the protocols SMTP, POP3, IMAP and NNTP."
HOMEPAGE = "http://www.etpan.org"
SECTION = "libs"
DEPENDS = "curl expat gnutls"
LICENSE = "BSD"
PR = "r1"
SRC_URI = "${SOURCEFORGE_MIRROR}/libetpan/libetpan-${PV}.tar.gz \
file://cxx-is-here.patch;patch=1"
inherit autotools pkgconfig gettext binconfig
EXTRA_OECONF = "--without-openssl --with-gnutls --disable-db"
PARALLEL_MAKE = ""
FILES_${PN} = "${libdir}/lib*.so.*"
FILES_${PN}-dev = "${bindir} ${includedir} ${libdir}/lib*.so ${libdir}/*.la ${libdir}/*.a ${libdir}/pkgconfig"

View File

@@ -0,0 +1,11 @@
--- nss-mdns-0.6/src/nss.c.orig 2005-09-25 17:27:51 +0200
+++ nss-mdns-0.6/src/nss.c 2005-09-25 17:28:55 +0200
@@ -456,6 +456,8 @@
result->h_addrtype = af;
result->h_length = address_length;
+ idx+=(sizeof(char*)-idx%sizeof(char*)); /* Align on 32 bit boundary */
+
/* Check if there's enough space for the addresses */
if (buflen < idx+u.data_len+sizeof(char*)*(u.count+1)) {
*errnop = ERANGE;

View File

@@ -0,0 +1,36 @@
DESCRIPTION = "NSS module for Multicast DNS name resolution"
HOMEPAGE = "http://0pointer.de/lennart/projects/nss-mdns/"
SECTION = "libs"
PRIORITY = "optional"
LICENSE = "LGPLv2.1+"
LIC_FILES_CHKSUM = "file://LICENSE;md5=2d5025d4aa3495befef8f17206a5b0a1"
DEPENDS = "avahi"
RDEPENDS = "avahi-daemon"
PR = "r0"
SRC_URI = "http://0pointer.de/lennart/projects/nss-mdns/nss-mdns-${PV}.tar.gz"
S = "${WORKDIR}/nss-mdns-${PV}"
inherit autotools
# suppress warning, but don't bother with autonamer
LEAD_SONAME = "libnss_mdns.so"
DEBIANNAME_${PN} = "libnss-mdns"
EXTRA_OECONF = "--libdir=/lib --disable-lynx --enable-avahi"
pkg_postinst () {
cat /etc/nsswitch.conf | grep "hosts:\s*files dns$" > /dev/null && {
cat /etc/nsswitch.conf | sed 's/hosts:\s*files dns/& mdns4/' > /tmp/nsswitch.conf
mv /tmp/nsswitch.conf /etc/nsswitch.conf
}
}
pkg_prerm () {
cat /etc/nsswitch.conf | grep "hosts:\s*files dns mdns$" > /dev/null && {
cat /etc/nsswitch.conf | sed 's/\(hosts:\s*files dns\) mdns4*/\1/' > /tmp/nsswitch.conf
mv /tmp/nsswitch.conf /etc/nsswitch.conf
}
}

View File

@@ -0,0 +1,165 @@
diff -ruN libpcap-1.1.1-orig/aclocal.m4 libpcap-1.1.1/aclocal.m4
--- libpcap-1.1.1-orig/aclocal.m4 2010-06-29 10:46:32.815117569 +0800
+++ libpcap-1.1.1/aclocal.m4 2010-06-29 10:49:17.150149949 +0800
@@ -37,7 +37,7 @@
dnl AC_LBL_C_INIT. Now, we run AC_LBL_C_INIT_BEFORE_CC, AC_PROG_CC,
dnl and AC_LBL_C_INIT at the top level.
dnl
-AC_DEFUN(AC_LBL_C_INIT_BEFORE_CC,
+AC_DEFUN([AC_LBL_C_INIT_BEFORE_CC],
[AC_PREREQ(2.50)
AC_BEFORE([$0], [AC_LBL_C_INIT])
AC_BEFORE([$0], [AC_PROG_CC])
@@ -90,7 +90,7 @@
dnl ac_cv_lbl_gcc_vers
dnl LBL_CFLAGS
dnl
-AC_DEFUN(AC_LBL_C_INIT,
+AC_DEFUN([AC_LBL_C_INIT],
[AC_PREREQ(2.50)
AC_BEFORE([$0], [AC_LBL_FIXINCLUDES])
AC_BEFORE([$0], [AC_LBL_DEVEL])
@@ -217,7 +217,7 @@
dnl V_SONAME_OPT
dnl V_RPATH_OPT
dnl
-AC_DEFUN(AC_LBL_SHLIBS_INIT,
+AC_DEFUN([AC_LBL_SHLIBS_INIT],
[AC_PREREQ(2.50)
if test "$GCC" = yes ; then
#
@@ -361,7 +361,7 @@
# Make sure we use the V_CCOPT flags, because some of those might
# disable inlining.
#
-AC_DEFUN(AC_LBL_C_INLINE,
+AC_DEFUN([AC_LBL_C_INLINE],
[AC_MSG_CHECKING(for inline)
save_CFLAGS="$CFLAGS"
CFLAGS="$V_CCOPT"
@@ -407,7 +407,7 @@
dnl
dnl AC_LBL_FIXINCLUDES
dnl
-AC_DEFUN(AC_LBL_FIXINCLUDES,
+AC_DEFUN([AC_LBL_FIXINCLUDES],
[if test "$GCC" = yes ; then
AC_MSG_CHECKING(for ANSI ioctl definitions)
AC_CACHE_VAL(ac_cv_lbl_gcc_fixincludes,
@@ -453,7 +453,7 @@
dnl $2 (yacc appended)
dnl $3 (optional flex and bison -P prefix)
dnl
-AC_DEFUN(AC_LBL_LEX_AND_YACC,
+AC_DEFUN([AC_LBL_LEX_AND_YACC],
[AC_ARG_WITH(flex, [ --without-flex don't use flex])
AC_ARG_WITH(bison, [ --without-bison don't use bison])
if test "$with_flex" = no ; then
@@ -506,7 +506,7 @@
dnl
dnl DECLWAITSTATUS (defined)
dnl
-AC_DEFUN(AC_LBL_UNION_WAIT,
+AC_DEFUN([AC_LBL_UNION_WAIT],
[AC_MSG_CHECKING(if union wait is used)
AC_CACHE_VAL(ac_cv_lbl_union_wait,
AC_TRY_COMPILE([
@@ -535,7 +535,7 @@
dnl
dnl HAVE_SOCKADDR_SA_LEN (defined)
dnl
-AC_DEFUN(AC_LBL_SOCKADDR_SA_LEN,
+AC_DEFUN([AC_LBL_SOCKADDR_SA_LEN],
[AC_MSG_CHECKING(if sockaddr struct has the sa_len member)
AC_CACHE_VAL(ac_cv_lbl_sockaddr_has_sa_len,
AC_TRY_COMPILE([
@@ -560,7 +560,7 @@
dnl
dnl HAVE_SOCKADDR_STORAGE (defined)
dnl
-AC_DEFUN(AC_LBL_SOCKADDR_STORAGE,
+AC_DEFUN([AC_LBL_SOCKADDR_STORAGE],
[AC_MSG_CHECKING(if sockaddr_storage struct exists)
AC_CACHE_VAL(ac_cv_lbl_has_sockaddr_storage,
AC_TRY_COMPILE([
@@ -593,7 +593,7 @@
dnl won't be using code that would use that member, or we wouldn't
dnl compile in any case).
dnl
-AC_DEFUN(AC_LBL_HP_PPA_INFO_T_DL_MODULE_ID_1,
+AC_DEFUN([AC_LBL_HP_PPA_INFO_T_DL_MODULE_ID_1],
[AC_MSG_CHECKING(if dl_hp_ppa_info_t struct has dl_module_id_1 member)
AC_CACHE_VAL(ac_cv_lbl_dl_hp_ppa_info_t_has_dl_module_id_1,
AC_TRY_COMPILE([
@@ -619,7 +619,7 @@
dnl
dnl ac_cv_lbl_have_run_path (yes or no)
dnl
-AC_DEFUN(AC_LBL_HAVE_RUN_PATH,
+AC_DEFUN([AC_LBL_HAVE_RUN_PATH],
[AC_MSG_CHECKING(for ${CC-cc} -R)
AC_CACHE_VAL(ac_cv_lbl_have_run_path,
[echo 'main(){}' > conftest.c
@@ -644,7 +644,7 @@
dnl
dnl LBL_ALIGN (DEFINED)
dnl
-AC_DEFUN(AC_LBL_UNALIGNED_ACCESS,
+AC_DEFUN([AC_LBL_UNALIGNED_ACCESS],
[AC_MSG_CHECKING(if unaligned accesses fail)
AC_CACHE_VAL(ac_cv_lbl_unaligned_fail,
[case "$host_cpu" in
@@ -749,7 +749,7 @@
dnl HAVE_OS_PROTO_H (defined)
dnl os-proto.h (symlinked)
dnl
-AC_DEFUN(AC_LBL_DEVEL,
+AC_DEFUN([AC_LBL_DEVEL],
[rm -f os-proto.h
if test "${LBL_CFLAGS+set}" = set; then
$1="$$1 ${LBL_CFLAGS}"
@@ -886,7 +886,7 @@
dnl statically and happen to have a libresolv.a lying around (and no
dnl libnsl.a).
dnl
-AC_DEFUN(AC_LBL_LIBRARY_NET, [
+AC_DEFUN([AC_LBL_LIBRARY_NET], [
# Most operating systems have gethostbyname() in the default searched
# libraries (i.e. libc):
# Some OSes (eg. Solaris) place it in libnsl
@@ -909,7 +909,7 @@
dnl Test for __attribute__
dnl
-AC_DEFUN(AC_C___ATTRIBUTE__, [
+AC_DEFUN([AC_C___ATTRIBUTE__], [
AC_MSG_CHECKING(for __attribute__)
AC_CACHE_VAL(ac_cv___attribute__, [
AC_COMPILE_IFELSE(
@@ -947,7 +947,7 @@
dnl
dnl -Scott Barron
dnl
-AC_DEFUN(AC_LBL_TPACKET_STATS,
+AC_DEFUN([AC_LBL_TPACKET_STATS],
[AC_MSG_CHECKING(if if_packet.h has tpacket_stats defined)
AC_CACHE_VAL(ac_cv_lbl_tpacket_stats,
AC_TRY_COMPILE([
@@ -976,7 +976,7 @@
dnl doesn't have that member (which is OK, as either we won't be using
dnl code that would use that member, or we wouldn't compile in any case).
dnl
-AC_DEFUN(AC_LBL_LINUX_TPACKET_AUXDATA_TP_VLAN_TCI,
+AC_DEFUN([AC_LBL_LINUX_TPACKET_AUXDATA_TP_VLAN_TCI],
[AC_MSG_CHECKING(if tpacket_auxdata struct has tp_vlan_tci member)
AC_CACHE_VAL(ac_cv_lbl_dl_hp_ppa_info_t_has_dl_module_id_1,
AC_TRY_COMPILE([
@@ -1003,7 +1003,7 @@
dnl
dnl HAVE_DLPI_PASSIVE (defined)
dnl
-AC_DEFUN(AC_LBL_DL_PASSIVE_REQ_T,
+AC_DEFUN([AC_LBL_DL_PASSIVE_REQ_T],
[AC_MSG_CHECKING(if dl_passive_req_t struct exists)
AC_CACHE_VAL(ac_cv_lbl_has_dl_passive_req_t,
AC_TRY_COMPILE([

View File

@@ -0,0 +1,22 @@
Index: libpcap-1.0.0/pcap-linux.c
===================================================================
--- libpcap-1.0.0.orig/pcap-linux.c 2009-01-28 11:58:54.000000000 +0300
+++ libpcap-1.0.0/pcap-linux.c 2009-01-28 11:59:04.000000000 +0300
@@ -1616,6 +1616,17 @@
* so let's use "Linux-cooked" mode. Jean II */
//handle->md.cooked = 1;
break;
+#ifndef ARPHRD_IEEE80215
+#define ARPHRD_IEEE80215 804
+#endif
+#ifndef ARPHRD_IEEE80215_PHY
+#define ARPHRD_IEEE80215_PHY 805
+#endif
+
+ case ARPHRD_IEEE80215:
+ case ARPHRD_IEEE80215_PHY:
+ handle->linktype = DLT_IEEE802_15_4;
+ break;
/* ARPHRD_LAPD is unofficial and randomly allocated, if reallocation
* is needed, please report it to <daniele@orlandi.com> */

View File

@@ -0,0 +1,24 @@
DESCRIPTION = "Libpcap is a tool to capture network packages on Unix/Linux platform"
HOMEPAGE = "http://www.tcpdump.org/"
BUGTRACKER = "http://sourceforge.net/tracker/?group_id=53067&atid=469577"
SECTION = "libs/network"
LICENSE = "BSD"
LIC_FILES_CHKSUM = "file://LICENSE;md5=1d4b0366557951c84a94fabe3529f867 \
file://pcap.h;beginline=1;endline=34;md5=8d6cf7e17d5745010d633e30bc529ea9"
DEPENDS = "flex-native bison-native"
SRC_URI = "http://www.tcpdump.org/release/libpcap-${PV}.tar.gz"
inherit autotools
EXTRA_OECONF = "--with-pcap=linux"
CPPFLAGS_prepend = "-I${S} "
CFLAGS_prepend = "-I${S} "
CXXFLAGS_prepend = "-I${S} "
do_configure_prepend () {
if [ ! -e acinclude.m4 ]; then
cat aclocal.m4 > acinclude.m4
fi
}

View File

@@ -0,0 +1,17 @@
require libpcap.inc
PR = "r0"
SRC_URI += "file://aclocal.patch \
file://ieee80215-arphrd.patch"
#
# make install doesn't cover the shared lib
# make install-shared is just broken (no symlinks)
#
do_install_prepend () {
install -d ${D}${libdir}
install -d ${D}${bindir}
oe_runmake install-shared DESTDIR=${D}
oe_libinstall -a -so libpcap ${D}${libdir}
}

View File

@@ -0,0 +1,22 @@
DESCRIPTION = "Network suspend/resume scripts"
SECTION = "base"
LICENSE = "GPLv2"
PV = "1.1"
PR = "r2"
SRC_URI = "file://ifupdown \
file://usbnet"
do_install() {
install -d ${D}${sysconfdir}/apm/scripts.d
install -m 0755 ${WORKDIR}/ifupdown ${D}${sysconfdir}/apm/scripts.d
install -m 0755 ${WORKDIR}/usbnet ${D}${sysconfdir}/apm/scripts.d
install -d ${D}${sysconfdir}/apm/suspend.d
ln -s ../scripts.d/ifupdown ${D}${sysconfdir}/apm/suspend.d/05ifupdown
ln -s ../scripts.d/usbnet ${D}${sysconfdir}/apm/suspend.d/10usbnet
install -d ${D}${sysconfdir}/apm/resume.d
ln -sf ../scripts.d/ifupdown ${D}${sysconfdir}/apm/resume.d/30ifupdown
ln -sf ../scripts.d/usbnet ${D}${sysconfdir}/apm/resume.d/20usbnet
}
FILES = "${sysconfdir}/apm"

View File

@@ -0,0 +1,26 @@
#!/bin/sh
# Unloads/loads all interface that are up at time of suspend
if [ "$1" = suspend ]; then
rm -f /var/run/ifstate-suspend
rm -f /var/run/ifstate-old
cp /var/run/ifstate /var/run/ifstate-old
cat /var/run/ifstate-old | (
IFS="="
while read IFACE LOGICAL; do
ifdown $IFACE
echo "$IFACE=$LOGICAL" >>/var/run/ifstate-suspend
done
rm -f /var/run/ifstate-old
)
elif [ "$1" = resume ] && [ "$2" != standby ] && [ -f /var/run/ifstate-suspend ]; then
cat /var/run/ifstate-suspend | (
while read LINE; do
ifup $LINE
done
)
rm -f /var/run/ifstate-suspend
fi
: exit 0

View File

@@ -0,0 +1,16 @@
#!/bin/sh
# Unloads/loads usb-eth so it always works
. /etc/default/usbd
if [ "$1" = suspend ]; then
rmmod usb-eth
rmmod sa1100usb_core
elif [ "$1" = resume ] && [ "$2" != standby ]; then
modprobe usb-eth
modprobe -r $usbdmodule
modprobe $usbdmodule
fi
: exit 0

View File

@@ -0,0 +1,13 @@
DESCRIPTION = "nfs idmapping library"
HOMEPAGE = "http://www.citi.umich.edu/projects/nfsv4/linux/"
SECTION = "libs"
LICENSE = "BSD"
LIC_FILES_CHKSUM = "file://COPYING;md5=d9c6a2a0ca6017fda7cd905ed2739b37"
PR = "r0"
SRC_URI = "http://www.citi.umich.edu/projects/nfsv4/linux/libnfsidmap/${BPN}-${PV}.tar.gz"
inherit autotools
EXTRA_OECONF = "--disable-ldap"

View File

@@ -0,0 +1,18 @@
--- ./support/nfs/svc_socket.c.orig 2004-12-12 06:43:52.000000000 +0000
+++ ./support/nfs/svc_socket.c 2004-12-12 06:50:04.000000000 +0000
@@ -66,6 +66,7 @@
memset ((char *) &addr, sizeof (addr));
addr.sin_family = AF_INET;
+#ifndef __UCLIBC__ /* neither getrpcbynumber() nor getrpcbynumber_r() is SuSv3 */
ret = getrpcbynumber_r (number, &rpcbuf, rpcdata, sizeof rpcdata,
&rpcp);
if (ret == 0 && rpcp != NULL)
@@ -99,6 +100,7 @@
}
}
else
+#endif
{
if (bindresvport (sock, &addr))
{

View File

@@ -0,0 +1,161 @@
#!/bin/sh
### BEGIN INIT INFO
# Provides: nfs-kernel-server
# Required-Start: $remote_fs $portmap hwclock
# Required-Stop: $remote_fs $portmap hwclock
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Kernel NFS server support
# Description: NFS is a popular protocol for file sharing across
# TCP/IP networks. This service provides NFS server
# functionality, which is configured via the
# /etc/exports file.
### END INIT INFO
#
# Startup script for nfs-utils
#
#
# The environment variable NFS_SERVERS may be set in /etc/default/nfsd
# Other control variables may be overridden here too
test -r /etc/default/nfsd && . /etc/default/nfsd
#
# Location of executables:
test -x "$NFS_MOUNTD" || NFS_MOUNTD=/usr/sbin/mountd
test -x "$NFS_NFSD" || NFS_NFSD=/usr/sbin/nfsd
test -x "$NFS_STATD" || NFS_STATD=/usr/sbin/statd
#
# The user mode program must also exist (it just starts the kernel
# threads using the kernel module code).
test -x "$NFS_MOUNTD" || exit 0
test -x "$NFS_NFSD" || exit 0
#
# Default is 8 threads, value is settable between 1 and the truely
# ridiculous 99
test "$NFS_SERVERS" -gt 0 && test "$NFS_SERVERS" -lt 100 || NFS_SERVERS=8
#
# The default state directory is /var/lib/nfs
test -n "$NFS_STATEDIR" || NFS_STATEDIR=/var/lib/nfs
#
#----------------------------------------------------------------------
# Startup and shutdown functions.
# Actual startup/shutdown is at the end of this file.
#directories
create_directories(){
echo -n 'creating NFS state directory: '
mkdir -p "$NFS_STATEDIR"
( cd "$NFS_STATEDIR"
umask 077
mkdir -p sm sm.bak
test -w sm/state || {
rm -f sm/state
:>sm/state
}
umask 022
for file in xtab etab smtab rmtab
do
test -w "$file" || {
rm -f "$file"
:>"$file"
}
done
)
echo done
}
#mountd
start_mountd(){
echo -n 'starting mountd: '
start-stop-daemon --start --exec "$NFS_MOUNTD" -- "-f /etc/exports $@"
echo done
}
stop_mountd(){
echo -n 'stopping mountd: '
start-stop-daemon --stop --quiet --exec "$NFS_MOUNTD"
echo done
}
#
#nfsd
start_nfsd(){
echo -n "starting $1 nfsd kernel threads: "
start-stop-daemon --start --exec "$NFS_NFSD" -- "$@"
echo done
}
delay_nfsd(){
for delay in 0 1 2 3 4 5 6 7 8 9
do
if pidof nfsd >/dev/null
then
echo -n .
sleep 1
else
return 0
fi
done
return 1
}
stop_nfsd(){
# WARNING: this kills any process with the executable
# name 'nfsd'.
echo -n 'stopping nfsd: '
start-stop-daemon --stop --quiet --signal 1 --name nfsd
if delay_nfsd || {
echo failed
echo ' using signal 9: '
start-stop-daemon --stop --quiet --signal 9 --name nfsd
delay_nfsd
}
then
echo done
# This will remove, recursively, dependencies
echo -n 'removing nfsd kernel module: '
if modprobe -r nfsd
then
echo done
else
echo failed
fi
else
echo failed
fi
}
#statd
start_statd(){
echo -n "starting statd: "
start-stop-daemon --start --exec "$NFS_STATD"
echo done
}
stop_statd(){
# WARNING: this kills any process with the executable
# name 'statd'.
echo -n 'stopping statd: '
start-stop-daemon --stop --quiet --signal 1 --name statd
echo done
}
#----------------------------------------------------------------------
#
# supported options:
# start
# stop
# reload: reloads the exports file
# restart: stops and starts mountd
#FIXME: need to create the /var/lib/nfs/... directories
case "$1" in
start) create_directories
start_nfsd "$NFS_SERVERS"
start_mountd
start_statd
test -r /etc/exports && exportfs -a;;
stop) exportfs -ua
stop_statd
stop_mountd
stop_nfsd;;
reload) test -r /etc/exports && exportfs -r;;
restart)exportfs -ua
stop_mountd
stop_statd
# restart does not restart the kernel threads,
# only the user mode processes
start_mountd
start_statd
test -r /etc/exports && exportfs -a;;
esac

View File

@@ -0,0 +1,51 @@
DESCRIPTION = "userspace utilities for kernel nfs"
HOMEPAGE = "http://nfs.sourceforge.net/"
SECTION = "console/network"
PRIORITY = "optional"
LICENSE = "GPLv2+"
LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3"
# util-linux for libblkid
DEPENDS = "libcap libnfsidmap libevent util-linux tcp-wrappers"
RDEPENDS = "portmap"
RRECOMMENDS = "kernel-module-nfsd"
PR = "r1"
SRC_URI = "${SOURCEFORGE_MIRROR}/nfs/nfs-utils-${PV}.tar.bz2 \
file://nfs-utils-1.0.6-uclibc.patch \
file://nfsserver"
PARALLEL_MAKE = ""
# Only kernel-module-nfsd is required here (but can be built-in) - the nfsd module will
# pull in the remainder of the dependencies.
INITSCRIPT_NAME = "nfsserver"
# The server has no dependencies at the user run levels, so just put
# it in at the default levels. It must be terminated before the network
# in the shutdown levels, but that works fine.
INITSCRIPT_PARAMS = "defaults"
inherit autotools update-rc.d
# --enable-uuid is need for cross-compiling
EXTRA_OECONF = "--with-statduser=nobody \
--enable-nfsv41 \
--enable-uuid \
--disable-gss \
--disable-tirpc \
--with-statedir=/var/lib/nfs"
INHIBIT_AUTO_STAGE = "1"
do_install_append () {
install -d ${D}${sysconfdir}/init.d
install -m 0755 ${WORKDIR}/nfsserver ${D}${sysconfdir}/init.d/nfsserver
# the following are built by CC_FOR_BUILD
rm -f ${D}${sbindir}/rpcdebug
rm -f ${D}${sbindir}/rpcgen
rm -f ${D}${sbindir}/locktest
}

View File

@@ -0,0 +1,24 @@
The number of colons are important :)
Index: openssl-0.9.8g/Configure
===================================================================
--- openssl-0.9.8g.orig/Configure 2008-04-12 04:27:22.000000000 +0200
+++ openssl-0.9.8g/Configure 2008-04-12 04:38:56.000000000 +0200
@@ -395,6 +395,16 @@
"linux-alpha-ccc","ccc:-fast -readonly_strings -DL_ENDIAN -DTERMIO::-D_REENTRANT:::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL:${no_asm}",
"linux-alpha+bwx-ccc","ccc:-fast -readonly_strings -DL_ENDIAN -DTERMIO::-D_REENTRANT:::SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL:${no_asm}",
+ # Linux on ARM
+"linux-elf-arm","$ENV{'CC'}:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG DES_RISC1::::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+"linux-elf-armeb","$ENV{'CC'}:-DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG DES_RISC1::::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+"linux-gnueabi-arm","$ENV{'CC'}:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG DES_RISC1::::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+"linux-gnueabi-armeb","$ENV{'CC'}:-DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG DES_RISC1::::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+"linux-uclibcgnueabi-arm","$ENV{'CC'}:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG DES_RISC1::::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+"linux-uclibcgnueabi-armeb","$ENV{'CC'}:-DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG DES_RISC1::::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+
+"linux-avr32","$ENV{'CC'}:-DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG DES_RISC1::::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).",
+
#### *BSD [do see comment about ${BSDthreads} above!]
"BSD-generic32","gcc:-DTERMIOS -O3 -fomit-frame-pointer -Wall::${BSDthreads}:::BN_LLONG RC2_CHAR RC4_INDEX DES_INT DES_UNROLL:${no_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"BSD-x86", "gcc:-DL_ENDIAN -DTERMIOS -O3 -fomit-frame-pointer -Wall::${BSDthreads}:::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_out_asm}:dlfcn:bsd-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",

View File

@@ -0,0 +1,20 @@
Index: openssl-0.9.8m/apps/CA.pl.in
===================================================================
--- openssl-0.9.8m.orig/apps/CA.pl.in 2006-04-28 00:28:51.000000000 +0000
+++ openssl-0.9.8m/apps/CA.pl.in 2010-02-27 00:36:51.000000000 +0000
@@ -65,6 +65,7 @@
foreach (@ARGV) {
if ( /^(-\?|-h|-help)$/ ) {
print STDERR "usage: CA -newcert|-newreq|-newreq-nodes|-newca|-sign|-verify\n";
+ print STDERR "usage: CA -signcert certfile keyfile|-newcert|-newreq|-newca|-sign|-verify\n";
exit 0;
} elsif (/^-newcert$/) {
# create a certificate
@@ -165,6 +166,7 @@
} else {
print STDERR "Unknown arg $_\n";
print STDERR "usage: CA -newcert|-newreq|-newreq-nodes|-newca|-sign|-verify\n";
+ print STDERR "usage: CA -signcert certfile keyfile|-newcert|-newreq|-newca|-sign|-verify\n";
exit 1;
}
}

View File

@@ -0,0 +1,15 @@
Index: openssl-0.9.8k/config
===================================================================
--- openssl-0.9.8k.orig/config 2009-02-16 09:43:41.000000000 +0100
+++ openssl-0.9.8k/config 2009-07-19 11:32:41.000000000 +0200
@@ -162,8 +162,8 @@
echo "${MACHINE}-whatever-linux1"; exit 0
;;
- GNU*)
- echo "hurd-x86"; exit 0;
+ GNU:*|GNU/*:*)
+ echo "${MACHINE}-gnuish"; exit 0;
;;
LynxOS:*)

View File

@@ -0,0 +1,54 @@
Index: openssl-0.9.8k/Configure
===================================================================
--- openssl-0.9.8k.orig/Configure 2009-12-09 16:09:41.000000000 +0000
+++ openssl-0.9.8k/Configure 2009-12-09 16:09:55.000000000 +0000
@@ -320,6 +320,49 @@
"osf1-alpha-cc", "cc:-std1 -tune host -O4 -readonly_strings::(unknown):::SIXTY_FOUR_BIT_LONG RC4_CHUNK:${no_asm}:dlfcn:alpha-osf1-shared:::.so",
"tru64-alpha-cc", "cc:-std1 -tune host -fast -readonly_strings::-pthread:::SIXTY_FOUR_BIT_LONG RC4_CHUNK:${no_asm}:dlfcn:alpha-osf1-shared::-msym:.so",
+# Debian GNU/* (various architectures)
+"debian-alpha","gcc:-DTERMIO -O3 -Wa,--noexecstack -g -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_RISC1 DES_UNROLL:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+"debian-alpha-ev4","gcc:-DTERMIO -O3 -Wa,--noexecstack -mcpu=ev4 -g -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_RISC1 DES_UNROLL:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+"debian-alpha-ev5","gcc:-DTERMIO -O3 -Wa,--noexecstack -mcpu=ev5 -g -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_RISC1 DES_UNROLL:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+"debian-arm","gcc:-DL_ENDIAN -DTERMIO -O2 -Wa,--noexecstack -g -Wall::-D_REENTRANT::-ldl:BN_LLONG DES_RISC1::::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+"debian-armeb","gcc:-DB_ENDIAN -DTERMIO -O2 -Wa,--noexecstack -g -Wall::-D_REENTRANT::-ldl:BN_LLONG DES_RISC1::::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+"debian-armel","gcc:-DL_ENDIAN -DTERMIO -O2 -Wa,--noexecstack -g -Wall::-D_REENTRANT::-ldl:BN_LLONG DES_RISC1::::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+#"debian-amd64","gcc:-DL_ENDIAN -DTERMIO -O3 -Wa,--noexecstack -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}::::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+"debian-amd64", "gcc:-m64 -DL_ENDIAN -DTERMIO -O3 -Wa,--noexecstack -g -Wall -DMD32_REG_T=int::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK RC4_CHAR BF_PTR2 DES_INT DES_UNROLL:${x86_64_asm_linux}:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+"debian-avr32", "gcc:-DB_ENDIAN -DTERMIO -O3 -Wa,--noexecstack -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG_BF_PTR::::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+"debian-kfreebsd-amd64","gcc:-m64 -DL_ENDIAN -DTERMIOS -O3 -Wa,--noexecstack -Wall -DMD32_REG_T=int::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK BF_PTR2 DES_INT DES_UNROLL:${x86_64_asm}:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+#"debian-freebsd-alpha","gcc:-DTERMIOS -O -Wa,--noexecstack -fomit-frame-pointer::(unknown):::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_PTR DES_RISC2::::::::::dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+"debian-kfreebsd-i386","gcc:-DL_ENDIAN -DTERMIOS -O3 -Wa,--noexecstack -g -march=i486 -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+"debian-hppa","gcc:-DB_ENDIAN -DTERMIO -O2 -Wa,--noexecstack -g -Wall::-D_REENTRANT::-ldl:BN_LLONG MD2_CHAR RC4_INDEX::::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+"debian-hurd-i386","gcc:-DL_ENDIAN -DTERMIOS -O3 -Wa,--noexecstack -g -mtune=i486 -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+"debian-ia64","gcc:-DTERMIO -O3 -Wa,--noexecstack -g -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK RC4_CHAR:${ia64_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+#"debian-i386","gcc:-DL_ENDIAN -DTERMIO -O3 -Wa,--noexecstack -fomit-frame-pointer -m486 -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}::::::::::dlfcn:linux-shared:-fPIC",
+"debian-i386","gcc:-DL_ENDIAN -DTERMIO -O3 -Wa,--noexecstack -g -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}::::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+"debian-i386-i486","gcc:-DL_ENDIAN -DTERMIO -O3 -march=i486 -Wa,--noexecstack -g -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+"debian-i386-i586","gcc:-DL_ENDIAN -DTERMIO -O3 -march=i586 -Wa,--noexecstack -g -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+"debian-i386-i686/cmov","gcc:-DL_ENDIAN -DTERMIO -O3 -march=i686 -Wa,--noexecstack -g -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+"debian-m68k","gcc:-DB_ENDIAN -DTERMIO -O2 -Wa,--noexecstack -g -Wall::-D_REENTRANT::-ldl:BN_LLONG MD2_CHAR RC4_INDEX::::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+"debian-mips", "gcc:-DB_ENDIAN -DTERMIO -O3 -Wa,--noexecstack -g -Wall::-D_REENTRANT::-ldl:BN_LLONG RC2_CHAR RC4_INDEX DES_INT DES_UNROLL DES_RISC2::::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+"debian-mipsel", "gcc:-DL_ENDIAN -DTERMIO -O3 -Wa,--noexecstack -g -Wall::-D_REENTRANT::-ldl:BN_LLONG RC2_CHAR RC4_INDEX DES_INT DES_UNROLL DES_RISC2::::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+"debian-netbsd-i386", "gcc:-DL_ENDIAN -DTERMIOS -O3 -Wa,--noexecstack -g -m486 -Wall::(unknown):::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}::::::::::::dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+"debian-netbsd-m68k", "gcc:-DB_ENDIAN -DTERMIOS -O3 -Wa,--noexecstack -g -Wall::(unknown):::BN_LLONG MD2_CHAR RC4_INDEX DES_UNROLL::::::::::::dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+"debian-netbsd-sparc", "gcc:-DB_ENDIAN -DTERMIOS -O3 -Wa,--noexecstack -g -mv8 -Wall::(unknown):::BN_LLONG MD2_CHAR RC4_INDEX DES_UNROLL::::::::::::dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+"debian-openbsd-alpha","gcc:-DTERMIOS -O3 -Wa,--noexecstack -g::(unknown):::SIXTY_FOUR_BIT_LONG DES_INT DES_PTR DES_RISC2::::::::::::dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+"debian-openbsd-i386", "gcc:-DL_ENDIAN -DTERMIOS -O3 -Wa,--noexecstack -g -m486::(unknown):::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_out_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+"debian-openbsd-mips","gcc:-O2 -Wa,--noexecstack -g -DL_ENDIAN::(unknown)::BN_LLONG MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC2 DES_PTR BF_PTR:::::::::::::dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+"debian-powerpc","gcc:-DB_ENDIAN -DTERMIO -O3 -Wa,--noexecstack -g -Wall::-D_REENTRANT::-ldl:BN_LLONG DES_UNROLL DES_RISC2 DES_PTR MD2_CHAR RC4_INDEX::linux_ppc32.o::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+"debian-ppc64","gcc:-m64 -DB_ENDIAN -DTERMIO -O3 -Wa,--noexecstack -g -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_RISC1 DES_UNROLL::linux_ppc64.o::::::::::dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+"debian-s390","gcc:-DB_ENDIAN -DTERMIO -O3 -Wa,--noexecstack -g -Wall::-D_REENTRANT::-ldl:BN_LLONG::::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+"debian-sh3", "gcc:-DL_ENDIAN -DTERMIO -O3 -Wa,--noexecstack -g -Wall::-D_REENTRANT::-ldl:BN_LLONG::::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+"debian-sh4", "gcc:-DL_ENDIAN -DTERMIO -O3 -Wa,--noexecstack -g -Wall::-D_REENTRANT::-ldl:BN_LLONG::::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+"debian-sh3eb", "gcc:-DB_ENDIAN -DTERMIO -O3 -Wa,--noexecstack -g -Wall::-D_REENTRANT::-ldl:BN_LLONG::::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+"debian-sh4eb", "gcc:-DB_ENDIAN -DTERMIO -O3 -Wa,--noexecstack -g -Wall::-D_REENTRANT::-ldl:BN_LLONG::::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+"debian-m32r","gcc:-DB_ENDIAN -DTERMIO -O3 -Wa,--noexecstack -g -Wall::-D_REENTRANT::-ldl:BN_LLONG::::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+"debian-sparc","gcc:-DB_ENDIAN -DTERMIO -O3 -Wa,--noexecstack -g -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR::::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+"debian-sparc-v8","gcc:-DB_ENDIAN -DTERMIO -O3 -Wa,--noexecstack -mcpu=v8 -g -Wall -DBN_DIV2W::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR::sparcv8.o:des_enc-sparc.o fcrypt_b.o:::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+"debian-sparc-v9","gcc:-DB_ENDIAN -DTERMIO -O3 -mcpu=v9 -Wa,--noexecstack -Wa,-Av8plus -g -Wall -DULTRASPARC -DBN_DIV2W::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR::sparcv8plus.o:des_enc-sparc.o fcrypt_b.o:::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+"debian-sparc64","gcc:-m64 -DB_ENDIAN -DTERMIO -O3 -Wa,--noexecstack -g -Wall -DULTRASPARC -DBN_DIV2W::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL BF_PTR:::des_enc-sparc.o fcrypt_b.o:::::::::dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+
####
#### Variety of LINUX:-)
####

View File

@@ -0,0 +1,47 @@
Index: openssl-0.9.8m/Makefile.org
===================================================================
--- openssl-0.9.8m.orig/Makefile.org 2010-01-27 16:06:36.000000000 +0000
+++ openssl-0.9.8m/Makefile.org 2010-02-27 00:43:04.000000000 +0000
@@ -620,7 +620,7 @@
install_sw:
@$(PERL) $(TOP)/util/mkdir-p.pl $(INSTALL_PREFIX)$(INSTALLTOP)/bin \
$(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR) \
- $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines \
+ $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/ssl/engines \
$(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig \
$(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl \
$(INSTALL_PREFIX)$(OPENSSLDIR)/misc \
Index: openssl-0.9.8m/engines/Makefile
===================================================================
--- openssl-0.9.8m.orig/engines/Makefile 2009-11-10 01:53:02.000000000 +0000
+++ openssl-0.9.8m/engines/Makefile 2010-02-27 00:45:03.000000000 +0000
@@ -101,13 +101,13 @@
*DSO_DL*) sfx="sl";; \
*) sfx="bad";; \
esac; \
- cp lib$$l.$$sfx $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines/lib$$l.$$sfx.new; \
+ cp lib$$l.$$sfx $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/ssl/engines/lib$$l.$$sfx.new; \
else \
sfx="so"; \
cp cyg$$l.dll $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines/lib$$l.$$sfx.new; \
fi; \
- chmod 555 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines/lib$$l.$$sfx.new; \
- mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines/lib$$l.$$sfx.new $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines/lib$$l.$$sfx ); \
+ chmod 555 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/ssl/engines/lib$$l.$$sfx.new; \
+ mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/ssl/engines/lib$$l.$$sfx.new $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines/lib$$l.$$sfx ); \
done; \
fi
Index: openssl-0.9.8m/Configure
===================================================================
--- openssl-0.9.8m.orig/Configure 2010-02-27 00:40:42.000000000 +0000
+++ openssl-0.9.8m/Configure 2010-02-27 00:46:47.000000000 +0000
@@ -1738,7 +1738,7 @@
# $foo is to become "$prefix/lib$multilib/engines";
# as Makefile.org and engines/Makefile are adapted for
# $multilib suffix.
- my $foo = "$prefix/lib/engines";
+ my $foo = "$prefix/lib/ssl/engines";
$foo =~ s/\\/\\\\/g;
print OUT "#define ENGINESDIR \"$foo\"\n";
}

View File

@@ -0,0 +1,13 @@
Index: openssl-0.9.8k/crypto/perlasm/x86_64-xlate.pl
===================================================================
--- openssl-0.9.8k.orig/crypto/perlasm/x86_64-xlate.pl 2008-02-13 21:01:48.000000000 +0100
+++ openssl-0.9.8k/crypto/perlasm/x86_64-xlate.pl 2009-07-19 11:37:23.000000000 +0200
@@ -62,7 +62,7 @@
my ($outdev,$outino,@junk)=stat($output);
open STDOUT,">$output" || die "can't open $output: $!"
- if ($stddev!=$outdev || $stdino!=$outino);
+# if ($stddev!=$outdev || $stdino!=$outino);
}
my $masmref=8 + 50727*2**-32; # 8.00.50727 shipped with VS2005

View File

@@ -0,0 +1,13 @@
Index: openssl-0.9.8k/Makefile.org
===================================================================
--- openssl-0.9.8k.orig/Makefile.org 2009-07-19 11:32:41.000000000 +0200
+++ openssl-0.9.8k/Makefile.org 2009-07-19 11:37:31.000000000 +0200
@@ -131,7 +131,7 @@
BASEADDR=
-DIRS= crypto fips ssl engines apps test tools
+DIRS= crypto fips ssl engines apps tools
SHLIBDIRS= crypto ssl fips
# dirs in crypto to build

View File

@@ -0,0 +1,13 @@
Index: openssl-0.9.8k/Makefile.org
===================================================================
--- openssl-0.9.8k.orig/Makefile.org 2009-07-19 11:32:41.000000000 +0200
+++ openssl-0.9.8k/Makefile.org 2009-07-19 11:37:29.000000000 +0200
@@ -152,7 +152,7 @@
MAKEFILE= Makefile
-MANDIR=$(OPENSSLDIR)/man
+MANDIR=/usr/share/man
MAN1=1
MAN3=3
MANSUFFIX=

View File

@@ -0,0 +1,32 @@
Index: openssl-0.9.8k/Makefile.org
===================================================================
--- openssl-0.9.8k.orig/Makefile.org 2009-07-19 11:34:06.000000000 +0200
+++ openssl-0.9.8k/Makefile.org 2009-07-19 11:37:21.000000000 +0200
@@ -155,7 +155,8 @@
MANDIR=/usr/share/man
MAN1=1
MAN3=3
-MANSUFFIX=
+MANSUFFIX=ssl
+MANSECTION=SSL
SHELL=/bin/sh
TOP= .
@@ -694,7 +695,7 @@
echo "installing man$$sec/$$fn.$${sec}$(MANSUFFIX)"; \
(cd `$(PERL) util/dirname.pl $$i`; \
sh -c "$$pod2man \
- --section=$$sec --center=OpenSSL \
+ --section=$${sec}$(MANSECTION) --center=OpenSSL \
--release=$(VERSION) `basename $$i`") \
> $(INSTALL_PREFIX)$(MANDIR)/man$$sec/$$fn.$${sec}$(MANSUFFIX); \
$(PERL) util/extract-names.pl < $$i | \
@@ -711,7 +712,7 @@
echo "installing man$$sec/$$fn.$${sec}$(MANSUFFIX)"; \
(cd `$(PERL) util/dirname.pl $$i`; \
sh -c "$$pod2man \
- --section=$$sec --center=OpenSSL \
+ --section=$${sec}$(MANSECTION) --center=OpenSSL \
--release=$(VERSION) `basename $$i`") \
> $(INSTALL_PREFIX)$(MANDIR)/man$$sec/$$fn.$${sec}$(MANSUFFIX); \
$(PERL) util/extract-names.pl < $$i | \

View File

@@ -0,0 +1,13 @@
Index: openssl-0.9.8k/Makefile.shared
===================================================================
--- openssl-0.9.8k.orig/Makefile.shared 2008-09-17 17:56:40.000000000 +0200
+++ openssl-0.9.8k/Makefile.shared 2009-07-19 11:37:25.000000000 +0200
@@ -151,7 +151,7 @@
NOALLSYMSFLAGS='-Wl,--no-whole-archive'; \
SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -Wl,-Bsymbolic -Wl,-soname=$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX"
-DO_GNU_APP=LDFLAGS="$(CFLAGS) -Wl,-rpath,$(LIBRPATH)"
+DO_GNU_APP=LDFLAGS="$(CFLAGS)"
#This is rather special. It's a special target with which one can link
#applications without bothering with any features that have anything to

View File

@@ -0,0 +1,13 @@
Index: openssl-0.9.8k/Makefile.shared
===================================================================
--- openssl-0.9.8k.orig/Makefile.shared 2009-07-19 11:35:02.000000000 +0200
+++ openssl-0.9.8k/Makefile.shared 2009-07-19 11:35:48.000000000 +0200
@@ -149,7 +149,7 @@
SHLIB_SUFFIX=; \
ALLSYMSFLAGS='-Wl,--whole-archive'; \
NOALLSYMSFLAGS='-Wl,--no-whole-archive'; \
- SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -Wl,-Bsymbolic -Wl,-soname=$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX"
+ SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -Wl,-soname=$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX"
DO_GNU_APP=LDFLAGS="$(CFLAGS)"

View File

@@ -0,0 +1,760 @@
From: Kurt Roeckx <kurt@roeckx.be>
Subject: Change the perl path's to /usr/bin/perl
This is the result of running:
perl util/perlpath.pl /usr/bin
The upstream sources have this set to various different paths.
--- openssl-0.9.8m.orig/Configure
+++ openssl-0.9.8m/Configure
@@ -1,4 +1,4 @@
-:
+#!/usr/bin/perl
eval 'exec perl -S $0 ${1+"$@"}'
if $running_under_some_shell;
##
--- openssl-0.9.8m.orig/VMS/VMSify-conf.pl
+++ openssl-0.9.8m/VMS/VMSify-conf.pl
@@ -1,4 +1,4 @@
-#! /usr/bin/perl
+#!/usr/bin/perl
use strict;
use warnings;
--- openssl-0.9.8m.orig/Netware/do_tests.pl
+++ openssl-0.9.8m/Netware/do_tests.pl
@@ -1,4 +1,4 @@
-# perl script to run OpenSSL tests
+#!/usr/bin/perl
my $base_path = "\\openssl";
--- openssl-0.9.8m.orig/apps/progs.pl
+++ openssl-0.9.8m/apps/progs.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/perl
print "/* apps/progs.h */\n";
print "/* automatically generated by progs.pl for openssl.c */\n\n";
--- openssl-0.9.8m.orig/os2/backwardify.pl
+++ openssl-0.9.8m/os2/backwardify.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl -w
+#!/usr/bin/perl
use strict;
# Use as $0
--- openssl-0.9.8m.orig/times/091/mips-rel.pl
+++ openssl-0.9.8m/times/091/mips-rel.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/perl
&doit(100,"Pentium 100 32",0.0195,0.1000,0.6406,4.6100); # pentium-100
&doit(200,"PPro 200 32",0.0070,0.0340,0.2087,1.4700); # pentium-100
--- openssl-0.9.8m.orig/fips/mkfipsscr.pl
+++ openssl-0.9.8m/fips/mkfipsscr.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl -w
+#!/usr/bin/perl
# Quick & dirty utility to generate a script for executing the
# FIPS 140-2 CMVP algorithm tests based on the pathnames of
# input algorithm test files actually present (the unqualified
--- openssl-0.9.8m.orig/fips/fipsalgtest.pl
+++ openssl-0.9.8m/fips/fipsalgtest.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl -w
+#!/usr/bin/perl
# Perl utility to run or verify FIPS 140-2 CMVP algorithm tests based on the
# pathnames of input algorithm test files actually present (the unqualified
# file names are consistent but the pathnames are not).
--- openssl-0.9.8m.orig/ms/uplink.pl
+++ openssl-0.9.8m/ms/uplink.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/env perl
+#!/usr/bin/perl
#
# For Microsoft CL this is implemented as inline assembler. So that
# even though this script can generate even Win32 code, we'll be
--- openssl-0.9.8m.orig/ms/segrenam.pl
+++ openssl-0.9.8m/ms/segrenam.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/env perl
+#!/usr/bin/perl
my $quiet = 1;
--- openssl-0.9.8m.orig/ms/cmp.pl
+++ openssl-0.9.8m/ms/cmp.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/perl
($#ARGV == 1) || die "usage: cmp.pl <file1> <file2>\n";
--- openssl-0.9.8m.orig/test/cms-test.pl
+++ openssl-0.9.8m/test/cms-test.pl
@@ -1,4 +1,4 @@
-# test/cms-test.pl
+#!/usr/bin/perl
# Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
# project.
#
--- openssl-0.9.8m.orig/test/cms-examples.pl
+++ openssl-0.9.8m/test/cms-examples.pl
@@ -1,4 +1,4 @@
-# test/cms-examples.pl
+#!/usr/bin/perl
# Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
# project.
#
--- openssl-0.9.8m.orig/demos/b64.pl
+++ openssl-0.9.8m/demos/b64.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/perl
#
# Make PEM encoded data have lines of 64 bytes of data
--- openssl-0.9.8m.orig/demos/tunala/configure.in
+++ openssl-0.9.8m/demos/tunala/configure.in
@@ -1,4 +1,4 @@
-dnl Process this file with autoconf to produce a configure script.
+#!/usr/bin/perl
AC_INIT(tunala.c)
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE(tunala, 0.0.1-dev)
--- openssl-0.9.8m.orig/crypto/x86cpuid.pl
+++ openssl-0.9.8m/crypto/x86cpuid.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/env perl
+#!/usr/bin/perl
push(@INC,"perlasm");
require "x86asm.pl";
--- openssl-0.9.8m.orig/crypto/x86_64cpuid.pl
+++ openssl-0.9.8m/crypto/x86_64cpuid.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/env perl
+#!/usr/bin/perl
$output=shift;
$masm=1 if ($output =~ /\.asm/);
--- openssl-0.9.8m.orig/crypto/md5/asm/md5-586.pl
+++ openssl-0.9.8m/crypto/md5/asm/md5-586.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/perl
# Normal is the
# md5_block_x86(MD5_CTX *c, ULONG *X);
--- openssl-0.9.8m.orig/crypto/md5/asm/md5-x86_64.pl
+++ openssl-0.9.8m/crypto/md5/asm/md5-x86_64.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl -w
+#!/usr/bin/perl
#
# MD5 optimized for AMD64.
#
--- openssl-0.9.8m.orig/crypto/sha/asm/sha1-ia64.pl
+++ openssl-0.9.8m/crypto/sha/asm/sha1-ia64.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/env perl
+#!/usr/bin/perl
#
# ====================================================================
# Written by Andy Polyakov <appro@fy.chalmers.se> for the OpenSSL
--- openssl-0.9.8m.orig/crypto/sha/asm/sha1-x86_64.pl
+++ openssl-0.9.8m/crypto/sha/asm/sha1-x86_64.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/env perl
+#!/usr/bin/perl
#
# ====================================================================
# Written by Andy Polyakov <appro@fy.chalmers.se> for the OpenSSL
--- openssl-0.9.8m.orig/crypto/sha/asm/sha512-sse2.pl
+++ openssl-0.9.8m/crypto/sha/asm/sha512-sse2.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/env perl
+#!/usr/bin/perl
#
# ====================================================================
# Written by Andy Polyakov <appro@fy.chalmers.se> for the OpenSSL
--- openssl-0.9.8m.orig/crypto/sha/asm/sha512-ia64.pl
+++ openssl-0.9.8m/crypto/sha/asm/sha512-ia64.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/env perl
+#!/usr/bin/perl
#
# ====================================================================
# Written by Andy Polyakov <appro@fy.chalmers.se> for the OpenSSL
--- openssl-0.9.8m.orig/crypto/sha/asm/sha512-x86_64.pl
+++ openssl-0.9.8m/crypto/sha/asm/sha512-x86_64.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/env perl
+#!/usr/bin/perl
#
# ====================================================================
# Written by Andy Polyakov <appro@fy.chalmers.se> for the OpenSSL
--- openssl-0.9.8m.orig/crypto/sha/asm/sha1-586.pl
+++ openssl-0.9.8m/crypto/sha/asm/sha1-586.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/env perl
+#!/usr/bin/perl
# ====================================================================
# [Re]written by Andy Polyakov <appro@fy.chalmers.se> for the OpenSSL
--- openssl-0.9.8m.orig/crypto/des/asm/des-586.pl
+++ openssl-0.9.8m/crypto/des/asm/des-586.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/perl
#
# The inner loop instruction sequence and the IP/FP modifications are from
# Svend Olaf Mikkelsen <svolaf@inet.uni-c.dk>
--- openssl-0.9.8m.orig/crypto/des/asm/desboth.pl
+++ openssl-0.9.8m/crypto/des/asm/desboth.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/perl
$L="edi";
$R="esi";
--- openssl-0.9.8m.orig/crypto/des/asm/des686.pl
+++ openssl-0.9.8m/crypto/des/asm/des686.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/perl
$prog="des686.pl";
--- openssl-0.9.8m.orig/crypto/des/asm/crypt586.pl
+++ openssl-0.9.8m/crypto/des/asm/crypt586.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/perl
#
# The inner loop instruction sequence and the IP/FP modifications are from
# Svend Olaf Mikkelsen <svolaf@inet.uni-c.dk>
--- openssl-0.9.8m.orig/crypto/lhash/num.pl
+++ openssl-0.9.8m/crypto/lhash/num.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/perl
#node 10 -> 4
--- openssl-0.9.8m.orig/crypto/ripemd/asm/rmd-586.pl
+++ openssl-0.9.8m/crypto/ripemd/asm/rmd-586.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/perl
# Normal is the
# ripemd160_block_asm_data_order(RIPEMD160_CTX *c, ULONG *X,int blocks);
--- openssl-0.9.8m.orig/crypto/rc4/asm/rc4-586.pl
+++ openssl-0.9.8m/crypto/rc4/asm/rc4-586.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/perl
# At some point it became apparent that the original SSLeay RC4
# assembler implementation performs suboptimaly on latest IA-32
--- openssl-0.9.8m.orig/crypto/rc4/asm/rc4-x86_64.pl
+++ openssl-0.9.8m/crypto/rc4/asm/rc4-x86_64.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/env perl
+#!/usr/bin/perl
#
# ====================================================================
# Written by Andy Polyakov <appro@fy.chalmers.se> for the OpenSSL
--- openssl-0.9.8m.orig/crypto/cast/asm/cast-586.pl
+++ openssl-0.9.8m/crypto/cast/asm/cast-586.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/perl
# define for pentium pro friendly version
$ppro=1;
--- openssl-0.9.8m.orig/crypto/rc5/asm/rc5-586.pl
+++ openssl-0.9.8m/crypto/rc5/asm/rc5-586.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/perl
push(@INC,"perlasm","../../perlasm");
require "x86asm.pl";
--- openssl-0.9.8m.orig/crypto/perlasm/x86ms.pl
+++ openssl-0.9.8m/crypto/perlasm/x86ms.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/perl
package x86ms;
--- openssl-0.9.8m.orig/crypto/perlasm/x86asm.pl
+++ openssl-0.9.8m/crypto/perlasm/x86asm.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/perl
# require 'x86asm.pl';
# &asm_init("cpp","des-586.pl");
--- openssl-0.9.8m.orig/crypto/perlasm/x86nasm.pl
+++ openssl-0.9.8m/crypto/perlasm/x86nasm.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/perl
package x86nasm;
--- openssl-0.9.8m.orig/crypto/perlasm/x86unix.pl
+++ openssl-0.9.8m/crypto/perlasm/x86unix.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/perl
package x86unix; # GAS actually...
--- openssl-0.9.8m.orig/crypto/perlasm/cbc.pl
+++ openssl-0.9.8m/crypto/perlasm/cbc.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/perl
# void des_ncbc_encrypt(input, output, length, schedule, ivec, enc)
# des_cblock (*input);
--- openssl-0.9.8m.orig/crypto/perlasm/x86_64-xlate.pl
+++ openssl-0.9.8m/crypto/perlasm/x86_64-xlate.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/env perl
+#!/usr/bin/perl
# Ascetic x86_64 AT&T to MASM assembler translator by <appro>.
#
--- openssl-0.9.8m.orig/crypto/bf/asm/bf-686.pl
+++ openssl-0.9.8m/crypto/bf/asm/bf-686.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/perl
push(@INC,"perlasm","../../perlasm");
require "x86asm.pl";
--- openssl-0.9.8m.orig/crypto/bf/asm/bf-586.pl
+++ openssl-0.9.8m/crypto/bf/asm/bf-586.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/perl
push(@INC,"perlasm","../../perlasm");
require "x86asm.pl";
--- openssl-0.9.8m.orig/crypto/objects/objects.pl
+++ openssl-0.9.8m/crypto/objects/objects.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/perl
open (NUMIN,"$ARGV[1]") || die "Can't open number file $ARGV[1]";
$max_nid=0;
--- openssl-0.9.8m.orig/crypto/objects/obj_dat.pl
+++ openssl-0.9.8m/crypto/objects/obj_dat.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/perl
# fixes bug in floating point emulation on sparc64 when
# this script produces off-by-one output on sparc64
--- openssl-0.9.8m.orig/crypto/conf/keysets.pl
+++ openssl-0.9.8m/crypto/conf/keysets.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/perl
$NUMBER=0x01;
$UPPER=0x02;
--- openssl-0.9.8m.orig/crypto/bn/bn_prime.pl
+++ openssl-0.9.8m/crypto/bn/bn_prime.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/perl
# bn_prime.pl
$num=2048;
--- openssl-0.9.8m.orig/crypto/bn/asm/x86.pl
+++ openssl-0.9.8m/crypto/bn/asm/x86.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/perl
push(@INC,"perlasm","../../perlasm");
require "x86asm.pl";
--- openssl-0.9.8m.orig/crypto/bn/asm/ppc.pl
+++ openssl-0.9.8m/crypto/bn/asm/ppc.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/env perl
+#!/usr/bin/perl
#
# Implemented as a Perl wrapper as we want to support several different
# architectures with single file. We pick up the target based on the
--- openssl-0.9.8m.orig/crypto/bn/asm/co-586.pl
+++ openssl-0.9.8m/crypto/bn/asm/co-586.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/perl
push(@INC,"perlasm","../../perlasm");
require "x86asm.pl";
--- openssl-0.9.8m.orig/crypto/bn/asm/bn-586.pl
+++ openssl-0.9.8m/crypto/bn/asm/bn-586.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/perl
push(@INC,"perlasm","../../perlasm");
require "x86asm.pl";
--- openssl-0.9.8m.orig/crypto/bn/asm/mo-586.pl
+++ openssl-0.9.8m/crypto/bn/asm/mo-586.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/env perl
+#!/usr/bin/perl
# This is crypto/bn/asm/x86-mont.pl (with asciz from crypto/perlasm/x86asm.pl)
# from OpenSSL 0.9.9-dev
--- openssl-0.9.8m.orig/crypto/bn/asm/x86_64-mont.pl
+++ openssl-0.9.8m/crypto/bn/asm/x86_64-mont.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/env perl
+#!/usr/bin/perl
# ====================================================================
# Written by Andy Polyakov <appro@fy.chalmers.se> for the OpenSSL
--- openssl-0.9.8m.orig/crypto/bn/asm/x86/comba.pl
+++ openssl-0.9.8m/crypto/bn/asm/x86/comba.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/perl
# x86 assember
sub mul_add_c
--- openssl-0.9.8m.orig/crypto/bn/asm/x86/add.pl
+++ openssl-0.9.8m/crypto/bn/asm/x86/add.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/perl
# x86 assember
sub bn_add_words
--- openssl-0.9.8m.orig/crypto/bn/asm/x86/mul.pl
+++ openssl-0.9.8m/crypto/bn/asm/x86/mul.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/perl
# x86 assember
sub bn_mul_words
--- openssl-0.9.8m.orig/crypto/bn/asm/x86/mul_add.pl
+++ openssl-0.9.8m/crypto/bn/asm/x86/mul_add.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/perl
# x86 assember
sub bn_mul_add_words
--- openssl-0.9.8m.orig/crypto/bn/asm/x86/sqr.pl
+++ openssl-0.9.8m/crypto/bn/asm/x86/sqr.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/perl
# x86 assember
sub bn_sqr_words
--- openssl-0.9.8m.orig/crypto/bn/asm/x86/sub.pl
+++ openssl-0.9.8m/crypto/bn/asm/x86/sub.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/perl
# x86 assember
sub bn_sub_words
--- openssl-0.9.8m.orig/crypto/bn/asm/x86/div.pl
+++ openssl-0.9.8m/crypto/bn/asm/x86/div.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/perl
# x86 assember
sub bn_div_words
--- openssl-0.9.8m.orig/crypto/aes/asm/aes-586.pl
+++ openssl-0.9.8m/crypto/aes/asm/aes-586.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/env perl
+#!/usr/bin/perl
#
# ====================================================================
# Written by Andy Polyakov <appro@fy.chalmers.se> for the OpenSSL
--- openssl-0.9.8m.orig/crypto/aes/asm/aes-x86_64.pl
+++ openssl-0.9.8m/crypto/aes/asm/aes-x86_64.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/env perl
+#!/usr/bin/perl
#
# ====================================================================
# Written by Andy Polyakov <appro@fy.chalmers.se> for the OpenSSL
--- openssl-0.9.8m.orig/crypto/asn1/charmap.pl
+++ openssl-0.9.8m/crypto/asn1/charmap.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl -w
+#!/usr/bin/perl
use strict;
--- openssl-0.9.8m.orig/util/mksdef.pl
+++ openssl-0.9.8m/util/mksdef.pl
@@ -1,4 +1,4 @@
-
+#!/usr/bin/perl
# Perl script to split libeay32.def into two distinct DEF files for use in
# fipdso mode. It works out symbols in each case by running "link" command and
# parsing the output to find the list of missing symbols then splitting
--- openssl-0.9.8m.orig/util/dirname.pl
+++ openssl-0.9.8m/util/dirname.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/perl
if ($#ARGV < 0) {
die "dirname.pl: too few arguments\n";
--- openssl-0.9.8m.orig/util/tab_num.pl
+++ openssl-0.9.8m/util/tab_num.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/perl
$num=1;
$width=40;
--- openssl-0.9.8m.orig/util/sp-diff.pl
+++ openssl-0.9.8m/util/sp-diff.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/perl
#
# This file takes as input, the files that have been output from
# ssleay speed.
--- openssl-0.9.8m.orig/util/mkerr.pl
+++ openssl-0.9.8m/util/mkerr.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl -w
+#!/usr/bin/perl
my $config = "crypto/err/openssl.ec";
my $debug = 0;
--- openssl-0.9.8m.orig/util/clean-depend.pl
+++ openssl-0.9.8m/util/clean-depend.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl -w
+#!/usr/bin/perl
# Clean the dependency list in a makefile of standard includes...
# Written by Ben Laurie <ben@algroup.co.uk> 19 Jan 1999
--- openssl-0.9.8m.orig/util/add_cr.pl
+++ openssl-0.9.8m/util/add_cr.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/perl
#
# This adds a copyright message to a souce code file.
# It also gets the file name correct.
--- openssl-0.9.8m.orig/util/pod2man.pl
+++ openssl-0.9.8m/util/pod2man.pl
@@ -1,4 +1,4 @@
-: #!/usr/bin/perl-5.005
+#!/usr/bin/perl
eval 'exec /usr/bin/perl -S $0 ${1+"$@"}'
if $running_under_some_shell;
--- openssl-0.9.8m.orig/util/mkstack.pl
+++ openssl-0.9.8m/util/mkstack.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl -w
+#!/usr/bin/perl
# This is a utility that searches out "DECLARE_STACK_OF()"
# declarations in .h and .c files, and updates/creates/replaces
--- openssl-0.9.8m.orig/util/selftest.pl
+++ openssl-0.9.8m/util/selftest.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl -w
+#!/usr/bin/perl
#
# Run the test suite and generate a report
#
--- openssl-0.9.8m.orig/util/ck_errf.pl
+++ openssl-0.9.8m/util/ck_errf.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/perl
#
# This is just a quick script to scan for cases where the 'error'
# function name in a XXXerr() macro is wrong.
--- openssl-0.9.8m.orig/util/mklink.pl
+++ openssl-0.9.8m/util/mklink.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/perl
# mklink.pl
--- openssl-0.9.8m.orig/util/src-dep.pl
+++ openssl-0.9.8m/util/src-dep.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/perl
# we make up an array of
# $file{function_name}=filename;
--- openssl-0.9.8m.orig/util/deleof.pl
+++ openssl-0.9.8m/util/deleof.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/perl
while (<>)
{
--- openssl-0.9.8m.orig/util/arx.pl
+++ openssl-0.9.8m/util/arx.pl
@@ -1,4 +1,4 @@
-#!/bin/perl
+#!/usr/bin/perl
# Simple perl script to wrap round "ar" program and exclude any
# object files in the environment variable EXCL_OBJ
--- openssl-0.9.8m.orig/util/copy.pl
+++ openssl-0.9.8m/util/copy.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/perl
use Fcntl;
--- openssl-0.9.8m.orig/util/mkdir-p.pl
+++ openssl-0.9.8m/util/mkdir-p.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/perl
# mkdir-p.pl
--- openssl-0.9.8m.orig/util/mkdef.pl
+++ openssl-0.9.8m/util/mkdef.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl -w
+#!/usr/bin/perl
#
# generate a .def file
#
--- openssl-0.9.8m.orig/util/files.pl
+++ openssl-0.9.8m/util/files.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/perl
#
# used to generate the file MINFO for use by util/mk1mf.pl
# It is basically a list of all variables from the passed makefile
--- openssl-0.9.8m.orig/util/mkfiles.pl
+++ openssl-0.9.8m/util/mkfiles.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/perl
#
# This is a hacked version of files.pl for systems that can't do a 'make files'.
# Do a perl util/mkminfo.pl >MINFO to build MINFO
--- openssl-0.9.8m.orig/util/perlpath.pl
+++ openssl-0.9.8m/util/perlpath.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/perl
#
# modify the '#!/usr/local/bin/perl'
# line in all scripts that rely on perl.
--- openssl-0.9.8m.orig/util/mk1mf.pl
+++ openssl-0.9.8m/util/mk1mf.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/perl
# A bit of an evil hack but it post processes the file ../MINFO which
# is generated by `make files` in the top directory.
# This script outputs one mega makefile that has no shell stuff or any
--- openssl-0.9.8m.orig/util/err-ins.pl
+++ openssl-0.9.8m/util/err-ins.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/perl
#
# tack error codes onto the end of a file
#
--- openssl-0.9.8m.orig/util/pl/Mingw32.pl
+++ openssl-0.9.8m/util/pl/Mingw32.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/perl
#
# Mingw32.pl -- Mingw
#
--- openssl-0.9.8m.orig/util/pl/unix.pl
+++ openssl-0.9.8m/util/pl/unix.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/perl
#
# unix.pl - the standard unix makefile stuff.
#
--- openssl-0.9.8m.orig/util/pl/netware.pl
+++ openssl-0.9.8m/util/pl/netware.pl
@@ -1,4 +1,4 @@
-# Metrowerks Codewarrior or gcc / nlmconv for NetWare
+#!/usr/bin/perl
#
$version_header = "crypto/opensslv.h";
--- openssl-0.9.8m.orig/util/pl/VC-32.pl
+++ openssl-0.9.8m/util/pl/VC-32.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/perl
# VC-32.pl - unified script for Microsoft Visual C++, covering Win32,
# Win64 and WinCE [follow $FLAVOR variable to trace the differences].
#
--- openssl-0.9.8m.orig/util/pl/OS2-EMX.pl
+++ openssl-0.9.8m/util/pl/OS2-EMX.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/perl
#
# OS2-EMX.pl - for EMX GCC on OS/2
#
--- openssl-0.9.8m.orig/util/pl/ultrix.pl
+++ openssl-0.9.8m/util/pl/ultrix.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/perl
#
# linux.pl - the standard unix makefile stuff.
#
--- openssl-0.9.8m.orig/util/pl/linux.pl
+++ openssl-0.9.8m/util/pl/linux.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/perl
#
# linux.pl - the standard unix makefile stuff.
#
--- openssl-0.9.8m.orig/util/pl/BC-32.pl
+++ openssl-0.9.8m/util/pl/BC-32.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/perl
# Borland C++ builder 3 and 4 -- Janez Jere <jj@void.si>
#

View File

@@ -0,0 +1,301 @@
Index: openssl-0.9.8o/crypto/Makefile
===================================================================
--- openssl-0.9.8o.orig/crypto/Makefile 2008-09-17 17:10:55.000000000 +0000
+++ openssl-0.9.8o/crypto/Makefile 2010-06-06 13:09:28.000000000 +0000
@@ -57,7 +57,7 @@
echo " #define DATE \"`LC_ALL=C LC_TIME=C date`\""; \
echo '#endif' ) >buildinf.h
-x86cpuid-elf.s: x86cpuid.pl perlasm/x86asm.pl
+x86cpuid-elf.S: x86cpuid.pl perlasm/x86asm.pl
$(PERL) x86cpuid.pl elf $(CFLAGS) $(PROCESSOR) > $@
x86cpuid-cof.s: x86cpuid.pl perlasm/x86asm.pl
$(PERL) x86cpuid.pl coff $(CFLAGS) $(PROCESSOR) > $@
@@ -70,7 +70,7 @@
uplink-cof.s: ../ms/uplink.pl
$(PERL) ../ms/uplink.pl coff > $@
-x86_64cpuid.s: x86_64cpuid.pl
+x86_64cpuid.S: x86_64cpuid.pl
$(PERL) x86_64cpuid.pl $@
ia64cpuid.s: ia64cpuid.S
$(CC) $(CFLAGS) -E ia64cpuid.S > $@
Index: openssl-0.9.8o/crypto/x86_64cpuid.pl
===================================================================
--- openssl-0.9.8o.orig/crypto/x86_64cpuid.pl 2007-11-11 16:25:00.000000000 +0000
+++ openssl-0.9.8o/crypto/x86_64cpuid.pl 2010-06-06 13:09:28.000000000 +0000
@@ -95,7 +95,11 @@
.size OPENSSL_wipe_cpu,.-OPENSSL_wipe_cpu
.section .init
+#ifdef OPENSSL_PIC
+ call OPENSSL_cpuid_setup\@PLT
+#else
call OPENSSL_cpuid_setup
+#endif
___
Index: openssl-0.9.8o/crypto/md5/Makefile
===================================================================
--- openssl-0.9.8o.orig/crypto/md5/Makefile 2008-09-17 17:11:02.000000000 +0000
+++ openssl-0.9.8o/crypto/md5/Makefile 2010-06-06 13:09:28.000000000 +0000
@@ -52,7 +52,8 @@
mx86-out.s: asm/md5-586.pl ../perlasm/x86asm.pl
(cd asm; $(PERL) md5-586.pl a.out $(CFLAGS) > ../$@)
-md5-x86_64.s: asm/md5-x86_64.pl; $(PERL) asm/md5-x86_64.pl $@
+md5-x86_64.s: asm/md5-x86_64.pl
+ $(PERL) asm/md5-x86_64.pl $@
files:
$(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO
Index: openssl-0.9.8o/crypto/des/asm/desboth.pl
===================================================================
--- openssl-0.9.8o.orig/crypto/des/asm/desboth.pl 2001-10-24 21:20:56.000000000 +0000
+++ openssl-0.9.8o/crypto/des/asm/desboth.pl 2010-06-06 13:09:28.000000000 +0000
@@ -16,6 +16,11 @@
&push("edi");
+ &call (&label("pic_point0"));
+ &set_label("pic_point0");
+ &blindpop("ebp");
+ &add ("ebp", "\$_GLOBAL_OFFSET_TABLE_+[.-" . &label("pic_point0") . "]");
+
&comment("");
&comment("Load the data words");
&mov($L,&DWP(0,"ebx","",0));
@@ -47,15 +52,21 @@
&mov(&swtmp(2), (DWC(($enc)?"1":"0")));
&mov(&swtmp(1), "eax");
&mov(&swtmp(0), "ebx");
- &call("DES_encrypt2");
+ &exch("ebx", "ebp");
+ &call("DES_encrypt2\@PLT");
+ &exch("ebx", "ebp");
&mov(&swtmp(2), (DWC(($enc)?"0":"1")));
&mov(&swtmp(1), "edi");
&mov(&swtmp(0), "ebx");
- &call("DES_encrypt2");
+ &exch("ebx", "ebp");
+ &call("DES_encrypt2\@PLT");
+ &exch("ebx", "ebp");
&mov(&swtmp(2), (DWC(($enc)?"1":"0")));
&mov(&swtmp(1), "esi");
&mov(&swtmp(0), "ebx");
- &call("DES_encrypt2");
+ &exch("ebx", "ebp");
+ &call("DES_encrypt2\@PLT");
+ &exch("ebx", "ebp");
&stack_pop(3);
&mov($L,&DWP(0,"ebx","",0));
Index: openssl-0.9.8o/crypto/rc4/Makefile
===================================================================
--- openssl-0.9.8o.orig/crypto/rc4/Makefile 2008-11-19 16:03:50.000000000 +0000
+++ openssl-0.9.8o/crypto/rc4/Makefile 2010-06-06 13:09:28.000000000 +0000
@@ -51,7 +51,7 @@
rx86-out.s: asm/rc4-586.pl ../perlasm/x86asm.pl
(cd asm; $(PERL) rc4-586.pl a.out $(CFLAGS) > ../$@)
-rc4-x86_64.s: asm/rc4-x86_64.pl; $(PERL) asm/rc4-x86_64.pl $@
+rc4-x86_64.S: asm/rc4-x86_64.pl; $(PERL) asm/rc4-x86_64.pl $@
rc4-ia64.s: asm/rc4-ia64.S
@case `awk '/^#define RC4_INT/{print$$NF}' $(TOP)/include/openssl/opensslconf.h` in \
Index: openssl-0.9.8o/crypto/rc4/asm/rc4-x86_64.pl
===================================================================
--- openssl-0.9.8o.orig/crypto/rc4/asm/rc4-x86_64.pl 2008-09-16 10:47:27.000000000 +0000
+++ openssl-0.9.8o/crypto/rc4/asm/rc4-x86_64.pl 2010-06-06 13:09:28.000000000 +0000
@@ -270,7 +270,11 @@
xor %r10,%r10
xor %r11,%r11
+#ifdef OPENSSL_PIC
+ mov OPENSSL_ia32cap_P\@GOTPCREL(%rip),$idx#d
+#else
mov OPENSSL_ia32cap_P(%rip),$idx#d
+#endif
bt \$20,$idx#d
jnc .Lw1stloop
bt \$30,$idx#d
@@ -338,7 +342,11 @@
RC4_options:
.picmeup %rax
lea .Lopts-.(%rax),%rax
+#ifdef OPENSSL_PIC
+ mov OPENSSL_ia32cap_P\@GOTPCREL(%rip),%edx
+#else
mov OPENSSL_ia32cap_P(%rip),%edx
+#endif
bt \$20,%edx
jnc .Ldone
add \$12,%rax
Index: openssl-0.9.8o/crypto/perlasm/x86unix.pl
===================================================================
--- openssl-0.9.8o.orig/crypto/perlasm/x86unix.pl 2008-05-01 23:11:32.000000000 +0000
+++ openssl-0.9.8o/crypto/perlasm/x86unix.pl 2010-06-06 13:09:28.000000000 +0000
@@ -400,6 +400,29 @@
$stack=4;
}
+sub main'function_begin_B_static
+ {
+ local($func,$extra)=@_;
+
+ &main'external_label($func);
+ $func=$under.$func;
+
+ local($tmp)=<<"EOF";
+.text
+EOF
+ push(@out,$tmp);
+ if ($main'cpp)
+ { push(@out,"TYPE($func,\@function)\n"); }
+ elsif ($main'coff)
+ { $tmp=push(@out,".def\t$func;\t.scl\t2;\t.type\t32;\t.endef\n"); }
+ elsif ($main'aout and !$main'pic)
+ { }
+ else { push(@out,".type $func,\@function\n"); }
+ push(@out,".align\t$align\n");
+ push(@out,"$func:\n");
+ $stack=4;
+ }
+
sub main'function_end
{
local($func)=@_;
@@ -694,7 +717,17 @@
{
$tmp=<<___;
.section .init
+#ifdef OPENSSL_PIC
+ pushl %ebx
+ call .pic_point0
+.pic_point0:
+ popl %ebx
+ addl \$_GLOBAL_OFFSET_TABLE_+[.-.pic_point0],%ebx
+ call $under$f\@PLT
+ popl %ebx
+#else
call $under$f
+#endif
jmp .Linitalign
.align $align
.Linitalign:
Index: openssl-0.9.8o/crypto/perlasm/cbc.pl
===================================================================
--- openssl-0.9.8o.orig/crypto/perlasm/cbc.pl 2005-05-09 21:48:00.000000000 +0000
+++ openssl-0.9.8o/crypto/perlasm/cbc.pl 2010-06-06 13:09:28.000000000 +0000
@@ -122,7 +122,11 @@
&mov(&DWP($data_off,"esp","",0), "eax"); # put in array for call
&mov(&DWP($data_off+4,"esp","",0), "ebx"); #
- &call($enc_func);
+ &call (&label("pic_point0"));
+ &set_label("pic_point0");
+ &blindpop("ebx");
+ &add ("ebx", "\$_GLOBAL_OFFSET_TABLE_+[.-" . &label("pic_point0") . "]");
+ &call("$enc_func\@PLT");
&mov("eax", &DWP($data_off,"esp","",0));
&mov("ebx", &DWP($data_off+4,"esp","",0));
@@ -187,7 +191,11 @@
&mov(&DWP($data_off,"esp","",0), "eax"); # put in array for call
&mov(&DWP($data_off+4,"esp","",0), "ebx"); #
- &call($enc_func);
+ &call (&label("pic_point1"));
+ &set_label("pic_point1");
+ &blindpop("ebx");
+ &add ("ebx", "\$_GLOBAL_OFFSET_TABLE_+[.-" . &label("pic_point1") . "]");
+ &call("$enc_func\@PLT");
&mov("eax", &DWP($data_off,"esp","",0));
&mov("ebx", &DWP($data_off+4,"esp","",0));
@@ -220,7 +228,11 @@
&mov(&DWP($data_off,"esp","",0), "eax"); # put back
&mov(&DWP($data_off+4,"esp","",0), "ebx"); #
- &call($dec_func);
+ &call (&label("pic_point2"));
+ &set_label("pic_point2");
+ &blindpop("ebx");
+ &add ("ebx", "\$_GLOBAL_OFFSET_TABLE_+[.-" . &label("pic_point2") . "]");
+ &call("$dec_func\@PLT");
&mov("eax", &DWP($data_off,"esp","",0)); # get return
&mov("ebx", &DWP($data_off+4,"esp","",0)); #
@@ -263,7 +275,11 @@
&mov(&DWP($data_off,"esp","",0), "eax"); # put back
&mov(&DWP($data_off+4,"esp","",0), "ebx"); #
- &call($dec_func);
+ &call (&label("pic_point3"));
+ &set_label("pic_point3");
+ &blindpop("ebx");
+ &add ("ebx", "\$_GLOBAL_OFFSET_TABLE_+[.-" . &label("pic_point3") . "]");
+ &call("$dec_func\@PLT");
&mov("eax", &DWP($data_off,"esp","",0)); # get return
&mov("ebx", &DWP($data_off+4,"esp","",0)); #
Index: openssl-0.9.8o/crypto/perlasm/x86_64-xlate.pl
===================================================================
--- openssl-0.9.8o.orig/crypto/perlasm/x86_64-xlate.pl 2010-06-06 13:09:00.000000000 +0000
+++ openssl-0.9.8o/crypto/perlasm/x86_64-xlate.pl 2010-06-06 13:09:28.000000000 +0000
@@ -435,7 +435,7 @@
chomp($line);
- $line =~ s|[#!].*$||; # get rid of asm-style comments...
+# $line =~ s|[#!].*$||; # get rid of asm-style comments...
$line =~ s|/\*.*\*/||; # ... and C-style comments...
$line =~ s|^\s+||; # ... and skip white spaces in beginning
Index: openssl-0.9.8o/crypto/aes/asm/aes-586.pl
===================================================================
--- openssl-0.9.8o.orig/crypto/aes/asm/aes-586.pl 2008-12-17 14:14:51.000000000 +0000
+++ openssl-0.9.8o/crypto/aes/asm/aes-586.pl 2010-06-06 13:09:28.000000000 +0000
@@ -250,7 +250,7 @@
sub _data_word() { my $i; while(defined($i=shift)) { &data_word($i,$i); } }
&public_label("AES_Te");
-&function_begin_B("_x86_AES_encrypt");
+&function_begin_B_static("_x86_AES_encrypt");
if ($vertical_spin) {
# I need high parts of volatile registers to be accessible...
&exch ($s1="edi",$key="ebx");
@@ -539,7 +539,7 @@
}
&public_label("AES_Td");
-&function_begin_B("_x86_AES_decrypt");
+&function_begin_B_static("_x86_AES_decrypt");
# note that caller is expected to allocate stack frame for me!
&mov (&DWP(12,"esp"),$key); # save key
@@ -1461,15 +1461,22 @@
&public_label("AES_Td");
&public_label("AES_Te");
&function_begin_B("AES_set_decrypt_key");
+ &push ("ebx");
&mov ("eax",&wparam(0));
&mov ("ecx",&wparam(1));
&mov ("edx",&wparam(2));
&sub ("esp",12);
+
+ &call (&label("pic_point0"));
+ &set_label("pic_point0");
+ &blindpop("ebx");
+ &add ("ebx", "\$_GLOBAL_OFFSET_TABLE_+[.-" . &label("pic_point0") . "]");
&mov (&DWP(0,"esp"),"eax");
&mov (&DWP(4,"esp"),"ecx");
&mov (&DWP(8,"esp"),"edx");
- &call ("AES_set_encrypt_key");
+ &call ("AES_set_encrypt_key\@PLT");
&add ("esp",12);
+ &pop ("ebx");
&cmp ("eax",0);
&je (&label("proceed"));
&ret ();

View File

@@ -0,0 +1,34 @@
Index: openssl-0.9.8k/Makefile.org
===================================================================
--- openssl-0.9.8k.orig/Makefile.org 2009-07-19 11:34:56.000000000 +0200
+++ openssl-0.9.8k/Makefile.org 2009-07-19 11:36:02.000000000 +0200
@@ -444,7 +444,8 @@
echo 'Description: OpenSSL cryptography library'; \
echo 'Version: '$(VERSION); \
echo 'Requires: '; \
- echo 'Libs: -L$${libdir} -lcrypto $(EX_LIBS)'; \
+ echo 'Libs: -L$${libdir} -lcrypto'; \
+ echo 'Libs.private: $(EX_LIBS)'; \
echo 'Cflags: -I$${includedir} $(KRB5_INCLUDES)' ) > libcrypto.pc
libssl.pc: Makefile
@@ -457,7 +458,8 @@
echo 'Description: Secure Sockets Layer and cryptography libraries'; \
echo 'Version: '$(VERSION); \
echo 'Requires: '; \
- echo 'Libs: -L$${libdir} -lssl -lcrypto $(EX_LIBS)'; \
+ echo 'Libs: -L$${libdir} -lssl'; \
+ echo 'Libs.private: -lcrypto $(EX_LIBS)'; \
echo 'Cflags: -I$${includedir} $(KRB5_INCLUDES)' ) > libssl.pc
openssl.pc: Makefile
@@ -470,7 +472,8 @@
echo 'Description: Secure Sockets Layer and cryptography libraries and tools'; \
echo 'Version: '$(VERSION); \
echo 'Requires: '; \
- echo 'Libs: -L$${libdir} -lssl -lcrypto $(EX_LIBS)'; \
+ echo 'Libs: -L$${libdir} -lssl -lcrypto'; \
+ echo 'Libs.private: $(EX_LIBS)'; \
echo 'Cflags: -I$${includedir} $(KRB5_INCLUDES)' ) > openssl.pc
Makefile: Makefile.org Configure config

View File

@@ -0,0 +1,14 @@
Index: openssl-0.9.8k/Configure
===================================================================
--- openssl-0.9.8k.orig/Configure 2009-07-19 11:32:41.000000000 +0200
+++ openssl-0.9.8k/Configure 2009-07-19 11:37:10.000000000 +0200
@@ -128,6 +128,9 @@
my $x86_out_asm="x86cpuid-out.o:bn86-out.o co86-out.o MAYBE-MO86-out.o:dx86-out.o yx86-out.o:ax86-out.o:bx86-out.o:mx86-out.o:sx86-out.o s512sse2-out.o:cx86-out.o:rx86-out.o rc4_skey.o:rm86-out.o:r586-out.o";
my $x86_64_asm="x86_64cpuid.o:x86_64-gcc.o x86_64-mont.o::aes-x86_64.o::md5-x86_64.o:sha1-x86_64.o sha256-x86_64.o sha512-x86_64.o::rc4-x86_64.o::";
+# rc4 asm is disabled on amd64 because we configured it with RC4_CHAR while
+# the assembler only works with int
+my $x86_64_asm_linux="x86_64cpuid.o:x86_64-gcc.o x86_64-mont.o::aes-x86_64.o::md5-x86_64.o:sha1-x86_64.o sha256-x86_64.o sha512-x86_64.o::::";
my $ia64_asm=":bn-ia64.o::aes_core.o aes_cbc.o aes-ia64.o:::sha1-ia64.o sha256-ia64.o sha512-ia64.o::rc4-ia64.o rc4_skey.o::";
my $no_asm="::::::::::";

View File

@@ -0,0 +1,33 @@
Index: openssl-0.9.8k/tools/c_rehash.in
===================================================================
--- openssl-0.9.8k.orig/tools/c_rehash.in 2002-10-11 22:31:27.000000000 +0200
+++ openssl-0.9.8k/tools/c_rehash.in 2009-07-19 11:36:26.000000000 +0200
@@ -59,12 +59,15 @@
}
}
closedir DIR;
- FILE: foreach $fname (grep {/\.pem$/} @flist) {
+ FILE: foreach $fname (grep {/\.pem$|\.crt$/} @flist) {
# Check to see if certificates and/or CRLs present.
my ($cert, $crl) = check_file($fname);
if(!$cert && !$crl) {
- print STDERR "WARNING: $fname does not contain a certificate or CRL: skipping\n";
- next;
+ ($cert, $crl) = check_file("$openssl x509 -in \"$fname\" -inform der -outform pem | ");
+ if(!$cert && !$crl) {
+ print STDERR "WARNING: $fname does not contain a certificate or CRL: skipping\n";
+ next;
+ }
}
link_hash_cert($fname) if($cert);
link_hash_crl($fname) if($crl);
@@ -102,6 +105,9 @@
my $fname = $_[0];
$fname =~ s/'/'\\''/g;
my ($hash, $fprint) = `"$openssl" x509 -hash -fingerprint -noout -in '$fname'`;
+ if(!$hash || !fprint) {
+ ($hash, $fprint) = `"$openssl" x509 -hash -fingerprint -noout -in '$fname' -inform der`;
+ }
chomp $hash;
chomp $fprint;
$fprint =~ s/^.*=//;

View File

@@ -0,0 +1,60 @@
Index: openssl-0.9.8k/doc/apps/c_rehash.pod
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ openssl-0.9.8k/doc/apps/c_rehash.pod 2009-07-19 11:36:27.000000000 +0200
@@ -0,0 +1,55 @@
+
+=pod
+
+=head1 NAME
+
+c_rehash - Create symbolic links to files named by the hash values
+
+=head1 SYNOPSIS
+
+B<c_rehash>
+[directory] ...
+
+=head1 DESCRIPTION
+
+c_rehash scans directories and takes a hash value of each .pem and .crt file in the directory. It then creates symbolic links for each of the files named by the hash value. This is useful as many programs require directories to be set up like this in order to find the certificates they require.
+
+If any directories are named on the command line then these directories are processed in turn. If not then and the environment variable SSL_CERT_DIR is defined then that is consulted. This variable should be a colon (:) separated list of directories, all of which will be processed. If neither of these conditions are true then /usr/lib/ssl/certs is processed.
+
+For each directory that is to be processed he user must have write permissions on the directory, if they do not then nothing will be printed for that directory.
+
+Note that this program deletes all the symbolic links that look like ones that it creates before processing a directory. Beware that if you run the program on a directory that contains symbolic links for other purposes that are named in the same format as those created by this program they will be lost.
+
+The hashes for certificate files are of the form <hash>.<n> where n is an integer. If the hash value already exists then n will be incremented, unless the file is a duplicate. Duplicates are detected using the fingerprint of the certificate. A warning will be printed if a duplicate is detected. The hashes for CRL files are of the form <hash>.r<n> and have the same behavior.
+
+The program will also warn if there are files with extension .pem which are not certificate or CRL files.
+
+The program uses the openssl program to compute the hashes and fingerprints. It expects the executable to be named openssl and be on the PATH, or in the /usr/lib/ssl/bin directory. If the OPENSSL environment variable is defined then this is used instead as the executable that provides the hashes and fingerprints. When called as $OPENSSL x509 -hash -fingerprint -noout -in $file it must output the hash of $file on the first line followed by the fingerprint on the second line, optionally prefixed with some text and an equals sign (=).
+
+=head1 OPTIONS
+
+None
+
+=head1 ENVIRONMENT
+
+=over 4
+
+=item B<OPENSSL>
+
+The name (and path) of an executable to use to generate hashes and fingerprints (see above).
+
+=item B<SSL_CERT_DIR>
+
+Colon separated list of directories to operate on. Ignored if directories are listed on the command line.
+
+=head1 SEE ALSO
+
+L<openssl(1)|openssl(1)>, L<x509(1)|x509(1)>
+
+=back
+
+=head1 BUGS
+
+No known bugs
+
+=cut

View File

@@ -0,0 +1,20 @@
ca.patch
config-hurd.patch
debian-targets.patch
engines-path.patch
kfreebsd-pipe.patch
make-targets.patch
man-dir.patch
man-section.patch
no-rpath.patch
no-symbolic.patch
pic.patch
pkg-config.patch
valgrind.patch
rc4-amd64.patch
rehash-crt.patch
rehash_pod.patch
shared-lib-ext.patch
stddef.patch
version-script.patch
perl-path.diff

View File

@@ -0,0 +1,14 @@
Index: openssl-0.9.8k/Configure
===================================================================
--- openssl-0.9.8k.orig/Configure 2009-07-19 11:36:24.000000000 +0200
+++ openssl-0.9.8k/Configure 2009-07-19 11:37:03.000000000 +0200
@@ -1568,7 +1568,8 @@
elsif ($shared_extension ne "" && $shared_extension =~ /^\.s([ol])\.[^\.]*\.[^\.]*$/)
{
my $sotmp = $1;
- s/^SHARED_LIBS_LINK_EXTS=.*/SHARED_LIBS_LINK_EXTS=.s$sotmp.\$(SHLIB_MAJOR) .s$sotmp/;
+# s/^SHARED_LIBS_LINK_EXTS=.*/SHARED_LIBS_LINK_EXTS=.s$sotmp.\$(SHLIB_MAJOR) .s$sotmp/;
+ s/^SHARED_LIBS_LINK_EXTS=.*/SHARED_LIBS_LINK_EXTS=.s$sotmp/;
}
elsif ($shared_extension ne "" && $shared_extension =~ /^\.[^\.]*\.[^\.]*\.dylib$/)
{

View File

@@ -0,0 +1,12 @@
Index: openssl-0.9.8k/crypto/sha/sha.h
===================================================================
--- openssl-0.9.8k.orig/crypto/sha/sha.h 2008-09-16 12:47:28.000000000 +0200
+++ openssl-0.9.8k/crypto/sha/sha.h 2009-07-19 11:36:28.000000000 +0200
@@ -59,6 +59,7 @@
#ifndef HEADER_SHA_H
#define HEADER_SHA_H
+#include <stddef.h>
#include <openssl/e_os2.h>
#include <stddef.h>

View File

@@ -0,0 +1,15 @@
Index: openssl-0.9.8k/crypto/rand/md_rand.c
===================================================================
--- openssl-0.9.8k.orig/crypto/rand/md_rand.c 2008-09-16 13:50:05.000000000 +0200
+++ openssl-0.9.8k/crypto/rand/md_rand.c 2009-07-19 11:36:05.000000000 +0200
@@ -477,8 +477,10 @@
MD_Update(&m,local_md,MD_DIGEST_LENGTH);
MD_Update(&m,(unsigned char *)&(md_c[0]),sizeof(md_c));
#ifndef PURIFY
+#if 0 /* Don't add uninitialised data. */
MD_Update(&m,buf,j); /* purify complains */
#endif
+#endif
k=(st_idx+MD_DIGEST_LENGTH/2)-st_num;
if (k > 0)
{

View File

@@ -0,0 +1,33 @@
Index: openssl-0.9.8m/Configure
===================================================================
--- openssl-0.9.8m.orig/Configure 2010-02-27 12:28:32.000000000 +0100
+++ openssl-0.9.8m/Configure 2010-02-27 12:28:35.000000000 +0100
@@ -1512,6 +1512,8 @@
}
}
+$shared_ldflag .= " -Wl,--version-script=openssl.ld";
+
open(IN,'<Makefile.org') || die "unable to read Makefile.org:$!\n";
unlink("$Makefile.new") || die "unable to remove old $Makefile.new:$!\n" if -e "$Makefile.new";
open(OUT,">$Makefile.new") || die "unable to create $Makefile.new:$!\n";
Index: openssl-0.9.8m/openssl.ld
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ openssl-0.9.8m/openssl.ld 2010-02-27 12:28:35.000000000 +0100
@@ -0,0 +1,5 @@
+OPENSSL_0.9.8 {
+ global:
+ *;
+};
+
Index: openssl-0.9.8m/engines/openssl.ld
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ openssl-0.9.8m/engines/openssl.ld 2010-02-27 12:28:35.000000000 +0100
@@ -0,0 +1,5 @@
+OPENSSL_0.9.8 {
+ global:
+ *;
+};
+

View File

@@ -0,0 +1,48 @@
diff --git a/Makefile.org b/Makefile.org
index e87d623..25ff367 100644
--- a/Makefile.org
+++ b/Makefile.org
@@ -355,7 +355,7 @@ libcrypto$(SHLIB_EXT): libcrypto.a $(SHARED_FIPS)
@if [ "$(SHLIB_TARGET)" != "" ]; then \
if [ "$(FIPSCANLIB)" = "libfips" ]; then \
$(ARD) libcrypto.a fipscanister.o ; \
- $(MAKE) SHLIBDIRS='crypto' SHLIBDEPS='-lfips' build-shared; \
+ $(MAKE) -e SHLIBDIRS='crypto' SHLIBDEPS='-lfips' build-shared; \
$(AR) libcrypto.a fips/fipscanister.o ; \
else \
if [ "$(FIPSCANLIB)" = "libcrypto" ]; then \
@@ -373,7 +373,7 @@ libssl$(SHLIB_EXT): libcrypto$(SHLIB_EXT) libssl.a
@if [ "$(SHLIB_TARGET)" != "" ]; then \
shlibdeps=-lcrypto; \
[ "$(FIPSCANLIB)" = "libfips" ] && shlibdeps="$$shlibdeps -lfips"; \
- $(MAKE) SHLIBDIRS=ssl SHLIBDEPS="$$shlibdeps" build-shared; \
+ $(MAKE) -e SHLIBDIRS=ssl SHLIBDEPS="$$shlibdeps" build-shared; \
else \
echo "There's no support for shared libraries on this platform" >&2 ; \
exit 1; \
diff --git a/crypto/Makefile b/crypto/Makefile
index 6557f2b..a69bf7c 100644
--- a/crypto/Makefile
+++ b/crypto/Makefile
@@ -103,7 +103,7 @@ $(LIB): $(LIBOBJ)
shared: buildinf.h lib subdirs
if [ -n "$(SHARED_LIBS)" ]; then \
- (cd ..; $(MAKE) $(SHARED_LIB)); \
+ (cd ..; $(MAKE) -e $(SHARED_LIB)); \
fi
libs:
diff --git a/ssl/Makefile b/ssl/Makefile
index 5ac3507..77ea2bd 100644
--- a/ssl/Makefile
+++ b/ssl/Makefile
@@ -62,7 +62,7 @@ lib: $(LIBOBJ)
shared: lib
if [ -n "$(SHARED_LIBS)" ]; then \
- (cd ..; $(MAKE) $(SHARED_LIB)); \
+ (cd ..; $(MAKE) -e $(SHARED_LIB)); \
fi
files:

View File

@@ -0,0 +1,100 @@
DESCRIPTION = "Secure Socket Layer (SSL) binary and related cryptographic tools."
HOMEPAGE = "http://www.openssl.org/"
BUGTRACKER = "http://www.openssl.org/news/vulnerabilities.html"
SECTION = "libs/network"
# "openssl | SSLeay" dual license
LICENSE = "openssl"
LIC_FILES_CHKSUM = "file://LICENSE;md5=83d26c69f6f0172ee7f795790424b453"
DEPENDS = "perl-native"
SRC_URI = "http://www.openssl.org/source/openssl-${PV}.tar.gz"
S = "${WORKDIR}/openssl-${PV}"
AR_append = " r"
CFLAG = "${@base_conditional('SITEINFO_ENDIANESS', 'le', '-DL_ENDIAN', '-DB_ENDIAN', d)} \
-DTERMIO ${FULL_OPTIMIZATION} -Wall"
# -02 does not work on mipsel: ssh hangs when it tries to read /dev/urandom
CFLAG_mtx-1 := "${@'${CFLAG}'.replace('-O2', '')}"
CFLAG_mtx-2 := "${@'${CFLAG}'.replace('-O2', '')}"
export DIRS = "crypto ssl apps"
export EX_LIBS = "-lgcc -ldl"
export AS = "${CC} -c"
PARALLEL_MAKE = ""
inherit pkgconfig siteinfo
PACKAGES =+ "libcrypto libssl"
FILES_libcrypto = "${libdir}/libcrypto.so.*"
FILES_libssl = "${libdir}/libssl.so.*"
FILES_${PN} =+ " ${libdir}/ssl/*"
do_configure () {
cd util
perl perlpath.pl ${bindir}
cd ..
ln -sf apps/openssl.pod crypto/crypto.pod ssl/ssl.pod doc/
os=${HOST_OS}
if [ "x$os" = "xlinux-uclibc" ]; then
os=linux
fi
target="$os-${HOST_ARCH}"
case $target in
linux-arm)
target=linux-elf-arm
;;
linux-armeb)
target=linux-elf-armeb
;;
linux-sh3)
target=debian-sh3
;;
linux-sh4)
target=debian-sh4
;;
linux-i486)
target=debian-i386-i486
;;
linux-i586)
target=debian-i386-i586
;;
linux-i686)
target=debian-i386-i686/cmov
;;
linux-mips)
target=debian-mips
;;
linux-mipsel)
target=debian-mipsel
;;
linux-powerpc)
target=linux-ppc
;;
linux-supersparc)
target=linux-sparcv8
;;
linux-sparc)
target=linux-sparcv8
;;
esac
# inject machine-specific flags
sed -i -e "s|^\(\"$target\",\s*\"[^:]\+\):\([^:]\+\)|\1:${CFLAG}|g" Configure
perl ./Configure shared --prefix=${prefix} --openssldir=${libdir}/ssl $target
}
do_compile () {
oe_runmake
}
do_install () {
install -m 0755 -d ${D}${libdir}/pkgconfig
oe_runmake INSTALL_PREFIX="${D}" install
chmod 644 ${D}${libdir}/pkgconfig/openssl.pc
oe_libinstall -so libcrypto ${D}${libdir}
oe_libinstall -so libssl ${D}${libdir}
}

View File

@@ -0,0 +1,28 @@
require openssl.inc
PR = "r0"
SRC_URI += "file://debian/ca.patch \
file://debian/config-hurd.patch;apply=no \
file://debian/debian-targets.patch \
file://debian/engines-path.patch \
file://debian/kfreebsd-pipe.patch;apply=no \
file://debian/make-targets.patch \
file://debian/man-dir.patch \
file://debian/man-section.patch \
file://debian/no-rpath.patch \
file://debian/no-symbolic.patch \
file://debian/pic.patch \
file://debian/pkg-config.patch \
file://debian/valgrind.patch \
file://debian/rc4-amd64.patch \
file://debian/rehash-crt.patch \
file://debian/rehash_pod.patch \
file://debian/shared-lib-ext.patch \
file://debian/stddef.patch \
file://debian/version-script.patch \
file://debian/perl-path.diff"
SRC_URI += "file://configure-targets.patch \
file://shared-libs.patch"
BBCLASSEXTEND = "native"

View File

@@ -0,0 +1,13 @@
Index: openswan-2.4.7/Makefile.inc
===================================================================
--- openswan-2.4.7.orig/Makefile.inc 2006-12-25 18:05:40.608503250 +0100
+++ openswan-2.4.7/Makefile.inc 2006-12-25 18:06:39.028154250 +0100
@@ -158,7 +158,7 @@
# how backup names are composed.
# Note that the install procedures will never overwrite an existing config
# file, which is why -b is not specified for them.
-INSTBINFLAGS=-b --suffix=.old
+INSTBINFLAGS=
INSTSUIDFLAGS=--mode=u+rxs,g+rx,o+rx --group=root -b --suffix=.old
INSTMANFLAGS=
INSTCONFFLAGS=

View File

@@ -0,0 +1,26 @@
--- openswan-2.2.0.orig/programs/Makefile.program 2004-06-03 03:06:27.000000000 +0200
+++ openswan-2.2.0/programs/Makefile.program 2005-03-05 13:50:19.000000000 +0100
@@ -30,10 +30,6 @@
CFLAGS+= ${WERROR}
-ifneq ($(LD_LIBRARY_PATH),)
-LDFLAGS=-L$(LD_LIBRARY_PATH)
-endif
-
MANDIR8=$(MANTREE)/man8
MANDIR5=$(MANTREE)/man5
--- openswan-2.2.0.orig/programs/pluto/Makefile 2005-01-03 20:40:45.000000000 +0100
+++ openswan-2.2.0/programs/pluto/Makefile 2005-03-05 13:51:21.000000000 +0100
@@ -234,10 +234,6 @@
LIBSPLUTO+=${CURL_LIBS}
LIBSPLUTO+= -lgmp -lresolv # -lefence
-ifneq ($(LD_LIBRARY_PATH),)
-LDFLAGS=-L$(LD_LIBRARY_PATH)
-endif
-
LIBSADNS = $(OPENSWANLIB)
LIBSADNS += -lresolv # -lefence

View File

@@ -0,0 +1,377 @@
diff -Nru openswan-2.4.7.orig/doc/Makefile openswan-2.4.7/doc/Makefile
--- openswan-2.4.7.orig/doc/Makefile 2005-11-08 23:32:45.000000000 +0200
+++ openswan-2.4.7/doc/Makefile 2006-12-06 22:46:54.732830840 +0200
@@ -1,6 +1,6 @@
# Makefile to generate various formats from HTML source
#
-# Assumes the htmldoc utility is available.
+# No longer cares if the htmldoc utility is available.
# This can be downloaded from www.easysw.com
#
# Also needs lynx(1) for HTML-to-text conversion
diff -Nru openswan-2.4.7.orig/lib/libcrypto/libdes/asm/crypt586.pl openswan-2.4.7/lib/libcrypto/libdes/asm/crypt586.pl
--- openswan-2.4.7.orig/lib/libcrypto/libdes/asm/crypt586.pl 2004-07-16 03:24:45.000000000 +0300
+++ openswan-2.4.7/lib/libcrypto/libdes/asm/crypt586.pl 2006-12-06 22:46:54.732830840 +0200
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/perl
#
# The inner loop instruction sequence and the IP/FP modifications are from
# Svend Olaf Mikkelsen <svolaf@inet.uni-c.dk>
diff -Nru openswan-2.4.7.orig/lib/libcrypto/libdes/asm/perlasm/cbc.pl openswan-2.4.7/lib/libcrypto/libdes/asm/perlasm/cbc.pl
--- openswan-2.4.7.orig/lib/libcrypto/libdes/asm/perlasm/cbc.pl 2004-07-10 11:07:06.000000000 +0300
+++ openswan-2.4.7/lib/libcrypto/libdes/asm/perlasm/cbc.pl 2006-12-06 22:46:54.736831090 +0200
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/perl
# void des_ncbc_encrypt(input, output, length, schedule, ivec, enc)
# des_cblock (*input);
diff -Nru openswan-2.4.7.orig/lib/libcrypto/libdes/asm/perlasm/x86asm.pl openswan-2.4.7/lib/libcrypto/libdes/asm/perlasm/x86asm.pl
--- openswan-2.4.7.orig/lib/libcrypto/libdes/asm/perlasm/x86asm.pl 2004-07-10 11:07:06.000000000 +0300
+++ openswan-2.4.7/lib/libcrypto/libdes/asm/perlasm/x86asm.pl 2006-12-06 22:46:54.736831090 +0200
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/perl
# require 'x86asm.pl';
# &asm_init("cpp","des-586.pl");
diff -Nru openswan-2.4.7.orig/lib/libcrypto/libdes/asm/perlasm/x86ms.pl openswan-2.4.7/lib/libcrypto/libdes/asm/perlasm/x86ms.pl
--- openswan-2.4.7.orig/lib/libcrypto/libdes/asm/perlasm/x86ms.pl 2004-07-10 11:07:07.000000000 +0300
+++ openswan-2.4.7/lib/libcrypto/libdes/asm/perlasm/x86ms.pl 2006-12-06 22:46:54.736831090 +0200
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/perl
package x86ms;
diff -Nru openswan-2.4.7.orig/lib/libcrypto/libdes/asm/perlasm/x86unix.pl openswan-2.4.7/lib/libcrypto/libdes/asm/perlasm/x86unix.pl
--- openswan-2.4.7.orig/lib/libcrypto/libdes/asm/perlasm/x86unix.pl 2004-07-10 11:07:07.000000000 +0300
+++ openswan-2.4.7/lib/libcrypto/libdes/asm/perlasm/x86unix.pl 2006-12-06 22:46:54.736831090 +0200
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/perl
package x86unix;
diff -Nru openswan-2.4.7.orig/lib/liblwres/Makefile openswan-2.4.7/lib/liblwres/Makefile
--- openswan-2.4.7.orig/lib/liblwres/Makefile 2004-12-18 20:13:34.000000000 +0200
+++ openswan-2.4.7/lib/liblwres/Makefile 2006-12-06 22:46:54.736831090 +0200
@@ -20,7 +20,7 @@
CDEFINES = -g
CWARNINGS = -Werror
-CFLAGS=${CINCLUDES} ${CDEFINES} ${CWARNINGS}
+CFLAGS=${CINCLUDES} ${CDEFINES} ${CWARNINGS} $(USERCOMPILE)
VERSION="@(\#) openswan-hacking-9.3-for-osw2"
LIBINTERFACE=2
diff -Nru openswan-2.4.7.orig/linux/net/ipsec/des/asm/des-586.pl openswan-2.4.7/linux/net/ipsec/des/asm/des-586.pl
--- openswan-2.4.7.orig/linux/net/ipsec/des/asm/des-586.pl 2004-07-10 11:06:50.000000000 +0300
+++ openswan-2.4.7/linux/net/ipsec/des/asm/des-586.pl 2006-12-06 22:46:54.736831090 +0200
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/perl
#
# The inner loop instruction sequence and the IP/FP modifications are from
# Svend Olaf Mikkelsen <svolaf@inet.uni-c.dk>
diff -Nru openswan-2.4.7.orig/linux/net/ipsec/des/asm/des686.pl openswan-2.4.7/linux/net/ipsec/des/asm/des686.pl
--- openswan-2.4.7.orig/linux/net/ipsec/des/asm/des686.pl 2004-07-10 11:06:50.000000000 +0300
+++ openswan-2.4.7/linux/net/ipsec/des/asm/des686.pl 2006-12-06 22:46:54.740831340 +0200
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/perl
$prog="des686.pl";
diff -Nru openswan-2.4.7.orig/linux/net/ipsec/des/asm/desboth.pl openswan-2.4.7/linux/net/ipsec/des/asm/desboth.pl
--- openswan-2.4.7.orig/linux/net/ipsec/des/asm/desboth.pl 2004-07-10 11:06:50.000000000 +0300
+++ openswan-2.4.7/linux/net/ipsec/des/asm/desboth.pl 2006-12-06 22:46:54.740831340 +0200
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/perl
$L="edi";
$R="esi";
diff -Nru openswan-2.4.7.orig/Makefile.inc openswan-2.4.7/Makefile.inc
--- openswan-2.4.7.orig/Makefile.inc 2006-11-14 19:56:09.000000000 +0200
+++ openswan-2.4.7/Makefile.inc 2006-12-06 22:48:32.534943089 +0200
@@ -46,7 +46,7 @@
DESTDIR?=
# "local" part of tree, used in building other pathnames
-INC_USRLOCAL=/usr/local
+INC_USRLOCAL?=/usr
# PUBDIR is where the "ipsec" command goes; beware, many things define PATH
# settings which are assumed to include it (or at least, to include *some*
@@ -80,7 +80,7 @@
MANPLACES=man3 man5 man8
# where configuration files go
-FINALCONFFILE?=/etc/ipsec.conf
+FINALCONFFILE?=/etc/ipsec/ipsec.conf
CONFFILE=$(DESTDIR)$(FINALCONFFILE)
FINALCONFDIR?=/etc
@@ -91,7 +91,7 @@
# sample configuration files go into
INC_DOCDIR?=share/doc
-FINALEXAMPLECONFDIR=${INC_USRLOCAL}/${INC_DOCDIR}/openswan
+FINALEXAMPLECONFDIR?=${INC_USRLOCAL}/${INC_DOCDIR}/openswan
EXAMPLECONFDIR=${DESTDIR}${FINALEXAMPLECONFDIR}
FINALDOCDIR?=${INC_USRLOCAL}/${INC_DOCDIR}/openswan
@@ -239,7 +239,7 @@
# installed one in RH 7.2, won't work - you wind up depending upon
# openssl.
-BIND9STATICLIBDIR?=/usr/local/lib
+BIND9STATICLIBDIR?=/usr/lib
# if you install elsewere, you may need to point the include files to it.
#BIND9STATICLIBDIR?=/sandel/lib
diff -Nru openswan-2.4.7.orig/programs/barf/barf.in openswan-2.4.7/programs/barf/barf.in
--- openswan-2.4.7.orig/programs/barf/barf.in 2006-11-07 05:49:18.000000000 +0200
+++ openswan-2.4.7/programs/barf/barf.in 2006-12-06 22:46:54.740831340 +0200
@@ -16,7 +16,7 @@
LOGS=${LOGS-/var/log}
CONFS=${IPSEC_CONFS-/etc}
-CONFDDIR=${IPSEC_CONFDDIR-/etc/ipsec.d}
+CONFDDIR=${IPSEC_CONFDDIR-/etc/ipsec/ipsec.d}
me="ipsec barf"
# Max lines to use for things like 'route -n'
maxlines=100
@@ -238,13 +238,13 @@
done
fi
_________________________ ipsec/ls-libdir
-ls -l ${IPSEC_LIBDIR-/usr/local/lib/ipsec}
+ls -l ${IPSEC_LIBDIR-/usr/lib/ipsec}
_________________________ ipsec/ls-execdir
-ls -l ${IPSEC_EXECDIR-/usr/local/libexec/ipsec}
+ls -l ${IPSEC_EXECDIR-/usr/libexec/ipsec}
_________________________ ipsec/updowns
-for f in `ls ${IPSEC_EXECDIR-/usr/local/libexec/ipsec} | egrep updown`
+for f in `ls ${IPSEC_EXECDIR-/usr/libexec/ipsec} | egrep updown`
do
- cat ${IPSEC_EXECDIR-/usr/local/libexec/ipsec}/$f
+ cat ${IPSEC_EXECDIR-/usr/libexec/ipsec}/$f
done
_________________________ /proc/net/dev
cat /proc/net/dev
diff -Nru openswan-2.4.7.orig/programs/eroute/eroute.5 openswan-2.4.7/programs/eroute/eroute.5
--- openswan-2.4.7.orig/programs/eroute/eroute.5 2006-10-26 23:40:43.000000000 +0300
+++ openswan-2.4.7/programs/eroute/eroute.5 2006-12-06 22:57:19.307864340 +0200
@@ -168,7 +168,7 @@
.SH "FILES"
.PP
-/proc/net/ipsec_eroute, /usr/local/bin/ipsec
+/proc/net/ipsec_eroute, /usr/bin/ipsec
.SH "SEE ALSO"
diff -Nru openswan-2.4.7.orig/programs/eroute/eroute.8 openswan-2.4.7/programs/eroute/eroute.8
--- openswan-2.4.7.orig/programs/eroute/eroute.8 2003-10-31 04:32:27.000000000 +0200
+++ openswan-2.4.7/programs/eroute/eroute.8 2006-12-06 22:46:54.740831340 +0200
@@ -308,7 +308,7 @@
.br
.LP
.SH FILES
-/proc/net/ipsec_eroute, /usr/local/bin/ipsec
+/proc/net/ipsec_eroute, /usr/bin/ipsec
.SH "SEE ALSO"
ipsec(8), ipsec_manual(8), ipsec_tncfg(8), ipsec_spi(8),
ipsec_spigrp(8), ipsec_klipsdebug(8), ipsec_eroute(5)
diff -Nru openswan-2.4.7.orig/programs/_include/_include.in openswan-2.4.7/programs/_include/_include.in
--- openswan-2.4.7.orig/programs/_include/_include.in 2003-01-06 23:44:04.000000000 +0200
+++ openswan-2.4.7/programs/_include/_include.in 2006-12-06 22:46:54.740831340 +0200
@@ -47,10 +47,10 @@
do
if test ! -r "$f"
then
- if test ! "$f" = "/etc/ipsec.conf"
+ if test ! "$f" = "/etc/ipsec/ipsec.conf"
then
echo "#:cannot open configuration file \'$f\'"
- if test "$f" = "/etc/ipsec.secrets"
+ if test "$f" = "/etc/ipsec/ipsec.secrets"
then
echo "#:Your secrets file will be created when you start FreeS/WAN for the first time."
fi
diff -Nru openswan-2.4.7.orig/programs/ipsec/ipsec.8 openswan-2.4.7/programs/ipsec/ipsec.8
--- openswan-2.4.7.orig/programs/ipsec/ipsec.8 2003-02-27 18:51:54.000000000 +0200
+++ openswan-2.4.7/programs/ipsec/ipsec.8 2006-12-06 22:46:54.744831590 +0200
@@ -81,7 +81,7 @@
.I ipsec
thinks the IPsec configuration files are stored.
.SH FILES
-/usr/local/lib/ipsec usual utilities directory
+/usr/lib/ipsec usual utilities directory
.SH ENVIRONMENT
.PP
The following environment variables control where FreeS/WAN finds its
diff -Nru openswan-2.4.7.orig/programs/klipsdebug/klipsdebug.5 openswan-2.4.7/programs/klipsdebug/klipsdebug.5
--- openswan-2.4.7.orig/programs/klipsdebug/klipsdebug.5 2006-10-27 01:21:25.000000000 +0300
+++ openswan-2.4.7/programs/klipsdebug/klipsdebug.5 2006-12-06 22:58:04.150666840 +0200
@@ -114,7 +114,7 @@
.SH "FILES"
.PP
-/proc/net/ipsec_klipsdebug, /usr/local/bin/ipsec
+/proc/net/ipsec_klipsdebug, /usr/bin/ipsec
.SH "SEE ALSO"
diff -Nru openswan-2.4.7.orig/programs/klipsdebug/klipsdebug.8 openswan-2.4.7/programs/klipsdebug/klipsdebug.8
--- openswan-2.4.7.orig/programs/klipsdebug/klipsdebug.8 2006-10-27 01:21:25.000000000 +0300
+++ openswan-2.4.7/programs/klipsdebug/klipsdebug.8 2006-12-06 22:58:22.295800840 +0200
@@ -111,7 +111,7 @@
.SH "FILES"
.PP
-/proc/net/ipsec_klipsdebug, /usr/local/bin/ipsec
+/proc/net/ipsec_klipsdebug, /usr/bin/ipsec
.SH "SEE ALSO"
diff -Nru openswan-2.4.7.orig/programs/mailkey/mailkey.in openswan-2.4.7/programs/mailkey/mailkey.in
--- openswan-2.4.7.orig/programs/mailkey/mailkey.in 2006-10-29 02:49:23.000000000 +0300
+++ openswan-2.4.7/programs/mailkey/mailkey.in 2006-12-06 22:46:54.828836839 +0200
@@ -60,7 +60,7 @@
"$test1st"
-Common concerns: This account must be able to read /etc/ipsec.secrets.
+Common concerns: This account must be able to read /etc/ipsec/ipsec.secrets.
If you haven't generated your key yet, please run 'ipsec newhostkey'."
exit 0
}
diff -Nru openswan-2.4.7.orig/programs/pluto/Makefile openswan-2.4.7/programs/pluto/Makefile
--- openswan-2.4.7.orig/programs/pluto/Makefile 2006-11-07 17:55:52.000000000 +0200
+++ openswan-2.4.7/programs/pluto/Makefile 2006-12-06 22:46:54.832837088 +0200
@@ -256,7 +256,7 @@
-DPOLICYGROUPSDIR=\"${FINALCONFDDIR}/policies\" \
-DPERPEERLOGDIR=\"${FINALLOGDIR}/pluto/peer\"
-ALLFLAGS = $(CPPFLAGS) $(CFLAGS)
+ALLFLAGS = $(CPPFLAGS) $(CFLAGS) $(USERCOMPILE)
# libefence is a free memory allocation debugger
# Solaris 2 needs -lsocket -lnsl
diff -Nru openswan-2.4.7.orig/programs/setup/Makefile openswan-2.4.7/programs/setup/Makefile
--- openswan-2.4.7.orig/programs/setup/Makefile 2004-12-18 20:13:43.000000000 +0200
+++ openswan-2.4.7/programs/setup/Makefile 2006-12-06 22:46:54.832837088 +0200
@@ -33,25 +33,10 @@
@rm -f $(BINDIR)/setup
@$(INSTALL) $(INSTBINFLAGS) setup $(RCDIR)/ipsec
@ln -s $(FINALRCDIR)/ipsec $(BINDIR)/setup
- -@for i in 0 1 2 3 4 5 6; do mkdir -p $(RCDIR)/../rc$$i.d; done
- -@cd $(RCDIR)/../rc0.d && ln -f -s ../init.d/ipsec K76ipsec
- -@cd $(RCDIR)/../rc1.d && ln -f -s ../init.d/ipsec K76ipsec
- -@cd $(RCDIR)/../rc2.d && ln -f -s ../init.d/ipsec S47ipsec
- -@cd $(RCDIR)/../rc3.d && ln -f -s ../init.d/ipsec S47ipsec
- -@cd $(RCDIR)/../rc4.d && ln -f -s ../init.d/ipsec S47ipsec
- -@cd $(RCDIR)/../rc5.d && ln -f -s ../init.d/ipsec S47ipsec
- -@cd $(RCDIR)/../rc6.d && ln -f -s ../init.d/ipsec K76ipsec
install_file_list::
@echo $(RCDIR)/ipsec
@echo $(BINDIR)/setup
- @echo $(RCDIR)/../rc0.d/K76ipsec
- @echo $(RCDIR)/../rc1.d/K76ipsec
- @echo $(RCDIR)/../rc2.d/S47ipsec
- @echo $(RCDIR)/../rc3.d/S47ipsec
- @echo $(RCDIR)/../rc4.d/S47ipsec
- @echo $(RCDIR)/../rc5.d/S47ipsec
- @echo $(RCDIR)/../rc6.d/K76ipsec
clean::
@rm -f setup
diff -Nru openswan-2.4.7.orig/programs/showhostkey/showhostkey.in openswan-2.4.7/programs/showhostkey/showhostkey.in
--- openswan-2.4.7.orig/programs/showhostkey/showhostkey.in 2004-11-14 15:40:41.000000000 +0200
+++ openswan-2.4.7/programs/showhostkey/showhostkey.in 2006-12-06 22:46:54.844837840 +0200
@@ -18,7 +18,7 @@
usage="Usage: $me [--file secrets] [--left] [--right] [--txt gateway] [--id id]
[--dhclient] [--ipseckey]"
-file=/etc/ipsec.secrets
+file=/etc/ipsec/ipsec.secrets
fmt=""
gw=
id=
diff -Nru openswan-2.4.7.orig/programs/spi/spi.5 openswan-2.4.7/programs/spi/spi.5
--- openswan-2.4.7.orig/programs/spi/spi.5 2006-10-26 23:53:59.000000000 +0300
+++ openswan-2.4.7/programs/spi/spi.5 2006-12-06 23:00:11.910340779 +0200
@@ -157,7 +157,7 @@
.SH "FILES"
.PP
-/proc/net/ipsec_spi, /usr/local/bin/ipsec
+/proc/net/ipsec_spi, /usr/bin/ipsec
.SH "SEE ALSO"
diff -Nru openswan-2.4.7.orig/programs/spi/spi.8 openswan-2.4.7/programs/spi/spi.8
--- openswan-2.4.7.orig/programs/spi/spi.8 2006-10-30 22:00:04.000000000 +0200
+++ openswan-2.4.7/programs/spi/spi.8 2006-12-06 23:00:27.043286530 +0200
@@ -215,7 +215,7 @@
.SH "FILES"
.PP
-/proc/net/ipsec_spi, /usr/local/bin/ipsec
+/proc/net/ipsec_spi, /usr/bin/ipsec
.SH "SEE ALSO"
diff -Nru openswan-2.4.7.orig/programs/spigrp/spigrp.5 openswan-2.4.7/programs/spigrp/spigrp.5
--- openswan-2.4.7.orig/programs/spigrp/spigrp.5 2006-10-26 23:50:29.000000000 +0300
+++ openswan-2.4.7/programs/spigrp/spigrp.5 2006-12-06 23:01:25.650949280 +0200
@@ -67,7 +67,7 @@
.SH "FILES"
.PP
-/proc/net/ipsec_spigrp, /usr/local/bin/ipsec
+/proc/net/ipsec_spigrp, /usr/bin/ipsec
.SH "SEE ALSO"
diff -Nru openswan-2.4.7.orig/programs/spigrp/spigrp.8 openswan-2.4.7/programs/spigrp/spigrp.8
--- openswan-2.4.7.orig/programs/spigrp/spigrp.8 2006-10-26 23:50:29.000000000 +0300
+++ openswan-2.4.7/programs/spigrp/spigrp.8 2006-12-06 23:01:39.079788532 +0200
@@ -87,7 +87,7 @@
.SH "FILES"
.PP
-/proc/net/ipsec_spigrp, /usr/local/bin/ipsec
+/proc/net/ipsec_spigrp, /usr/bin/ipsec
.SH "SEE ALSO"
diff -Nru openswan-2.4.7.orig/programs/tncfg/tncfg.5 openswan-2.4.7/programs/tncfg/tncfg.5
--- openswan-2.4.7.orig/programs/tncfg/tncfg.5 2006-10-26 23:58:11.000000000 +0300
+++ openswan-2.4.7/programs/tncfg/tncfg.5 2006-12-06 23:01:59.385057530 +0200
@@ -101,7 +101,7 @@
.SH "FILES"
.PP
-/proc/net/ipsec_tncfg, /usr/local/bin/ipsec
+/proc/net/ipsec_tncfg, /usr/bin/ipsec
.SH "SEE ALSO"
diff -Nru openswan-2.4.7.orig/programs/tncfg/tncfg.8 openswan-2.4.7/programs/tncfg/tncfg.8
--- openswan-2.4.7.orig/programs/tncfg/tncfg.8 2006-10-26 23:58:11.000000000 +0300
+++ openswan-2.4.7/programs/tncfg/tncfg.8 2006-12-06 23:02:09.245673780 +0200
@@ -63,7 +63,7 @@
.SH "FILES"
.PP
-/proc/net/ipsec_tncfg, /usr/local/bin/ipsec
+/proc/net/ipsec_tncfg, /usr/bin/ipsec
.SH "SEE ALSO"

View File

@@ -0,0 +1,36 @@
SECTION = "console/network"
DESCRIPTION = "Openswan is an Open Source implementation of IPsec for the \
Linux operating system."
HOMEPAGE = "http://www.openswan.org"
LICENSE = "GPLv2"
DEPENDS = "gmp flex-native"
RRECOMMENDS = "kernel-module-ipsec"
RDEPENDS_nylon = "perl"
PR = "r0"
SRC_URI = "http://www.openswan.org/download/old/openswan-${PV}.tar.gz \
file://openswan-2.4.7-gentoo.patch;patch=1 \
file://installflags.patch;patch=1 \
file://ld-library-path-breakage.patch;patch=1"
S = "${WORKDIR}/openswan-${PV}"
PARALLEL_MAKE = ""
EXTRA_OEMAKE = "DESTDIR=${D} \
USERCOMPILE="${CFLAGS}" \
FINALCONFDIR=${sysconfdir}/ipsec \
INC_RCDEFAULT=${sysconfdir}/init.d \
INC_USRLOCAL=${prefix} \
INC_MANDIR=share/man WERROR=''"
do_compile () {
oe_runmake programs
}
do_install () {
oe_runmake install
}
FILES_${PN} = "${sysconfdir} ${libdir}/ipsec/* ${sbindir}/* ${libexecdir}/ipsec/*"
FILES_${PN}-dbg += "${libdir}/ipsec/.debug ${libexecdir}/ipsec/.debug"
CONFFILES_${PN} = "${sysconfdir}/ipsec/ipsec.conf"

View File

@@ -0,0 +1,18 @@
---
cmake/OpenSyncInternal.cmake.in | 1 -
1 file changed, 1 deletion(-)
--- libopensync-0.36.orig/cmake/OpenSyncInternal.cmake.in
+++ libopensync-0.36/cmake/OpenSyncInternal.cmake.in
@@ -5,11 +5,10 @@ INCLUDE( OpenSyncTesting )
INCLUDE( OpenSyncPackaging )
INCLUDE( OpenSyncPlugin )
INCLUDE( OpenSyncPlatforms )
INCLUDE( MacroEnsureOutOfSourceBuild )
-MACRO_ENSURE_OUT_OF_SOURCE_BUILD("${CMAKE_PROJECT_NAME} doesn't allow to build within the source directory. Please, create a seperate build directory and run 'cmake ${PROJECT_SOURCE_DIR} [options]'!")
SET( OPENSYNC_PLUGINDIR "@OPENSYNC_PLUGINDIR@" )
SET( OPENSYNC_FORMATSDIR "@OPENSYNC_FORMATSDIR@" )
SET( OPENSYNC_PYTHON_PLUGINDIR "@OPENSYNC_PYTHON_PLUGINDIR@" )

View File

@@ -0,0 +1,17 @@
---
opensync/CMakeLists.txt | 1 -
1 file changed, 1 deletion(-)
Index: libopensync-0.37/opensync/CMakeLists.txt
===================================================================
--- libopensync-0.37.orig/opensync/CMakeLists.txt 2008-10-15 13:56:45.000000000 +0100
+++ libopensync-0.37/opensync/CMakeLists.txt 2008-10-15 13:59:03.000000000 +0100
@@ -67,8 +67,6 @@
SET_TARGET_PROPERTIES( opensync PROPERTIES VERSION ${OPENSYNC_LIBVERSION_VERSION} )
SET_TARGET_PROPERTIES( opensync PROPERTIES SOVERSION ${OPENSYNC_LIBVERSION_SOVERSION} )
-SET_TARGET_PROPERTIES( opensync PROPERTIES COMPILE_FLAGS ${SYMBOLS_VISIBILITY} )
-
IF ( OPENSYNC_UNITTESTS )
ADD_LIBRARY( opensync-testing SHARED ${libopensync_LIB_SRCS} )
TARGET_LINK_LIBRARIES( opensync-testing ${GLIB2_LIBRARIES} ${GTHREAD2_LIBRARIES} ${GMODULE2_LIBRARIES} ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${LIBEXSLT_LIBRARIES} ${SQLITE3_LIBRARIES} )

View File

@@ -0,0 +1,16 @@
---
CMakeLists.txt | 1 -
1 file changed, 1 deletion(-)
Index: libopensync-0.37/CMakeLists.txt
===================================================================
--- libopensync-0.37.orig/CMakeLists.txt 2008-08-18 16:14:24.000000000 +0100
+++ libopensync-0.37/CMakeLists.txt 2008-10-15 14:00:12.000000000 +0100
@@ -65,7 +65,6 @@
FIND_PACKAGE( LibXslt REQUIRED )
FIND_PACKAGE( LibExslt REQUIRED )
FIND_PACKAGE( SWIG )
-FIND_PACKAGE( PythonLibs )
FIND_PACKAGE( Check )
ADD_SUBDIRECTORY( opensync )

View File

@@ -0,0 +1,23 @@
Index: libopensync-plugin-evolution2-0.36/cmake/modules/FindOpenSync.cmake
===================================================================
--- libopensync-plugin-evolution2-0.36.orig/cmake/modules/FindOpenSync.cmake 2008-10-20 13:07:14.000000000 +0100
+++ libopensync-plugin-evolution2-0.36/cmake/modules/FindOpenSync.cmake 2008-10-20 13:08:09.000000000 +0100
@@ -23,15 +23,15 @@
ENDIF ( OpenSync_FIND_REQUIRED )
IF ( OPENSYNC_MIN_VERSION )
- PKG_SEARCH_MODULE( OPENSYNC ${_pkgconfig_REQUIRED} opensync-1.0>=${OPENSYNC_MIN_VERSION} )
+ PKG_SEARCH_MODULE( OPENSYNC ${_pkgconfig_REQUIRED} libopensync>=${OPENSYNC_MIN_VERSION} )
ELSE ( OPENSYNC_MIN_VERSION )
- PKG_SEARCH_MODULE( OPENSYNC ${_pkgconfig_REQUIRED} opensync-1.0 )
+ PKG_SEARCH_MODULE( OPENSYNC ${_pkgconfig_REQUIRED} libopensync )
ENDIF ( OPENSYNC_MIN_VERSION )
FIND_PROGRAM( PKGCONFIG_EXECUTABLE NAMES pkg-config )
IF ( PKGCONFIG_EXECUTABLE )
- EXEC_PROGRAM( ${PKGCONFIG_EXECUTABLE} ARGS opensync-1.0 --variable=datadir OUTPUT_VARIABLE _opensync_data_DIR )
+ EXEC_PROGRAM( ${PKGCONFIG_EXECUTABLE} ARGS libopensync --variable=datadir OUTPUT_VARIABLE _opensync_data_DIR )
STRING( REGEX REPLACE "[\r\n]" " " _opensync_data_DIR "${_opensync_data_DIR}" )
ENDIF ( PKGCONFIG_EXECUTABLE )

View File

@@ -0,0 +1,7 @@
require libopensync-plugin_0.36.inc
DEPENDS += " eds-dbus"
SRC_URI += "file://0.37-fixes.patch;patch=1"
PR = "r1"

View File

@@ -0,0 +1 @@
require libopensync-plugin_0.36.inc

View File

@@ -0,0 +1 @@
require libopensync-plugin_0.36.inc

View File

@@ -0,0 +1,3 @@
require libopensync-plugin_0.36.inc
DEPENDS += "openobex bluez4"

View File

@@ -0,0 +1,13 @@
Index: libopensync-plugin-syncml-0.38/src/syncml_callbacks.c
===================================================================
--- libopensync-plugin-syncml-0.38.orig/src/syncml_callbacks.c 2009-07-31 10:30:33.000000000 +0100
+++ libopensync-plugin-syncml-0.38/src/syncml_callbacks.c 2009-07-31 10:30:39.000000000 +0100
@@ -405,7 +405,7 @@
} else {
/* This problem should be fixed with the next SLOW-SYNC. */
osync_trace(TRACE_EXIT_ERROR, "%s - unexpected Add or Replace command", __func__);
- smlErrorSet(error, SML_ERROR_TEMPORARY, "Unwanted Add or Replace command on second OMA DS session.");
+ smlErrorSet(error, SML_ERROR_GENERIC, "Unwanted Add or Replace command on second OMA DS session.");
return FALSE;
}
}

View File

@@ -0,0 +1,7 @@
require libopensync-plugin_0.36.inc
DEPENDS += " libsyncml (>= 0.4.7)"
SRC_URI += "file://fixerror.patch;patch=1"
PR = "r1"

View File

@@ -0,0 +1,3 @@
require libopensync-plugin_0.36.inc
DEPENDS += " check"

View File

@@ -0,0 +1,9 @@
DEPENDS = "libopensync (>= 0.36)"
SRC_URI = "http://opensync.org/download/releases/${PV}/${P}.tar.bz2"
inherit cmake
FILES_${PN} += "${libdir}/opensync*/plugins/*.so \
${libdir}/opensync*/formats/*.so \
${datadir}/opensync*/defaults/"

View File

@@ -0,0 +1,25 @@
LICENSE = "LGPL"
HOMEPAGE = "http://www.opensync.org/"
DEPENDS = "sqlite3 libxml2 glib-2.0 check zlib libxslt"
PR = "r1"
SRC_URI = "http://opensync.org/download/releases/${PV}/libopensync-${PV}.tar.bz2\
file://cmake.patch;patch=1 \
file://build-in-src.patch;patch=1 \
file://no-python-check.patch;patch=1"
inherit cmake pkgconfig
LEAD_SONAME = "libopensync.so"
FILES_${PN} += " ${libdir}/opensync*/formats/*.so \
${libdir}/opensync*/osplugin \
${datadir}/opensync*/schemas \
${datadir}/opensync*/capabilities \
${datadir}/opensync*/descriptions \
"
FILES_${PN}-dbg += " ${libdir}/opensync*/formats/.debug/*.so \
${libdir}/opensync*/.debug/osplugin "

View File

@@ -0,0 +1,19 @@
DESCRIPTION = "LibSync is a GObject-based framework for more convenient use of \
OpenSync in GLib applications."
LICENSE = "LGPL"
SECTION = "x11"
DEPENDS = "glib-2.0 gtk+ libglade libopensync avahi"
RRECOMMENDS = "\
libopensync-plugin-file \
"
PV = "0.0+svnr${SRCREV}"
SRC_URI = "svn://svn.o-hand.com/repos/sync/trunk;module=sync;proto=http"
inherit autotools pkgconfig
S = "${WORKDIR}/sync"
PACKAGES += "synctool"
FILES_${PN} = "${libdir}/lib*.so.*"
FILES_synctool = "${bindir} ${datadir}"

View File

@@ -0,0 +1,19 @@
---
CMakeLists.txt | 4 ----
1 file changed, 4 deletions(-)
Index: libsyncml-0.5.4/CMakeLists.txt
===================================================================
--- libsyncml-0.5.4.orig/CMakeLists.txt 2009-07-31 09:56:16.000000000 +0100
+++ libsyncml-0.5.4/CMakeLists.txt 2009-07-31 09:57:33.000000000 +0100
@@ -72,10 +72,6 @@
CHECK_TYPE_SIZE( uint32_t UINT32_T )
CHECK_TYPE_SIZE( uint8_t UINT8_T )
-# ensure out od source build
-INCLUDE( MacroEnsureOutOfSourceBuild )
-MACRO_ENSURE_OUT_OF_SOURCE_BUILD("${CMAKE_PROJECT_NAME} doesn't allow to build within the source directory. Please, create a seperate build directory and run 'cmake ${PROJECT_SOURCE_DIR} [options]'!")
-
# find requirements
SET ( GLIB2_MIN_VERSION "2.12" )
SET ( OPENOBEX_MIN_VERSION "1.1" )

View File

@@ -0,0 +1,17 @@
DESCRIPTION = "Libsyncml is a implementation of the SyncML protocol."
HOMEPAGE = "http://libsyncml.opensync.org/"
LICENSE = "LGPL"
DEPENDS = "sed-native wbxml2 libsoup libxml2 bluez4 openobex check"
PR = "r1"
SRC_URI = "${SOURCEFORGE_MIRROR}/libsyncml/0.5.4/libsyncml-0.5.4.tar.bz2 \
file://build-in-src.patch;patch=1"
inherit cmake pkgconfig
PACKAGES += "${PN}-tools"
FILES_${PN}-tools = "${bindir}"
FILES_${PN} = "${libdir}/*.so.*"
export VERBOSE=1

View File

@@ -0,0 +1,7 @@
SRC_URI = "http://www.opensync.org/download/releases/${PV}/msynctool-${PV}.tar.bz2"
LICENSE = "GPL"
DEPENDS = "libopensync glib-2.0"
HOMEPAGE = "http://www.opensync.org/"
inherit cmake pkgconfig

View File

@@ -0,0 +1,44 @@
From: Mike Frysinger <vapier@gentoo.org>
Date: Sun, 13 May 2007 21:15:12 +0000 (-0400)
Subject: respect DESTDIR and dont use -s with install
X-Git-Url: http://neil.brown.name/git?p=portmap;a=commitdiff_plain;h=603c59b978c04df2354f68d4a2dc676a758ff46d
respect DESTDIR and dont use -s with install
$(DESTDIR) is the standard for installing into other trees, not $(BASEDIR) ...
so I've converted the Makefile to use that. I've also left in $(BASEDIR) as a
default to support old installs; not sure if you'd just cut it.
Stripping should be left to the person to handle, not automatically done by
the install step. Also, `install -s` always calls `strip` which is
wrong/undesired in cross-compiling scenarios.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Neil Brown <neilb@suse.de>
---
diff --git a/Makefile b/Makefile
index 9e9a4b4..5343428 100644
--- a/Makefile
+++ b/Makefile
@@ -135,13 +135,14 @@ from_local: CPPFLAGS += -DTEST
portmap.man : portmap.8
sed $(MAN_SED) < portmap.8 > portmap.man
+DESTDIR = $(BASEDIR)
install: all
- install -o root -g root -m 0755 -s portmap ${BASEDIR}/sbin
- install -o root -g root -m 0755 -s pmap_dump ${BASEDIR}/sbin
- install -o root -g root -m 0755 -s pmap_set ${BASEDIR}/sbin
- install -o root -g root -m 0644 portmap.man ${BASEDIR}/usr/share/man/man8/portmap.8
- install -o root -g root -m 0644 pmap_dump.8 ${BASEDIR}/usr/share/man/man8
- install -o root -g root -m 0644 pmap_set.8 ${BASEDIR}/usr/share/man/man8
+ install -o root -g root -m 0755 portmap $(DESTDIR)/sbin
+ install -o root -g root -m 0755 pmap_dump $(DESTDIR)/sbin
+ install -o root -g root -m 0755 pmap_set $(DESTDIR)/sbin
+ install -o root -g root -m 0644 portmap.man $(DESTDIR)/usr/share/man/man8/portmap.8
+ install -o root -g root -m 0644 pmap_dump.8 $(DESTDIR)/usr/share/man/man8
+ install -o root -g root -m 0644 pmap_set.8 $(DESTDIR)/usr/share/man/man8
clean:
rm -f *.o portmap pmap_dump pmap_set from_local \

View File

@@ -0,0 +1,28 @@
From: Mike Frysinger <vapier@gentoo.org>
Date: Sun, 13 May 2007 21:17:32 +0000 (-0400)
Subject: fix building with tcpd support disabled
X-Git-Url: http://neil.brown.name/git?p=portmap;a=commitdiff_plain;h=7847207aed1b44faf077eed14a9ac9c68244eba5
fix building with tcpd support disabled
Make sure pmap_check.c only includes tcpd.h when HOSTS_ACCESS is defined.
Signed-off-by: Timothy Redaelli <drizzt@gentoo.org>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Neil Brown <neilb@suse.de>
---
diff --git a/pmap_check.c b/pmap_check.c
index 84f2c12..443a822 100644
--- a/pmap_check.c
+++ b/pmap_check.c
@@ -44,7 +44,9 @@
#include <netinet/in.h>
#include <rpc/rpcent.h>
#endif
+#ifdef HOSTS_ACCESS
#include <tcpd.h>
+#endif
#include <arpa/inet.h>
#include <grp.h>

View File

@@ -0,0 +1,31 @@
DESCRIPTION = "RPC program number mapper."
HOMEPAGE = "http://neil.brown.name/portmap/"
SECTION = "console/network"
LICENSE = "BSD"
LIC_FILES_CHKSUM = "file://portmap.c;beginline=2;endline=31;md5=51ff67e66ec84b2009b017b1f94afbf4 \
file://from_local.c;beginline=9;endline=35;md5=1bec938a2268b8b423c58801ace3adc1"
DEPENDS = "virtual/fakeroot-native"
SRC_URI = "${DEBIAN_MIRROR}/main/p/portmap/portmap_5.orig.tar.gz \
${DEBIAN_MIRROR}/main/p/portmap/portmap_${PV}.diff.gz;patch=1 \
file://portmap.init \
file://make.patch;apply=yes"
S = "${WORKDIR}/portmap_5beta"
INITSCRIPT_NAME = "portmap"
INITSCRIPT_PARAMS = "start 43 S . start 32 0 6 . stop 81 1 ."
inherit update-rc.d
sbindir = "/sbin"
fakeroot do_install() {
install -d ${D}${sysconfdir}/init.d
install -d ${D}${base_sbindir}
install -m 0755 ${WORKDIR}/portmap.init ${D}${sysconfdir}/init.d/portmap
oe_runmake 'docdir=${docdir}/portmap' 'DESTDIR=${D}' install
}
PACKAGES =+ "portmap-utils"
FILES_portmap-utils = "/sbin/pmap_set /sbin/pmap_dump"
FILES_${PN}-doc += "${docdir}"

View File

@@ -0,0 +1,59 @@
#!/bin/sh
#
### BEGIN INIT INFO
# Provides: portmap
# Required-Start: $network
# Required-Stop: $network
# Default-Start: S 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: The RPC portmapper
# Description: Portmap is a server that converts RPC (Remote
# Procedure Call) program numbers into DARPA
# protocol port numbers. It must be running in
# order to make RPC calls. Services that use
# RPC include NFS and NIS.
### END INIT INFO
test -f /sbin/portmap || exit 0
case "$1" in
start)
echo "Starting portmap daemon..."
start-stop-daemon --start --quiet --exec /sbin/portmap
if [ -f /var/run/portmap.upgrade-state ]; then
echo "Restoring old RPC service information..."
sleep 1 # needs a short pause or pmap_set won't work. :(
pmap_set </var/run/portmap.upgrade-state
rm -f /var/run/portmap.upgrade-state
echo "done."
fi
;;
stop)
echo "Stopping portmap daemon..."
start-stop-daemon --stop --quiet --exec /sbin/portmap
;;
reload)
;;
force-reload)
$0 restart
;;
restart)
pmap_dump >/var/run/portmap.state
$0 stop
$0 start
if [ ! -f /var/run/portmap.upgrade-state ]; then
sleep 1
pmap_set </var/run/portmap.state
fi
rm -f /var/run/portmap.state
;;
*)
echo "Usage: /etc/init.d/portmap {start|stop|reload|restart}"
exit 1
;;
esac
exit 0

Some files were not shown because too many files have changed in this diff Show More