diff --git a/README.md b/README.md index 2f973e3..1bef699 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,33 @@ # epics-module-meta -Meta repository with references to third party modules and tags to build them \ No newline at end of file +Meta repository with references to third party modules and tags to build them. + +This is very barebones, please improve as you see fit. +This at least allows us to pin down the versions for when we need to rebuild everything + +## How to + +Create a module yaml file in the `modules` directory, the most common case we build an already tagged version from GFS. + +``` +$ cat modules/autosave.yaml +module: autosave +repo: git@git.psi.ch:epics_driver_modules/autosave.git +tag: 5.7.18 +``` + +Build with: +``` +./build modules/autosave.yaml +``` + +Install with: +``` +./build modules/autosave.yaml install +``` + +If you have your modules directory in a non-standard location: +``` +export EPICS_MODULES=/path/to/your/modules +``` +in beforehand. diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..6f0dc90 --- /dev/null +++ b/build.sh @@ -0,0 +1,39 @@ +#!/usr/bin/bash +set -eo pipefail +WORKDIR=${WORKDIR:-workdir} +MODULEYAML=$1 + +if [ ! -f "$MODULEYAML" ]; then + echo "Module yaml description $MODULEYAML not found" + exit -1 +fi + +if [ ! -d "$WORKDIR" ]; then + mkdir $WORKDIR +fi + +module=$(yq e '.module' $MODULEYAML) +repo=$(yq e '.repo' $MODULEYAML) +tag=$(yq e '.tag' $MODULEYAML) + +builddir="$WORKDIR/$module" +if [ ! -d "${builddir}" ]; then + echo je + if [ ! "$tag" = "null" ]; then + # prioritize tags + git clone $repo $builddir -b $tag + else + # use commit + branch=$(yq e '.branch' $MODULEYAML) + commit=$(yq e '.commit' $MODULEYAML) + if [ -z "$commit" ]; then + echo "Error no tag or commit specified" + exit -1 + fi + git clone $repo $builddir -b $branch + git -C $builddir checkout $commit + fi +fi + +ARCH_FILTER="RHEL8%" make -C $builddir $2 + diff --git a/modules/motorSim.yaml b/modules/motorSim.yaml new file mode 100644 index 0000000..334df49 --- /dev/null +++ b/modules/motorSim.yaml @@ -0,0 +1,3 @@ +module: motorSim +repo: git@git.psi.ch:epics_driver_modules/motorMotorSim.git +tag: 1.2.0 diff --git a/modules/require.yaml b/modules/require.yaml new file mode 100644 index 0000000..d049208 --- /dev/null +++ b/modules/require.yaml @@ -0,0 +1,5 @@ +# For now and example, just to prove that we can build from commits +module: require +repo: git@git.psi.ch:epics_driver_modules/require.git +branch: master +commit: e2da39ec956c7e6db348f071faa0f6fc4234abf9