|
@@ -63,6 +63,153 @@ deploy() {
|
63
|
63
|
else
|
64
|
64
|
echo "(Nothing to say about this project.)"
|
65
|
65
|
fi
|
|
66
|
+ echo ""
|
|
67
|
+ echo "See MAINTAINERS.md for instructions how to build and"
|
|
68
|
+ echo "maintain this MKit project."
|
|
69
|
+ ;;
|
|
70
|
+
|
|
71
|
+ MAINTAINERS.md)
|
|
72
|
+ local heading="$any_name - maintainer instructions"
|
|
73
|
+ echo "${heading^^}"
|
|
74
|
+ tr -c '=\n' '=' <<<"$heading"
|
|
75
|
+ echo ''
|
|
76
|
+ echo "<!--"
|
|
77
|
+ echo " Note: This file has been auto-generated by MKit"
|
|
78
|
+ echo " v$MKIT_VERSION when initializing the project."
|
|
79
|
+ echo "-->"
|
|
80
|
+ echo ''
|
|
81
|
+ echo "This project is using MKit for packaging and versioning"
|
|
82
|
+ echo "meta-data; this file describes how to do basic maintenance"
|
|
83
|
+ echo "operations."
|
|
84
|
+ echo ''
|
|
85
|
+ echo "MKit uses GNU Make as an interface, so all operations are"
|
|
86
|
+ echo "'make' targets and GNU Make takes care of the dependencies"
|
|
87
|
+ echo "between them. For example, to install the project it's enough"
|
|
88
|
+ echo "to call 'make install'; GNU Make will call 'make built'"
|
|
89
|
+ echo "automatically if needed."
|
|
90
|
+ echo ""
|
|
91
|
+ echo ""
|
|
92
|
+ echo "Variables"
|
|
93
|
+ echo "---------"
|
|
94
|
+ echo ""
|
|
95
|
+ echo " * \`DESTDIR\` - root of the installation destination"
|
|
96
|
+ echo " * \`PREFIX\` - deployment prefix (often \`/usr\` or"
|
|
97
|
+ echo " \`/usr/local\`)"
|
|
98
|
+ echo " * \`MKIT_DRY\` - set to \`true\` to prevent MKit from making"
|
|
99
|
+ echo " any changes"
|
|
100
|
+ echo " * \`MKIT_DEBUG\` - set to \`true\` to have MKit display"
|
|
101
|
+ echo " (lots of) debugging information"
|
|
102
|
+ echo ""
|
|
103
|
+ echo "See *utils/mkit/include/vars.sh* for full list oof supported"
|
|
104
|
+ echo "variables. (You can use \`sfdoc utils/mkit/include/vars.sh\`"
|
|
105
|
+ echo "if you have sfdoc installed.)"
|
|
106
|
+ echo ""
|
|
107
|
+ echo ""
|
|
108
|
+ echo "Building and installation"
|
|
109
|
+ echo "-------------------------"
|
|
110
|
+ echo ""
|
|
111
|
+ echo "These operations are allowed on any branch. Assets built from"
|
|
112
|
+ echo "development branches will be marked using distinctive version"
|
|
113
|
+ echo "number containing timestamp, branch name and commit short-hash."
|
|
114
|
+ echo ""
|
|
115
|
+ echo " * \`make\` - same as \`make build\`"
|
|
116
|
+ echo " * \`make build\` - build project files"
|
|
117
|
+ echo " * \`make install\` - install project to \`\$DESTDIR\`"
|
|
118
|
+ echo " * \`make uninstall\` - uninstall project from \`\$DESTDIR\`"
|
|
119
|
+ echo " * \`make rpmstuff\` - create RPM SPEC file and a source"
|
|
120
|
+ echo " tarball"
|
|
121
|
+ echo " * \`make debstuff\` - create 'debian' directory and a source"
|
|
122
|
+ echo " tarball"
|
|
123
|
+ echo " * \`make clean\` - remove any previously built assets".
|
|
124
|
+ echo ""
|
|
125
|
+ echo ""
|
|
126
|
+ echo "Versioning"
|
|
127
|
+ echo "----------"
|
|
128
|
+ echo ""
|
|
129
|
+ echo "These operations are only allowed on *release source branch*:"
|
|
130
|
+ echo ""
|
|
131
|
+ echo " * \`make vbump\` - bump version and create bump commit"
|
|
132
|
+ echo " * \`make release\` - create release tag"
|
|
133
|
+ echo ""
|
|
134
|
+ echo ""
|
|
135
|
+ echo "Recommended workflow"
|
|
136
|
+ echo "--------------------"
|
|
137
|
+ echo ""
|
|
138
|
+ echo ""
|
|
139
|
+ echo "### Development and testing ###"
|
|
140
|
+ echo ""
|
|
141
|
+ echo "Any branch can be used to create any kind of asset. Assets"
|
|
142
|
+ echo "built from development branch will be marked using distinctive"
|
|
143
|
+ echo "version number in all MKit macros."
|
|
144
|
+ echo ""
|
|
145
|
+ echo "Development is done in branches as needed, but one branch"
|
|
146
|
+ echo "(often called *master*, *main* or *trunk*) is designated as"
|
|
147
|
+ echo "**release source** branch. Only maintainer can push into this"
|
|
148
|
+ echo "branch and this is where maintainer creates the next release."
|
|
149
|
+ echo ""
|
|
150
|
+ echo ""
|
|
151
|
+ echo "### Versioning and releases ###"
|
|
152
|
+ echo ""
|
|
153
|
+ echo "After all development branches are merged and project is"
|
|
154
|
+ echo "considered ready for release, maintainer will create new"
|
|
155
|
+ echo "release. This consists of three steps (only two of them are"
|
|
156
|
+ echo "assisted by MKit):"
|
|
157
|
+ echo ""
|
|
158
|
+ echo " 1. \`make vbump\` - will auto-edit [project:version] in"
|
|
159
|
+ echo " mkit.ini and start creating **bump commit**."
|
|
160
|
+ echo ""
|
|
161
|
+ echo " **Bump commit** is a special commit which consists of:"
|
|
162
|
+ echo ""
|
|
163
|
+ echo " * Bump of version in mkit.ini"
|
|
164
|
+ echo " * commit message providing rudimentary human"
|
|
165
|
+ echo " readable summary of changes."
|
|
166
|
+ echo ""
|
|
167
|
+ echo " \`make vbump\` target will cause bump of the *last*"
|
|
168
|
+ echo " version fragment (Z, or PATCH in SemVer). To bump other"
|
|
169
|
+ echo " fragments, use \`make vbump_y\` or \`make vbump_x\` (MINOR"
|
|
170
|
+ echo " or MAJOR in SemVer, respectively)."
|
|
171
|
+ echo ""
|
|
172
|
+ echo " MKit will create a template of the message by scanning"
|
|
173
|
+ echo " all commits since last release and invoke 'git commit' so"
|
|
174
|
+ echo " that maintainer is presented with a window editing the"
|
|
175
|
+ echo " commit message."
|
|
176
|
+ echo ""
|
|
177
|
+ echo " Maintainer is responsible for finishing the commit message"
|
|
178
|
+ echo " by:"
|
|
179
|
+ echo ""
|
|
180
|
+ echo " * Re-wording and merging the items as needed."
|
|
181
|
+ echo " * Adding any details, if needed."
|
|
182
|
+ echo " * Removing short hashes and file lists added by MKit"
|
|
183
|
+ echo " (these are added only to make editing easier)."
|
|
184
|
+ echo ""
|
|
185
|
+ echo " Once maintainer is happy with *bump commit* message,"
|
|
186
|
+ echo " they can exit the editor and move on to next step."
|
|
187
|
+ echo ""
|
|
188
|
+ echo " 2. \`make release\` - will check if latest commit on current"
|
|
189
|
+ echo " branch is a *bump commit*, and if yes, will create"
|
|
190
|
+ echo " a corresponding **release tag**."
|
|
191
|
+ echo ""
|
|
192
|
+ echo " **Release tags** are annotated tags (see *git-tag(1)*)"
|
|
193
|
+ echo " formed by version number prefixed by letter \`v\` and are"
|
|
194
|
+ echo " used by MKit to calculate version number when building"
|
|
195
|
+ echo " assets. Release tags contain the *bump commit* message"
|
|
196
|
+ echo " as the annotation."
|
|
197
|
+ echo ""
|
|
198
|
+ echo " If a *release destination* branch is specified as"
|
|
199
|
+ echo " [project:reldst] in mkit.ini, MKit will also update that"
|
|
200
|
+ echo " branch so that it points to the same commmit as the"
|
|
201
|
+ echo " newly created release tag."
|
|
202
|
+ echo ""
|
|
203
|
+ echo " 3. Maintainer will push branches and commits to any shared"
|
|
204
|
+ echo " remotes as needed."
|
|
205
|
+ echo ""
|
|
206
|
+ echo " Warning: This is your last chance to fix any mistakes."
|
|
207
|
+ echo " git tags are designed to be permanent, \"official\","
|
|
208
|
+ echo " write-only objects and they will typically quickly spread"
|
|
209
|
+ echo " to other clones. *Don't count on getting rid of release"
|
|
210
|
+ echo " tag*."
|
|
211
|
+ echo ""
|
|
212
|
+
|
66
|
213
|
;;
|
67
|
214
|
|
68
|
215
|
*/mkit.ini|mkit.ini)
|
|
@@ -90,6 +237,7 @@ deploy() {
|
90
|
237
|
echo "[dist]"
|
91
|
238
|
{
|
92
|
239
|
$MkLicense && echo "tarball = LICENSE.md"
|
|
240
|
+ $MkReadme && echo "tarball = MAINTAINERS.md"
|
93
|
241
|
$MkMakefile && echo "tarball = Makefile"
|
94
|
242
|
$MkReadme && echo "tarball = README.md"
|
95
|
243
|
echo "tarball = mkit.ini"
|
|
@@ -115,6 +263,9 @@ deploy() {
|
115
|
263
|
echo "[macros]"
|
116
|
264
|
{
|
117
|
265
|
echo "__${PackageName^^}_FOO__ = Barr.."
|
|
266
|
+ echo " __PROJECT_DESC_MAIN__ = MKIT_STUB_DESCRIPTION - replace this with your project"
|
|
267
|
+ echo " __PROJECT_DESC_MAIN__ = MKIT_STUB_DESCRIPTION .. description; this will appear"
|
|
268
|
+ echo " __PROJECT_DESC_MAIN__ = MKIT_STUB_DESCRIPTION .. in places like rpm -i"
|
118
|
269
|
} | reformat_section
|
119
|
270
|
echo ""
|
120
|
271
|
echo "[modes]"
|
|
@@ -135,18 +286,19 @@ deploy() {
|
135
|
286
|
;;
|
136
|
287
|
|
137
|
288
|
packaging/template.spec)
|
138
|
|
- echo 'Name: __MKIT_PROJ_PKGNAME__'
|
139
|
|
- echo 'Version: __MKIT_PROJ_VERSION__'
|
140
|
|
- echo 'Release: 1%{?dist}'
|
141
|
|
- echo 'Summary: __MKIT_PROJ_NAME__ - __MKIT_PROJ_TAGLINE__'
|
|
289
|
+ echo 'Name: __MKIT_PROJ_PKGNAME__'
|
|
290
|
+ echo 'Version: __MKIT_PROJ_VERSION__'
|
|
291
|
+ echo 'Release: 1%{?dist}'
|
|
292
|
+ echo 'Summary: __MKIT_PROJ_NAME__ - __MKIT_PROJ_TAGLINE__'
|
142
|
293
|
test -n "$VcsBrowser" && echo 'URL: __MKIT_PROJ_VCS_BROWSER__'
|
143
|
|
- $MkLicense && echo "License: $License"
|
144
|
|
- echo 'Source0: %{name}-%{version}.tar.gz'
|
145
|
|
- echo 'BuildArch: noarch'
|
|
294
|
+ $MkLicense && echo "License: $License"
|
|
295
|
+ echo 'Source0: %{name}-%{version}.tar.gz'
|
|
296
|
+ echo 'BuildArch: noarch'
|
|
297
|
+ echo 'BuildRequires: make'
|
146
|
298
|
echo ''
|
147
|
299
|
echo 'Requires: MKIT_STUB_REQUIRES'
|
148
|
300
|
echo '%description'
|
149
|
|
- echo 'MKIT_STUB_DESCRIPTION'
|
|
301
|
+ echo '__PROJECT_DESC_MAIN__'
|
150
|
302
|
echo ''
|
151
|
303
|
echo '%prep'
|
152
|
304
|
echo '%setup -q'
|
|
@@ -163,6 +315,7 @@ deploy() {
|
163
|
315
|
echo '%changelog'
|
164
|
316
|
echo ''
|
165
|
317
|
echo '# specfile built with MKit __MKIT_MKIT_VERSION__'
|
|
318
|
+ echo "# .. based on stub from: $MKIT_VERSION"
|
166
|
319
|
;;
|
167
|
320
|
|
168
|
321
|
packaging/debian/copyright)
|
|
@@ -178,14 +331,16 @@ deploy() {
|
178
|
331
|
echo 'Standards-Version: 3.9.2'
|
179
|
332
|
echo 'Build-Depends:'
|
180
|
333
|
echo ' debhelper (>= 9),'
|
|
334
|
+ echo ' make,'
|
181
|
335
|
echo ''
|
182
|
336
|
echo 'Package: __MKIT_PROJ_PKGNAME__'
|
183
|
337
|
echo 'Architecture: all'
|
184
|
338
|
echo 'Depends: MKIT_STUB_REQUIRES'
|
185
|
339
|
echo 'Description: __MKIT_PROJ_NAME__ - __MKIT_PROJ_TAGLINE__'
|
186
|
|
- echo ' MKIT_STUB_DESCRIPTION'
|
|
340
|
+ echo ' __PROJECT_DESC_MAIN__'
|
187
|
341
|
echo ''
|
188
|
342
|
echo '# control file built with MKit __MKIT_MKIT_VERSION__'
|
|
343
|
+ echo "# .. based on stub from: $MKIT_VERSION"
|
189
|
344
|
;;
|
190
|
345
|
|
191
|
346
|
packaging/debian/changelog)
|
|
@@ -205,11 +360,11 @@ deploy() {
|
205
|
360
|
echo ''
|
206
|
361
|
echo '%:'
|
207
|
362
|
echo ''
|
208
|
|
- echo ' dh $@'
|
|
363
|
+ echo ' PREFIX=/usr dh $@'
|
209
|
364
|
echo ''
|
210
|
365
|
echo 'override_dh_auto_install:'
|
211
|
366
|
echo ''
|
212
|
|
- echo ' make install PREFIX=/usr DESTDIR=debian/tmp'
|
|
367
|
+ echo ' make install DESTDIR=debian/tmp'
|
213
|
368
|
;;
|
214
|
369
|
|
215
|
370
|
packaging/debian/source/format)
|
|
@@ -430,11 +585,15 @@ deploy() {
|
430
|
585
|
if $MkReadme; then
|
431
|
586
|
echo ""
|
432
|
587
|
echo ""
|
433
|
|
- echo "README.md"
|
434
|
|
- echo "---------"
|
|
588
|
+ echo "README.md and MAINTAINERS.md"
|
|
589
|
+ echo "----------------------------"
|
435
|
590
|
echo ""
|
436
|
591
|
echo "Each serious project needs a serious README. Which is why"
|
437
|
592
|
echo "*stub* has created a 'stub' of one for you."
|
|
593
|
+ echo ""
|
|
594
|
+ echo "Furthermore MAINTAINERS.md is created to help maintainers"
|
|
595
|
+ echo "do basic MKit operations such as building assets and making"
|
|
596
|
+ echo "releases."
|
438
|
597
|
fi
|
439
|
598
|
|
440
|
599
|
echo ""
|
|
@@ -479,7 +638,7 @@ usage() {
|
479
|
638
|
echo " -V VERSION initial version (default: 0.0.0)"
|
480
|
639
|
echo " -a enable autoclean ('make clean' after"
|
481
|
640
|
echo " each 'make install')"
|
482
|
|
- echo " -g make git commits before and adter"
|
|
641
|
+ echo " -g make git commits before and after"
|
483
|
642
|
echo " (implies -y)"
|
484
|
643
|
echo " -y don't ask, just do it"
|
485
|
644
|
echo " -R skip creating README.md"
|
|
@@ -699,6 +858,7 @@ main() {
|
699
|
858
|
deploy src/"$PackageName".skel
|
700
|
859
|
$MkMakefile && deploy Makefile
|
701
|
860
|
$MkReadme && deploy README.md
|
|
861
|
+ $MkReadme && deploy MAINTAINERS.md
|
702
|
862
|
$MkLicense && deploy LICENSE.md
|
703
|
863
|
$AutoClean && deploy .mkit/autoclean
|
704
|
864
|
$MkPackaging && deploy_packaging
|