diff options
Diffstat (limited to 'makefile')
-rw-r--r-- | makefile | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/makefile b/makefile new file mode 100644 index 0000000..68dd4a8 --- /dev/null +++ b/makefile | |||
@@ -0,0 +1,47 @@ | |||
1 | pkgname = my-x200 | ||
2 | exts := md html confd initd sh deb dsc orig.tar.gz debian.tar.xz | ||
3 | findopts := $(foreach ext,$(exts),-or -iname "*.$(ext)") | ||
4 | pkgver := 0.6 | ||
5 | |||
6 | all: install | ||
7 | |||
8 | clean: | ||
9 | rm -rf .backup | ||
10 | find -iname "*~" | xargs rm -rf | ||
11 | rm -rf $(pkgname)-$(pkgver) | ||
12 | find ./* -type f -iname "makefile" $(findopts) > ls-R | ||
13 | find ./* -type d -iname "debian" >> ls-R | ||
14 | rm -rf etc | ||
15 | rsync -avPr --files-from=ls-R . .backup | ||
16 | rm -rf * | ||
17 | cp -p -r .backup/* . | ||
18 | rm -rf .backup | ||
19 | pandoc -s README.md -o about.html | ||
20 | |||
21 | prepare: | ||
22 | rm -rf $(pkgname)-$(pkgver) | ||
23 | debian/rules clean | ||
24 | rsync -avPr ./ $(pkgname)-$(pkgver) | ||
25 | tar czf $(pkgname)_$(pkgver).orig.tar.gz $(pkgname)-$(pkgver) | ||
26 | |||
27 | debian: prepare | ||
28 | $(MAKE) --directory=$(pkgname)-$(pkgver) debian_package | ||
29 | |||
30 | debian_package: | ||
31 | debuild | ||
32 | |||
33 | install: | ||
34 | install -Dm755 my-x200.initd $(DESTDIR)etc/init.d/my-x200 | ||
35 | install -Dm644 my-x200.confd $(DESTDIR)etc/default/my-x200 | ||
36 | install -Dm644 my-x200-lid.sh $(DESTDIR)etc/acpi/events/my-x200-lid | ||
37 | install -Dm644 my-x200-sleep.sh $(DESTDIR)etc/acpi/events/my-x200-sleep | ||
38 | install -Dm755 my-x200.sh $(DESTDIR)etc/acpi/my-x200.sh | ||
39 | |||
40 | uninstall: | ||
41 | rm -rf $(DESTDIR)etc/init.d/my-x200 | ||
42 | rm -rf $(DESTDIR)etc/default/my-x200 | ||
43 | rm -rf $(DESTDIR)etc/acpi/events/my-x200-lid | ||
44 | rm -rf $(DESTDIR)etc/acpi/events/my-x200-sleep | ||
45 | rm -rf $(DESTDIR)etc/acpi/my-x200.sh | ||
46 | |||
47 | .PHONY: all clean install uninstall prepare debian debian_package | ||