-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.am
79 lines (62 loc) · 2.02 KB
/
Makefile.am
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
73
74
75
76
77
78
79
SUBDIRS =
SUBDIRS += src
top_docs = README.md COPYING AUTHORS TODO
deb_examples = debian/control debian/get_deps
EXTRA_DIST =
EXTRA_DIST += $(top_docs)
EXTRA_DIST += $(deb_examples)
EXTRA_DIST += doit.1.include
man1_MANS = doit.1
install-data-local:
$(MKDIR_P) $(DESTDIR)$(docdir)/debian
cp -r $(top_docs:%=$(srcdir)/%) $(DESTDIR)$(docdir)
cp -r $(deb_examples:%=$(srcdir)/%) $(DESTDIR)$(docdir)/debian
uninstall-local:
rm -f $(top_docs:%=$(DESTDIR)$(docdir)/%)
rm -f $(deb_examples:%=$(DESTDIR)$(docdir)/%)
distclean-local:
rm -f $(builddir)/doit.1
doit.1: $(srcdir)/src/doit config.log $(srcdir)/doit.1.include
help2man -o $@ --no-info --include $(srcdir)/doit.1.include $<
# i know this isn't the right way to do this... but it's how i've been
# occasionally making .pkg files to install, now documented/automated
# to make life easier.
DEBREV=1
DEBVERSION=$(PACKAGE_VERSION)-$(DEBREV)
DEBNAME=$(PACKAGE_TARNAME)_$(DEBVERSION)
DEBFILE=$(abs_top_builddir)/$(DEBNAME).deb
DPKGDIR=$(abs_top_builddir)/$(DEBNAME)
DEBDIR=$(DPKGDIR)/DEBIAN
DEBCTRL=$(DEBDIR)/control
DEBSIZE=$(DEBDIR)/.size
DEBARCH=$(DEBDIR)/.arch
DEBDEPS=$(DEBDIR)/.deps
DEBCTRL_DEPS=$(DEBSIZE) $(DEBARCH) $(DEBDEPS)
.PHONY: dpkg
dpkg: $(DEBFILE)
$(DEBFILE): $(DEBCTRL)
rm -f $(DEBCTRL_DEPS)
dpkg-deb --build --root-owner-group $(DPKGDIR)
rm -rf $(DPKGDIR)
$(DPKGDIR):
./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var
$(MAKE) clean
$(MAKE) all
$(MAKE) DESTDIR=$@ install
$(DEBDIR): $(DPKGDIR)
$(MKDIR_P) $@
$(DEBSIZE): $(DEBDIR)
du -s $(DPKGDIR) | awk '{print $$1}' > $@
$(DEBARCH): $(DEBDIR)
dpkg-architecture --query DEB_HOST_ARCH > $@
$(DEBDEPS): $(DEBDIR)
$(srcdir)/debian/get_deps $(DPKGDIR) > $(DEBDIR)/.tmp
awk -F": " '/^pkgs:/ {print $$2}' $(DEBDIR)/.tmp > $@
rm -f $(DEBDIR)/.tmp
$(DEBCTRL): $(DEBCTRL_DEPS)
cat $(srcdir)/debian/control | sed \
-e 's|__version__|$(DEBVERSION)|' \
-e "s|__size__|$$(cat $(DEBDIR)/.size)|" \
-e "s|__arch__|$$(cat $(DEBDIR)/.arch)|" \
-e "s|__deplibs__|$$(cat $(DEBDIR)/.deps)|" \
> $@