summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: b75e67b1c41e21e7b3463422b760099cfc7506e1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
pkgname=yltra-flat-icons
pkgver=2.5
pkgrel=2
pkgdesc='A simple flat icon theme, derived from Ultra Flat icons'
arch=('any')
url='https://github.com/kimifetch/yltra-flat-icon-theme'
license=('CCPL:cc-by-nc-sa-4.0')
makedepends=('git')
provides=("${pkgname}")
conflicts=("${pkgname}")
options=(!strip !emptydirs)
source=("git+${url}.git")
md5sums=('SKIP')

package() {
	# Create base directory 
	install -d -m 755 "${pkgdir}"/usr/share/icons

	local _themefolder=$(basename ${url})
	local _themename="Yltra Flat"

	# Copy folders without spaces in the filename
	find "${srcdir}"/$_themefolder -mindepth 1 -prune -type d ! -name .git -print0 | \
		while read -d $'\0' f; do
			f=$(basename "$f")
			cp -r "${srcdir}"/$_themefolder/"$f" "${pkgdir}"/usr/share/icons/${f// /}
		done

	# Fix index.theme with the space-less name main theme
	find "${pkgdir}" -name index.theme -exec sed -i "s/\(Inherits=\)$_themename/\1${_themename// /}/" {} \;

	# Fix files with a space in their filename, it causes gtk-update-icon-cache to fail
	find "${pkgdir}" -name "* *" \( -type f -o -type l \) -print0 | \
		while read -d $'\0' f; do
			if [[ $f == *unity-control-center* ]]; then
				mv "$f" ${f// /-}
			else
				mv "$f" ${f// /}
			fi
		done

	# Volume icons fix
	find "${pkgdir}" -name "audio-volume-*-panel.svg" -print0 | \
		while read -d $'\0' f; do
			ln -fsr  $f ${f/-panel/}
		done

	# Remove non-essential files
	find "${pkgdir}" \( -name CREDITS -o -name "*.txt" \) -exec rm {} \;

	# License
	install -Dm644 "${srcdir}"/$_themefolder/"$_themename"/LICENSE.txt "${pkgdir}"/usr/share/licenses/${pkgname}/LICENSE
	install -m644 "${srcdir}"/$_themefolder/"$_themename"/CREDITS "${pkgdir}"/usr/share/licenses/${pkgname}
}