net-libs/mbedtls: version bump to 2.5.1
[gentoo.git] / sys-kernel / linux-firmware / linux-firmware-20170519.ebuild
1 # Copyright 1999-2017 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5 inherit savedconfig
6
7 if [[ ${PV} == 99999999* ]]; then
8         inherit git-2
9         SRC_URI=""
10         EGIT_REPO_URI="git://git.kernel.org/pub/scm/linux/kernel/git/firmware/${PN}.git"
11         KEYWORDS=""
12 else
13         GIT_COMMIT="df40d15d6ad617e72ce7ea00b91d9117d92dcccc"
14         SRC_URI="https://git.kernel.org/cgit/linux/kernel/git/firmware/linux-firmware.git/snapshot/linux-firmware-${GIT_COMMIT}.tar.gz -> ${P}.tar.gz"
15         KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
16 fi
17
18 DESCRIPTION="Linux firmware files"
19 HOMEPAGE="https://git.kernel.org/?p=linux/kernel/git/firmware/linux-firmware.git"
20
21 LICENSE="linux-firmware ( BSD ISC MIT no-source-code ) GPL-2 GPL-2+ freedist"
22 SLOT="0"
23 IUSE="savedconfig"
24
25 DEPEND=""
26 RDEPEND="!savedconfig? (
27                 !sys-firmware/alsa-firmware[alsa_cards_ca0132]
28                 !sys-firmware/alsa-firmware[alsa_cards_korg1212]
29                 !sys-firmware/alsa-firmware[alsa_cards_maestro3]
30                 !sys-firmware/alsa-firmware[alsa_cards_sb16]
31                 !sys-firmware/alsa-firmware[alsa_cards_ymfpci]
32                 !media-tv/cx18-firmware
33                 !<sys-firmware/ivtv-firmware-20080701-r1
34                 !media-tv/linuxtv-dvb-firmware[dvb_cards_cx231xx]
35                 !media-tv/linuxtv-dvb-firmware[dvb_cards_cx23885]
36                 !media-tv/linuxtv-dvb-firmware[dvb_cards_usb-dib0700]
37                 !net-dialup/ueagle-atm
38                 !net-dialup/ueagle4-atm
39                 !net-wireless/ar9271-firmware
40                 !net-wireless/i2400m-fw
41                 !net-wireless/libertas-firmware
42                 !sys-firmware/rt61-firmware
43                 !net-wireless/rt73-firmware
44                 !net-wireless/rt2860-firmware
45                 !net-wireless/rt2870-firmware
46                 !sys-block/qla-fc-firmware
47                 !sys-firmware/amd-ucode
48                 !sys-firmware/iwl1000-ucode
49                 !sys-firmware/iwl2000-ucode
50                 !sys-firmware/iwl2030-ucode
51                 !sys-firmware/iwl3945-ucode
52                 !sys-firmware/iwl4965-ucode
53                 !sys-firmware/iwl5000-ucode
54                 !sys-firmware/iwl5150-ucode
55                 !sys-firmware/iwl6000-ucode
56                 !sys-firmware/iwl6005-ucode
57                 !sys-firmware/iwl6030-ucode
58                 !sys-firmware/iwl6050-ucode
59                 !sys-firmware/iwl3160-ucode
60                 !sys-firmware/iwl7260-ucode
61                 !sys-firmware/iwl7265-ucode
62                 !sys-firmware/iwl3160-7260-bt-ucode
63                 !sys-firmware/radeon-ucode
64         )"
65 #add anything else that collides to this
66
67 src_unpack() {
68         if [[ ${PV} == 99999999* ]]; then
69                 git-2_src_unpack
70         else
71                 default
72                 # rename directory from git snapshot tarball
73                 mv ${PN}-*/ ${P} || die
74         fi
75 }
76
77 src_prepare() {
78         default
79         echo "# Remove files that shall not be installed from this list." > ${PN}.conf
80         find * \( \! -type d -and \! -name ${PN}.conf \) >> ${PN}.conf
81
82         if use savedconfig; then
83                 restore_config ${PN}.conf
84                 ebegin "Removing all files not listed in config"
85                 find * \( \! -type d -and \! -name ${PN}.conf \) \
86                         | sort ${PN}.conf ${PN}.conf - \
87                         | uniq -u | xargs -r rm
88                 eend $? || die
89                 # remove empty directories, bug #396073
90                 find -type d -empty -delete || die
91         fi
92 }
93
94 src_install() {
95         if use !savedconfig; then
96                 save_config ${PN}.conf
97         fi
98         rm ${PN}.conf || die
99         insinto /lib/firmware/
100         doins -r *
101 }
102
103 pkg_preinst() {
104         if use savedconfig; then
105                 ewarn "USE=savedconfig is active. You must handle file collisions manually."
106         fi
107 }
108
109 pkg_postinst() {
110         elog "If you are only interested in particular firmware files, edit the saved"
111         elog "configfile and remove those that you do not want."
112 }