forked from zssfred/cderpm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcde.spec
370 lines (324 loc) · 12.3 KB
/
cde.spec
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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
%ifarch x86_64
%define _archflag -m64
%endif
%ifarch %{ix86}
%define _archflag -m32
%endif
# Set a macro to use for distribution variances
%if 0%{?fedora}
%define _distribution fedora
%endif
%if 0%{?rhel}
%define _distribution rhel
%endif
%if 0%{?epel}
%define _distribution epel
%endif
%if "%{?distsuffix:%{distsuffix}}%{!?distsuffix:0}" == "pclos"
%define _distribution pclos
%endif
Name: cde
Version: 2.3.2
%if "%{_distribution}" == "pclos"
Release: %mkrel 3
%else
Release: 3%{?dist}
%endif
Summary: Common Desktop Environment
Group: User Interface/Desktops
License: LGPLv2+
URL: http://cdesktopenv.sourceforge.net/
# Source is in git. Actual releases can be found here:
# http://sourceforge.net/projects/cdesktopenv/files/
# Source repo can be cloned this way:
# git clone git://git.code.sf.net/p/cdesktopenv/code cdesktopenv-code
# The checkout-cde.sh generates the source archives used by this spec file.
Source0: %{name}-%{version}.tar.gz
Source1: checkout-cde.sh
Source2: dt.conf
Source3: dt.sh
Source4: dt.csh
Source5: dtspc
Source6: cde.desktop
Source7: fonts.alias
Source8: fonts.dir
Source9: dtlogin.service
Patch0: cde-2.2.4-ttdbserver.patch
Patch1: cde-2.3.0-ustat.h.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(id -u -n)
Requires: xinetd
Requires: ksh
%if "%{_distribution}" == "fedora" || "%{_distribution}" == "rhel" || "%{_distribution}" == "epel"
Requires: xorg-x11-xinit
Requires: xorg-x11-utils
Requires: xorg-x11-server-utils
Requires: xorg-x11-server-Xorg
Requires: xorg-x11-fonts-ISO8859-1-100dpi
Requires: xorg-x11-fonts-ISO8859-2-100dpi
Requires: xorg-x11-fonts-ISO8859-9-100dpi
Requires: xorg-x11-fonts-ISO8859-14-100dpi
Requires: xorg-x11-fonts-ISO8859-15-100dpi
Requires: xorg-x11-fonts-100dpi
Requires: xorg-x11-fonts-misc
%endif
%if "%{_distribution}" == "pclos"
Requires: xinit
Requires: xset
Requires: bdftopcf
Requires: x11-server-xorg
Requires: x11-font-misc
# for dtterm terminfo definition
Requires: ncurses-extraterms
%endif
Requires: ncompress
Requires: rpcbind
%if "%{_distribution}" == "fedora" || "%{_distribution}" == "rhel" || "%{_distribution}" == "epel"
BuildRequires: xorg-x11-proto-devel
%if 0%{?rhel} >= 7
%{?systemd_requires}
BuildRequires: motif-devel
BuildRequires: systemd
%endif
%if 0%{?rhel} <= 6
BuildRequires: openmotif-devel
%endif
BuildRequires: patchelf
%endif
%if "%{_distribution}" == "pclos"
BuildRequires: x11-proto-devel
BuildRequires: lib64openmotif4
BuildRequires: lib64openmotif4-devel
%endif
BuildRequires: file
BuildRequires: ksh
BuildRequires: m4
BuildRequires: ncompress
BuildRequires: bison
BuildRequires: byacc
BuildRequires: gcc-c++
%if "%{_distribution}" == "fedora" || "%{_distribution}" == "rhel" || "%{_distribution}" == "epel"
BuildRequires: libXp-devel
BuildRequires: libXt-devel
BuildRequires: libXmu-devel
BuildRequires: libXft-devel
BuildRequires: libXinerama-devel
BuildRequires: libXpm-devel
BuildRequires: libXaw-devel
BuildRequires: libX11-devel
BuildRequires: libXScrnSaver-devel
BuildRequires: libjpeg-turbo-devel
BuildRequires: freetype-devel
BuildRequires: openssl-devel
BuildRequires: tcl-devel
BuildRequires: xorg-x11-xbitmaps
BuildRequires: libXdmcp-devel
BuildRequires: libtirpc-devel
%endif
%if "%{_distribution}" == "pclos"
BuildRequires: lib64xp-devel
BuildRequires: lib64xt-devel
BuildRequires: lib64xmu-devel
BuildRequires: lib64xft-devel
BuildRequires: lib64xinerama-devel
BuildRequires: lib64xpm-devel
BuildRequires: lib64xaw-devel
BuildRequires: lib64x11-devel
BuildRequires: lib64xscrnsaver-devel
BuildRequires: lib64jpeg-devel
BuildRequires: lib64freetype6-devel
BuildRequires: lib64openssl-devel
BuildRequires: lib64tcl-devel
BuildRequires: x11-data-bitmaps
BuildRequires: lib64xdmcp-devel
BuildRequires: lib64tirpc-devel
%endif
BuildRequires: ncurses
# /usr/bin/rpcgen exists in glibc-common in older releases, otherwise we
# have to explicitly pull in the rpcgen package
%if 0%{?rhel} > 7 || 0%{?fedora} > 27
BuildRequires: rpcgen
%endif
%description
CDE is the Common Desktop Environment from The Open Group.
%prep
%setup -q
%patch0 -p1
sed -i -e '1i #define FILE_MAP_OPTIMIZE' programs/dtfile/Utils.c
echo "#define KornShell /bin/ksh" >> config/cf/site.def
echo "#define CppCmd cpp" >> config/cf/site.def
echo "#define YaccCmd bison -y" >> config/cf/site.def
echo "#define HasZlib YES" >> config/cf/site.def
echo "#define DtLocalesToBuild" >> config/cf/site.def
echo "#define RegisterRPC" >> config/cf/site.def
%build
export LANG=C
export LC_ALL=C
export IMAKECPP=cpp
%{__make} World BOOTSTRAPCFLAGS="%{optflags} %{_archflag}"
#sed -i -e 's:mkProd -D :&%{buildroot}:' admin/IntegTools/dbTools/installCDE
%install
srcdir="$(pwd)"
pushd admin/IntegTools/dbTools
export LANG=C
export LC_ALL=C
./installCDE -s "$srcdir" -pseudo -destdir "%{buildroot}" -pI "%{buildroot}%{_prefix}/dt" -pV "%{buildroot}%{_localstatedir}/dt" -pC "%{buildroot}%{_sysconfdir}/dt"
popd
%if "%{_distribution}" == "fedora" || "%{_distributon}" == "rhel" || "%{_distribution}" == "epel"
# Remove the rpath setting from ELF objects.
# XXX: This is a heavy hammer which should really be fixed by not using -rpath
# in the build in the first place. Baby steps.
find %{buildroot}%{_prefix}/dt -type f | while read infile ; do
typ="$(file -b --mime-type $infile)"
if [ "$typ" = "application/x-executable" ] || [ "$typ" = "application/x-sharedlib" ]; then
rpath="$(patchelf --print-rpath $infile >/dev/null 2>&1)"
[ -z "$rpath" ] || patchelf --remove-rpath $infile
fi
done
%endif
# Specific permissions required on some things
chmod 2555 %{buildroot}%{_prefix}/dt/bin/dtmail
# Configuration files
install -D -m 0644 %SOURCE2 %{buildroot}%{_sysconfdir}/ld.so.conf.d/dt.conf
install -D -m 0755 %SOURCE3 %{buildroot}%{_sysconfdir}/profile.d/dt.sh
install -D -m 0755 %SOURCE4 %{buildroot}%{_sysconfdir}/profile.d/dt.csh
install -D -m 0600 contrib/xinetd/ttdbserver %{buildroot}%{_sysconfdir}/xinetd.d/ttdbserver
install -D -m 0600 contrib/xinetd/cmsd %{buildroot}%{_sysconfdir}/xinetd.d/cmsd
install -D -m 0600 %SOURCE5 %{buildroot}%{_sysconfdir}/xinetd.d/dtspc
install -D -m 0644 %SOURCE6 %{buildroot}%{_datadir}/xsessions/cde.desktop
install -D -m 0644 %SOURCE7 %{buildroot}%{_sysconfdir}/dt/config/xfonts/C/fonts.alias
install -D -m 0644 %SOURCE8 %{buildroot}%{_sysconfdir}/dt/config/xfonts/C/fonts.dir
# Documentation
mkdirhier %{buildroot}%{_prefix}/share/doc/%{name}-%{version}
install -D -m 0644 CONTRIBUTORS COPYING README copyright HISTORY %{buildroot}%{_prefix}/share/doc/%{name}-%{version}
%if "%{_distribution}" == "fedora" || "%{_distribution}" == "rhel" || "%{_distribution}" == "epel"
# Install systemd unit file on applicable systems
%if 0%{?rhel} >= 7
install -D -m 0644 %SOURCE9 %{buildroot}%{_unitdir}/dtlogin.service
%endif
# Create terminfo file for dtterm
pushd programs/dtterm
./terminfoCreate < terminfoChecklist > dtterm.terminfo
tic dtterm.terminfo
install -D -m 0644 dtterm %{buildroot}%{_datadir}/terminfo/d/dtterm
popd
%endif
%clean
rm -rf %{buildroot}
%post
PATH=/bin:/usr/bin
# Add 'dtspc' line to /etc/services
grep -qE "^dtspc" /etc/services >/dev/null 2>&1
if [ $? -eq 1 ]; then
echo -e "dtspc\t6112/tcp\t#subprocess control" >> /etc/services
fi
# Make sure rpcbind runs with -i
if [ -f /etc/sysconfig/rpcbind ]; then
. /etc/sysconfig/rpcbind
echo "$RPCBIND_ARGS" | grep -q "\-i" >/dev/null 2>&1
[ $? -eq 1 ] && echo "RPCBIND_ARGS=\"-i\"" >> /etc/sysconfig/rpcbind
else
echo "RPCBIND_ARGS=\"-i\"" >> /etc/sysconfig/rpcbind
fi
# Tell users what needs to happen once they have installed
echo
echo
echo "***************************************"
echo "* Important postinstall steps for CDE *"
echo "***************************************"
echo
echo "1) Enable and start rpcbind:"
if [ -x /usr/bin/systemctl ]; then
echo " systemctl enable rpcbind.service"
echo " systemctl start rpcbind.service"
else
echo " chkconfig rpcbind on"
echo " service rpcbind start"
fi
echo
echo "2) Enable and start xinetd:"
if [ -x /usr/bin/systemctl ]; then
echo " systemctl enable xinetd.service"
echo " systemctl start xinetd.service"
else
echo " chkconfig xinetd on"
echo " service xinetd start"
fi
echo
echo
%postun
PATH=/bin:/usr/bin
TMPDIR="$(mktemp -d)"
# Remove 'dtspc' line from /etc/services
grep -qE "^dtspc" /etc/services >/dev/null 2>&1
if [ $? -eq 0 ]; then
grep -vE "^dtspc\s+6112" /etc/services > $TMPDIR/services
mv $TMPDIR/services /etc/services
fi
rm -rf $TMPDIR
%files
%defattr(-,root,root,-)
%doc CONTRIBUTORS COPYING README copyright HISTORY
%{_prefix}/dt
%attr(1777, root, root) %{_localstatedir}/dt
%config %{_sysconfdir}/ld.so.conf.d/dt.conf
%config %{_sysconfdir}/profile.d/dt.sh
%config %{_sysconfdir}/profile.d/dt.csh
%config %{_sysconfdir}/dt
%config %{_sysconfdir}/xinetd.d/cmsd
%config %{_sysconfdir}/xinetd.d/dtspc
%config %{_sysconfdir}/xinetd.d/ttdbserver
%config %{_sysconfdir}/dt/config/xfonts/C/fonts.alias
%config %{_sysconfdir}/dt/config/xfonts/C/fonts.dir
%{_datadir}/xsessions
%if "%{_distribution}" == "fedora" || "%{_distribution}" == "rhel" || "%{_distribution}" == "epel"
%{_datadir}/terminfo
%endif
%if 0%{?rhel} >= 7
%{_unitdir}/dtlogin.service
%endif
%changelog
* Wed Aug 22 2018 David Cantrell <[email protected]> - 2.3.0-2
- Conditionalize the BR on rpcgen for only recent systems
* Thu Aug 16 2018 David Cantrell <[email protected]> - 2.3.0-1
- Upgrade to CDE 2.3.0
- Use patchelf rather than chrpath in %%install
- Build requires rpcgen
- Replace deprecated/removed ustat(2) calls with statfs(2)
* Tue Sep 05 2017 David Cantrell <[email protected]> - 2.2.4-9
- Create /usr/share/terminfo/d/dtterm entry
* Tue Sep 05 2017 David Cantrell <[email protected]> - 2.2.4-8
- In the postinstall script, check for systemctl in /usr/bin
- Build with libtirpc-devel since that does not work correctly for CDE
on 64-bit platforms right now
- Add systemd unit file for dtlogin for EL-7 and Fedora
* Tue Sep 05 2017 David Cantrell <[email protected]> - 2.2.4-7
- Small fix for libast/ast.h in the dtksh source
- Require xorg-x11-fonts-misc to map to default CDE fonts
* Thu Aug 24 2017 David Cantrell <[email protected]> - 2.2.4-6
- Add fonts.alias and fonts.dir files for /etc/dt/config/xfonts/C
- Patch /etc/xinetd.d/ttdbserver file to enable by default
- Ensure /var/dt is installed with 1777 permissions
- In the RPM postinstall script, tell the user to make sure rpcbind
and xinetd services are enabled
* Tue May 30 2017 David Cantrell <[email protected]> - 2.2.4-5
- Updated spec file for CentOS 7.x building
* Tue May 16 2017 David Cantrell <[email protected]> - 2.2.4-4
- Complete packaging using the installCDE script
- Initial set of configuration files and control scripts
- Runtime requirement on xinetd
- xsession file to support launching CDE from gdm login screen
* Thu May 11 2017 David Cantrell <[email protected]> - 2.2.4-3
- Shift to using installCDE to install the build
- Add ksh as a BuildRequires
* Wed May 10 2017 David Cantrell <[email protected]> - 2.2.4-2
- Sort out the file list and get things moved to the correct place
* Thu Apr 27 2017 David Cantrell <[email protected]> - 2.2.4-1
- First update of this package to CDE 2.2.4
* Thu Aug 23 2012 David Cantrell <[email protected]> - 2.2.0-3.20120816gitce4004f
- Unpack dt.tar in the buildroot, create required directories
- Disable the use of -Wl,-rpath,PATH during the build
* Fri Aug 17 2012 David Cantrell <[email protected]> - 2.2.0-2.20120816gitce4004f
- Use /bin/sh in installation scripts, not /bin/ksh
- Use -m64 and -m32 in BOOTSTRAPCFLAGS to get correct linking
* Thu Aug 16 2012 David Cantrell <[email protected]> - 2.2.0-1.20120816gitce4004f
- Initial packaging attempt