aboutsummaryrefslogtreecommitdiffstats
path: root/security/ophcrack
diff options
context:
space:
mode:
authordanfe <danfe@FreeBSD.org>2008-09-17 19:30:08 +0800
committerdanfe <danfe@FreeBSD.org>2008-09-17 19:30:08 +0800
commit05ae9a3c821153b3d40c53ddaaea6648f51abc8d (patch)
treee0ccfd13cbf16c46a453c1d20a673ed02b24af18 /security/ophcrack
parentf14e71ccda6535f09475771c647fac803fd6eb6a (diff)
downloadfreebsd-ports-gnome-05ae9a3c821153b3d40c53ddaaea6648f51abc8d.tar.gz
freebsd-ports-gnome-05ae9a3c821153b3d40c53ddaaea6648f51abc8d.tar.zst
freebsd-ports-gnome-05ae9a3c821153b3d40c53ddaaea6648f51abc8d.zip
- Unbreak on big-endian architectures
- Avoid patching things at extract phase Based on a patch from: gahr Approved by: portmgr (pav) Tested on: amd64, sparc64
Diffstat (limited to 'security/ophcrack')
-rw-r--r--security/ophcrack/Makefile19
1 files changed, 17 insertions, 2 deletions
diff --git a/security/ophcrack/Makefile b/security/ophcrack/Makefile
index 2c531d6d3879..8a7010b3ffc4 100644
--- a/security/ophcrack/Makefile
+++ b/security/ophcrack/Makefile
@@ -25,16 +25,31 @@ MAN1= bkhive.1 samdump2.1
TOOLS_VER= 1.1.1
-post-extract:
+post-patch:
@${REINPLACE_CMD} -e '/^CFLAGS=/d' ${WRKSRC}/${CONFIGURE_SCRIPT}
# Do not install any Linux binaries: we build and install native ones;
# mute their banner as well in favor of our nice pkg-message
@${REINPLACE_CMD} -e 's/ install-exec-local// ; 605,617d' \
${WRKSRC}/Makefile.in
# Hint the tools about correct endianness
- @${REINPLACE_CMD} -e '27s,^$$,#include <machine/endian.h>,' \
+ @${REINPLACE_CMD} -e '22s,^$$,#include <sys/endian.h>,' \
+ ${WRKDIR}/bkhive-${TOOLS_VER}/bkhive.c
+ @${REINPLACE_CMD} -e '26s,^$$,#include <sys/endian.h>,' \
+ ${WRKDIR}/bkhive-${TOOLS_VER}/hive.c
+ @${REINPLACE_CMD} -e '27s,^$$,#include <sys/endian.h>,' \
+ ${WRKDIR}/samdump2-${TOOLS_VER}/samdump2.c
+# FreeBSD does not have <byteswap.h>
+ @${REINPLACE_CMD} -e '/byteswap\.h/d' \
${WRKDIR}/bkhive-${TOOLS_VER}/bkhive.c \
+ ${WRKDIR}/bkhive-${TOOLS_VER}/hive.c \
+ ${WRKDIR}/samdump2-${TOOLS_VER}/samdump2.c
+# And our swap function names are prettier
+ @${REINPLACE_CMD} -E 's,__bswap_([[:digit:]]+),bswap\1,' \
+ ${WRKDIR}/bkhive-${TOOLS_VER}/hive.c \
${WRKDIR}/samdump2-${TOOLS_VER}/samdump2.c
+# Link to file instead of patching identical copy
+ @${LN} -sf ../bkhive-${TOOLS_VER}/hive.c \
+ ${WRKDIR}/samdump2-${TOOLS_VER}/hive.c
post-build:
# Build auxiliary tools (useful: e.g., samdump2 is called at runtime)