Diff lirc-0.9.4a-r2 with a lirc-0.9.4c

/usr/portage/app-misc/lirc/lirc-0.9.4c.ebuild 2017-03-29 01:10:00.000000000 +0000
3 3

  
4 4
EAPI=6
5 5

  
6
inherit eutils flag-o-matic systemd
6
PYTHON_COMPAT=( python3_4 python3_5 )
7

  
8
inherit eutils flag-o-matic python-single-r1 systemd xdg-utils
7 9

  
8 10
DESCRIPTION="decode and send infra-red signals of many commonly used remote controls"
9 11
HOMEPAGE="http://www.lirc.org/"
......
21 23
LICENSE="GPL-2+"
22 24
SLOT="0"
23 25
KEYWORDS="~amd64 ~ppc ~ppc64 ~x86"
24
IUSE="doc static-libs X audio irman ftdi inputlirc iguanair systemd usb"
26
IUSE="audio doc ftdi gtk inputlirc static-libs systemd usb X"
27

  
28
REQUIRED_USE="
29
	${PYTHON_REQUIRED_USE}
30
	gtk? ( X )
31
"
25 32

  
26 33
S="${WORKDIR}/${MY_P}"
27 34

  
28
REQUIRED_USE="
29
	iguanair? ( irman )
35
COMMON_DEPEND="
36
	${PYTHON_DEPS}
37
	audio? (
38
		>media-libs/portaudio-18
39
		media-libs/alsa-lib
40
	)
41
	dev-python/pyyaml[${PYTHON_USEDEP}]
42
	ftdi? ( dev-embedded/libftdi:0 )
43
	systemd? ( sys-apps/systemd )
44
	usb? ( virtual/libusb:0 )
45
	X? (
46
		x11-libs/libICE
47
		x11-libs/libSM
48
		x11-libs/libX11
49
	)
30 50
"
51

  
31 52
DEPEND="
53
	${COMMON_DEPEND}
54
	dev-libs/libxslt
32 55
	doc? ( app-doc/doxygen )
56
	sys-apps/kmod
57
	sys-kernel/linux-headers
33 58
"
34 59

  
35 60
RDEPEND="
36
	X? (
37
		x11-libs/libX11
38
		x11-libs/libSM
39
		x11-libs/libICE
40
	)
41
	systemd? ( sys-apps/systemd )
42
	audio? (
43
		>media-libs/portaudio-18
44
		media-libs/alsa-lib
61
	${COMMON_DEPEND}
62
	gtk? (
63
		x11-libs/vte[introspection]
64
		dev-python/pygobject[${PYTHON_USEDEP}]
45 65
	)
46
	irman? ( media-libs/libirman )
47
	iguanair? ( app-misc/iguanaIR )
48
	ftdi? ( dev-embedded/libftdi:0 )
49 66
	inputlirc? ( app-misc/inputlircd )
50
	usb? ( virtual/libusb:0 )
51 67
"
52 68

  
53 69
PATCHES=(
54
	"${FILESDIR}"/lirc-0.9.4-doc-path-fix.patch # https://bugs.gentoo.org/show_bug.cgi?id=589246 https://sourceforge.net/p/lirc/tickets/214/
70
	# https://bugs.gentoo.org/show_bug.cgi?id=589246 https://sourceforge.net/p/lirc/tickets/214/
71
	"${FILESDIR}"/lirc-0.9.4-doc-path-fix.patch
55 72
)
56 73

  
57 74
src_configure() {
58
	filter-flags -Wl,-O1
75
	xdg_environment_reset
59 76
	econf \
60
		--localstatedir=/var \
77
		--localstatedir="${EPREFIX}/var" \
61 78
		$(use_enable static-libs static) \
62 79
		$(use_with X x)
63 80
}
64 81

  
65
# Defined src_compile as a workaround for a parallel make issue
66
# See https://bugs.gentoo.org/show_bug.cgi?id=588864
67
# and https://sourceforge.net/p/lirc/tickets/210/
68
src_compile() {
69
	emake lib
70
	emake
71
}
72

  
73 82
src_install() {
74 83
	default
75 84

  
85
	if use !gtk ; then
86
		# lirc-setup requires gtk
87
		rm "${ED%/}"/usr/bin/lirc-setup || die
88
	fi
89

  
76 90
	newinitd "${FILESDIR}"/lircd-0.8.6-r2 lircd
77 91
	newinitd "${FILESDIR}"/lircmd-0.9.4a-r2 lircmd
78 92
	newconfd "${FILESDIR}"/lircd.conf.4 lircd
......
85 99
	newconfd "${FILESDIR}"/irexec-confd irexec
86 100

  
87 101
	keepdir /etc/lirc
88
	if [[ -e "${D}"/etc/lirc/lircd.conf ]]; then
89
		newdoc "${D}"/etc/lirc/lircd.conf lircd.conf.example
102
	if [[ -e "${ED%/}"/etc/lirc/lircd.conf ]]; then
103
		newdoc "${ED%/}"/etc/lirc/lircd.conf lircd.conf.example
90 104
	fi
91 105

  
92
	find "${D}" -name '*.la' -delete || die
106
	find "${ED}" -name '*.la' -delete || die
93 107

  
94 108
	# Avoid QA notice
95
	rm -d "${D}"/var/run/lirc || die
96
	rm -d "${D}"/var/run || die
109
	rm -d "${ED%/}"/var/run/lirc || die
110
	rm -d "${ED%/}"/var/run || die
97 111
}
98 112

  
99 113
pkg_preinst() {
100
	local dir="${EROOT}/etc/modprobe.d"
114
	local dir="${EROOT%/}/etc/modprobe.d"
101 115
	if [[ -a "${dir}"/lirc && ! -a "${dir}"/lirc.conf ]]; then
102 116
		elog "Renaming ${dir}/lirc to lirc.conf"
103 117
		mv -f "${dir}/lirc" "${dir}/lirc.conf" || die
104 118
	fi
105 119

  
106 120
	# copy the first file that can be found
107
	if [[ -f "${EROOT}"/etc/lirc/lircd.conf ]]; then
108
		cp "${EROOT}"/etc/lirc/lircd.conf "${T}"/lircd.conf || die
109
	elif [[ -f "${EROOT}"/etc/lircd.conf ]]; then
110
		cp "${EROOT}"/etc/lircd.conf "${T}"/lircd.conf || die
121
	if [[ -f "${EROOT%/}"/etc/lirc/lircd.conf ]]; then
122
		cp "${EROOT%/}"/etc/lirc/lircd.conf "${T}"/lircd.conf || die
123
	elif [[ -f "${EROOT%/}"/etc/lircd.conf ]]; then
124
		cp "${EROOT%/}"/etc/lircd.conf "${T}"/lircd.conf || die
111 125
		MOVE_OLD_LIRCD_CONF=1
112
	elif [[ -f "${D}"/etc/lirc/lircd.conf ]]; then
113
		cp "${D}"/etc/lirc/lircd.conf "${T}"/lircd.conf || die
126
	elif [[ -f "${ED%/}"/etc/lirc/lircd.conf ]]; then
127
		cp "${ED%/}"/etc/lirc/lircd.conf "${T}"/lircd.conf || die
114 128
	fi
115 129

  
116 130
	# stop portage from touching the config file
117
	if [[ -e "${D}"/etc/lirc/lircd.conf ]]; then
118
		rm -f "${D}"/etc/lirc/lircd.conf || die
131
	if [[ -e "${ED%/}"/etc/lirc/lircd.conf ]]; then
132
		rm -f "${ED%/}"/etc/lirc/lircd.conf || die
119 133
	fi
120 134
}
121 135

  
......
124 138
	# without portage knowing about it
125 139
	# so it will not delete it on unmerge or ever touch it again
126 140
	if [[ -e "${T}"/lircd.conf ]]; then
127
		cp "${T}"/lircd.conf "${EROOT}"/etc/lirc/lircd.conf || die
141
		cp "${T}"/lircd.conf "${EROOT%/}"/etc/lirc/lircd.conf || die
128 142
		if [[ "$MOVE_OLD_LIRCD_CONF" = "1" ]]; then
129 143
			elog "Moved /etc/lircd.conf to /etc/lirc/lircd.conf"
130
			rm -f "${EROOT}"/etc/lircd.conf || die
144
			rm -f "${EROOT%/}"/etc/lircd.conf || die
131 145
		fi
132 146
	fi
133 147

  
134 148
	einfo "The new default location for lircd.conf is inside of"
135
	einfo "/etc/lirc/ directory"
149
	einfo "${EROOT%/}/etc/lirc/ directory"
136 150
}
Thank you!