Initial commit

This commit is contained in:
2026-04-07 16:21:37 +03:00
commit 707786ea90
4 changed files with 98 additions and 0 deletions
+3
View File
@@ -0,0 +1,3 @@
# Ignore BPM archives and signatures
*.bpm
*.bpm.sig
+15
View File
@@ -0,0 +1,15 @@
#!/bin/bash
# Gitlab repository
REPO="apparmor/apparmor"
# Replace slash with URL encoded representation
REPO=$(echo "$REPO" | sed 's|/|%2F|g')
# Get tag name using Gitlab Rest API
TAG_NAME=$(curl -s -L https://gitlab.com/api/v4/projects/"$REPO"/releases | jq -r '.[].tag_name' | grep -v 'rc' | head -n1)
# Trim 'v' character in TAG_NAME variable
VERSION=$(echo "$TAG_NAME" | tr -d 'v')
echo "$VERSION"
+31
View File
@@ -0,0 +1,31 @@
name: apparmor
description: |-
Mandatory Access Control (MAC) mechanism which uses the
Linux Security Module (LSM) framework
version: 4.1.7
revision: 1
url: https://gitlab.com/apparmor/apparmor
license: GPL2-only
maintainers:
- [email protected]
architecture: any
type: source
depends:
- bash
- glibc
- pam
- python3
optional_depends:
- perl:For perl bindings
- ruby:For ruby bindings
make_depends:
- autoconf-archive
- libxcrypt
- python-setuptools
- ruby
- swig
downloads:
- url: https://gitlab.com/apparmor/apparmor/-/archive/v${BPM_PKG_VERSION}/apparmor-v${BPM_PKG_VERSION}.tar.gz
extract_to: ${BPM_SOURCE}
extract_strip_components: 1
checksum: ded4cd419b8a05002a108a0912208e2098695752664c6a59464d2dda418e0452
+49
View File
@@ -0,0 +1,49 @@
# This is the source.sh script. It is executed by BPM in a temporary directory when compiling a source package
# BPM Expects the source code to be extracted into the automatically created 'source' directory which can be accessed using $BPM_SOURCE
# BPM Expects the output files to be present in the automatically created 'output' directory which can be accessed using $BPM_OUTPUT
# The prepare function is executed in the root of the temp directory
# This function is used for putting downloaded files to the correct location or applying patches
prepare() {
cd "$BPM_SOURCE"/libraries/libapparmor
autoreconf -fi
}
# The build function is executed in the source directory
# This function is used to compile the source code
build() {
cd "$BPM_SOURCE"/libraries/libapparmor
./configure --prefix=/usr --with-perl --with-python --with-ruby
make
cd "$BPM_SOURCE"
make -C binutils
make -C parser
make -C profiles
make -C utils
}
# The package function is executed in the source directory
# This function is used to move the compiled files into the output directory
package() {
make -C libraries/libapparmor DESTDIR="$BPM_OUTPUT" install
make -C binutils DESTDIR="$BPM_OUTPUT" install
make -C parser DESTDIR="$BPM_OUTPUT" SBINDIR="$BPM_OUTPUT"/usr/sbin APPARMOR_BIN_PREFIX="$BPM_OUTPUT"/usr/lib/apparmor install
make -C profiles DESTDIR="$BPM_OUTPUT" install
make -C utils DESTDIR="$BPM_OUTPUT" install
# Set file mode to allow the perl library to be stripped:
# https://gitlab.com/apparmor/apparmor/issues/34
find "$BPM_OUTPUT"/usr/lib/perl/ -type f -iname "*.so" -exec chmod 755 {} \;
# Remove empty core_perl directory:
# https://gitlab.com/apparmor/apparmor/issues/40
rm -r "$BPM_OUTPUT"/usr/lib/perl/*/core_perl
# Move ruby bindings to vendor_ruby:
# https://gitlab.com/apparmor/apparmor/issues/35
mv "$BPM_OUTPUT"/usr/lib/ruby/{site,vendor}_ruby
# Install package license
install -Dm644 "$BPM_SOURCE"/LICENSE "$BPM_OUTPUT"/usr/share/licenses/apparmor/LICENSE
}