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.
|
2021-04-27 12:54:55 +00:00
|
|
|
# New packages are only uploaded if the source changed.
|
2021-04-27 12:15:54 +00:00
|
|
|
# Environment variables:
|
|
|
|
# * PROJ: the OBS namespace to upload to (e.g. "network:osmocom:latest")
|
2021-04-27 12:44:56 +00:00
|
|
|
# * FEED:
|
|
|
|
# * "latest": use latest tagged release (default)
|
2021-05-17 09:41:57 +00:00
|
|
|
# * other: use last commit of branch of same name, exit with error if it does
|
|
|
|
# not exist
|
2021-04-27 13:34:23 +00:00
|
|
|
# * PACKAGES: set to a space-separated list of packages to skip all others
|
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
|
|
|
|
2021-05-17 15:10:05 +00:00
|
|
|
# Values for FEED env var. Adjust FEEDS_ALL in common-obs when changing.
|
2021-04-27 12:44:56 +00:00
|
|
|
FEEDS="
|
|
|
|
latest
|
|
|
|
"
|
|
|
|
|
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
|
|
|
|
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"
|
2021-04-27 12:44:56 +00:00
|
|
|
FEED="${FEED:-latest}"
|
|
|
|
|
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"
|
2021-05-17 15:10:05 +00:00
|
|
|
osmo_obs_prepare_conflict
|
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
|
|
|
|
2021-04-27 13:34:23 +00:00
|
|
|
if osmo_obs_skip_pkg "$project"; then
|
|
|
|
return
|
|
|
|
fi
|
|
|
|
|
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
|
2021-04-27 12:44:56 +00:00
|
|
|
|
|
|
|
if [ "$FEED" = "latest" ]; then
|
|
|
|
VER=$(get_last_tag "$project")
|
|
|
|
git checkout -f -B "$VER" "refs/tags/$VER"
|
|
|
|
else
|
|
|
|
git checkout -f -B "$FEED" "origin/$FEED"
|
|
|
|
fi
|
|
|
|
|
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
|
|
|
}
|
|
|
|
|
2021-04-29 07:50:42 +00:00
|
|
|
# Generate a source package and upload it to OBS
|
|
|
|
# $1: package name (e.g. "libosmocore")
|
|
|
|
# $2: arguments to pass to "gbp buildpackage"
|
2018-10-04 17:25:35 +00:00
|
|
|
build() {
|
|
|
|
project=$1
|
|
|
|
gitbpargs="$2"
|
|
|
|
output="$DEBSRCDIR/$project"
|
2021-04-27 13:34:23 +00:00
|
|
|
|
|
|
|
if osmo_obs_skip_pkg "$project"; then
|
|
|
|
return
|
|
|
|
fi
|
|
|
|
|
2018-10-04 17:25:35 +00:00
|
|
|
echo
|
|
|
|
echo "====> Building $project"
|
|
|
|
cd "$TOP/$project"
|
2021-04-27 12:44:56 +00:00
|
|
|
|
2021-04-27 14:56:13 +00:00
|
|
|
osmo_obs_git_version_gen
|
|
|
|
|
2021-04-27 12:44:56 +00:00
|
|
|
if [ "$FEED" = "latest" ]; then
|
|
|
|
debian_branch=$(get_last_tag "$project")
|
|
|
|
else
|
|
|
|
debian_branch="$FEED"
|
2021-04-27 14:56:13 +00:00
|
|
|
# Set new debian changelog version with commit appended. This version will
|
|
|
|
# become part of resulting filenames, and will change if commits have been
|
|
|
|
# added to the feed's branch.
|
|
|
|
VER="$(osmo_obs_get_commit_version)"
|
|
|
|
dch -b -v "$VER" -m "Snapshot build"
|
|
|
|
git commit -m "$VER snapshot" debian/
|
2021-04-27 12:44:56 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
osmo_obs_add_depend_deb "./debian/control" "$project" "osmocom-$FEED"
|
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" \
|
2021-04-27 12:44:56 +00:00
|
|
|
"--git-debian-branch=$debian_branch" --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" \
|
2021-04-27 12:44:56 +00:00
|
|
|
"--git-debian-branch=$debian_branch" --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
|
|
|
|
2021-04-27 12:44:56 +00:00
|
|
|
osmo_obs_add_rpm_spec "$TOP/$PROJ/$project" "$TOP/$project" "$project" "osmocom-$FEED"
|
2021-03-01 11:04:36 +00:00
|
|
|
|
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-03-01 19:53:09 +00:00
|
|
|
checkout osmo-smlc
|
2021-01-24 15:18:46 +00:00
|
|
|
checkout osmo-cbc
|
2021-03-01 09:37:02 +00:00
|
|
|
checkout osmo-gbproxy
|
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
|
|
|
|
2021-04-27 12:44:56 +00:00
|
|
|
build osmocom-$FEED
|
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-03-01 19:53:09 +00:00
|
|
|
build osmo-smlc
|
2021-01-24 15:18:46 +00:00
|
|
|
build osmo-cbc
|
2021-03-01 09:37:02 +00:00
|
|
|
build osmo-gbproxy
|
2018-10-04 17:25:35 +00:00
|
|
|
|
|
|
|
cd "$TOP/$PROJ"
|
2021-04-27 12:44:56 +00:00
|
|
|
osc ci -m "$FEED versions of $DT" --noservice
|
2018-10-04 17:25:35 +00:00
|
|
|
}
|
|
|
|
|
2021-05-17 09:31:26 +00:00
|
|
|
osmo_obs_verify_feed
|
2018-10-04 17:25:35 +00:00
|
|
|
build_osmocom
|