summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeyslan G. Bem2017-02-11 12:04:47 -0300
committerGeyslan G. Bem2017-02-11 12:04:47 -0300
commitaefe7c3b3a2b1152ba15c79c46017782b2fa46a9 (patch)
tree9721c4189ead3f1476dcfe69bf7475bf4b690c65
parent44c0591dc8b0acec471a2a9e939b32b75d5c243a (diff)
downloadaur-aefe7c3b3a2b1152ba15c79c46017782b2fa46a9.tar.gz
refactoring and fixes
Signed-off-by: Geyslan G. Bem <geyslan@gmail.com>
-rw-r--r--.SRCINFO17
-rw-r--r--PKGBUILD66
2 files changed, 33 insertions, 50 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 0ecf11f0881c..ec3edc7f2b5d 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,18 +1,15 @@
pkgbase = pje-office
pkgdesc = PJeOffice is a software made available by CNJ for electronic signing PJe system's documents
pkgver = 1.0.8
- pkgrel = 2
+ pkgrel = 3
url = http://www.cnj.jus.br/wiki/index.php/PJeOffice
install = pje-office.install
- arch = i686
- arch = x86_64
- license = BSD
- makedepends = deb2targz
- makedepends = coreutils
- source_i686 = ftp://ftp.cnj.jus.br/pje/programs/pje-office/pje-office_1.0.8_i386.deb
- md5sums_i686 = c7d3df1069a1f9f12be41659ef4f7be7
- source_x86_64 = ftp://ftp.cnj.jus.br/pje/programs/pje-office/pje-office_1.0.8_amd64.deb
- md5sums_x86_64 = f971eba91dfa913b5d7e7c404681ba00
+ arch = any
+ license = custom
+ depends = java-environment
+ depends = bash
+ source = ftp://ftp.cnj.jus.br/pje/programs/pje-office/pje-office_1.0.8_amd64.deb
+ md5sums = f971eba91dfa913b5d7e7c404681ba00
pkgname = pje-office
diff --git a/PKGBUILD b/PKGBUILD
index 2bd988e51704..a0e59b612f65 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,65 +2,51 @@
pkgname=pje-office
pkgver=1.0.8
-pkgrel=2
+pkgrel=3
pkgdesc="PJeOffice is a software made available by CNJ for electronic signing PJe system's documents"
-arch=('i686' 'x86_64')
+arch=('any')
url='http://www.cnj.jus.br/wiki/index.php/PJeOffice'
-license=('BSD')
-makedepends=('deb2targz' 'coreutils')
-source_i686=('ftp://ftp.cnj.jus.br/pje/programs/pje-office/'$pkgname'_'$pkgver'_i386.deb')
-source_x86_64=('ftp://ftp.cnj.jus.br/pje/programs/pje-office/'$pkgname'_'$pkgver'_amd64.deb')
-install='pje-office.install'
-md5sums_i686=('c7d3df1069a1f9f12be41659ef4f7be7')
-md5sums_x86_64=('f971eba91dfa913b5d7e7c404681ba00')
+license=('custom')
+depends=('java-environment' 'bash')
+source=(ftp://ftp.cnj.jus.br/pje/programs/${pkgname}/${pkgname}_${pkgver}_amd64.deb)
+install=${pkgname}.install
+md5sums=('f971eba91dfa913b5d7e7c404681ba00')
_fix() {
local _launcher
- echo "- Fixing launcher"
- _launcher=usr/share/$pkgname/pjeOffice.sh
- sed -i 's/^DIR=.*/DIR=$( cd "$( dirname $(readlink -f "${BASH_SOURCE[0]}" ) )" \&\& pwd )/' $_launcher
+ # why waste space?
+ rm -rf usr/share/${pkgname}/jre
+
+ # new launcher using default installed java
+ _launcher=usr/share/${pkgname}/pjeOffice.sh
+ echo "#!/bin/bash" > ${_launcher}
+ echo -e "# PJeOffice CLEAN script\n" >> ${_launcher}
+ echo -e "echo \"Iniciando o PJeOffice!\"\n" >> ${_launcher}
+ echo -e "$(which java) -jar /usr/share/${pkgname}/pjeOffice.jar" >> ${_launcher}
+
+ # load icon from package path
+ sed -i "s/^Icon=.*/Icon=\/usr\/share\/${pkgname}\/shortcuts\/icons\/PJeOffice.png/" usr/share/${pkgname}/shortcuts/${pkgname}.desktop
}
_clinks() {
local _basepath
- _basepath=usr/share/$pkgname
+ _basepath=usr/share/${pkgname}
- echo "- Creating symbolic links"
+ # creating symbolic links
mkdir -p usr/bin
- ln -sf /$_basepath/pjeOffice.sh usr/bin/pjeOffice
+ ln -sf /${_basepath}/pjeOffice.sh usr/bin/pjeOffice
mkdir -p usr/share/applications
- ln -sf /$_basepath/shortcuts/$pkgname.desktop usr/share/applications/$pkgname.desktop
- mkdir -p usr/share/icons
- ln -sf /$_basepath/shortcuts/icons/PJeOffice.png usr/share/icons/PJeOffice.png
+ ln -sf /${_basepath}/shortcuts/${pkgname}.desktop usr/share/applications/${pkgname}.desktop
}
prepare() {
- local _arch
- local _filename
-
- if [[ $CARCH == "i686" ]]; then
- _srcfile="$(basename $source_i686)"
- else
- _srcfile="$(basename $source_x86_64)"
- fi
-
- # realpath
- _srcfile="$(realpath ../$_srcfile)"
- # remove extension
- _srcfile="${_srcfile%.*}"
-
- echo "- Converting deb to tar.xz"
- deb2targz "$_srcfile.deb"
-
- echo "- Extracting tar.xz"
- tar xf "$_srcfile.tar.xz"
-
+ tar xf data.tar.xz
_fix
_clinks
}
package() {
- cp -R usr/ "$pkgdir"
- chmod 755 "$pkgdir/usr/share/pje-office/pjeOffice.sh"
+ cp -R usr/ ${pkgdir}
+ chmod 755 ${pkgdir}/usr/share/pje-office/pjeOffice.sh
}