You are not logged in.

#1 2018-05-29 21:11:11

ReedWood
Member
From: Germany
Registered: 2010-07-12
Posts: 23

Review request: Backup files

Howdy,

can s.o. please give me a quick review if I am doing stuff the right  way with respect to backup configuration files and install files in general.

Thank you in advance.

Best,
Wolfgang

# Maintainer: Wolfgang Mader <Mail address goes here>

pkgname=paperless
pkgver=1.3.0
pkgrel=2
pkgdesc="Scan, index, and archive all of your paper documents"
arch=('any')
url="https://github.com/danielquinn/paperless"
license=('GPL3')
options=(!buildflags)
depends=('python-django' 'python-django-extensions' 'python-django-rest-framework' 'python-django-crispy-forms' 'python-django-filter' 'python-fuzzywuzzy' 'python-pyocr' 'python-gnupg' 'python-pilkit' 'python-dotenv' 'python-dateutil' 'python-magic' 'python-django-flat-responsive' 'python-langdetect' 'tesseract' 'unpaper' 'ghostscript' 'python-dateparser' 'python-pdftotext')
source=("https://github.com/danielquinn/${pkgname}/archive/${pkgver}.tar.gz"
        paperless.conf
        paperless-consumer.service
        paperless-webserver.service)
sha512sums=('f7759a9685206e65fce2b8eb7eebf188136c303e7d6aee543657849e52931c5aa6cdfa8fab820718e72131891f6f7a328b03c7e756cc5151e7b5549bba3dd6ab'
            'eb453491ad689505db8e1f9ca91a292eff0ad6ffaf530ed6c6d9b28131379b29d055bdf2533b8d18f2ad590054b24ccaa7df0880c4d89f66c0fce84473445e40'
            'de3a825b24e310d6d97446cb7d206718eba10d6ab4c63c140a0325fe5e641d422bfdf0e39dc10406c37157ff6d2a45764a4d9c4f1559555e0023aef467d6f137'
            'c148bffd5b7cde4730043955921f9220251abf330c54f20169863edd2acf5d5a59b2c59cdf50fb3e4a09587e813a54ef334c0c96ea55c3b8e419ea032c42ccf3')
backup=("etc/paperless.conf" "usr/lib/systemd/system/paperless-webserver.service" "usr/lib/systemd/system/paperless-consumer.service")
_datadir="/usr/share/webapps/${pkgname}"
_systemddir="/usr/lib/systemd/system/"

package() {
  mkdir -p ${pkgdir}/etc
  install -m644 paperless.conf ${pkgdir}/etc/paperless.conf

  mkdir -p ${pkgdir}/${_systemddir}
  install -m644 paperless-consumer.service ${pkgdir}/${_systemddir} 
  install -m644 paperless-webserver.service ${pkgdir}/${_systemddir} 

  cd ${srcdir}/${pkgname}-${pkgver}
  mkdir -p ${pkgdir}/${_datadir}
  cp -R src ${pkgdir}/${_datadir}
  
  install -m760 -d ${pkgdir}/${_datadir}/data
  install -m760 -d -D ${pkgdir}/${_datadir}/media/documents/originals
  install -m760 -d -D ${pkgdir}/${_datadir}/media/documents/thumbnails
}

Offline

#2 2018-05-29 22:53:54

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: Review request: Backup files

1) You need to quote "${srcdir}" and "${pkgdir}" everywhere, no exceptions. It's not under your control, users could be running makepkg in a path with spaces.

2) systemd services are not backup files, use overrides in /etc/systemd/ or better yet use foo.service.d/ dropin directories (systemctl edit foo.service will even do this automatically for you).

3) Use source=("${pkgname}-${pkgver}.tar.gz::${url}/archive/${pkgver}.tar.gz"
For two reasons. Firstly, IMHO reusing ${url} is nicer, secondly, because downloading a source file named 1.3.0.tar.gz does not play nicely with shared "${SRCDEST}". See the description of "source" in the PKGBUILD(5) manpage.


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#3 2018-05-30 18:09:11

ReedWood
Member
From: Germany
Registered: 2010-07-12
Posts: 23

Re: Review request: Backup files

Great input. Thank you.

Offline

#4 2018-05-30 19:30:58

loqs
Member
Registered: 2014-03-06
Posts: 17,327

Re: Review request: Backup files

options=(!buildflags)

Are you dropping the buildflags because you do not use them or does one of them break something in the PKGBUILD?

Offline

Board footer

Powered by FluxBB