1 | # Copyright 1999-2006 Gentoo Foundation |
---|
2 | # Distributed under the terms of the GNU General Public License v2 |
---|
3 | # $Header: /var/cvsroot/gentoo-x86/media-tv/mythtv/mythtv-0.19_p9163-r1.ebuild,v 1.3 2006/03/16 18:09:13 herbs Exp $ |
---|
4 | |
---|
5 | inherit flag-o-matic multilib eutils debug qt3 |
---|
6 | |
---|
7 | PATCHREV=9163 |
---|
8 | MY_PV="${PV%_*}" |
---|
9 | |
---|
10 | DESCRIPTION="Homebrew PVR project" |
---|
11 | HOMEPAGE="http://www.mythtv.org/" |
---|
12 | SRC_URI="http://www.mythtv.org/mc/${PN}-${MY_PV}.tar.bz2 |
---|
13 | http://dev.gentoo.org/~cardoe/files/${PN}-${MY_PV}-rev${PATCHREV}.patch.bz2" |
---|
14 | |
---|
15 | LICENSE="GPL-2" |
---|
16 | SLOT="0" |
---|
17 | KEYWORDS="~amd64 ~ppc ~x86" |
---|
18 | |
---|
19 | IUSE_VIDEO_CARDS="video_cards_i810 video_cards_nvidia video_cards_via" |
---|
20 | |
---|
21 | IUSE="alsa altivec arts backendonly debug dbox2 dvb dvd frontendonly ieee1394 jack joystick lcd |
---|
22 | lirc mmx oggvorbis opengl xvmc ${IUSE_VIDEO_CARDS}" |
---|
23 | |
---|
24 | RDEPEND=">=media-libs/freetype-2.0 |
---|
25 | >=media-sound/lame-3.93.1 |
---|
26 | || ( ( x11-libs/libX11 |
---|
27 | x11-libs/libXext |
---|
28 | x11-libs/libXinerama |
---|
29 | x11-libs/libXv |
---|
30 | x11-libs/libXrandr |
---|
31 | x11-libs/libXxf86vm |
---|
32 | ) |
---|
33 | virtual/x11 ) |
---|
34 | xvmc? ( |
---|
35 | || ( x11-libs/libXvMC virtual/x11 ) |
---|
36 | video_cards_nvidia? ( media-video/nvidia-glx ) |
---|
37 | video_cards_via? ( || ( x11-drivers/xf86-video-via virtual/x11 ) ) |
---|
38 | video_cards_i810? ( || ( x11-drivers/xf86-video-i810 virtual/x11 ) ) |
---|
39 | ) |
---|
40 | $(qt_min_version 3.3) |
---|
41 | dev-db/mysql |
---|
42 | alsa? ( >=media-libs/alsa-lib-0.9 ) |
---|
43 | arts? ( kde-base/arts ) |
---|
44 | dvd? ( media-libs/libdvdnav |
---|
45 | media-libs/libdts ) |
---|
46 | dvb? ( media-libs/libdvb ) |
---|
47 | jack? ( media-sound/jack-audio-connection-kit ) |
---|
48 | lcd? ( app-misc/lcdproc ) |
---|
49 | lirc? ( app-misc/lirc ) |
---|
50 | oggvorbis? ( media-libs/libvorbis ) |
---|
51 | opengl? ( virtual/opengl ) |
---|
52 | ieee1394? ( >=sys-libs/libraw1394-1.2.0 |
---|
53 | >=sys-libs/libavc1394-0.5.0 |
---|
54 | >=media-libs/libiec61883-1.0.0 ) |
---|
55 | || ( >=net-misc/wget-1.9.1 >=media-tv/xmltv-0.5.34 ) |
---|
56 | !<x11-base/xorg-x11-6.8" |
---|
57 | |
---|
58 | DEPEND="${RDEPEND} |
---|
59 | || ( x11-apps/xinit virtual/x11 )" |
---|
60 | |
---|
61 | PDEPEND="=x11-themes/mythtv-themes-${MY_PV}*" |
---|
62 | |
---|
63 | S="${WORKDIR}/${PN}-${MY_PV}" |
---|
64 | |
---|
65 | MYTHTV_GROUPS="video,audio,plugdev,tty" |
---|
66 | |
---|
67 | pkg_setup() { |
---|
68 | |
---|
69 | if ! built_with_use x11-libs/qt mysql ; then |
---|
70 | eerror "Qt is missing MySQL support. Please add" |
---|
71 | eerror "'mysql' to your USE flags, and re-emerge Qt." |
---|
72 | die "Qt needs MySQL support" |
---|
73 | fi |
---|
74 | |
---|
75 | if ! built_with_use x11-libs/qt opengl ; then |
---|
76 | eerror "Qt requires OpenGL support. Please add" |
---|
77 | eerror "'opengl' to your USE flags, and re-emerge Qt." |
---|
78 | die "Qt needs OpenGL support." |
---|
79 | fi |
---|
80 | |
---|
81 | if ! has_version x11-libs/libXv && ! built_with_use x11-base/xorg-x11 xv; then |
---|
82 | eerror "xorg-x11 is missing XV support. Please add" |
---|
83 | eerror "'xv' to your USE flags, and re-emerge xorg-x11." |
---|
84 | die "xorg-x11 needs XV support" |
---|
85 | fi |
---|
86 | |
---|
87 | if use xvmc && use video_cards_nvidia; then |
---|
88 | echo |
---|
89 | ewarn "You enabled the 'xvmc' USE flag, you must have a GeForce 4 or" |
---|
90 | ewarn "greater to use this. Otherwise, you'll have crashes with MythTV" |
---|
91 | echo |
---|
92 | fi |
---|
93 | |
---|
94 | if built_with_use dev-db/mysql utf8; then |
---|
95 | echo |
---|
96 | ewarn "Your MySQL installation on this machine most likely won't work" |
---|
97 | ewarn "because you compiled it with USE=utf8. Either use another mysql" |
---|
98 | ewarn "server (on another machine) or recompile MySQL without utf8." |
---|
99 | echo |
---|
100 | fi |
---|
101 | |
---|
102 | if has x11-libs/libX11 virtual/x11; then |
---|
103 | echo |
---|
104 | eerror "Congratulations. You've unmasked modular X but somehow managed" |
---|
105 | eerror "to royally screw up its installation. This means you've broke" |
---|
106 | eerror "dependancy checking for ALL your X based apps. You don't have" |
---|
107 | eerror "to believe me but don't insist the dependancies for MythTV are" |
---|
108 | eerror "broken, because it is you that is broken." |
---|
109 | die "You are broken" |
---|
110 | fi |
---|
111 | |
---|
112 | einfo |
---|
113 | einfo "This ebuild now uses a heavily stripped down version of your CFLAGS" |
---|
114 | einfo "Don't complain because your -momfg-fast-speed CFLAG is being stripped" |
---|
115 | einfo "Only additional CFLAG issues that will be addressed are for binary" |
---|
116 | einfo "package building." |
---|
117 | einfo |
---|
118 | } |
---|
119 | |
---|
120 | src_unpack() { |
---|
121 | unpack ${A} |
---|
122 | cd ${S} |
---|
123 | |
---|
124 | #Fixes of the bugs found in the 0.19 release |
---|
125 | |
---|
126 | # Disable these patches to see if those cause trouble |
---|
127 | #epatch "${WORKDIR}"/${PN}-${MY_PV}-rev${PATCHREV}.patch |
---|
128 | |
---|
129 | # Support installing in libdir != lib |
---|
130 | epatch "${FILESDIR}/mythtv-0.19-libdir.patch" |
---|
131 | } |
---|
132 | |
---|
133 | src_compile() { |
---|
134 | local myconf="--prefix=/usr |
---|
135 | --mandir=/usr/share/man |
---|
136 | --libdir-name=$(get_libdir)" |
---|
137 | use alsa || myconf="${myconf} --disable-audio-alsa" |
---|
138 | use arts || myconf="${myconf} --disable-audio-arts" |
---|
139 | use jack || myconf="${myconf} --disable-audio-jack" |
---|
140 | use altivec || myconf="${myconf} --disable-altivec" |
---|
141 | use xvmc && myconf="${myconf} --enable-xvmc" |
---|
142 | myconf="${myconf} |
---|
143 | $(use_enable lirc) |
---|
144 | $(use_enable joystick joystick-menu) |
---|
145 | $(use_enable dbox2) |
---|
146 | $(use_enable dvb) |
---|
147 | $(use_enable dvb dvb-eit) |
---|
148 | --dvb-path=/usr/include |
---|
149 | $(use_enable dvd) |
---|
150 | $(use_enable opengl opengl-vsync) |
---|
151 | $(use_enable ieee1394 firewire) |
---|
152 | --enable-xrandr |
---|
153 | --enable-xv |
---|
154 | --disable-directfb |
---|
155 | --enable-x11 |
---|
156 | --enable-proc-opt" |
---|
157 | |
---|
158 | if use mmx || use amd64; then |
---|
159 | myconf="${myconf} --enable-mmx" |
---|
160 | else |
---|
161 | myconf="${myconf} --disable-mmx" |
---|
162 | fi |
---|
163 | |
---|
164 | if use debug; then |
---|
165 | myconf="${myconf} --compile-type=debug" |
---|
166 | else |
---|
167 | myconf="${myconf} --compile-type=release" |
---|
168 | fi |
---|
169 | |
---|
170 | ## CFLAG cleaning so it compiles |
---|
171 | MARCH=$(get-flag "march") |
---|
172 | MTUNE=$(get-flag "mtune") |
---|
173 | MCPU=$(get-flag "mcpu") |
---|
174 | strip-flags |
---|
175 | filter-flags "-march=*" "-mtune=*" "-mcpu=*" |
---|
176 | filter-flags "-O" "-O?" |
---|
177 | |
---|
178 | if [[ -n "${MARCH}" ]]; then |
---|
179 | myconf="${myconf} --arch=${MARCH}" |
---|
180 | fi |
---|
181 | if [[ -n "${MTUNE}" ]]; then |
---|
182 | myconf="${myconf} --tune=${MTUNE}" |
---|
183 | fi |
---|
184 | if [[ -n "${MCPU}" ]]; then |
---|
185 | myconf="${myconf} --cpu=${MCPU}" |
---|
186 | fi |
---|
187 | |
---|
188 | # myconf="${myconf} --extra-cxxflags=\"${CXXFLAGS}\" --extra-cflags=\"${CFLAGS}\"" |
---|
189 | hasq distcc ${FEATURES} || myconf="${myconf} --disable-distcc" |
---|
190 | hasq ccache ${FEATURES} || myconf="${myconf} --disable-ccache" |
---|
191 | |
---|
192 | if use frontendonly; then |
---|
193 | ##Backend Removal |
---|
194 | ewarn |
---|
195 | ewarn "You are using the experimental feature for only installing the frontend." |
---|
196 | ewarn "You will not get Gentoo support nor support from MythTV upstream for this." |
---|
197 | ewarn "If this breaks, you own both pieces." |
---|
198 | ewarn |
---|
199 | myconf="${myconf} --disable-backend" |
---|
200 | fi |
---|
201 | |
---|
202 | if use backendonly; then |
---|
203 | ##Frontend Removal |
---|
204 | ewarn |
---|
205 | ewarn "You are using the experimental feature for only installing the backend." |
---|
206 | ewarn "You will not get Gentoo support nor support from MythTV upstream for this." |
---|
207 | ewarn "If this breaks, you own both pieces." |
---|
208 | ewarn |
---|
209 | myconf="${myconf} --disable-frontend" |
---|
210 | fi |
---|
211 | |
---|
212 | # let MythTV come up with our CFLAGS. Upstream will support this |
---|
213 | CFLAGS="" |
---|
214 | CXXFLAGS="" |
---|
215 | einfo "Running ./configure ${myconf}" |
---|
216 | ./configure ${myconf} || die "configure died" |
---|
217 | |
---|
218 | ${QTDIR}/bin/qmake QMAKE=${QTDIR}/bin/qmake -o "Makefile" mythtv.pro || die "qmake failed" |
---|
219 | emake || die "emake failed" |
---|
220 | |
---|
221 | } |
---|
222 | |
---|
223 | src_install() { |
---|
224 | |
---|
225 | einstall INSTALL_ROOT="${D}" || die "install failed" |
---|
226 | for doc in AUTHORS COPYING FAQ UPGRADING ChangeLog README; do |
---|
227 | test -e "${doc}" && dodoc ${doc} |
---|
228 | done |
---|
229 | |
---|
230 | if ! use frontendonly; then |
---|
231 | insinto /usr/share/mythtv/database |
---|
232 | doins database/* |
---|
233 | |
---|
234 | exeinto /usr/share/mythtv |
---|
235 | doexe "${FILESDIR}/mythfilldatabase.cron" |
---|
236 | |
---|
237 | newinitd ${FILESDIR}/mythbackend-0.18.2.rc mythbackend |
---|
238 | newconfd ${FILESDIR}/mythbackend-0.18.2.conf mythbackend |
---|
239 | fi |
---|
240 | |
---|
241 | if ! use backendonly; then |
---|
242 | dobin ${FILESDIR}/runmythfe |
---|
243 | |
---|
244 | ewarn "Want MythFrontend to always? Add the following to your" |
---|
245 | ewarn "myth user. i.e. My user is mythtv" |
---|
246 | echo "crontab -e -u mythtv" |
---|
247 | echo "* * * * * /usr/bin/runmythfe &" |
---|
248 | ewarn "And you're all set." |
---|
249 | fi |
---|
250 | dodoc keys.txt docs/*.{txt,pdf} |
---|
251 | dohtml docs/*.html |
---|
252 | |
---|
253 | keepdir /etc/mythtv |
---|
254 | chown -R mythtv "${D}"/etc/mythtv |
---|
255 | keepdir /var/log/mythtv |
---|
256 | chown -R mythtv "${D}"/var/log/mythtv |
---|
257 | |
---|
258 | insinto /usr/share/mythtv/contrib |
---|
259 | doins contrib/* |
---|
260 | } |
---|
261 | |
---|
262 | pkg_preinst() { |
---|
263 | enewuser mythtv -1 "-1" -1 ${MYTHTV_GROUPS} || die "Problem adding mythtv user" |
---|
264 | usermod -G ${MYTHTV_GROUPS} mythtv |
---|
265 | } |
---|
266 | |
---|
267 | pkg_postinst() { |
---|
268 | einfo "Want MythFrontend to alway run? Run the following:" |
---|
269 | echo " #crontab -e -u mythtv" |
---|
270 | einfo "And add the following:" |
---|
271 | echo "* * * * * /usr/bin/runmythfe &" |
---|
272 | echo |
---|
273 | echo |
---|
274 | einfo "To always have MythBackend running and available run the following:" |
---|
275 | echo "rc-update add mythbackend default" |
---|
276 | echo |
---|
277 | ewarn "Your recordings folder must be owned by the user 'mythtv' now" |
---|
278 | echo "chown -R mythtv /path/to/store" |
---|
279 | } |
---|
280 | |
---|