-
Notifications
You must be signed in to change notification settings - Fork 35
/
PacketTracer-8.1.yml
60 lines (58 loc) · 2.59 KB
/
PacketTracer-8.1.yml
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# Version: 8.1.0
app: PacketTracer
ingredients:
dist: jessie
sources:
- deb http://deb.debian.org/debian jessie main
packages:
- libpng12-0
- libssl1.0.0
- python3
- libdouble-conversion1
- qt-at-spi
script:
- FILENAME='CiscoPacketTracer_810_Ubuntu_64bit.deb'
- URL='https://archive.org/download/cisco-packet-tracer-810-ubuntu-64bit/CiscoPacketTracer_810_Ubuntu_64bit.deb'
- CHECKSUM='09359b9597e420b2537a77f503d2d409e66b9669'
- [ -f ../"$FILENAME" ] && ln -sf ../"$FILENAME" .
- [ -f ../"$FILENAME" ] || wget -c "$URL"
- echo "$CHECKSUM $FILENAME" > checksum
- sha1sum -c checksum
- [ -f ../etc/PacketTracerSettingsFix.py ] && cp ../etc/PacketTracerSettingsFix.py .
- [ -f ../etc/PacketTracerSettingsFix.py ] || wget -c https://raw.githubusercontent.com/konradmb/PacketTracer-AppImage/master/etc/PacketTracerSettingsFix.py
- chmod +x PacketTracerSettingsFix.py
script:
# Fix overly restrictive permissions - we should be able do delete directory
- find opt/pt/saves opt/pt/templates -type d -exec chmod +w {} +
# Copy helper script to bin
- cp ../PacketTracerSettingsFix.py usr/bin/
# Copy .desktop file, icon and libs from extracted archive
- cp usr/share/applications/cisco-pt.desktop ./PacketTracer.desktop
- cp opt/pt/art/app.png ./PacketTracer.png
- mkdir -p usr/lib/x86_64-linux-gnu/
- mv opt/pt/bin/*.so.* usr/lib/x86_64-linux-gnu/
# # Remove unused binaries
- rm opt/pt/bin/linguist opt/pt/bin/meta
# Fix wrong permissions - images shouldn't be executable. Cisco still cannot into permissions, even with deb. ;)
- find opt/pt/help/default/images/ -type f -exec chmod -x {} +
- chmod -x opt/pt/art/ComponentBox/*.png
- chmod -x opt/pt/art/Toolbar/*.png
# Add wrapper
- cat > usr/bin/PacketTracerWrapper << EOF
- #!/bin/sh
# Fool PacketTracer into thinking that it's been already running from this directory
- cd ..
- usr/bin/python3 usr/bin/PacketTracerSettingsFix.py 8.1
- cd opt/pt/bin
- export PT8HOME="$(readlink -f ..)"
- QT_AUTO_SCREEN_SCALE_FACTOR=1 ./PacketTracer "$@"
- EOF
# Make it executable
- chmod +x usr/bin/PacketTracerWrapper
# Patch PT bin - change $HOME/.packettracer string to something else
# New file name must have the same length
- sed -i 's!/.packettracer!/.ptappimage00!g' opt/pt/bin/PacketTracer
# Change icon and executable path
- sed -i 's!Icon=/opt/pt/art/app.png!Icon=PacketTracer.png!' PacketTracer.desktop
- sed -i 's!Exec=/opt/pt/packettracer %f!Exec=PacketTracerWrapper %f!' PacketTracer.desktop
- echo 'Categories=Education;ComputerScience;' >> PacketTracer.desktop