Skip to content

Commit c5bcd08

Browse files
committed
run.py --local-build: detect spec file paths
This allows to build packages with a flat (current Fedora/RHEL standard) source layout. Originally-by: Tu Dinh <[email protected]> Signed-off-by: Yann Dirson <[email protected]>
1 parent e21d247 commit c5bcd08

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

files/init-container.sh

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,25 @@ if [ -n "$BUILD_LOCAL" ]; then
6969
time (
7070
cd ~/rpmbuild
7171
rm BUILD BUILDROOT RPMS SRPMS -rf
72-
sudo $BDEP -y SPECS/*.spec
72+
73+
if specs=$(ls *.spec 2>/dev/null); then
74+
SPECFLAGS=(
75+
--define "_sourcedir $PWD"
76+
--define "_specdir $PWD"
77+
)
78+
else
79+
specs=$(ls SPECS/*.spec 2>/dev/null)
80+
# SOURCES/ and SPECS/ are still the default in Alma10
81+
SPECFLAGS=()
82+
fi
83+
echo "Found specfiles $specs"
84+
85+
sudo $BDEP -y $specs
7386
RPMBUILDFLAGS=(
74-
-ba SPECS/*.spec
87+
-ba $specs
7588
--target "$RPMARCH"
76-
$RPMBUILD_OPTS
89+
$RPMBUILD_OPTS
90+
"${SPECFLAGS[@]}"
7791
)
7892
# in case the build deps contain xs-opam-repo, source the added profile.d file
7993
[ ! -f /etc/profile.d/opam.sh ] || source /etc/profile.d/opam.sh

0 commit comments

Comments
 (0)