config

OpenBSD system configuration
git clone git://jacobedwards.org/config
Log | Files | Refs | README

commit 2436e1d42ae49264b8e4e930047a61ef34d6e41f
parent 6b3faba9f6ba12c3470d6199c36690bc4c42b309
Author: Jacob R. Edwards <n/a>
Date:   Wed, 30 Nov 2022 12:05:36 -0600

Update forks' infrastructure

- Add name variable which every every fork must define
- Rename git.mk's ref variable to rev, and make every fork define
  it
- Have dir define where sources are extracted to, rather than just
  telling where
- Add extract target, which simply points to ${dir} making it
  possible to recursively extract the source archives through make

In addition to the changes, a README was added to hopefully define
what everything is suppost to do a little.

Diffstat:
Mlocal/src/src/fork/Makefile | 4++--
Alocal/src/src/fork/README | 45+++++++++++++++++++++++++++++++++++++++++++++
Mlocal/src/src/fork/common.mk | 9++++++---
Mlocal/src/src/fork/dmenu/Makefile | 4+++-
Mlocal/src/src/fork/dwm/Makefile | 4+++-
Mlocal/src/src/fork/git.mk | 12+++++++-----
Mlocal/src/src/fork/herbe/Makefile | 3++-
Mlocal/src/src/fork/hurl/Makefile | 3++-
Mlocal/src/src/fork/slstatus/Makefile | 3++-
9 files changed, 72 insertions(+), 15 deletions(-)

diff --git a/local/src/src/fork/Makefile b/local/src/src/fork/Makefile @@ -4,9 +4,9 @@ SUBDIRS =\ herbe\ slstatus\ -all distclean fullclean clean ready patch build install uninstall: +all distclean fullclean clean extract patch build install uninstall: .for SUBDIR in ${SUBDIRS} cd ${SUBDIR} && make $@ .endfor -.PHONY: all distclean fullclean clean ready patch build install uninstall +.PHONY: all distclean fullclean clean extract patch build install uninstall diff --git a/local/src/src/fork/README b/local/src/src/fork/README @@ -0,0 +1,45 @@ +# Guide to adding forks + +All fork Makefiles should include include common.mk; it should be +flexible enough for every fork and defines many of the targets meant +to be used directly: 'clean', 'fullclean', 'fetch', 'verify', +'extract', and 'patch'. It depends on 'cleancache' and ${arc} to +be defined. (${arc} is simply a target to get the source archive, +cleancache removes files ${arc} created) Additionally, 'build', +'install', and 'uninstall' must be defined elsewhere. + +There are two predefined ${arc} (and their respective cleancache) +targets defined in http.mk and git.mk. http.mk is for getting source +archives over HTTP, and git is for getting them from git repositories. + +There are 'build', 'install', and 'uninstall' targets defined in +suckless.mk which probably work for most simple make(1) based +projects. + +So, then, the fork Makefile. Each one should define the following +variables: + +- name + + The project's name. + +- rev + + The revision. While only git.mk requires this (and it must be a + valid tree-ish identifier, see git(1), "IDENTIFIER TERMINOLOGY"), + every fork should define it. + +- dir + + Where to source repository should be extracted. + +- arc + + Where the source archive should be located. (The suffixes must + be accurate, i.e. .bz2 should be a bzip2(1) compressed file.) + +- url + + The URL that the ${arc} target uses to get the archive. + +and then simply include the appropriate targets. diff --git a/local/src/src/fork/common.mk b/local/src/src/fork/common.mk @@ -12,13 +12,16 @@ fetch: ${arc} verify: fetch make checksum | cmp /dev/stdin checksum +# Note: pax substituion assumes everything is in one directory ${dir}: verify case ${arc} in \ (*.gz) gunzip;; \ (*.bz2) bunzip2;; \ - esac < ${arc} | pax -r + esac < ${arc} | pax -r -s '/^[^\/]*/${dir}/' -patch: ${dir} +extract: ${dir} + +patch: extract if test -d patches -a '!' -e patched; then \ for patch in patches/*; do \ patch -d ${dir} -p 1 < $$patch; \ @@ -32,4 +35,4 @@ checksum: ${arc} updatechecksum: make checksum > checksum -.PHONY: all clean fullclean ready patch verify checksum updatechecksum +.PHONY: all clean fullclean fetch verify extract patch checksum updatechecksum diff --git a/local/src/src/fork/dmenu/Makefile b/local/src/src/fork/dmenu/Makefile @@ -1,4 +1,6 @@ -dir = dmenu-5.0 +name = dmenu +rev = 5.0 +dir = dmenu-${rev} arc = ${dir}.tar.gz url = http://dl.suckless.org/tools/${arc} diff --git a/local/src/src/fork/dwm/Makefile b/local/src/src/fork/dwm/Makefile @@ -1,4 +1,6 @@ -dir = dwm-6.3 +name = dwm +rev = 6.3 +dir = dwm-${rev} arc = ${dir}.tar.gz url = http://dl.suckless.org/dwm/${arc} diff --git a/local/src/src/fork/git.mk b/local/src/src/fork/git.mk @@ -1,15 +1,17 @@ # git distribution target -${arc}.git: - git clone --quiet --mirror ${url} ${arc}.git +git=${name}.git -${arc}: ${arc}.git +${git}: + git clone --quiet --mirror ${url} ${git} + +${arc}: ${git} case ${arc} in \ (*.bz2) a=bzip2;; \ (*.gz|*.tgz) a=gzip;; \ esac ; \ - git -C ${arc}.git archive --format=tar --prefix=${dir}/ ${ref} | $$a > ${arc} + git -C ${git} archive --format=tar --prefix=${dir}/ ${rev} | $$a > ${arc} cleancache: rm -f ${arc} - rm -rf ${arc}.git + rm -rf ${git} diff --git a/local/src/src/fork/herbe/Makefile b/local/src/src/fork/herbe/Makefile @@ -1,7 +1,8 @@ +name = herbe +rev = dec89e4d669a38a3f6dd8a6f2e2bae39f26369d3 dir = herbe arc = herbe.tar.gz url = https://github.com/dudik/herbe -ref = dec89e4d669a38a3f6dd8a6f2e2bae39f26369d3 .include "../common.mk" .include "../git.mk" diff --git a/local/src/src/fork/hurl/Makefile b/local/src/src/fork/hurl/Makefile @@ -1,7 +1,8 @@ +name = hurl +rev = 0.7 dir = hurl arc = ${dir}.tar.bz2 url = git://git.codemadness.org/hurl -ref = 0.7 .include "../common.mk" .include "../git.mk" diff --git a/local/src/src/fork/slstatus/Makefile b/local/src/src/fork/slstatus/Makefile @@ -1,7 +1,8 @@ +name = slstatus +rev = 84a2f117a32f0796045941260cdc4b69852b41e0 dir = slstatus arc = ${dir}.tar.bz2 url = https://git.suckless.org/slstatus -ref = 84a2f117a32f0796045941260cdc4b69852b41e0 .include "../common.mk" .include "../git.mk"