summaryrefslogtreecommitdiff
path: root/mozilla-testing/icecat-i18n/Makefile
blob: 5dd818e629e23d4d5a95f60e8e0af76a81cdbcd6 (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
#!/usr/bin/make -f
# Use this script to update the PKGBUILD's list of langpacks.
# This script depends on:
#  - coreutils
#  - grep
#  - pacman
#  - sed
#  - wget

pkgver=9.0.1

default: PHONY all
all: PHONY PKGBUILD
.PRECIOUS: PKGBUILD

index.html: Makefile
	rm -f $@
	wget http://gnuzilla.gnu.org/download/langpacks/${pkgver}/
langpacks.txt: index.html Makefile
	egrep -o '[^>".]+\.xpi' $< | sort -u | sed 's/\.xpi//' > $@
PKGBUILD: langpacks.txt Makefile
	sed \
	  -e 's/^pkgver=.*/pkgver=$(pkgver)/' \
	  -e "s/_langpacks=.*/_langpacks=(`xargs echo < $<`)/" \
	  -e '/md5sums/,$$d' \
	  $@ > $@.$$$$ && \
	makepkg -g >> $@.$$$$ && \
	mv $@.$$$$ $@

clean: PHONY
	rm -f index.html langpacks.txt *.xpi

.PHONY: PHONY FORCE