| 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 |
ARCH= |
| 34 |
|
| 35 |
VERSION=$(shell awk -F= '/config{version}[[:space:]]*=/ {print $$2}' cgi-bin/qemu-web-desktop.pl | sed -e 's/;.*//' -e 's/"//g' -e 's/[[:space:]]*//g' | tail -1 ) |
| 36 |
|
| 37 |
|
| 38 |
ifneq ("$(wildcard /etc/debian_version)","") |
| 39 |
ARCH = Debian |
| 40 |
$(info Detected Debian-type system) |
| 41 |
else ifneq ("$(wildcard /etc/redhat-release)","") |
| 42 |
ARCH = RedHat |
| 43 |
$(info Detected RedHat-type system) |
| 44 |
else ifneq ("$(wildcard /etc/arch-release)","") |
| 45 |
ARCH = Arch |
| 46 |
$(info Detected Arch-type system) |
| 47 |
else ifneq ("$(wildcard /etc/bashrc_Apple_Terminal)","") |
| 48 |
ARCH = Darwin |
| 49 |
$(info Detected Darwin-type system - Apple) |
| 50 |
endif |
| 51 |
|
| 52 |
|
| 53 |
uname_m := $(shell uname -m) |
| 54 |
QEMU.i386 := qemu-system-x86 |
| 55 |
QEMU.x86_64 := qemu-system-x86 |
| 56 |
QEMU.aarch64 := qemu-system-arm |
| 57 |
QEMU.arm64 := qemu-system-arm |
| 58 |
|
| 59 |
QEMU ?= $(QEMU.$(uname_m)) |
| 60 |
|
| 61 |
ifeq ($(ARCH),Debian) |
| 62 |
DIR_CGI_BIN = /usr/lib/cgi-bin |
| 63 |
DIR_APACHE_CONF_QWD = /etc/apache2/conf-available |
| 64 |
APACHE_CONF = |
| 65 |
DIR_WWW = /var/www/html |
| 66 |
else ifeq ($(ARCH),RedHat) |
| 67 |
DIR_CGI_BIN = /var/www/cgi-bin |
| 68 |
DIR_APACHE_CONF_QWD = /etc/httpd/conf.d/ |
| 69 |
APACHE_CONF = /etc/httpd/conf/httpd.conf |
| 70 |
DIR_WWW = /var/www/html |
| 71 |
else ifeq ($(ARCH),Arch) |
| 72 |
DIR_CGI_BIN = /srv/http/cgi-bin |
| 73 |
DIR_APACHE_CONF_QWD = /etc/httpd/conf/extra/ |
| 74 |
APACHE_CONF = /etc/httpd/conf/httpd.conf |
| 75 |
DIR_WWW = /srv/http |
| 76 |
else ifeq ($(ARCH),Darwin) |
| 77 |
DESTDIR ?= $(shell brew --prefix) |
| 78 |
PERLDIR = $(shell brew --prefix perl) |
| 79 |
DIR_APACHE_CONF_QWD = /etc/httpd/extra/ |
| 80 |
APACHE_CONF = /etc/httpd/httpd.conf |
| 81 |
DIR_CGI_BIN = /Library/WebServer/CGI-Executables/ |
| 82 |
DIR_WWW = /Library/WebServer/Documents/ |
| 83 |
else |
| 84 |
$(error Undefined target. Set system type with: make install ARCH=Debian|RedHat|Arch|Darwin) |
| 85 |
endif |
| 86 |
|
| 87 |
all: help |
| 88 |
|
| 89 |
help: |
| 90 |
ifneq ($(ARCH),Darwin) |
| 91 |
@help2man -o doc/qwdctl.1 --no-discard-stderr -n 'control qemu-web-desktop' bin/qwdctl || true |
| 92 |
@pandoc -s -f man -t markdown < doc/qwdctl.1 > doc/qwdctl.md || true |
| 93 |
@sed '/^\[!\[DOI\]/d' README.md | pandoc --to pdf -o doc/README.pdf || true |
| 94 |
@pandoc --to pdf -o doc/CONFIGURE.pdf doc/CONFIGURE.md || true |
| 95 |
@pandoc --to pdf -o doc/GPU.pdf doc/GPU.md || true |
| 96 |
@pandoc --to pdf -o doc/INSTALL.pdf doc/INSTALL.md || true |
| 97 |
@pandoc --to pdf -o doc/qwdctl.pdf doc/qwdctl.md || true |
| 98 |
@pandoc --to pdf -o doc/USAGE.pdf doc/USAGE.md || true |
| 99 |
@pandoc --to pdf -o doc/VIRTUAL_MACHINES.pdf doc/VIRTUAL_MACHINES.md || true |
| 100 |
endif |
| 101 |
@echo "Usage: install qemu-web-desktop" |
| 102 |
@echo "make deps" |
| 103 |
@echo " install dependencies" |
| 104 |
@echo "make install" |
| 105 |
@echo " install qemu-web-desktop" |
| 106 |
@echo "make uninstall" |
| 107 |
@echo " uninstall qemu-web-desktop" |
| 108 |
@echo "make deb" |
| 109 |
@echo " create debian package" |
| 110 |
|
| 111 |
|
| 112 |
|
| 113 |
|
| 114 |
deps: |
| 115 |
@echo "Installing $(ARCH)-class dependencies" |
| 116 |
ifeq ($(ARCH),Debian) |
| 117 |
sudo apt install apache2 libapache2-mod-perl2 novnc websockify $(QEMU) qemu-utils bridge-utils iptables dnsmasq libcgi-pm-perl liblist-moreutils-perl libsys-cpu-perl libsys-cpuload-perl libsys-meminfo-perl libnet-dns-perl libproc-background-perl libproc-processtable-perl libemail-valid-perl libnet-smtps-perl libmail-imapclient-perl libnet-ldap-perl libemail-valid-perl libjson-perl libwww-perl libguestfs-tools libapache2-mpm-itk libtext-qrcode-perl libnet-ssh2-perl wget nano |
| 118 |
if [ "$(uname_m)" = "aarch64" -o "$(uname_m)" = "arm64" ]; then sudo apt install qemu-efi-aarch64; fi |
| 119 |
else ifeq ($(ARCH),Arch) |
| 120 |
@echo "NOTE: You need 'yay' to be installed, and the AUR to be available." |
| 121 |
yay -Sy python-numpy python-setuptools mod_itk apache qemu-desktop bridge-utils qemu-img dnsmasq guestfs-tools perl-cgi perl-list-moreutils perl-sys-cpu perl-sys-meminfo perl-net-dns perl-proc-processtable perl-mail-imapclient perl-ldap perl-json perl-libwww mod_perl novnc websockify perl-proc-background perl-email-valid perl-net-smtps perl-text-qrcode perl-net-ssh2 wget nano |
| 122 |
else ifeq ($(ARCH),RedHat) |
| 123 |
@echo "NOTE: This system-type is not fully supported" |
| 124 |
sudo dnf install mod_perl novnc python3-websockify guestfs-tools perl-CGI perl-List-MoreUtils perl-Sys-CPU perl-Sys-MemInfo perl-Net-DNS perl-Proc-ProcessTable perl-Email-Valid perl-Net-SMTPS perl-Mail-IMAPClient perl-LDAP perl-JSON perl-libwww-perl perl-Text-QRCode perl-Net-SSH2 perl-Net-Ping perl-CPAN wget nano |
| 125 |
sudo cpan Proc::Background |
| 126 |
else ifeq ($(ARCH),Darwin) |
| 127 |
ifeq ($(shell id -u),0) |
| 128 |
$(error "Install dependencies as normal user, not root.") |
| 129 |
endif |
| 130 |
@echo "NOTE: This system-type is not properly supported" |
| 131 |
brew install apache2 qemu perl python3 python-setuptools grep wget gnu-sed nano cpanminus |
| 132 |
# install PERL CPAN modules |
| 133 |
# WARNING: Net::SMTPS fails installation on Mac |
| 134 |
cpanm --notest CGI Cwd File::Temp File::Path File::Basename File::Copy List::MoreUtils List::Util IO::Socket::INET IO::Socket::IP JSON Proc::Background Proc::ProcessTable Proc::Killfam System::CPU Sys::MemInfo Email::Valid Mail::IMAPClient LWP::UserAgent Net::Ping Net::LDAP Net::SSH2 URI |
| 135 |
# install websockify |
| 136 |
$(cd /tmp; wget https://github.com/novnc/websockify/archive/refs/tags/v0.13.0.tar.gz; tar xzf v0.13.0.tar.gz; cd websockify-0.13.0; python3 setup.py build; python3 setup.py build; ) |
| 137 |
|
| 138 |
if [ ! -d "$(DESTDIR)/usr/share/novnc" ]; then bash -c "cd /tmp; wget https://github.com/novnc/noVNC/archive/refs/tags/v1.6.0.tar.gz; tar xzf v1.6.0.tar.gz; cp -r noVNC-1.6.0 $(DESTDIR)/usr/share/novnc"; fi |
| 139 |
endif |
| 140 |
@echo "[OK] Dependencies installed for $(ARCH)" |
| 141 |
@echo "You may now proceed with: make install" |
| 142 |
|
| 143 |
|
| 144 |
|
| 145 |
|
| 146 |
|
| 147 |
install: copy config |
| 148 |
|
| 149 |
copy: |
| 150 |
@echo "Copying QWD files for $(ARCH)-type system" |
| 151 |
ifeq ($(ARCH),Darwin) |
| 152 |
# copy: Darwin/Apple macos |
| 153 |
# create directories (install command is broken - we use mkdir/cp) |
| 154 |
ifeq ($(shell id -u),0) |
| 155 |
$(error "Install as normal user (brew), not root.") |
| 156 |
endif |
| 157 |
mkdir -p $(DESTDIR)$(prefix)/etc/qemu-web-desktop |
| 158 |
mkdir -p $(DESTDIR)$(prefix)/etc/qemu-web-desktop/config.d |
| 159 |
mkdir -p $(DESTDIR)$(prefix)/bin |
| 160 |
mkdir -p $(DESTDIR)$(prefix)/usr/share/qemu-web-desktop/html/desktop |
| 161 |
mkdir -p $(DESTDIR)$(prefix)/usr/share/qemu-web-desktop/html/desktop/images |
| 162 |
mkdir -p $(DESTDIR)$(prefix)/usr/share/doc/qemu-web-desktop |
| 163 |
mkdir -p $(DESTDIR)$(prefix)/var/lib/qemu-web-desktop/machines |
| 164 |
mkdir -p $(DESTDIR)$(prefix)/var/lib/qemu-web-desktop/snapshots |
| 165 |
mkdir -p $(DESTDIR)$(prefix)/var/www/cgi-bin/ |
| 166 |
# common install |
| 167 |
cp etc/machines.conf $(DESTDIR)$(prefix)/etc/qemu-web-desktop/ |
| 168 |
cp etc/config.pl $(DESTDIR)$(prefix)/etc/qemu-web-desktop/ |
| 169 |
cp html/desktop/index.html $(DESTDIR)$(prefix)/usr/share/qemu-web-desktop/html/desktop |
| 170 |
cp html/desktop/style.css $(DESTDIR)$(prefix)/usr/share/qemu-web-desktop/html/desktop |
| 171 |
cp html/desktop/images/* $(DESTDIR)$(prefix)/usr/share/qemu-web-desktop/html/desktop/images |
| 172 |
cp doc/*.pdf $(DESTDIR)$(prefix)/usr/share/doc/qemu-web-desktop |
| 173 |
cp bin/qwdctl $(DESTDIR)$(prefix)/bin/ |
| 174 |
-cp html/desktop/machines/* $(DESTDIR)$(prefix)/var/lib/qemu-web-desktop/machines |
| 175 |
# system specific locations |
| 176 |
# mkdir -p $(DESTDIR)$(prefix)$(DIR_APACHE_CONF_QWD) |
| 177 |
# cp etc/apache.conf $(DESTDIR)$(prefix)$(DIR_APACHE_CONF_QWD)/qemu-web-desktop.conf |
| 178 |
sudo cp cgi-bin/qemu-web-desktop.pl $(prefix)$(DIR_CGI_BIN) |
| 179 |
sudo sed -i '' 's|^#!/usr/bin/env perl|#!$(PERLDIR)/bin/perl|' $(prefix)$(DIR_CGI_BIN)qemu-web-desktop.pl |
| 180 |
sudo chmod 755 $(prefix)$(DIR_CGI_BIN)qemu-web-desktop.pl |
| 181 |
chmod a+x $(DESTDIR)$(prefix)/etc/qemu-web-desktop/ |
| 182 |
chmod -R a+r $(DESTDIR)$(prefix)/etc/qemu-web-desktop/ |
| 183 |
chmod a+x $(DESTDIR)$(prefix)/etc/qemu-web-desktop/config.d |
| 184 |
chmod a+xrw $(DESTDIR)$(prefix)/var/lib/qemu-web-desktop/snapshots |
| 185 |
chmod a+xrw $(DESTDIR)$(prefix)/var/log/ |
| 186 |
touch $(DESTDIR)$(prefix)/var/log/qemu-web-desktop.log |
| 187 |
chmod a+rw $(DESTDIR)$(prefix)/var/log/qemu-web-desktop.log |
| 188 |
|
| 189 |
# now sudo part to link to the native Apache from macos |
| 190 |
-sudo ln -s $(DESTDIR)$(prefix)/usr/share/qemu-web-desktop/html/desktop $(prefix)$(DIR_WWW)/qemu-web-desktop |
| 191 |
-sudo ln -s $(prefix)$(DIR_CGI_BIN)qemu-web-desktop.pl $(DESTDIR)$(prefix)/var/www/cgi-bin/ |
| 192 |
|
| 193 |
else |
| 194 |
# not Darwin/Apple macos |
| 195 |
# create directories |
| 196 |
install -D -d $(DESTDIR)$(prefix)/etc/qemu-web-desktop |
| 197 |
install -D -d $(DESTDIR)$(prefix)/usr/bin |
| 198 |
install -D -d $(DESTDIR)$(prefix)/usr/share/qemu-web-desktop/html/desktop |
| 199 |
install -D -d $(DESTDIR)$(prefix)/usr/share/qemu-web-desktop/html/desktop/images |
| 200 |
install -D -d $(DESTDIR)$(prefix)/usr/share/doc/qemu-web-desktop |
| 201 |
install -D -d $(DESTDIR)$(prefix)/var/lib/qemu-web-desktop/machines |
| 202 |
install -D -d $(DESTDIR)$(prefix)/var/lib/qemu-web-desktop/snapshots |
| 203 |
# common install |
| 204 |
install -D etc/machines.conf -m 644 $(DESTDIR)$(prefix)/etc/qemu-web-desktop/ |
| 205 |
install -D etc/config.pl -m 644 $(DESTDIR)$(prefix)/etc/qemu-web-desktop/ |
| 206 |
install -D html/desktop/index.html -m 644 $(DESTDIR)$(prefix)/usr/share/qemu-web-desktop/html/desktop |
| 207 |
install -D html/desktop/style.css -m 644 $(DESTDIR)$(prefix)/usr/share/qemu-web-desktop/html/desktop |
| 208 |
install -D html/desktop/images/* -m 644 $(DESTDIR)$(prefix)/usr/share/qemu-web-desktop/html/desktop/images |
| 209 |
install -D doc/qwdctl.1 -m 644 $(DESTDIR)$(prefix)/usr/share/man/man1/qwdctl.1 |
| 210 |
install -D doc/README.pdf -m 644 $(DESTDIR)$(prefix)/usr/share/doc/qemu-web-desktop |
| 211 |
install -D bin/qwdctl $(DESTDIR)$(prefix)/usr/bin/ |
| 212 |
-install -D html/desktop/machines/* -m 644 $(DESTDIR)$(prefix)/var/lib/qemu-web-desktop/machines |
| 213 |
# system specific locations |
| 214 |
ifndef DEB_BUILD_ARCH |
| 215 |
install -D -d $(DESTDIR)$(prefix)$(DIR_WWW) |
| 216 |
endif |
| 217 |
install -D -d $(DESTDIR)$(prefix)$(DIR_APACHE_CONF_QWD) |
| 218 |
install etc/apache.conf -m 644 $(DESTDIR)$(prefix)$(DIR_APACHE_CONF_QWD)/qemu-web-desktop.conf |
| 219 |
install -D -d $(DESTDIR)$(prefix)$(DIR_CGI_BIN) |
| 220 |
install -D cgi-bin/qemu-web-desktop.pl $(DESTDIR)$(prefix)$(DIR_CGI_BIN)/qemu-web-desktop.pl |
| 221 |
chmod 755 $(DESTDIR)$(prefix)$(DIR_CGI_BIN)/qemu-web-desktop.pl |
| 222 |
# system specific actions |
| 223 |
ifneq ($(ARCH),Debian) |
| 224 |
sed -i 's|Alias /qemu-web-desktop|#Alias /qemu-web-desktop|' $(DESTDIR)$(prefix)$(DIR_APACHE_CONF_QWD)/qemu-web-desktop.conf |
| 225 |
sed -i 's/config{service_port_multiple} = 0/config{service_port_multiple} = 1/' $(DESTDIR)$(prefix)/etc/qemu-web-desktop//config.pl |
| 226 |
sed -i 's/machines_insert=no/machines_insert=yes/' $(DESTDIR)$(prefix)/usr/bin/qwdctl |
| 227 |
endif |
| 228 |
find $(DESTDIR)$(prefix)/usr/share/qemu-web-desktop/html -type f -exec chmod a+r {} + |
| 229 |
find $(DESTDIR)$(prefix)/usr/share/qemu-web-desktop/html -type d -exec chmod a+rx {} + |
| 230 |
chmod u+xrw $(DESTDIR)$(prefix)/var/lib/qemu-web-desktop/snapshots |
| 231 |
|
| 232 |
endif |
| 233 |
|
| 234 |
chmod a+wxr $(DESTDIR)$(prefix)/var/lib/qemu-web-desktop |
| 235 |
chmod a+xrw $(DESTDIR)$(prefix)/var/lib/qemu-web-desktop/machines |
| 236 |
|
| 237 |
@echo "[OK] QWD Installation complete for $(ARCH)." |
| 238 |
@echo "You may now proceed with: make config" |
| 239 |
|
| 240 |
|
| 241 |
|
| 242 |
|
| 243 |
config: |
| 244 |
ifndef DEB_BUILD_ARCH |
| 245 |
@echo "Post QWD installation steps (auto-configure) for $(ARCH)" |
| 246 |
# skip when buidling Debian |
| 247 |
ifneq ($(ARCH),Darwin) |
| 248 |
-ln -sf $(DESTDIR)$(prefix)/usr/share/qemu-web-desktop/html/desktop $(DESTDIR)$(prefix)$(DIR_WWW)/ |
| 249 |
-ln -sf $(DESTDIR)$(prefix)/var/lib/qemu-web-desktop/machines $(DESTDIR)$(prefix)$(DIR_WWW)/desktop/ |
| 250 |
endif |
| 251 |
# log file |
| 252 |
touch $(DESTDIR)$(prefix)/var/log/qemu-web-desktop.log |
| 253 |
chmod 640 $(DESTDIR)$(prefix)/var/log/qemu-web-desktop.log |
| 254 |
ifeq ($(ARCH),Debian) |
| 255 |
-adduser --system --home $(DESTDIR)$(prefix)/var/lib/qemu-web-desktop --force-badname _qemu-web-desktop |
| 256 |
-chown -R _qemu-web-desktop $(DESTDIR)$(prefix)/var/lib/qemu-web-desktop |
| 257 |
-chown _qemu-web-desktop $(DESTDIR)$(prefix)/var/log/qemu-web-desktop.log |
| 258 |
systemctl enable apache2 |
| 259 |
a2enconf qemu-web-desktop |
| 260 |
a2enmod cgi proxy proxy_http proxy_wstunnel rewrite include |
| 261 |
systemctl restart apache2 |
| 262 |
chmod 755 /etc/qemu-ifup |
| 263 |
endif |
| 264 |
ifeq ($(ARCH),Arch) |
| 265 |
useradd --system -m --home-dir $(DESTDIR)$(prefix)/var/lib/qemu-web-desktop --badname _qemu-web-desktop |
| 266 |
chown -R _qemu-web-desktop $(DESTDIR)$(prefix)/var/lib/qemu-web-desktop |
| 267 |
ln -sf $(DESTDIR)$(prefix)/usr/share/qemu-web-desktop/html/desktop $(DESTDIR)$(prefix)$(DIR_WWW)/qemu-web-desktop |
| 268 |
sed -i 's|/usr/share/novnc|$(DESTDIR)$(prefix)/usr/share/webapps/novnc|' $(DESTDIR)$(prefix)/etc/qemu-web-desktop/config.pl |
| 269 |
# MPM ITK requires prefork, that conflicts with mpm_event |
| 270 |
sed -i 's/LoadModule mpm_event/#LoadModule mpm_event/' $(DESTDIR)$(prefix)$(APACHE_CONF) |
| 271 |
sed -i 's/#LoadModule mpm_prefork/LoadModule mpm_prefork/' $(DESTDIR)$(prefix)$(APACHE_CONF) |
| 272 |
grep -q "mpm_itk" $(DESTDIR)$(prefix)$(APACHE_CONF) || echo "LoadModule mpm_itk_module modules/mpm_itk.so" >> $(DESTDIR)$(prefix)$(APACHE_CONF) |
| 273 |
grep -q "qemu-web-desktop" $(DESTDIR)$(prefix)$(APACHE_CONF) || echo "Include conf/extra/qemu-web-desktop.conf" >> $(DESTDIR)$(prefix)$(APACHE_CONF) |
| 274 |
systemctl enable httpd |
| 275 |
systemctl daemon-reload |
| 276 |
systemctl restart httpd |
| 277 |
endif |
| 278 |
ifeq ($(ARCH),RedHat) |
| 279 |
# There is no available MPM ITK module :-( |
| 280 |
chown -R apache $(DESTDIR)$(prefix)/var/lib/qemu-web-desktop |
| 281 |
ln -sf $(DESTDIR)$(prefix)/usr/share/qemu-web-desktop/html/desktop $(DESTDIR)$(prefix)$(DIR_WWW)/qemu-web-desktop |
| 282 |
usermod -a -G kvm apache |
| 283 |
systemctl enable httpd |
| 284 |
systemctl daemon-reload |
| 285 |
systemctl restart httpd |
| 286 |
# SElinux permissions: allow port 6080 (update if config.pl changes). |
| 287 |
# Currently this does not work: we get a KVM error from httpd daemon |
| 288 |
semanage port -a -t http_port_t -p tcp 6080 || true |
| 289 |
semanage port -a -t http_port_t -p tcp 5901 || true |
| 290 |
setsebool -P httpd_can_network_relay 1 |
| 291 |
setsebool -P httpd_can_network_connect 1 |
| 292 |
setsebool -P httpd_read_user_content 1 |
| 293 |
@echo "WARNING: $(ARCH): the web service will probably not work. Use: qwdctl start VM|ISO" |
| 294 |
endif |
| 295 |
ln -sf $(DESTDIR)$(prefix)/var/lib/qemu-web-desktop/machines.html $(DESTDIR)$(prefix)/usr/share/qemu-web-desktop/html/desktop || true |
| 296 |
@echo " " |
| 297 |
@echo "[OK] QWD Configuration complete for $(ARCH)." |
| 298 |
qwdctl download |
| 299 |
@echo "Now connect to http://localhost/qemu-web-desktop for immediate use." |
| 300 |
@echo "or launch a VM with: qwdctl start VM" |
| 301 |
@echo "or refer to https://gitlab.com/soleil-data-treatment/soleil-software-projects/qemu-web-desktop" |
| 302 |
@echo "to configure the service." |
| 303 |
endif |
| 304 |
|
| 305 |
|
| 306 |
|
| 307 |
test: |
| 308 |
-qwdctl stop |
| 309 |
ifneq ($(ARCH),Darwin) |
| 310 |
if timeout 10 perl cgi-bin/qemu-web-desktop.pl --dir_snapshots=/tmp --dir_cfg=/tmp --dir_machines=html/desktop/machines/ --oneshot=1 --machine=TinyCore-current.iso = 124; then echo "OK"; fi |
| 311 |
else |
| 312 |
@echo "Test is not available for Darwin/Apple macos" |
| 313 |
endif |
| 314 |
@echo Test OK |
| 315 |
|
| 316 |
uninstall: |
| 317 |
-rm -rf $(DESTDIR)$(prefix)/etc/qemu-web-desktop/ |
| 318 |
-rm -rf $(DESTDIR)$(prefix)/usr/share/qemu-web-desktop |
| 319 |
-rm -rf $(DESTDIR)$(prefix)/usr/share/doc/qemu-web-desktop |
| 320 |
-rm -f $(DESTDIR)$(prefix)/usr/share/man/man1/qwdctl.* |
| 321 |
-rm -f $(DESTDIR)$(prefix)/usr/bin/qwdctl |
| 322 |
-rm -rf $(DESTDIR)$(prefix)/var/lib/qemu-web-desktop/ |
| 323 |
-rm -rf $(DESTDIR)$(prefix)$(DIR_WWW)/qemu-web-desktop |
| 324 |
-rm -rf $(DESTDIR)$(prefix)$(DIR_WWW)/desktop |
| 325 |
-rm -f $(DESTDIR)$(prefix)$(DIR_APACHE_CONF_QWD)/qemu-web-desktop.conf |
| 326 |
-rm -f $(DESTDIR)$(prefix)$(DIR_CGI_BIN)/qemu-web-desktop.pl |
| 327 |
if [ -e $(DESTDIR)$(prefix)/etc/httpd/conf/httpd.conf ]; then \ |
| 328 |
sed -i 's|Include conf/extra/qemu-web-desktop.conf|#Include conf/extra/qemu-web-desktop.conf|' $(DESTDIR)$(prefix)$(APACHE_CONF); \ |
| 329 |
fi |
| 330 |
-apachectl restart |
| 331 |
-killall -9 websockify |
| 332 |
-deluser _qemu-web-desktop || userdel _qemu-web-desktop || true |
| 333 |
@echo "[OK] QWD uninstalled." |
| 334 |
|
| 335 |
dist: |
| 336 |
tar --create \ |
| 337 |
--auto-compress \ |
| 338 |
--file=../qemu-web-desktop-$(VERSION).tar.gz \ |
| 339 |
--transform=s,^./,qemu-web-desktop-$(VERSION)/, \ |
| 340 |
--exclude=./html/desktop/machines \ |
| 341 |
--exclude=./.git* \ |
| 342 |
--exclude=*~ \ |
| 343 |
--exclude=./debian \ |
| 344 |
. |
| 345 |
deb: |
| 346 |
@echo "Building Debian package" |
| 347 |
# requires: git-buildpackage dh-apache2 dh-sysuser devscripts |
| 348 |
-rm -rf debian build |
| 349 |
cp -r packaging/debian . |
| 350 |
# remove too big ISO |
| 351 |
mv html/desktop/machines/slax.iso . |
| 352 |
debuild -b || true |
| 353 |
rm -rf debian build |
| 354 |
mv slax.iso html/desktop/machines/slax.iso |
| 355 |
@echo "[OK] Build deb" |
| 356 |
|
| 357 |
.PHONY: all install uninstall |
| 358 |
.NOTPARALLEL: copy config |
| 359 |
|
| 360 |
|