~ubuntu-branches/ubuntu/quantal/spectacle/quantal

« back to all changes in this revision

Viewing changes to spectacle/spec/spec.tmpl

  • Committer: Bazaar Package Importer
  • Author(s): Fathi Boudra
  • Date: 2010-08-08 20:01:42 UTC
  • Revision ID: james.westby@ubuntu.com-20100808200142-q09anvq02isk4o6n
Tags: upstream-0.18+git19+4768025
ImportĀ upstreamĀ versionĀ 0.18+git19+4768025

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# ##############################################
 
2
# Do NOT Edit the Auto-generated Part!
 
3
# Generated by: spectacle version ${metadata.MyVersion}
 
4
# ##############################################
 
5
#set $str_newline = '\n'
 
6
# >> macros
 
7
#if $extra.content.has_key("macros") and $extra.content.macros.has_key("main")
 
8
$str_newline.join($extra.content.macros.main)
 
9
#end if
 
10
# << macros
 
11
#if $extra.HasStatic
 
12
%define keepstatic 1
 
13
#set $cfgstatic = ""
 
14
#else
 
15
#set $cfgstatic = "--disable-static"
 
16
#end if
 
17
#if $metadata.has_key('Builder')
 
18
#set $Builder = $metadata.Builder
 
19
#else
 
20
## default
 
21
#set $Builder = 'make'
 
22
#end if
 
23
 
 
24
#if $Builder == 'python'
 
25
#if $metadata.has_key("BuildArch") and $metadata.BuildArch == 'noarch'
 
26
%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
 
27
#else
 
28
%{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
 
29
#end if
 
30
#end if
 
31
Name:       ${metadata.Name}
 
32
Summary:    ${metadata.Summary}
 
33
Version:    ${metadata.Version}
 
34
Release:    ${metadata.Release}
 
35
#if $metadata.has_key("Epoch")
 
36
Epoch:      ${metadata.Epoch}
 
37
#set $auto_depend = "%{epoch}:%{version}-%{release}"
 
38
#else
 
39
#set $auto_depend = "%{version}-%{release}"
 
40
#end if
 
41
Group:      ${metadata.Group}
 
42
License:    ${metadata.License}
 
43
#if $metadata.has_key("ExclusiveArch")
 
44
ExclusiveArch:  ${metadata.ExclusiveArch}
 
45
#end if
 
46
#if $metadata.has_key("BuildArch")
 
47
BuildArch:  ${metadata.BuildArch}
 
48
#end if
 
49
#if $metadata.has_key("Prefix")
 
50
Prefix:  ${metadata.Prefix}
 
51
#end if
 
52
#if $metadata.has_key("URL")
 
53
URL:        ${metadata.URL}
 
54
#end if
 
55
## Sources
 
56
#if $metadata.has_key("Sources")
 
57
#set $idx = 0
 
58
#for $source in $metadata.Sources
 
59
Source${idx}:    $source
 
60
#set $idx = $idx + 1
 
61
#end for
 
62
#end if
 
63
Source100:  ${metadata.Name}.yaml
 
64
#if $metadata.has_key("RpmLintIgnore")
 
65
Source101:  ${metadata.Name}-rpmlintrc
 
66
#end if
 
67
## Patches
 
68
#if $metadata.has_key("Patches")
 
69
#set $idx = 0
 
70
#for $patch in $metadata.Patches
 
71
## checking arch namespace prefix
 
72
#if $patch.startswith('arm:')
 
73
#set $arch = '%{arm}'
 
74
#set $patch = $patch[4:]
 
75
#else if $patch.startswith('ix86:')
 
76
#set $arch = '%{ix86}'
 
77
#set $patch = $patch[5:]
 
78
#else
 
79
#set $arch = ""
 
80
#end if
 
81
## end of checking
 
82
#if $arch
 
83
%ifarch $arch
 
84
Patch${idx}:     $patch
 
85
%endif
 
86
#else
 
87
Patch${idx}:     $patch
 
88
#end if
 
89
#set $idx = $idx + 1
 
90
#end for ## each patch
 
91
#end if
 
92
#if 'NoAutoReq' in $metadata
 
93
AutoReq: 0
 
94
#end if
 
95
## Requires
 
96
#if $Builder == 'perl'
 
97
Requires:   perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo \$version))
 
98
#end if
 
99
#if $metadata.has_key("Requires")
 
100
#for $req in $metadata.Requires
 
101
## checking arch namespace prefix
 
102
#if $req.startswith('arm:')
 
103
#set $arch = '%{arm}'
 
104
#set $req = $req[4:]
 
105
#else if $req.startswith('ix86:')
 
106
#set $arch = '%{ix86}'
 
107
#set $req = $req[5:]
 
108
#else
 
109
#set $arch = ""
 
110
#end if
 
111
## end of checking
 
112
#if $arch
 
113
%ifarch $arch
 
114
Requires:   $req
 
115
%endif
 
116
#else
 
117
Requires:   $req
 
118
#end if
 
119
#end for ## each req
 
120
#end if
 
121
#if $metadata.has_key("RequiresPre")
 
122
#for $req in $metadata.RequiresPre
 
123
Requires(pre): $req
 
124
#end for
 
125
#end if
 
126
#if $metadata.has_key("RequiresPreUn")
 
127
#for $req in $metadata.RequiresPreUn
 
128
Requires(preun): $req
 
129
#end for
 
130
#end if
 
131
#if $metadata.has_key("RequiresPost")
 
132
#for $req in $metadata.RequiresPost
 
133
Requires(post): $req
 
134
#end for
 
135
#end if
 
136
#if $metadata.has_key("RequiresPostUn")
 
137
#for $req in $metadata.RequiresPostUn
 
138
Requires(postun): $req
 
139
#end for
 
140
#end if
 
141
## BuildRequires
 
142
#if $metadata.has_key("PkgConfigBR")
 
143
#for $br in $metadata.PkgConfigBR
 
144
## checking arch namespace prefix
 
145
#if $br.startswith('arm:')
 
146
#set $arch = '%{arm}'
 
147
#set $br = $br[4:]
 
148
#else if $br.startswith('ix86:')
 
149
#set $arch = '%{ix86}'
 
150
#set $br = $br[5:]
 
151
#else
 
152
#set $arch = ""
 
153
#end if
 
154
## end of checking
 
155
#if $arch
 
156
%ifarch $arch
 
157
#end if
 
158
#set $br_comps = $br.split()
 
159
#if $len($br_comps) > 1
 
160
BuildRequires:  pkgconfig($br_comps[0])$br[$len($br_comps[0]):]
 
161
#else
 
162
BuildRequires:  pkgconfig($br_comps[0])
 
163
#end if
 
164
#if $arch
 
165
%endif
 
166
#end if
 
167
#end for ## each br
 
168
#end if
 
169
#set $br_locale = ""
 
170
#if $metadata.has_key("PkgBR")
 
171
#for $br in $metadata.PkgBR
 
172
## checking arch namespace prefix
 
173
#if $br.startswith('arm:')
 
174
#set $arch = '%{arm}'
 
175
#set $br = $br[4:]
 
176
#else if $br.startswith('ix86:')
 
177
#set $arch = '%{ix86}'
 
178
#set $br = $br[5:]
 
179
#else
 
180
#set $arch = ""
 
181
#end if
 
182
## end of checking
 
183
#if $br == 'intltool' and not $metadata.has_key("LocaleName") and not $metadata.has_key("NoAutoLocale")
 
184
#set $br_locale = $metadata.Name
 
185
#end if
 
186
#if $arch
 
187
%ifarch $arch
 
188
BuildRequires:  $br
 
189
%endif
 
190
#else
 
191
BuildRequires:  $br
 
192
#end if
 
193
#end for ## each br
 
194
#end if
 
195
## BuildConflicts
 
196
#if $metadata.has_key("BuildConflicts")
 
197
#for $bcfl in $metadata.BuildConflicts
 
198
BuildConflicts: $bcfl
 
199
#end for
 
200
#end if
 
201
#if $metadata.has_key("RunFdupes")
 
202
BuildRequires:  fdupes
 
203
#end if
 
204
#if 'NoAutoProv' in $metadata
 
205
AutoProv: 0
 
206
#end if
 
207
## Provides
 
208
#if $metadata.has_key("Provides")
 
209
#for $prd in $metadata.Provides
 
210
Provides:   $prd
 
211
#end for
 
212
#end if
 
213
## Conflicts
 
214
#if $metadata.has_key("Conflicts")
 
215
#for $cfl in $metadata.Conflicts
 
216
Conflicts:   $cfl
 
217
#end for
 
218
#end if
 
219
## Obsoletes
 
220
#if $metadata.has_key("Obsoletes")
 
221
#for $obs in $metadata.Obsoletes
 
222
Obsoletes:   $obs
 
223
#end for
 
224
#end if
 
225
#if 'SupportOtherDistros' in $metadata
 
226
BuildRoot:  %{_tmppath}/%{name}-%{version}-build
 
227
#end if
 
228
 
 
229
 
 
230
%description
 
231
#if $metadata.has_key("Description")
 
232
${metadata.Description}
 
233
#else
 
234
Description: %{summary}
 
235
#end if
 
236
 
 
237
#if $metadata.has_key("AutoSubPackages")
 
238
#for $sp in $metadata.AutoSubPackages
 
239
%package $sp
 
240
Summary:    Development files for %{name}
 
241
Group:      Development/Libraries
 
242
Requires:   %{name} = $auto_depend
 
243
%description $sp
 
244
Development files for %{name}
 
245
 
 
246
#end for
 
247
#end if
 
248
 
 
249
#if $metadata.has_key("SubPackages")
 
250
#for $sp in $metadata.SubPackages
 
251
#set $sub_extra = $extra.subpkgs[$sp.Name]
 
252
#if $sp.has_key("AsWholeName")
 
253
%package -n $sp.Name
 
254
#else
 
255
%package $sp.Name
 
256
#end if
 
257
Summary:    $sp.Summary
 
258
#if $sp.has_key("License")
 
259
License:    $sp.License
 
260
#end if
 
261
#if $sp.has_key("Group")
 
262
Group:      $sp.Group
 
263
#else
 
264
Group:      ${metadata.Group}
 
265
#end if
 
266
#if $sp.has_key("Version")
 
267
Version:    $sp.Version
 
268
#end if
 
269
#if $sp.has_key("Release")
 
270
Release:    $sp.Release
 
271
#end if
 
272
#if $sp.has_key("Epoch")
 
273
Epoch:    $sp.Epoch
 
274
#end if
 
275
#if $sp.has_key("URL")
 
276
URL:    $sp.URL
 
277
#end if
 
278
#if $sp.has_key("BuildArch")
 
279
BuildArch:    $sp.BuildArch
 
280
#end if
 
281
#if $sp.has_key("Prefix")
 
282
Prefix:    $sp.Prefix
 
283
#end if
 
284
#if 'NoAutoReq' in $sp
 
285
AutoReq:    0
 
286
#end if
 
287
#if 'NoAutoProv' in $sp
 
288
AutoProv:    0
 
289
#end if
 
290
#if $sp.has_key("AutoDepend") and not $metadata.has_key("NoFiles")
 
291
Requires:   %{name} = $auto_depend
 
292
#end if
 
293
#if $sp.has_key("Requires")
 
294
#for $req in $sp.Requires
 
295
## checking arch namespace prefix
 
296
#if $req.startswith('arm:')
 
297
#set $arch = '%{arm}'
 
298
#set $req = $req[4:]
 
299
#else if $req.startswith('ix86:')
 
300
#set $arch = '%{ix86}'
 
301
#set $req = $req[5:]
 
302
#else
 
303
#set $arch = ""
 
304
#end if
 
305
## end of checking
 
306
#if $arch
 
307
%ifarch $arch
 
308
Requires:   $req
 
309
%endif
 
310
#else
 
311
Requires:   $req
 
312
#end if
 
313
#end for ## each req
 
314
#end if
 
315
#if $sp.has_key("RequiresPre")
 
316
#for $req in $sp.RequiresPre
 
317
Requires(pre): $req
 
318
#end for
 
319
#end if
 
320
#if $sp.has_key("RequiresPreUn")
 
321
#for $req in $sp.RequiresPreUn
 
322
Requires(preun): $req
 
323
#end for
 
324
#end if
 
325
#if $sp.has_key("RequiresPost")
 
326
#for $req in $sp.RequiresPost
 
327
Requires(post): $req
 
328
#end for
 
329
#end if
 
330
#if $sp.has_key("RequiresPostUn")
 
331
#for $req in $sp.RequiresPostUn
 
332
Requires(postun): $req
 
333
#end for
 
334
#end if
 
335
## Provides
 
336
#if $sp.has_key("Provides")
 
337
#for $prd in $sp.Provides
 
338
Provides:   $prd
 
339
#end for
 
340
#end if
 
341
## Conflicts
 
342
#if $sp.has_key("Conflicts")
 
343
#for $cfl in $sp.Conflicts
 
344
Conflicts:   $cfl
 
345
#end for
 
346
#end if
 
347
## Obsoletes
 
348
#if $sp.has_key("Obsoletes")
 
349
#for $obs in $sp.Obsoletes
 
350
Obsoletes:   $obs
 
351
#end for
 
352
#end if
 
353
## BR
 
354
#if $sp.has_key("PkgBR")
 
355
#for $br in $sp.PkgBR
 
356
## checking arch namespace prefix
 
357
#if $br.startswith('arm:')
 
358
#set $arch = '%{arm}'
 
359
#set $br = $br[4:]
 
360
#else if $br.startswith('ix86:')
 
361
#set $arch = '%{ix86}'
 
362
#set $br = $br[5:]
 
363
#else
 
364
#set $arch = ""
 
365
#end if
 
366
## end of checking
 
367
#if $arch
 
368
%ifarch $arch
 
369
BuildRequires:   $br
 
370
%endif
 
371
#else
 
372
BuildRequires:   $br
 
373
#end if
 
374
#end for ## each br
 
375
#end if
 
376
## PkgConfigBR
 
377
#if $sp.has_key("PkgConfigBR")
 
378
#for $br in $sp.PkgConfigBR
 
379
## checking arch namespace prefix
 
380
#if $br.startswith('arm:')
 
381
#set $arch = '%{arm}'
 
382
#set $br = $br[4:]
 
383
#else if $br.startswith('ix86:')
 
384
#set $arch = '%{ix86}'
 
385
#set $br = $br[5:]
 
386
#else
 
387
#set $arch = ""
 
388
#end if
 
389
## end of checking
 
390
#if $arch
 
391
%ifarch $arch
 
392
#end if
 
393
#set $br_comps = $br.split()
 
394
#if $len($br_comps) > 1
 
395
BuildRequires:  pkgconfig($br_comps[0])$br[$len($br_comps[0]):]
 
396
#else
 
397
BuildRequires:  pkgconfig($br_comps[0])
 
398
#end if
 
399
#if $arch
 
400
%endif
 
401
#end if
 
402
#end for ## each br
 
403
#end if
 
404
## BuildConflicts
 
405
#if $sp.has_key("BuildConflicts")
 
406
#for $bcfl in $sp.BuildConflicts
 
407
BuildConflicts: $bcfl
 
408
#end for
 
409
#end if
 
410
 
 
411
#if $sp.has_key("AsWholeName")
 
412
%description -n $sp.Name
 
413
#else
 
414
%description $sp.Name
 
415
#end if
 
416
#if $sp.has_key('Description')
 
417
$sp.Description
 
418
#else
 
419
Description: %{summary}
 
420
#end if
 
421
 
 
422
#end for
 
423
#end if
 
424
 
 
425
############################ prep scripts
 
426
%prep
 
427
#if $metadata.has_key("Sources")
 
428
#if $metadata.has_key("NoSetup")
 
429
# No setup
 
430
#else if $metadata.has_key("SetupOptions")
 
431
%setup $metadata.SetupOptions
 
432
#else
 
433
%setup -q -n $metadata.SourcePrefix
 
434
#end if
 
435
 
 
436
#end if ## has Sources
 
437
## Applying patches
 
438
#if $metadata.has_key("Patches")
 
439
#set $idx = 0
 
440
#for $patch in $metadata.Patches
 
441
## checking arch namespace prefix
 
442
#if $patch.startswith('arm:')
 
443
#set $arch = '%{arm}'
 
444
#set $patch = $patch[4:]
 
445
#else if $patch.startswith('ix86:')
 
446
#set $arch = '%{ix86}'
 
447
#set $patch = $patch[5:]
 
448
#else
 
449
#set $arch = ""
 
450
#end if
 
451
## end of checking
 
452
#if $arch
 
453
%ifarch $arch
 
454
#end if
 
455
$metadata.PatchCmts[$idx]
 
456
#if 'PatchOpts' in $metadata
 
457
%patch${idx} $metadata.PatchOpts[$idx]
 
458
#else
 
459
%patch${idx} -p1
 
460
#end if
 
461
#if $arch
 
462
%endif
 
463
#end if
 
464
#set $idx = $idx + 1
 
465
#end for
 
466
#end if
 
467
# >> setup
 
468
#if $extra.content.has_key("setup") and $extra.content.setup.has_key("main")
 
469
$str_newline.join($extra.content.setup.main)
 
470
#end if
 
471
# << setup
 
472
 
 
473
############################ build scripts
 
474
%build
 
475
#if not $metadata.has_key('UseAsNeeded')
 
476
unset LD_AS_NEEDED
 
477
#end if
 
478
# >> build pre
 
479
#if $extra.content.has_key("build") and $extra.content.build.has_key("pre")
 
480
$str_newline.join($extra.content.build.pre)
 
481
#end if
 
482
# << build pre
 
483
 
 
484
############################
 
485
#if $Builder == 'python'
 
486
CFLAGS="\$RPM_OPT_FLAGS" %{__python} setup.py build
 
487
#else if $Builder == 'qmake'
 
488
#set $Configure = 'none'
 
489
qmake-qt4 install_prefix=/usr
 
490
make %{?jobs:-j%jobs}
 
491
#else if $Builder == 'perl'
 
492
if test -f Makefile.PL; then
 
493
%{__perl} Makefile.PL INSTALLDIRS=vendor
 
494
make %{?jobs:-j%jobs}
 
495
else
 
496
%{__perl} Build.PL  --installdirs vendor
 
497
./Build
 
498
fi
 
499
#else
 
500
#######
 
501
#if $metadata.has_key('Configure')
 
502
#set $Configure = $metadata.Configure
 
503
#######
 
504
#else
 
505
## default
 
506
#if $Builder == 'cmake'
 
507
#set $Configure = 'cmake'
 
508
#else
 
509
#set $Configure = 'configure'
 
510
#end if
 
511
#end if
 
512
#######
 
513
#if $Configure == 'autogen'
 
514
%autogen $cfgstatic#slurp
 
515
#else if $Configure == 'cmake'
 
516
mkdir meego-build
 
517
cd meego-build
 
518
cmake .. #slurp
 
519
#else if $Configure == 'configure'
 
520
%configure $cfgstatic#slurp
 
521
#else if $Configure == 'reconfigure'
 
522
%reconfigure $cfgstatic#slurp
 
523
#else if $Configure == 'cmake'
 
524
%reconfigure $cfgstatic#slurp
 
525
#end if
 
526
## any other values fall thru to 'noconfigure'
 
527
#if ( $Configure != 'noconfigure' or $Configure != 'none' ) and $metadata.has_key("ConfigOptions")
 
528
 \
 
529
#set $length = len($metadata.ConfigOptions)
 
530
#set $idx = 1
 
531
#for $opt in $metadata.ConfigOptions
 
532
## checking arch namespace prefix
 
533
#if $opt.startswith('arm:')
 
534
#set $arch = '%{arm}'
 
535
#set $opt = $opt[4:]
 
536
#else if $opt.startswith('ix86:')
 
537
#set $arch = '%{ix86}'
 
538
#set $opt = $opt[5:]
 
539
#else
 
540
#set $arch = ""
 
541
#end if
 
542
## end of checking
 
543
#if $arch
 
544
%ifarch $arch
 
545
#end if
 
546
    $opt#slurp
 
547
#if $idx == $length
 
548
 
 
549
#else
 
550
 \
 
551
#end if
 
552
#if $arch
 
553
%endif
 
554
#end if
 
555
#set $idx = $idx + 1
 
556
#end for
 
557
#end if ## ConfigOptions
 
558
 
 
559
#if $Builder == 'make' or $Builder == 'cmake'
 
560
make %{?jobs:-j%jobs}
 
561
#else if $Builder == 'single-make'
 
562
make
 
563
#else if $Builder != 'no-make' and $Builder != 'none' and $Builder != 'no-builder'
 
564
$Builder
 
565
#end if
 
566
#end if ## Builder == python
 
567
############################
 
568
 
 
569
# >> build post
 
570
#if $extra.content.has_key("build") and  $extra.content.build.has_key("post")
 
571
$str_newline.join($extra.content.build.post)
 
572
#end if
 
573
# << build post
 
574
############################ installation scripts
 
575
%install
 
576
#if 'SupportOtherDistros' in $metadata
 
577
rm -rf \$RPM_BUILD_ROOT
 
578
#else
 
579
rm -rf %{buildroot}
 
580
#end if
 
581
# >> install pre
 
582
#if $extra.content.has_key("install") and  $extra.content.install.has_key("pre")
 
583
$str_newline.join($extra.content.install.pre)
 
584
#end if
 
585
# << install pre
 
586
#if $Builder == 'python'
 
587
#if 'SupportOtherDistros' in $metadata
 
588
%if 0%{?suse_version}
 
589
%{__python} setup.py install --root=\$RPM_BUILD_ROOT --prefix=%{_prefix}
 
590
%else
 
591
%{__python} setup.py install --root=\$RPM_BUILD_ROOT -O1
 
592
%endif
 
593
#else
 
594
%{__python} setup.py install --root=%{buildroot} -O1
 
595
#end if
 
596
#else if $Builder == 'perl'
 
597
if test -f Makefile.PL; then
 
598
make pure_install PERL_INSTALL_ROOT=%{buildroot}
 
599
else
 
600
./Build install --installdirs vendor
 
601
fi
 
602
find %{buildroot} -type f -name .packlist -exec rm -f {} ';'
 
603
find %{buildroot} -depth -type d -exec rmdir {} 2>/dev/null ';'
 
604
find %{buildroot} -type f -name '*.bs' -empty -exec rm -f {} ';'
 
605
%{_fixperms} %{buildroot}/*
 
606
#else if $Builder == 'make' or $Builder == 'single-make' or $Builder == 'qmake' or $Builder == 'cmake'
 
607
#if $Builder == 'qmake'
 
608
#set $extra_install_param="INSTALL_ROOT=%{buildroot}"
 
609
#else
 
610
#set $extra_install_param=""
 
611
#end if
 
612
#if 'SupportOtherDistros' in $metadata
 
613
%if 0%{?moblin_version}
 
614
%make_install $extra_install_param
 
615
%else
 
616
%makeinstall
 
617
%endif
 
618
#else
 
619
#if $Builder == 'cmake'
 
620
cd meego-build
 
621
#end if
 
622
%make_install $extra_install_param
 
623
#end if
 
624
#end if ## of Builder==???
 
625
#if $metadata.has_key("ExtraInstall")
 
626
$metadata.ExtraInstall
 
627
#end if
 
628
 
 
629
# >> install post
 
630
#if $extra.content.has_key("install") and $extra.content.install.has_key("post")
 
631
$str_newline.join($extra.content.install.post)
 
632
#end if
 
633
# << install post
 
634
#if $extra.Desktop
 
635
desktop-file-install --delete-original       \
 
636
  --dir %{buildroot}%{_datadir}/applications             \
 
637
   %{buildroot}%{_datadir}/applications/*.desktop
 
638
#end if
 
639
#if $metadata.has_key("LocaleName")
 
640
#if $metadata.has_key("LocaleOptions")
 
641
#set $localeopt_str = $metadata["LocaleOptions"]
 
642
%find_lang ${metadata.LocaleName} $localeopt_str
 
643
#else
 
644
%find_lang ${metadata.LocaleName}
 
645
#end if
 
646
#else if $br_locale != ""
 
647
%find_lang $br_locale
 
648
#end if
 
649
############################ run fdupes
 
650
#if $metadata.has_key("RunFdupes")
 
651
%fdupes  %{buildroot}/${metadata.RunFdupes}
 
652
#end if
 
653
############################ optional check scripts
 
654
#if $metadata.has_key("Check")
 
655
%check
 
656
# >> check
 
657
#if $extra.content.has_key("check")
 
658
$str_newline.join($extra.content.check.main)
 
659
#else
 
660
#if  $Builder == 'perl'
 
661
if test -f Makefile.PL; then
 
662
make test
 
663
else
 
664
./Build test
 
665
fi
 
666
#else
 
667
make check
 
668
#end if
 
669
#end if
 
670
# << check
 
671
#end if
 
672
 
 
673
############################ Pre
 
674
#set $has_extra_pre = $extra.content.has_key("pre") and $extra.content.pre.has_key("main")
 
675
#if $extra.Schema or $has_extra_pre
 
676
%pre
 
677
## -Schema
 
678
#if $extra.Schema
 
679
if [ "$1" -gt 1 ]; then
 
680
#for $schema in $extra.Schemas
 
681
  export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source`
 
682
  gconftool-2 --makefile-uninstall-rule \
 
683
    $schema \
 
684
    > /dev/null || :
 
685
#end for
 
686
fi
 
687
#end if
 
688
## -Extra pre
 
689
#if $has_extra_pre
 
690
# >> pre
 
691
$str_newline.join($extra.content.pre.main)
 
692
# << pre
 
693
#end if
 
694
#end if
 
695
 
 
696
############################ PreUn
 
697
#set $has_extra_preun = $extra.content.has_key("preun") and $extra.content.preun.has_key("main")
 
698
#if $extra.Schema or $has_extra_preun
 
699
%preun
 
700
## -Schema
 
701
#if $extra.Schema
 
702
if [ "$1" -eq 0 ]; then
 
703
#for $schema in $extra.Schemas
 
704
  export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source`
 
705
  gconftool-2 --makefile-uninstall-rule \
 
706
    $schema \
 
707
    > /dev/null || :
 
708
#end for
 
709
fi
 
710
#end if
 
711
## -Extra preun
 
712
#if $has_extra_preun
 
713
# >> preun
 
714
$str_newline.join($extra.content.preun.main)
 
715
# << preun
 
716
#end if
 
717
#end if
 
718
 
 
719
############################ Post
 
720
#set $has_extra_post = $extra.content.has_key("post") and $extra.content.post.has_key("main") and $extra.content.post.main
 
721
#if $extra.Lib or $extra.Info or $extra.Schema or $extra.Icon or $extra.DesktopDB or $has_extra_post
 
722
#set $only_Lib = not ($extra.Info or $extra.Schema or $extra.Icon or $extra.DesktopDB or $has_extra_post)
 
723
#if $only_Lib
 
724
%post -p /sbin/ldconfig
 
725
#else
 
726
%post
 
727
#end if
 
728
## -Lib
 
729
#if $extra.Lib and not $only_Lib
 
730
/sbin/ldconfig
 
731
#end if
 
732
## -Schema
 
733
#if $extra.Schema
 
734
#for $schema in $extra.Schemas
 
735
export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source`
 
736
gconftool-2 --makefile-install-rule \
 
737
    $schema  > /dev/null || :
 
738
#end for
 
739
#end if
 
740
## -Info
 
741
#if $extra.Info
 
742
#for $inf in $extra.Infos
 
743
%install_info --info-dir=%_infodir $inf
 
744
#end for
 
745
#end if
 
746
## -Icon
 
747
#if $extra.Icon
 
748
/bin/touch --no-create %{_datadir}/icons/hicolor || :
 
749
%{_bindir}/gtk-update-icon-cache \
 
750
  --quiet %{_datadir}/icons/hicolor 2> /dev/null|| :
 
751
#end if
 
752
## -DesktopDB
 
753
#if $extra.DesktopDB
 
754
update-desktop-database %{_datadir}/applications &> /dev/null || :
 
755
#end if
 
756
## -Extra Post Script
 
757
#if $has_extra_post
 
758
# >> post
 
759
$str_newline.join($extra.content.post.main)
 
760
# << post
 
761
#end if
 
762
#end if ## need post
 
763
 
 
764
############################ PostUn
 
765
#set $has_extra_postun = $extra.content.has_key("postun") and $extra.content.postun.has_key("main") and $extra.content.postun.main
 
766
#if $extra.Lib or $extra.Info or $extra.Icon or $extra.DesktopDB or $has_extra_postun
 
767
#set $only_Lib = not ($extra.Info or $extra.Icon or $extra.DesktopDB or $has_extra_postun)
 
768
#if $only_Lib
 
769
%postun -p /sbin/ldconfig
 
770
#else
 
771
%postun
 
772
#end if
 
773
#if $extra.Lib and not $only_Lib
 
774
/sbin/ldconfig
 
775
#end if
 
776
## -Info
 
777
#if $extra.Info
 
778
if [ $1 = 0 ] ;then
 
779
#for $inf in $extra.Infos
 
780
%install_info_delete --info-dir=%{_infodir} $inf
 
781
#end for
 
782
fi
 
783
#end if
 
784
## -Icon
 
785
#if $extra.Icon
 
786
/bin/touch --no-create %{_datadir}/icons/hicolor || :
 
787
%{_bindir}/gtk-update-icon-cache \
 
788
  --quiet %{_datadir}/icons/hicolor 2> /dev/null|| :
 
789
#end if
 
790
## -DesktopDB
 
791
#if $extra.DesktopDB
 
792
update-desktop-database %{_datadir}/applications &> /dev/null || :
 
793
#end if
 
794
## -Extra Postun Script
 
795
#if $has_extra_postun
 
796
# >> postun
 
797
$str_newline.join($extra.content.postun.main)
 
798
# << postun
 
799
#end if
 
800
#end if ## need postun
 
801
 
 
802
########################################
 
803
## Pre/Preun/Post/Postun for SubPackages
 
804
#if $metadata.has_key("SubPackages")
 
805
#for $sp in $metadata.SubPackages
 
806
#if $sp.has_key("AsWholeName")
 
807
#set $pkg_name = "-n " + $sp.Name
 
808
#else
 
809
#set $pkg_name = $sp.Name
 
810
#end if
 
811
#set $sub_extra = $extra.subpkgs[$sp.Name]
 
812
#######################
 
813
## Pre for SubPackages
 
814
#set $has_extra_pre = $extra.content.has_key("pre") and $extra.content.pre.has_key($sp.Name)
 
815
#if $sub_extra.Schema or $has_extra_pre
 
816
%pre $pkg_name
 
817
## -Schema
 
818
#if $sub_extra.Schema
 
819
if [ "$1" -gt 1 ]; then
 
820
#for $schema in $sub_extra.Schemas
 
821
  export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source`
 
822
  gconftool-2 --makefile-uninstall-rule \
 
823
    $schema \
 
824
    > /dev/null || :
 
825
#end for
 
826
fi
 
827
#end if
 
828
## -Extra pre
 
829
#if $has_extra_pre
 
830
# >> pre $sp.Name
 
831
$str_newline.join($extra.content.pre[$sp.Name])
 
832
# << pre $sp.Name
 
833
#end if
 
834
#end if
 
835
 
 
836
#######################
 
837
## Preun for SubPackages
 
838
#set $has_extra_preun = $extra.content.has_key("preun") and $extra.content.preun.has_key($sp.Name)
 
839
#if $sub_extra.Schema or $has_extra_preun
 
840
%preun $pkg_name
 
841
## -Schema
 
842
#if $sub_extra.Schema
 
843
if [ "$1" -eq 0 ]; then
 
844
#for $schema in $sub_extra.Schemas
 
845
  export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source`
 
846
  gconftool-2 --makefile-uninstall-rule \
 
847
    $schema \
 
848
    > /dev/null || :
 
849
#end for
 
850
fi
 
851
#end if
 
852
## -Extra preun
 
853
#if $has_extra_preun
 
854
# >> preun $sp.Name
 
855
$str_newline.join($extra.content.preun[$sp.Name])
 
856
# << preun $sp.Name
 
857
#end if
 
858
#end if
 
859
 
 
860
#######################
 
861
## Post for SubPackages
 
862
#set $has_extra_post = $extra.content.has_key("post") and $extra.content.post.has_key($sp.Name) and $extra.content.post[$sp.Name]
 
863
#if $sub_extra.Lib or $sub_extra.Info or $sub_extra.Icon or $sub_extra.Schema or $sub_extra.DesktopDB or $has_extra_post
 
864
#set $only_Lib = not ($sub_extra.Info or $sub_extra.Icon or $sub_extra.Schema or $sub_extra.DesktopDB or $has_extra_post)
 
865
#if $only_Lib
 
866
%post $pkg_name -p /sbin/ldconfig
 
867
#else
 
868
%post $pkg_name
 
869
#end if
 
870
## -Lib
 
871
#if $sub_extra.Lib and not $only_Lib
 
872
/sbin/ldconfig
 
873
#end if
 
874
## -Schema
 
875
#if $sub_extra.Schema
 
876
#for $schema in $sub_extra.Schemas
 
877
export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source`
 
878
gconftool-2 --makefile-install-rule \
 
879
    $schema  > /dev/null || :
 
880
#end for
 
881
#end if
 
882
## -Info
 
883
#if $sub_extra.Info
 
884
#for $inf in $sub_extra.Infos
 
885
%install_info --info-dir=%_infodir $inf
 
886
#end for
 
887
#end if ## Info
 
888
## -Icon
 
889
#if $sub_extra.Icon
 
890
/bin/touch --no-create %{_datadir}/icons/hicolor || :
 
891
%{_bindir}/gtk-update-icon-cache \
 
892
  --quiet %{_datadir}/icons/hicolor 2> /dev/null|| :
 
893
#end if
 
894
## -DesktopDB
 
895
#if $sub_extra.DesktopDB
 
896
update-desktop-database %{_datadir}/applications &> /dev/null || :
 
897
#end if
 
898
## -Extra Post Script
 
899
#if $has_extra_post
 
900
# >> post $sp.Name
 
901
$str_newline.join($extra.content.post[$sp.Name])
 
902
# << post $sp.Name
 
903
#end if
 
904
#end if ## need post
 
905
 
 
906
#######################
 
907
## PostUn for SubPackages
 
908
#set $has_extra_postun = $extra.content.has_key("postun") and $extra.content.postun.has_key($sp.Name) and $extra.content.postun[$sp.Name]
 
909
#if  $sub_extra.Lib or $sub_extra.Info or $sub_extra.Icon or $sub_extra.DesktopDB or $has_extra_postun
 
910
#set $only_Lib = not ($sub_extra.Info or $sub_extra.Icon or $sub_extra.DesktopDB or $has_extra_postun)
 
911
#if $only_Lib
 
912
%postun $pkg_name -p /sbin/ldconfig
 
913
#else
 
914
%postun $pkg_name
 
915
#end if
 
916
#if $sub_extra.Lib and not $only_Lib
 
917
/sbin/ldconfig
 
918
#end if
 
919
#if $sub_extra.Info
 
920
if [ $1 = 0 ] ;then
 
921
#for $inf in $sub_extra.Infos
 
922
%install_info_delete --info-dir=%{_infodir} $inf
 
923
#end for
 
924
fi
 
925
#end if ## Info
 
926
## -Icon
 
927
#if $sub_extra.Icon
 
928
/bin/touch --no-create %{_datadir}/icons/hicolor || :
 
929
%{_bindir}/gtk-update-icon-cache \
 
930
  --quiet %{_datadir}/icons/hicolor 2> /dev/null|| :
 
931
#end if
 
932
## -DesktopDB
 
933
#if $sub_extra.DesktopDB
 
934
update-desktop-database %{_datadir}/applications &> /dev/null || :
 
935
#end if
 
936
## -Extra Postun Script
 
937
#if $has_extra_postun
 
938
# >> postun $sp.Name
 
939
$str_newline.join($extra.content.postun[$sp.Name])
 
940
# << postun $sp.Name
 
941
#end if
 
942
#end if ## need postun
 
943
#end for ## per subpackage
 
944
#end if ## has subpackages
 
945
 
 
946
#if not $metadata.has_key("NoFiles")
 
947
#if $metadata.has_key("LocaleName")
 
948
%files -f ${metadata.LocaleName}.lang
 
949
#else if $br_locale != ""
 
950
%files -f ${br_locale}.lang
 
951
#else if $metadata.has_key('FilesInput')
 
952
%files -f $metadata.FilesInput
 
953
#else
 
954
%files
 
955
#end if
 
956
%defattr(-,root,root,-)
 
957
## TODO to be cleanup
 
958
#if $metadata.has_key("Documents")
 
959
#for $doc in $metadata.Documents
 
960
%doc $doc
 
961
#end for
 
962
#end if
 
963
#if "Files" in $metadata:
 
964
#for $f in $metadata.Files
 
965
$f
 
966
#end for
 
967
#end if
 
968
# >> files
 
969
#if $extra.content.has_key("files") and $extra.content.files.has_key("main")
 
970
$str_newline.join($extra.content.files.main)
 
971
#end if
 
972
# << files
 
973
#end if ## not NoFiles
 
974
 
 
975
#if $metadata.has_key("AutoSubPackages")
 
976
#for $sp in $metadata.AutoSubPackages
 
977
%files $sp
 
978
%defattr(-,root,root,-)
 
979
# >> files $sp
 
980
#if $extra.content.has_key("files") and $extra.content.files.has_key($sp)
 
981
$str_newline.join($extra.content.files[$sp])
 
982
#end if
 
983
# << files $sp
 
984
 
 
985
#end for
 
986
#end if
 
987
 
 
988
## files for subpkgs
 
989
#if $metadata.has_key("SubPackages")
 
990
#for $sp in $metadata.SubPackages
 
991
#if $sp.has_key("AsWholeName")
 
992
#set $pkg_name = "-n " + $sp.Name
 
993
#else
 
994
#set $pkg_name = $sp.Name
 
995
#end if
 
996
#if $sp.has_key('FilesInput')
 
997
%files $pkg_name -f $sp.FilesInput
 
998
#else
 
999
%files $pkg_name
 
1000
#end if
 
1001
%defattr(-,root,root,-)
 
1002
## TODO to be cleanup
 
1003
#if $sp.has_key("Documents")
 
1004
#for $doc in $sp.Documents
 
1005
%doc $doc
 
1006
#end for
 
1007
#end if
 
1008
#if "Files" in $sp:
 
1009
#for $f in $sp.Files
 
1010
$f
 
1011
#end for
 
1012
#end if
 
1013
# >> files $sp.Name
 
1014
#if $extra.content.has_key("files") and $extra.content.files.has_key($sp.Name)
 
1015
$str_newline.join($extra.content.files[$sp.Name])
 
1016
#end if
 
1017
# << files $sp.Name
 
1018
 
 
1019
#end for
 
1020
#end if