Sometimes code is not available from package managers, just like in the stone age. Until those maintainers wake up to the basic modern programming practices of our glorious present, you can do this:
- Create a
scripts/sspm.shfile with the code from this repository:
- Create a package specific file
scripts/download/footool.shand use one of those functions:
#!/usr/bin/env sh
set -ex
. ./scripts/sspm.sh
download_from_git \
footool \
master \
6f6944bee215d391d7c80c529028003ba3b838da \
https://gitlab.com/sdwolfz/footool.git
- Create an equivalent build file
scripts/build/footool.shto compile it:
#!/usr/bin/env sh
set -ex
APPDIR="$PWD"/lib
cd vendor/footool
./autogen.sh
./configure \
--prefix="$APPDIR" \
--enable-bar=yes
make -j`nproc`
make install -j`nproc`
- Create a
Makefilefor easy execution:
.DEFAULT_GOAL = all
# ------------------------------------------------------------------------------
# Package Management
.PHONY: all
all: download clean build
# ------------------------------------------------------------------------------
# Build
.PHONY: build
build: \
build/footool
.PHONY: build/footool
build/footool:
@sh scripts/build/footool.sh
# ------------------------------------------------------------------------------
# Clean
.PHONY: clean
clean: \
clean/footool
.PHONY: clean/footool
clean/footool:
@rm -f lib/footool
# ------------------------------------------------------------------------------
# Download
.PHONY: download
download: \
download/footool
.PHONY: download/footool
download/footool:
@sh scripts/download/footool.sh
-
Add as many other files and
makegoals as you want, each for every independent package you need. -
Run it with
make alland enjoy the benefits of the modern package manager you were forced to write yourself just now.