Skip to content

Commit

Permalink
devel/libk8055: Sanitize MANPREFIX
Browse files Browse the repository at this point in the history
- Add LICENSE GPLv2+ mentioned in code
- Refresh patches

Approved by:	portmgr (blanket)
  • Loading branch information
5u623l20 committed Jan 21, 2024
1 parent 1e66610 commit d5807b7
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 22 deletions.
7 changes: 5 additions & 2 deletions devel/libk8055/Makefile
@@ -1,5 +1,6 @@
PORTNAME= libk8055
PORTVERSION= 0.2
PORTREVISION= 1
CATEGORIES= devel
MASTER_SITES= http://www.horizon9.org/~geroy/download/k8055/ \
http://xz.cx/downloads/k8055/
Expand All @@ -8,16 +9,18 @@ MAINTAINER= jake@xz.cx
COMMENT= Velleman K8055 USB experimental board support and command line tool
WWW= http://www.horizon9.org/~geroy/

USE_LDCONFIG= yes
LICENSE= GPLv2+

USE_CSTD= gnu89
USE_LDCONFIG= yes

PLIST_FILES= bin/k8055 \
include/k8055.h \
lib/libk8055.c \
lib/libk8055.o \
lib/libk8055.so \
lib/libk8055.so.0.2 \
man/man1/k8055.1.gz
share/man/man1/k8055.1.gz

post-patch:
@${RM} ${WRKSRC}/libk8055.c.orig
Expand Down
22 changes: 15 additions & 7 deletions devel/libk8055/files/patch-Makefile
@@ -1,5 +1,5 @@
--- Makefile.orig 2006-07-29 18:03:43.000000000 +0800
+++ Makefile 2014-05-27 17:29:02.806622803 +0800
--- Makefile.orig 2006-07-29 10:03:43 UTC
+++ Makefile
@@ -1,22 +1,22 @@
-cc = gcc
+CC ?= gcc
Expand All @@ -11,7 +11,7 @@
+bindir = ${PREFIX}/bin
+libdir = ${PREFIX}/lib
+includedir = ${PREFIX}/include
+mandir = ${MANPREFIX}/man/man1
+mandir = ${PREFIX}/share/man/man1
OBJS = main.o libk8055.o
# if your are using Linux comment out next line
-CFLAGS = -DDAEMON -Wall -D_BSD
Expand All @@ -32,7 +32,7 @@
-ln -sf libk8055.so.0.2 libk8055.so

libk8055.c: k8055.h
@@ -24,29 +24,29 @@ libk8055.c: k8055.h
@@ -24,33 +24,33 @@ all: k8055_prog libk8055.so.0.1
all: k8055_prog libk8055.so.0.1

%.o: %.c
Expand All @@ -43,10 +43,12 @@
- $(cc) $(OBJS) -o $(exec) $(libs)
+ $(CC) $(OBJS) -o $(exec) $(libs)
strip $(exec)

-
+
clean:
rm -f *.o libk8055.so libk8055.so.0.2 $(exec)

-
+
install: k8055_prog libk8055.so.0.1
- cp -f $(exec) $(bindir)/
- if !(test -d $(libdir)); then \
Expand All @@ -70,7 +72,13 @@
+ mkdir $(DESTDIR)$(mandir); \
fi
- cp -f man/k8055.1.gz $(mandir)/
-
+ cp -f man/k8055.1.gz $(DESTDIR)$(mandir)/
+
uninstall:
rm -f $(bindir)/$(exec) $(libdir)/libk8055* $(includedir)/k8055.h
-
+
test: k8055_prog
killall $(exec)
./$(exec)
26 changes: 13 additions & 13 deletions devel/libk8055/files/patch-libk8055.c
@@ -1,6 +1,6 @@
--- libk8055.c 2006-07-29 11:02:26.000000000 +0100
+++ libk8055.c.orig 2011-10-09 21:34:57.693521803 +0100
@@ -83,7 +83,7 @@
--- libk8055.c.orig 2006-07-29 10:02:26 UTC
+++ libk8055.c
@@ -83,7 +83,7 @@ int OpenDevice(long board_address){
return -1; /*throw -1 to show that OpenDevice failed */
}
else
Expand All @@ -9,7 +9,7 @@
if (open_status!=8)
return -1;
else
@@ -101,7 +101,7 @@
@@ -101,7 +101,7 @@ long ReadAnalogChannel(long Channelno){

long ReadAnalogChannel(long Channelno){
int open_status=0;
Expand All @@ -18,7 +18,7 @@
if (open_status==8){
if (Channelno==2)
return data_in[3];
@@ -114,7 +114,7 @@
@@ -114,7 +114,7 @@ int ReadAllAnalog(long* data1, long* data2){

int ReadAllAnalog(long* data1, long* data2){
int open_status=0;
Expand All @@ -27,7 +27,7 @@
if (open_status==8){
*data1=data_in[2];
*data2=data_in[3];
@@ -131,8 +131,8 @@
@@ -131,8 +131,8 @@ int OutputAnalogChannel(long channel, long data){
data_out[3]=(unsigned char)data;
else
data_out[2]=(unsigned char)data;
Expand All @@ -38,7 +38,7 @@
if (open_status!=8)
return -1;
else
@@ -144,8 +144,8 @@
@@ -144,8 +144,8 @@ int OutputAllAnalog(long data1,long data2){
data_out[0]=0x05; /* analog out or digital out command */
data_out[2]=(unsigned char)data1;
data_out[3]=(unsigned char)data2;
Expand All @@ -49,7 +49,7 @@
if (open_status!=8)
return -1;
else
@@ -179,8 +179,8 @@
@@ -179,8 +179,8 @@ int WriteAllDigital(long data){
int open_status=0;
data_out[0]=0x05; /* analog out or digital out command */
data_out[1]=(unsigned char)data;
Expand All @@ -60,7 +60,7 @@
if (open_status!=8)
return -1;
else
@@ -225,7 +225,7 @@
@@ -225,7 +225,7 @@ int ReadDigitalChannel(long channel){
int open_status=0,i;
unsigned char mask=8;
if (channel>0 && channel<6){
Expand All @@ -69,7 +69,7 @@
if (open_status==8){
for (i=1;i<=channel;i++)
if (i!=3) mask*=2;
@@ -244,7 +244,7 @@
@@ -244,7 +244,7 @@ long ReadAllDigital(){
long ReadAllDigital(){
int open_status=0,i,return_data=0;
unsigned char mask=8,pow=1;
Expand All @@ -78,7 +78,7 @@
if (open_status==8){
for (i=1;i<=5;i++){
mask*=2;
@@ -269,8 +269,8 @@
@@ -269,8 +269,8 @@ int ResetCounter(long counternr){
if (counternr==1 || counternr==2){
data_out[0]=0x02+(unsigned char)counternr; /* counter selection */
data_out[3+counternr]=0x00;
Expand All @@ -89,7 +89,7 @@
if (open_status==8)
return 0;
else
@@ -283,7 +283,7 @@
@@ -283,7 +283,7 @@ long ReadCounter(long counterno){
long ReadCounter(long counterno){
int open_status=0;
if (counterno==1 || counterno==2){
Expand All @@ -98,7 +98,7 @@
if (open_status==8){
if (counterno==2)
return data_in[6];
@@ -316,7 +316,7 @@
@@ -316,7 +316,7 @@ int SetCounterDebounceTime(long counterno, long deboun
value+=1;
data_out[5+counterno]=(unsigned char)value;
if (DEBUG) fprintf(stderr,"Debouncetime%d value for k8055:%d\n",(int)counterno,data_out[5+counterno]);
Expand Down

0 comments on commit d5807b7

Please sign in to comment.