| 1 |
# Maintainer: Massimiliano Torromeo <[email protected]> |
| 2 |
# Contributor: Iwan Timmer <[email protected]> |
| 3 |
# Contributor: Mark Constable <[email protected]> |
| 4 |
# Contributor: Anatol Pomozov <[email protected]> |
| 5 |
|
| 6 |
pkgbase=cockpit |
| 7 |
pkgname=(cockpit cockpit-packagekit cockpit-storaged) |
| 8 |
pkgver=368 |
| 9 |
pkgrel=1 |
| 10 |
pkgdesc='A systemd web based user interface for Linux servers' |
| 11 |
arch=('x86_64') |
| 12 |
url='https://cockpit-project.org/' |
| 13 |
license=(LGPL) |
| 14 |
makedepends=(krb5 json-glib glib-networking glib2-devel |
| 15 |
git intltool gtk-doc gobject-introspection networkmanager npm |
| 16 |
asciidoctor python-build python-installer python-wheel) |
| 17 |
source=("cockpit-${pkgver}.tar.xz" |
| 18 |
"cockpit.pam") |
| 19 |
sha256sums=('SKIP' |
| 20 |
'079bb6751214e642673f9e1212df2a17fed1a3cc6cfdd6375af2b68ed6ddd340') |
| 21 |
|
| 22 |
prepare() { |
| 23 |
cd cockpit-$pkgver |
| 24 |
# TODO: disable buggy package-lock check |
| 25 |
sed -r '/^cmd_make_package_lock_json\b/ a exit 0' -i tools/node-modules |
| 26 |
} |
| 27 |
|
| 28 |
build() { |
| 29 |
cd cockpit-$pkgver |
| 30 |
./configure \ |
| 31 |
--prefix=/usr \ |
| 32 |
--sbindir=/usr/bin \ |
| 33 |
--libexecdir=/usr/lib/$pkgname/ \ |
| 34 |
--sysconfdir=/etc \ |
| 35 |
--localstatedir=/var \ |
| 36 |
--disable-dependency-tracking \ |
| 37 |
--disable-silent-rules \ |
| 38 |
--with-admin-group=wheel \ |
| 39 |
make all |
| 40 |
} |
| 41 |
|
| 42 |
package_cockpit() { |
| 43 |
depends=(krb5 json-glib python) |
| 44 |
provides=(cockpit-pcp) |
| 45 |
replaces=(cockpit-pcp) |
| 46 |
backup=('etc/pam.d/cockpit' 'etc/cockpit/disallowed-users') |
| 47 |
optdepends=("pcp: reading performance metrics" |
| 48 |
"cockpit-storaged: manage storage" |
| 49 |
"cockpit-packagekit: manage packaged" |
| 50 |
"cockpit-podman: user interface for managing podman containers" |
| 51 |
"cockpit-machines: user interface for managing virtual machines" |
| 52 |
"polkit: elevate privileges" |
| 53 |
"sudo: elevate privileges" |
| 54 |
"networkmanager: manage network connections" |
| 55 |
"sssd: authentication" |
| 56 |
"sscg: generate self-signed certificate") |
| 57 |
|
| 58 |
cd cockpit-$pkgver |
| 59 |
make DESTDIR="$pkgdir" install |
| 60 |
rm -rf "$pkgdir"/usr/{src,lib/firewalld} |
| 61 |
install -Dm644 "$srcdir"/cockpit.pam "$pkgdir"/etc/pam.d/cockpit |
| 62 |
|
| 63 |
# remove unused plugins |
| 64 |
rm -rf "$pkgdir"/usr/share/cockpit/{selinux,playground,sosreport} \ |
| 65 |
"$pkgdir"/usr/share/metainfo/org.cockpit_project.cockpit_{selinux,sosreport}.metainfo.xml |
| 66 |
|
| 67 |
# remove plugins packaged separately |
| 68 |
rm -rf "$pkgdir"/usr/share/cockpit/{apps,packagekit,pcp,storaged} \ |
| 69 |
"$pkgdir"/usr/share/metainfo/org.cockpit_project.cockpit_storaged.metainfo.xml \ |
| 70 |
"$pkgdir"/usr/lib/cockpit/cockpit-pcp \ |
| 71 |
"$pkgdir"/var/lib/pcp |
| 72 |
|
| 73 |
# Arch lacks the necessary kdump packages and grub infra |
| 74 |
rm -rf "$pkgdir"/usr/share/cockpit/kdump \ |
| 75 |
"$pkgdir"/usr/share/metainfo/org.cockpit_project.cockpit_kdump.metainfo.xml |
| 76 |
|
| 77 |
# Disallow root login by default |
| 78 |
printf "# List of users which are not allowed to login to Cockpit\nroot\n" > "$pkgdir"/etc/cockpit/disallowed-users |
| 79 |
chmod 644 "$pkgdir"/etc/cockpit/disallowed-users |
| 80 |
} |
| 81 |
|
| 82 |
_do_package_component() { |
| 83 |
_component="${1:-${pkgname#cockpit-}}" |
| 84 |
|
| 85 |
cd "$srcdir"/cockpit-$pkgver |
| 86 |
make DESTDIR="$pkgdir"/tmp install |
| 87 |
|
| 88 |
cd "$pkgdir"/tmp |
| 89 |
bsdtar -cf - usr/share/cockpit/$_component \ |
| 90 |
| bsdtar -xf - -C "$pkgdir" |
| 91 |
|
| 92 |
metainfo="usr/share/metainfo/org.cockpit_project.cockpit_${_component}.metainfo.xml" |
| 93 |
|
| 94 |
[ -f "$metainfo" ] && \ |
| 95 |
install -Dm644 "$metainfo" "$pkgdir/$metainfo" |
| 96 |
|
| 97 |
rm -rf "$pkgdir"/tmp |
| 98 |
} |
| 99 |
|
| 100 |
package_cockpit-storaged() { |
| 101 |
pkgdesc='Cockpit user interface for storage, using udisks' |
| 102 |
depends=(cockpit udisks2 dbus-python) |
| 103 |
optdepends=( |
| 104 |
"clevis: manage disk encryption" |
| 105 |
) |
| 106 |
_do_package_component |
| 107 |
} |
| 108 |
|
| 109 |
package_cockpit-packagekit() { |
| 110 |
pkgdesc='Cockpit user interface for packages' |
| 111 |
depends=(cockpit polkit packagekit python) |
| 112 |
_do_package_component |
| 113 |
_do_package_component apps |
| 114 |
} |