-
Notifications
You must be signed in to change notification settings - Fork 35
/
PacketTracer.yml
63 lines (61 loc) · 2.63 KB
/
PacketTracer.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
61
62
63
# Version: 8.2.2
app: PacketTracer
ingredients:
dist: jessie
sources:
- deb http://archive.debian.org/debian jessie main
packages:
- libpng12-0
- libssl1.0.0
- python3
- libdouble-conversion1
- qt-at-spi
- libxcb-xinerama0
script:
- FILENAME='CiscoPacketTracer822_amd64_signed.deb'
- URL='https://archive.org/download/cisco-packet-tracer-822-amd-64-signed_202405/CiscoPacketTracer822_amd64_signed.deb'
- CHECKSUM='35bd819fcb0e2ed1df3582387d599e4a9c6bf2c9'
- [ -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
- cp -r ../etc/ .
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 icon and libs from extracted archive
- 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
# Create .desktop file
- cp ../etc/PacketTracer.desktop .
# - cp ../etc/PacketTracer-url.desktop .
- 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