aboutsummaryrefslogtreecommitdiffstats
path: root/share/mk/install
AgeCommit message (Collapse)AuthorFilesLines
2025-06-28share/mk/: uninstall-man: Fix support for pages with ':' in their file nameAlejandro Colomar1-1/+2
I don't know when this was exacly broken, since we didn't have such pages until now. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-05-17*: grfixAlejandro Colomar6-6/+6
Scripted change: $ grep -rl 'The authors of the Linux man-pages' \ | xargs sed -i '/Copyright, The authors of the Linux man-pages project/s/The/the/'; Reported-by: Josh Triplett <josh@joshtriplett.org> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-05-10*, AUTHORS: Consistently refer to authorsAlejandro Colomar6-6/+6
- Rename the file CREDITS => AUTHORS - Say 'authors' in the copyright notice. Scripted change: $ grep -rn 'The contributors to the Linux man-pages' -l \ | xargs sed -i '/Copyright, The contributors to the Linux man-pages project/s/contributors to/authors of/' Suggested-by: Dave Martin <Dave.Martin@arm.com> Acked-by: "G. Branden Robinson" <branden@debian.org> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-05-06*, CREDITS: Unify copyright noticesAlejandro Colomar6-6/+6
Link: <https://lore.kernel.org/linux-man/jpin2dbnp5vpitnh7l4qmvkamzq3h3xljzsznrudgioox3nn72@57uybxbe3h4p/T/#u> Link: <https://www.linuxfoundation.org/blog/blog/copyright-notices-in-open-source-software-projects> Cc: "G. Branden Robinson" <branden@debian.org> Cc: Carlos O'Donell <carlos@redhat.com> Cc: Eugene Syromyatnikov <evgsyr@gmail.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-11-03share/mk/: wsfixAlejandro Colomar2-4/+4
Add some spaces for readability and consistency. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-11-03share/mk/: [un]install-bin: Add target to [un]install shell scriptsAlejandro Colomar2-2/+41
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-07-20share/mk/: Reduce the work of 'make && make install'Alejandro Colomar1-0/+3
Distros expect 'make' to build only what they need. While we want to build more stuff upstream, for various reasons (mainly, for extra diagnostics), packagers only want what they'll use, and don't want to waste CPU time with that. Also, distros expect 'make install' to only install what they'll use, which is just the manual pages. For that, repurpose the build and install targets to do precisely that, and add build-all and install-all targets that do all that can be done. Reported-by: Sam James <sam@gentoo.org> Signed-off-by: Alejandro Colomar <alx@kernel.org> Cherry-picked-from: liba2i.git 791f163b1a72 (2024-07-18, "share/mk/: Reduce the work of 'make && make install'") Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-04-16share/mk/: Read files before 'if'Alejandro Colomar1-1/+3
'if' turns off set -e. We want to read files before 'if', so that if they don't exist, the shell will error out. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-04-16share/mk/: install-man: Don't pipe to install(1)Alejandro Colomar1-3/+3
install(1) doesn't work well in Darwin. It seems to be unable to handle </dev/stdin>. The problem seems to be that Darwin's stdin misbehaves. I've only workarounded the install target, and not the dist target, since it's unlikely that one would run it in such a broken system. But since installing the pages is a common operation that everybody needs, let's work around it here. Fixes: 30c38a8bf8ae ("*.mk: Pipe to install(1)") Link: <https://github.com/NixOS/nixpkgs/pull/300797> Closes: <https://bugzilla.kernel.org/show_bug.cgi?id=218730> Reported-by: Sergei Trofimovich <slyich@gmail.com> Reported-by: Mario Rodas <https://github.com/marsam> Cc: Eli Schwartz <eschwartz93@gmail.com> Cc: Pádraig Brady <P@draigBrady.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-04-09share/mk/: Remove support for installing compressed pagesAlejandro Colomar1-30/+4
I don't like compressed pages: they make it more difficult/slow to grep them. This was added to make it easier for users to install compressed pages even when installing from source, but probably nobody cares at all these days about a few KiB per page; drive space got cheap. Also, some of the algorithms were added just for benchmarking (for demonstrating that they were bad in this case), and not for real use. This reduces a use of compression tools, which seem to be dangerous these days. Link: <https://tukaani.org/xz-backdoor/> Link: <https://cmpct.info/~sam/blog/posts/automatic-manpage-compression/> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-03-26share/mk/: Reorganize files for generating the PDF bookAlejandro Colomar1-1/+1
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-03-24share/mk/: build-pdf*, install-pdf*: Rename targets for consistencyAlejandro Colomar3-33/+49
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-03-24share/mk/: [un]install-pdf: Add target to install the PDF bookAlejandro Colomar1-0/+33
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-03-24share/mk/: Reorganize build systemAlejandro Colomar2-6/+8
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-03-21share/mk/: build-book, build-man, install-man: Specify version and dateAlejandro Colomar1-1/+1
Each page has its own date. Add new 'build-man' target, which stamps the date and version in the pages (in $builddir, not the source ones). Build-system internal stuff: $CURDIR will be used for the build system, while $srcdir will be used for the project root of the repository. This helps use this build system in other projects. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-03-20share/mk/: Reorganize dependenciesAlejandro Colomar3-11/+14
Use one directory per each (Debian) package, and one file per command. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-03-18share/mk/: Update licenseAlejandro Colomar3-12/+6
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-03-18share/mk/: Use grohtml(1) instead of man2html(1)Alejandro Colomar1-3/+4
man2html(1) crashes on tzfile(5), and the upstream project is defunct. Link: <https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1067022> Cc: Paul Eggert <eggert@cs.ucla.edu> Cc: "G. Branden Robinson" <branden@debian.org> Cc: Robert Luberda <robert@debian.org> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-02-25share/mk/: Use a variable to prefix recursive make(1) outputAlejandro Colomar3-4/+4
Piping the output to sed(1) didn't behave well with -Orecurse. Using a variable behaves well, keeping output synchronized. The length of the variable name is specific, so that `$(INFO_)` uses exactly 8 characters, a tab. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-02-17share/mk/: $(info ...): Make output more consistentAlejandro Colomar3-4/+4
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-02-17share/mk/: Reorganize build systemAlejandro Colomar3-2/+4
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-02-17share/mk/: Move configuration variables to share/mk/configure/Alejandro Colomar3-26/+2
Some variables are only part of the implementation of our build system, and users should not modify them; others are designed to be set by users when they invoke make(1). Define the latter in share/mk/configure/, so that they are more visible. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-02-17share/mk/: Reorganize build dependenciesAlejandro Colomar3-7/+15
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-09-06*.mk: Have the makefiles as dependencies of all filesAlejandro Colomar2-2/+2
If any makefile is modified, all files should be remade. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-08-29*.mk: man*ext: Make the variables actually usableAlejandro Colomar1-6/+9
There were several important bugs regarding these variables that made them unusable: - intro(*) pages were completely ignoring them. - The rules for non-intro pages were also ignoring them. The variables were only being effectively used for updating the .so links to other pages, but not the page filenames themselves. Behavior prior to this patch: $ rm -rf /tmp/dest; $ echo '.so man2type/open_how.2type' >man2type/foo.2type; $ echo '.so man2type/open_how.2type' >man2type/intro.2type; $ make install-man2type install-manintro \ DESTDIR=/tmp/dest/dir \ man2typedir=/mantoo \ man2typeext=.twotype \ Z=.gz \ LINK_PAGES=symlink; INSTALL /tmp/dest/dir/mantoo/ INSTALL /tmp/dest/dir/mantoo/foo.2type.gz INSTALL /tmp/dest/dir/mantoo/open_how.2type.gz INSTALL /tmp/dest/dir/usr/local/share/man/man1/ INSTALL /tmp/dest/dir/usr/local/share/man/man1/intro.1.gz INSTALL /tmp/dest/dir/usr/local/share/man/man2type/ INSTALL /tmp/dest/dir/usr/local/share/man/man2type/intro.2type.gz INSTALL /tmp/dest/dir/usr/local/share/man/man2/ INSTALL /tmp/dest/dir/usr/local/share/man/man2/intro.2.gz INSTALL /tmp/dest/dir/usr/local/share/man/man3/ [...] $ readlink /tmp/dest/dir/mantoo/foo.2type.gz; ../mantoo/open_how.twotype.gz $ readlink /tmp/dest/dir/usr/local/share/man/man2type/intro.2type.gz; ../mantoo/open_how.twotype.gz Notice the dead symlinks above. Behavior after this patch: $ rm -rf /tmp/dest; $ echo '.so man2type/open_how.2type' >man2type/foo.2type; $ echo '.so man2type/open_how.2type' >man2type/intro.2type; $ make install-man2type install-manintro \ DESTDIR=/tmp/dest/dir \ man2typedir=/mantoo \ man2typeext=.twotype \ Z=.gz \ LINK_PAGES=symlink; INSTALL /tmp/dest/dir/mantoo/ INSTALL /tmp/dest/dir/mantoo/foo.twotype.gz INSTALL /tmp/dest/dir/mantoo/open_how.twotype.gz INSTALL /tmp/dest/dir/usr/local/share/man/man1/ INSTALL /tmp/dest/dir/usr/local/share/man/man1/intro.1.gz INSTALL /tmp/dest/dir/usr/local/share/man/man2/ INSTALL /tmp/dest/dir/usr/local/share/man/man2/intro.2.gz INSTALL /tmp/dest/dir/mantoo/intro.twotype.gz INSTALL /tmp/dest/dir/usr/local/share/man/man3/ [...] $ readlink /tmp/dest/dir/mantoo/foo.twotype.gz; ../mantoo/open_how.twotype.gz $ readlink /tmp/dest/dir/mantoo/intro.twotype.gz; ../mantoo/open_how.twotype.gz Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-08-29*.mk: srcfixAlejandro Colomar1-2/+4
Cosmetic changes in preparation for next commit. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-08-29*.mk: man*ext: Don't include $(Z) in $(man*ext)Alejandro Colomar1-2/+2
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-08-29*.mk: srcfixAlejandro Colomar1-1/+1
For consistency, let's use $(MAN$(s)DIR). Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-08-28*.mk: Use $(foreach ...) to reduce repetitionAlejandro Colomar1-13/+2
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-08-28*.mk: gzip(1) doesn't need '-' to act as a filterAlejandro Colomar1-3/+3
Remove the redundant special file name. It would be better to specify /dev/stdin, if we wanted to specify a file name. But the command just works as a filter without a filename, so there's no need for that at all. Remove this redundant code. The other compressors are compatible with gzip(1) in that regard. Do the same. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-08-28*.mk: Pipe to install(1)Alejandro Colomar1-3/+3
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-08-28*.mk: MANSECTIONS: Rename variableAlejandro Colomar1-13/+13
For consistency with other $(MAN*) variables, remove the underscore. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-08-27*.mk: Use $(foreach ..., $(eval ...) to reduce repetitionAlejandro Colomar1-126/+38
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-08-13*.mk: [un]install-manintro: Add target to [un]install intro(*) pages separatelyAlejandro Colomar1-3/+11
Debian installs intro(*) pages --including intro(3)-- in the manpages package, not in manpages-dev, even if they would otherwise belong to the -dev one due to their section. This is because even if someone may not be interested in installing development manual pages, an introduction to the section, explaining what one could find there when installed, is useful. Let's make it easy to do that with a specialized target that installs all intro(*) pages. This is a breaking change, since from now on, the only way to install intro(*) pages is through this new target, and the old install-man* targets won't install their own intro(*) pages. However, of course, the wrapper targets `install` and `install-man` still install the intro(*) pages. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-04-29*.mk: Don't rmdirAlejandro Colomar3-37/+3
There's no need; we can leave empty dirs on 'make uninstall', and it allows some simplifications. We don't need the FORCE target anymore, and don't need some directory variables either. While at it, I found some unused variable that should have been removed a long time ago: $installdirs_manX Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-04-26*.mk: Handle pathnames with ':'Alejandro Colomar1-2/+24
Since make(1) uses ':' as a special character in rules, it needs to be handled carefully. A way to make it work is to escape it with '\:'. We can use sed(1) to do that right when we get the pathnames. The only problem with ':' is in rules' targets and prerequisites: everywhere else it's fine; so let's discuss what needs to be done in those places: - In the targets, it's as easy as escaping. - In prerequisites, we can't second-expand variables containing such pathnames, as the '\' would not be used by make(1) to escape the ':', but it would be interpreted as part of the pathname. This means we need to expand rules written using second expansion into several rules that only expand their variables once. - $(wildcard ...) also performs the escape, so after using it the pathnames are not escaped. If we used those variables in targets, we would need to escape the ':'s again, but since we don't we can skip that. The trick to make this work is to second-expand these variables. Link: <https://stackoverflow.com/a/76096683/6872717> Cc: GNU Make <bug-make@gnu.org> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-04-25*.mk: Use empty recipes for .PHONY targetsAlejandro Colomar3-16/+8
The @: dummy recipe was there to avoid having rules without recipes. Rules without recipes can be confusing, as the reader can't know if a recipe is being defined somewhere else. Also, implicit rules might apply (in general, but we disable all implicit stuff). However, @: is also problematic, since make really needs to run that command, which is unnecessary overhead. But okay, :(1) (really called true(1), but wouldn't it be a nice man page name?) that's not meaningful overhead. And the bigger problem: having a recipe hides the usual: make: Nothing to be done for 'all'. We already disable it by using .SILENCE:, but the message can be seen when using V=1 (after this patch; prior to this patch, it was impossible to find that message). It is good to be able to know that make(1) says there's nothing to be done, as a confirmation. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-04-23install/_.mk: Make pattern rule more explicitAlejandro Colomar1-1/+1
Specify $DESTDIR, so that it's more clear what this rule is about. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-04-23*/mk: mkdir -p (and install -d) are safe to useAlejandro Colomar3-6/+2
There are no race conditions, contrary to what some sources say. Previously, we had each directory depend on its parent directory, so that only a few parent-most directories would be created with parents, and all others would be created when their parents exist. That was due to FUD about TOCTOU race conditions with mkdir -p and parallel make, but it was just FUD. This patch makes it so that each directory is directly created with parents without specifying any dependency. This simplifies the makefile at some cost: calling mkdir -p so many times is a bit slower. However, it's only about 5%, so we can live with it, since we're talking about hundreds of a second for creating all the directories that this build system knows about. Reported-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-04-22*.mk: Make comment more genericAlejandro Colomar3-3/+3
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-04-22*.mk: License consistently with GPL-3.0-or-laterAlejandro Colomar3-6/+6
Also, use consistent formatting for the license and copyright. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-04-14*.mk: Move makefiles from lib/ to share/mk/Alejandro Colomar3-0/+299
According to the FHS, lib/ is for arch-dependent files, while share/ is for arch-independent files. While moving, create a more organized directory structure. Signed-off-by: Alejandro Colomar <alx@kernel.org>