groff-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[groff] 21/46: Fix `mostlyclean', add the `chem' contrib.


From: Bertrand Garrigues
Subject: [groff] 21/46: Fix `mostlyclean', add the `chem' contrib.
Date: Sat, 29 Nov 2014 19:47:32 +0000

bgarrigues pushed a commit to branch automake3
in repository groff.

commit c9a8f735c5567f59fcc41c784209f3a26aa4f777
Author: Bertrand Garrigues <address@hidden>
Date:   Sat Sep 6 13:30:32 2014 +0200

    Fix `mostlyclean', add the `chem' contrib.
    
    * tmac/tmac.am: Fix `mostlyclean' target. In the previous commit, the
      in-source build was not properly tested, and some files of the
      source tree were mistakenly deleted.
    
    * contrib/chem/chem.am: build and installation.
---
 Makefile.am               |   13 ++++-
 TESTS                     |   62 +++++++++++++++-------
 contrib/chem/Makefile.sub |  124 ---------------------------------------------
 contrib/chem/chem.am      |  117 ++++++++++++++++++++++++++++++++++++++++++
 tmac/.gitignore           |    8 +++
 tmac/tmac.am              |    2 +-
 6 files changed, 179 insertions(+), 147 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index d5bb96e..d1d9e4e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -161,7 +161,9 @@ datasubdir=$(dataprogramdir)/$(VERSION)
 # `infodir' says where to install info files.
 
 # docdir
-# `docdir' says where to install documentation files.
+# `docdir' says where to install documentation files.  The default
+# location is ${datarootdir}/doc/${PACKAGE}, but we add the version
+docdir=$(datarootdir)/doc/${PACKAGE}-$(VERSION)
 
 # `exampledir' says where to install example files.
 exampledir=$(docdir)/examples
@@ -525,6 +527,7 @@ AM_YFLAGS = -d -v
 include $(top_srcdir)/lib/gnulib.mk
 include $(top_srcdir)/arch/mingw/mingw.am
 include $(top_srcdir)/arch/misc/misc.am
+include $(top_srcdir)/contrib/chem/chem.am
 include $(top_srcdir)/font/devX100/devX100.am
 include $(top_srcdir)/font/devX100-12/devX100-12.am
 include $(top_srcdir)/font/devX75/devX75.am
@@ -593,7 +596,7 @@ lib/localcharset.$(OBJEXT): lib/configmake.h
 
 # directories specific to groff
 uninstall-hook: uninstall_groffdirs
-uninstall_groffdirs: uninstall_devpdf
+uninstall_groffdirs: uninstall_devpdf uninstall_tmac_hook
        if test -d $(DESTDIR)$(datasubdir); then \
          rm -rf $(DESTDIR)$(fontdir); \
          rm -rf $(DESTDIR)$(oldfontdir); \
@@ -608,6 +611,12 @@ uninstall_groffdirs: uninstall_devpdf
        if test -d $(DESTDIR)$(libprogramdir); then \
          rmdir $(DESTDIR)$(libprogramdir); \
        fi
+       if test -d $(DESTDIR)$(docdir); then \
+         if test -d $(DESTDIR)$(exampledir); then \
+           rmdir $(DESTDIR)$(exampledir); \
+         fi; \
+         rmdir $(DESTDIR)$(docdir); \
+       fi
 
 # Other files that should be present in the distribution tarball.
 EXTRA_DIST += \
diff --git a/TESTS b/TESTS
index 9d6f37e..489fc7c 100644
--- a/TESTS
+++ b/TESTS
@@ -20,6 +20,7 @@ Current status
   - Build font/*
   - man files from 'man' directory installed
   - tmac files from 'tmac' directory installed
+  - Build and installation of contrib/chem
 
 Tests
 -----
@@ -133,6 +134,9 @@ from font: font files in
   - devps
   - devutf8
 
+from contrib/chem:
+  - `chem' script and 3 README files
+
 In order to check and improve the dependencies, the following targets
 were built from a clean environment:
   - make lib/libgnu.a
@@ -170,6 +174,7 @@ were built from a clean environment:
   - make grog
   - make nroff
   - make troff
+  - make chem
 
 2.2 make clean
 
@@ -181,10 +186,6 @@ The following files remain (this is expected):
   - src/include/stamp-h1
   - .deps directories and .dirstamp files
 
-  - .n files, afmtodit are cleaned
-  - shdeps.sed is cleaned
-  - binaries from bin_PROGRAMS are cleaned
-
 2.3 make mostlyclean
 
   Like 'make clean', but the following files also remain (expected):
@@ -260,7 +261,19 @@ Differences with former build system:
     stripped (comments removed) at build time. Checked that they are
     strictly identical to the one install by the original build
     system.
+  
+  - contrib/chem:
+
+    -- chem.pic installed in
+    $(DESTDIR)/usr/local/share/groff/1.22.3/pic/chem.pic
 
+    -- other chem files installed in
+    $(DESTDIR)/usr/local/share/doc/groff-1.22.3/examples, identical to
+    the old build system.
+    
+    -- contrib/chem/README is strangely build but not installed, this
+       is the behaviour on the old build system.
+    
 Diff with previous build system:
   - devcp1047 fonts are installed $(DESTDIR)/usr/local/groff/1.22.3/font
 
@@ -272,23 +285,33 @@ TODO:
   value in tmac/Makefile.sub, I don't quite understand how these
   variables could be set.
 
+  - Add automake conditional for examples, html, and doc in `contrib'.
+
 2.7 make uninstall
 
-  Removes:
-
-  - $(DESTDIR)/usr/local/lib/charset.alias if exists
-  - $(DESTDIR)/usr/local/bin/*
-  - $(DESTDIR)/usr/local/man/man1/*
-  - $(DESTDIR)/usr/local/man/man5/*
-  - $(DESTDIR)/usr/local/share/groff/1.22.3/eign
-  - $(DESTDIR)/usr/local/share/groff/1.22.3/
-  - $(DESTDIR)/usr/local/share/groff/1.22.3/font
-  - $(DESTDIR)/usr/local/share/groff/1.22.3/oldfont
-  - $(DESTDIR)/usr/local/share/groff/1.22.3/tmac
-  - $(DESTDIR)/usr/local/share/groff/
-  - $(DESTDIR)/usr/local/lib/X11/app-defaults/GXditview and
-    GXditview-color. However, GXditview.old and GXditview-color.old
-    are not removed (this is the behaviour on the old build system)
+  - Tree after uninstall:
+.
+└── usr
+    └── local
+        ├── bin
+        ├── lib
+        │   └── X11
+        │       └── app-defaults
+        └── share
+            ├── doc
+            └── man
+                ├── man1
+                ├── man5
+                └── man7
+
+12 directories, 0 files
+
+  - Notes:
+    -- $(DESTDIR)/usr/local/lib/charset.alias is removed if exists
+    -- $(DESTDIR)/usr/local/lib/X11/app-defaults/GXditview and
+    GXditview-color are removed. However, GXditview.old and
+    GXditview-color.old are not removed (this is the behaviour on the
+    old build system)
   
 2.8 make dist
 
@@ -362,4 +385,3 @@ Notes
   - Gnulib: some files of src/libs/libgroff could be replaced by their
     gnulib equivalent
   - Gnulib: git-version-gen could be used
-
diff --git a/contrib/chem/Makefile.sub b/contrib/chem/Makefile.sub
deleted file mode 100644
index b13dc2e..0000000
--- a/contrib/chem/Makefile.sub
+++ /dev/null
@@ -1,124 +0,0 @@
-# Makefile.sub for `chem'
-
-# File position: <groff-source>/contrib/chem/Makefile.sub
-
-# Copyright (C) 2006-2014  Free Software Foundation, Inc.
-# Written by Bernd Warken <address@hidden>.
-
-# This file is part of `chem' which is part of `groff'.
-
-# `groff' is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License (GPL) version 2 as
-# published by the Free Software Foundation.
-
-# `groff' is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-
-# The GPL2 license text is available in the internet at
-# <http://www.gnu.org/licenses/gpl-2.0.html>.
-
-########################################################################
-
-MAN1=chem.n
-MOSTLYCLEANADD=\
-  chem \
-  chem.n \
-  README \
-  examples/README \
-  examples/122/README
-
-RM=rm -f
-
-all: README chem $(MAN1) $(make_examples)
-
-README: $(srcdir)/README.txt
-       sed -e "s|@g@|$(g)|g" $? >$@
-
-.PHONY: examples
-examples: examples/README examples/122/README
-
-examples/README: $(srcdir)/examples/README.txt
-       test -d examples || $(mkinstalldirs) examples;
-       sed -e "s|@g@|$(g)|g" $? >$@
-
-examples/122/README: $(srcdir)/examples/122/README.txt
-       test -d examples || $(mkinstalldirs) examples;
-       test -d examples/122 || $(mkinstalldirs) examples/122;
-       sed -e "s|@g@|$(g)|g" $? >$@;
-
-chem: $(srcdir)/chem.pl $(SH_DEPS_SED_SCRIPT)
-       $(RM) $@;
-       sed -f "$(SH_DEPS_SED_SCRIPT)" \
-           -e "s|@g@|$(g)|g" \
-           -e "s|@BINDIR@|$(DESTDIR)$(bindir)|g" \
-           -e "s|@MACRODIR@|$(DESTDIR)$(tmacdir)|g" \
-           -e "s|@PICDIR@|$(DESTDIR)$(datasubdir)/pic|g" \
-           -e "s|@VERSION@|$(version)$(revision)|g" \
-           -e "$(SH_SCRIPT_SED_CMD)" \
-           $(srcdir)/chem.pl >$@;
-       chmod +x $@;
-
-.PHONY: install_always
-install_always: chem README $(srcdir)/chem.pic
-       test -d $(DESTDIR)$(bindir) || $(mkinstalldirs) $(DESTDIR)$(bindir);
-       $(RM) $(DESTDIR)$(bindir)/$(g)chem;
-       $(INSTALL_SCRIPT) chem $(DESTDIR)$(bindir)/$(g)chem;
-       test -d $(DESTDIR)$(datasubdir)/pic \
-         || $(mkinstalldirs) $(DESTDIR)$(datasubdir)/pic;
-       $(RM) $(DESTDIR)$(datasubdir)/pic/chem.pic;
-       $(INSTALL_DATA) $(srcdir)/chem.pic \
-         $(DESTDIR)$(datasubdir)/pic/chem.pic;
-
-.PHONY: install_examples
-install_examples:
-       test -d $(DESTDIR)$(exampledir)/chem \
-         || $(mkinstalldirs) $(DESTDIR)$(exampledir)/chem;
-       test -d $(DESTDIR)$(exampledir)/chem/122 \
-         || $(mkinstalldirs) $(DESTDIR)$(exampledir)/chem/122;
-       find $(DESTDIR)$(exampledir)/chem -type f -exec rm -f '{}' ';'
-       $(INSTALL_DATA) examples/README $(DESTDIR)$(exampledir)/chem/README;
-       for i in $(srcdir)/examples/*.chem; do \
-         n=`echo $$i | sed 's|$(srcdir)/examples/||g'`; \
-         $(INSTALL_DATA) $$i $(DESTDIR)$(exampledir)/chem/$$n; \
-       done;
-       $(INSTALL_DATA) examples/122/README \
-         $(DESTDIR)$(exampledir)/chem/122/README;
-       for i in $(srcdir)/examples/122/*.chem; do \
-         n=`echo $$i | sed 's|$(srcdir)/examples/122/||g'`; \
-         $(INSTALL_DATA) $$i $(DESTDIR)$(exampledir)/chem/122/$$n; \
-       done
-
-.PHONY: install_data
-
-install_data: install_always $(make_install_examples)
-
-# uninstall_sub: uninstall_always $(make_uninstall_examples)
-
-.PHONY: uninstall_always
-uninstall_always:
-       $(RM) $(DESTDIR)$(bindir)/chem;
-       $(RM) $(DESTDIR)$(datasubdir)/pic/chem.pic;
-       -test -d $(DESTDIR)$(datasubdir)/pic && \
-         rmdir $(DESTDIR)$(datasubdir)/pic;
-
-.PHONY: uninstall_examples
-uninstall_examples:
-       $(RM) $(DESTDIR)$(exampledir)/chem/122/*;
-       -test -d $(DESTDIR)$(exampledir)/chem/122 && \
-         rmdir $(DESTDIR)$(exampledir)/chem/122;
-       $(RM) $(DESTDIR)$(exampledir)/chem/*;
-       -test -d $(DESTDIR)$(exampledir)/chem && \
-         rmdir $(DESTDIR)$(exampledir)/chem;
-
-.PHONY: uninstall_sub
-uninstall_sub: uninstall_always uninstall_examples
-
-########################################################################
-# Emacs settings
-########################################################################
-#
-# Local Variables:
-# mode: makefile
-# End:
diff --git a/contrib/chem/chem.am b/contrib/chem/chem.am
new file mode 100644
index 0000000..5b56494
--- /dev/null
+++ b/contrib/chem/chem.am
@@ -0,0 +1,117 @@
+# Automake rules for `chem'
+
+# File position: <groff-source>/contrib/chem/chem.am
+
+# Copyright (C) 2006-14
+#   Free Software Foundation, Inc.
+# Written by Bernd Warken <address@hidden>.
+# Moved to automake by Bertrand Garrigues
+
+# This file is part of `chem' which is part of `groff'.
+
+# `groff' is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License (GPL) version 2 as
+# published by the Free Software Foundation.
+
+# `groff' is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+
+# The GPL2 license text is available in the internet at
+# <http://www.gnu.org/licenses/gpl-2.0.html>.
+
+########################################################################
+
+chem_srcdir = $(top_srcdir)/contrib/chem
+bin_SCRIPTS += chem
+
+# Files installed in $(datasubdir)/pic
+chempicdir = $(datasubdir)/pic
+dist_chempic_DATA = contrib/chem/chem.pic
+
+
+CHEM_GENEXAMPLES = contrib/chem/examples/README
+CHEM_EXAMPLES =  \
+  contrib/chem/examples/atp.chem \
+  contrib/chem/examples/cholesterin.chem \
+  contrib/chem/examples/ethamivan.chem \
+  contrib/chem/examples/lsd.chem \
+  contrib/chem/examples/morphine.chem \
+  contrib/chem/examples/penicillin.chem \
+  contrib/chem/examples/reserpine.chem
+
+# Files installed in $(exampledir)/chem
+chemexampledir = $(exampledir)/chem
+nodist_chemexample_DATA = $(CHEM_GENEXAMPLES)
+dist_chemexample_DATA = $(CHEM_EXAMPLES)
+
+# Files installed in $(exampledir)/chem/122. All the .chem files in 122 are 
+# lazily installed by the local install target
+chemexample122dir = $(chemexampledir)/122
+nodist_chemexample122_DATA = contrib/chem/examples/122/README
+
+EXTRA_DIST += \
+  contrib/chem/ChangeLog \
+  contrib/chem/chem.man \
+  contrib/chem/chem.pic \
+  contrib/chem/chem.pl \
+  contrib/chem/README.txt \
+  contrib/chem/examples/README.txt \
+  contrib/chem/examples/122/README.txt
+
+man1_MANS += contrib/chem/chem.n
+MOSTLYCLEANFILES += $(CHEM_GENEXAMPLES) $(nodist_chemexample122_DATA) \
+  chem \
+  contrib/chem/README
+
+# This is strangly built but not installed
+all: contrib/chem/README
+
+contrib/chem/README: $(chem_srcdir)/README.txt
+       @$(MKDIR_P) contrib/chem/
+       sed -e "s|address@hidden@]|$(g)|g" $? >$@
+
+contrib/chem/examples/README: $(chem_srcdir)/examples/README.txt
+       @$(MKDIR_P) contrib/chem/examples
+       sed -e "s|address@hidden@]|$(g)|g" $? >$@
+
+contrib/chem/examples/122/README: $(chem_srcdir)/examples/122/README.txt
+       @$(MKDIR_P) contrib/chem/examples/122
+       sed -e "s|address@hidden@]|$(g)|g" $? >$@
+
+chem: $(chem_srcdir)/chem.pl $(SH_DEPS_SED_SCRIPT)
+       $(RM) $@
+       sed -f "$(SH_DEPS_SED_SCRIPT)" \
+           -e "s|address@hidden@]|$(g)|g" \
+           -e "s|address@hidden@]|$(DESTDIR)$(bindir)|g" \
+           -e "s|address@hidden@]|$(DESTDIR)$(tmacdir)|g" \
+           -e "s|address@hidden@]|$(DESTDIR)$(datasubdir)/pic|g" \
+           -e "s|address@hidden@]|$(VERSION)|g" \
+           -e "$(SH_SCRIPT_SED_CMD)" \
+           $(chem_srcdir)/chem.pl >$@
+       chmod +x $@
+
+install-data-local: install_chem_extra
+install_chem_extra:
+       -test -d $(DESTDIR)$(chemexample122dir) \
+          || $(mkinstalldirs) $(DESTDIR)$(chemexample122dir);
+       for i in $(chem_srcdir)/examples/122/*.chem; do \
+         n=`echo $$i | sed 's|$(chem_srcdir)/examples/122/||g'`; \
+         $(INSTALL_DATA) $$i $(DESTDIR)$(chemexample122dir)/$$n; \
+       done
+
+uninstall-local: uninstall_chem_extra
+uninstall_chem_extra:
+       $(RM) $(DESTDIR)$(exampledir)/chem/122/*
+       -rmdir $(DESTDIR)$(exampledir)/chem/122
+       $(RM) $(DESTDIR)$(exampledir)/chem/*
+       -rmdir $(DESTDIR)$(exampledir)/chem
+       -rmdir $(DESTDIR)$(datasubdir)/pic
+
+dist-hook: dist_chem
+dist_chem:
+       chmod u+w $(distdir)/contrib/chem/examples/122
+       for i in $(chem_srcdir)/examples/122/*.chem; do \
+         cp -f $$i $(distdir)/contrib/chem/examples/122; \
+       done
diff --git a/tmac/.gitignore b/tmac/.gitignore
index b760cd5..45d432b 100644
--- a/tmac/.gitignore
+++ b/tmac/.gitignore
@@ -8,3 +8,11 @@ groff_ms.n
 groff_www.n
 groff_trace.n
 stamp-strip
+doc-common
+doc-ditroff
+doc-nroff
+doc-old.tmac
+doc-syms
+doc.tmac
+e.tmac
+www.tmac
diff --git a/tmac/tmac.am b/tmac/tmac.am
index c59746e..04e2e3e 100644
--- a/tmac/tmac.am
+++ b/tmac/tmac.am
@@ -111,7 +111,7 @@ nodist_mdoc_DATA = $(TMACMDOCFILES)
 # Installed in localtmacdir
 dist_localtmac_DATA = tmac/man.local tmac/mdoc.local
 
-MOSTLYCLEANFILES += $(TMACMDOCFILES) $(TMACSPECIALFILES) $(TMACSTRIPFILES) \
+MOSTLYCLEANFILES += $(TMACMDOCFILES) tmac/www.tmac $(TMACSTRIPFILES) \
    tmac/stamp-wrap \
    tmac/*-wrap
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]