Initial commit

This commit is contained in:
Emi Vasilek 2024-01-29 05:57:24 +00:00
commit a3b6aedd86
3 changed files with 32 additions and 0 deletions

9
Makefile Normal file
View file

@ -0,0 +1,9 @@
PREFIX ?= /usr/local
all:
install:
install -D -m 755 docker-compose-m4 $(DESTDIR)$(PREFIX)/bin/docker-compose-m4
install -D -m 755 docker-compose.m4 $(DESTDIR)$(PREFIX)/share/docker-compose-m4/docker-compose.m4
.PHONY: all install

16
docker-compose-m4 Executable file
View file

@ -0,0 +1,16 @@
#!/bin/sh
set -eu
if ! [ -f docker-compose.yml.m4 ]; then
>&2 echo docker-compose.yml.m4 file not found
exit 1
fi
# first try docker-compose.m4 in pwd (for running directly from the repository)
templatefile=docker-compose.m4
# then, if that's not found, try the installed location
if ! [ -f "$templatefile" ]; then
templatefile="$(dirname "$0")/../share/docker-compose-m4/docker-compose.m4"
fi
m4 "$templatefile" > docker-compose.yml

7
docker-compose.m4 Normal file
View file

@ -0,0 +1,7 @@
define(`rmbreaks', `patsubst(`$*', `
', `')')dnl
define(`iinclude', `rmbreaks(include(`$*'))')dnl
# DO NOT EDIT THIS FILE
# it has been autogenerated from docker-compose.yml.m4, edit that file instead and then run docker-compose-m4
include(docker-compose.yml.m4)