summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2020-11-11 17:04:53 +0100
committerMatthias Beyer <mail@beyermatthias.de>2020-11-11 18:04:26 +0100
commit0ecead640a3ca8070666a91fc02b054f97bface3 (patch)
treeed23de728e8a185fb9da82796aa4f7e1fc9b7809 /examples
parentf1626ac35ef0c8359e4a342a564a3365d96bce1c (diff)
Have tmux as example packaged
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Diffstat (limited to 'examples')
-rw-r--r--examples/packages/example_tmux/Makefile38
-rw-r--r--examples/packages/example_tmux/config.toml47
-rw-r--r--examples/packages/example_tmux/pkg.toml62
3 files changed, 147 insertions, 0 deletions
diff --git a/examples/packages/example_tmux/Makefile b/examples/packages/example_tmux/Makefile
new file mode 100644
index 0000000..28ce019
--- /dev/null
+++ b/examples/packages/example_tmux/Makefile
@@ -0,0 +1,38 @@
+setup: dirs repo
+ @echo Ready.
+
+repo_content: repo_dir
+ @cp ./pkg.toml /tmp/tmux-repo/pkg.toml
+
+repo: repo_dir repo_content
+ cd /tmp/tmux-repo && git init && git add . && git commit -m init
+
+dirs: release_dir staging_dir repo_dir sources_dir
+
+release_dir:
+ @mkdir -p /tmp/tmux-releases
+
+staging_dir:
+ @mkdir -p /tmp/tmux-staging
+
+repo_dir:
+ @mkdir -p /tmp/tmux-repo
+
+sources_dir:
+ @mkdir -p /tmp/tmux-sources
+
+
+dirs_clean: release_dir_clean staging_dir_clean repo_dir_clean sources_dir_clean
+
+release_dir_dir:
+ @rm /tmp/tmux-releases/* || true
+
+staging_dir_dir:
+ @rm /tmp/tmux-staging/* || true
+
+repo_dir_dir:
+ @rm /tmp/tmux-repo/* || true
+
+sources_dir_dir:
+ @rm /tmp/tmux-sources/* || true
+
diff --git a/examples/packages/example_tmux/config.toml b/examples/packages/example_tmux/config.toml
new file mode 100644
index 0000000..0977015
--- /dev/null
+++ b/examples/packages/example_tmux/config.toml
@@ -0,0 +1,47 @@
+# Configuration file for BUTIDO for this repository
+
+# repository of package definitions
+repository = "/tmp/tmux-repo"
+releases = "/tmp/tmux-releases"
+staging = "/tmp/tmux-staging"
+source_cache = "/tmp/tmux-sources"
+
+# ####
+#
+# Log database configuration
+#
+# ####
+
+# The database to use
+#
+# Can be overridden via environment vairbale BUTIDO_DATABASE_URI or set via CLI.
+database_host = "localhost"
+database_port = 5432
+database_user = "pgdev"
+database_password = "password"
+database_name = "butido"
+
+
+# Phases which can be configured in the packages
+available_phases = [ "unpack", "depinst", "configure", "build", "install", "package" ]
+
+[docker]
+# Images which can be used to build
+# images not listed here are automatically rejected
+images = [ "debian:bullseye" ]
+verify_images_present = true
+
+# List of docker endpoints
+[[docker.endpoints]]
+name = "example host name"
+uri = "http://0.0.0.0:8095"
+endpoint_type = "http"
+speed = 1
+maxjobs = 10
+
+
+[containers]
+# environment variables which are allowed during container start
+# This way, errors (typos) when passing environment to a build can be prevented
+allowed_env = [ "PATH" ]
+
diff --git a/examples/packages/example_tmux/pkg.toml b/examples/packages/example_tmux/pkg.toml
new file mode 100644
index 0000000..7d4119e
--- /dev/null
+++ b/examples/packages/example_tmux/pkg.toml
@@ -0,0 +1,62 @@
+name = "tmux"
+version = "3.1c"
+version_is_semver = false
+
+# no patches by default
+patches = []
+
+[source]
+url = "https://github.com/tmux/tmux/archive/3.1c.tar.gz"
+hash.type = "sha1"
+hash.hash = "5e8bcaa3c758f84f01935a914e2bbf01309462ae"
+
+
+[dependencies]
+system = ["libevent"]
+system_runtime = []
+build = []
+runtime = []
+
+# Root description of phases
+# can be overridden as well
+[phases]
+
+unpack.script = '''
+ mkdir /build
+ tar -C /build -xzf /inputs/*source
+'''
+
+# We use a depinst phase here because we don't want to add a Dockerfile to the
+# repo where we prepare a build container.
+# This is, of course, not be the way it would be done in a real-world scenario!
+depinst.script = '''
+ apt update
+ apt install -y pkg-config gcc bison make autotools-dev autoconf libevent-dev libncurses5-dev
+'''
+
+configure.script = '''
+ cd /build/tmux-3.1c/
+ echo "SOURCES: "
+ ls
+ echo "-----"
+
+ ./autogen.sh || exit 1
+ ./configure || exit 1
+'''
+
+build.script = '''
+ cd /build/tmux-3.1c
+ make || exit 1
+'''
+
+install.script = '''
+ cd /build/tmux-3.1c
+ make install || exit 1
+'''
+
+package.script = '''
+ # I am simple
+ mkdir /outputs/
+ tar czf /outputs/tmux-3.1c.tgz /usr/local/bin/tmux
+'''
+