Home | News | Download | Packages | Forum | Wiki | Github

[Solved] Template for debian package


#1

Hello, I want to install a sofware for which a debian package is available: it’s pdfstudio. At the moment it’s what I have:

# Template file for 'pdfstudio'
pkgname=pdfstudio
version=12.0.0
_version=12_0_0
revision=1
#wrksrc=
#create_wrksrc=yes
#only_for_archs="i686 x86_64"
build_style=fetch
#configure_args=""
#make_build_args=""
#make_install_args=""
#conf_files=""
#make_dirs="/var/log/dir 0755 root root"
hostmakedepends=""
makedepends=""
depends=""
short_desc="Review, annotate, and edit PDF Documents"
maintainer="Rocket"
license="custom"
homepage="http://www.qoppa.com/pdfstudio/"
distfiles="https://download.qoppa.com/$pkgname/v12/PDFStudio_v${_version}_linux64.deb"
checksum=3ba653575e6f445071cc2e2e0500e4d87aecfef2bff668e7399f0d66feae82f5

do_install(){
    ar vx PDFStudio_v12_0_0_linux64.deb
    tar xvzf data.tar.gz
    rm -rf opt/pdfstudio12/jre
    vcopy opt/* opt/
}

Basically I have to unpack the deb package and to remove the java virtual machine to use the installed one (I’ll add the denpendency later). I don’t knwo if I’m on the right way at the moment. I used instead of “vcopy opt/* opt/” the function vmove, but it didn’t work. At the moment the package is created, it’s size is bigger than 0 but when I installed it, I get the following:

Name      Action    Version           New version            Download size
pdfstudio install   -                 12.0.0_1               - 

Free space on disk:             45GB

Do you want to continue? [Y/n] y

[*] Downloading binary packages

[*] Verifying package integrity
pdfstudio-12.0.0_1: verifying SHA256 hash...
ERROR: pdfstudio-12.0.0_1: SHA256 hash is not valid: Numerical result out of range

It seems that it’s empty and the SHA hash is wrong. But I was able to create the package. What’s wrong here ?

Thank you!


#2
 do_extract() {
         ar vx ${XBPS_SRCDISTDIR}/${pkgname}-${version}/PDFStudio_v12_0_0_linux64.deb
 }
 
 do_install(){
         tar xvzf data.tar.gz -C ${DESTDIR}
         rm -rf ${DESTDIR}/opt/pdfstudio12/jre
 }

#3

Thank you, the package builds now without problem. But I can’t install it. I have always the second problem: the sha256 is not valid. I have tried to display debug information or to be more verbose, but it doesn’t help.

Here is the command I use to install the package:

sudo xbps-install --repository=hostdir/binpkgs/myrepo pdfstudio


#4

Add only_for_archs="x86_64" line to your template. This won’t let xbps-src build this package for i686.
Also add this to your do_install():
vmkdir /usr/bin ln -s /opt/pdfstudio12/pdfstudio12 "${DESTDIR}/usr/bin/pdfstudio"
This will allow starting pdfstudio from command line.


#5

Ok, at the end it worked… but I still don’t know why. I did the following: I created one package for some scripts named “wmutils-perso”. Now when a package is created, it is put in hostdir/binpks/wmutils-perso. That folder contains a file name x86_64-repodata. I thought the SHA256 was perhaps saved for wmutils-perso so I deleted the folder wmutis-perso. Now I can build the package and there is no problem. I also can install it without a problem.

I tried to rebuild another package and I noticed I had again the same error about the wrong sha256 sum. Do I have to put each package in separate repository ? Or is the problem something else ?


#6

If you built it before with the same version and revision you have to build with xbps-src -f pkg ..., otherwise the existing package will not be overwritten.


#7

It was probably the problem. Thank you for all your help!