ports

recipes for building multiple softwares
git clone git://z3bra.org/ports
Log | Files | Refs

commit 604dffca8e80ae9b8c251f1a2a03635bd3634dba
parent 89330fd09d0dc1705483dbba0391002fe13b94d4
Author: z3bra <willyatmailoodotorg>
Date:   Fri Jan  8 20:31:22 2016

mk: plan9's way to maintain files

Diffstat:
 mk/.footprint                  |  30 ++++++++++-
 mk/.md5sum                     |   3 +-
 mk/makeme                      |  15 +++++-
 mk/patches/0000-destdir.diff   | 121 ++++++++++++++++++++++++++++++++++++++++++-
 mk/patches/0001-manprefix.diff | 120 ++++++++++++++++++++++++++++++++++++++++++-
 5 files changed, 289 insertions(+), 0 deletions(-)

diff --git a/mk/.footprint b/mk/.footprint @@ -0,0 +1,30 @@ +drwxr-xr-x root/root usr/ +drwxr-xr-x root/root usr/bin/ +-rwxr-xr-x root/root usr/bin/mk +drwxr-xr-x root/root usr/doc/ +-rw-r--r-- root/root usr/doc/mk.pdf +drwxr-xr-x root/root usr/include/ +-rw-r--r-- root/root usr/include/bio.h +-rw-r--r-- root/root usr/include/fmt.h +-rw-r--r-- root/root usr/include/regexp9.h +-rw-r--r-- root/root usr/include/utf.h +drwxr-xr-x root/root usr/lib/ +-rw-r--r-- root/root usr/lib/libbio.a +-rw-r--r-- root/root usr/lib/libfmt.a +-rw-r--r-- root/root usr/lib/libregexp9.a +-rw-r--r-- root/root usr/lib/libutf.a +drwxr-xr-x root/root usr/share/ +drwxr-xr-x root/root usr/share/man/ +drwxr-xr-x root/root usr/share/man/man1/ +-rw-r--r-- root/root usr/share/man/man1/mk.1.gz +drwxr-xr-x root/root usr/share/man/man3/ +-rw-r--r-- root/root usr/share/man/man3/bio.3.gz +-rw-r--r-- root/root usr/share/man/man3/fmtinstall.3.gz +-rw-r--r-- root/root usr/share/man/man3/isalpharune.3.gz +-rw-r--r-- root/root usr/share/man/man3/print.3.gz +-rw-r--r-- root/root usr/share/man/man3/regexp9.3.gz +-rw-r--r-- root/root usr/share/man/man3/rune.3.gz +-rw-r--r-- root/root usr/share/man/man3/runestrcat.3.gz +drwxr-xr-x root/root usr/share/man/man7/ +-rw-r--r-- root/root usr/share/man/man7/regexp9.7.gz +-rw-r--r-- root/root usr/share/man/man7/utf.7.gz diff --git a/mk/.md5sum b/mk/.md5sum @@ -0,0 +1,3 @@ +289d52ec2547f6d72e2aaa83441e720d 0000-destdir.diff +f8ed3466d25e2905c294e4c03dd38a21 0001-manprefix.diff +b4f5960b875258a08505e07f3404d639 mk-with-libs.tgz diff --git a/mk/makeme b/mk/makeme @@ -0,0 +1,15 @@ +name=mk +version=0.1 +source=http://swtch.com/plan9port/unix/$name-with-libs.tgz + +package() { + curl -# -L $source | tar xz + cd $name + cat ../patches/*.diff | patch -Np1 + make + make DESTDIR=$WORKDIR/$name PREFIX= install + rm -r $WORKDIR/$name/doc + + cd .. + rm -r $name +} diff --git a/mk/patches/0000-destdir.diff b/mk/patches/0000-destdir.diff @@ -0,0 +1,121 @@ +diff -urN a/libbio/Makefile b/libbio/Makefile +--- a/libbio/Makefile 2011-01-02 21:52:49.000000000 +0100 ++++ b/libbio/Makefile 2016-01-08 12:18:18.412351802 +0100 +@@ -52,12 +52,12 @@ + all: $(LIB) + + install: $(LIB) +- mkdir -p $(PREFIX)/share/man/man3 +- install -m 0644 bio.3 $(PREFIX)/share/man/man3/bio.3 +- mkdir -p $(PREFIX)/include +- install -m 0644 bio.h $(PREFIX)/include +- mkdir -p $(PREFIX)/lib +- install -m 0644 $(LIB) $(PREFIX)/lib/$(LIB) ++ mkdir -p $(DESTDIR)$(PREFIX)/share/man/man3 ++ install -m 0644 bio.3 $(DESTDIR)$(PREFIX)/share/man/man3/bio.3 ++ mkdir -p $(DESTDIR)$(PREFIX)/include ++ install -m 0644 bio.h $(DESTDIR)$(PREFIX)/include ++ mkdir -p $(DESTDIR)$(PREFIX)/lib ++ install -m 0644 $(LIB) $(DESTDIR)$(PREFIX)/lib/$(LIB) + + bcat: bcat.$O $(LIB) + $(CC) -o bcat bcat.$O $(LIB) -L/usr/local/lib -lfmt -lutf +diff -urN a/libfmt/Makefile b/libfmt/Makefile +--- a/libfmt/Makefile 2011-01-02 21:52:49.000000000 +0100 ++++ b/libfmt/Makefile 2016-01-08 12:18:18.412351802 +0100 +@@ -76,13 +76,13 @@ + all: $(LIB) + + install: $(LIB) +- test -d $(PREFIX)/share/man/man3 || mkdir -p $(PREFIX)/share/man/man3 +- install -m 0644 print.3 $(PREFIX)/share/man/man3/print.3 +- install -m 0644 fmtinstall.3 $(PREFIX)/share/man/man3/fmtinstall.3 +- mkdir -p $(PREFIX)/include +- install -m 0644 fmt.h $(PREFIX)/include/fmt.h +- mkdir -p $(PREFIX)/lib +- install -m 0644 $(LIB) $(PREFIX)/lib/$(LIB) ++ test -d $(DESTDIR)$(PREFIX)/share/man/man3 || mkdir -p $(DESTDIR)$(PREFIX)/share/man/man3 ++ install -m 0644 print.3 $(DESTDIR)$(PREFIX)/share/man/man3/print.3 ++ install -m 0644 fmtinstall.3 $(DESTDIR)$(PREFIX)/share/man/man3/fmtinstall.3 ++ mkdir -p $(DESTDIR)$(PREFIX)/include ++ install -m 0644 fmt.h $(DESTDIR)$(PREFIX)/include/fmt.h ++ mkdir -p $(DESTDIR)$(PREFIX)/lib ++ install -m 0644 $(LIB) $(DESTDIR)$(PREFIX)/lib/$(LIB) + + $(NAN).$O: nan.h + strtod.$O: nan.h +diff -urN a/libregexp/Makefile b/libregexp/Makefile +--- a/libregexp/Makefile 2011-01-02 21:52:49.000000000 +0100 ++++ b/libregexp/Makefile 2016-01-08 12:18:18.412351802 +0100 +@@ -43,13 +43,13 @@ + all: $(LIB) + + install: $(LIB) +- mkdir -p $(PREFIX)/share/man/man3 $(PREFIX)/man/man7 +- install -m 0644 regexp9.3 $(PREFIX)/share/man/man3/regexp9.3 +- install -m 0644 regexp9.7 $(PREFIX)/man/man7/regexp9.7 +- mkdir -p $(PREFIX)/lib +- install -m 0644 $(LIB) $(PREFIX)/lib/$(LIB) +- mkdir -p $(PREFIX)/include +- install -m 0644 regexp9.h $(PREFIX)/include/regexp9.h ++ mkdir -p $(DESTDIR)$(PREFIX)/share/man/man3 $(DESTDIR)$(PREFIX)/man/man7 ++ install -m 0644 regexp9.3 $(DESTDIR)$(PREFIX)/share/man/man3/regexp9.3 ++ install -m 0644 regexp9.7 $(DESTDIR)$(PREFIX)/man/man7/regexp9.7 ++ mkdir -p $(DESTDIR)$(PREFIX)/lib ++ install -m 0644 $(LIB) $(DESTDIR)$(PREFIX)/lib/$(LIB) ++ mkdir -p $(DESTDIR)$(PREFIX)/include ++ install -m 0644 regexp9.h $(DESTDIR)$(PREFIX)/include/regexp9.h + + test: test.$O $(LIB) + $(CC) -o test test.$O $(LIB) -L/usr/local/lib -lfmt -lutf +diff -urN a/libutf/Makefile b/libutf/Makefile +--- a/libutf/Makefile 2011-01-02 21:52:48.000000000 +0100 ++++ b/libutf/Makefile 2016-01-08 12:18:18.412351802 +0100 +@@ -55,15 +55,15 @@ + all: $(LIB) + + install: $(LIB) +- mkdir -p $(PREFIX)/share/man/man3 $(PREFIX)/man/man7 +- install -c -m 0644 isalpharune.3 $(PREFIX)/share/man/man3/isalpharune.3 +- install -c -m 0644 utf.7 $(PREFIX)/man/man7/utf.7 +- install -c -m 0644 rune.3 $(PREFIX)/share/man/man3/rune.3 +- install -c -m 0644 runestrcat.3 $(PREFIX)/share/man/man3/runestrcat.3 +- mkdir -p $(PREFIX)/include +- install -c -m 0644 utf.h $(PREFIX)/include/utf.h +- mkdir -p $(PREFIX)/lib +- install -c -m 0644 $(LIB) $(PREFIX)/lib/$(LIB) ++ mkdir -p $(DESTDIR)$(PREFIX)/share/man/man3 $(DESTDIR)$(PREFIX)/man/man7 ++ install -c -m 0644 isalpharune.3 $(DESTDIR)$(PREFIX)/share/man/man3/isalpharune.3 ++ install -c -m 0644 utf.7 $(DESTDIR)$(PREFIX)/man/man7/utf.7 ++ install -c -m 0644 rune.3 $(DESTDIR)$(PREFIX)/share/man/man3/rune.3 ++ install -c -m 0644 runestrcat.3 $(DESTDIR)$(PREFIX)/share/man/man3/runestrcat.3 ++ mkdir -p $(DESTDIR)$(PREFIX)/include ++ install -c -m 0644 utf.h $(DESTDIR)$(PREFIX)/include/utf.h ++ mkdir -p $(DESTDIR)$(PREFIX)/lib ++ install -c -m 0644 $(LIB) $(DESTDIR)$(PREFIX)/lib/$(LIB) + + $(LIB): $(OFILES) + $(AR) $(ARFLAGS) $(LIB) $(OFILES) +diff -urN a/mk/Makefile b/mk/Makefile +--- a/mk/Makefile 2011-01-02 21:52:50.000000000 +0100 ++++ b/mk/Makefile 2016-01-08 12:18:18.412351802 +0100 +@@ -63,13 +63,13 @@ + TGZFILES+=mk.pdf + + install: $(TARG) +- mkdir -p $(PREFIX)/bin +- install -m 0755 mk $(PREFIX)/bin/mk ++ mkdir -p $(DESTDIR)$(PREFIX)/bin ++ install -m 0755 mk $(DESTDIR)$(PREFIX)/bin/mk + cat mk.1 | sed 's;DOCPREFIX;$(PREFIX);g' >mk.1a +- mkdir -p $(PREFIX)/man/man1 +- install -m 0644 mk.1a $(PREFIX)/man/man1/mk.1 +- mkdir -p $(PREFIX)/doc +- install -m 0644 mk.pdf $(PREFIX)/doc/mk.pdf ++ mkdir -p $(DESTDIR)$(PREFIX)/man/man1 ++ install -m 0644 mk.1a $(DESTDIR)$(PREFIX)/man/man1/mk.1 ++ mkdir -p $(DESTDIR)$(PREFIX)/doc ++ install -m 0644 mk.pdf $(DESTDIR)$(PREFIX)/doc/mk.pdf + + $(LIB): $(OFILES) + $(AR) $(ARFLAGS) $(LIB) $(OFILES) diff --git a/mk/patches/0001-manprefix.diff b/mk/patches/0001-manprefix.diff @@ -0,0 +1,120 @@ +diff -urN a/libbio/Makefile b/libbio/Makefile +--- a/libbio/Makefile 2016-01-08 12:18:18.412351802 +0100 ++++ b/libbio/Makefile 2016-01-08 12:22:42.429015354 +0100 +@@ -15,6 +15,7 @@ + include Make.$(SYSNAME)-$(OBJTYPE) + + PREFIX=/usr/local ++MANDIR=$(PREFIX)/share/man + + NUKEFILES= + +@@ -52,8 +53,8 @@ + all: $(LIB) + + install: $(LIB) +- mkdir -p $(DESTDIR)$(PREFIX)/share/man/man3 +- install -m 0644 bio.3 $(DESTDIR)$(PREFIX)/share/man/man3/bio.3 ++ mkdir -p $(DESTDIR)$(MANDIR)/man3 ++ install -m 0644 bio.3 $(DESTDIR)$(MANDIR)/man3/bio.3 + mkdir -p $(DESTDIR)$(PREFIX)/include + install -m 0644 bio.h $(DESTDIR)$(PREFIX)/include + mkdir -p $(DESTDIR)$(PREFIX)/lib +diff -urN a/libfmt/Makefile b/libfmt/Makefile +--- a/libfmt/Makefile 2016-01-08 12:18:18.412351802 +0100 ++++ b/libfmt/Makefile 2016-01-08 12:22:42.429015354 +0100 +@@ -15,6 +15,7 @@ + include Make.$(SYSNAME)-$(OBJTYPE) + + PREFIX=/usr/local ++MANDIR=$(PREFIX)/share/man + + NUKEFILES= + +@@ -76,9 +77,9 @@ + all: $(LIB) + + install: $(LIB) +- test -d $(DESTDIR)$(PREFIX)/share/man/man3 || mkdir -p $(DESTDIR)$(PREFIX)/share/man/man3 +- install -m 0644 print.3 $(DESTDIR)$(PREFIX)/share/man/man3/print.3 +- install -m 0644 fmtinstall.3 $(DESTDIR)$(PREFIX)/share/man/man3/fmtinstall.3 ++ test -d $(DESTDIR)$(MANDIR)/man3 || mkdir -p $(DESTDIR)$(MANDIR)/man3 ++ install -m 0644 print.3 $(DESTDIR)$(MANDIR)/man3/print.3 ++ install -m 0644 fmtinstall.3 $(DESTDIR)$(MANDIR)/man3/fmtinstall.3 + mkdir -p $(DESTDIR)$(PREFIX)/include + install -m 0644 fmt.h $(DESTDIR)$(PREFIX)/include/fmt.h + mkdir -p $(DESTDIR)$(PREFIX)/lib +diff -urN a/libregexp/Makefile b/libregexp/Makefile +--- a/libregexp/Makefile 2016-01-08 12:18:18.412351802 +0100 ++++ b/libregexp/Makefile 2016-01-08 12:22:42.429015354 +0100 +@@ -15,6 +15,7 @@ + include Make.$(SYSNAME)-$(OBJTYPE) + + PREFIX=/usr/local ++MANDIR=$(PREFIX)/share/man + + NUKEFILES= + +@@ -43,9 +44,9 @@ + all: $(LIB) + + install: $(LIB) +- mkdir -p $(DESTDIR)$(PREFIX)/share/man/man3 $(DESTDIR)$(PREFIX)/man/man7 +- install -m 0644 regexp9.3 $(DESTDIR)$(PREFIX)/share/man/man3/regexp9.3 +- install -m 0644 regexp9.7 $(DESTDIR)$(PREFIX)/man/man7/regexp9.7 ++ mkdir -p $(DESTDIR)$(MANDIR)/man3 $(DESTDIR)$(MANDIR)/man7 ++ install -m 0644 regexp9.3 $(DESTDIR)$(MANDIR)/man3/regexp9.3 ++ install -m 0644 regexp9.7 $(DESTDIR)$(MANDIR)/man7/regexp9.7 + mkdir -p $(DESTDIR)$(PREFIX)/lib + install -m 0644 $(LIB) $(DESTDIR)$(PREFIX)/lib/$(LIB) + mkdir -p $(DESTDIR)$(PREFIX)/include +diff -urN a/libutf/Makefile b/libutf/Makefile +--- a/libutf/Makefile 2016-01-08 12:18:18.412351802 +0100 ++++ b/libutf/Makefile 2016-01-08 12:22:42.429015354 +0100 +@@ -15,6 +15,7 @@ + include Make.$(SYSNAME)-$(OBJTYPE) + + PREFIX=/usr/local ++MANDIR=$(PREFIX)/share/man + + NUKEFILES= + +@@ -55,11 +56,11 @@ + all: $(LIB) + + install: $(LIB) +- mkdir -p $(DESTDIR)$(PREFIX)/share/man/man3 $(DESTDIR)$(PREFIX)/man/man7 +- install -c -m 0644 isalpharune.3 $(DESTDIR)$(PREFIX)/share/man/man3/isalpharune.3 +- install -c -m 0644 utf.7 $(DESTDIR)$(PREFIX)/man/man7/utf.7 +- install -c -m 0644 rune.3 $(DESTDIR)$(PREFIX)/share/man/man3/rune.3 +- install -c -m 0644 runestrcat.3 $(DESTDIR)$(PREFIX)/share/man/man3/runestrcat.3 ++ mkdir -p $(DESTDIR)$(MANDIR)/man3 $(DESTDIR)$(MANDIR)/man7 ++ install -c -m 0644 isalpharune.3 $(DESTDIR)$(MANDIR)/man3/isalpharune.3 ++ install -c -m 0644 utf.7 $(DESTDIR)$(MANDIR)/man7/utf.7 ++ install -c -m 0644 rune.3 $(DESTDIR)$(MANDIR)/man3/rune.3 ++ install -c -m 0644 runestrcat.3 $(DESTDIR)$(MANDIR)/man3/runestrcat.3 + mkdir -p $(DESTDIR)$(PREFIX)/include + install -c -m 0644 utf.h $(DESTDIR)$(PREFIX)/include/utf.h + mkdir -p $(DESTDIR)$(PREFIX)/lib +diff -urN a/mk/Makefile b/mk/Makefile +--- a/mk/Makefile 2016-01-08 12:18:18.412351802 +0100 ++++ b/mk/Makefile 2016-01-08 12:22:42.429015354 +0100 +@@ -15,6 +15,7 @@ + include Make.$(SYSNAME)-$(OBJTYPE) + + PREFIX=/usr/local ++MANDIR=$(PREFIX)/share/man + + NUKEFILES= + +@@ -66,8 +67,8 @@ + mkdir -p $(DESTDIR)$(PREFIX)/bin + install -m 0755 mk $(DESTDIR)$(PREFIX)/bin/mk + cat mk.1 | sed 's;DOCPREFIX;$(PREFIX);g' >mk.1a +- mkdir -p $(DESTDIR)$(PREFIX)/man/man1 +- install -m 0644 mk.1a $(DESTDIR)$(PREFIX)/man/man1/mk.1 ++ mkdir -p $(DESTDIR)$(MANDIR)/man1 ++ install -m 0644 mk.1a $(DESTDIR)$(MANDIR)/man1/mk.1 + mkdir -p $(DESTDIR)$(PREFIX)/doc + install -m 0644 mk.pdf $(DESTDIR)$(PREFIX)/doc/mk.pdf +