1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
7 inherit eutils gnuconfig multilib
9 #revision for debian stable versions (e.g. +squeeze)
12 DESCRIPTION="Debian commandline package manager"
13 HOMEPAGE="http://packages.qa.debian.org/apt"
14 SRC_URI="mirror://debian/pool/main/a/${PN}/${PN}_${PV}${MY_PVR}.tar.gz"
18 KEYWORDS="~amd64 ~x86"
19 IUSE="apt-pkg berkdb doc examples graphviz largefile latex nls rpath ssl utils"
20 ILINGUAS="ar ast bg bs ca cs cy da de dz el es eu fi fr gl hu it ja km
21 ko ku lt mr nb ne nl nn pl pt pt_BR ro ru sk sl sv th tl uk
24 for lang in $ILINGUAS; do
25 IUSE="${IUSE} linguas_${lang}"
27 REQUIRED_USE="berkdb? ( apt-pkg )
32 COMMON_DEPEND="sys-libs/zlib
33 berkdb? ( sys-libs/db )"
34 RDEPEND="app-arch/dpkg
37 ssl? ( net-misc/curl[ssl] )
39 DEPEND="app-text/debiandoc-sgml
40 >=app-text/docbook-xml-dtd-4.5
41 app-text/docbook-xsl-stylesheets
42 >=app-text/po4a-0.40.1
49 graphviz? ( media-gfx/graphviz )
53 S="${WORKDIR}/${P}${MY_PVR}"
56 strip-linguas $ILINGUAS
59 sed -e 's#xml/docbook/stylesheet/nwalsh#sgml/docbook/xsl-stylesheets#' \
60 -i doc/manpage-style.xsl || die
64 HAVE_DOT=$(usex graphviz "YES" "NO") econf \
65 $(use_enable largefile ) \
71 # Make the compile process noisy so it's easier to debug for QA
76 local mydpkglibdir=/usr/$(get_libdir)/dpkg/methods/${PN}
77 local myetcdir=/etc/${PN}
80 # Install main binaries
81 dobin bin/apt-{cache,cdrom,config,get,key,mark}
82 exeinto /usr/$(get_libdir)/${PN}/methods
85 rm "${D}"/usr/$(get_libdir)/apt/methods/https || die
88 insinto ${mydpkglibdir}
89 doins dselect/{desc.apt,names}
90 exeinto ${mydpkglibdir}
91 doexe dselect/{install,setup,update}
92 dolib.so bin/libapt-pkg*
93 insinto /usr/share/bug/${PN}
94 newins debian/apt.bug-script script
96 # Install lintian overrides
97 insinto /usr/share/lintian/overrides
98 newins "${FILESDIR}"/apt.lintian ${PN}
100 # Install configuration examples
101 if use examples; then
102 insinto /usr/share/doc/${PF}
103 doins -r docs/examples
106 # Install API documentation
108 dohtml -r build/doc/doxygen/html/*.{html,png}
109 rm "${D}"/usr/share/doc/${PF}/html/files.html || die
111 insinto /usr/share/doc/${PF}
112 doins -r build/doc/doxygen/latex
113 # Uncompress tex files since tex editors cannot use compressed files
114 docompress -x /usr/share/doc/${PF}/latex
118 # Install main documentation
119 dodoc debian/{changelog,NEWS}
121 dodoc debian/apt-transport-https.README
123 dodoc docs/{design.text,dpkg-tech.text,files.text,guide.text,method.text,offline.text}
124 dohtml -r docs/{design.html,dpkg-tech.html,files.html,guide.html,method.html,offline.html}
125 doman doc/{apt-config.8,apt-get.8,apt-key.8,apt-mark.8,apt-secure.8}
126 doman doc/{apt-cache.8,apt-cdrom.8,apt.8,apt.conf.5,apt_preferences.5,sources.list.5}
129 find locale -type f -iname "apt-utils.mo" -delete || die
132 # Install locale related docs
133 for lang in ${ILINGUAS}; do
134 use linguas_${lang} || continue
135 # store use languages so there's no need to check use again
136 mylangs="${mylangs} ${lang}"
138 insinto /usr/share/locale
139 doins -r locale/${lang}
141 if [ -e docs/guide.${lang}.html ]; then
142 dohtml -r docs/guide.${lang}.html
144 if [ -e docs/offline.${lang}.html ]; then
145 dohtml -r docs/offline.${lang}.html
147 if [ -e docs/guide.${lang}.text ]; then
148 dohtml -r docs/guide.${lang}.text
150 if [ -e docs/offline.${lang}.text ]; then
151 dohtml -r docs/offline.${lang}.text
153 if [ -e doc/${lang} ]; then
154 doman doc/${lang}/{apt-config.${lang}.8,apt-get.${lang}.8,apt-key.${lang}.8}
155 doman doc/${lang}/{apt-mark.${lang}.8,apt-secure.${lang}.8}
156 doman doc/${lang}/{apt-cache.${lang}.8,apt-cdrom.${lang}.8,apt.conf.${lang}.5}
157 doman doc/${lang}/{apt_preferences.${lang}.5,sources.list.${lang}.5}
162 # Install example of sources.list in main configuration area
164 doins doc/examples/sources.list
166 # Install auto remove configuration
167 insinto ${myetcdir}/apt.conf.d
168 newins debian/apt.conf.autoremove 01autoremove
170 # Create other needed configuration directories
171 keepdir ${myetcdir}/preferences.d
172 keepdir ${myetcdir}/sources.list.d
173 keepdir ${myetcdir}/trusted.gpg.d
175 # Install log rotation configuration
176 insinto /etc/logrotate.d
177 newins debian/apt.logrotate ${PN}
179 # Install apt cront script
180 insinto /etc/cron.daily
181 newins debian/apt.cron.daily ${PN}
183 # Create other needed directories
184 keepdir /var/cache/${PN}/archives/partial
185 keepdir /var/lib/${PN}/lists/partial
186 keepdir /var/lib/${PN}/mirrors/partial
187 keepdir /var/lib/${PN}/periodic
188 keepdir /var/log/${PN}
190 # Install apt pkg libraries
192 doheader -r include/apt-pkg
193 dolib.so bin/libapt-inst.so*
195 # Install apt-ftparchive and related docs
197 dobin bin/apt-ftparchive
198 doman doc/apt-ftparchive.1
199 for lang in ${mylangs}; do
200 if [ -e doc/${lang} ]; then
201 doman doc/${lang}/apt-ftparchive.${lang}.1
205 if use examples; then
206 dodoc doc/examples/apt-ftparchive.conf
210 # Install apt utility programs and docs
212 dobin bin/apt-{extracttemplates,internal-solver,sortpkgs}
213 doman doc/{apt-extracttemplates.1,apt-sortpkgs.1}
214 for lang in ${mylangs}; do
215 if [ -e doc/${lang} ]; then
216 doman doc/${lang}/{apt-extracttemplates.${lang}.1,apt-sortpkgs.${lang}.1}