core-agent-linux/archlinux/PKGBUILD

95 lines
2.9 KiB
Bash
Raw Normal View History

2013-04-12 16:43:46 +02:00
# This is an example PKGBUILD file. Use this as a start to creating your own,
# and remove these comments. For more information, see 'man PKGBUILD'.
# NOTE: Please fill out the license field for your package! If it is unknown,
# then please put 'unknown'.
# Maintainer: Olivier Medoc <o_medoc@yahoo.fr>
pkgname=qubes-vm-core
pkgver=`cat version`
pkgrel=18
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=()
depends=(qubes-libvchan qubes-vm-utils imagemagick ntp zenity notification-daemon haveged)
2013-04-12 16:43:46 +02:00
makedepends=(qubes-vm-utils)
checkdepends=()
optdepends=()
provides=()
conflicts=()
replaces=()
backup=()
options=()
install=PKGBUILD.install
changelog=
source=(PKGBUILD.qubes-ensure-lib-modules.service)
2013-04-12 16:43:46 +02:00
noextract=()
md5sums=('88f4b3d5b156888a9d38f5bc28702ab8') #generate with 'makepkg -g'
2013-04-12 16:43:46 +02:00
build() {
2013-04-17 01:44:28 +02:00
for source in qubes-rpc qrexec misc Makefile vm-init.d vm-systemd network ; do
2013-04-12 16:43:46 +02:00
(ln -s $srcdir/../$source $srcdir/$source)
done
# Fix for building with python2
export PYTHON=python2
sed 's:python:python2:g' -i misc/Makefile
# 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/*
# Fix for archlinux sbindir
sed 's:/usr/sbin/ntpdate:/usr/bin/ntpdate:g' -i qubes-rpc/sync-ntp-clock
sed 's:/usr/sbin/qubes-netwatcher:/usr/bin/qubes-netwatcher:g' -i vm-systemd/qubes-netwatcher.service
sed 's:/usr/sbin/qubes-firewall:/usr/bin/qubes-firewall:g' -i vm-systemd/qubes-firewall.service
2013-04-12 16:43:46 +02:00
for dir in qubes-rpc qrexec misc; do
(cd $dir; make)
done
}
package() {
# Note: Archlinux removed use of directory such as /sbin /bin /usr/sbin (https://mailman.archlinux.org/pipermail/arch-dev-public/2012-March/022625.html)
(cd qrexec; make install DESTDIR=$pkgdir SBINDIR=/usr/bin)
2013-04-12 16:43:46 +02:00
make install-vm DESTDIR=$pkgdir SBINDIR=/usr/bin DIST=archlinux
2013-04-12 16:43:46 +02:00
# Change the place for iptable rules to match archlinux standard
mkdir -p $pkgdir/etc/iptables
mv $pkgdir/usr/lib/qubes/init/iptables $pkgdir/etc/iptables/iptables.rules
mv $pkgdir/usr/lib/qubes/init/ip6tables $pkgdir/etc/iptables/ip6tables.rules
2013-04-12 16:43:46 +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
# Install systemd script allowing to automount /lib/modules
install -m 644 $srcdir/PKGBUILD.qubes-ensure-lib-modules.service $pkgdir/lib/systemd/system/qubes-ensure-lib-modules.service
# 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
[Service]
ExecStart=
ExecStart=-/usr/bin/agetty --autologin user --noclear %I 38400 linux
EOF
2013-04-12 16:43:46 +02:00
}
# vim:set ts=2 sw=2 et: