1 | # Note: this .spec is borrowed from help2man-1.46.4-1.fc22.src.rpm
|
---|
2 |
|
---|
3 | # Supported build option:
|
---|
4 | #
|
---|
5 | # --with nls ... build this package with --enable-nls
|
---|
6 |
|
---|
7 | Name: help2man
|
---|
8 | Summary: Create simple man pages from --help output
|
---|
9 | Version: 1.46.4
|
---|
10 | Release: 2%{?dist}
|
---|
11 | Group: Development/Tools
|
---|
12 | License: GPLv3+
|
---|
13 | URL: http://www.gnu.org/software/help2man
|
---|
14 | #Source: ftp://ftp.gnu.org/gnu/help2man/help2man-%{version}.tar.xz
|
---|
15 |
|
---|
16 | %define svn_url http://svn.netlabs.org/repos/ports/help2man/trunk
|
---|
17 | %define svn_rev 980
|
---|
18 |
|
---|
19 | Source: %{name}-%{version}%{?svn_rev:-r%{svn_rev}}.zip
|
---|
20 |
|
---|
21 | BuildRequires: gcc make subversion zip
|
---|
22 |
|
---|
23 | %bcond_with nls
|
---|
24 |
|
---|
25 | %{!?with_nls:BuildArch: noarch}
|
---|
26 |
|
---|
27 | BuildRequires: texinfo
|
---|
28 | #BuildRequires: perl(Getopt::Long)
|
---|
29 | #BuildRequires: perl(POSIX)
|
---|
30 | #BuildRequires: perl(Text::ParseWords)
|
---|
31 | #BuildRequires: perl(Text::Tabs)
|
---|
32 | #BuildRequires: perl(strict)
|
---|
33 | %{?with_nls:BuildRequires: perl(Locale::gettext) /usr/bin/msgfmt}
|
---|
34 | %{?with_nls:BuildRequires: perl(Encode)}
|
---|
35 | %{?with_nls:BuildRequires: perl(I18N::Langinfo)}
|
---|
36 |
|
---|
37 | # @todo Replace with `%info_requires` when it's available.
|
---|
38 | Requires(post): %{_sbindir}/install-info.exe
|
---|
39 | Requires(preun): %{_sbindir}/install-info.exe
|
---|
40 |
|
---|
41 | %description
|
---|
42 | help2man is a script to create simple man pages from the --help and
|
---|
43 | --version output of programs.
|
---|
44 |
|
---|
45 | Since most GNU documentation is now in info format, this provides a
|
---|
46 | way to generate a placeholder man page pointing to that resource while
|
---|
47 | still providing some useful information.
|
---|
48 |
|
---|
49 | %prep
|
---|
50 | %if %{?svn_rev:%(sh -c 'if test -f "%{_sourcedir}/%{name}-%{version}-r%{svn_rev}.zip" ; then echo 1 ; else echo 0 ; fi')}%{!?svn_rev):0}
|
---|
51 | %setup -q
|
---|
52 | %else
|
---|
53 | %setup -n "%{name}-%{version}" -Tc
|
---|
54 | svn export %{?svn_rev:-r %{svn_rev}} %{svn_url} . --force
|
---|
55 | rm -f "%{_sourcedir}/%{name}-%{version}%{?svn_rev:-r%{svn_rev}}.zip"
|
---|
56 | (cd .. && zip -SrX9 "%{_sourcedir}/%{name}-%{version}%{?svn_rev:-r%{svn_rev}}.zip" "%{name}-%{version}")
|
---|
57 | %endif
|
---|
58 |
|
---|
59 | # Create files necessary for configure
|
---|
60 | bootstrap.sh
|
---|
61 |
|
---|
62 | %build
|
---|
63 | %configure --%{!?with_nls:disable}%{?with_nls:enable}-nls --libdir=%{_libdir}/help2man
|
---|
64 | make %{?_smp_mflags}
|
---|
65 |
|
---|
66 | %install
|
---|
67 | rm -rf $RPM_BUILD_ROOT
|
---|
68 | # Disable install_l10n for now since it depends on Perl(Locale:gettext) which is missing ATM
|
---|
69 | #make install_l10n DESTDIR=$RPM_BUILD_ROOT
|
---|
70 | make install DESTDIR=$RPM_BUILD_ROOT
|
---|
71 | #%find_lang %name --with-man
|
---|
72 |
|
---|
73 | %post
|
---|
74 | # @todo Replace with `%info_post foobar.info` when it's available.
|
---|
75 | if [ -f %{_infodir}/help2man.info ]; then
|
---|
76 | %{_sbindir}/install-info.exe %{_infodir}/help2man.info %{_infodir}/dir || :
|
---|
77 | fi
|
---|
78 |
|
---|
79 | %preun
|
---|
80 | # @todo Replace with `%info_preun foobar.info` when it's available.
|
---|
81 | if [ $1 -eq 0 ]; then
|
---|
82 | # @todo: don't remove these comment lines! See http://trac.netlabs.org/rpm/ticket/118 for more info.
|
---|
83 | #################################
|
---|
84 | #################################
|
---|
85 | if [ -f %{_infodir}/help2man.info ]; then
|
---|
86 | %{_sbindir}/install-info.exe --delete %{_infodir}/help2man.info %{_infodir}/dir || :
|
---|
87 | fi
|
---|
88 | fi
|
---|
89 |
|
---|
90 | # See above
|
---|
91 | #%files -f %name.lang
|
---|
92 | %files
|
---|
93 | %doc README NEWS THANKS COPYING
|
---|
94 | %{_bindir}/help2man
|
---|
95 | %{_infodir}/*
|
---|
96 | %{_mandir}/man1/*
|
---|
97 |
|
---|
98 | %if %{with nls}
|
---|
99 | %{_libdir}/help2man
|
---|
100 | %endif
|
---|
101 |
|
---|
102 | %changelog
|
---|
103 | * Fri Feb 13 2015 Dmitriy Kuminov <coding@dmik.org> 1.46.4-2
|
---|
104 | - Enable proper info file and locale data installation.
|
---|
105 |
|
---|
106 | * Tue Jan 20 2015 Dmitriy Kuminov <coding@dmik.org> 1.46.4-1
|
---|
107 | - Initial package for version 1.46.4.
|
---|