Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.package
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ophélie Gagnard
slapos.package
Commits
0573dbae
Commit
0573dbae
authored
Mar 11, 2022
by
Ophélie Gagnard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow to use custom compilation template files.
parent
a3e424de
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
146 additions
and
23 deletions
+146
-23
obs/generic/build-scripts/bootstrap_buildout.sh
obs/generic/build-scripts/bootstrap_buildout.sh
+1
-1
obs/generic/build-scripts/clean_compilation_templates.sh
obs/generic/build-scripts/clean_compilation_templates.sh
+1
-1
obs/generic/build-scripts/compilation_templates.sh
obs/generic/build-scripts/compilation_templates.sh
+12
-5
obs/generic/build-scripts/configuration_information.sh
obs/generic/build-scripts/configuration_information.sh
+1
-1
obs/generic/build-scripts/obs.sh
obs/generic/build-scripts/obs.sh
+2
-2
obs/generic/templates/compilation-templates/_generic/Makefile.in
...eric/templates/compilation-templates/_generic/Makefile.in
+1
-1
obs/generic/templates/compilation-templates/_generic/local_buildout.cfg.in
...ates/compilation-templates/_generic/local_buildout.cfg.in
+0
-4
obs/generic/templates/compilation-templates/fluent-bit/Makefile.in
...ic/templates/compilation-templates/fluent-bit/Makefile.in
+54
-0
obs/generic/templates/compilation-templates/fluent-bit/local_buildout.cfg.in
...es/compilation-templates/fluent-bit/local_buildout.cfg.in
+0
-8
obs/generic/templates/compilation-templates/mca/Makefile.in
obs/generic/templates/compilation-templates/mca/Makefile.in
+58
-0
obs/generic/templates/compilation-templates/mca/local_buildout.cfg.in
...templates/compilation-templates/mca/local_buildout.cfg.in
+16
-0
No files found.
obs/generic/build-scripts/bootstrap_buildout.sh
View file @
0573dbae
...
@@ -15,7 +15,7 @@ cd $INITIAL_DIR
...
@@ -15,7 +15,7 @@ cd $INITIAL_DIR
mkdir
-p
$RUN_BUILDOUT_DIR
mkdir
-p
$RUN_BUILDOUT_DIR
cd
$RUN_BUILDOUT_DIR
cd
$RUN_BUILDOUT_DIR
# should be with gcc here and without in OBS
# should be with gcc here and without in OBS
cp
$COMPILATION_TEMPLATES_DIR
/tmp/
buildout_without_gcc
.cfg buildout.cfg
cp
$COMPILATION_TEMPLATES_DIR
/tmp/
$SOFTWARE_NAME
/local_buildout
.cfg buildout.cfg
## next line explained
## next line explained
# 1st cmd: bootstrap buildout (creates bin/buildout)
# 1st cmd: bootstrap buildout (creates bin/buildout)
# 2nd cmd: backup bin/buildout (to be restored for OBS)
# 2nd cmd: backup bin/buildout (to be restored for OBS)
...
...
obs/generic/build-scripts/clean_compilation_templates.sh
View file @
0573dbae
...
@@ -5,4 +5,4 @@ source build-scripts/configuration_information.sh
...
@@ -5,4 +5,4 @@ source build-scripts/configuration_information.sh
cd
$INITIAL_DIR
cd
$INITIAL_DIR
# Clean temporary directory for templates
# Clean temporary directory for templates
rm
-rf
$COMPILATION_TEMPLATES_DIR
/tmp/
rm
-rf
$COMPILATION_TEMPLATES_DIR
/tmp/
$SOFTWARE_NAME
obs/generic/build-scripts/compilation_templates.sh
View file @
0573dbae
...
@@ -4,8 +4,15 @@ set -e
...
@@ -4,8 +4,15 @@ set -e
source
build-scripts/configuration_information.sh
source
build-scripts/configuration_information.sh
cd
$INITIAL_DIR
cd
$INITIAL_DIR
# Prepare the templates in $COMPILATION_TEMPLATES_DIR/tmp/
# Prepare the templates in $COMPILATION_TEMPLATES_DIR/tmp/$SOFTWARE_NAME
mkdir
-p
$COMPILATION_TEMPLATES_DIR
/tmp/
mkdir
-p
$COMPILATION_TEMPLATES_DIR
/tmp/
$SOFTWARE_NAME
sed
$ALL_REGEX
$COMPILATION_TEMPLATES_DIR
/buildout_with_gcc.cfg.in
>
$COMPILATION_TEMPLATES_DIR
/tmp/buildout_with_gcc.cfg
sed
$ALL_REGEX
$COMPILATION_TEMPLATES_DIR
/buildout_without_gcc.cfg.in
>
$COMPILATION_TEMPLATES_DIR
/tmp/buildout_without_gcc.cfg
# if a custom directory exist for compilation templates, choose it
sed
$ALL_REGEX
$COMPILATION_TEMPLATES_DIR
/Makefile.in
>
$COMPILATION_TEMPLATES_DIR
/tmp/Makefile
# otherwise, default to .../_generic
ACTUAL_TEMPLATES_DIR
=
$COMPILATION_TEMPLATES_DIR
/
$SOFTWARE_NAME
if
[
!
-d
$ACTUAL_TEMPLATES_DIR
]
;
then
ACTUAL_TEMPLATES_DIR
=
$COMPILATION_TEMPLATES_DIR
/_generic
fi
sed
$ALL_REGEX
$ACTUAL_TEMPLATES_DIR
/local_buildout.cfg.in
>
$COMPILATION_TEMPLATES_DIR
/tmp/
$SOFTWARE_NAME
/local_buildout.cfg
sed
$ALL_REGEX
$ACTUAL_TEMPLATES_DIR
/Makefile.in
>
$COMPILATION_TEMPLATES_DIR
/tmp/
$SOFTWARE_NAME
/Makefile
obs/generic/build-scripts/configuration_information.sh
View file @
0573dbae
...
@@ -33,7 +33,7 @@ TARBALL_DIR=$INITIAL_DIR/tarballs/$SOFTWARE_AND_VERSION
...
@@ -33,7 +33,7 @@ TARBALL_DIR=$INITIAL_DIR/tarballs/$SOFTWARE_AND_VERSION
#SR_PATH=$TARBALL_DIR/software_release/component/$SOFTWARE_NAME/buildout.cfg
#SR_PATH=$TARBALL_DIR/software_release/component/$SOFTWARE_NAME/buildout.cfg
SR_PATH
=
$TARBALL_DIR
/software_release/software/
$SOFTWARE_NAME
/software.cfg
SR_PATH
=
$TARBALL_DIR
/software_release/software/
$SOFTWARE_NAME
/software.cfg
COMPILATION_TEMPLATES_DIR
=
$INITIAL_DIR
/templates/compilation-templates
COMPILATION_TEMPLATES_DIR
=
$INITIAL_DIR
/templates/compilation-templates
/
# BUILD_DIR was formerly BUILD_ROOT_DIRECTORY
# BUILD_DIR was formerly BUILD_ROOT_DIRECTORY
BUILD_DIR
=
$TARBALL_DIR
/build/
BUILD_DIR
=
$TARBALL_DIR
/build/
# RUN_BUILDOUT_DIR is where the parts/ directory will be ; formerly BUILD_DIRECTORY
# RUN_BUILDOUT_DIR is where the parts/ directory will be ; formerly BUILD_DIRECTORY
...
...
obs/generic/build-scripts/obs.sh
View file @
0573dbae
...
@@ -9,9 +9,9 @@ TMP_DIR=`realpath -m $TMP_DIR`
...
@@ -9,9 +9,9 @@ TMP_DIR=`realpath -m $TMP_DIR`
echo
TMP_DIR
=
$TMP_DIR
echo
TMP_DIR
=
$TMP_DIR
# copy the Makefile at the root of the tarball
# copy the Makefile at the root of the tarball
cp
$COMPILATION_TEMPLATES_DIR
/tmp/Makefile
$TARBALL_DIR
/Makefile
cp
$COMPILATION_TEMPLATES_DIR
/tmp/
$SOFTWARE_NAME
/
Makefile
$TARBALL_DIR
/Makefile
# save the local TARBALL_DIR to replace it with the TARBALL_DIR of OBS' VM
# save the local TARBALL_DIR to replace it with the TARBALL_DIR of OBS' VM
echo
$TARBALL_DIR
>
$TARBALL_DIR
/
cache_creation
_build_directory
echo
$TARBALL_DIR
>
$TARBALL_DIR
/
local
_build_directory
# restore bin/buildout
# restore bin/buildout
# note: when installing python, buildout "rebootstrap" itself to use the installed python: it would fail on OBS' VM
# note: when installing python, buildout "rebootstrap" itself to use the installed python: it would fail on OBS' VM
mv
$RUN_BUILDOUT_DIR
/bin/backup.buildout
$RUN_BUILDOUT_DIR
/bin/buildout
mv
$RUN_BUILDOUT_DIR
/bin/backup.buildout
$RUN_BUILDOUT_DIR
/bin/buildout
...
...
obs/generic/templates/compilation-templates/Makefile.in
→
obs/generic/templates/compilation-templates/
_generic/
Makefile.in
View file @
0573dbae
...
@@ -13,7 +13,7 @@ INSTALL_DIR = $(DESTDIR)$(TARGET_DIR)
...
@@ -13,7 +13,7 @@ INSTALL_DIR = $(DESTDIR)$(TARGET_DIR)
RUN_BUILDOUT_DIR
=
$(BUILD_DIR)$(TARGET_DIR)
RUN_BUILDOUT_DIR
=
$(BUILD_DIR)$(TARGET_DIR)
#PATCHES_DIR := $(shell pwd)/patches
#PATCHES_DIR := $(shell pwd)/patches
# get the path of the BUILD_DIR of the first build (performed to prepare the cache for OBS)
# get the path of the BUILD_DIR of the first build (performed to prepare the cache for OBS)
OLD_TARBALL_DIR
:=
$(
shell
cat
cache_creation
_build_directory
)
OLD_TARBALL_DIR
:=
$(
shell
cat
local
_build_directory
)
#Use to get path of buildout correct
#Use to get path of buildout correct
#ORIGINAL_DIRECTORY := $(shell cat ./original_directory)
#ORIGINAL_DIRECTORY := $(shell cat ./original_directory)
...
...
obs/generic/templates/compilation-templates/
buildout_without_gcc
.cfg.in
→
obs/generic/templates/compilation-templates/
_generic/local_buildout
.cfg.in
View file @
0573dbae
...
@@ -4,10 +4,6 @@ destdir = %BUILD_DIR%
...
@@ -4,10 +4,6 @@ destdir = %BUILD_DIR%
builddir = %RUN_BUILDOUT_DIR%
builddir = %RUN_BUILDOUT_DIR%
extends =
extends =
%SR_PATH%
%SR_PATH%
# %BUILD_DIR%/../software_release/software/fluent-bit/software.cfg
# %TARBALL_DIR%/software_release/software/fluent-bit/software.cfg
# %TARBALL_DIR%/software_release/component/fluent-bit/buildout.cfg
# %BUILD_DIR%/../software_release/component/fluent-bit/buildout.cfg
versions = versions
versions = versions
extends-cache = extends-cache
extends-cache = extends-cache
download-cache = download-cache
download-cache = download-cache
...
...
obs/generic/templates/compilation-templates/fluent-bit/Makefile.in
0 → 100644
View file @
0573dbae
PY
=
$(PYTHON)
#INSTALL_DIR = $(DESTDIR)/opt/test
#TARGET_DIR = /opt/slapos
# This templates are replaced by build-scripts/template_stage.sh
# according to the values and regular expressions defined in
# build-scripts/configuration_information.sh
# The variable TARGET_DIR is pretty useless atm
TARGET_DIR
=
%TARGET_DIR%
TARBALL_DIR
=
$(
shell
pwd
)
BUILD_DIR
=
$(TARBALL_DIR)
/build
INSTALL_DIR
=
$(DESTDIR)$(TARGET_DIR)
RUN_BUILDOUT_DIR
=
$(BUILD_DIR)$(TARGET_DIR)
#PATCHES_DIR := $(shell pwd)/patches
# get the path of the BUILD_DIR of the first build (performed to prepare the cache for OBS)
OLD_TARBALL_DIR
:=
$(
shell
cat
local_build_directory
)
#Use to get path of buildout correct
#ORIGINAL_DIRECTORY := $(shell cat ./original_directory)
all
:
build
build
:
build-stamp
build-stamp
:
@
echo
"Fixing buildout path to
$(TARBALL_DIR)
rather than
$(OLD_TARBALL_DIR)
for buildout"
################################################################################
# grep -rIl '$(OLD_DIRECTORY)' $(BUILD_DIR) 2> /dev/null | \
# xargs sed -i 's#$(OLD_DIRECTORY)#$(BUILD_DIR)#g' || \
# echo "No path to fix."
################################################################################
ls
-l
$(RUN_BUILDOUT_DIR)
# DEBUG
ls
-l
$(RUN_BUILDOUT_DIR)/bin/
# DEBUG
cd
$(RUN_BUILDOUT_DIR);
sed
-i
's#$(OLD_TARBALL_DIR)#$(TARBALL_DIR)#g'
buildout.cfg
bin/*
echo
RUN_BUILDOUT_DIR
=
$(RUN_BUILDOUT_DIR)
\;
PY
=
$(PY)
cd
$(RUN_BUILDOUT_DIR)
&&
\
$(PY)
./bin/buildout
-v
@touch
build-stamp
clean
:
# TODO: implement a proper cleaning
#rm -rf
$(BUILD_DIR)
rm
-f
*
-stamp
install
:
all
#cd slapos; make install
mkdir
-p
$(INSTALL_DIR)
/bin
mkdir
-p
$(INSTALL_DIR)
/share/
#cp `find
$(RUN_BUILDOUT_DIR)
|
grep
-e
"^
$(RUN_BUILDOUT_DIR)
/[^/][^/]*/bin/*
`
$(DESTDIR)
/usr/bin/
-
cp
-r
$(RUN_BUILDOUT_DIR)
/parts/fluent-bit/bin/
*
$(INSTALL_DIR)
/bin/
-
cp
-r
$(RUN_BUILDOUT_DIR)
/parts/fluent-bit/share/
*
$(INSTALL_DIR)
/share/
ls
-Rl
$(INSTALL_DIR)
/bin/
# DEBUG
.PHONY
:
build all clean install
obs/generic/templates/compilation-templates/
buildout_with_gcc
.cfg.in
→
obs/generic/templates/compilation-templates/
fluent-bit/local_buildout
.cfg.in
View file @
0573dbae
...
@@ -4,18 +4,10 @@ destdir = %BUILD_DIR%
...
@@ -4,18 +4,10 @@ destdir = %BUILD_DIR%
builddir = %RUN_BUILDOUT_DIR%
builddir = %RUN_BUILDOUT_DIR%
extends =
extends =
%SR_PATH%
%SR_PATH%
# %BUILD_DIR%/../software_release/software/fluent-bit/software.cfg
# %TARBALL_DIR%/software_release/software/fluent-bit/software.cfg
# %TARBALL_DIR%/software_release/component/fluent-bit/buildout.cfg
# %BUILD_DIR%/../software_release/component/fluent-bit/buildout.cfg
versions = versions
versions = versions
extends-cache = extends-cache
extends-cache = extends-cache
download-cache = download-cache
download-cache = download-cache
[gcc]
# force usage of gcc from slapos to have it in the cache
max_version = 0
[versions]
[versions]
setuptools = 44.1.1
setuptools = 44.1.1
# Use SlapOS patched zc.buildout
# Use SlapOS patched zc.buildout
...
...
obs/generic/templates/compilation-templates/mca/Makefile.in
0 → 100644
View file @
0573dbae
PY
=
$(PYTHON)
#INSTALL_DIR = $(DESTDIR)/opt/test
#TARGET_DIR = /opt/slapos
# This templates are replaced by build-scripts/template_stage.sh
# according to the values and regular expressions defined in
# build-scripts/configuration_information.sh
# The variable TARGET_DIR is pretty useless atm
TARGET_DIR
=
%TARGET_DIR%
TARBALL_DIR
=
$(
shell
pwd
)
BUILD_DIR
=
$(TARBALL_DIR)
/build
INSTALL_DIR
=
$(DESTDIR)$(TARGET_DIR)
RUN_BUILDOUT_DIR
=
$(BUILD_DIR)$(TARGET_DIR)
#PATCHES_DIR := $(shell pwd)/patches
# get the path of the BUILD_DIR of the first build (performed to prepare the cache for OBS)
OLD_TARBALL_DIR
:=
$(
shell
cat
local_build_directory
)
#Use to get path of buildout correct
#ORIGINAL_DIRECTORY := $(shell cat ./original_directory)
all
:
build
build
:
build-stamp
build-stamp
:
@
echo
"Fixing buildout path to
$(TARBALL_DIR)
rather than
$(OLD_TARBALL_DIR)
for buildout"
################################################################################
# grep -rIl '$(OLD_DIRECTORY)' $(BUILD_DIR) 2> /dev/null | \
# xargs sed -i 's#$(OLD_DIRECTORY)#$(BUILD_DIR)#g' || \
# echo "No path to fix."
################################################################################
ls
-l
$(RUN_BUILDOUT_DIR)
# DEBUG
ls
-l
$(RUN_BUILDOUT_DIR)/bin/
# DEBUG
cd
$(RUN_BUILDOUT_DIR);
sed
-i
's#$(OLD_TARBALL_DIR)#$(TARBALL_DIR)#g'
buildout.cfg
bin/*
echo
RUN_BUILDOUT_DIR
=
$(RUN_BUILDOUT_DIR)
\;
PY
=
$(PY)
cd
$(RUN_BUILDOUT_DIR)
&&
\
$(PY)
./bin/buildout
-v
@touch
build-stamp
clean
:
# TODO: implement a proper cleaning
#rm -rf
$(BUILD_DIR)
rm
-f
*
-stamp
install
:
all
#cd slapos; make install
mkdir
-p
$(INSTALL_DIR)
/bin
mkdir
-p
$(INSTALL_DIR)
/etc/
mkdir
-p
$(INSTALL_DIR)
/lib/
mkdir
-p
$(INSTALL_DIR)
/share/
#cp `find
$(RUN_BUILDOUT_DIR)
|
grep
-e
"^
$(RUN_BUILDOUT_DIR)
/[^/][^/]*/bin/*
`
$(DESTDIR)
/usr/bin/
-
cp
-r
$(RUN_BUILDOUT_DIR)
/parts/mca/bin/
*
$(INSTALL_DIR)
/bin/
-
cp
-r
$(RUN_BUILDOUT_DIR)
/parts/mca/etc/
*
$(INSTALL_DIR)
/etc/
-
cp
-r
$(RUN_BUILDOUT_DIR)
/parts/
{
mca,openssl
}
/lib/
*
$(INSTALL_DIR)
/lib/
-
cp
-r
$(RUN_BUILDOUT_DIR)
/parts/
{
mca,openssl
}
/share/
*
$(INSTALL_DIR)
/share/
ls
-Rl
$(INSTALL_DIR)
/bin/
# DEBUG
.PHONY
:
build all clean install
obs/generic/templates/compilation-templates/mca/local_buildout.cfg.in
0 → 100644
View file @
0573dbae
[buildout]
rootdir = %TARGET_DIR%
destdir = %BUILD_DIR%
builddir = %RUN_BUILDOUT_DIR%
extends =
%SR_PATH%
versions = versions
extends-cache = extends-cache
download-cache = download-cache
[versions]
setuptools = 44.1.1
# Use SlapOS patched zc.buildout
zc.buildout = 2.7.1+slapos016
# Use SlapOS patched zc.recipe.egg (zc.recipe.egg 2.x is for Buildout 2)
zc.recipe.egg = 2.0.3+slapos003
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment