-
Notifications
You must be signed in to change notification settings - Fork 35
/
Copy pathPacketTracer-7.2.1.yml
68 lines (65 loc) · 2.9 KB
/
PacketTracer-7.2.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
61
62
63
64
65
66
67
68
app: PacketTracer-7.2.1
ingredients:
dist: jessie
sources:
- deb http://deb.debian.org/debian jessie main
packages:
- libpng12-0
- libssl1.0.0
- python3
exclude:
- PacketTracer
script:
- FILENAME="Packet Tracer 7.2.1 for Linux 64 bit.tar.gz"
- [ -f ../"$FILENAME" ] && ln -sf ../"$FILENAME" .
- [ -f ../"$FILENAME" ] || wget -c https://archive.org/download/pt722/Packet%20Tracer%207.2.1%20for%20Linux%2064%20bit.tar.gz
- echo "b95e0a58e9a65c623b6534bd42855117e25c50d3 $FILENAME" > checksum
- sha1sum -c checksum
# Remove directory if already extracted
- rm -rf extracted
- mkdir -p extracted
- tar zxvf "$FILENAME" --directory extracted/
# Fix overly restrictive permissions - we should be able do delete directory
- find extracted/saves -type d -exec chmod +w {} +
# Copy helper script
- wget -c https://raw.githubusercontent.com/konradmb/PacketTracer-AppImage/master/etc/PacketTracerSettingsFix.py
- chmod +x PacketTracerSettingsFix.py
- echo "7.2.1" > VERSION
script:
# Copy helper script to bin
- cp ../PacketTracerSettingsFix.py usr/bin/
# Copy .desktop file, icon and libs from extracted archive
- cp ../extracted/bin/Cisco-PacketTracer.desktop ./PacketTracer.desktop
- cp ../extracted/art/app.png ./PacketTracer.png
- mkdir -p usr/lib/x86_64-linux-gnu/
- cp ../extracted/bin/*.so.* usr/lib/x86_64-linux-gnu/
# Copy all of the archive contents to its own directory
- mkdir -p usr/share/PacketTracer
- cp -r ../extracted/* usr/share/PacketTracer
# Remove libraries already copied to usr/lib/x86_64-linux-gnu
- rm usr/share/PacketTracer/bin/*.so.*
# Remove files needed for installation
- rm usr/share/PacketTracer/tpl.* usr/share/PacketTracer/set_* usr/share/PacketTracer/install
# Remove unused binaries
- rm usr/share/PacketTracer/bin/linguist usr/share/PacketTracer/bin/meta
# Fix wrong permissions - images shouldn't be executable. Cisco cannot into permissions. ;)
- chmod -x usr/share/PacketTracer/help/default/images/font*.png
- chmod -x usr/share/PacketTracer/art/ComponentBox/*.png
- chmod -x usr/share/PacketTracer/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
# Should think of a nicer solution
- bin/python3 bin/PacketTracerSettingsFix.py 7.2
- cd share/PacketTracer/bin
- ./PacketTracer7
- 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' usr/share/PacketTracer/bin/PacketTracer7
# Change icon and executable path
- sed -i 's!Icon=/opt/pt/art/app.png!Icon=PacketTracer.png!' PacketTracer.desktop
- sed -i 's!Exec=packettracer %F!Exec=PacketTracerWrapper!' PacketTracer.desktop