You are not logged in.

#1 2016-06-19 01:09:07

unpoweredcubicle
Member
Registered: 2016-06-19
Posts: 2

Include small files in PKGBUILDs via cat or not?

I encountered many PKGBUILDs in the AUR that had multiple small files added, like a .desktop file or a short script, maybe even a one- or two-liner. Is this common procedure or would it be more elegant to include those files directly in the PKGBUILD via (for example):

# launcher expects to be started from the game directory, so we make a custom launcher script
	cat << EOF > "${srcdir}/${pkgname}"
	#!/bin/sh
	
	cd /opt/${pkgname}
	./start.sh
EOF

Sorry if this is a duplicate, my limited google-fu brought up nothing. I've recently bought a lot of gog games as the sale is currently going on, so I wanted to share the PKGBUILDs I would make. And for that, I want to achive maximum quality.

Offline

#2 2016-06-19 01:42:51

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,442
Website

Re: Include small files in PKGBUILDs via cat or not?

I'm not sure if there is an official guideline on this, but small files like .desktop files are definitely allowed in the AUR with the PKGBUILD.  Personally, I'd much prefer to have them as separate files than as a here-document in the PKGBUILD.  The former seems more orderly and transparent.  It's easier for a user or new maintainer to see just what is packaged and what is going on.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#3 2016-06-19 03:55:44

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,463

Re: Include small files in PKGBUILDs via cat or not?

For me, it depends on the file. A .desktop file, I will include as a file. A really trivial script, I will echo.

Offline

Board footer

Powered by FluxBB