aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--misc/hotkeys/Makefile23
-rw-r--r--misc/hotkeys/files/patch-configure76
-rw-r--r--misc/hotkeys/files/patch-src-conf.c45
-rw-r--r--misc/hotkeys/files/patch-src-hotkeys.c16
-rw-r--r--misc/hotkeys/files/patch-src-hotkeys.conf13
-rw-r--r--misc/hotkeys/pkg-plist2
6 files changed, 148 insertions, 27 deletions
diff --git a/misc/hotkeys/Makefile b/misc/hotkeys/Makefile
index ce6ad2a8552d..8d8214dad960 100644
--- a/misc/hotkeys/Makefile
+++ b/misc/hotkeys/Makefile
@@ -6,7 +6,7 @@
PORTNAME= hotkeys
PORTVERSION= 0.5.7.1
-PORTREVISION= 4
+PORTREVISION= 5
CATEGORIES= misc
MASTER_SITES= http://ypwong.org/hotkeys/${PORTVERSION}/ \
${MASTER_SITE_XCONTRIB}
@@ -15,20 +15,20 @@ DISTNAME= hotkeys_${PORTVERSION}
MAINTAINER= ports@FreeBSD.org
COMMENT= Allows usage of special keys on internet/multimedia keyboards
-LIB_DEPENDS= xml2.5:${PORTSDIR}/textproc/libxml2 \
- db3.3:${PORTSDIR}/databases/db3
+LIB_DEPENDS= xml2.5:${PORTSDIR}/textproc/libxml2
WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION}
-CONFIGURE_ARGS= --with-db3-inc=${LOCALBASE}/include/db3 \
- --with-db3-lib=${LOCALBASE}/lib \
+CONFIGURE_ARGS= --with-db3-inc=${BDB_INCLUDE_DIR} \
+ --with-db3-lib=${BDB_LIB_DIR} \
+ --with-db-name=${BDB_LIB_NAME} \
--x-includes=${X11BASE}/include \
--x-libraries=${X11BASE}/lib
GNU_CONFIGURE= yes
+USE_BDB= yes
USE_GMAKE= yes
+
MAN1= hotkeys.1
-ORIG_CONFIG= ${PREFIX}/etc/hotkeys.conf
-SAMPLE_CONFIG= ${PREFIX}/etc/hotkeys.conf.sample
OPTIONS= XOSD "Enable On-Screen-Display support" on
@@ -44,8 +44,15 @@ post-extract:
@${CP} ${PATCHDIR}/eliteduo.def ${WRKSRC}/def
@${CP} ${PATCHDIR}/logitech-ultrax.def ${WRKSRC}/def
+post-patch:
+ @${REINPLACE_CMD} -e '/^install-exec-am/s/install-sysconfDATA//' \
+ ${WRKSRC}/src/Makefile.in
+
post-install:
- @${MV} ${ORIG_CONFIG} ${SAMPLE_CONFIG}
+ @${INSTALL_DATA} ${WRKSRC}/src/hotkeys.conf ${PREFIX}/etc/hotkeys.conf.sample
+ @if [ ! -f ${PREFIX}/etc/hotkeys.conf ]; then \
+ ${CP} -p ${PREFIX}/etc/hotkeys.conf.sample ${PREFIX}/etc/hotkeys.conf ; \
+ fi
@${CAT} ${PKGMESSAGE}
.include <bsd.port.post.mk>
diff --git a/misc/hotkeys/files/patch-configure b/misc/hotkeys/files/patch-configure
index 123312ec3209..027faa796e23 100644
--- a/misc/hotkeys/files/patch-configure
+++ b/misc/hotkeys/files/patch-configure
@@ -1,5 +1,5 @@
---- configure.orig Sun Dec 8 09:34:24 2002
-+++ configure Sun May 11 22:17:53 2003
+--- configure.orig Sun Dec 8 22:34:24 2002
++++ configure Fri Mar 2 22:30:45 2007
@@ -251,6 +251,7 @@
# Initializations.
#
@@ -30,7 +30,30 @@
if test -n "$ac_prev"; then
ac_option=--`echo $ac_prev | sed 's/_/-/g'`
{ echo "$as_me: error: missing argument to $ac_option" >&2
-@@ -4353,13 +4369,13 @@
+@@ -859,6 +875,7 @@
+ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
+ --with-xml-prefix=PFX Prefix where GNOME XML library is installed
++ --with-db-name=NAME set the library name of Berkeley DB
+ --with-db3-inc=DIR Set the include directory of Berkeley DB3
+ --with-db3-lib=DIR Set the library directory of Berkeley DB3
+ --with-gtk Use GTK interface (incl. splash screen, default is
+@@ -2827,6 +2844,14 @@
+ enable_xmltest=yes
+ fi;
+
++# Check whether --with-db_name or --without-db_name was given.
++if test "${with_db_name+set}" = set; then
++ withval="$with_db_name"
++ test x$withval != x && with_db_name="$withval"
++else
++ with_db_name='db'
++fi;
++
+
+ # Check whether --with-db3-inc or --without-db3-inc was given.
+ if test "${with_db3_inc+set}" = set; then
+@@ -4353,13 +4378,13 @@
fi
@@ -47,7 +70,7 @@
cat >conftest.$ac_ext <<_ACEOF
#line $LINENO "configure"
/* confdefs.h. */
-@@ -4412,7 +4428,7 @@
+@@ -4412,7 +4437,7 @@
#define HAVE_LIBPTHREAD 1
_ACEOF
@@ -56,3 +79,48 @@
fi
+@@ -4435,7 +4460,11 @@
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ ac_check_lib_save_LIBS=$LIBS
+-LIBS="-ldb3 $LIBS"
++LIBS="-l$with_db_name $LIBS"
++__db_create="db_create"
++if [ "$with_db_name" = "db-4.2" ]; then
++ __db_create="db_create_4002"
++fi
+ cat >conftest.$ac_ext <<_ACEOF
+ #line $LINENO "configure"
+ /* confdefs.h. */
+@@ -4450,11 +4479,11 @@
+ #endif
+ /* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+-char db_create ();
++char $__db_create ();
+ int
+ main ()
+ {
+-db_create ();
++$__db_create ();
+ ;
+ return 0;
+ }
+@@ -4488,7 +4517,7 @@
+ #define HAVE_LIBDB3 1
+ _ACEOF
+
+- LIBS="-ldb3 $LIBS"
++ LIBS="-l$with_db_name $LIBS"
+
+ else
+ nodb=yes
+@@ -4590,7 +4619,7 @@
+ {
+ int major=0, minor=0, patch=0;
+ db_version(&major, &minor, &patch);
+- if ( major==3 && ((minor==2 && patch>=9) || minor>2) )
++ if ( major > 3 || (major==3 && ((minor==2 && patch>=9) || minor>2)) )
+ exit(0);
+ else
+ exit(1);
diff --git a/misc/hotkeys/files/patch-src-conf.c b/misc/hotkeys/files/patch-src-conf.c
index 318f09abc9a4..4379281343b6 100644
--- a/misc/hotkeys/files/patch-src-conf.c
+++ b/misc/hotkeys/files/patch-src-conf.c
@@ -1,15 +1,15 @@
--- src/conf.c.orig Thu Nov 28 03:30:08 2002
-+++ src/conf.c Fri Mar 2 19:26:23 2007
-@@ -25,7 +25,7 @@
- #include "common.h"
++++ src/conf.c Fri Mar 2 19:57:12 2007
+@@ -31,6 +31,8 @@
- #include <stdio.h>
--#include <db.h>
-+#include </usr/local/include/db3/db.h>
- #include <string.h>
- #include <sys/param.h>
+ #include "conf.h"
-@@ -68,6 +68,9 @@
++#define DB_VERSION (DB_VERSION_MAJOR*100000+DB_VERSION_MINOR*1000+DB_VERSION_PATCH)
++
+ char* conf_keys[] = {
+
+ /* KEY DEFAULT VALUE */
+@@ -68,6 +70,9 @@
"Shopping", "mozilla -remote 'openURL(http://thinkgeek.com)'",
"Go", "mozilla -remote 'openURL(http://linux.com)'",
"Print", "lpr",
@@ -19,7 +19,7 @@
/*
"Screendump", "xwd -root",
*/
-@@ -75,9 +78,14 @@
+@@ -75,9 +80,14 @@
// "osd_font", "-*-lucidatypewriter-bold-r-normal-*-*-250-*-*-*-*-*-*",
"osd_font", "lucidasanstypewriter-bold-24",
"osd_color", "LawnGreen",
@@ -35,3 +35,28 @@
NULL, NULL
};
+@@ -242,14 +252,24 @@
+ char* h;
+ char filename[MAXPATHLEN];
+
++ dbp = NULL;
++
+ /* Create the hash table */
++#if DB_VERSION >= 300000
+ if ( (ret = db_create(&dbp, dbenv, 0)) != 0 )
+ {
+ uError("Failed in db_create: %d", ret);
+ bailout();
+ }
++#endif
+
++#if DB_VERSION >= 401025
++ if ( (ret = dbp->open(dbp, NULL, NULL, NULL, DB_HASH, DB_CREATE, 0664)) != 0 )
++#elif DB_VERSION >= 300000
+ if ( (ret = dbp->open(dbp, NULL, NULL, DB_HASH, DB_CREATE, 0664)) != 0 )
++#else
++ if ( (ret = dbp->open(NULL, DB_HASH, DB_CREATE, 0644, NULL, NULL, &dbp)) != 0 )
++#endif
+ {
+ uError("Can't create hash table: %d", ret);
+ bailout();
diff --git a/misc/hotkeys/files/patch-src-hotkeys.c b/misc/hotkeys/files/patch-src-hotkeys.c
index 77b057adf370..2d36f65ab9be 100644
--- a/misc/hotkeys/files/patch-src-hotkeys.c
+++ b/misc/hotkeys/files/patch-src-hotkeys.c
@@ -1,5 +1,5 @@
--- src/hotkeys.c.orig Wed Dec 4 03:26:32 2002
-+++ src/hotkeys.c Fri Mar 2 19:27:17 2007
++++ src/hotkeys.c Mon Mar 5 20:33:39 2007
@@ -54,7 +54,7 @@
#include <fcntl.h>
#include <sys/ioctl.h>
@@ -260,7 +260,7 @@
}
#endif
break; /* break the for loop */
-@@ -1435,15 +1450,17 @@
+@@ -1435,15 +1450,16 @@
#ifdef HAVE_LIBXOSD
if ( osd )
{
@@ -283,11 +283,10 @@
+ xosd_set_vertical_offset(osd, atoi(getConfig("osd_voffset")));
+ xosd_set_font(osd, xstrdup(getConfig("osd_font")));
+ xosd_set_align(osd, strncmp(getConfig("osd_align"),"left",4)?((!strncmp(getConfig("osd_align"),"center",6))?XOSD_center:XOSD_right):XOSD_left);
-+ xosd_set_align(osd, XOSD_center);
}
#endif
}
-@@ -1592,6 +1609,7 @@
+@@ -1592,6 +1608,7 @@
doMute();
} else
/* APM stuffs */
@@ -295,7 +294,7 @@
if ( ev.message.keycode == (kbd.defCmds)[sleepKey].key ||
ev.message.keycode == (kbd.defCmds)[wakeupKey].key ) {
sleepState(STANDBY);
-@@ -1601,8 +1619,9 @@
+@@ -1601,14 +1618,15 @@
}
else
{
@@ -306,3 +305,10 @@
}
}
+ #ifdef HAVE_LIBXOSD
+ if (osd)
+- xosd_uninit(osd);
++ xosd_destroy(osd);
+ #endif
+ XCloseDisplay(dpy);
+ closelog();
diff --git a/misc/hotkeys/files/patch-src-hotkeys.conf b/misc/hotkeys/files/patch-src-hotkeys.conf
new file mode 100644
index 000000000000..e282c610a63c
--- /dev/null
+++ b/misc/hotkeys/files/patch-src-hotkeys.conf
@@ -0,0 +1,13 @@
+--- src/hotkeys.conf.orig Fri Nov 22 02:03:35 2002
++++ src/hotkeys.conf Mon Mar 5 20:30:28 2007
+@@ -44,4 +44,9 @@
+ # osd_timeout=3
+ ### osd_position is either 'top' or 'bottom'
+ # osd_position=bottom
+-# osd_offset=25
++# osd_align=right
++# osd_voffset=10
++# osd_hoffset=0
++# osd_shadow_offset=0
++# osd_shadow_color=Black
++# osd_bar_length=20
diff --git a/misc/hotkeys/pkg-plist b/misc/hotkeys/pkg-plist
index 9e6c3f408cc7..5826d26482a4 100644
--- a/misc/hotkeys/pkg-plist
+++ b/misc/hotkeys/pkg-plist
@@ -1,5 +1,7 @@
bin/hotkeys
+@unexec if cmp -s %D/etc/hotkeys.conf.sample %D/etc/hotkeys.conf; then rm -f %D/etc/hotkeys.conf; fi
etc/hotkeys.conf.sample
+@exec if [ ! -f %D/etc/hotkeys.conf ] ; then cp -p %D/%F %B/hotkeys.conf; fi
%%DATADIR%%/splash.png
%%DATADIR%%/acerwl.def
%%DATADIR%%/btc9000.def