2010-04-05 20:58:57 +02:00
|
|
|
#
|
|
|
|
# The Qubes OS Project, http://www.qubes-os.org
|
|
|
|
#
|
|
|
|
# Copyright (C) 2010 Joanna Rutkowska <joanna@invisiblethingslab.com>
|
|
|
|
# Copyright (C) 2010 Rafal Wojtczuk <rafal@invisiblethingslab.com>
|
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or
|
|
|
|
# modify it under the terms of the GNU General Public License
|
|
|
|
# as published by the Free Software Foundation; either version 2
|
|
|
|
# of the License, or (at your option) any later version.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program; if not, write to the Free Software
|
|
|
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
#
|
|
|
|
#
|
|
|
|
|
|
|
|
%{!?version: %define version %(cat version_vm)}
|
|
|
|
|
|
|
|
Name: qubes-core-appvm
|
|
|
|
Version: %{version}
|
2011-03-16 19:14:42 +01:00
|
|
|
Release: 1%{dist}
|
2010-04-05 20:58:57 +02:00
|
|
|
Summary: The Qubes core files for AppVM
|
|
|
|
|
|
|
|
Group: Qubes
|
|
|
|
Vendor: Invisible Things Lab
|
|
|
|
License: GPL
|
|
|
|
URL: http://www.qubes-os.org
|
|
|
|
Requires: /usr/bin/xenstore-read
|
2011-03-15 23:05:48 +01:00
|
|
|
Requires: fedora-release
|
2010-06-29 12:45:09 +02:00
|
|
|
Requires: /usr/bin/mimeopen
|
2011-03-11 01:38:04 +01:00
|
|
|
Requires: qubes-core-commonvm
|
2011-03-02 11:55:54 +01:00
|
|
|
BuildRequires: gcc
|
|
|
|
BuildRequires: xen-devel
|
2010-04-05 20:58:57 +02:00
|
|
|
Provides: qubes-core-vm
|
|
|
|
|
|
|
|
%define _builddir %(pwd)/appvm
|
|
|
|
|
|
|
|
%define kde_service_dir /usr/share/kde4/services/ServiceMenus
|
|
|
|
|
|
|
|
%description
|
|
|
|
The Qubes core files for installation inside a Qubes AppVM.
|
|
|
|
|
|
|
|
%pre
|
|
|
|
|
2010-09-15 15:33:09 +02:00
|
|
|
if [ "$1" != 1 ] ; then
|
|
|
|
# do this whole %pre thing only when updating for the first time...
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
adduser --create-home user
|
|
|
|
|
2010-04-05 20:58:57 +02:00
|
|
|
mkdir -p $RPM_BUILD_ROOT/var/lib/qubes
|
|
|
|
|
|
|
|
%build
|
|
|
|
make clean all
|
2010-09-03 16:23:09 +02:00
|
|
|
make -C ../common
|
2011-03-04 16:32:58 +01:00
|
|
|
make -C ../qrexec
|
2011-03-08 12:24:47 +01:00
|
|
|
make -C ../vchan
|
|
|
|
make -C ../u2mfn
|
2010-04-05 20:58:57 +02:00
|
|
|
|
|
|
|
%install
|
|
|
|
|
|
|
|
mkdir -p $RPM_BUILD_ROOT/etc/init.d
|
2011-03-11 01:38:04 +01:00
|
|
|
cp qubes_core_appvm $RPM_BUILD_ROOT/etc/init.d/
|
2010-04-05 20:58:57 +02:00
|
|
|
mkdir -p $RPM_BUILD_ROOT/var/lib/qubes
|
|
|
|
mkdir -p $RPM_BUILD_ROOT/usr/bin
|
2011-03-14 11:25:18 +01:00
|
|
|
cp qubes_timestamp qvm-copy-to-vm qvm-open-in-dvm qvm-open-in-dvm2 $RPM_BUILD_ROOT/usr/bin
|
2011-03-16 16:47:32 +01:00
|
|
|
cp qvm-copy-to-vm2 $RPM_BUILD_ROOT/usr/bin
|
2010-07-16 10:26:55 +02:00
|
|
|
mkdir -p $RPM_BUILD_ROOT/usr/lib/qubes
|
|
|
|
cp qubes_add_pendrive_script qubes_penctl qvm-copy-to-vm.kde $RPM_BUILD_ROOT/usr/lib/qubes
|
2011-03-16 16:47:32 +01:00
|
|
|
cp qvm-copy-to-vm2.kde $RPM_BUILD_ROOT/usr/lib/qubes
|
2011-03-04 16:32:58 +01:00
|
|
|
cp ../qrexec/qrexec_agent $RPM_BUILD_ROOT/usr/lib/qubes
|
2011-03-15 16:43:43 +01:00
|
|
|
cp dvm_file_editor qfile-agent qfile-agent-dvm qfile-unpacker $RPM_BUILD_ROOT/usr/lib/qubes
|
2010-07-16 10:26:55 +02:00
|
|
|
ln -s /usr/bin/qvm-open-in-dvm $RPM_BUILD_ROOT/usr/lib/qubes/qvm-dvm-transfer
|
2010-08-30 11:40:19 +02:00
|
|
|
cp ../common/meminfo-writer $RPM_BUILD_ROOT/usr/lib/qubes
|
2010-04-05 20:58:57 +02:00
|
|
|
mkdir -p $RPM_BUILD_ROOT/%{kde_service_dir}
|
2010-06-29 12:54:27 +02:00
|
|
|
cp qvm-copy.desktop qvm-dvm.desktop $RPM_BUILD_ROOT/%{kde_service_dir}
|
2010-04-05 20:58:57 +02:00
|
|
|
mkdir -p $RPM_BUILD_ROOT/etc/udev/rules.d
|
|
|
|
cp qubes.rules $RPM_BUILD_ROOT/etc/udev/rules.d
|
|
|
|
mkdir -p $RPM_BUILD_ROOT/mnt/incoming
|
|
|
|
mkdir -p $RPM_BUILD_ROOT/mnt/outgoing
|
2010-05-13 15:23:31 +02:00
|
|
|
mkdir -p $RPM_BUILD_ROOT/mnt/removable
|
2010-05-20 15:16:07 +02:00
|
|
|
|
2010-07-14 18:50:48 +02:00
|
|
|
mkdir -p $RPM_BUILD_ROOT/etc/X11
|
|
|
|
cp xorg-preload-apps.conf $RPM_BUILD_ROOT/etc/X11
|
|
|
|
|
2010-06-02 15:50:22 +02:00
|
|
|
mkdir -p $RPM_BUILD_ROOT/home_volatile/user
|
|
|
|
chown 500:500 $RPM_BUILD_ROOT/home_volatile/user
|
|
|
|
|
2011-03-08 12:24:47 +01:00
|
|
|
install -D ../vchan/libvchan.h $RPM_BUILD_ROOT/usr/include/libvchan.h
|
|
|
|
install -D ../u2mfn/u2mfnlib.h $RPM_BUILD_ROOT/usr/include/u2mfnlib.h
|
|
|
|
install -D ../u2mfn/u2mfn-kernel.h $RPM_BUILD_ROOT/usr/include/u2mfn-kernel.h
|
|
|
|
|
|
|
|
install -D ../vchan/libvchan.so $RPM_BUILD_ROOT/%{_libdir}/libvchan.so
|
|
|
|
install -D ../u2mfn/libu2mfn.so $RPM_BUILD_ROOT/%{_libdir}/libu2mfn.so
|
|
|
|
|
2011-03-10 15:41:31 +01:00
|
|
|
mkdir -p $RPM_BUILD_ROOT/var/run/qubes
|
2011-03-08 12:24:47 +01:00
|
|
|
|
2010-05-20 15:16:07 +02:00
|
|
|
%triggerin -- initscripts
|
2010-06-18 01:45:27 +02:00
|
|
|
cp /var/lib/qubes/serial.conf /etc/init/serial.conf
|
2010-05-20 12:54:05 +02:00
|
|
|
|
2010-04-05 20:58:57 +02:00
|
|
|
%post
|
|
|
|
|
2011-03-11 23:42:49 +01:00
|
|
|
chkconfig --add qubes_core_appvm || echo "WARNING: Cannot add service qubes_core!"
|
|
|
|
chkconfig qubes_core_appvm on || echo "WARNING: Cannot enable service qubes_core!"
|
|
|
|
|
2010-06-14 23:52:21 +02:00
|
|
|
if [ "$1" != 1 ] ; then
|
|
|
|
# do this whole %post thing only when updating for the first time...
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2010-05-20 15:16:07 +02:00
|
|
|
usermod -L user
|
|
|
|
|
2010-04-05 20:58:57 +02:00
|
|
|
%preun
|
|
|
|
if [ "$1" = 0 ] ; then
|
|
|
|
# no more packages left
|
2011-03-11 01:38:04 +01:00
|
|
|
chkconfig qubes_core_appvm off
|
2010-04-05 20:58:57 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
%clean
|
|
|
|
rm -rf $RPM_BUILD_ROOT
|
|
|
|
|
|
|
|
%files
|
|
|
|
%defattr(-,root,root,-)
|
2011-03-11 01:38:04 +01:00
|
|
|
/etc/init.d/qubes_core_appvm
|
2010-04-05 20:58:57 +02:00
|
|
|
/usr/bin/qvm-copy-to-vm
|
2011-03-16 16:47:32 +01:00
|
|
|
/usr/bin/qvm-copy-to-vm2
|
2010-07-16 10:26:55 +02:00
|
|
|
/usr/lib/qubes/qvm-copy-to-vm.kde
|
2011-03-16 16:47:32 +01:00
|
|
|
/usr/lib/qubes/qvm-copy-to-vm2.kde
|
2010-06-29 12:16:32 +02:00
|
|
|
%attr(4755,root,root) /usr/bin/qvm-open-in-dvm
|
2011-03-14 11:25:18 +01:00
|
|
|
/usr/bin/qvm-open-in-dvm2
|
2010-07-16 10:26:55 +02:00
|
|
|
/usr/lib/qubes/qvm-dvm-transfer
|
2010-08-30 11:40:19 +02:00
|
|
|
/usr/lib/qubes/meminfo-writer
|
2011-03-10 16:50:40 +01:00
|
|
|
/usr/lib/qubes/dvm_file_editor
|
2010-04-05 20:58:57 +02:00
|
|
|
%{kde_service_dir}/qvm-copy.desktop
|
2010-06-29 12:56:09 +02:00
|
|
|
%{kde_service_dir}/qvm-dvm.desktop
|
2010-07-16 10:26:55 +02:00
|
|
|
%attr(4755,root,root) /usr/lib/qubes/qubes_penctl
|
|
|
|
/usr/lib/qubes/qubes_add_pendrive_script
|
2011-03-04 16:32:58 +01:00
|
|
|
/usr/lib/qubes/qrexec_agent
|
2011-03-15 16:07:00 +01:00
|
|
|
/usr/lib/qubes/qfile-agent
|
2011-03-15 16:19:42 +01:00
|
|
|
/usr/lib/qubes/qfile-agent-dvm
|
2011-03-15 16:43:43 +01:00
|
|
|
/usr/lib/qubes/qfile-unpacker
|
2010-04-05 20:58:57 +02:00
|
|
|
/etc/udev/rules.d/qubes.rules
|
|
|
|
%dir /mnt/incoming
|
|
|
|
%dir /mnt/outgoing
|
2010-05-13 15:23:31 +02:00
|
|
|
%dir /mnt/removable
|
2010-06-02 15:50:22 +02:00
|
|
|
/usr/bin/qubes_timestamp
|
|
|
|
%dir /home_volatile
|
|
|
|
%attr(700,user,user) /home_volatile/user
|
2010-07-14 18:50:48 +02:00
|
|
|
/etc/X11/xorg-preload-apps.conf
|
2011-03-08 12:24:47 +01:00
|
|
|
/usr/include/libvchan.h
|
|
|
|
%{_libdir}/libvchan.so
|
|
|
|
%{_libdir}/libu2mfn.so
|
2011-03-10 15:41:31 +01:00
|
|
|
%dir /var/run/qubes
|
2011-03-08 12:24:47 +01:00
|
|
|
|
|
|
|
|
|
|
|
%package devel
|
|
|
|
Summary: Include files for qubes core libraries
|
|
|
|
License: GPL v2 only
|
|
|
|
Group: Development/Sources
|
|
|
|
|
|
|
|
%description devel
|
|
|
|
|
|
|
|
%files devel
|
|
|
|
/usr/include/libvchan.h
|
|
|
|
/usr/include/u2mfnlib.h
|
|
|
|
/usr/include/u2mfn-kernel.h
|