94
94
export_dir = para['base_path'] + '/share/debmake/extra0export/'
95
95
substlist['@EXPORT@'] = ''
96
96
if 'compiler' in para['export']:
97
substlist['@EXPORT@'] += debmake.read.read(export_dir + 'compiler').rstrip() + '\n\n'
98
if 'java' in para['export']:
99
substlist['@EXPORT@'] += debmake.read.read(export_dir + 'java').rstrip() + '\n\n'
100
if 'vala' in para['export']:
101
substlist['@EXPORT@'] += debmake.read.read(export_dir + 'vala').rstrip() + '\n\n'
97
substlist['@EXPORT@'] += debmake.read.read(export_dir + 'compiler').rstrip() + '\n'
98
if 'java' in para['export']:
99
substlist['@EXPORT@'] += debmake.read.read(export_dir + 'java').rstrip() + '\n'
100
if 'vala' in para['export']:
101
substlist['@EXPORT@'] += debmake.read.read(export_dir + 'vala').rstrip() + '\n'
102
substlist['@EXPORT@'] += debmake.read.read(export_dir + 'misc').rstrip() + '\n\n'
103
104
#######################################################################
104
105
# set override string
113
114
substlist['@OVERRIDE@'] += debmake.read.read(override_dir + 'autogen').rstrip() + '\n\n'
114
115
if 'autoreconf' in para['override']:
115
116
substlist['@OVERRIDE@'] += debmake.read.read(override_dir + 'autoreconf').rstrip() + '\n\n'
117
if 'cmake' in para['override']:
118
substlist['@OVERRIDE@'] += debmake.read.read(override_dir + 'cmake').rstrip() + '\n\n'
116
119
if 'dbg' in para['override']:
117
120
substlist['@OVERRIDE@'] += debmake.read.read(override_dir + 'dbg').format(para['dh_strip']).rstrip() + '\n\n'
118
121
if 'java' in para['override']:
119
122
substlist['@OVERRIDE@'] += debmake.read.read(override_dir + 'java').rstrip() + '\n\n'
120
123
if 'judge' in para['override']:
121
124
substlist['@OVERRIDE@'] += debmake.read.read(override_dir + 'judge').rstrip() + '\n\n'
125
if 'makefile' in para['override']:
126
substlist['@OVERRIDE@'] += debmake.read.read(override_dir + 'makefile').rstrip() + '\n\n'
122
127
if 'multiarch' in para['override']:
123
128
substlist['@OVERRIDE@'] += debmake.read.read(override_dir + 'multiarch').rstrip() + '\n\n'
124
129
if 'pythons' in para['override']:
126
131
###################################################################
127
132
# 4 configuration files which must exist (level=0)
128
133
###################################################################
129
debmake.cat.cat('debian/control', debmake.control.control(para), quiet=para['quiet'])
130
debmake.cat.cat('debian/copyright', debmake.copyright.copyright(para['package'], para['license'], para['cdata'], para['xml_html_files'], para['binary_files'], para['huge_files']), quiet=para['quiet'])
134
debmake.cat.cat('debian/control', debmake.control.control(para), tutorial=para['tutorial'])
135
debmake.cat.cat('debian/copyright', debmake.copyright.copyright(para['package'], para['license'], para['cdata'], para['xml_html_files'], para['binary_files'], para['huge_files'], tutorial=para['tutorial']), tutorial=para['tutorial'])
131
136
if para['dh_with'] == set(): # no dh_with
132
137
substlist['@DHWITH@'] = ''
138
143
substlist['@DHBUILDSYSTEM@'] = '--buildsystem={}'.format(para['dh_buildsystem'])
139
144
confdir = para['base_path'] + '/share/debmake/extra0/'
140
debmake.sed.sed(confdir, 'debian/', substlist, package, quiet=para['quiet']) # changelog, rules
145
debmake.sed.sed(confdir, 'debian/', substlist, package, tutorial=para['tutorial']) # changelog, rules
141
146
os.chmod('debian/rules', 0o755)
142
147
###################################################################
143
148
# These should be created for the new source (level=1)
146
151
###################################################################
148
153
confdir = para['base_path'] + '/share/debmake/extra1/'
149
debmake.sed.sed(confdir, 'debian/', substlist, package, quiet=para['quiet'])
154
debmake.sed.sed(confdir, 'debian/', substlist, package, tutorial=para['tutorial'])
150
155
confdir = para['base_path'] + '/share/debmake/extra1source/'
151
debmake.sed.sed(confdir, 'debian/source/', substlist, package, quiet=para['quiet'])
156
debmake.sed.sed(confdir, 'debian/source/', substlist, package, tutorial=para['tutorial'])
152
157
if not para['native']:
153
158
confdir = para['base_path'] + '/share/debmake/extra1patches/'
154
debmake.sed.sed(confdir, 'debian/patches/', substlist, package, quiet=para['quiet'])
159
debmake.sed.sed(confdir, 'debian/patches/', substlist, package, tutorial=para['tutorial'])
155
160
###################################################################
156
161
# Optional files which is nice to be created for the new source (level=2)
157
162
# Harmless but some interactive editting are desirable.
166
171
if len(para['debs']) == 1: # if single binary deb
167
172
confdir = para['base_path'] + '/share/debmake/extra2single/'
168
debmake.sed.sed(confdir, 'debian/', substlist, package, quiet=para['quiet'])
173
debmake.sed.sed(confdir, 'debian/', substlist, package, tutorial=para['tutorial'])
169
174
else: # if multi-binary debs
170
175
confdir = para['base_path'] + '/share/debmake/extra2multi/'
171
debmake.sed.sed(confdir, 'debian/', substlist, package, quiet=para['quiet'])
176
debmake.sed.sed(confdir, 'debian/', substlist, package, tutorial=para['tutorial'])
172
177
for deb in para['debs']:
173
178
substlist['@BINPACKAGE@'] = deb['package']
174
179
type = deb['type']
175
180
if type in binlist:
177
182
confdir = para['base_path'] + '/share/debmake/extra2' + type + '/'
178
debmake.sed.sed(confdir, 'debian/', substlist, deb['package'], quiet=para['quiet'])
183
debmake.sed.sed(confdir, 'debian/', substlist, deb['package'], tutorial=para['tutorial'])
179
184
if deb['package'] == docpackage:
181
186
confdir = para['base_path'] + '/share/debmake/extra2' + type + '/'
182
debmake.sed.sed(confdir, 'debian/', substlist, deb['package'], quiet=para['quiet'])
187
debmake.sed.sed(confdir, 'debian/', substlist, deb['package'], tutorial=para['tutorial'])
183
188
###################################################################
184
189
# Rarely used optional files (level=3)
185
190
# Provided as the dh_make compatibilities. (files with ".ex" postfix)
188
193
substlist['@BINPACKAGE@'] = package # just in case
190
195
confdir = para['base_path'] + '/share/debmake/extra3/'
191
debmake.sed.sed(confdir, 'debian/', substlist, package, quiet=para['quiet'])
196
debmake.sed.sed(confdir, 'debian/', substlist, package, tutorial=para['tutorial'])
192
197
###################################################################
193
198
# copyright file examples (level=4)
194
199
###################################################################
196
201
confdir = para['base_path'] + '/share/debmake/extra4/'
197
debmake.sed.sed(confdir, 'debian/license-examples/', substlist, package, quiet=para['quiet'])
202
debmake.sed.sed(confdir, 'debian/license-examples/', substlist, package, tutorial=para['tutorial'])
199
204
print('I: run "debmake -x{}" to get more template files'.format(extra + 1), file=sys.stderr)
200
205
###################################################################