]> Pileus Git - ~andy/sunrise/blob - sys-apps/apt/apt-0.9.7.6.ebuild
app-accessibility/julius: Add ~amd64 keyword, EAPI bump
[~andy/sunrise] / sys-apps / apt / apt-0.9.7.6.ebuild
1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: $
4
5 EAPI="5"
6
7 inherit eutils gnuconfig multilib
8
9 #revision for debian stable versions (e.g. +squeeze)
10 MY_PVR=""
11
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"
15
16 LICENSE="GPL-2+"
17 SLOT="0"
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
22         vi zh_CN zh_TW"
23
24 for lang in $ILINGUAS; do
25         IUSE="${IUSE} linguas_${lang}"
26 done
27 REQUIRED_USE="berkdb? ( apt-pkg )
28         graphviz? ( doc )
29         latex? ( doc )
30         utils? ( apt-pkg )"
31
32 COMMON_DEPEND="sys-libs/zlib
33         berkdb? ( sys-libs/db )"
34 RDEPEND="app-arch/dpkg
35         app-crypt/gnupg
36         virtual/udev
37         ssl? ( net-misc/curl[ssl] )
38         ${COMMON_DEPEND}"
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
43         dev-libs/libxslt
44         dev-util/intltool
45         net-misc/curl[ssl]
46         sys-devel/gettext
47         doc? (
48                 app-doc/doxygen
49                 graphviz? ( media-gfx/graphviz )
50         )
51         ${COMMON_DEPEND}"
52
53 S="${WORKDIR}/${P}${MY_PVR}"
54
55 src_prepare() {
56         strip-linguas $ILINGUAS
57         # Fix broken symlinks
58         gnuconfig_update
59         sed -e 's#xml/docbook/stylesheet/nwalsh#sgml/docbook/xsl-stylesheets#' \
60                 -i doc/manpage-style.xsl || die
61 }
62
63 src_configure() {
64         HAVE_DOT=$(usex graphviz "YES" "NO") econf \
65                 $(use_enable largefile ) \
66                 $(use_enable nls ) \
67                 $(use_enable rpath )
68 }
69
70 src_compile() {
71         # Make the compile process noisy so it's easier to debug for QA
72         emake NOISY=1
73 }
74
75 src_install() {
76         local mydpkglibdir=/usr/$(get_libdir)/dpkg/methods/${PN}
77         local myetcdir=/etc/${PN}
78         local mylangs=
79
80         # Install main binaries
81         dobin bin/apt-{cache,cdrom,config,get,key,mark}
82         exeinto /usr/$(get_libdir)/${PN}/methods
83         doexe bin/methods/*
84         if ! use ssl; then
85                 rm "${D}"/usr/$(get_libdir)/apt/methods/https || die
86         fi
87
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
95
96         # Install lintian overrides
97         insinto /usr/share/lintian/overrides
98         newins "${FILESDIR}"/apt.lintian ${PN}
99
100         # Install configuration examples
101         if use examples; then
102                 insinto /usr/share/doc/${PF}
103                 doins -r docs/examples
104         fi
105
106         # Install API documentation
107         if use doc; then
108                 dohtml -r build/doc/doxygen/html/*.{html,png}
109                 rm "${D}"/usr/share/doc/${PF}/html/files.html || die
110                 if use latex; then
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
115                 fi
116         fi
117
118         # Install main documentation
119         dodoc debian/{changelog,NEWS}
120         if use ssl; then
121                 dodoc debian/apt-transport-https.README
122         fi
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}
127
128         if ! use utils; then
129                 find locale -type f -iname "apt-utils.mo" -delete || die
130         fi
131
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}"
137
138                 insinto /usr/share/locale
139                 doins -r locale/${lang}
140
141                 if [ -e docs/guide.${lang}.html ]; then
142                         dohtml -r docs/guide.${lang}.html
143                 fi
144                 if [ -e docs/offline.${lang}.html ]; then
145                         dohtml -r docs/offline.${lang}.html
146                 fi
147                 if [ -e docs/guide.${lang}.text ]; then
148                         dohtml -r docs/guide.${lang}.text
149                 fi
150                 if [ -e docs/offline.${lang}.text ]; then
151                         dohtml -r docs/offline.${lang}.text
152                 fi
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}
158                 fi
159         done
160         unset lang
161
162         # Install example of sources.list in main configuration area
163         insinto ${myetcdir}
164         doins doc/examples/sources.list
165
166         # Install auto remove configuration
167         insinto ${myetcdir}/apt.conf.d
168         newins debian/apt.conf.autoremove 01autoremove
169
170         # Create other needed configuration directories
171         keepdir ${myetcdir}/preferences.d
172         keepdir ${myetcdir}/sources.list.d
173         keepdir ${myetcdir}/trusted.gpg.d
174
175         # Install log rotation configuration
176         insinto /etc/logrotate.d
177         newins debian/apt.logrotate ${PN}
178
179         # Install apt cront script
180         insinto /etc/cron.daily
181         newins debian/apt.cron.daily ${PN}
182
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}
189
190         # Install apt pkg libraries
191         if use apt-pkg; then
192                 doheader -r include/apt-pkg
193                 dolib.so bin/libapt-inst.so*
194
195                 # Install apt-ftparchive and related docs
196                 if use berkdb; then
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
202                                 fi
203                         done
204                         unset lang
205                         if use examples; then
206                                 dodoc doc/examples/apt-ftparchive.conf
207                         fi
208                 fi
209
210                 # Install apt utility programs and docs
211                 if use utils; then
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}
217                                 fi
218                         done
219                         unset lang
220                 fi
221         fi
222 }