Import manibuilder from flashrom master

References to the upstream repository have been changed to
`flashrom-stable.git`. The directory `flashrom` is kept,
though, so existing containers can be used for both projects.

Change-Id: I8ba148e30602e8e03e3858f7c1eb6789230654d6
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/c/flashrom-stable/+/70906
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Tested-by: Nico Huber <nico.h@gmx.de>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
diff --git a/util/manibuilder/Dockerfile.djgpp b/util/manibuilder/Dockerfile.djgpp
new file mode 100644
index 0000000..5fc7338
--- /dev/null
+++ b/util/manibuilder/Dockerfile.djgpp
@@ -0,0 +1,32 @@
+FROM anibali/djgpp:6.1.0
+
+USER root
+RUN \
+	userdel appuser && \
+	useradd -p locked -m mani && \
+	zypper -q install -y tar make git ccache
+
+ENV GIT_SSL_NO_VERIFY=1
+USER mani
+
+ARG ORIGIN=https://review.coreboot.org/flashrom-stable.git
+RUN cd && \
+	mkdir .ccache && chown mani:users .ccache && \
+	git clone ${ORIGIN} flashrom && \
+	git clone https://git.kernel.org/pub/scm/utils/pciutils/pciutils.git && \
+	cd pciutils && \
+		git checkout v3.5.6 && \
+		curl --insecure https://flashrom.org/images/6/6a/Pciutils-3.5.6.patch.gz | zcat | git apply && \
+		make ZLIB=no DNS=no HOST=i386-djgpp-djgpp \
+			CROSS_COMPILE=i586-pc-msdosdjgpp- \
+			PREFIX=/ DESTDIR=$PWD/../ \
+			STRIP="--strip-program=i586-pc-msdosdjgpp-strip -s" \
+			install install-lib && \
+		cd ../ && \
+	curl --insecure https://flashrom.org/images/3/3d/Libgetopt.tar.gz | zcat | tar x && \
+	cd libgetopt && \
+		make && cp libgetopt.a ../lib/ && cp getopt.h ../include/
+
+ENV DEVSHELL /bin/bash
+COPY mani-wrapper.sh /home/mani/
+ENTRYPOINT ["/bin/sh", "/home/mani/mani-wrapper.sh"]