Contents of /trunk/core/dbus/dbus-1.14.8-r2.smage2
Parent Directory | Revision Log
Revision 33592 -
(show annotations)
(download)
Thu Aug 10 14:46:28 2023 UTC (9 months, 2 weeks ago) by niro
File size: 5073 byte(s)
Thu Aug 10 14:46:28 2023 UTC (9 months, 2 weeks ago) by niro
File size: 5073 byte(s)
-systemd rebuild
1 | # $Id$ |
2 | |
3 | PNAME="dbus" |
4 | PVER="1.14.8" |
5 | PBUILD="r2" |
6 | |
7 | # 1=enable systemd support |
8 | # 0=enable systemd support |
9 | ENABLE_SYSTEMD=1 |
10 | |
11 | # 1=enable x11 support |
12 | # 0=enable x11 support |
13 | ENABLE_X11=0 |
14 | |
15 | SPLIT_PACKAGES="dbus-libs dbus" |
16 | |
17 | PCAT="sys-apps" |
18 | HOMEPAGE="http://www.freedesktop.org/Software/dbus" |
19 | |
20 | LIB_DEPEND=">= virtual/glibc" |
21 | |
22 | # call systemctl depend here because systemd gets always installed after dbus |
23 | DBUS_DEPEND=">= dev-libs/expat-2 |
24 | >= sys-apps/util-linux-2.34" |
25 | |
26 | if [[ ${ENABLE_X11} = 1 ]] |
27 | then |
28 | SPLIT_PACKAGES+=" dbus-x11" |
29 | |
30 | X11_DEPEND=">= x11-libs/libX11-1.6 |
31 | >= x11-libs/libXt-1.1" |
32 | fi |
33 | |
34 | if [[ ${ENABLE_SYSTEMD} = 1 ]] |
35 | then |
36 | DBUS_DEPEND="${DBUS_DEPEND} |
37 | >= sys-libs/libsystemd-243 |
38 | >= sys-apps/systemd-systemctl-243" |
39 | fi |
40 | |
41 | # disable atm |
42 | msetfeature "!check" |
43 | if mqueryfeature "check" |
44 | then |
45 | CHECK_DEPEND=">= dev-libs/dbus-glib-0.112 |
46 | >= dev-python/python2-dbus-1.3" |
47 | else |
48 | CHECK_DEPEND="" |
49 | fi |
50 | |
51 | SDEPEND="${LIB_DEPEND} |
52 | ${DBUS_DEPEND} |
53 | ${CHECK_DEPEND} |
54 | >= app-text/xmlto-0.0.26 |
55 | >= dev-util/pkgconfig-0.25 |
56 | >= app-text/docbook-xml-dtd44-4.4 |
57 | >= app-text/docbook-xsl-stylesheets-1.75" |
58 | |
59 | if [[ ${ENABLE_SYSTEMD} = 1 ]] |
60 | then |
61 | SDEPEND="${SDEPEND} |
62 | >= sys-apps/systemd-243" |
63 | fi |
64 | |
65 | if [[ ${ENABLE_X11} = 1 ]] |
66 | then |
67 | SDEPEND="${SDEPEND} |
68 | ${X11_DEPEND}" |
69 | fi |
70 | |
71 | SRCFILE="${PNAME}-${PVER}.tar.xz" |
72 | SRCDIR="${BUILDDIR}/${PNAME}-${PVER}" |
73 | |
74 | sminclude mtools multilib systemd |
75 | |
76 | SESSION_SCRIPT_REV=2 |
77 | |
78 | SRC_URI=( |
79 | http://dbus.freedesktop.org/releases/${PNAME}/${SRCFILE} |
80 | mirror://${PNAME}/${SRCFILE} |
81 | mirror://${PNAME}/${PNAME}-1.5.8-no-fatal-warnings.patch |
82 | ) |
83 | |
84 | # use subdir $uri/dbus |
85 | UP2SUBDIR="${PNAME}" |
86 | UP2DATE="updatecmd_freedesktop ${PNAME} xz" |
87 | |
88 | split_info_dbus-libs() |
89 | { |
90 | DESCRIPTION="Libraries for accessing D-BUS." |
91 | DEPEND="${LIB_DEPEND}" |
92 | PCAT="sys-libs" |
93 | } |
94 | |
95 | split_info_dbus() |
96 | { |
97 | DESCRIPTION="D-BUS is a message bus system, a simple way for applications to talk to one another." |
98 | DEPEND="== sys-libs/dbus-libs-${PVER} |
99 | ${DBUS_DEPEND}" |
100 | } |
101 | |
102 | if [[ ${ENABLE_X11} ]] |
103 | then |
104 | split_info_dbus-x11() |
105 | { |
106 | DESCRIPTION="X11-requiring add-ons for D-BUS." |
107 | DEPEND="== sys-libs/dbus-libs-${PVER} |
108 | == sys-apps/dbus-${PVER} |
109 | ${X11_DEPEND}" |
110 | } |
111 | fi |
112 | |
113 | pkg_setup() |
114 | { |
115 | preinstall_dbus |
116 | } |
117 | |
118 | src_prepare() |
119 | { |
120 | munpack ${SRCFILE} || die |
121 | |
122 | # do not abort on fatal warnings by default |
123 | mpatch ${PNAME}-1.5.8-no-fatal-warnings.patch || die |
124 | } |
125 | |
126 | src_compile() |
127 | { |
128 | local myopts |
129 | if [[ ${ENABLE_SYSTEMD} = 1 ]] |
130 | then |
131 | myopts+=" --with-systemdsystemunitdir=$(mget-systemd-unit-dir)" |
132 | myopts+=" --enable-systemd" |
133 | myopts+=" --enable-user-session" |
134 | fi |
135 | |
136 | if [[ ${ENABLE_X11} = 1 ]] |
137 | then |
138 | myopts+=" --with-x" |
139 | else |
140 | myopts+=" --without-x" |
141 | fi |
142 | |
143 | # using /lib/systemd/system as systemd units dir even on multilib systems |
144 | # to have one common rules/script directory! |
145 | mconfigure \ |
146 | --with-system-pid-file=/run/dbus.pid \ |
147 | --with-system-socket=/run/dbus/system_bus_socket \ |
148 | --with-session-socket-dir=/tmp \ |
149 | --with-test-socket-dir=/tmp \ |
150 | --with-console-auth-dir=/run/console \ |
151 | --libexecdir=/usr/$(mlibdir)/dbus-1.0 \ |
152 | --localstatedir=/var \ |
153 | --with-dbus-user=messagebus \ |
154 | --with-xml=expat \ |
155 | --disable-verbose-mode \ |
156 | --disable-checks \ |
157 | --disable-asserts \ |
158 | --enable-inotify \ |
159 | --disable-dnotify \ |
160 | --disable-doxygen-docs \ |
161 | ${myopts} \ |
162 | || die |
163 | |
164 | mmake || die |
165 | } |
166 | |
167 | src_install_dbus-libs() |
168 | { |
169 | # fix ln issue on multilib: force overwrite of all symlinks |
170 | mmake DESTDIR=${BINDIR} LN_S="'ln -sf'" -C dbus install-libLTLIBRARIES || die |
171 | } |
172 | |
173 | src_install_dbus() |
174 | { |
175 | # fix ln issue on multilib: force overwrite of all symlinks |
176 | mmake install DESTDIR=${BINDIR} LN_S="'ln -sf'" || die |
177 | # remove libraries provided by the dbus-libs package |
178 | mmake DESTDIR=${BINDIR} LN_S="'ln -sf'" -C dbus uninstall-libLTLIBRARIES || die |
179 | |
180 | if [[ ${ENABLE_X11} = 1 ]] |
181 | then |
182 | # remove dbus-launch provided by dbus-x11 package |
183 | mdelete /usr/bin/dbus-launch || die |
184 | mdelete /usr/share/man/man1/dbus-launch.1 || die |
185 | # remove dbus-run-session provided by dbus-x11 package |
186 | mdelete /usr/bin/dbus-run-session || die |
187 | mdelete /usr/share/man/man1/dbus-run-session.1 || die |
188 | fi |
189 | |
190 | # mark some dirs undeletable |
191 | mkeepdir /var/lib/dbus || die |
192 | mkeepdir /run/dbus || die |
193 | mkeepdir /usr/lib/dbus-1.0/services || die |
194 | mkeepdir /usr/share/dbus-1/services || die |
195 | mkeepdir /etc/dbus-1/system.d || die |
196 | mkeepdir /etc/dbus-1/session.d || die |
197 | |
198 | minstalldocs AUTHORS ChangeLog COPYING HACKING NEWS README || die |
199 | } |
200 | |
201 | if [[ ${ENABLE_X11} = 1 ]] |
202 | then |
203 | src_install_dbus-x11() |
204 | { |
205 | all-abis minstallexec tools/.libs/dbus-launch || die |
206 | all-abis minstallman doc/dbus-launch.1 || die |
207 | |
208 | all-abis minstallexec tools/.libs/dbus-run-session || die |
209 | all-abis minstallman doc/dbus-run-session.1 || die |
210 | } |
211 | fi |
212 | |
213 | preinstall_dbus() |
214 | { |
215 | # adds plugdev group |
216 | mgroupadd -o "-g 302" plugdev |
217 | |
218 | # adds messagebus user |
219 | mgroupadd -o "-g 300" messagebus |
220 | museradd -o "-M -u 300 -g messagebus -d /dev/null -s /bin/false" messagebus |
221 | } |
222 | |
223 | postinstall_dbus() |
224 | { |
225 | # only reload dbus-daemon if already running |
226 | if pidof dbus-daemon > /dev/null |
227 | then |
228 | mreloadunit dbus.service dbus-daemon |
229 | else |
230 | mstartunit dbus.service dbus-daemon |
231 | fi |
232 | } |
233 | |
234 | postremove_dbus() |
235 | { |
236 | mstopunit dbus.service dbus-daemon |
237 | } |