summaryrefslogtreecommitdiff
path: root/~lukeshu/android-udev/Makefile
blob: 238877f5a4fdd454fbdfb12d1b987ba2bba09514 (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
# Use this to update the package from AUR.

default: PHONY all
all: PHONY 51-android.rules PKGBUILD 

name=android-udev

aur:
	mkdir $@
aur/%.tar.gz: | aur
	cd aur && wget http://aur.archlinux.org/packages/$*/$*.tar.gz
aur/%: aur/%.tar.gz
	cd aur && tar xzf $(notdir $<)
aur/$(name)/%: aur/$(name).tar.gz | aur/$(name)
	test -f $@ && touch $@

51-android.rules: aur/$(name)/51-android.rules
	sed -r 's/\s+$$//' < $< > $@

PKGBUILD: aur/$(name)/PKGBUILD 51-android.rules
	# Update pkg{ver,rel}
	ver=`grep -m1 pkgver= $<`  ; sed -i "s/pkgver=.*/$$ver/" $@
	rel=`grep -m1 pkgrel= $<`.1; sed -i "s/pkgrel=.*/$$rel/" $@
	# Update md5sums
	sed -i '/md5sums/,$$d' $@
	makepkg -g >> $@

clean: PHONY
	rm -rf aur
maintainerclean: PHONY clean
	rm -f 51-android.rules

.PHONY: PHONY FORCE