2017-10-01 20:48:13 +02:00
#!/bin/bash
2013-04-12 16:43:46 +02:00
# Maintainer: Olivier Medoc <o_medoc@yahoo.fr>
2017-10-01 20:48:13 +02:00
# shellcheck disable=SC2034
2013-04-12 16:43:46 +02:00
pkgname = qubes-vm-core
2017-10-01 20:48:13 +02:00
pkgver = $( cat version)
2017-01-29 15:37:15 +01:00
pkgrel = 11
2013-04-12 16:43:46 +02:00
epoch =
pkgdesc = "The Qubes core files for installation inside a Qubes VM."
arch = ( "x86_64" )
url = "http://qubes-os.org/"
license = ( 'GPL' )
groups = ( )
2017-05-20 15:53:03 +02:00
depends = ( "qubes-vm-utils>=3.1.3" python2 python3 python2-xdg ethtool ntp net-tools gnome-packagekit imagemagick fakeroot notification-daemon dconf zenity qubes-libvchan "qubes-db-vm>=3.2.1" haveged python2-gobject python2-dbus xdg-utils notification-daemon gawk sed procps-ng librsvg)
2017-01-28 21:20:20 +01:00
makedepends = ( gcc make pkg-config "qubes-vm-utils>=3.1.3" qubes-libvchan qubes-db-vm qubes-vm-xen libx11 python2 python3 lsb-release)
2013-04-12 16:43:46 +02:00
checkdepends = ( )
2015-07-08 15:00:50 +02:00
optdepends = ( gnome-keyring gnome-settings-daemon networkmanager iptables tinyproxy python2-nautilus gpk-update-viewer)
2013-04-12 16:43:46 +02:00
provides = ( )
conflicts = ( )
replaces = ( )
backup = ( )
options = ( )
install = PKGBUILD.install
changelog =
2017-10-01 20:48:13 +02:00
source = (
PKGBUILD.qubes-ensure-lib-modules.service PKGBUILD.qubes-update-desktop-icons.hook
PKGBUILD-qubes-noupgrade.conf
PKGBUILD-qubes-repo-3.1.conf
PKGBUILD-qubes-repo-3.2.conf
)
2013-04-12 16:43:46 +02:00
noextract = ( )
2017-01-29 15:37:15 +01:00
md5sums = ( SKIP)
2013-04-12 16:43:46 +02:00
build( ) {
2017-10-01 20:48:13 +02:00
for source in autostart-dropins qubes-rpc qrexec misc Makefile vm-init.d vm-systemd network init version; do
# shellcheck disable=SC2154
( ln -s " $srcdir /../ $source " " $srcdir / $source " )
done
# Fix for network tools paths
sed 's:/sbin/ifconfig:ifconfig:g' -i network/*
sed 's:/sbin/route:route:g' -i network/*
sed 's:/sbin/ethtool:ethtool:g' -i network/*
sed 's:/sbin/ip:ip:g' -i network/*
sed 's:/bin/grep:grep:g' -i network/*
# Force running all scripts with python2
sed 's:#!/usr/bin/python:#!/usr/bin/python2:' -i misc/*
sed 's:#!/usr/bin/env python:#!/usr/bin/env python2:' -i misc/*
sed 's:#!/usr/bin/python:#!/usr/bin/python2:' -i qubes-rpc/*
sed 's:#!/usr/bin/env python:#!/usr/bin/env python2:' -i qubes-rpc/*
# Fix for archlinux sbindir
sed 's:/usr/sbin/ntpdate:/usr/bin/ntpdate:g' -i qubes-rpc/sync-ntp-clock
sed 's:/usr/sbin/qubes-firewall:/usr/bin/qubes-firewall:g' -i vm-systemd/qubes-firewall.service
for dir in qubes-rpc qrexec misc; do
2017-10-02 13:49:40 +02:00
make -C " $dir "
2017-10-01 20:48:13 +02:00
done
2013-04-12 16:43:46 +02:00
}
package( ) {
2017-10-01 20:48:13 +02:00
# Note: Archlinux removed use of directory such as /sbin /bin /usr/sbin (https://mailman.archlinux.org/pipermail/arch-dev-public/2012-March/022625.html)
# shellcheck disable=SC2154
2017-10-02 13:49:40 +02:00
make -C qrexec install DESTDIR = " $pkgdir " SBINDIR = /usr/bin LIBDIR = /usr/lib SYSLIBDIR = /usr/lib
2015-10-15 04:34:55 +02:00
2017-10-01 20:48:13 +02:00
make install-vm DESTDIR = " $pkgdir " SBINDIR = /usr/bin LIBDIR = /usr/lib SYSLIBDIR = /usr/lib SYSTEM_DROPIN_DIR = /usr/lib/systemd/system USER_DROPIN_DIR = /usr/lib/systemd/user DIST = archlinux
2013-04-12 16:43:46 +02:00
2017-10-01 20:48:13 +02:00
# Remove things non wanted in archlinux
rm -r " $pkgdir /etc/yum " *
rm -r " $pkgdir /etc/init.d "
# Remove fedora specific scripts
rm " $pkgdir /etc/fstab "
2013-04-26 09:31:20 +02:00
2017-10-01 20:48:13 +02:00
# Install systemd script allowing to automount /lib/modules
install -m 644 " $srcdir /PKGBUILD.qubes-ensure-lib-modules.service " " ${ pkgdir } /usr/lib/systemd/system/qubes-ensure-lib-modules.service "
2013-04-12 16:43:46 +02:00
2017-10-01 20:48:13 +02:00
# Install pacman hook to update desktop icons
mkdir -p " ${ pkgdir } /usr/share/libalpm/hooks/ "
install -m 644 " $srcdir /PKGBUILD.qubes-update-desktop-icons.hook " " ${ pkgdir } /usr/share/libalpm/hooks/qubes-update-desktop-icons.hook "
2014-02-03 20:53:03 +01:00
2017-10-01 20:48:13 +02:00
# Install pacman.d drop-ins (at least 1 drop-in must be installed or pacman will fail)
mkdir -p " ${ pkgdir } /etc/pacman.d "
install -m 644 " $srcdir /PKGBUILD-qubes-noupgrade.conf " " ${ pkgdir } /etc/pacman.d/10-qubes-noupgrade.conf "
2016-07-11 15:29:31 +02:00
2017-10-01 20:48:13 +02:00
# Install pacman repository
release = $( echo " $pkgver " | cut -d '.' -f 1,2)
echo " Installing repository for release ${ release } "
install -m 644 " $srcdir /PKGBUILD-qubes-repo- ${ release } .conf " " ${ pkgdir } /etc/pacman.d/99-qubes-repository- ${ release } .conf.disabled "
2016-07-11 17:21:55 +02:00
2017-10-01 20:48:13 +02:00
# Archlinux specific: enable autologin on tty1
mkdir -p " $pkgdir /etc/systemd/system/getty@tty1.service.d/ "
cat <<EOF > " $pkgdir /etc/systemd/system/getty@tty1.service.d/autologin.conf "
2014-02-16 17:29:40 +01:00
[ Service]
ExecStart =
ExecStart = -/usr/bin/agetty --autologin user --noclear %I 38400 linux
EOF
2017-10-01 20:48:13 +02:00
# Archlinux packaging guidelines: /var/run is a symlink to a tmpfs. Don't create it
rm -r " $pkgdir /var/run "
2013-04-12 16:43:46 +02:00
}
# vim:set ts=2 sw=2 et: