forked from zeromq/zproject
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathzproject_obs.gsl
102 lines (96 loc) · 3.91 KB
/
zproject_obs.gsl
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
# Generate Open Build Service recipes for project
#
# This is a code generator built using the iMatix GSL code generation
# language. See https://github.com/imatix/gsl for details.
#
# Copyright (c) the Contributors as noted in the AUTHORS file.
# This file is part of zproject.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
register_target ("obs", "service for Open Build Service")
.macro target_obs
.if defined (project.repository)
.directory.create ('packaging/obs')
.output "packaging/obs/_service"
<services>
<service name="tar_scm">
<param name="url">$(project.repository)</param>
<param name="scm">git</param>
<param name="versionformat">@PARENT_TAG@+git%cd</param>
<!-- extract redhat packaging -->
<param name="changesgenerate">enable</param>
</service>
<!-- extract redhat packaging -->
<service name="extract_file">
<param name="archive">*.tar</param>
<param name="files">*/packaging/redhat/$(project.name).spec</param>
<param name="outfilename">$(project.name).spec</param>
</service>
<!-- extract debian packaging -->
<service name="extract_file">
<param name="archive">*.tar</param>
<param name="files">*/packaging/debian/$(string.replace (project.name, "_|-"):lower).dsc.obs</param>
<param name="outfilename">$(string.replace (project.name, "_|-"):lower).dsc</param>
</service>
<service name="extract_file">
<param name="archive">*.tar</param>
<param name="files">*/packaging/debian/changelog</param>
<param name="outfilename">debian.changelog</param>
</service>
<service name="extract_file">
<param name="archive">*.tar</param>
<param name="files">*/packaging/debian/compat</param>
<param name="outfilename">debian.compat</param>
</service>
<service name="extract_file">
<param name="archive">*.tar</param>
<param name="files">*/packaging/debian/control</param>
<param name="outfilename">debian.control</param>
</service>
<service name="extract_file">
<param name="archive">*.tar</param>
<param name="files">*/packaging/debian/copyright</param>
<param name="outfilename">debian.copyright</param>
</service>
. if project.has_main | count(project.bin) > 0
<service name="extract_file">
<param name="archive">*.tar</param>
<param name="files">*/packaging/debian/$(string.replace (project.name, "_|-"):lower).install</param>
<param name="outfilename">debian.$(string.replace (project.name, "_|-"):lower).install</param>
</service>
. endif
<service name="extract_file">
<param name="archive">*.tar</param>
<param name="files">*/packaging/debian/format</param>
<param name="outfilename">debian.format</param>
</service>
. if project.exports_classes
<service name="extract_file">
<param name="archive">*.tar</param>
<param name="files">*/packaging/debian/$(string.replace (project.libname, "_|-"))$(project->version.major).install</param>
<param name="outfilename">debian.$(string.replace (project.libname, "_|-"))$(project->version.major).install</param>
</service>
<service name="extract_file">
<param name="archive">*.tar</param>
<param name="files">*/packaging/debian/$(string.replace (project.libname, "_|-"))-dev.install</param>
<param name="outfilename">debian.$(string.replace (project.libname, "_|-"))-dev.install</param>
</service>
. endif
<service name="extract_file">
<param name="archive">*.tar</param>
<param name="files">*/packaging/debian/rules</param>
<param name="outfilename">debian.rules</param>
</service>
<service name="set_version">
<param name="basename">$(string.replace (project.name, "_|-"):lower)</param>
</service>
<service name="recompress">
<param name="file">*.tar</param>
<param name="compression">gz</param>
</service>
</services>
.close
.endif
.endmacro