forked from xHarbour-org/xharbour
-
Notifications
You must be signed in to change notification settings - Fork 0
/
xharbour.spec
735 lines (610 loc) · 26.7 KB
/
xharbour.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
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
#
# $Id: xharbour.spec,v 1.101 2008/04/28 02:28:07 lculik Exp $
#
# ---------------------------------------------------------------
# Copyright 2003 Przemyslaw Czerpak <[email protected]>,
# Dave Pearson <[email protected]>
# xHarbour RPM spec file
#
# See doc/license.txt for licensing terms.
# ---------------------------------------------------------------
######################################################################
# Conditional build:
# --with static - link all binaries with static libs
# --with mysql - build mysql lib
# --with pgsql - build pgsql lib
# --with odbc - build odbc lib
# --with hrbsh - build /etc/profile.d/harb.sh (not necessary)
# --without adsrdd - do not build ADS RDD
# --without nf - do not build nanforum lib
# --without gpl - do not build libs which needs GPL 3-rd party code
# --without x11 - do not build GTXWC
# --without gpm - build GTTRM, GTSLN and GTCRS without GPM support
# --without gtsln - do not build GTSLN
######################################################################
######################################################################
## Definitions.
######################################################################
# please add your distro suffix if it not belong to the one recognized below
# and remember that order checking can be important
%define platform %(release=$(rpm -q --queryformat='%{VERSION}' mandriva-release-common 2>/dev/null) && echo "mdv$release"|tr -d ".")
%if "%{platform}" == ""
%define platform %(release=$(rpm -q --queryformat='%{VERSION}' mandrake-release 2>/dev/null) && echo "mdk$release"|tr -d ".")
%if "%{platform}" == ""
%define platform %(release=$(rpm -q --queryformat='%{VERSION}' redhat-release 2>/dev/null) && echo "rh$release"|tr -d ".")
%if "%{platform}" == ""
%define platform %(release=$(rpm -q --queryformat='%{VERSION}' fedora-release 2>/dev/null) && echo "fc$release"|tr -d ".")
%if "%{platform}" == ""
%define platform %(release=$(rpm -q --queryformat='%{VERSION}' suse-release 2>/dev/null) && echo "sus$release"|tr -d ".")
%if "%{platform}" == ""
%define platform %(release=$(rpm -q --queryformat='%{VERSION}' conectiva-release 2>/dev/null) && echo "cl$release"|tr -d ".")
%if "%{platform}" == ""
%define platform %(release=$(rpm -q --queryformat='%{VERSION}' aurox-release 2>/dev/null) && echo "aur$release"|tr -d ".")
%if "%{platform}" == ""
%define platform %([ -f /etc/pld-release ] && cat /etc/pld-release|sed -e '/1/ !d' -e 's/[^0-9]//g' -e 's/^/pld/')
%endif
%endif
%endif
%endif
%endif
%endif
%endif
%define hb_ldconf %([ -d /etc/ld.so.conf.d ] && echo /etc/ld.so.conf.d)
%if "%{hb_ldconf}" == ""
%undefine hb_ldconf
%endif
%define name xharbour
%define dname xHarbour
%define version 1.2.3
%define releasen 0
%define hb_pref xhb
%define hb_etcdir /etc/%{name}
%define hb_arch export HB_ARCHITECTURE=linux
%define hb_cc export HB_COMPILER=gcc
%define hb_cflag export C_USR="-O3"
%define hb_lflag export L_USR="${CC_L_USR} %{?_with_static:-static}"
%define hb_mt export HB_MT=MT
%define hb_gt export HB_GT_LIB=gttrm
%define shl_path export LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+${LD_LIBRARY_PATH}:}`pwd`/lib/${HB_PLATFORM}/${HB_COMPILER}${HB_BUILD_NAME}
%define hb_defgt export HB_GT_DEFAULT="${HB_GT_DEFAULT}"
%define hb_gpm export HB_GPM_MOUSE=%{!?_without_gpm:yes}
%define hb_sln export HB_WITHOUT_GTSLN=%{?_without_gtsln:yes}
%define hb_x11 export HB_WITHOUT_X11=%{?_without_x11:yes}
%define hb_bdir export HB_BIN_INSTALL=%{_bindir}
%define hb_idir export HB_INC_INSTALL=%{_includedir}/%{name}
%define hb_ldir export HB_LIB_INSTALL=%{_libdir}/%{name}
%define hb_opt export HB_GTALLEG=%{?_with_allegro:yes}
%define hb_cmrc export HB_COMMERCE=%{?_without_gpl:yes}
%define hb_edir export HB_INSTALL_ETC=${RPM_BUILD_ROOT}%{hb_etcdir}
%define hb_ctrb %{!?_without_nf:libnf} %{!?_without_adsrdd:rdd_ads} %{?_with_mysql:mysql} %{?_with_pgsql:pgsql} %{!?_without_libmisc:misc}
%define hb_env %{hb_arch} ; %{hb_cc} ; %{hb_cflag} ; %{hb_lflag} ; %{hb_mt} ; %{shl_path} ; %{hb_gt} ; %{hb_defgt} ; %{hb_gpm} ; %{hb_sln} ;%{hb_x11} ; %{hb_bdir} ; %{hb_idir} ; %{hb_ldir} ; %{hb_opt} ; %{hb_edir}
%define hb_host www.xharbour.org
%define readme README.RPM
######################################################################
## Preamble.
######################################################################
Summary: Free software Clipper compatible compiler
Summary(pl): Darmowy kompilator kompatybilny z jêzykiem Clipper.
Summary(pt_BR): Um compilador Clipper compativel Gratis
Summary(ru): ó×ÏÂÏÄÎÙÊ ËÏÍÐÉÌÑÔÏÒ, ÓÏ×ÍÅÓÔÉÍÙÊ Ó ÑÚÙËÏÍ Clipper.
Name: %{name}
Version: %{version}
Release: %{releasen}%{platform}
License: GPL (plus exception)
Group: Development/Languages
Vendor: %{hb_host}
URL: http://%{hb_host}/
Source: %{name}-%{version}.src.tar.gz
Packager: Przemyslaw Czerpak <[email protected]> Luiz Rafael Culik Guimaraes <[email protected]>
BuildPrereq: gcc binutils bison bash ncurses ncurses-devel %{!?_without_gpm: gpm-devel}
Requires: gcc binutils bash sh-utils %{name}-lib = %{?epoch:%{epoch}:}%{version}-%{release}
Provides: %{name} harbour
BuildRoot: /tmp/%{name}-%{version}-root
%define _noautoreq 'libxharbour.*'
%description
%{dname} is a CA-Clipper compatible compiler for multiple platforms. This
package includes a compiler, pre-processor, header files, virtual machine
and documentation.
See README.RPM in the documentation directory for information specific to
this RPM distribution.
%description -l pl
%{dname} to kompatybilny z jêzykiem CA-Clipper kompilator rozwijany na
wielu ró¿nych platformach. Ten pakiet zawiera kompilator, preprocesor,
zbiory nag³ówkowe, wirtualn± maszynê oraz dokumentacjê.
%description -l pt_BR
%{dname} ‚ um compilador Clipper compativel para multiplas plataformas.
Esse pacote contem um compilador, um pr‚-processador, arquivos de cabe‡alho
uma maquina virtual e documenta‡Æo.
%description -l ru
%{dname} - ÍÎÏÇÏÐÌÁÔÆÏÒÍÅÎÎÙÊ ËÏÍÐÉÌÑÔÏÒ, ÓÏ×ÍÅÓÔÉÍÙÊ Ó ÑÚÙËÏÍ CA-Clipper.
üÔÏÔ ÐÁËÅÔ ÓÏÄÅÒÖÉÔ ËÏÍÐÉÌÑÔÏÒ, ÐÒÅÐÒÏÃÅÓÓÏÒ, ÆÁÊÌÙ ÚÁÇÏÌÏ×ËÏ×, ×ÉÒÔÕÁÌØÎÕÀ
ÍÁÛÉÎÕ É ÄÏËÕÍÅÎÔÁÃÉÀ.
######################################################################
## main shared lib
######################################################################
%package lib
Summary: Shared runtime libaries for %{dname} compiler
Summary(pl): Dzielone bilioteki dla kompilatora %{dname}
Summary(ru): óÏ×ÍÅÓÔÎÏ ÉÓÐÏÌØÚÕÅÍÙÅ ÂÉÂÌÉÏÔÅËÉ ÄÌÑ ËÏÍÐÉÌÑÔÏÒÁ %{dname}
Group: Development/Languages
Provides: lib%{name}.so lib%{name}mt.so
%description lib
%{dname} is a Clipper compatible compiler.
This package provides %{dname} runtime shared libraries for programs
linked dynamically.
%description -l pl lib
%{dname} to kompatybilny z jêzykiem CA-Clipper kompilator.
Ten pakiet udostêpnia dzielone bilioteki kompilatora %{dname}
dla programów konsolidowanych dynamicznie.
%description -l pt_BR lib
%{dname} ‚ um compilador compativel com o Clipper.
Esse pacote %{dname} provem as bibliotecas compartilhadas para programas
linkados dinamicamente.
%description -l ru lib
%{dname} - ËÏÍÐÉÌÑÔÏÒ, ÓÏ×ÍÅÓÔÉÍÙÊ Ó ÑÚÙËÏÍ CA-Clipper.
üÔÏÔ ÐÁËÅÔ ÓÏÄÅÒÖÉÔ ÓÏ×ÍÅÓÔÎÏ ÉÓÐÏÌØÚÕÅÍÙÅ ÂÉÂÌÉÏÔÅËÉ %{dname},
ÎÅÏÂÈÏÄÉÍÙÅ ÄÌÑ ÒÁÂÏÔÙ ÄÉÎÁÍÉÞÅÓËÉ ÓËÏÍÐÏÎÏ×ÁÎÎÙÈ ÐÒÏÇÒÁÍÍ.
######################################################################
## static libs
######################################################################
%package static
Summary: Static runtime libaries for %{dname} compiler
Summary(pl): Statyczne bilioteki dla kompilatora %{dname}
Summary(ru): óÔÁÔÉÞÅÓËÉÅ ÂÉÂÌÉÏÔÅËÉ ÄÌÑ ËÏÍÐÉÌÑÔÏÒÁ %{dname}
Group: Development/Languages
Requires: %{name} = %{?epoch:%{epoch}:}%{version}-%{release}
%description static
%{dname} is a Clipper compatible compiler.
This package provides %{dname} static runtime libraries for static
program linking.
%description -l pl static
%{dname} to kompatybilny z jêzykiem CA-Clipper kompilator.
Ten pakiet udostêpnia statyczne bilioteki dla kompilatora %{dname}
niezbêdne do statycznej konsolidacji programów.
%description -l pt_BR static
%{dname} ‚ um compilador compativel com o clippe.
Esse pacote %{dname} provem as bibliotecas de run time staticas para linkagem
dos os programas
%description -l ru static
%{dname} - ËÏÍÐÉÌÑÔÏÒ, ÓÏ×ÍÅÓÔÉÍÙÊ Ó ÑÚÙËÏÍ CA-Clipper.
üÔÏÔ ÐÁËÅÔ ÓÏÄÅÒÖÉÔ ÓÔÁÔÉÞÅÓËÉÅ ÂÉÂÌÉÏÔÅËÉ ËÏÍÐÉÌÑÔÏÒÁ %{dname},
ÎÅÏÂÈÏÄÉÍÙÅ ÄÌÑ ÓÔÁÔÉÞÅÓËÏÊ ËÏÍÐÏÎÏ×ËÉ ÐÒÏÇÒÁÍÍ.
%package contrib
Summary: Contrib runtime libaries for %{dname} compiler
Summary(pl): Bilioteki z drzewa contrib dla kompilatora %{dname}
Summary(pt_BR): Libs contrib para %{dname}
Summary(ru): âÉÂÌÉÏÔÅËÉ ÉÚ ÄÅÒÅ×Á contrib ÄÌÑ ËÏÍÐÉÌÑÔÏÒÁ %{dname}
Group: Development/Languages
Requires: %{name} = %{?epoch:%{epoch}:}%{version}-%{release}
%description contrib
%{dname} is a Clipper compatible compiler.
This package provides %{dname} contrib libraries for program linking.
%description -l pl contrib
%{dname} to kompatybilny z jêzykiem CA-Clipper kompilator.
Ten pakiet udostêpnia statyczne bilioteki z drzewa contrib dla
kompilatora %{dname}.
%description -l pt_BR contrib
%{dname} ‚ um compilador compativel com o clippe.
Esse pacote %{dname} provem as bibliotecas contrib para linkagem
dos programas.
%description -l ru contrib
%{dname} - ËÏÍÐÉÌÑÔÏÒ, ÓÏ×ÍÅÓÔÉÍÙÊ Ó ÑÚÙËÏÍ CA-Clipper.
üÔÏÔ ÐÁËÅÔ ÓÏÄÅÒÖÉÔ ÓÔÁÔÉÞÅÓËÉÅ ÂÉÂÌÉÏÔÅËÉ %{dname} ÉÚ ÄÅÒÅ×Á contrib.
######################################################################
## PP
######################################################################
%package pp
Summary: Clipper/Harbour/xBase compatible Pre-Processor, DOT prompt and interpreter
Summary(pl): Kompatybilny z Clipper/Harbour/xBase Preprocesor i interpreter
Summary(ru): óÏ×ÍÅÓÔÉÍÙÊ Ó Clipper/Harbour/xBase ÐÒÅÐÒÏÃÅÓÓÏÒ É ÉÎÔÅÒÐÒÅÔÁÔÏÒ
License: GPL
Group: Development/Languages
Requires: %{name} = %{version}
%description pp
%{dname} is a Clipper compatible compiler.
This package provides %{dname} PP. It has 3 personalities which are tied
tightly together.
1. What is supposed to be 100% Clipper compatible Pre-Processor
(with some extensions).
2. DOT prompt, which suppose to allow most of Clipper syntax.
3. Finally, PP is a limited Clipper/Harbour/xBase Interpreter. Subject
to those same few limitations it can execute most of Harbour syntax.
You can write your own xBase scripts by adding to your .prg files
#!/usr/bin/pprun
%description -l pl pp
%{dname} to kompatybilny z jêzykiem CA-Clipper kompilator.
Ten pakiet udostêpnia %{dname} PP, który daje trzy narzêdzia w jednym.
1. W 100% kompatybilny z Clipperem preprocesor (z pewnymi rozeszerzeniami)
2. ¦rodowisko DOT, w którym mo¿na u¿ywaæ wiêkszo¶ci sk³adni Clippera
3. PP to tak¿e nieco ograniczony interpreter Clippera. Z uwzglêdnieniem
wspomnianych kilku ograniczeñ potrafi on uruchomiæ wiêkszo¶æ sk³adni
Harbour. Mo¿esz napisaæ swój w³asny skrypt xBase dodaj±c do pliku .prg
#!/usr/bin/pprun
%description -l pt_BR pp
%{dname} ‚ um compilador Clipper compativel.
Esse pacote provem o %{dname} PP. Ele tem 3 caracteristicas dependentes
uma da outra.
1. Que e supostamente ser um Pre-Processor 100% compativel com o Clipper
(com algumas extenssäes).
2. DOT prompt, que supostamente permite a maioria das syntaxes do Clipper.
3. Finalmente, PP ‚ um limitado Interpretador Clipper/Harbour/xBase . Sujeito
com algumas limita‡äes que pode executar a maioria da syntaxe do Harbour.
Voce pode escrever seus proprios scritps em .prg ao adicionar as seus arquivos
.prg #!/usr/bin/pprun
%description -l ru pp
%{dname} - ËÏÍÐÉÌÑÔÏÒ, ÓÏ×ÍÅÓÔÉÍÙÊ Ó ÑÚÙËÏÍ CA-Clipper.
üÔÏÔ ÐÁËÅÔ ÓÏÄÅÒÖÉÔ ÐÒÅÐÒÏÃÅÓÓÏÒ %{dname}, ËÏÔÏÒÙÊ ÓÏÓÔÏÉÔ ÉÚ ÔÒÅÈ ÔÅÓÎÏ
Ó×ÑÚÁÎÎÙÈ ÞÁÓÔÅÊ.
1. 100%-ÓÏ×ÍÅÓÔÉÍÙÊ Ó Clipper ÐÒÅÐÒÏÃÅÓÓÏÒ (Ó ÎÅËÏÔÏÒÙÍÉ ÒÁÓÛÉÒÅÎÉÑÍÉ).
2. DOT Prompt, × ËÏÔÏÒÏÍ ÍÏÖÎÏ ÉÓÐÏÌØÚÏ×ÁÔØ ÂÏÌØÛÉÎÓÔ×Ï ËÏÎÓÔÒÕËÃÉÊ Clipper.
3. ëÒÏÍÅ ÔÏÇÏ, PP - ÏÇÒÁÎÉÞÅÎÎÙÊ ÉÎÔÅÒÐÒÅÔÁÔÏÒ Clipper. úÁ ÉÓËÌÀÞÅÎÉÅÍ
ÎÅÓËÏÌØËÉÈ ÏÐÉÓÁÎÎÙÈ ÏÇÒÁÎÉÞÅÎÉÊ, ÏÎ ÍÏÖÅÔ ×ÙÐÏÌÎÑÔØ ÂÏÌØÛÉÎÓÔ×Ï
ËÏÎÓÔÒÕËÃÉÊ Harbour. íÏÖÎÏ ÓÏÚÄÁ×ÁÔØ ÓÏÂÓÔ×ÅÎÎÙÅ xBase-ÓËÒÉÐÔÙ ÐÕÔÅÍ
ÄÏÂÁ×ÌÅÎÉÑ × ÎÁÞÁÌÏ .prg-ÆÁÊÌÁ ÓÔÒÏËÉ:
#!/usr/bin/pprun
######################################################################
## Preperation.
######################################################################
%prep
%setup -c %{name}
rm -rf $RPM_BUILD_ROOT
######################################################################
## Build.
######################################################################
%build
%{hb_env}
case "`uname -m`" in
*[_@]64)
export C_USR="$C_USR -fPIC"
;;
esac
make %{?_smp_mflags}
# build contrib libraries
for l in %{hb_ctrb}
do
(cd "contrib/$l"
make -r %{?_smp_mflags})
done
######################################################################
## Install.
######################################################################
# Install harbour itself.
%install
%{hb_env}
case "`uname -m`" in
*[_@]64)
export C_USR="$C_USR -fPIC"
;;
esac
export _DEFAULT_BIN_DIR=$HB_BIN_INSTALL
export _DEFAULT_INC_DIR=$HB_INC_INSTALL
export _DEFAULT_LIB_DIR=$HB_LIB_INSTALL
export HB_BIN_INSTALL=$RPM_BUILD_ROOT/$HB_BIN_INSTALL
export HB_INC_INSTALL=$RPM_BUILD_ROOT/$HB_INC_INSTALL
export HB_LIB_INSTALL=$RPM_BUILD_ROOT/$HB_LIB_INSTALL
mkdir -p $HB_BIN_INSTALL
mkdir -p $HB_INC_INSTALL
mkdir -p $HB_LIB_INSTALL
make install %{?_smp_mflags}
# install contrib libraries
for l in %{hb_ctrb}
do
(cd "contrib/$l"
make -r -i install %{?_smp_mflags})
done
[ "%{?_with_odbc:1}" ] || rm -f $HB_LIB_INSTALL/libhbodbc.a
[ "%{?_with_allegro:1}" ] || rm -f $HB_LIB_INSTALL/libgtalleg.a
[ "%{?_without_gtsln:1}" ] && rm -f $HB_LIB_INSTALL/libgtsln.a
rm -fR %{!?hb_ldconf:$HB_INSTALL_ETC/ld.so.conf.d}
rm -f %{?hb_ldconf:$RPM_BUILD_ROOT/%{_libdir}/*.so*}
# Keep the size of the binaries to a minimim.
strip $HB_BIN_INSTALL/harbour
# Keep the size of the libraries to a minimim.
strip --strip-debug $HB_LIB_INSTALL/*
#mkdir -p $RPM_BUILD_ROOT%{_mandir}/man1
#install -m644 doc/man/*.1* $RPM_BUILD_ROOT%{_mandir}/man1/
mkdir -p $RPM_BUILD_ROOT/etc/harbour
install -m644 source/rtl/gtcrs/hb-charmap.def $RPM_BUILD_ROOT/etc/harbour/hb-charmap.def
cat > $RPM_BUILD_ROOT/etc/harbour.cfg <<EOF
CC=gcc
CFLAGS=-c -I$_DEFAULT_INC_DIR -O3
VERBOSE=YES
DELTMP=YES
EOF
if [ "%{?_with_hrbsh:1}" ]; then
mkdir -p $RPM_BUILD_ROOT/etc/profile.d
cat > $RPM_BUILD_ROOT/etc/profile.d/harb.sh <<EOF
%{hb_cc}
%{hb_arch}
%{hb_bdir}
%{hb_idir}
%{hb_ldir}
%{hb_gt}
export HB_LEX="SIMPLEX"
export C_USR="-O3"
EOF
chmod 755 $RPM_BUILD_ROOT/etc/profile.d/harb.sh
fi
# check if we should rebuild tools with shared libs
if [ "%{!?_with_static:1}" ]
then
unset HB_GTALLEG
export L_USR="${CC_L_USR} -L${HB_LIB_INSTALL} -l%{name} -lncurses %{!?_without_gtsln:-lslang} %{!?_without_gpm:-lgpm} %{!?_without_x11:-L/usr/X11R6/%{_lib} -lX11}"
#export L_USR="${CC_L_USR} -L${HB_LIB_INSTALL} -l%{name} -lncurses %{!?_without_gtsln:-lslang} %{!?_without_gpm:-lgpm} %{!?_without_x11:-L/usr/X11R6/%{_lib} -lX11} %{?_with_allegro:%(allegro-config --static)}"
export PRG_USR="\"-D_DEFAULT_INC_DIR='${_DEFAULT_INC_DIR}'\" ${PRG_USR}"
for utl in hbmake hbrun hbpp hbdoc xbscript
do
(cd "utils/${utl}"
rm -fR "./${HB_ARCHITECTURE}"
make -r install %{?_smp_mflags}
strip "${HB_BIN_INSTALL}/${utl}")
done
fi
ln -s xbscript ${HB_BIN_INSTALL}/pprun
ln -s xbscript ${HB_BIN_INSTALL}/xprompt
# remove unused files
rm -f ${HB_BIN_INSTALL}/hbdoc ${HB_BIN_INSTALL}/hbtest
# Create a README file for people using this RPM.
cat > doc/%{readme} <<EOF
This RPM distribution of %{dname} includes extra commands to make compiling
and linking with %{dname} a little easier. There are compiler and linker
wrappers called "%{hb_pref}cc", "%{hb_pref}cmp", "%{hb_pref}lnk" and "%{hb_pref}mk".
"%{hb_pref}cc" is a wrapper to the C compiler only. It sets all flags
and paths necessary to compile .c files which include %{dname} header
files. The result of its work is an object file.
Use "%{hb_pref}cmp" exactly as you would use the harbour compiler itself.
The main difference with %{hb_pref}cmp is that it results in an object file,
not a C file that needs compiling down to an object. %{hb_pref}cmp also
ensures that the harbour include directory is seen by the harbour compiler.
"%{hb_pref}lnk" simply takes a list of object files and links them together
with the harbour virtual machine and run-time library to produce an
executable. The executable will be given the basename of the first object
file if not directly set by the "-o" command line switch.
"%{hb_pref}mk" tries to produce an executable from your .prg file. It's a simple
equivalent of cl.bat from the CA-Clipper distribution.
All these scripts accept command line switches:
-o<outputfilename> # output file name
-static # link with static %{dname} libs
-fullstatic # link with all static libs
-shared # link with shared libs (default)
-mt # link with multi-thread libs
-gt<hbgt> # link with <hbgt> GT driver, can be repeated to
# link with more GTs. The first one will be
# the default at runtime
-xbgtk # link with xbgtk library (xBase GTK+ interface)
-hwgui # link with HWGUI library (GTK+ interface)
-l<libname> # link with <libname> library
-L<libpath> # additional path to search for libraries
-fmstat # link with the memory statistics lib
-nofmstat # do not link with the memory statistics lib (default)
-[no]strip # strip (no strip) binaries
-main=<main_func> # set the name of main program function/procedure.
# if not set then 'MAIN' is used or if it doesn't
# exist the name of first public function/procedure
# in first linked object module (link)
Link options work only with "%{hb_pref}lnk" and "%{hb_pref}mk" and have no effect
in "%{hb_pref}cc" and "%{hb_pref}cmp".
Other options are passed to %{dname}/C compiler/linker.
An example compile/link session looks like:
----------------------------------------------------------------------
druzus@uran:~/tmp$ cat foo.prg
function main()
? "Hello, World!"
return nil
druzus@uran:~/tmp$ %{hb_pref}cmp foo
xHarbour Compiler build 0.80.0 (SimpLex)
Copyright 1999-2005, http://www.xharbour.org http://www.harbour-project.org/
Compiling 'foo.prg'...
Lines 5, Functions/Procedures 2
Generating C source output to 'foo.c'... Done.
druzus@uran:~/tmp$ %{hb_pref}lnk foo.o
druzus@uran:~/tmp$ strip foo
druzus@uran:~/tmp$ ls -l foo
-rwxrwxr-x 1 druzus druzus 3824 maj 17 02:46 foo
----------------------------------------------------------------------
or using %{hb_pref}mk only:
----------------------------------------------------------------------
druzus@uran:~/tmp$ cat foo.prg
function main()
? "Hello, World!"
return nil
druzus@uran:~/tmp$ %{hb_pref}mk foo
xHarbour Compiler build 0.80.0 (SimpLex)
Copyright 1999-2005, http://www.xharbour.org http://www.harbour-project.org/
Compiling 'foo.prg'...
Lines 5, Functions/Procedures 2
Generating C source output to 'foo.c'... Done.
druzus@uran:~/tmp$ ls -l foo
-rwxrwxr-x 1 druzus druzus 3824 maj 17 02:46 foo
----------------------------------------------------------------------
In this RPM you will find additional wonderful tools: /usr/bin/pprun
You can run clipper/xbase compatible source files with it if you only
put in their first line:
#!/usr/bin/pprun
For example:
----------------------------------------------------------------------
druzus@uran:~/tmp$ cat foo.prg
#!/usr/bin/pprun
function main()
? "Hello, World!, This is a script !!! :-)"
return nil
druzus@uran:~/tmp$ chmod +x foo.prg
druzus@uran:~/tmp$ ./foo.prg
I hope this RPM is useful. Have fun with %{dname}.
Many thanks to Dave Pearson <[email protected]>
Przemyslaw Czerpak <[email protected]>
EOF
######################################################################
## Post install
######################################################################
%post lib
/sbin/ldconfig
######################################################################
## Post uninstall
######################################################################
#%postun lib
#/sbin/ldconfig
######################################################################
## Clean.
######################################################################
%clean
rm -rf $RPM_BUILD_ROOT
######################################################################
## File list.
######################################################################
%files
%defattr(-,root,root,755)
%doc ChangeLog*
%doc doc/*.txt
%doc doc/%{readme}
%doc doc/en/
%doc doc/es/
%dir /etc/harbour
%verify(not md5 mtime) %config /etc/harbour.cfg
%verify(not md5 mtime) %config /etc/harbour/hb-charmap.def
%{?_with_hrbsh:/etc/profile.d/harb.sh}
%{_bindir}/harbour
%{_bindir}/hb-mkslib
%{_bindir}/%{hb_pref}-build
%{_bindir}/%{hb_pref}cc
%{_bindir}/%{hb_pref}cmp
%{_bindir}/%{hb_pref}lnk
%{_bindir}/%{hb_pref}mk
#%{_bindir}/hbtest
%{_bindir}/hbrun
%{_bindir}/hbpp
%{_bindir}/hbmake
#%{_mandir}/man1/*.1*
%dir %{_includedir}/%{name}
%attr(644,root,root) %{_includedir}/%{name}/*
%files static
%defattr(644,root,root,755)
%dir %{_libdir}/%{name}
%{_libdir}/%{name}/libcodepage.a
%{_libdir}/%{name}/libcommon.a
%{_libdir}/%{name}/libdb*.a
%{_libdir}/%{name}/libbmdbfcdx*.a
%{_libdir}/%{name}/libdebug.a
%{_libdir}/%{name}/libfm*.a
%{_libdir}/%{name}/libgt*.a
%{_libdir}/%{name}/libct*.a
%{_libdir}/%{name}/libtip*.a
%{?_with_odbc: %{_libdir}/%{name}/libhbodbc.a}
%{_libdir}/%{name}/liblang.a
%{_libdir}/%{name}/libmacro*.a
%{_libdir}/%{name}/libnulsys*.a
%{_libdir}/%{name}/libpp*.a
%{_libdir}/%{name}/librdd*.a
%{_libdir}/%{name}/libusrrdd*.a
%{_libdir}/%{name}/libhsx*.a
%{_libdir}/%{name}/libhbsix*.a
%{_libdir}/%{name}/librtl*.a
%{_libdir}/%{name}/libzlib*.a
%{_libdir}/%{name}/libpcre*.a
%{_libdir}/%{name}/libvm*.a
%{_libdir}/%{name}/libcgi*.a
#%{_libdir}/%{name}/libmisc*.a
%files contrib
%defattr(-,root,root,755)
%dir %{_libdir}/%{name}
%{!?_without_nf: %{_libdir}/%{name}/libnf*.a}
%{!?_without_adsrdd: %{_libdir}/%{name}/librddads*.a}
%{!?_without_libmisc:%{_libdir}/%{name}/libmisc*.a}
%{?_with_mysql: %{_libdir}/%{name}/libmysql*.a}
%{?_with_pgsql: %{_libdir}/%{name}/libhbpg*.a}
%files lib
%defattr(755,root,root,755)
%dir %{_libdir}/%{name}
%{_libdir}/%{name}/libxharbour*.so*
%{!?hb_ldconf:%{_libdir}/libxharbour*.so*}
%files pp
%defattr(-,root,root,755)
%doc utils/xbscript/xbscript.txt
%{_bindir}/xbscript
%{_bindir}/pprun
%{_bindir}/xprompt
######################################################################
## Spec file Changelog.
######################################################################
%changelog
* Sat Dec 04 2004 Przemyslaw Czerpak <druzus/at/priv.onet.pl>
- the destination directories changed to use ditribution's
_bindir, _libdir, _includedir
* Sat Aug 28 2004 Przemyslaw Czerpak <druzus/at/priv.onet.pl>
- updated for recent changes in CVS structure - CT and TIP moved
from contrib into core
* Sun Mar 07 2004 Phil Krylov <[email protected]>
- Russian translation added.
* Thu Sep 11 2003 Przemyslaw Czerpak <[email protected]>
- automatic platform checking - now MDK and RH, please add others
* Sat Aug 09 2003 Przemyslaw Czerpak <[email protected]>
- removed ${RPM_OPT_FLAGS} from C_USR
* Wed Jul 23 2003 Przemyslaw Czerpak <[email protected]>
- fixed file (user and group) owner for RPMs builded from non root account
- shared lib names changed from [x]harbour{mt,}.so to
[x]harbour{mt,}-<version>.so and soft links with short names created
- 0.82 version set
* Wed Apr 30 2003 Przemyslaw Czerpak <[email protected]>
- new tool "%{hb_pref}-build" (%{hb_pref}cmp, %{hb_pref}lnk, %{hb_pref}mk) added -
compiler/linker wrapper.
- new tool "hb-mkslib" (build shared libraries from static ones and object
files).
- shared libraries added.
- binary package divided.
* Fri Mar 08 2002 Dave Pearson <[email protected]>
- Fixed gharbour so that it should work no matter the case of the name of
the PRG file.
* Wed Feb 13 2002 Dave Pearson <[email protected]>
- Fixed a bug in harbour-link which meant that, since the environment
changes of Jan 17 2002, users could not specify which GT library they
wanted their application linked against.
* Tue Jan 22 2002 Dave Pearson <[email protected]>
- Used the "name" macro a lot more, especially in some paths.
* Thu Jan 17 2002 Dave Pearson <[email protected]>
- Removed the use of the /etc/profile.d scripts for setting the
harbour environment variables. The settings are now placed
directly in gharbour and harbour-link. This means that this .spec
file should be more useful on RPM using platforms other than RedHat.
* Wed Dec 19 2001 Dave Pearson <[email protected]>
- Added a platform ID to the name of the RPM.
* Mon Dec 17 2001 Dave Pearson <[email protected]>
- todo.txt is now called TODO.
* Tue Aug 21 2001 Dave Pearson <[email protected]>
- Added todo.txt as a doc file.
* Sun Jul 22 2001 Dave Pearson <[email protected]>
- harbour-link now fully respects the setting of $HB_GT_LIB.
- HB_GT_LIB wasn't set in the csh startup script. Fixed.
* Fri Jul 20 2001 Dave Pearson <[email protected]>
- Added the setting of $HB_GT_LIB to the environment (ncurses is used).
- Added support for installing hbmake.
* Mon Mar 19 2001 Dave Pearson <[email protected]>
- Reinstated hbrun in the files section.
* Tue Feb 20 2001 Dave Pearson <[email protected]>
- Added README.RPM to the documentation directory.
* Sat Jan 06 2001 Dave Pearson <[email protected]>
- The gharbour script now passes the harbour include directory, using -I,
to harbour.
* Thu Aug 24 2000 Dave Pearson <[email protected]>
- Changed the files section so that hbrun doesn't get installed. It isn't
useful on GNU/Linux systems.
* Tue Aug 22 2000 Dave Pearson <[email protected]>
- Changed the 'egcs' requirement to 'gcc'.
* Mon Aug 21 2000 Przemyslaw Czerpak <[email protected]>
- Polish translation added
- BuildRoot marco added. Now you can build the package from normal user
account.
- bison and flex added to BuildPrereq list
- Debug information is stripped from installed files.
* Wed Aug 02 2000 Dave Pearson <[email protected]>
- Removed hbtest from the list of files installed into the bin directory.
- Added 'bash' and 'sh-utils' to the list of required packages.
* Tue Aug 01 2000 Dave Pearson <[email protected]>
- Added harbour environment scripts to /etc/profile.d.
- Added generation of gharbour and harbour-link commands.
* Mon Jul 31 2000 Dave Pearson <[email protected]>
- Re-worked the layout of the spec file to make it cleaner and easier to
read and maintain.
- The latest harbour ChangeLog is now installed into the RPM's doc
directory.
- The content of the RPM's doc directory reflects the layout and content of
the harbour source's doc directory.