forked from zeromq/zproject
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathzproject_debian.gsl
231 lines (211 loc) · 6.6 KB
/
zproject_debian.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
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
# Generate debian 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 ("debian", "packaging for Debian")
.macro target_debian
.for project.main where main.service ?= 1
. systemd = 1
.endfor
.directory.create ('packaging/debian')
.output "packaging/debian/changelog"
$(project.name:lower) ($(->version.major).$(->version.minor).$(->version.patch)) UNRELEASED; urgency=low
* Initial packaging.
-- $(project.name) Developers <$(project.email)> Wed, 31 Dec 2014 00:00:00 +0000
.output "packaging/debian/compat"
9
.output "packaging/debian/control"
#
# $(project.name) - $(project.description?'':)
#
. for project.license
# $(string.trim (license.):block )
. endfor
Source: $(string.replace (project.name, "_|-"):lower)
Section: net
Priority: optional
Maintainer: $(project.name) Developers <$(project.email)>
Standards-Version: 3.9.7
Build-Depends: debhelper (>= 9),
pkg-config,
dh-autoreconf,
.for project.use
.if defined(use.debian_name)
$(use.debian_name),
.elsif regexp.match("^lib", use.libname)
$(string.replace (use.libname, "_|-"))-dev,
.else
lib$(string.replace (use.libname, "_|-"))-dev,
.endif
.endfor
.if systemd ?= 1
systemd,
dh-systemd,
.endif
Build-Depends-Indep: asciidoc,
xmlto
.if project.exports_classes
Package: $(string.replace (project.libname, "_|-"))$(project->version.major)
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
Description: $(project.name)
This package contains shared library for $(project.name): $(project.description)
Package: $(string.replace (project.libname, "_|-"))-dev
Architecture: any
Section: libdevel
Depends:
.for project.use
.if defined(use.debian_name)
$(use.debian_name),
.elsif regexp.match("^lib", use.libname)
$(string.replace (use.libname, "_|-"))-dev,
.else
lib$(string.replace (use.libname, "_|-"))-dev,
.endif
.endfor
$(string.replace (project.libname, "_|-"))$(project->version.major) (= ${binary:Version})
Description: development files for $(project.name)
This package contains development files for $(project.name): $(project.description)
.endif
.if project.has_main | count(project.bin) > 0
Package: $(string.replace (project.name, "_|-"):lower)
Architecture: any
Depends: ${misc:Depends}, ${shlibs:Depends}
Description: $(project.description)
Main package for $(project.name): $(project.description)
.endif
Package: $(string.replace (project.name, "_|-"):lower)-dbg
Architecture: any
Section: debug
Priority: extra
Depends:
.if project.has_main | count(project.bin) > 0
$(string.replace (project.name, "_|-"):lower) (= ${binary:Version}),
.elsif project.exports_classes
$(string.replace (project.libname, "_|-"))$(project->version.major) (= ${binary:Version}),
.endif
${misc:Depends}
Description: debugging symbols for $(project.name)
This package contains the debugging symbols for $(project.name) : $(project.description).
.output "packaging/debian/copyright"
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: $(project.name)
Files: *
Copyright: 2015- $(project.name) Developers <$(project.email)>
License: $(project.name)_license
. for project.license
$(string.trim (license.):block )
. endfor
.output "packaging/debian/format"
3.0 (quilt)
.output "packaging/debian/rules"
#!/usr/bin/make -f
# -*- makefile -*-
DRAFTS=no
# OBS build: add
# Macros:
# %_with_drafts 1
# at the BOTTOM of the OBS prjconf
OBS_BUILD_CFG=/.build/build.dist
ifeq ("\$(wildcard \$(OBS_BUILD_CFG))","")
BUILDCONFIG=\$(shell ls -1 /usr/src/packages/SOURCES/_buildconfig* | head -n 1)
endif
ifneq ("\$(wildcard \$(OBS_BUILD_CFG))","")
ifneq ("\$(shell grep drafts \$(OBS_BUILD_CFG))","")
DRAFTS=yes
endif
endif
# User build: DEB_BUILD_OPTIONS=drafts dpkg-buildpackage
ifneq (,\$(findstring drafts,\$(DEB_BUILD_OPTIONS)))
DRAFTS=yes
endif
override_dh_strip:
dh_strip --dbg-package=$(string.replace (project.name, "_|-"):lower)-dbg
override_dh_auto_test:
echo "Skipped for now"
override_dh_auto_configure:
dh_auto_configure -- \\
.if systemd ?= 1
--with-systemd-units \\
.endif
--enable-drafts=\$(DRAFTS)
%:
dh $@ \\
.if systemd ?= 1
--with systemd \\
.endif
--with autoreconf
.chmod_x ("packaging/debian/rules")
.discover_manpages(project)
.if project.has_main | count(project.bin) > 0
. output ("packaging/debian/$(string.replace (project.name, "_|-"):lower).install")
.# generate binary names
. for project.main where scope = "public"
. if project.has_main
usr/bin/$(main.name)
. if man1 ?<> ""
usr/share/man/man1/$(main.name).1
. endif
. endif
. if file.exists ("src/$(main.name).cfg.example")
etc/$(project.name)/$(main.name).cfg.example
. endif
. endfor
. for project.bin
usr/bin/$(bin.name)
. endfor
.# generate service file names
. for project.main where main.service ?= 1
etc/$(project.name)/$(main.name).cfg
lib/systemd/system/$(main.name).service
. endfor
.endif
.if project.exports_classes
. output ("packaging/debian/$(string.replace (project.libname, "_|-"))$(project->version.major).install")
usr/lib/*/$(project.libname).so.*
. output ("packaging/debian/$(string.replace (project.libname, "_|-"))-dev.install")
usr/include/*
usr/lib/*/$(project.libname).so
usr/lib/*/pkgconfig/$(project.libname).pc
. if man3 ?<> ""
usr/share/man/man3/*
. endif
. if man7 ?<> ""
usr/share/man/man7/*
. endif
.endif
.output ("packaging/debian/$(string.replace (project.name, "_|-"):lower).dsc.obs")
Format: 3.0 (quilt)
Binary: $(project.name)
Source: $(project.name)
Version: $(->version.major).$(->version.minor).$(->version.patch)
Maintainer: $(project.name) Developers <$(project.email)>
Architecture: any
Build-Depends: debhelper (>= 9),
pkg-config,
dh-autoreconf,
.for project.use
.if defined(use.debian_name)
$(use.debian_name),
.elsif regexp.match("^lib", use.libname)
$(string.replace (use.libname, "_|-"))-dev,
.else
lib$(string.replace (use.libname, "_|-"))-dev,
.endif
.endfor
.if systemd ?= 1
systemd,
dh-systemd,
.endif
Build-Depends-Indep: asciidoc,
xmlto
Files:
7697688bf65a35bc33ae2db51ebb0e3b 818110 $(string.replace (project.name, "_|-"):lower).tar.gz
.endmacro