-
Notifications
You must be signed in to change notification settings - Fork 909
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pkg: RPM - add mock config for EL8/EL9 based on alma+epel-(8|9)-x86_64
This mock config can be used to build RPM packages from a kamailio src.rpm. - update pkg/kamailio/obs/README -> README.md to include mock instructions - add script create-src-rpm.sh to create src.rpm for package building Cherry-pick from 9de780b
- Loading branch information
1 parent
04ef597
commit 42f2035
Showing
6 changed files
with
111 additions
and
18 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# RPM Specs | ||
|
||
## For OpenSuse Build Service (OBS) | ||
|
||
Here are the RPM packaging specs for openSUSE Build Service: | ||
|
||
* https://build.opensuse.org/ | ||
|
||
It builds RPM packages for following distributions: | ||
|
||
* CentOS 6 and 7 | ||
* RHEL 6 and 7 | ||
* Fedora 25 and 26 | ||
* openSUSE 42.2 and 42.3 | ||
|
||
Kamailio's RPMs bulding projects for various versions can be found at: | ||
|
||
* https://build.opensuse.org/project/subprojects/home:kamailio | ||
|
||
## For local build using mock | ||
|
||
# prepare source tarball from repo | ||
cd kamailio/ | ||
mkdir -p ../rpmbuild/SOURCES ../rpmbuild/SPECS | ||
./pkg/kamailio/scripts/git-archive-all.sh kamailio-5.8.0 ../rpmbuild/SOURCES/kamailio-5.8.0_src | ||
# prepare src.rpm with version/release: replace MYVER/MYREL below | ||
cp pkg/kamailio/obs/kamailio.spec ../rpmbuild/SPECS/ | ||
sed -i -e s'/^%define ver.*/%define ver MYVER/' -e s'/^%define rel.*/%define rel MYREL/' ../rpmbuild/SPECS/kamailio.spec | ||
rpmbuild -bs --define "_topdir $PWD/../rpmbuild" ../rpmbuild/SPECS/kamailio.spec | ||
|
||
# build for EL8/9 | ||
mock -r pkg/kamailio/obs/kamailio-8-x86_64.cfg ../rpmbuild/SRPMS/*src.rpm | ||
mock -r pkg/kamailio/obs/kamailio-9-x86_64.cfg ../rpmbuild/SRPMS/*src.rpm | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
include('almalinux-8-x86_64.cfg') | ||
include('templates/epel-8.tpl') | ||
|
||
config_opts['root'] = "kamailio-8-{{ target_arch }}" | ||
config_opts['description'] = 'Kamailio- AlmaLinux 8 + EPEL' | ||
|
||
config_opts['dnf.conf'] += """ | ||
# you must copy the kamailio RPM signing key to the host as | ||
# /etc/pki/mock/kamailio-rpm-pub.key | ||
# curl https://rpm.kamailio.org/rpm-pub.key | sudo tee /etc/pki/mock/kamailio-rpm-pub.key | ||
[kamailio] | ||
name=Support packages for kamailio | ||
baseurl=http://rpm.kamailio.org/centos/$releasever/master/master/$basearch/ | ||
gpgkey=file:///etc/pki/mock/kamailio-rpm-pub.key | ||
""" | ||
|
||
# since EL9 the chroots don't include C/C++ development tools | ||
config_opts['chroot_additional_packages'] = "gcc gcc-c++ make GeoIP-devel autoconf automake libtool" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
include('almalinux-9-x86_64.cfg') | ||
include('templates/epel-9.tpl') | ||
|
||
config_opts['root'] = "kamailio-9-{{ target_arch }}" | ||
config_opts['description'] = 'Kamailio- AlmaLinux 9 + EPEL' | ||
|
||
config_opts['dnf.conf'] += """ | ||
# you must copy the kamailio RPM signing key to the host as | ||
# /etc/pki/mock/kamailio-rpm-pub.key | ||
# curl https://rpm.kamailio.org/rpm-pub.key | sudo tee /etc/pki/mock/kamailio-rpm-pub.key | ||
[kamailio] | ||
name=Support packages for kamailio | ||
baseurl=http://rpm.kamailio.org/centos/$releasever/master/master/$basearch/ | ||
gpgkey=file:///etc/pki/mock/kamailio-rpm-pub.key | ||
""" | ||
|
||
# since EL9 the chroots don't include C/C++ development tools | ||
config_opts['chroot_additional_packages'] = "gcc gcc-c++ make GeoIP-devel autoconf automake libtool" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/bin/bash | ||
# | ||
|
||
usage() { | ||
echo Usage: create-src-rpm.sh '<version>' '<release>' | ||
} | ||
|
||
# creates a src.rpm for mock | ||
VER=$1 | ||
REL=$2 | ||
[[ -n $VER ]] || { echo "Version not specified"; usage; exit 1; } | ||
[[ -n $REL ]] || { echo "Release not specified"; usage; exit 2; } | ||
|
||
git submodule update --init | ||
|
||
TMP=$(date +"%s") | ||
RPMBUILD=rpmbuild.${TMP} | ||
|
||
rm -rf $RPMBUILD/* | ||
mkdir -p $RPMBUILD/{SRPMS,SPECS,SOURCES} | ||
./pkg/kamailio/scripts/git-archive-all.sh kamailio-${VER} $RPMBUILD/SOURCES/kamailio-${VER}_src | ||
|
||
# prepare src.rpm with version/release | ||
cp pkg/kamailio/obs/kamailio.spec $RPMBUILD/SPECS/ | ||
sed -i -e s"/^%define ver.*/%define ver ${VER}/" -e s"/^%define rel.*/%define rel ${REL}/" ${RPMBUILD}/SPECS/kamailio.spec | ||
|
||
rm -f ${RPMBUILD}/SRPMS/*.src.rpm | ||
rpmbuild -bs --define "_topdir $PWD/$RPMBUILD" $RPMBUILD/SPECS/kamailio.spec | ||
|
||
echo "src.rpm is created in $RPMBUILD/SRPMS" | ||
echo "To build:" | ||
echo Run: mock -r pkg/kamailio/obs/kamailio-8-x86_64.cfg $RPMBUILD/SRPMS/*src.rpm | ||
echo Run: mock -r pkg/kamailio/obs/kamailio-9-x86_64.cfg $RPMBUILD/SRPMS/*src.rpm | ||
|
||
|
||
exit 0 | ||
|
3 changes: 1 addition & 2 deletions
3
pkg/scripts/git-archive-all.sh → pkg/kamailio/scripts/git-archive-all.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters