Makefile revision 13654
fd0cb187615695ddc84ec25c88710c6c4e7cf096Evan Hunt# Makefile for generateing man page tarballs that are used in each of the
fd0cb187615695ddc84ec25c88710c6c4e7cf096Evan Hunt# SUNW*.spec files
d7be2b79ed0934483d550e17e2bd09de4eaff8f5Evan Hunt# Generates : $(PACKAGE)-manpages-$(MANPAGE_VERSION).tar.gz
d7be2b79ed0934483d550e17e2bd09de4eaff8f5Evan Hunt# e.g. sun-manpage-tarballs/*.tar.gz
1c1879b7efe32e6fe95de0ba923249925e3a320cEvan Hunt# "make" : Rebuilds all man page tarballs
7f2a245b96f3fb2fd7c644316c426b1edaa57984Evan Hunt# "make check-used" : Outputs list of man pages not being used.
77b8f02d19efea79c34f0d4afcefc7ad65de8000Evan Hunt# "make check-version" : Prints current man page tarball version
77b8f02d19efea79c34f0d4afcefc7ad65de8000Evan Hunt# "make $(PACKAGE)-manpages-$(MANPAGE_VERSION).tar.gz
0c25a44aac24a452a41240c45d35320ce054427dEvan Hunt# will only generate SUNWgnome-panel's man page tarball
8281fd83da005cdb114a4c784c847a7eec4bdc38Evan Hunt# For each package that contains man pages.
8281fd83da005cdb114a4c784c847a7eec4bdc38Evan Hunt# - Ensure all relevant man pages for your package are located under the
8281fd83da005cdb114a4c784c847a7eec4bdc38Evan Hunt# correct man page section dir i.e.
146057d7e755d646283adfe5d813f756b0538095Mark Andrews# - Add Package name to PACKAGES Variable
146057d7e755d646283adfe5d813f756b0538095Mark Andrews# e.g. PACKAGES = \
fe3472c80b76b6fed0ae674fd63471d02477a03aMark Andrews# SUNWgnome-panel \
fe3472c80b76b6fed0ae674fd63471d02477a03aMark Andrews# SUNWyour-package
3975f627fe9c0d3aa02ed135070e3253357daad9Mark Andrews# - Add two package specific variables
3975f627fe9c0d3aa02ed135070e3253357daad9Mark Andrews# PACKAGE_PAGES - Full path of all manpages for this package
e2271ee953be1f0cde0cdebfdf498f81ea901d09Evan Hunt# e.g. SUNWgnome-panel_PAGES = man1/gnome-panel.1 etc...
e2271ee953be1f0cde0cdebfdf498f81ea901d09Evan Hunt# PACKAGE.PAGES - Assigned to $(PACKAGE_PAGES).
5caf26b168332b69c9071aac6b72ef0f50436a14Evan Hunt# e.g. SUNWgnome-panel.PAGES: $(SUNWgnome-panel_PAGES)
5caf26b168332b69c9071aac6b72ef0f50436a14Evan Hunt# To Add new man pages to existing packages
36e97eb661df71069df2d75f5fd3b5bb0dcf1efeMark Andrews# -----------------------------------------
36e97eb661df71069df2d75f5fd3b5bb0dcf1efeMark Andrews# Put very simply, all that is required from engineers is to make some changes
62a348b15dd552e12bfbe94111e14072f1c8f02eMark Andrews# and commit in SVN.
7b4b6f361b2fb2291c2019b377a9c0c8e80cfd6bMark Andrews# - Ensure the man page exists in SVN under the relevant man page section sub
9c03f13e18c1b0c32f62391a17300378605bbc7bEvan Hunt# - Add man page to the SUNW<package>_PAGES Makefile variable
9c03f13e18c1b0c32f62391a17300378605bbc7bEvan Hunt# e.g. For a new gnome-panel man page it would be added to
9c03f13e18c1b0c32f62391a17300378605bbc7bEvan Hunt# SUNWgnome-panel_PAGES
9c03f13e18c1b0c32f62391a17300378605bbc7bEvan Hunt# - Remake tarballs
9c03f13e18c1b0c32f62391a17300378605bbc7bEvan Hunt# This will re-generate all man page tarballs.
9c03f13e18c1b0c32f62391a17300378605bbc7bEvan Hunt# - Copy newly generated tarball from sun-manpage-tarballs to package build
9c03f13e18c1b0c32f62391a17300378605bbc7bEvan Hunt# sources e.g. /jds/packages/SOURCES, and ensure package builds and manpages
9c03f13e18c1b0c32f62391a17300378605bbc7bEvan Hunt# install correctly.
c4352fb17ebb1cf29ccabdf1c4273a86f035f38bMark Andrews# - New man page tarball will be generated by RE for each nightly, and for each
cd22c3e4e4ff8ad6eb399155bd8df9330aa39547Mark Andrews# milestone build.
cd22c3e4e4ff8ad6eb399155bd8df9330aa39547Mark Andrews# - Commit change back to subverison, e.g. new/amended man pagees,
0148654d85b2818f9317b428a67701f4585c8243Scott Mann# Solaris/manpages/Makefile, Solaris/S*.spec files if affected.
b91b288f923d143292af3ac35df6f6cff50647f2Scott Mann# MANPAGE_VERSION is maintained by RE and only gets bumped when spec-files gets
b91b288f923d143292af3ac35df6f6cff50647f2Scott Mann# branched. PLEASE do not change this.
6b95b91c617a3e56aff611772744af32b5410e1fEvan HuntSUNWdbus-bindings.PAGES: $(SUNWdbus-bindings_PAGES)
fbe2cff19f5cddc67b967764ad95038dfcafc85aEvan HuntSUNWevolution-exchange.PAGES: $(SUNWevolution-exchange_PAGES)
eee7f742eab409723902e229b840dcdbc9a512f5Evan HuntSUNWevolution-data-server.PAGES: $(SUNWevolution-data-server_PAGES)
bfe32d08c51a606744bd0d6ea518eb95084d2eefEvan HuntSUNWgnome-a11y-dasher.PAGES: $(SUNWgnome-a11y-dasher_PAGES)
c0984ac8bdb9ab8812374651bbabcfeb5873eb38Mark AndrewsSUNWgnome-a11y-gok.PAGES: $(SUNWgnome-a11y-gok_PAGES)
7609e973f517387352a5e98b1b9c368bfb769b09Mark AndrewsSUNWgnome-a11y-libs.PAGES: $(SUNWgnome-a11y-libs_PAGES)
de7df3e56fe99c33a415674b018aae93eee94750Evan HuntSUNWgnome-a11y-reader.PAGES: $(SUNWgnome-a11y-reader_PAGES)
ac21f918f23ce95fd5be807428ee9e2c42319878Evan HuntSUNWgnome-a11y-poke.PAGES: $(SUNWgnome-a11y-poke_PAGES)
ac21f918f23ce95fd5be807428ee9e2c42319878Evan HuntSUNWgnome-archive-mgr.PAGES: $(SUNWgnome-archive-mgr_PAGES)
9cf04a12ec5ea0ee64338feef76e885980a524dfMark AndrewsSUNWgnome-base-libs.PAGES: $(SUNWgnome-base-libs_PAGES)
30f888cbd416f3bcc60b508c3957ef724af592d6Scott MannSUNWgnome-base-libs-java.PAGES: $(SUNWgnome-base-libs-java_PAGES)
319b8a14881a95996af3a9ba4a20f144eb766b31Evan HuntSUNWgnome-calculator.PAGES: $(SUNWgnome-calculator_PAGES)
4fc55db699529ce60f7f1e12aae40e315831c67fScott MannSUNWgnome-cd-burner.PAGES: $(SUNWgnome-cd-burner_PAGES)
0994d3a21baeedf28cbf7e461b3bd8de5f9a6654Evan HuntSUNWgnome-character-map.PAGES: $(SUNWgnome-character-map_PAGES)
35f1a4fc935ad0f05a23d5a6cfba17f5913fdcc1Evan HuntSUNWgnome-common-devel.PAGES: $(SUNWgnome-common-devel_PAGES)
653cad790b4dc6c1330f634150a8941b75ed761eMark AndrewsSUNWgnome-component.PAGES: $(SUNWgnome-component_PAGES)
e41de66a124e6e564428360c2f76e5f1ae6c6f06Francis DupontSUNWgnome-config-editor.PAGES: $(SUNWgnome-config-editor_PAGES)
cbf59e5887d69fca6fe86a1ee5fcc82dded14babMark AndrewsSUNWgnome-config.PAGES: $(SUNWgnome-config_PAGES)
ed53ec0b06825bcc6ba54e10e0174e2de93e595dMark AndrewsSUNWgnome-crash-report.PAGES: $(SUNWgnome-crash-report_PAGES)
2415f36f79e168a46c59cdedf0d6d3146efa5196Mark AndrewsSUNWgnome-desktop-prefs.PAGES: $(SUNWgnome-desktop-prefs_PAGES)
4f587beb8eb70f198346333bce5b89df3ac5c88eMark AndrewsSUNWgnome-dialog.PAGES: $(SUNWgnome-dialog_PAGES)
422009fe5b15e31e7f5d09212bd1480121a1464eEvan HuntSUNWgnome-display-mgr.PAGES: $(SUNWgnome-display-mgr_PAGES)
215ef83bbed20727813a52ddcdbcd1455856638bMark AndrewsSUNWgnome-file-mgr.PAGES: $(SUNWgnome-file-mgr_PAGES)
fea04b0ffeaa83716937f1728ff6742722cec91aMark AndrewsSUNWgnome-gtksourceview.PAGES: $(SUNWgnome-gtksourceview_PAGES)
c2f051aaaab60dbac4bc754f09d594846d99fb89Evan HuntSUNWgnome-help-viewer.PAGES: $(SUNWgnome-help-viewer_PAGES)
35efe74edbdae034447a5bf73c78d8243e50b0b8Mark AndrewsSUNWgnome-hex-editor.PAGES: $(SUNWgnome-hex-editor_PAGES)
624664e50406f63108ddc7bad47dbac87ac74261Francis DupontSUNWgnome-im-client.PAGES: $(SUNWgnome-im-client_PAGES)
c1ced49662181d2fb2343ed7bde71d170f0d1119Mark AndrewsSUNWgnome-meeting.PAGES: $(SUNWgnome-meeting_PAGES)
ba88bcf08b965f65c07735efa2f675b8cbeb735aMark AndrewsSUNWgnome-img-viewer.PAGES: $(SUNWgnome-img-viewer_PAGES)
2f09e7c3fc25c0e5028593a24531d636845c3e42Mark AndrewsSUNWgnome-media-apps.PAGES: $(SUNWgnome-media-apps_PAGES)
ddd40390be246189f10dc18782914b295befb139Mark AndrewsSUNWgnome-media-player.PAGES: $(SUNWgnome-media-player_PAGES)
699e00089fb1a6eb31d7bd1c96bf973608953159Mark AndrewsSUNWgnome-menu-editor.PAGES: $(SUNWgnome-menu-editor_PAGES)
30aaec21221ca5d8715d1ff1ce92fbdf98bb6652Mark AndrewsSUNWgnome-pdf-viewer.PAGES: $(SUNWgnome-pdf-viewer_PAGES)
aae88005f26209d969328703a09170e8af3faff3Mark AndrewsSUNWgnome-removable-media.PAGES: $(SUNWgnome-removable-media_PAGES)
b1b42b03b774d77ddfd38e5e0a5c0a3ed1944b89Mark AndrewsSUNWgnome-remote-desktop.PAGES: $(SUNWgnome-remote-desktop_PAGES)
74b7355f1ee4a914aa09a6c6493aae64c588b026Mark AndrewsSUNWgnome-session.PAGES: $(SUNWgnome-session_PAGES)
5cfe4bcb0afd71f6bc1cc2dab37a9ad6181c13f9Mark AndrewsSUNWgnome-sys-suspend.PAGES: $(SUNWgnome-sys-suspend_PAGES)
c1ee8bb4ba3e9ab1463403ed685729631de406b1Mark AndrewsSUNWgnome-system-tools.PAGES: $(SUNWgnome-system-tools_PAGES)
63d9e735c402ff883d86b22484742d11623745dbMark AndrewsSUNWgnome-system-monitor.PAGES: $(SUNWgnome-system-monitor_PAGES)
000a8970f840a0c27c5cc404826853c4674362acMark AndrewsSUNWgnome-terminal.PAGES: $(SUNWgnome-terminal_PAGES)
903b3c84e2428160b2921364335363bb33452dabEvan HuntSUNWgnome-text-editor.PAGES: $(SUNWgnome-text-editor_PAGES)
e02c1d738bd326beceabbe4a04692ea0282225edMark AndrewsSUNWgnome-ui-designer.PAGES: $(SUNWgnome-ui-designer_PAGES)
584ad7dedd0928a59830f82d82ae696bf6f4e705Evan HuntSUNWgnome-devhelp.PAGES: $(SUNWgnome-devhelp_PAGES)
71bd858d8ed62672e7c23999dc7c02fd16a55089Evan HuntSUNWgnome-power-manager.PAGES: $(SUNWgnome-manager_PAGES)
71bd858d8ed62672e7c23999dc7c02fd16a55089Evan HuntSUNWprint-monitor.PAGES: $(SUNWprint-monitor_PAGES)
9f9b7f0e8d455b1c88e51ddcefdbf19b472e1ef2Mark AndrewsSUNWxdg-user-dirs-gtk.PAGES: $(SUNWxdg-user-dirs-gtk_PAGES)
e78c2b856b9bfbf713fe805224f345f8e8f84e4aEvan Hunt.SUFFIXES: -manpages-$(MANPAGE_VERSION).tar.gz .PAGES
e78c2b856b9bfbf713fe805224f345f8e8f84e4aEvan HuntTARBALLS = $(TARBALL_DIR)/$(addsuffix -$(MANPAGE_VERSION).tar.bz2, $(PACKAGES))
82f0630bae09598209cc37c1db00ff4356efee27Mark Andrews @test -d $(TARBALL_DIR) || mkdir -p "$(TARBALL_DIR)"
82f0630bae09598209cc37c1db00ff4356efee27Mark Andrews @test -x $(SGML2ROFF) || echo "sgml2roff utility not found"
36fc19f9397ac2469d5432e5eb6ff8774cf60676Mark Andrews @test -x $(GZIP) || echo "gzip utility not found"
c656722ea789f512132d5df9a613bea5717dbe3aMark Andrews $(MAKE) MAKE=\"$(MAKE)\" $$package-manpages-$(MANPAGE_VERSION).tar.gz; \
97664670d0e45ec865da407112fceb892133eaf3Mark Andrews @test -d $(TARBALL_DIR) || mkdir -p "$(TARBALL_DIR)"
c656722ea789f512132d5df9a613bea5717dbe3aMark Andrews @if test -f $(TARBALL_DIR)/$@; then \
b5b934a0bb46aded1552a17473652b5a7f4a3274Evan Hunt @test -d $(MANPAGE_DIR) || mkdir -p "$(MANPAGE_DIR)"
5af195d1dbe4c266a47264111a9293069041209dMark Andrews @echo "Converting manpages for $@"
5af195d1dbe4c266a47264111a9293069041209dMark Andrews @for manpage in $($(subst .PAGES,_PAGES,$<)); do \
5af195d1dbe4c266a47264111a9293069041209dMark Andrews suffix=`expr "$$base_manpage" : '.*\.\([^./]*\)$'`; \
8eb30f8dd3c1170406f4f2307964e4c0994494beEvan Hunt $(SGML2ROFF) $$manpage > $(MANPAGE_DIR)/$$base_manpage; \
8eb30f8dd3c1170406f4f2307964e4c0994494beEvan Hunt idx1 = index($$0, "ARC "); \
d48730a446ffffa8d75462a4abefce030425fa64Mark Andrews idx2 = index($$0, "-->"); \
d48730a446ffffa8d75462a4abefce030425fa64Mark Andrews if (idx1 > 0 && idx2 > 0) { \
d48730a446ffffa8d75462a4abefce030425fa64Mark Andrews print "...\\\" " substr($$0, idx1+6, idx2-(idx1+6)); \
7ffe86618c91097b73cde82fb535180dbd5f8e91Mark Andrews echo $$base_manpage >> $(MANPAGE_DIR)/$$suffix; \
380c874925f684847d9278b909cf511cb5b0289aShawn Routhier @cp Makefile.template $(MANPAGE_DIR)/Makefile
380c874925f684847d9278b909cf511cb5b0289aShawn Routhier mv $(MANPAGE_DIR)/ent $(MANPAGE_DIR)/entities; \
7ffe86618c91097b73cde82fb535180dbd5f8e91Mark Andrews @for mantype in entities 1 1m 3 3tiff 4 5; do \
a27b3757fdd8976ce05e37f391ad9e7ac4638e5dMark Andrews echo "MAN"$$mantype"PAGES = \\" >> $(MANPAGE_DIR)/Makefile; \
a27b3757fdd8976ce05e37f391ad9e7ac4638e5dMark Andrews if (length(saved_page) > 0) \
7ffe86618c91097b73cde82fb535180dbd5f8e91Mark Andrews print " " saved_page " \\"; \
7ffe86618c91097b73cde82fb535180dbd5f8e91Mark Andrews saved_page=$$0; \
c9c2ffe729bf24a7fd0f0a234a4a84e67621d414Mark Andrews print " " saved_page; \
c9c2ffe729bf24a7fd0f0a234a4a84e67621d414Mark Andrews }' $(MANPAGE_DIR)/$$mantype >> $(MANPAGE_DIR)/Makefile; \
7bce3361868c7c00929e0c1b64a45f24a714972fMark Andrews @for mantype in entities 1 1m 3 3tiff 4 5; do \
2015023399657c36e9dcc8b5dc35ce20dfc876f0Mark Andrews echo " install -d \$$(DESTDIR)\$$(MAN"$$mantype"DIR)" >> $(MANPAGE_DIR)/Makefile; \
2015023399657c36e9dcc8b5dc35ce20dfc876f0Mark Andrews echo " for mp in \$$(MAN"$$mantype"PAGES); do \\" >> $(MANPAGE_DIR)/Makefile; \
2015023399657c36e9dcc8b5dc35ce20dfc876f0Mark Andrews echo " install --mode=0644 \$$\$$mp \$$(DESTDIR)\$$(MAN"$$mantype"DIR); \\" >> $(MANPAGE_DIR)/Makefile; \
ed83fa75f5657ab2394a701f7ccc169dd9ef48fcMark Andrews @tarball=`basename "$@" .gz`; echo "Making tarball $$tarball"; \
9eba1cf5e5420aeded5ed380d9942269fbde90f1Mark Andrews $(TAR) -cf $(TARBALL_DIR)/$$tarball $(MANPAGE_DIR); \
506a2177bfafa4321cf1ba27ff4a1d09bac69e14Mark Andrews @test -d check-used-manpages || mkdir -p "check-used-manpages"
082f42dcf2f38509a8c842013548f680a6ad06f3Mark Andrews @test -d check-all-manpages || mkdir -p "check-all-manpages"
c75523bcb30c2b8426ee7cb226d9b429c337325bMark Andrews $(MAKE) MAKE=\"$(MAKE)\" $$package.check-used; \
70ba55161bbecab6b58ad4d2203741e9b57951bcMark Andrews if test -f check-used-manpages/$$base_manpage; then \
70ba55161bbecab6b58ad4d2203741e9b57951bcMark Andrews echo " "$$base_manpage >> unused-manpages.txt; \
3f9f14055b85c2dda341b341de0e65d4639542c5Mark Andrews @if test -f unused-manpages.txt; then \
3f9f14055b85c2dda341b341de0e65d4639542c5Mark Andrews echo "Following Manpages are not being used in any SUNW package :"; \
8fb412590e03dcf9de775dad1eb7acf320b575edMark Andrews echo "All man pages are being used"; \
1b42401954a8770d82a168ae1ac06ce66862fd25Mark Andrews @for manpage in $($(subst .PAGES,_PAGES,$<)); do \