forked from archlinuxhardened/selinux
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·73 lines (64 loc) · 2.06 KB
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/bin/sh
# Build in a per-user temporary folder by default, if there is no directory
# specified in /etc/makepkg.conf.
# This directory can be specifically mounted with "exec" option on systems
# where /tmp is mounted "noexec".
# Find the configured BUILDDIR
if [ -z "$BUILDDIR" ] ; then
BUILDDIR="$(bash -c 'shopt -u extglob ; source /etc/makepkg.conf ; echo $BUILDDIR')"
if [ -z "$BUILDDIR" ] ; then
BUILDDIR="/tmp/makepkg-$(id -nu)"
fi
fi
export BUILDDIR
# Build a package
pkgbuild() {
# Uncomment the following line to skip already-installed packages
#if pacman -Qq "$1" > /dev/null 2>&1 ; then return; fi
# Clean up the package folder
rm -rf "./$1/src" "./$1/pkg"
rm -f "./$1/"*.pkg.tar.xz "./$1/"*.pkg.tar.xz.sig
rm -f "./$1/"*.pkg.tar.zst "./$1/"*.pkg.tar.zst.sig
# makepkg options:
# -s (--syncdeps): Install missing dependencies
# -C (--cleanbuild): Remove $srcdir before building the package
(cd "./$1" && makepkg -s -C) || exit $?
# Uncomment the following line to install or update the non-debug packages
#sudo pacman -U $(ls "./$1/"*.pkg.tar.zst | grep -vE '[-]debug') || exit $?
}
# Build SELinux userspace packages
pkgbuild libsepol
pkgbuild libselinux
pkgbuild checkpolicy
pkgbuild secilc
pkgbuild setools
pkgbuild libsemanage
pkgbuild sepolgen
pkgbuild semodule-utils
pkgbuild restorecond
pkgbuild mcstrans
pkgbuild policycoreutils
pkgbuild selinux-python
pkgbuild selinux-gui
pkgbuild selinux-dbus-config
pkgbuild selinux-sandbox
# Build core packages with SELinux support
pkgbuild pambase-selinux
pkgbuild pam-selinux
pkgbuild coreutils-selinux
pkgbuild findutils-selinux
pkgbuild iproute2-selinux
pkgbuild logrotate-selinux
pkgbuild openssh-selinux
pkgbuild psmisc-selinux
pkgbuild shadow-selinux
pkgbuild sudo-selinux
pkgbuild util-linux-selinux
pkgbuild systemd-selinux
pkgbuild dbus-selinux
pkgbuild cronie-selinux
# Build refpolicy source package and Arch Linux policy and pacman hook
pkgbuild selinux-refpolicy-src
pkgbuild selinux-refpolicy-arch
pkgbuild selinux-refpolicy-git
pkgbuild selinux-alpm-hook