0

In a software I have to tweak, the man file is located under doc/ along with a simple Makefile.am file:

man_MANS = software.1
EXTRA_DIST = $(man_MANS)

Upon installation, I expect make install to copy the manual under /usr/local/share/man/, but the script - instead - will try to install the man under /usr/local/share/man/man1 - which does not exist - throwing an error and stopping the process.

I would expect a similar behavior if I assigned software.1 to man1_MANS, though.

What is going on ? How is this possible that automake does not create non-existing folders ?

ziu
  • 2,634
  • 2
  • 24
  • 39
  • Works for me. Which version of automake are you using? – William Pursell May 26 '14 at 13:25
  • Why do you expect the man page to be installed in `/usr/local/share/man` rather than `/usr/local/share/man/man1`? – William Pursell May 26 '14 at 13:28
  • @WilliamPursell `automake (GNU automake) 1.14.1` --- `autoconf (GNU Autoconf) 2.69` It is my understanding that using the variable manX_MANS will copy the manual under a subdirectory named manX. Am I wrong ? I am not very experienced with Autotools since I still write my Makefiles by hand. – ziu May 26 '14 at 13:32
  • You are correct. Automake will construct a `Makefile.in` which `configure` will use to create `Makefile` which will have an `install` target which will create a directory `$(DESTDIR)$(mandir)/man1` (which by default will be `/usr/local/share/man/man1`) and install software.1 to that location. If that is not happening, then something else in your build files is wrong. Create a simple project (nothing but software.1, configure.ac, and Makefile.am) and see if you get the same behavior. – William Pursell May 26 '14 at 13:40
  • Using always `man_MANS = software.1` make tries to install `software.1` under `/usr/local/share/man/man1` which does not exist. So, if I cannot change the destination directory, shall I add by hand a `mkdir` command somewhere else ? – ziu May 26 '14 at 13:54
  • No! The correct location for the man page is /usr/local/share/man/man1/software.1 If the target directory is not being created, you should figure out why. You absolutely can change the target directory, but if you do so it should be done when you run configure (`./configure --mandir=/p/a/t/h`) which will install the file in `/p/a/t/h/man1`. If the user does that, `make install` should create `/p/a/t/h/man1`, but if your build files are borked and that doesn't happen then you have errors in your build files. – William Pursell May 26 '14 at 13:59
  • Are you possibly just hitting a permission error? Perhaps you do not have permission to create directories in `/usr/local/share/man`, but you are not noticing the error message about the failure to create the directory. What happens if you do `make install DESTDIR=/tmp/foo`? – William Pursell May 26 '14 at 15:14
  • `/tmp/foo/usr/local/share/man/man1: No such file or directory` I do fear, since I did not write the build scripts, that the autotools application is kind of hackish. – ziu May 26 '14 at 16:06
  • Ok, I just realized that MKDIR_P is blank in the generated Makefile. Now, I will try to trace back the problem. That is strange, since starting a new project from scratch does not produce any issues: something is fishy in the `configure.ac`, which is rather old and "fatty". – ziu May 26 '14 at 16:17

1 Answers1

1

man_MANS will try to figure out in which section to put the manual depending on the extension you gave it, so it is correct in this case that it would install into ${mandir}/man1.

Since you say that MKDIR_P is empty in your output, try to ensure that AC_PROG_MKDIR_P is being called in your configure.ac (it should be automatically called by AM_INIT_AUTOMAKE but since you said it's old it might have some issues).

Diego Elio Pettenò
  • 3,152
  • 12
  • 15