Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFC – doc: Remove generated files and add rules to build manpages #856

Merged
merged 1 commit into from
May 1, 2017

Conversation

stweil
Copy link
Member

@stweil stweil commented Apr 30, 2017

Those files can be built by doc/generate_manpages.sh.

The manpages are needed for the installation,
so add Makefile rules for them.

Git must ignore the generated manpages.

Signed-off-by: Stefan Weil sw@weilnetz.de

Those files can be built by doc/generate_manpages.sh.

The manpages are needed for the installation,
so add Makefile rules for them.

Git must ignore the generated manpages.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
@stweil
Copy link
Member Author

stweil commented Apr 30, 2017

This is a request for comments. The patch removes documentation files which can be easily created if asciidoc is available in the build environment. Man pages are now not built and installed by default. They are build and installed in maintainer mode (./configure --enable-maintainer-mode).

Removing the documentation files which can be built simplifies the maintenance, because it is no longer necessary to update three generated files for a simple documentation update.

@amitdo
Copy link
Collaborator

amitdo commented Apr 30, 2017

I just tried to install the asciidoc package on Debian with Synaptic.
Synaptic lists additional 59 required packages.

@stweil
Copy link
Member Author

stweil commented Apr 30, 2017

Are you sure that those packages are required? On my Debian Stretch, I see 4 required packages (1.4 MB disk space): asciidoc, asciidoc-base, asciidoc-common, libxml2-utils. As long as you don't want to create LaTeX and PDF documents, you can keep the installation pretty small.

@Shreeshrii
Copy link
Collaborator

It may depend on what is already installed on the system. I get the following list:

 sudo apt-get install asciidoc
sudo: unable to resolve host ALL-IN-1-TOUCH
[sudo] password for shree:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
  dblatex docbook-dsssl docbook-utils fonts-lmodern fonts-texgyre jadetex
  latex-beamer latex-xcolor libkpathsea6 libosp5 libostyle1c2 libptexenc1
  libreadline5 libruby1.9.1 libsgmls-perl libsp1c2 lmodern luatex openjade pgf
  preview-latex-style prosper ps2eps ruby ruby1.9.1 sgmlspl sp tcl tcl8.6
  tex-common tex-gyre texlive texlive-base texlive-bibtex-extra
  texlive-binaries texlive-extra-utils texlive-font-utils
  texlive-fonts-recommended texlive-fonts-recommended-doc
  texlive-generic-recommended texlive-latex-base texlive-latex-base-doc
  texlive-latex-extra texlive-latex-extra-doc texlive-latex-recommended
  texlive-latex-recommended-doc texlive-luatex texlive-math-extra
  texlive-pictures texlive-pictures-doc texlive-pstricks texlive-pstricks-doc
  tipa tk tk8.6 xmlto xsltproc
Suggested packages:
  source-highlight vim-addon-manager docbook latex-cjk-all opensp
  texlive-lang-cyrillic texlive-xetex transfig docbook-dsssl-doc sgmls-doc
  doc-base ri ruby-dev ruby1.9.1-examples ri1.9.1 graphviz ruby1.9.1-dev
  tcl-tclreadline perl-tk chktex fragmaster xindy latexdiff lacheck latexmk
  dvidvi purifyeps dvipng t1utils psutils libfile-which-perl python-pygments
  dot2tex libtcltk-ruby xmltex
Recommended packages:
  wish
The following NEW packages will be installed:
  asciidoc dblatex docbook-dsssl docbook-utils fonts-lmodern fonts-texgyre
  jadetex latex-beamer latex-xcolor libkpathsea6 libosp5 libostyle1c2
  libptexenc1 libreadline5 libruby1.9.1 libsgmls-perl libsp1c2 lmodern luatex
  openjade pgf preview-latex-style prosper ps2eps ruby ruby1.9.1 sgmlspl sp
  tcl tcl8.6 tex-common tex-gyre texlive texlive-base texlive-bibtex-extra
  texlive-binaries texlive-extra-utils texlive-font-utils
  texlive-fonts-recommended texlive-fonts-recommended-doc
  texlive-generic-recommended texlive-latex-base texlive-latex-base-doc
  texlive-latex-extra texlive-latex-extra-doc texlive-latex-recommended
  texlive-latex-recommended-doc texlive-luatex texlive-math-extra
  texlive-pictures texlive-pictures-doc texlive-pstricks texlive-pstricks-doc
  tipa tk tk8.6 xmlto xsltproc
0 upgraded, 58 newly installed, 0 to remove and 171 not upgraded.
Need to get 727 MB of archives.
After this operation, 1,145 MB of additional disk space will be used.
Do you want to continue? [Y/n] n
Abort.

@stweil
Copy link
Member Author

stweil commented Apr 30, 2017

Try apt-get install --no-install-recommends asciidoc. This will reduce the list a lot, because all TeX related packages are only recommended (needed for PDF generation, but not for simple man pages).

I get 4 packages with --no-install-recommends, but 72 packages without that option.

@Shreeshrii
Copy link
Collaborator

Thanks. That does the trick.

sudo apt-get install --no-install-recommends asciidoc
sudo: unable to resolve host ALL-IN-1-TOUCH
[sudo] password for shree:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
  source-highlight vim-addon-manager
Recommended packages:
  dblatex docbook-utils xmlto
The following NEW packages will be installed:
  asciidoc
0 upgraded, 1 newly installed, 0 to remove and 171 not upgraded.
Need to get 688 kB of archives.
After this operation, 2,370 kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu/ trusty/main asciidoc all 8.6.9-2ubuntu1 [688 kB]
Fetched 688 kB in 2s (239 kB/s)
Selecting previously unselected package asciidoc.
(Reading database ... 103366 files and directories currently installed.)
Preparing to unpack .../asciidoc_8.6.9-2ubuntu1_all.deb ...
Unpacking asciidoc (8.6.9-2ubuntu1) ...
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
Setting up asciidoc (8.6.9-2ubuntu1) ...

@amitdo
Copy link
Collaborator

amitdo commented Apr 30, 2017

$ apt-cache depends asciidoc
asciidoc
  Depends: python
  Depends: <python:any>
    python
  Suggests: source-highlight
  Suggests: vim-addon-manager
  Recommends: dblatex
  Recommends: docbook-utils
  Recommends: libxml2-utils
  Recommends: xmlto
$ apt-get install --dry-run --no-install-recommends asciidoc
NOTE: This is only a simulation!
      apt-get needs root privileges for real execution.
      Keep also in mind that locking is deactivated,
      so don't depend on the relevance to the real current situation!
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Suggested packages:
  source-highlight vim-addon-manager
Recommended packages:
  dblatex docbook-utils libxml2-utils xmlto
The following NEW packages will be installed:
  asciidoc
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Inst asciidoc (8.6.9-3 Debian:8.7/stable [all])
Conf asciidoc (8.6.9-3 Debian:8.7/stable [all])

@amitdo
Copy link
Collaborator

amitdo commented Apr 30, 2017

@stweil
Copy link
Member Author

stweil commented Apr 30, 2017

By the way, builds which use cmake don't install any man pages, only autoconf based builds do.

@amitdo
Copy link
Collaborator

amitdo commented Apr 30, 2017

Cmake is used by people that use MSVC and by the CI.

@zdenop
Copy link
Contributor

zdenop commented Apr 30, 2017

Any objection to merge this PR?

@amitdo
Copy link
Collaborator

amitdo commented Apr 30, 2017

If this PR is accepted, we will need to add this to the Compiling wiki page:
apt-get install --no-install-recommends asciidoc, but we only have instructions for Debian-based distros. If other package managers in non-Debian-based distros have a similar behavior like
apt-get install asciidoc (install also recommended packages) users will get a lot of unnecessary packages.

@stweil, what do think about this issue?

@stweil
Copy link
Member Author

stweil commented Apr 30, 2017

Yes, we have to add documentation for package maintainers who want to install the man pages with the Tesseract package.

I expect that a person who wants to build a distro package won't have problems with installing too many packages with asciidoc. My main machine, for example, already had TeX installed, so the installation of asciidoc did not add many more packages.

Normal users who want to build Tesseract would not automatically build man pages, so they don't need asciidoc. The main question is whether that is acceptable.

Instead of building man pages in maintainer mode only, it would also be possible to build them only if asciidoc was found. Would that be better?

@amitdo
Copy link
Collaborator

amitdo commented Apr 30, 2017

OK. No objection to this PR.

BTW, Git does the same thing:
https://github.com/git/git/tree/master/Documentation

@amitdo
Copy link
Collaborator

amitdo commented May 1, 2017

https://github.com/git/git/blob/v2.13.0-rc1/INSTALL#L160
Stefan, I suggest to do something similar in Tesseract.
(Of course, don't copy even a single line from that GPL codebase)

@zdenop zdenop merged commit 857d920 into tesseract-ocr:master May 1, 2017
@stweil stweil deleted the doc branch May 1, 2017 14:08
@Shreeshrii
Copy link
Collaborator

Making all in doc
make[2]: Entering directory /mnt/c/Users/User/shree/tesseract/doc' make[2]: *** No rule to make target cntraining.1', needed by all-am'. Stop. make[2]: Leaving directory /mnt/c/Users/User/shree/tesseract/doc'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/mnt/c/Users/User/shree/tesseract'
make: *** [all] Error 2

@Shreeshrii
Copy link
Collaborator

Making install in doc
make[1]: Entering directory /mnt/c/Users/User/shree/tesseract/doc' make[1]: *** No rule to make target cntraining.1', needed by all-am'. Stop. make[1]: Leaving directory /mnt/c/Users/User/shree/tesseract/doc'
make: *** [install-recursive] Error 1

@Shreeshrii
Copy link
Collaborator

The above errors came while building using the regular automake method with plain ./configure

@stweil
Copy link
Member Author

stweil commented May 2, 2017

Thank you for the report. This is fixed in PR #862. Don't forget to run ./autogen.sh after that patch.

@Shreeshrii
Copy link
Collaborator

Thanks! I usually follow the following for rebuilding tesseract.

git pull origin

./autogen.sh
./configure 
LDFLAGS="-L/usr/local/lib" CFLAGS="-I/usr/local/include" make
sudo make install
sudo ldconfig
make training
sudo make training-install

@amitdo amitdo added the RFC label Mar 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants