summaryrefslogtreecommitdiff
blob: e29293a0a6cca839f6e5ca91b087612ce588f341 (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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

EAPI=5
inherit systemd toolchain-funcs udev

DESCRIPTION="Split of readahead systemd implementation"
HOMEPAGE="https://dev.gentoo.org/~pacho/systemd-readahead.html"
SRC_URI="https://www.freedesktop.org/software/systemd/systemd-${PV}.tar.xz"

LICENSE="LGPL-2.1 MIT"
SLOT="0"
KEYWORDS="~alpha amd64 ~arm ~ia64 ~ppc ~ppc64 ~sparc x86"
IUSE=""

S=${WORKDIR}/systemd-${PV}

RDEPEND=">=sys-apps/systemd-217:="
DEPEND="${RDEPEND}
	app-arch/xz-utils:0
	dev-util/gperf
	>=dev-util/intltool-0.50
	>=sys-apps/coreutils-8.16
	>=sys-devel/binutils-2.23.1
	>=sys-kernel/linux-headers-3.8
	virtual/pkgconfig
"

src_prepare() {
	# systemd-notify no longer supports readahead playing
	sed -i -e 's:ExecStart=@SYSTEMD_NOTIFY@ --readahead=done:ExecStart=/bin/touch /run/systemd/readahead/done:' \
		units/systemd-readahead-done.service.in || die
}

src_configure() {
	# Keep using the one where the rules were installed.
	MY_UDEVDIR=$(get_udevdir)
	# Fix systems broken by bug #509454.
	[[ ${MY_UDEVDIR} ]] || MY_UDEVDIR=/lib/udev

	local myeconfargs=(
		# disable -flto since it is an optimization flag
		# and makes distcc less effective
		cc_cv_CFLAGS__flto=no

		--enable-readahead

		--disable-maintainer-mode
		--localstatedir=/var
		# make sure we get /bin:/sbin in $PATH
		--enable-split-usr
		# For testing.
		--with-rootprefix="${ROOTPREFIX-/usr}"
		--with-rootlibdir="${ROOTPREFIX-/usr}/$(get_libdir)"
		# disable sysv compatibility
		--with-sysvinit-path=
		--with-sysvrcnd-path=
		# Disable most of the stuff
		--disable-efi
		--disable-ima
		--disable-acl
		--disable-apparmor
		--disable-audit
		--disable-libcryptsetup
		--disable-libcurl
		--disable-gtk-doc
		--disable-elfutils
		--disable-gcrypt
		--disable-gudev
		--disable-microhttpd
		--disable-gnutls
		--disable-libidn
		--disable-introspection
		--disable-kdbus
		--disable-kmod
		--disable-lz4
		--disable-xz
		--disable-pam
		--disable-polkit
		--without-python
		--disable-python-devel
		--disable-qrencode
		--disable-seccomp
		--disable-selinux
		--disable-tests
		--disable-dbus

		--disable-smack
		--disable-blkid
		--disable-multi-seat-x
		--disable-myhostname

		# Disable optional binaries
		--disable-backlight
		--disable-binfmt
		--disable-bootchart
		--disable-coredump
		--disable-firstboot
		--disable-hostnamed
		--disable-localed
		--disable-logind
		--disable-machined
		--disable-networkd
		--disable-quotacheck
		--disable-randomseed
		--disable-resolved
		--disable-rfkill
		--disable-sysusers
		--disable-timedated
		--disable-timesyncd
		--disable-tmpfiles
		--disable-vconsole

		# not supported (avoid automagic deps in the future)
		--disable-chkconfig

		# dbus paths
		--with-dbuspolicydir="${EPREFIX}/etc/dbus-1/system.d"
		--with-dbussessionservicedir="${EPREFIX}/usr/share/dbus-1/services"
		--with-dbussystemservicedir="${EPREFIX}/usr/share/dbus-1/system-services"
		--with-dbusinterfacedir="${EPREFIX}/usr/share/dbus-1/interfaces"
	)

	# Work around bug 463846.
	tc-export CC

	econf "${myeconfargs[@]}"
}

src_compile() {
	echo 'BUILT_SOURCES: $(BUILT_SOURCES)' > "${T}"/Makefile.extra
	emake -f Makefile -f "${T}"/Makefile.extra BUILT_SOURCES

	emake systemd-readahead
	emake units/systemd-readahead-{drop,collect,replay,done}.service units/systemd-readahead-done.timer
	emake man/{sd-readahead.3,sd_readahead.3,systemd-readahead-replay.service.8}
}

src_test() {
	einfo "No specific tests for this"
}

src_install() {
	# Install main app
	exeinto /usr/lib/systemd/
	doexe systemd-readahead

	# Install unit files
	systemd_dounit units/systemd-readahead-{drop,collect,replay,done}.service units/systemd-readahead-done.timer

	# Install manpages and aliases
	doman man/{sd-readahead.3,sd_readahead.3,systemd-readahead-replay.service.8}
	newman man/systemd-readahead-replay.service.8 systemd-readahead-collect.service.8
	newman man/systemd-readahead-replay.service.8 systemd-readahead-done.service.8
	newman man/systemd-readahead-replay.service.8 systemd-readahead-done.timer.8
	newman man/systemd-readahead-replay.service.8 systemd-readahead.8

	# Install docs
	dodoc TODO README
}