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 80 81 82 83 84 85 86
|
manfiles5 = sysusers.d.5
manfiles8 = systemd-sysusers.8 systemd-sysusers.service.8
docfiles = UIDS-GIDS.html USER_NAMES.html
xsltargs = --nonet \
--xinclude \
--maxdepth 9000 \
--stringparam man.output.quietly 1 \
--stringparam funcsysnopsis.style ansi \
--stringparam man.authors.section.enabled 0 \
--stringparam man.copyright.section.enabled 0 \
--stringparam systemd.version 238.51
all: man
ifeq ($(HAVEDOC),yes)
all: doc
endif
man:
xsltproc $(xsltargs) custom-man.xsl systemd-sysusers.xml
xsltproc $(xsltargs) custom-man.xsl sysusers.d.xml
doc:
if command -v cmark-gfm; then \
md='cmark-gfm --extension table'; \
elif command -v cmark; then \
md='cmark'; \
else \
md='markdown'; \
fi; \
$$md UIDS-GIDS.md > UIDS-GIDS.html; \
$$md USER_NAMES.md > USER_NAMES.html
# Delete files because wget can't overwrite them
download-docs:
rm -f *.xml *.xsl
if command -v wget; then \
download='wget'; \
elif command -v curl; then \
download='curl --location --remote-name-all'; \
elif command -v fetch; then \
download='fetch'; \
fi; \
$$download \
'https://github.com/systemd/systemd/raw/main/man/custom-html.xsl' \
'https://github.com/systemd/systemd/raw/main/man/custom-man.xsl' \
'https://github.com/systemd/systemd/raw/main/man/standard-options.xml' \
'https://github.com/systemd/systemd/raw/main/man/standard-specifiers.xml' \
'https://github.com/systemd/systemd/raw/main/man/systemd-sysusers.xml' \
'https://github.com/systemd/systemd/raw/main/man/sysusers.d.xml' \
'https://github.com/systemd/systemd/raw/main/docs/UIDS-GIDS.md' \
'https://github.com/systemd/systemd/raw/main/docs/USER_NAMES.md'
clean:
rm -f $(manfiles5)
rm -f $(manfiles8)
rm -f $(docfiles)
install-man:
$(INSTALL) -d $(DESTDIR)$(MANDIR)/man5 $(DESTDIR)$(MANDIR)/man8
$(INSTALL) -m $(DOCMODE) $(manfiles5) $(DESTDIR)$(MANDIR)/man5
$(INSTALL) -m $(DOCMODE) $(manfiles8) $(DESTDIR)$(MANDIR)/man8
install-doc:
$(INSTALL) -d $(DESTDIR)$(DOCDIR)
$(INSTALL) -m $(DOCMODE) $(docfiles) $(DESTDIR)$(DOCDIR)
install: install-man
ifeq ($(HAVEDOC),yes)
install: install-doc
endif
uninstall-man:
for man in ${manfiles5}; do rm -f $(DESTDIR)$(MANDIR)/man5/$$man; done
for man in ${manfiles8}; do rm -f $(DESTDIR)$(MANDIR)/man8/$$man; done
uninstall-doc:
for doc in ${docfiles}; do rm -f $(DESTDIR)$(DOCDIR)/$$doc; done
rm -rf --one-file-system $(DESTDIR)$(DOCDIR)
uninstall: uninstall-man
ifeq ($(HAVEDOC),yes)
uninstall: uninstall-doc
endif
.PHONY: all man doc download-docs clean install install-man install-doc uninstall-man uninstall-doc uninstall
|