New package: sgfutils-0.25

Closes: #6239 [via git-merge-pr]
This commit is contained in:
Brandon Wilson 2017-04-21 10:06:41 +09:00 committed by Michael Aldridge
parent 1146fc49bb
commit 7a0c148169
2 changed files with 87 additions and 0 deletions

View File

@ -0,0 +1,74 @@
diff --git Makefile Makefile
index d624f49..4355fc7 100644
--- Makefile
+++ Makefile
@@ -3,6 +3,7 @@ TPROGS=sgf sgfsplit sgfvarsplit sgfstrip sgfinfo sgfmerge sgftf \
ngf2sgf nip2sgf nk2sgf gib2sgf
PROGS=$(TPROGS) sgftopng ugi2sgf
+OBJECTS:=$(CSOURCES:.c=.o) sgfdbinfo.o
CSOURCES:=sgf.c sgfsplit.c sgfvarsplit.c sgfstrip.c sgfinfo.c sgfmerge.c \
sgftf.c sgfcheck.c sgfdb.c readsgf.c readsgf0.c writesgf.c \
@@ -10,17 +11,17 @@ CSOURCES:=sgf.c sgfsplit.c sgfvarsplit.c sgfstrip.c sgfinfo.c sgfmerge.c \
playgogame.c tests.c errexit.c xmalloc.c sgftopng.c \
ftw.c ugi2sgf.c ngf2sgf.c nip2sgf.c nk2sgf.c gib2sgf.c
-OBJECTS:=$(CSOURCES:.c=.o) sgfdbinfo.o
-
HSOURCES=errexit.h xmalloc.h sgfdb.h readsgf.h writesgf.h sgfinfo.h ftw.h \
playgogame.h sgffileinput.h sgfdbinput.h tests.h
SOURCES=$(CSOURCES) $(HSOURCES)
+BINDIR=$(DESTDIR)$(PREFIX)/bin
-CFLAGS=-Wall -Wmissing-prototypes -O3
-
+CFLAGS+=-Wall -Wmissing-prototypes -O3
+sgfdbinfo: CFLAGS += -DREAD_FROM_DB
+sgfinfo sgfdbinfo: LDLIBS += -lcrypto
# For systems where iconv is in a separate library
-# LDLIBS=-liconv
+#sgfcharset ugi2sgf: LDLIBS += -liconv
# is needed for sgfcharset and ugi2sgf
all: $(PROGS)
@@ -47,23 +48,16 @@ sgftf: sgftf.o readsgf.o ftw.o xmalloc.o
sgfdb: sgfdb.o readsgf.o playgogame.o ftw.o xmalloc.o
-sgfinfo: sgfinfo.o sgffileinput.c readsgf.o playgogame.o tests.o \
- ftw.o xmalloc.o
- cc $(CFLAGS) $^ -o $@ -lcrypto
+sgfinfo: sgfinfo.o sgffileinput.o readsgf.o playgogame.o tests.o ftw.o xmalloc.o
sgfdbinfo: sgfdbinfo.o sgfdbinput.o readsgf.o xmalloc.o tests.o ftw.o
- cc $(CFLAGS) $^ -o $@ -lcrypto
sgfcharset: sgfcharset.o xmalloc.o
-sgfinfo.o: sgfinfo.c
+nk2sgf: readsgf.o writesgf.o xmalloc.o
sgfdbinfo.o: sgfinfo.c
- cc $(CFLAGS) -DREAD_FROM_DB -c sgfinfo.c -o sgfdbinfo.o
-
-sgftopng: sgftopng.o
-
-nk2sgf: readsgf.o writesgf.o xmalloc.o
+ $(CC) $(CFLAGS) -DREAD_FROM_DB $(TARGET_ARCH) -o $@ -c $<
# Something like this spoils the $^ macro
# $(PROGS): Makefile
@@ -78,5 +72,11 @@ makefile: Makefile makefile.tail
# gnumake complains about $include
-include $(DEPFILE)
+install: $(PROGS)
+ install -m 755 -D -t "$(BINDIR)" $^
+
+uninstall:
+ rm -f $(PROGS:%=$(BINDIR)/%)
+
clean:
rm -f *~ $(OBJECTS) $(PROGS)

13
srcpkgs/sgfutils/template Normal file
View File

@ -0,0 +1,13 @@
# Template file for 'sgfutils'
pkgname=sgfutils
version=0.25
revision=1
build_style=gnu-makefile
short_desc="Collection of utilities to handle SGF files"
maintainer='Brandon Wilson <x@wilsonb.com>'
license="GPL-2"
homepage="http://www.cwi.nl/~aeb/go/sgfutils/html/"
distfiles="http://homepages.cwi.nl/~aeb/go/${pkgname}/${pkgname}.tgz"
checksum=4b26b321fbe255722f1d7e57233614da89a4da5bab031ae4ef7118ae3c7436a2
makedepends="libressl-devel"
depends="ImageMagick"