Creating a template


(karl-k) #1

Hello, I am trying to make template for VirtualShield, it is very simple but am running into errors.

What ${dir} should I use? I have tried FILESDIR, DESTDIR, SRCDIR, PKGDIR… not sure what am doing wrong :confused: is wrksrc not set right? How do I figure out these directories? this is first time I have try to make a template for Void, I am Arch user.

I have tried removing the ‘v’ from ‘vinstall’ but same result…
and I have tried adding and removing vmkdir to mkdir directories, but still no difference…

## Template file for 'virtualshield'
## Maintainer: Karl-K

pkgname=virtualshield
version=1.0
revision=1
wrksrc="${pkgname}-${version}"
depends="mono mono-basic wine-mono openvpn gtk-sharp2"
short_desc="You have the right to remain private! VirtualShield VPN"
maintainer="<karl-k>"
license="https://virtualshield.com/legal/eula/"
homepage="https://virtualshield.com"
distfiles="https://github.com/karl-k/${pkgname}/archive/${version}.tar.gz"
checksum="b6ac7a79e1f1eb545c1e41d505d0ea85d920d3091a6be2c357f8a313759a2cdb"

do_install() {

	vinstall -D -m666 "VirtualShield.exe" ${FILESDIR}usr/share/virtualshield/VirtualShield.exe
	vinstall -D -m666 "VirtualShieldSvc.exe" ${FILESDIR}usr/share/virtualshield/VirtualShieldSvc.exe
	vinstall -D -m666 "virtualshield.desktop" ${FILESDIR}usr/share/applications/VirtualShield.desktop
	vinstall -D -m666 "nautilus-actions.conf" ${FILESDIR}usr/share/virtualshield/nautilus-actions.conf
	vinstall -D -m666 "AppIcon.png" ${FILESDIR}usr/share/virtualshield/AppIcon.png
	vinstall -D -m666 "VirtualShieldSetup.exe" ${FILESDIR}usr/share/virtualshield/VirtualShieldSetup.exe
	vinstall -D -m666 "virtualshield.deb" ${FILESDIR}usr/local/share/virtualshield/virtualshield.deb
	vinstall -D -m666 "c5c988bb-fa14-487d-b7bf-2ccb8c2eec4d.desktop" ${FILESDIR}usr/share/virtualshield/c5c988bb-fa14-487d-b7bf-2ccb8c2eec4d.desktop
	vinstall -D -m755 "VirtualShield-bin" ${FILESDIR}usr/bin/VirtualShield
	vinstall -D -m755 "run" ${FILESDIR}etc/sv/VirtualShield/run

}
=> virtualshield-1.0_1: skipping check (XBPS_CHECK_PKGS is disabled) ...
=> virtualshield-1.0_1: running pre-pkg hook: 03-rewrite-python-shebang ...
find: ‘/destdir//virtualshield-1.0’: No such file or directory
=> virtualshield-1.0_1: running pre-pkg hook: 04-generate-runtime-deps ...
/void-packages/common/hooks/pre-pkg/04-generate-runtime-deps.sh: line 37: /destdir//virtualshield-1.0/rdeps: No such file or directory
/void-packages/common/hooks/pre-pkg/04-generate-runtime-deps.sh: line 44: /destdir//virtualshield-1.0/rdeps: No such file or directory
/void-packages/common/hooks/pre-pkg/04-generate-runtime-deps.sh: line 44: /destdir//virtualshield-1.0/rdeps: No such file or directory
/void-packages/common/hooks/pre-pkg/04-generate-runtime-deps.sh: line 44: /destdir//virtualshield-1.0/rdeps: No such file or directory
/void-packages/common/hooks/pre-pkg/04-generate-runtime-deps.sh: line 44: /destdir//virtualshield-1.0/rdeps: No such file or directory
/void-packages/common/hooks/pre-pkg/04-generate-runtime-deps.sh: line 44: /destdir//virtualshield-1.0/rdeps: No such file or directory
=> virtualshield-1.0_1: running pre-pkg hook: 05-prepare-32bit ...
=> virtualshield-1.0_1: running pre-pkg hook: 06-shlib-provides ...
=> virtualshield-1.0_1: running pre-pkg hook: 90-set-timestamps ...
=> virtualshield-1.0_1: setting mtimes to Sun Jul  8 12:34:30 EDT 2018
find: ‘/destdir//virtualshield-1.0’: No such file or directory
touch: missing file operand
Try 'touch --help' for more information.
=> ERROR: virtualshield-1.0_1: pre-pkg_90-set-timestamps: 'xargs -0 touch -h --date "@$SOURCE_DATE_EPOCH"' exited with 123
=> ERROR:   in hook() at common/hooks/pre-pkg/90-set-timestamps.sh:8
=> ERROR:   in run_func() at common/xbps-src/shutils/common.sh:21
=> ERROR:   in run_pkg_hooks() at common/xbps-src/shutils/common.sh:251
=> ERROR:   in main() at common/xbps-src/libexec/xbps-src-prepkg.sh:47

(maxice8 alter) #2

https://github.com/void-linux/void-packages/blob/master/Manual.md contains the info necessary


(karl-k) #3

Still I am unsure of what I am doing wrong… I spent all last night reading over this Manual.md but am still getting this error about set-timestamps… I see nothing about timestamps in the manual.md either. I read that vinstall means I do not have to use {FILESDIR} and such, that helps, but still this same error comes up…


(maxice8 alter) #4

Ok, get ready.

  1. You’re using vinstall wrong, the manual states

vinstall

so vinstall VirtualShield.exe 666 usr/share/virtualshield

  1. FILESDIR point to the files directory of the sourcepkg (srcpkgs/<pkgname>/files) we use that to store files that will be installed but are not provided in the tarball, like runit service definitions.

  2. You don’t need to set wrksrc= to ${pkgname}-${version} since that is the default

  3. Your maintainer= variable needs 'nickname ’ , have a reachable email, no github.noreply stuff.

  4. There is only one hashtag at the header ‘Template file […]’ , the Maintainer: line and the blank line are unnecessary

  5. license should be the name of the license, not a link to it.

  6. the last vinstall is plain wrong, you use vsv to install a runit service definition into /etc/sv, that run isn’t even a service definition

  7. never install to /usr/local, that is outside the purview of the package manager, install to /usr

  8. Not sure why you’re mirroring it in your github, isn’t there an upstream source available ?


(karl-k) #5

It is mirrored to my github because I am helping virtualshield package their app for Linux, I have already successfully created a PKGBUILD on the AUR, having it mirrored to github allows me to add in extra things like the run script… and we cannot install to /usr/local? I guess I will have to change some things then but that should be no big deal…

and thank you very much for the detailed reply, I will apply the fixes you have suggested.

And for license, should I just put “EULA” ? I am sorry, this is all new to me, I have tried asking about it but virtualshield dev team takes forever to reply - I am still waiting on this answer…


(karl-k) #6

I have applied the fixes you have suggested but still I get this error… I don’t understand where this error is coming from… I have tried changing many other things around but this same error still appears…

Is this something to do with the MUSL builder failing to connect? I don’t know what is causing this error…
No matter what I change I still get same error… I have taken a look at other templates but have not found one that is specifically only for installing already-made files, I have no idea what I am doing wrong… I would greatly appreciate anyone telling me what I am doing wrong that is causing this error…

# Template file for 'virtualshield'
pkgname=virtualshield
version=1.0
revision=1
build_style=vinstall
depends="mono mono-basic wine-mono openvpn gtk-sharp2"
short_desc="You have the right to remain private! VirtualShield VPN"
maintainer="karl-k <kk199469@gmail.com>"
license="EULA"
homepage="https://virtualshield.com"
distfiles="https://github.com/karl-k/${pkgname}/archive/${version}.tar.gz"
checksum="180cdd7be16b93cef565b369145d87879fdb6d7197a652f1f2d8984696ef2655"

do_install() {


        vinstall "VirtualShield.exe" 666 usr/share/virtualshield/VirtualShield.exe
        vinstall "VirtualShieldSvc.exe" 666 usr/share/virtualshield/VirtualShieldSvc.exe
        vinstall "virtualshield.desktop" 666 usr/share/applications/VirtualShield.desktop
        vinstall "nautilus-actions.conf" 666 usr/share/virtualshield/nautilus-actions.conf
        vinstall "AppIcon.png" 666 usr/share/virtualshield/AppIcon.png
        vinstall "VirtualShieldSetup.exe" 666 usr/share/virtualshield/VirtualShieldSetup.exe
        vinstall "virtualshield.deb" 666 usr/share/virtualshield/virtualshield.deb
        vinstall "c5c988bb-fa14-487d-b7bf-2ccb8c2eec4d.desktop" 666 usr/share/virtualshield/c5c988bb-fa14-487d-b7bf-2ccb8c2eec4d.desktop
        vinstall "VirtualShield-bin" 755 usr/bin/VirtualShield
        vsv "run" 755 etc/sv/


}

Still I am getting this error…

find: ‘/destdir//virtualshield-1.0’: No such file or directory
=> virtualshield-1.0_1: running pre-pkg hook: 04-generate-runtime-deps ...
/void-packages/common/hooks/pre-pkg/04-generate-runtime-deps.sh: line 37: /destdir//virtualshield-1.0/rdeps: No such file or directory
/void-packages/common/hooks/pre-pkg/04-generate-runtime-deps.sh: line 44: /destdir//virtualshield-1.0/rdeps: No such file or directory
/void-packages/common/hooks/pre-pkg/04-generate-runtime-deps.sh: line 44: /destdir//virtualshield-1.0/rdeps: No such file or directory
/void-packages/common/hooks/pre-pkg/04-generate-runtime-deps.sh: line 44: /destdir//virtualshield-1.0/rdeps: No such file or directory
/void-packages/common/hooks/pre-pkg/04-generate-runtime-deps.sh: line 44: /destdir//virtualshield-1.0/rdeps: No such file or directory
/void-packages/common/hooks/pre-pkg/04-generate-runtime-deps.sh: line 44: /destdir//virtualshield-1.0/rdeps: No such file or directory
=> virtualshield-1.0_1: running pre-pkg hook: 05-prepare-32bit ...
=> virtualshield-1.0_1: running pre-pkg hook: 06-shlib-provides ...
=> virtualshield-1.0_1: running pre-pkg hook: 90-set-timestamps ...
=> virtualshield-1.0_1: setting mtimes to Sun Jul  8 19:17:27 EDT 2018
find: ‘/destdir//virtualshield-1.0’: No such file or directory
touch: missing file operand
Try 'touch --help' for more information.
=> ERROR: virtualshield-1.0_1: pre-pkg_90-set-timestamps: 'xargs -0 touch -h --date "@$SOURCE_DATE_EPOCH"' exited with 123
=> ERROR:   in hook() at common/hooks/pre-pkg/90-set-timestamps.sh:8
=> ERROR:   in run_func() at common/xbps-src/shutils/common.sh:21
=> ERROR:   in run_pkg_hooks() at common/xbps-src/shutils/common.sh:251
=> ERROR:   in main() at common/xbps-src/libexec/xbps-src-prepkg.sh:47

(karl-k) #7

I did not know about ./xbps-src clean , something so simple caused me such problems! Sorry this is first time I’ve ever tried making a template. It will now successfully build :smiley:

this is not the final draft & I am not submitting it yet, I am going to take care of getting the repository made official first, as well as some other changes, this is just a rough draft. thank you to north1 and the guys on IRC.

# Template file for 'virtualshield'
pkgname=virtualshield
version=1.0
revision=1
_release=1
wrksrc=${pkgname}-${version}
depends="mono mono-basic wine-mono openvpn gtk-sharp2"
short_desc="You have the right to remain private! VirtualShield VPN"
maintainer="karl-k <kk199469@gmail.com>"
license="Proprietary"
homepage="https://virtualshield.com"
restricted=yes
distfiles="https://github.com/karl-k/${pkgname}/archive/${version}.tar.gz"
checksum="180cdd7be16b93cef565b369145d87879fdb6d7197a652f1f2d8984696ef2655"

do_install() {

mv VirtualShield-bin VirtualShield

	vinstall VirtualShield.exe 666 usr/share/virtualshield/
	vinstall VirtualShieldSvc.exe 666 usr/share/virtualshield/
	vinstall virtualshield.desktop 666 usr/share/applications/
	vinstall nautilus-actions.conf 666 usr/share/virtualshield/
	vinstall AppIcon.png 666 usr/share/virtualshield/
	vinstall VirtualShieldSetup.exe 666 usr/share/virtualshield/
	vinstall virtualshield.deb 666 usr/share/virtualshield/
	vinstall c5c988bb-fa14-487d-b7bf-2ccb8c2eec4d.desktop 666 usr/share/virtualshield/
	vinstall VirtualShield 755 usr/bin/
	vinstall run 755 etc/sv/VirtualShield
}

(Erin) #13

Handbags safely stowed and back on-topic; Is the license actually “Proprietary”? You may wish to check if it is redistributable and check with the admins about any limits/restrictions on the software and/or template.