makepkg: remove VCS package support
[pacman-ng.git] / doc / Makefile.am
blobbcb05b74a8aa2ba8f4105829e36883c31a80af38
1 # We have to do some funny stuff here with the manpages. In order to ensure
2 # a dist tarball doesn't get put out there without manpages, we keep those
3 # files listed in EXTRA_DIST no matter what. However, we only add them to
4 # man_MANS if --enable-asciidoc and/or --enable-doxygen are used.
6 ASCIIDOC_MANS = \
7         pacman.8 \
8         makepkg.8 \
9         repo-add.8 \
10         vercmp.8 \
11         pkgdelta.8 \
12         pacman-key.8 \
13         pactree.8 \
14         PKGBUILD.5 \
15         makepkg.conf.5 \
16         pacman.conf.5 \
17         libalpm.3
19 DOXYGEN_MANS = $(wildcard man3/*.3)
21 HTML_MANPAGES = \
22         pacman.8.html \
23         makepkg.8.html \
24         repo-add.8.html \
25         vercmp.8.html \
26         pkgdelta.8.html \
27         pacman-key.8.html \
28         pactree.8.html \
29         PKGBUILD.5.html \
30         makepkg.conf.5.html \
31         pacman.conf.5.html \
32         libalpm.3.html
34 HTML_OTHER = \
35         index.html \
36         submitting-patches.html \
37         translation-help.html \
38         HACKING.html
40 HTML_DOCS = \
41         $(HTML_MANPAGES) \
42         $(HTML_OTHER)
44 EXTRA_DIST = \
45         asciidoc.conf \
46         asciidoc-override.css \
47         pacman.8.txt \
48         makepkg.8.txt \
49         repo-add.8.txt \
50         vercmp.8.txt \
51         pkgdelta.8.txt \
52         pacman-key.8.txt \
53         pactree.8.txt \
54         PKGBUILD.5.txt \
55         PKGBUILD-example.txt \
56         makepkg.conf.5.txt \
57         pacman.conf.5.txt \
58         libalpm.3.txt \
59         footer.txt \
60         index.txt \
61         submitting-patches.txt \
62         translation-help.txt \
63         Doxyfile \
64         $(ASCIIDOC_MANS) \
65         $(DOXYGEN_MANS)
67 # Files that should be removed, but which Automake does not know.
68 MOSTLYCLEANFILES = *.xml $(ASCIIDOC_MANS) $(HTML_DOCS) repo-remove.8 website.tar.gz
70 # Ensure manpages are fresh when building a dist tarball
71 dist-hook:
72         $(MAKE) $(AM_MAKEFLAGS) clean
73         $(MAKE) $(AM_MAKEFLAGS) all
75 if USE_GIT_VERSION
76 GIT_VERSION := $(shell sh -c 'git describe --abbrev=4 --dirty | sed s/^v//')
77 REAL_PACKAGE_VERSION = $(GIT_VERSION)
78 else
79 REAL_PACKAGE_VERSION = $(PACKAGE_VERSION)
80 endif
82 man_MANS =
83 dist_man_MANS = $(ASCIIDOC_MANS)
85 if USE_DOXYGEN
86 man_MANS += $(DOXYGEN_MANS)
88 all-local: doxygen.in
90 doxygen.in:
91         $(DOXYGEN) $(srcdir)/Doxyfile
92 endif
94 html: $(HTML_DOCS)
96 website: website.tar.gz
98 .PHONY: html website
100 website.tar.gz: html
101         $(AM_V_GEN)bsdtar czf $@ $(HTML_DOCS) \
102                 asciidoc-override.css \
103                 -C /etc/asciidoc/stylesheets/ \
104                 asciidoc.css \
105                 -C /etc/asciidoc/javascripts/ \
106                 asciidoc.js \
107                 -C /etc/asciidoc/ \
108                 images
110 pkgdatadir = ${datadir}/${PACKAGE}
112 ASCIIDOC_OPTS = \
113         -f $(srcdir)/asciidoc.conf \
114         -a pacman_version="$(REAL_PACKAGE_VERSION)" \
115         -a pacman_date="`date +%Y-%m-%d`" \
116         -a pkgdatadir=$(pkgdatadir) \
117         -a localstatedir=$(localstatedir) \
118         -a sysconfdir=$(sysconfdir)
120 A2X_OPTS = \
121         --no-xmllint \
122         -d manpage \
123         -f manpage \
124         --xsltproc-opts='-param man.endnotes.list.enabled 0 -param man.endnotes.are.numbered 0' \
125         --destination-dir='./'
127 # These rules are due to the includes and files of the asciidoc text
128 $(ASCIIDOC_MANS): asciidoc.conf footer.txt Makefile.am
129         $(AM_V_GEN)a2x $(A2X_OPTS) --asciidoc-opts="$(ASCIIDOC_OPTS) --out-file=./$@.xml" $(srcdir)/$@.txt
131 %.html: %.txt
132         $(AM_V_GEN)asciidoc $(ASCIIDOC_OPTS) -o - $*.txt | \
133                 sed -e 's/\r$$//' > $@
135 HACKING.html: ../HACKING
136         $(AM_V_GEN)asciidoc $(ASCIIDOC_OPTS) -o - ../HACKING | \
137                 sed -e 's/\r$$//' > $@
139 # Customizations for certain HTML docs
140 $(HTML_MANPAGES): asciidoc.conf footer.txt Makefile.am
141 $(HTML_OTHER): asciidoc.conf Makefile.am
142 %.html: ASCIIDOC_OPTS += -a linkcss -a toc -a icons -a max-width=960px -a stylesheet=asciidoc-override.css
143 %.8.html: ASCIIDOC_OPTS += -d manpage
144 %.5.html: ASCIIDOC_OPTS += -d manpage
145 %.3.html: ASCIIDOC_OPTS += -d manpage
147 # Dependency rules
148 pacman.8 pacman.8.html: pacman.8.txt
149 makepkg.8 makepkg.8.html: makepkg.8.txt
150 repo-add.8 repo-add.8.html: repo-add.8.txt
151 vercmp.8 vercmp.8.html: vercmp.8.txt
152 pkgdelta.8 pkgdelta.8.html: pkgdelta.8.txt
153 pacman-key.8 pacman-key.8.html: pacman-key.8.txt
154 pactree.8 pactree.8.html: pactree.8.txt
155 PKGBUILD.5 PKGBUILD.5.html: PKGBUILD.5.txt PKGBUILD-example.txt
156 makepkg.conf.5 makepkg.conf.5.html: makepkg.conf.5.txt
157 pacman.conf.5 pacman.conf.5.html: pacman.conf.5.txt
158 libalpm.3 libalpm.3.html: libalpm.3.txt
159 # this one is just a symlink
160 repo-remove.8: repo-add.8
161         $(RM) repo-remove.8
162         $(LN_S) repo-add.8 repo-remove.8
164 install-data-hook:
165         cd $(DESTDIR)$(mandir)/man8 && \
166                 $(RM) repo-remove.8 && \
167                 ( $(LN_S) repo-add.8 repo-remove.8 || \
168                 ln repo-add.8 repo-remove.8 || \
169                 cp repo-add.8 repo-remove.8 )
171 uninstall-hook:
172         $(RM) $(DESTDIR)$(mandir)/man8/repo-remove.8
174 # vim:set ts=2 sw=2 noet: