39 lines
		
	
	
		
			951 B
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			39 lines
		
	
	
		
			951 B
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
| #/usr/bin/env bash
 | |
| 
 | |
| pkgname="dufs"
 | |
| arch="amd64"
 | |
| pkgver="0.41.0"
 | |
| pkgrel=3
 | |
| pkgdesc="A file server that supports static serving, uploading, searching, accessing control, webdav..."
 | |
| url="https://github.com/sigoden/dufs"
 | |
| maintainer="Leafee98 <me@leafee98.com>"
 | |
| 
 | |
| _arch="x86_64"
 | |
| platform="unknown-linux-musl"
 | |
| 
 | |
| 
 | |
| source=(
 | |
|     "dufs-v${pkgver}-${_arch}-${platform}.tar.gz::https://github.com/sigoden/dufs/releases/download/v${pkgver}/dufs-v${pkgver}-${_arch}-${platform}.tar.gz"
 | |
|     "dufs.service::materials/dufs.service"
 | |
| )
 | |
| 
 | |
| function package {
 | |
|     install -Dm755 "${srcdir}/dufs" "${pkgdir}/usr/bin/dufs"
 | |
|     install -Dm644 "${srcdir}/dufs.service" "${pkgdir}/usr/lib/systemd/system/dufs.service"
 | |
| }
 | |
| 
 | |
| function debian_postinst {
 | |
|     cat << EOF
 | |
| #!/usr/bin/env bash
 | |
| adduser --system --group dufs
 | |
| 
 | |
| mkdir -p /srv/dufs
 | |
| chown dufs:dufs -R /srv/dufs
 | |
| 
 | |
| systemctl daemon-reload
 | |
| if systemctl is-active --quiet dufs.service ; then
 | |
|     systemctl restart dufs.service
 | |
| fi
 | |
| EOF
 | |
| }
 | 
