media-libs/portaudio: Version bump
[gentoo.git] / app-pda / barry / barry-0.18.3.ebuild
1 # Copyright 1999-2016 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI=5
6 inherit bash-completion-r1 eutils flag-o-matic gnome2-utils udev
7
8 DESCRIPTION="Sync, backup, program management, and charging for BlackBerry devices"
9 HOMEPAGE="http://www.netdirect.ca/software/packages/barry/"
10 SRC_URI="mirror://sourceforge/barry/${P}.tar.bz2"
11
12 LICENSE="CC-BY-SA-3.0 GPL-2" #See logo/README for CCPL
13 SLOT="0"
14 KEYWORDS="~amd64 ~x86"
15 IUSE="boost desktop doc gui nls static-libs"
16
17 RDEPEND=">=dev-cpp/libxmlpp-2.6:2.6
18         >=dev-libs/glib-2
19         >=dev-libs/libtar-1.2.11-r2
20         >=media-libs/libsdl-1.2
21         >=sys-fs/fuse-2.5
22         sys-libs/zlib
23         virtual/libusb:1
24         boost? ( >=dev-libs/boost-1.33 )
25         desktop? ( >=net-libs/libgcal-0.9.6 )
26         gui? (
27                 dev-cpp/glibmm:2
28                 dev-cpp/gtkmm:2.4
29                 dev-cpp/libglademm:2.4
30                 )"
31 DEPEND="${RDEPEND}
32         virtual/pkgconfig
33         doc? ( >=app-doc/doxygen-1.5.6 )
34         nls? ( >=sys-devel/gettext-0.18.1.1 )"
35
36 DOCS=( AUTHORS ChangeLog KnownBugs NEWS README TODO )
37
38 src_prepare() {
39         epatch "${FILESDIR}"/${PN}-0.18.4-shared_ptr.patch
40
41         append-cxxflags -std=c++11
42
43         sed -i -e 's:plugdev:usb:g' "${S}"/udev/99-blackberry-perms.rules || die
44         sed -i -e '/Icon/s:=.*:=barry:' "${S}"/menu/*.desktop || die
45 }
46
47 src_configure() {
48         econf \
49                 $(use_enable nls) \
50                 $(use_enable static-libs static) \
51                 $(use_enable boost) \
52                 $(use_enable gui) \
53                 $(use_enable desktop) \
54                 --disable-rpath
55 }
56
57 src_compile() {
58         default
59
60         if use doc; then
61                 cd "${S}"
62                 doxygen || die
63         fi
64 }
65
66 src_install() {
67         default
68
69         # docs
70         rm -rf "${S}"/doc/www/*.{php,sh}
71         find "${S}"/doc/www/doxygen/html -name "*.map" -size 0 -exec rm -f {} +
72         use doc && dohtml "${S}"/doc/www/doxygen/html/*
73         rm -rf "${S}"/doc/www
74         dodoc -r "${S}"/doc/*
75
76         # Skipping different (old Fedora) rules 69-blackberry.rules in purpose
77         udev_dorules "${S}"/udev/10-blackberry.rules "${S}"/udev/99-blackberry-perms.rules
78
79         # blacklist for BERRY_CHARGE kernel module
80         insinto /lib/modprobe.d
81         doins "${S}"/modprobe/blacklist-berry_charge.conf
82
83         # pppd options files
84         docinto ppp
85         dodoc "${S}"/ppp/*
86
87         dobashcomp "${S}"/bash/btool "${S}"/bash/bjavaloader
88
89         newicon -s scalable "${S}"/logo/${PN}_logo_icon.svg ${PN}.svg
90         use desktop && domenu "${S}"/menu/barrydesktop.desktop
91         use gui && domenu "${S}"/menu/barrybackup.desktop
92
93         prune_libtool_files
94 }
95
96 pkg_preinst() {
97         gnome2_icon_savelist
98 }
99
100 pkg_postinst() {
101         gnome2_icon_cache_update
102
103         elog "Barry requires you to be a member of the \"usb\" group."
104         ewarn
105         ewarn "Barry and the in-kernel module 'BERRY_CHARGE' are incompatible."
106         ewarn
107         ewarn "Kernel-based USB suspending can discharge your blackberry."
108         ewarn "Use at least kernel 2.6.22 and/or disable CONFIG_USB_SUSPEND."
109         ewarn
110 }
111
112 pkg_postrm() {
113         gnome2_icon_cache_update
114 }