]> mj.ucw.cz Git - subauth.git/blobdiff - Makefile
Debian: Re-packaged for Bookworm
[subauth.git] / Makefile
index 830d7ecf5fcdf3449401ddc808be5b829da56314..97e43cea0cef2cd4ec116d47154c244c9be9dcc9 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,3 +1,6 @@
+VERSION=1.0
+YEAR=2018
+
 # The default target
 all: runtree programs configs
 
@@ -14,17 +17,55 @@ ifdef BUILDSYS
 # We will use the libucw build system
 include $(BUILDSYS)/Maketop
 
-EXTRA_RUNDIRS=run
+EXTRA_RUNDIRS=run/subauthd lib/subauthd share/man/man1 share/man/man8
 
 # Add the detected flags to all the global flags
 CFLAGS+=$(LIBUCW_CFLAGS) $(LIBUCW_JSON_CFLAGS)
 LIBS+=$(LIBUCW_LIBS) $(LIBUCW_JSON_LIBS)
 
+install::
+.PHONY: install
+
 include $(s)/server/Makefile
 include $(s)/client/Makefile
 include $(s)/pam/Makefile
 
+ifdef CONFIG_APACHE_MOD
+include $(s)/apache/Makefile
+endif
+
 # And finally the default rules of the build system
 include $(BUILDSYS)/Makebottom
 
+# Our own rules for building man pages. They are a little bit hacky
+# as a2x cannot produce output in a different directory.
+$(o)/%.1: $(s)/%.1.txt
+       $(M)MAN $<
+       $(Q)cp $< $@.txt
+       $(Q)a2x -f manpage $@.txt
+       $(Q)$(call symlink,$@,run/share/man/man1)
+
+$(o)/%.8: $(s)/%.8.txt
+       $(M)MAN $<
+       $(Q)cp $< $@.txt
+       $(Q)a2x -f manpage $@.txt
+       $(Q)$(call symlink,$@,run/share/man/man8)
+
+# The dependency on %.1 is there to serialize both calls of asciidoc,
+# which does not name temporary files safely.
+$(o)/%.1.html: $(s)/%.1.txt $(o)/%.1
+       $(M)HTML $<
+       $(Q)a2x -f xhtml -D $(@D) $<
+$(o)/%.8.html: $(s)/%.8.txt $(o)/%.8
+       $(M)HTML $<
+       $(Q)a2x -f xhtml -D $(@D) $<
+
+release: $(HTML_DOCS)
+       git tag v$(VERSION)
+       git push --tags
+       git archive --format=tar --prefix=subauth-$(VERSION)/ HEAD | gzip >subauth-$(VERSION).tar.gz
+       rsync subauth-$(VERSION).tar.gz atrey:ftp/linux/
+       rsync $(HTML_DOCS) jw:www/static/sw/subauth/
+       ssh jw 'cd web && bin/release-prog subauth $(VERSION)'
+
 endif