Diff elogind-252.9-r3 with a f2fs-tools-9999

/usr/portage/sys-fs/f2fs-tools/f2fs-tools-9999.ebuild 2024-07-02 13:51:49.421851595 +0300
1
# Copyright 1999-2025 Gentoo Authors
1
# Copyright 1999-2024 Gentoo Authors
2 2
# Distributed under the terms of the GNU General Public License v2
3 3

  
4
EAPI=7
4
EAPI=8
5 5

  
6
PYTHON_COMPAT=( python3_{10..13} )
6
inherit autotools flag-o-matic
7 7

  
8
if [[ ${PV} = *9999* ]]; then
9
	EGIT_BRANCH="v252-stable"
10
	EGIT_REPO_URI="https://github.com/elogind/elogind.git"
8
DESCRIPTION="Tools for Flash-Friendly File System (F2FS)"
9
HOMEPAGE="https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs-tools.git/about/"
10
if [[ ${PV} == *9999 ]]; then
11 11
	inherit git-r3
12
	EGIT_REPO_URI="https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/${PN}.git"
13
	EGIT_BRANCH="dev"
12 14
else
13
	SRC_URI="https://github.com/${PN}/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
14
	KEYWORDS="~alpha amd64 arm arm64 ~hppa ~loong ~mips ppc ppc64 ~riscv ~s390 sparc x86"
15
	SRC_URI="https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/${PN}.git/snapshot/${P}.tar.gz"
16
	KEYWORDS="~amd64 ~arm ~arm64 ~loong ~mips ~ppc ~ppc64 ~riscv ~x86"
15 17
fi
16 18

  
17
inherit linux-info meson pam python-any-r1 udev xdg-utils
18

  
19
DESCRIPTION="The systemd project's logind, extracted to a standalone package"
20
HOMEPAGE="https://github.com/elogind/elogind"
21

  
22
LICENSE="CC0-1.0 LGPL-2.1+ public-domain"
23
SLOT="0"
24
IUSE="+acl audit cgroup-hybrid debug doc +pam +policykit selinux test"
25
RESTRICT="!test? ( test )"
26

  
27
BDEPEND="
28
	app-text/docbook-xml-dtd:4.2
29
	app-text/docbook-xml-dtd:4.5
30
	app-text/docbook-xsl-stylesheets
31
	dev-util/gperf
32
	virtual/pkgconfig
33
	$(python_gen_any_dep 'dev-python/jinja2[${PYTHON_USEDEP}]')
34
	$(python_gen_any_dep 'dev-python/lxml[${PYTHON_USEDEP}]')
35
"
36
DEPEND="
37
	audit? ( sys-process/audit )
19
LICENSE="GPL-2"
20
SLOT="0/10"
21
IUSE="lz4 lzo selinux"
22

  
23
RDEPEND="
24
	lz4? ( app-arch/lz4:= )
25
	lzo? ( dev-libs/lzo:2 )
38 26
	sys-apps/util-linux
39
	sys-libs/libcap
40
	virtual/libudev:=
41
	acl? ( sys-apps/acl )
42
	pam? ( sys-libs/pam )
43 27
	selinux? ( sys-libs/libselinux )
28
	elibc_musl? ( sys-libs/queue-standalone )
44 29
"
45
RDEPEND="${DEPEND}
46
	!sys-apps/systemd
47
"
48
PDEPEND="
49
	sys-apps/dbus
50
	policykit? ( sys-auth/polkit )
51
"
52

  
53
DOCS=( README.md)
54

  
55
PATCHES=(
56
	"${FILESDIR}/${P}-nodocs.patch"
57
	"${FILESDIR}/${P}-musl-lfs.patch"
58
	"${FILESDIR}/${P}-musl-1.2.5.patch"
59
	"${FILESDIR}/${P}-py-exec.patch" # bug 933398
60
)
61

  
62
python_check_deps() {
63
	python_has_version "dev-python/jinja2[${PYTHON_USEDEP}]" &&
64
	python_has_version "dev-python/lxml[${PYTHON_USEDEP}]"
65
}
66

  
67
pkg_setup() {
68
	local CONFIG_CHECK="~CGROUPS ~EPOLL ~INOTIFY_USER ~SIGNALFD ~TIMERFD"
69

  
70
	use kernel_linux && linux-info_pkg_setup
71
}
30
DEPEND="${RDEPEND}"
72 31

  
73 32
src_prepare() {
74
	if use elibc_musl; then
75
		# Some of musl-specific patches break build on the
76
		# glibc systems (like getdents), therefore those are
77
		# only used when the build is done for musl.
78
		PATCHES+=(
79
			"${FILESDIR}/${P}-musl-sigfillset.patch"
80
			"${FILESDIR}/${P}-musl-statx.patch"
81
			"${FILESDIR}/${P}-musl-rlim-max.patch"
82
			"${FILESDIR}/${P}-musl-getdents.patch"
83
			"${FILESDIR}/${P}-musl-gshadow.patch"
84
			"${FILESDIR}/${P}-musl-strerror_r.patch"
85
			"${FILESDIR}/${P}-musl-more-strerror_r.patch"
86
		)
87
	fi
88

  
89 33
	default
90
	xdg_environment_reset
34
	eautoreconf
91 35
}
92 36

  
93 37
src_configure() {
94
	if use cgroup-hybrid; then
95
		cgroupmode="hybrid"
96
	else
97
		cgroupmode="unified"
98
	fi
99

  
100
	python_setup
101

  
102
	EMESON_BUILDTYPE="$(usex debug debug release)"
103

  
104
	local emesonargs=(
105
		-Ddocdir="${EPREFIX}/usr/share/doc/${PF}"
106
		-Dhtmldir="${EPREFIX}/usr/share/doc/${PF}/html"
107
		-Dpamlibdir=$(getpam_mod_dir)
108
		-Dudevrulesdir="${EPREFIX}$(get_udevdir)"/rules.d
109
		--libdir="${EPREFIX}"/usr/$(get_libdir)
110
		-Drootlibdir="${EPREFIX}"/$(get_libdir)
111
		-Drootlibexecdir="${EPREFIX}"/$(get_libdir)/elogind
112
		-Drootprefix="${EPREFIX}/"
113
		-Dbashcompletiondir="${EPREFIX}/usr/share/bash-completion/completions"
114
		-Dman=auto
115
		-Dpolkit=$(usex policykit true false)
116
		-Dsmack=true
117
		-Dcgroup-controller=openrc
118
		-Ddefault-hierarchy=${cgroupmode}
119
		-Ddefault-kill-user-processes=false
120
		-Dacl=$(usex acl true false)
121
		-Daudit=$(usex audit true false)
122
		-Dhtml=$(usex doc auto false)
123
		-Dpam=$(usex pam true false)
124
		-Dselinux=$(usex selinux true false)
125
		-Dtests=$(usex test true false)
126
		-Dutmp=$(usex elibc_musl false true)
127
		-Dmode=release
38
	# -Werror=lto-type-mismatch
39
	# https://bugs.gentoo.org/863896
40
	# Sent an email to linux-f2fs-devel@ but it hasn't been accepted yet...
41
	filter-lto
42

  
43
	local myconf=(
44
		# This is required to install to /sbin, bug #481110
45
		--bindir="${EPREFIX}"/sbin
46
		$(use_with lz4)
47
		$(use_with lzo lzo2)
48
		$(use_with selinux)
128 49
	)
129 50

  
130
	meson_src_configure
51
	econf "${myconf[@]}"
131 52
}
132 53

  
133 54
src_install() {
134
	meson_src_install
135

  
136
	newinitd "${FILESDIR}"/${PN}.init-r1 ${PN}
137

  
138
	sed -e "s|@libdir@|$(get_libdir)|" "${FILESDIR}"/${PN}.conf.in > ${PN}.conf || die
139
	newconfd ${PN}.conf ${PN}
140
}
141

  
142
pkg_postinst() {
143
	udev_reload
144
	if ! use pam; then
145
		ewarn "${PN} will not be managing user logins/seats without USE=\"pam\"!"
146
		ewarn "In other words, it will be useless for most applications."
147
		ewarn
148
	fi
149
	if ! use policykit; then
150
		ewarn "loginctl will not be able to perform privileged operations without"
151
		ewarn "USE=\"policykit\"! That means e.g. no suspend or hibernate."
152
		ewarn
153
	fi
154
	if [[ "$(rc-config list boot | grep elogind)" != "" ]]; then
155
		elog "elogind is currently started from boot runlevel."
156
	elif [[ "$(rc-config list default | grep elogind)" != "" ]]; then
157
		ewarn "elogind is currently started from default runlevel."
158
		ewarn "Please remove elogind from the default runlevel and"
159
		ewarn "add it to the boot runlevel by:"
160
		ewarn "# rc-update del elogind default"
161
		ewarn "# rc-update add elogind boot"
162
	else
163
		elog "elogind is currently not started from any runlevel."
164
		elog "You may add it to the boot runlevel by:"
165
		elog "# rc-update add elogind boot"
166
		elog
167
		elog "Alternatively, you can leave elogind out of any"
168
		elog "runlevel. It will then be started automatically"
169
		if use pam; then
170
			elog "when the first service calls it via dbus, or"
171
			elog "the first user logs into the system."
172
		else
173
			elog "when the first service calls it via dbus."
174
		fi
175
	fi
176

  
177
	for version in ${REPLACING_VERSIONS}; do
178
		if ver_test "${version}" -lt 252.9; then
179
			elog "Starting with release 252.9 the sleep configuration is now done"
180
			elog "in the /etc/elogind/sleep.conf. Should you use non-default sleep"
181
			elog "configuration remember to migrate those to new configuration file."
182
		fi
183
	done
184
}
185

  
186
pkg_postrm() {
187
	udev_reload
55
	default
56
	find "${ED}" -name "*.la" -delete || die
188 57
}
Thank you!