summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 3428cbcfe35321b1b7cf2cbdfd25117d6820b270 (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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# Maintainer: bemxio <bemxiov@protonmail.com>

pkgname="anituner"
pkgdesc="Create, edit and convert Windows animated cursors"

pkgver=2.0.0
pkgrel=1

arch=(i686 x86_64)

url="https://www.gdgsoft.com/anituner"
license=("freeware")

depends=(wine)
makedepends=(unzip gendesk icoutils)

provides=(anituner)

source=("https://download.gdgsoft.com/anitun2p.zip")
md5sums=("f0cff36790da5e3f9b02a65aa4d64101")

prepare() {
	# make a temporary directory for generated files
	mkdir -p ${startdir}/tmp

	# move into the temporary directory
	cd ${startdir}/tmp

	# extract the icon out of the executable
	wrestool -x -t14 ${srcdir}/AniTuner.exe --output AniTuner.ico

	# get the highest quality PNG from the icon file
	icotool -x AniTuner.ico -i 6 --output AniTuner.png

	# generate a .desktop file
	gendesk -f -n \
		--pkgname AniTuner \
		--pkgdesc "$pkgdesc" \
		--exec anituner \
		--icon AniTuner.png \
		--categories "Graphics;Utility" \
		--mimetypes "image/bmp;image/jpeg;image/png;image/gif;image/vnd.adobe.photoshop;image/x-icon;image/x-win-bitmap;application/x-navi-animation;application/anituner-atd"
}

package() {
	# rename the default configuration file
	mv ${srcdir}/AniTunerPref.xml ${srcdir}/AniTunerPrefDefault.xml

	# make the required directories
	mkdir -p ${pkgdir}/usr/share/anituner
	mkdir -p ${pkgdir}/usr/bin

	mkdir -p ${pkgdir}/usr/share/applications
	mkdir -p ${pkgdir}/usr/share/pixmaps
	mkdir -p ${pkgdir}/usr/share/mime/packages

	# copy all of AniTuner's files
	cp -r ${srcdir}/* ${pkgdir}/usr/share/anituner

	# remove the symlink to the ZIP from the package files
	rm -f ${pkgdir}/usr/share/anituner/anitun2p.zip

	# copy the script
	cp -r ${startdir}/anituner ${pkgdir}/usr/bin

	# copy the extracted icon and the generated .desktop file
	cp -r ${startdir}/tmp/AniTuner.png ${pkgdir}/usr/share/pixmaps
	cp -r ${startdir}/tmp/AniTuner.desktop ${pkgdir}/usr/share/applications

	# copy the custom MIME type
	cp -r ${startdir}/anituner-atd.xml ${pkgdir}/usr/share/mime/packages
}