2017-10-28 21:22:43 +00:00
|
|
|
#!/bin/sh
|
2020-05-25 09:06:28 +00:00
|
|
|
# Generate source packages and upload them to OBS, for the latest feed.
|
2019-07-22 10:04:01 +00:00
|
|
|
. "$(dirname "$0")/common.sh"
|
2019-06-13 13:53:39 +00:00
|
|
|
. "$(dirname "$0")/common-obs.sh"
|
2017-10-28 21:22:43 +00:00
|
|
|
|
2017-11-21 12:06:14 +00:00
|
|
|
set -e
|
2018-10-04 17:25:35 +00:00
|
|
|
set -x
|
2017-10-28 21:22:43 +00:00
|
|
|
|
|
|
|
# OBS project name
|
|
|
|
PROJ=network:osmocom:latest
|
|
|
|
|
2021-01-15 09:57:53 +00:00
|
|
|
DT=$(date +%Y%m%d%H%M)
|
2017-11-15 19:42:39 +00:00
|
|
|
TOP=$(pwd)
|
2018-10-04 17:25:35 +00:00
|
|
|
DEBSRCDIR="$TOP/debsrc"
|
2017-10-28 21:22:43 +00:00
|
|
|
|
2019-04-11 12:48:17 +00:00
|
|
|
### OBS build
|
2018-10-04 17:25:35 +00:00
|
|
|
prepare() {
|
|
|
|
# start with a checkout of the project
|
|
|
|
if [ -d $PROJ ]; then
|
|
|
|
(cd $PROJ && osc up)
|
|
|
|
else
|
|
|
|
osc co $PROJ
|
|
|
|
fi
|
|
|
|
[ -d "$DEBSRCDIR" ] && rm -rf "$DEBSRCDIR"
|
|
|
|
mkdir "$DEBSRCDIR"
|
2019-06-13 13:53:39 +00:00
|
|
|
|
|
|
|
cd "$TOP"
|
2020-05-25 09:06:28 +00:00
|
|
|
osmo_obs_prepare_conflict "osmocom-latest" "osmocom-nightly" "osmocom-next"
|
2018-10-04 17:25:35 +00:00
|
|
|
}
|
2017-10-28 21:22:43 +00:00
|
|
|
|
2018-10-04 17:25:35 +00:00
|
|
|
get_last_tag() {
|
|
|
|
project="$1"
|
2020-02-23 15:01:56 +00:00
|
|
|
if [ "$project" = "limesuite" ] || [ "$project" = "open5gs" ]; then
|
2018-10-04 17:25:35 +00:00
|
|
|
ver_regexp="^v[0-9]*.[0-9]*.[0-9]*$"
|
|
|
|
else
|
|
|
|
ver_regexp="^[0-9]*.[0-9]*.[0-9]*$"
|
|
|
|
fi
|
|
|
|
VER=$(git -C "${TOP}/${project}" tag -l --sort=v:refname | grep "$ver_regexp" | tail -n 1)
|
|
|
|
echo "${VER}"
|
|
|
|
}
|
|
|
|
|
|
|
|
checkout() {
|
2017-11-21 11:59:00 +00:00
|
|
|
project=$1
|
2020-02-24 19:31:47 +00:00
|
|
|
url=$2
|
2018-10-04 17:25:35 +00:00
|
|
|
gitbpargs=""
|
2020-02-24 19:31:47 +00:00
|
|
|
|
|
|
|
if [ -z "$url" ]; then
|
|
|
|
url="$(osmo_git_clone_url "$project")"
|
|
|
|
fi
|
|
|
|
|
2017-10-28 21:22:43 +00:00
|
|
|
echo
|
2018-10-04 17:25:35 +00:00
|
|
|
echo "====> Checking out $project"
|
2017-11-15 19:45:12 +00:00
|
|
|
cd "$TOP"
|
2020-02-24 19:31:47 +00:00
|
|
|
[ -d "$project" ] || osmo_git_clone_date "$url" "$project"
|
2018-10-04 17:25:35 +00:00
|
|
|
cd "$project"
|
2017-10-28 21:22:43 +00:00
|
|
|
git fetch
|
2018-10-04 17:25:35 +00:00
|
|
|
VER=$(get_last_tag "$project")
|
|
|
|
git checkout -f -B "$VER" "refs/tags/$VER"
|
2020-02-23 15:01:56 +00:00
|
|
|
if [ "$project" = "open5gs" ]; then
|
|
|
|
meson subprojects download freeDiameter
|
|
|
|
fi
|
2018-10-04 17:25:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
build() {
|
|
|
|
project=$1
|
|
|
|
gitbpargs="$2"
|
|
|
|
output="$DEBSRCDIR/$project"
|
|
|
|
echo
|
|
|
|
echo "====> Building $project"
|
|
|
|
cd "$TOP/$project"
|
|
|
|
VER=$(get_last_tag "$project")
|
2018-08-08 06:28:26 +00:00
|
|
|
if [ -x ./git-version-gen ]; then
|
|
|
|
./git-version-gen . > .tarball-version 2>/dev/null
|
2019-06-13 13:53:39 +00:00
|
|
|
fi
|
|
|
|
|
2021-01-14 14:33:40 +00:00
|
|
|
osmo_obs_add_depend_deb "./debian/control" "$project" "osmocom-latest"
|
2019-06-13 13:53:39 +00:00
|
|
|
|
2020-02-23 15:01:56 +00:00
|
|
|
if [ "$project" = "open5gs" ]; then
|
|
|
|
# we cannot control the output directory of the generated source :(
|
|
|
|
dpkg-buildpackage -S -uc -us -d
|
|
|
|
mkdir -p "$output"
|
|
|
|
mv "../$name"*.tar* "../$name"*.dsc "$output"
|
|
|
|
elif [ -x ./git-version-gen ]; then
|
2018-08-08 06:28:26 +00:00
|
|
|
gbp buildpackage -S -uc -us -d --git-ignore-branch "--git-export-dir=$output" \
|
2018-10-04 17:25:35 +00:00
|
|
|
"--git-debian-branch=$VER" --git-ignore-new $gitbpargs \
|
2018-08-08 06:28:26 +00:00
|
|
|
--git-postexport='cp $GBP_GIT_DIR/../.tarball-version $GBP_TMP_DIR/'
|
|
|
|
else
|
|
|
|
gbp buildpackage -S -uc -us -d --git-ignore-branch "--git-export-dir=$output" \
|
2018-10-04 17:25:35 +00:00
|
|
|
"--git-debian-branch=$VER" --git-ignore-new $gitbpargs
|
2018-08-08 06:28:26 +00:00
|
|
|
fi
|
2017-11-21 11:59:00 +00:00
|
|
|
|
2018-10-04 17:25:35 +00:00
|
|
|
if [ ! -d "$TOP/$PROJ/$project" ] ; then
|
2017-11-21 11:59:00 +00:00
|
|
|
# creating a new package is different from using old ones
|
2018-10-04 17:25:35 +00:00
|
|
|
mkdir "$TOP/$PROJ/$project"
|
|
|
|
mv "$output/"*.dsc "$TOP/$PROJ/$project/"
|
|
|
|
mv "$output/"*.tar* "$TOP/$PROJ/$project/"
|
2017-11-21 11:59:00 +00:00
|
|
|
cd "$TOP/$PROJ"
|
2018-10-04 17:25:35 +00:00
|
|
|
osc add "$project"
|
2017-11-21 11:59:00 +00:00
|
|
|
else
|
2018-10-04 17:25:35 +00:00
|
|
|
cd "$TOP/$PROJ/$project"
|
2017-11-21 11:59:00 +00:00
|
|
|
|
|
|
|
# update OBS only if the filename doesn't match
|
|
|
|
file=$(cd "$output/" ; ls ./*.dsc)
|
|
|
|
if [ ! -e "$file" ] ; then
|
|
|
|
osc rm ./* || true
|
|
|
|
mv "$output/"*.dsc .
|
|
|
|
mv "$output/"*.tar* .
|
2020-05-13 07:55:18 +00:00
|
|
|
osc add ./*
|
|
|
|
fi
|
2017-11-21 11:59:00 +00:00
|
|
|
fi
|
2021-03-01 11:04:36 +00:00
|
|
|
|
|
|
|
osmo_obs_add_rpm_spec "$TOP/$PROJ/$project" "$TOP/$project" "$project" "osmocom-latest"
|
|
|
|
|
2017-11-15 19:45:12 +00:00
|
|
|
cd "$TOP"
|
2017-10-28 21:22:43 +00:00
|
|
|
}
|
|
|
|
|
2019-04-11 08:41:34 +00:00
|
|
|
# add those once they have tagged any versions that include the 'debian' sub-dir:
|
2018-10-04 17:25:35 +00:00
|
|
|
#rtl-sdr
|
|
|
|
#osmo-fl2k
|
|
|
|
|
|
|
|
build_osmocom() {
|
|
|
|
prepare
|
|
|
|
|
2019-12-12 12:15:43 +00:00
|
|
|
# NOTE: when adding a repository that is not in gerrit, adjust osmo_git_clone_url()
|
2020-02-24 19:31:47 +00:00
|
|
|
checkout limesuite https://github.com/myriadrf/LimeSuite
|
2019-05-28 13:21:50 +00:00
|
|
|
checkout osmo-gsm-manuals
|
2018-10-04 17:25:35 +00:00
|
|
|
checkout libosmocore
|
|
|
|
checkout libosmo-sccp
|
|
|
|
checkout libosmo-abis
|
|
|
|
checkout libosmo-netif
|
|
|
|
checkout libsmpp34
|
|
|
|
checkout libasn1c
|
|
|
|
checkout libgtpnl
|
|
|
|
checkout libusrp
|
|
|
|
checkout osmo-iuh
|
|
|
|
checkout osmo-ggsn
|
|
|
|
checkout osmo-sgsn
|
|
|
|
checkout osmo-pcap
|
|
|
|
checkout osmo-trx
|
|
|
|
checkout osmo-sip-connector
|
|
|
|
checkout osmo-bts
|
|
|
|
checkout osmo-pcu
|
|
|
|
checkout osmo-hlr
|
|
|
|
checkout osmo-mgw
|
|
|
|
checkout osmo-msc
|
|
|
|
checkout osmo-bsc
|
|
|
|
checkout simtrace2
|
2019-01-26 17:28:25 +00:00
|
|
|
checkout libosmo-dsp
|
2019-04-03 07:52:39 +00:00
|
|
|
checkout osmo-sysmon
|
2019-07-21 19:34:38 +00:00
|
|
|
checkout osmo-remsim
|
2020-02-24 19:31:47 +00:00
|
|
|
checkout open5gs https://github.com/open5gs/open5gs
|
2020-02-24 19:26:54 +00:00
|
|
|
checkout neocon https://github.com/laf0rge/neocon
|
2020-04-24 21:41:44 +00:00
|
|
|
checkout osmo-uecups
|
2020-07-01 08:50:25 +00:00
|
|
|
checkout osmo-e1d
|
2021-01-24 15:18:46 +00:00
|
|
|
checkout osmo-cbc
|
2018-10-04 17:25:35 +00:00
|
|
|
|
2020-05-22 08:06:18 +00:00
|
|
|
cd "$TOP"
|
|
|
|
osmo_obs_checkout_copy debian8 osmo-gsm-manuals
|
2019-05-28 13:21:50 +00:00
|
|
|
|
2019-06-13 13:53:39 +00:00
|
|
|
build osmocom-latest
|
2018-10-04 17:25:35 +00:00
|
|
|
build limesuite --git-upstream-tree="$(get_last_tag limesuite)"
|
2019-05-28 13:21:50 +00:00
|
|
|
build osmo-gsm-manuals
|
2020-05-22 08:06:18 +00:00
|
|
|
build osmo-gsm-manuals-debian8
|
2018-10-04 17:25:35 +00:00
|
|
|
build libosmocore
|
|
|
|
build libosmo-sccp
|
|
|
|
build libosmo-abis
|
|
|
|
build libosmo-netif
|
|
|
|
build libsmpp34
|
|
|
|
build libasn1c
|
|
|
|
build libgtpnl
|
|
|
|
build libusrp
|
|
|
|
build osmo-iuh
|
|
|
|
build osmo-ggsn
|
|
|
|
build osmo-sgsn
|
|
|
|
build osmo-pcap
|
|
|
|
build osmo-trx
|
|
|
|
build osmo-sip-connector
|
|
|
|
build osmo-bts
|
|
|
|
build osmo-pcu
|
|
|
|
build osmo-hlr
|
|
|
|
build osmo-mgw
|
|
|
|
build osmo-msc
|
|
|
|
build osmo-bsc
|
|
|
|
build simtrace2
|
2019-01-26 17:28:25 +00:00
|
|
|
build libosmo-dsp
|
2019-04-03 07:52:39 +00:00
|
|
|
build osmo-sysmon
|
2019-07-21 19:34:38 +00:00
|
|
|
build osmo-remsim
|
2020-02-23 15:01:56 +00:00
|
|
|
build open5gs
|
2020-02-24 19:26:54 +00:00
|
|
|
build neocon
|
2021-02-23 19:21:11 +00:00
|
|
|
build osmo-uecups
|
2020-07-01 08:50:25 +00:00
|
|
|
build osmo-e1d
|
2021-01-24 15:18:46 +00:00
|
|
|
build osmo-cbc
|
2018-10-04 17:25:35 +00:00
|
|
|
|
|
|
|
cd "$TOP/$PROJ"
|
2020-05-22 08:38:50 +00:00
|
|
|
osc ci -m "Latest Tagged versions of $DT" --noservice
|
2018-10-04 17:25:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
build_osmocom
|