First commit: Add Readme and main Makefile

This commit is contained in:
PedroEdiaz
2024-06-16 12:33:26 +06:00
commit 1c0db2166e
2 changed files with 120 additions and 0 deletions

82
Makefile Normal file
View File

@@ -0,0 +1,82 @@
# VARIABLES
ARCH=x86_64-musl
CACHEDIR = ${XDG_CACHE_HOME}/xbps-make
BUILDDIR = ${XDG_RUNTIME_DIR}/xbps-make
XBPSDIR = ${XDG_CACHE_HOME}/xbps
POSIX=yes
MAN=yes
# PROTOTYPES
.SUFFIXES: .d .xbps .src
.d.src:
mkdir -p ${BUILDDIR}
${MAKE} -C $< ${CACHEDIR}/`basename $@`
rm -rf ${BUILDDIR}
.d.xbps:
mkdir -p ${BUILDDIR}
${MAKE} -C $< ${CACHEDIR}/`basename $@`
rm -rf ${BUILDDIR}
# Default
help:
cat README
# BUILD RULES
${CACHEDIR}/${package}.src: ${CACHEDIR}
test -d files && mkdir -p files && cp -R files ${BUILDDIR}/files || true
${MAKE} -C ${BUILDDIR} -f `pwd`/Makefile prepare
tar -z -cf $@ -C ${BUILDDIR}/build .
${CACHEDIR}/${package}.xbps: ${CACHEDIR} ${BUILDDIR}/root
xbps-create \
-A ${ARCH} \
-n ${package}-${pkgver} \
-s "${description}" \
-C "${conflicts}" \
-D "${dependecies}" \
-H "${homepage}" \
-l "${license}" \
-P "${provides}" \
-R "${replaces}" \
--alternatives "${alternatives}" \
--shlib-provides "${shlib-provides}" \
--shlib-requires "${shlib-requires}" \
${BUILDDIR}/root
mv *.xbps ${XBPSDIR}
xbps-rindex -af ${XBPSDIR}/${package}-${pkgver}.${ARCH}.xbps
${BUILDDIR}/root: ${BUILDDIR}/build
${MAKE} -C ${BUILDDIR}/build -f `pwd`/Makefile root=$@ \
root root-posix-${POSIX} root-man-${MAN}
test -f `pwd`/postinstall.sh && install -Dm 755 `pwd`/postinstall.sh "$@/var/db/bmpm/${package}.sh" || true
${BUILDDIR}/build:
mkdir -p $@
tar -z -xf ${CACHEDIR}/${package}.src -C $@
${CACHEDIR}:
mkdir -p $@
clean:
rm -r ${BUILDDIR}
# OPTION BUILDS
root-posix:
root-posix-no:
root-posix-yes: root-posix
root-man:
root-man-yes: root-man
root-man-no:
# UTIL
DOWNLOAD = curl -sLO
SHA256 = test `sha256sum $@ |sed 's/\s.*//'` =
SHA256D = test `find $@ -type f |xargs sha256sum|sort|sha256sum|sed 's/\s.*//'` =
GITCLONE = \
git clone $$url/$$pkg &&\
git -C $$pkg reset --hard $$commit &&\
rm -rf $$pkg/.git

38
README Normal file
View File

@@ -0,0 +1,38 @@
xbps-make: xbps Makefiles repository
====================================
This is a repository of posix Makefiles used to build diferent xbps
packages with one simple generic command and minimum dependecies.
Easy to hack if you don't use xbps, or any other dependecie.
Usage:
$ make devel/tcc.src (download source)
$ make devel/tcc.xbps (build and make package)
Options:
MAN=no (Do not install manuals)
POSIX=no (Do not install complice)
BUILDDIR=path (compile .src on path)
CACHEDIR=path (save .src on path)
XBPSDIR=path (save .xbps on path)
Dependecies:
* xbps
* make
* tar
* gzip
_ curl
_ git
_ sha256
_ sed
_ find
_ xargs
Warning:
* This proyect it's used with bmake, other posix make programs
haven't been tested, but it should work, feel free to adapt it
if needed.
* GNU make doesn't work because the "include" command work
diferent than posix make "include" command.
Licence:
0BSD - Zero Clause BSD Licence