File: install_pods

package info (click to toggle)
cupt 2.8.4
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 2,204 kB
  • ctags: 2,598
  • sloc: cpp: 23,043; perl: 191; sh: 22; makefile: 20
file content (18 lines) | stat: -rw-r--r-- 650 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/perl

use warnings;
use strict;

foreach my $pod_file (glob("doc/*.pod")) {
	# example: doc/cupt.1.pod
	my ($name, $section) = ($pod_file =~ m{.*/((?:\w|_|-|\.)+)\.(\d)\.pod}) or
			die "badly formatted POD name $pod_file";
	my $man_page_name = "$name.$section";
	my $uppercased_name = uc $name;
	my $pod2man_command = "pod2man --utf8 --name $uppercased_name --section $section $pod_file > $man_page_name";
	my $dh_command = "dh_installman -pcupt $man_page_name";
	my $command = "$pod2man_command && $dh_command && rm $man_page_name";
	print "   $command\n";
	system($command) == 0 or
			die "installing man page $man_page_name failed";
}