1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-21 00:25:50 +00:00

Add new port: devel/lnphost

PR:		182288
Submitted by:	Jason Bacon

     =================================================================

A library supporting IR communication over the Lego Mindstorms IR tower.
It can be used from C programs on Posix compliant platforms, supports
multiple protocols and is designed to be a replacement for lnpd.
This commit is contained in:
John Marino 2014-08-03 21:25:42 +00:00
parent cb8af26bb1
commit 3c0a036bf7
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=363938
6 changed files with 116 additions and 0 deletions

View File

@ -1189,6 +1189,7 @@
SUBDIR += lm4tools
SUBDIR += lmdbg
SUBDIR += lndir
SUBDIR += lnphost
SUBDIR += lockfree-malloc
SUBDIR += log4c
SUBDIR += log4cplus

32
devel/lnphost/Makefile Normal file
View File

@ -0,0 +1,32 @@
# Created by: Jason Bacon <jwbacon@tds.net>
# $FreeBSD$
PORTNAME= lnphost
PORTVERSION= 1.0a
CATEGORIES= devel
MASTER_SITES= SF
MAINTAINER= jwbacon@tds.net
COMMENT= Lego RCX iinfrared communication API
LICENSE= GPLv2
USES= zip gmake
WRKSRC= ${WRKDIR}/lnphost
CFLAGS+= -DHAVE_STRING_H
PLIST_FILES= bin/lnpdump \
lib/lnphost.a \
include/lnphost.h \
man/man1/lnpdump.1.gz
MAKE_ARGS= PREFIX=${STAGEDIR}${PREFIX}
# Use system getopt
post-patch:
${RM} ${WRKSRC}/Include/getopt.h ${WRKSRC}/Modules/getopt.c
post-install:
${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/lnpdump
.include <bsd.port.mk>

2
devel/lnphost/distinfo Normal file
View File

@ -0,0 +1,2 @@
SHA256 (lnphost-1.0a.zip) = 194aa84b926b6b2a742184d45ad88ef3e8c6976ad28fdfb8cea1ed69cc236641
SIZE (lnphost-1.0a.zip) = 30007

View File

@ -0,0 +1,11 @@
--- Include/lnphost.h.orig Sat Nov 20 14:22:00 2004
+++ Include/lnphost.h Thu Sep 13 22:22:20 2007
@@ -21,6 +21,8 @@
#if defined(LINUX) || defined(linux)
#define LNP_DEFAULTDEVICE "/dev/ttyS0"
+#elif defined (__FreeBSD__)
+#define LNP_DEFAULTDEVICE "/dev/cuad0"
#elif defined (__CYGWIN__) || (_WIN32)
#define LNP_DEFAULTDEVICE "com1"
#else

View File

@ -0,0 +1,65 @@
--- Makefile.orig Fri Mar 18 10:20:31 2005
+++ Makefile Thu Sep 13 21:14:41 2007
@@ -8,16 +8,20 @@
endif
PROGRAMS=$(patsubst %.c,%$(EXT),$(wildcard *.c))
-BINDIR=/usr/local/bin
-MANDIR=/usr/share/man/man1
+LIBS=lnphost.a
-all: $(PROGRAMS)
+BINDIR=${PREFIX}/bin
+MANDIR=${PREFIX}/man/man1
+LIBDIR=${PREFIX}/lib
+INCDIR=${PREFIX}/include
+
+all: $(PROGRAMS) $(LIBS)
clean:
- make -C Docs clean
- rm -f *~ */*~
- rm -f $(patsubst %.c,%.o,$(wildcard Modules/*.c))
- rm -f $(patsubst %.c,%$(EXT),$(wildcard *.c))
+ ${MAKE} -C Docs clean
+ ${RM} -f *~ */*~
+ ${RM} -f $(patsubst %.c,%.o,$(wildcard Modules/*.c))
+ ${RM} -f $(patsubst %.c,%$(EXT),$(wildcard *.c))
needroot:
@if [ ! $$UID -eq 0 ]; then \
@@ -26,21 +30,27 @@
fi
install: all needroot
- make -C Docs all
- install -g root -o root -m 644 Docs/lnpdump.1.gz $(MANDIR)
- install -g root -o root -m 755 lnpdump$(EXT) $(BINDIR)
+ ${MAKE} -C Docs all
+ install -g 0 -o 0 -m 644 Docs/lnpdump.1 $(MANDIR)
+ install -g 0 -o 0 -m 755 lnpdump$(EXT) $(BINDIR)
+ install -g 0 -o 0 -m 0644 lnphost.a $(LIBDIR)
+ install -g 0 -o 0 -m 0644 Include/lnphost.h $(INCDIR)
remove: needroot
- rm -f $(MANDIR)/lnpdump.1.gz
- rm -f $(BINDIR)/lnpdump$(EXT)
+ ${RM} -f $(MANDIR)/lnpdump.1.gz
+ ${RM} -f $(BINDIR)/lnpdump$(EXT)
+ ${RM} -f $(LIBDIR)/lnphost.a
+ ${RM} -f $(INCDIR)/lnphost.h
-lnpdump$(EXT): lnpdump.c Modules/getopt.o Modules/lnphost.o
+lnpdump$(EXT): lnpdump.c Modules/lnphost.o
$(CC) $(CFLAGS) -Wall -IInclude -o $@ $+ -lpthread
Modules/%.o: Modules/%.c Include/%.h
$(CC) $(CFLAGS) -Wall -IInclude -c -o $@ $<
-posrecv$(EXT): posrecv.c Modules/getopt.o Modules/lnphost.o
+posrecv$(EXT): posrecv.c Modules/lnphost.o
$(CC) $(CFLAGS) -Wall -IInclude -o $@ $+ -lpthread
+lnphost.a: Modules/lnphost.o
+ $(AR) r lnphost.a Modules/lnphost.o

5
devel/lnphost/pkg-descr Normal file
View File

@ -0,0 +1,5 @@
A library supporting IR communication over the Lego Mindstorms IR tower.
It can be used from C programs on Posix compliant platforms, supports
multiple protocols and is designed to be a replacement for lnpd.
WWW: http://sourceforge.net/projects/lnphost/?source=directory