blob: 2e6ecadd73be1fe14559608cd759ce3d38f67ebf (
plain)
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
|
# Maintainer: Geyslan G. Bem <geyslan@gmail.com>
# Maintainer: Pedro Henrique Quitete Barreto <pedrohqb@gmail.com>
pkgname=pje-office
pkgver=2.5.16u
pkgrel=8
pkgdesc="PJeOffice is a software made available by CNJ for electronic signing PJe system's documents"
arch=('any')
url='https://pjeoffice.trf3.jus.br'
license=('custom')
options=(!debug)
depends=('java-runtime=11' 'bash')
makedepends=('unzip')
source=("https://pje-office.pje.jus.br/pro/pjeoffice-pro-v${pkgver}-linux_x64.zip")
sha256sums=('6087391759c7cba11fb5ef815fe8be91713b46a8607c12eb664a9d9a6882c4c7')
prepare() {
# Extract the archive first
bsdtar -xf "${srcdir}/pjeoffice-pro-v${pkgver}-linux_x64.zip" -C "${srcdir}"
# Remove the bundled JRE
rm -rf "${srcdir}/pjeoffice-pro/jre"
# Remove not applicable README file
rm -rf "${srcdir}/pjeoffice-pro/LEIA-ME.TXT"
# Create the target directory structure within srcdir before moving files
install -d "${srcdir}/usr/share/"
# Move the extracted content to its final location within srcdir
mv "${srcdir}/pjeoffice-pro" "${srcdir}/usr/share/"
# Remove .gitignore from the moved directory
rm -f "${srcdir}/usr/share/pjeoffice-pro/.gitignore"
# Now create the launch script inside the moved directory
install -Dm775 /dev/null "${srcdir}/usr/share/pjeoffice-pro/pjeoffice-pro.sh"
cat << EOF > "${srcdir}/usr/share/pjeoffice-pro/pjeoffice-pro.sh"
#!/bin/bash
# PJeOffice CLEAN script
echo "Iniciando o PJeOffice!"
exec /usr/lib/jvm/java-11-openjdk/bin/java \
-XX:+UseG1GC \
-XX:MinHeapFreeRatio=3 \
-XX:MaxHeapFreeRatio=3 \
-Xms20m \
-Xmx2048m \
-Dpjeoffice_home="/usr/share/pjeoffice-pro/" \
-Dffmpeg_home="/usr/share/pjeoffice-pro/" \
-Dpjeoffice_looksandfeels="Metal" \
-Dcutplayer4j_looksandfeels="Nimbus" \
-jar \
/usr/share/pjeoffice-pro/pjeoffice-pro.jar
EOF
# Extract the 512x512 icon directly to a temporary location
unzip -p "${srcdir}/usr/share/pjeoffice-pro/pjeoffice-pro.jar" 'images/pje-icon-pje-feather.png' > "${srcdir}/pjeoffice.png"
# Create the .desktop file inside the moved directory
install -Dm644 /dev/null "${srcdir}/usr/share/pjeoffice-pro/pje-office.desktop"
cat << EOF > "${srcdir}/usr/share/pjeoffice-pro/pje-office.desktop"
[Desktop Entry]
Encoding=UTF-8
Name=PJeOffice
GenericName=PJeOffice
Exec=/usr/bin/pjeoffice-pro
Type=Application
Terminal=false
Categories=Office;
Comment=PJeOffice
Icon=pjeoffice
StartupWMClass=br-jus-cnj-pje-office-imp-PjeOfficeApp
EOF
}
package() {
# Copy the prepared 'usr' directory to the package root
cp -R "${srcdir}/usr/" "${pkgdir}/"
# Install the 512x512 PNG icon to the correct hicolor directory
install -Dm644 "${srcdir}/pjeoffice.png" "${pkgdir}/usr/share/icons/hicolor/512x512/apps/pjeoffice.png"
# Create symbolic links to the executable and desktop file
install -d "${pkgdir}/usr/bin"
ln -s "/usr/share/pjeoffice-pro/pjeoffice-pro.sh" "${pkgdir}/usr/bin/pjeoffice-pro"
install -d "${pkgdir}/usr/share/applications"
ln -s "/usr/share/pjeoffice-pro/pje-office.desktop" "${pkgdir}/usr/share/applications/pje-office.desktop"
# Make ffmpeg.exe executable
chmod +x "${pkgdir}/usr/share/pjeoffice-pro/ffmpeg.exe"
}
|