/[gentoo-x86]/app-doc/heirloom-doctools/heirloom-doctools-080407-r2.ebuild
Gentoo

Contents of /app-doc/heirloom-doctools/heirloom-doctools-080407-r2.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (hide annotations) (download)
Thu Jan 20 04:42:43 2011 UTC (9 years, 1 month ago) by flameeyes
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +1 -1 lines
FILE REMOVED
Remove packages slated for removal.

1 flameeyes 1.1 # Copyright 1999-2009 Gentoo Foundation
2     # Distributed under the terms of the GNU General Public License v2
3 flameeyes 1.3 # $Header: /var/cvsroot/gentoo-x86/app-doc/heirloom-doctools/heirloom-doctools-080407-r2.ebuild,v 1.2 2009/10/02 22:19:28 flameeyes Exp $
4 flameeyes 1.1
5     EAPI=2
6    
7     inherit flag-o-matic toolchain-funcs multilib
8    
9     DESCRIPTION="Classic Unix documentation tools ported from OpenSolaris"
10     HOMEPAGE="http://heirloom.sourceforge.net/doctools.html"
11     SRC_URI="mirror://sourceforge/heirloom/${P}.tar.bz2"
12    
13     LICENSE="CDDL"
14    
15     SLOT="0"
16    
17     KEYWORDS="~amd64 ~x86"
18    
19     IUSE="cxx"
20    
21     RDEPEND="!sys-apps/groff"
22     DEPEND="sys-devel/flex
23     sys-devel/bison"
24    
25     src_prepare() {
26     # Make sure that C++ code is built with CXXFLAGS and not CFLAGS.
27     find . -name Makefile.mk -exec \
28     sed -i \
29     -e '/(CCC)/s:CFLAGS:CXXFLAGS:' \
30     {} +
31    
32     # mpm uses C++, we'll build it explicitly if we really want to
33     sed -i -e 's:mpm:$(MPM):' makefile
34    
35     # Monkeypatching dependencies to avoid parallel make failure
36     echo "picl.o: picl.c y.tab.h" >> pic/Makefile.mk
37    
38     # Move some stuff around to better suit our filesystem layout
39     sed -i -e '/INSTALL.*grap\.defines/s:$(LIBDIR):/usr/share/heirloom/doctools:' \
40     grap/Makefile.mk || die
41     sed -i -e '/GRAPDEFINES/s:LIBDIR:"/usr/share/heirloom/doctools":' \
42     grap/main.c || die
43    
44     sed -i -e '/INSTALL.*eign/s:$(LIBDIR):/usr/share/heirloom/doctools:' \
45     ptx/Makefile.mk || die
46     sed -i -e '/\/eign/s:\(LIB\|REF\)DIR:"/usr/share/heirloom/doctools":' \
47     ptx/ptx.c refer/mkey3.c || die
48    
49     sed -i -e 's:$(LIBDIR)/vgrindefs:/usr/share/heirloom/doctools/vgrindefs:' \
50     vgrind/Makefile.mk || die
51     sed -i -e '/\/vgrindefs/s:LIBDIR:"/usr/share/heirloom/doctools":' \
52     vgrind/vfontedpr.c || die
53    
54     sed -i -e 's:$(REFDIR)/papers:/usr/share/heirloom/reftools/papers:g' \
55     refer/Makefile.mk || die
56     sed -i -e '/\/papers\/Ind/s:REFDIR:"/usr/share/heirloom/reftools":' \
57     refer/refer1.c || die
58    
59     # Correct paths for the installed man pages, just to be clean
60     find . \( -name '*.1' -or -name '*.1b' -or -name '*.7' -or -name '*.7b' \) -exec \
61     sed -i \
62     -e "s:/usr/ucblib/grap.defines:/usr/share/heirloom/doctools/grap.defines:" \
63     -e "s:/usr/ucblib/vgrindefs:/usr/share/heirloom/doctools/vgrindefs:" \
64     -e "s:/usr/ucblib/vfontedpr:/usr/libexec/heirloom/doctools/vfontedpr:" \
65     -e "s:/usr/ucblib/tmac/vgrind:/usr/share/heirloom/tmac/vgrind:" \
66     -e "s:/usr/ucblib/eign:/usr/share/heirloom/doctools/eign:" \
67     -e "s:/usr/ucb/:/usr/bin/:g" \
68     -e "s:/usr/ucblib/doctools:/usr/share/heirloom/doctools:g" \
69     -e "s:/usr/ucblib/reftools/papers:/usr/share/heirloom/reftools/papers:" \
70     -e "s:/usr/ucblib/reftools:/usr/libexec/heirloom/reftools:g" \
71     {} +
72     }
73    
74     src_configure() {
75     append-cppflags -D_GNU_SOURCE
76    
77     sed \
78     -e "s:@CFLAGS@:${CFLAGS}:" \
79     -e "s:@CXXFLAGS@:${CXXFLAGS}:" \
80     -e "s:@CPPFLAGS@:${CPPFLAGS}:" \
81     -e "s:@LDFLAGS@:${LDFLAGS}:" \
82     -e "s:@CC@:$(tc-getCC):" \
83     -e "s:@CXX@:$(tc-getCXX):" \
84     -e "s:@RANLIB@:$(tc-getRANLIB):" \
85     -e "s:@libdir@:$(get_libdir):" \
86     "${FILESDIR}"/${PV}.config \
87     > "${S}"/mk.config
88     }
89    
90     src_compile() {
91     emake $(use cxx && echo MPM=mpm) || die
92     }
93    
94     src_install() {
95     dodir /usr/share/heirloom/{doc,ref}tools
96    
97     # The build system uses the ROOT variable in place of DESTIDR.
98     emake $(use cxx && echo MPM=mpm) ROOT="${D}" install || die
99    
100     dodoc README CHANGES || die
101    
102     # Rename ptx to avoid a collision with coreutils… maybe this
103     # should be made conditional to userland_GNU (somebody got to
104     # check on FreeBSD).
105     mv "${D}"/usr/bin/{,hl-}ptx || die
106     mv "${D}"/usr/share/man/man1/{,hl-}ptx.1 || die
107    
108     # Rename otfdump to avoid a collision with dev-libs/libotf
109     mv "${D}"/usr/bin/{,hl-}otfdump || die
110     mv "${D}"/usr/share/man/man1/{,hl-}otfdump.1 || die
111    
112     # Rename ta to avoid a collision with app-cdr/pxlinux
113     mv "${D}"/usr/bin/{,hl-}ta || die
114    
115     # Not sure why they install in man{1,7}b, but we don't list that
116     # in by default, so move all of them to man1. We don't do that in
117     # the Makefiles, because it's definitely more complex (even though
118     # faster).
119     pushd "${D}"/usr/share/man
120     for section in 1 7; do
121     for man in man${section}b/*.${section}b*; do
122     if [ -L $man ]; then
123     local oldlink=$(readlink $man)
124     rm $man
125     ln -s ${oldlink//${section}b/${section}} ${man//${section}b/${section}}
126     else
127     mv $man ${man//${section}b/${section}} || die "failed moving $man"
128     fi
129     done
130     done
131     rmdir man{1,7}b
132     popd
133    
134     # Add some compatibility encodings for being able to use heirloom-doctools with
135     # sys-apps/man-db
136     for encoding in utf8 ascii; do
137     ln -s tab.37 "${D}"/usr/share/heirloom/nterm/tab.${encoding}
138     done
139     }
140    
141     pkg_postinst() {
142 flameeyes 1.2 local manpkg
143    
144 flameeyes 1.1 if has_version sys-apps/man; then
145     elog "To make proper use of heirloom-doctools with sys-apps/man you"
146     elog "need to make sure that /etc/man.conf is configured properly with"
147     elog "the following settings:"
148     elog ""
149     elog "TROFF /usr/bin/troff -Tlocale -mg -msafe -mpadj -mandoc"
150     elog "NROFF /usr/bin/nroff -mg -msafe -mpadj -mandoc"
151     elog "EQN /usr/bin/eqn -Tps"
152     elog "NEQN /usr/bin/neqn -Tlatin1"
153     elog "TBL /usr/bin/tbl"
154     elog "COL /usr/bin/col"
155     elog "REFER /usr/bin/refer"
156     elog "PIC /usr/bin/pic"
157     elog "VGRIND /usr/bin/vgrind"
158     elog "GRAP /usr/bin/grap"
159 flameeyes 1.2 manpkg=sys-apps/man
160 flameeyes 1.1 elif has_version sys-apps/man-db; then
161     elog "To make proper use of heirloom-doctools with sys-apps/man you"
162     elog "need to make sure that /etc/man_db.conf is configured properly with"
163     elog "the following settings:"
164     elog ""
165     elog "DEFINE troff troff -Tlocale -mg -msafe -mpadj -mandoc"
166     elog "DEFINE nroff nroff -mg -msafe -mpadj -mandoc"
167     elog "DEFINE eqn eqn -Tps"
168     elog "DEFINE neqn neqn -Tlatin1"
169     elog "DEFINE tbl tbl"
170     elog "DEFINE col col"
171     elog "DEFINE vgrind vgrind"
172     elog "DEFINE refer refer"
173     elog "DEFINE grap grap"
174     elog "DEFINE pic pic"
175 flameeyes 1.2 elog
176     ewarn "The compatibility between heirloom-doctools and man-db is pretty limited"
177     ewarn "you've been warned. Your man pages might look nothing like you were used"
178     ewarn "to."
179     manpkg=sys-apps/man-db
180 flameeyes 1.1 fi
181 flameeyes 1.2 elog ""
182     elog "If you just switched from sys-apps/groff, please make sure to rebuild the"
183     elog "${manpkg} package, since there are build-time conditionals on the nroff"
184     elog "implementation available."
185 flameeyes 1.1 }

  ViewVC Help
Powered by ViewVC 1.1.20