aboutsummaryrefslogtreecommitdiff
blob: 63c60e1a1e900784bcbf225a4ff136ce9b4aeb9a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7

PYTHON_COMPAT=( python3_{7,8,9} )
DISTUTILS_OPTIONAL=true

inherit distutils-r1

DESCRIPTION="Scripts to make the life of a Debian Package maintainer easier"
HOMEPAGE="https://salsa.debian.org/debian/devscripts"
SRC_URI="mirror://debian/pool/main/d/${PN}/${PN}_${PV}.tar.xz"

LICENSE="GPL-2+"
SLOT="0"
KEYWORDS="~amd64"
IUSE="python test"
REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
RESTRICT="!test? ( test )"

CDEPEND="
	dev-lang/perl:=
	dev-perl/File-DesktopEntry
	dev-perl/File-DirList
	dev-perl/File-HomeDir
	dev-perl/File-Touch
	dev-perl/IPC-Run
	dev-perl/Moo
	dev-perl/libwww-perl
	dev-util/distro-info
	python? ( ${PYTHON_DEPS} )
"
DEPEND="${CDEPEND}
	test? (
		app-arch/zip
		dev-perl/Git-Wrapper
		dev-perl/GitLab-API-v4
		dev-perl/List-Compare
		dev-perl/Software-License
		dev-perl/String-ShellQuote
		dev-perl/UNIVERSAL-require
		dev-python/pyftpdlib[${PYTHON_USEDEP}]
		dev-python/python-debian[${PYTHON_USEDEP}]
		dev-util/shunit2
		dev-vcs/subversion
		sys-libs/libfaketime
		virtual/perl-DB_File
	)
"
RDEPEND="${CDEPEND}
	app-arch/dpkg
	app-crypt/gnupg
	app-text/wdiff
	dev-util/debhelper
	dev-util/patchutils
	sys-apps/fakeroot
"
BDEPEND="virtual/pkgconfig"

PATCHES=(
	"${FILESDIR}/distutils-r1.patch"
	"${FILESDIR}/Remove-failing-tests.patch"
	"${FILESDIR}/Replace-Debian-xsl-stylesheets-paths-with-Gentoos.patch"
)

DISTUTILS_S="${S}"/scripts

src_prepare() {
	default

	# Avoid file collision with app-shells/bash-completion
	rm "${DISTUTILS_S}"/bts.bash_completion || die
}

src_configure() {
	default

	if use python; then
		pushd "${DISTUTILS_S}" > /dev/null || die
		distutils-r1_src_configure
		popd > /dev/null || die
	fi
}

src_compile() {
	default

	if use python; then
		pushd "${DISTUTILS_S}" > /dev/null || die
		distutils-r1_src_compile
		popd > /dev/null || die
	fi
}

src_install() {
	dodir /usr/bin
	default

	if use python; then
		pushd "${DISTUTILS_S}" > /dev/null || die
		distutils-r1_src_install
		popd > /dev/null || die
	fi

	mv "${ED}"/usr/share/doc/${PN} "${ED}"/usr/share/doc/${PF} || die

	# "incorrect name, no completions for command defined"
	rm "${ED}"/usr/share/bash-completion/completions/{debcheckout,pkgnames} || die
}

src_test() {
	default

	if use python; then
		pushd "${DISTUTILS_S}" > /dev/null || die
		distutils-r1_src_test
		popd > /dev/null || die
	fi
}