mirror of
https://github.com/roddhjav/apparmor.d.git
synced 2024-11-14 23:43:56 +01:00
ci: add rpm pkg build.
This commit is contained in:
parent
7f87b69bf7
commit
55d46631da
@ -101,6 +101,18 @@ ubuntu:
|
||||
variables:
|
||||
DISTRIBUTION: ubuntu
|
||||
|
||||
opensuse:
|
||||
stage: build
|
||||
image: registry.gitlab.com/roddhjav/builders/opensuse
|
||||
script:
|
||||
- mkdir -p "$PKGDEST"
|
||||
- sudo zypper install -y distribution-release golang-packaging rsync
|
||||
- bash dists/build.sh rpm
|
||||
artifacts:
|
||||
expire_in: 1 day
|
||||
paths:
|
||||
- $PKGDEST/*.rpm
|
||||
|
||||
|
||||
# Profile Preprocessing
|
||||
# ---------------------
|
||||
@ -140,10 +152,11 @@ preprocess-ubuntu:
|
||||
preprocess-opensuse:
|
||||
stage: preprocess
|
||||
image: opensuse/tumbleweed
|
||||
dependencies:
|
||||
- opensuse
|
||||
script:
|
||||
- zypper install -y apparmor-profiles go git rsync util-linux findutils make
|
||||
- make
|
||||
- make install
|
||||
- zypper install -y apparmor-profiles
|
||||
- rpm -i $PKGDEST/*
|
||||
- apparmor_parser --preprocess /etc/apparmor.d 1> /dev/null
|
||||
|
||||
|
||||
|
@ -8,6 +8,7 @@
|
||||
set -eu -o pipefail
|
||||
|
||||
readonly COMMAND="$1"
|
||||
readonly OUTPUT="${PKGDEST:-$PWD}"
|
||||
readonly PKGNAME=apparmor.d
|
||||
VERSION="0.$(git rev-list --count HEAD)"
|
||||
readonly VERSION
|
||||
@ -21,14 +22,13 @@ main() {
|
||||
dpkg)
|
||||
dch --newversion="$VERSION-1" --urgency=medium --distribution=stable --controlmaint "Release $VERSION-1"
|
||||
dpkg-buildpackage -b -d --no-sign
|
||||
mv ../"${PKGNAME}_${VERSION}-1"_*.deb .
|
||||
mv ../"${PKGNAME}_${VERSION}-1"_*.deb "$OUTPUT"
|
||||
;;
|
||||
|
||||
rpm)
|
||||
RPMBUILD_ROOT=$(mktemp -d)
|
||||
OUTPUT_DIR=$(pwd)
|
||||
ARCH=$(uname -m)
|
||||
readonly RPMBUILD_ROOT ARCH OUTPUT_DIR
|
||||
readonly RPMBUILD_ROOT ARCH
|
||||
|
||||
mkdir -p "$RPMBUILD_ROOT"/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS/tmp}
|
||||
cp -p "dists/$PKGNAME.spec" "$RPMBUILD_ROOT/SPECS"
|
||||
@ -38,7 +38,7 @@ main() {
|
||||
sed -i "s/^Version:.*/Version: $VERSION/" "SPECS/$PKGNAME.spec"
|
||||
rpmbuild -bb --define "_topdir $RPMBUILD_ROOT" "SPECS/$PKGNAME.spec"
|
||||
|
||||
cp "$RPMBUILD_ROOT/RPMS/$ARCH/"*.rpm "$OUTPUT_DIR"
|
||||
cp "$RPMBUILD_ROOT/RPMS/$ARCH/"*.rpm "$OUTPUT"
|
||||
rm -rf "$RPMBUILD_ROOT"
|
||||
;;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user