|
@@ -23,23 +23,23 @@ init_core
|
23
|
23
|
|
24
|
24
|
mkit_import ini
|
25
|
25
|
|
26
|
|
-declare -A MKIT_INIT_LICENSES
|
27
|
|
-MKIT_INIT_LICENSES[GPLv1]="http://www.gnu.org/licenses/old-licenses/gpl-1.0.md"
|
28
|
|
-MKIT_INIT_LICENSES[GPLv2]="http://www.gnu.org/licenses/old-licenses/gpl-2.0.md"
|
29
|
|
-MKIT_INIT_LICENSES[GPLv3]="http://www.gnu.org/licenses/gpl-3.0.md"
|
30
|
|
-MKIT_INIT_LICENSES[LGPLv2]="http://www.gnu.org/licenses/old-licenses/lgpl-2.1.md"
|
31
|
|
-MKIT_INIT_LICENSES[LGPLv3]="http://www.gnu.org/licenses/lgpl-3.0.md"
|
32
|
|
-MKIT_INIT_LICENSES[AGPLv3]="http://www.gnu.org/licenses/agpl-3.0.md"
|
33
|
|
-MKIT_INIT_LICENSES[FDLv1.3]="http://www.gnu.org/licenses/fdl-1.3.md"
|
34
|
|
-MKIT_INIT_LICENSES[FDLv1.2]="http://www.gnu.org/licenses/old-licenses/fdl-1.2.md"
|
35
|
|
-MKIT_INIT_LICENSES[FDLv1.1]="http://www.gnu.org/licenses/old-licenses/fdl-1.1.md"
|
|
26
|
+declare -A MKIT_STUB_LICENSES
|
|
27
|
+MKIT_STUB_LICENSES[GPLv1]="http://www.gnu.org/licenses/old-licenses/gpl-1.0.md"
|
|
28
|
+MKIT_STUB_LICENSES[GPLv2]="http://www.gnu.org/licenses/old-licenses/gpl-2.0.md"
|
|
29
|
+MKIT_STUB_LICENSES[GPLv3]="http://www.gnu.org/licenses/gpl-3.0.md"
|
|
30
|
+MKIT_STUB_LICENSES[LGPLv2]="http://www.gnu.org/licenses/old-licenses/lgpl-2.1.md"
|
|
31
|
+MKIT_STUB_LICENSES[LGPLv3]="http://www.gnu.org/licenses/lgpl-3.0.md"
|
|
32
|
+MKIT_STUB_LICENSES[AGPLv3]="http://www.gnu.org/licenses/agpl-3.0.md"
|
|
33
|
+MKIT_STUB_LICENSES[FDLv1.3]="http://www.gnu.org/licenses/fdl-1.3.md"
|
|
34
|
+MKIT_STUB_LICENSES[FDLv1.2]="http://www.gnu.org/licenses/old-licenses/fdl-1.2.md"
|
|
35
|
+MKIT_STUB_LICENSES[FDLv1.1]="http://www.gnu.org/licenses/old-licenses/fdl-1.1.md"
|
36
|
36
|
|
37
|
37
|
|
38
|
38
|
deploy() {
|
39
|
39
|
local file=$1 # which known file?
|
40
|
40
|
local any_name=${NiceName:-$PackageName}
|
41
|
41
|
local tmp
|
42
|
|
- tmp=$(mktemp -t newstub.deploy.XXXXXXX)
|
|
42
|
+ tmp=$(mktemp -t mkit.stub.deploy.XXXXXXX)
|
43
|
43
|
mkdir -p "$(dirname "$file")"
|
44
|
44
|
case $file in
|
45
|
45
|
|
|
@@ -132,10 +132,10 @@ deploy() {
|
132
|
132
|
echo ''
|
133
|
133
|
echo 'BuildArch: noarch'
|
134
|
134
|
echo 'BuildRequires: coreutils git'
|
135
|
|
- echo 'Requires: MKIT_NEWSTUB_REQUIRES'
|
|
135
|
+ echo 'Requires: MKIT_STUB_REQUIRES'
|
136
|
136
|
echo ''
|
137
|
137
|
echo '%description'
|
138
|
|
- echo 'MKIT_NEWSTUB_DESCRIPTION'
|
|
138
|
+ echo 'MKIT_STUB_DESCRIPTION'
|
139
|
139
|
echo ''
|
140
|
140
|
echo '%prep'
|
141
|
141
|
echo '%setup -q'
|
|
@@ -147,7 +147,7 @@ deploy() {
|
147
|
147
|
echo '%make_install'
|
148
|
148
|
echo ''
|
149
|
149
|
echo '%files'
|
150
|
|
- echo 'MKIT_NEWSTUB_FILELIST'
|
|
150
|
+ echo 'MKIT_STUB_FILELIST'
|
151
|
151
|
echo ''
|
152
|
152
|
echo '%changelog'
|
153
|
153
|
echo ''
|
|
@@ -169,9 +169,9 @@ deploy() {
|
169
|
169
|
echo ''
|
170
|
170
|
echo 'Package: __MKIT_PROJ_PKGNAME__'
|
171
|
171
|
echo 'Architecture: all'
|
172
|
|
- echo 'Depends: MKIT_NEWSTUB_REQUIRES'
|
|
172
|
+ echo 'Depends: MKIT_STUB_REQUIRES'
|
173
|
173
|
echo 'Description: __MKIT_PROJ_NAME__ - __MKIT_PROJ_TAGLINE__'
|
174
|
|
- echo ' MKIT_NEWSTUB_DESCRIPTION'
|
|
174
|
+ echo ' MKIT_STUB_DESCRIPTION'
|
175
|
175
|
echo ''
|
176
|
176
|
echo '# control file built with MKit __MKIT_SELF_VERSION__'
|
177
|
177
|
;;
|
|
@@ -209,7 +209,7 @@ deploy() {
|
209
|
209
|
;;
|
210
|
210
|
|
211
|
211
|
packaging/debian/*.install)
|
212
|
|
- echo MKIT_NEWSTUB_FILELIST
|
|
212
|
+ echo MKIT_STUB_FILELIST
|
213
|
213
|
;;
|
214
|
214
|
|
215
|
215
|
src/*.skel)
|
|
@@ -219,7 +219,7 @@ deploy() {
|
219
|
219
|
|
220
|
220
|
LICENSE.md)
|
221
|
221
|
local url # license URL
|
222
|
|
- url="${MKIT_INIT_LICENSES[$License]}"
|
|
222
|
+ url="${MKIT_STUB_LICENSES[$License]}"
|
223
|
223
|
curl -sf "$url" \
|
224
|
224
|
|| die "failed to download license: $url"
|
225
|
225
|
;;
|
|
@@ -227,13 +227,13 @@ deploy() {
|
227
|
227
|
.mkit/autoclean)
|
228
|
228
|
;;
|
229
|
229
|
|
230
|
|
- MKIT_NEWSTUB_README.md)
|
|
230
|
+ MKIT_STUB_README.md)
|
231
|
231
|
echo "FINISHING MKIT CONFIGURATION"
|
232
|
232
|
echo "============================"
|
233
|
233
|
echo ""
|
234
|
234
|
echo "Congratulations, your new project has been configured!"
|
235
|
235
|
echo ""
|
236
|
|
- echo "However, the *newstub* script is not able to figure out"
|
|
236
|
+ echo "However, the *stub* script is not able to figure out"
|
237
|
237
|
echo "everything, so few things still need to be done manually."
|
238
|
238
|
echo "This document will guide you throught the rest of the"
|
239
|
239
|
echo "process."
|
|
@@ -291,17 +291,17 @@ deploy() {
|
291
|
291
|
echo "Placeholders"
|
292
|
292
|
echo "------------"
|
293
|
293
|
echo ""
|
294
|
|
- echo "At places where *newstub* script did not have way to get all"
|
|
294
|
+ echo "At places where *stub* script did not have way to get all"
|
295
|
295
|
echo "information automatically, it has inserted placeholders."
|
296
|
296
|
echo "You will need to go through all of these placeholders and"
|
297
|
297
|
echo "replace them with proper data."
|
298
|
298
|
echo ""
|
299
|
299
|
echo "Please follow instructions:"
|
300
|
300
|
echo ""
|
301
|
|
- echo " 1. Look for placeholders starting with \`MKIT_NEWSTUB_\`"
|
|
301
|
+ echo " 1. Look for placeholders starting with \`MKIT_STUB_\`"
|
302
|
302
|
echo " prefix by calling this command:"
|
303
|
303
|
echo ""
|
304
|
|
- echo " grep -lw MKIT_NEWSTUB_ -r"
|
|
304
|
+ echo " grep -lw MKIT_STUB_ -r"
|
305
|
305
|
echo ""
|
306
|
306
|
echo " 2. Go through each file and locate the placeholder. (You"
|
307
|
307
|
echo " will also see placeholders like \`__MKIT_*__\`, you can"
|
|
@@ -309,13 +309,13 @@ deploy() {
|
309
|
309
|
echo ""
|
310
|
310
|
echo " 3. Replace placeholder with appropriate information:"
|
311
|
311
|
echo ""
|
312
|
|
- echo " * \`MKIT_NEWSTUB_REQUIRES\` - Requirements of your"
|
|
312
|
+ echo " * \`MKIT_STUB_REQUIRES\` - Requirements of your"
|
313
|
313
|
echo " project."
|
314
|
314
|
echo ""
|
315
|
|
- echo " * \`MKIT_NEWSTUB_DESCRIPTION\` - Description of your"
|
|
315
|
+ echo " * \`MKIT_STUB_DESCRIPTION\` - Description of your"
|
316
|
316
|
echo " project (few sentences to paragraphs)."
|
317
|
317
|
echo ""
|
318
|
|
- echo " * \`MKIT_NEWSTUB_FILELIST\` - List of full paths to"
|
|
318
|
+ echo " * \`MKIT_STUB_FILELIST\` - List of full paths to"
|
319
|
319
|
echo " your files after installation."
|
320
|
320
|
echo ""
|
321
|
321
|
echo " Refer to these documents for further details:"
|
|
@@ -412,7 +412,7 @@ deploy() {
|
412
|
412
|
echo "Makefile"
|
413
|
413
|
echo "--------"
|
414
|
414
|
echo ""
|
415
|
|
- echo "*newstub* script also created a Makefile for you, but all"
|
|
415
|
+ echo "*stub* script also created a Makefile for you, but all"
|
416
|
416
|
echo "it really does is include MKit's own mkit.mk, which in turn"
|
417
|
417
|
echo "only maps \`make\` targets to actual mkit script calls."
|
418
|
418
|
echo "Unless your project already uses GNU Make, you should not"
|
|
@@ -426,7 +426,7 @@ deploy() {
|
426
|
426
|
echo "---------"
|
427
|
427
|
echo ""
|
428
|
428
|
echo "Each serious project needs a serious README. Which is why"
|
429
|
|
- echo "*newstub* has created a 'stub' of one for you."
|
|
429
|
+ echo "*stub* has created a 'stub' of one for you."
|
430
|
430
|
fi
|
431
|
431
|
|
432
|
432
|
echo ""
|
|
@@ -445,7 +445,7 @@ deploy() {
|
445
|
445
|
known_licenses() {
|
446
|
446
|
local key
|
447
|
447
|
local first=true
|
448
|
|
- for key in "${!MKIT_INIT_LICENSES[@]}"; do
|
|
448
|
+ for key in "${!MKIT_STUB_LICENSES[@]}"; do
|
449
|
449
|
$first && echo "$key" && continue
|
450
|
450
|
echo ", $key"
|
451
|
451
|
done
|
|
@@ -454,9 +454,9 @@ known_licenses() {
|
454
|
454
|
usage() {
|
455
|
455
|
{
|
456
|
456
|
echo "Usage:"
|
457
|
|
- echo " newstub [options] new PKGNAME"
|
458
|
|
- echo " newstub [options] update"
|
459
|
|
- echo " newstub -L"
|
|
457
|
+ echo " stub [options] new PKGNAME"
|
|
458
|
+ echo " stub [options] update"
|
|
459
|
+ echo " stub -L"
|
460
|
460
|
echo ""
|
461
|
461
|
echo "Options:"
|
462
|
462
|
echo ""
|
|
@@ -514,7 +514,7 @@ mkcommit_backup() {
|
514
|
514
|
|| { warn "nothing to back up"; return 0; }
|
515
|
515
|
git add . || return
|
516
|
516
|
git rm -r --cached utils/mkit || return
|
517
|
|
- git commit -m "WIP [mkit/newstub] backup" || return
|
|
517
|
+ git commit -m "WIP [mkit/stub] backup" || return
|
518
|
518
|
}
|
519
|
519
|
|
520
|
520
|
mkcommit_mkit_code() {
|
|
@@ -522,7 +522,7 @@ mkcommit_mkit_code() {
|
522
|
522
|
| grep -q -e '^utils/mkit$' -e '^utils/mkit/' \
|
523
|
523
|
|| return 0
|
524
|
524
|
git add utils/mkit || return
|
525
|
|
- git commit -m "WIP [mkit/newstub] Add MKit version v$MKIT_VERSION" || return
|
|
525
|
+ git commit -m "WIP [mkit/stub] Add MKit version v$MKIT_VERSION" || return
|
526
|
526
|
}
|
527
|
527
|
|
528
|
528
|
mkcommit_mkit_conf() {
|
|
@@ -532,7 +532,7 @@ mkcommit_mkit_conf() {
|
532
|
532
|
new) msg="Add MKit configuration stub" ;;
|
533
|
533
|
update) msg="Update MKit configuration" ;;
|
534
|
534
|
esac
|
535
|
|
- git commit -m "WIP [mkit/newstub] $msg" || return
|
|
535
|
+ git commit -m "WIP [mkit/stub] $msg" || return
|
536
|
536
|
}
|
537
|
537
|
|
538
|
538
|
deploy_packaging() {
|
|
@@ -629,7 +629,7 @@ main() {
|
629
|
629
|
local MkPackaging=true # create packaging templates?
|
630
|
630
|
local MkLicense=false # create LICENSE.md file
|
631
|
631
|
local Action # 'update' to respect existing, 'new' to force
|
632
|
|
- # rewrite incl. MKIT_NEWSTUB_* placeholders
|
|
632
|
+ # rewrite incl. MKIT_STUB_* placeholders
|
633
|
633
|
declare -A UserGave
|
634
|
634
|
while true; do case $1 in
|
635
|
635
|
-n) NiceName=$2; UserGave[NiceName]=1; shift 2 || usage ;;
|
|
@@ -681,9 +681,9 @@ main() {
|
681
|
681
|
mkcommit_mkit_code || die "failed creating post-commit"
|
682
|
682
|
mkcommit_mkit_conf || die "failed creating post-commit"
|
683
|
683
|
fi
|
684
|
|
- deploy MKIT_NEWSTUB_README.md
|
|
684
|
+ deploy MKIT_STUB_README.md
|
685
|
685
|
warn "Configuration stub built, follow instructions in"
|
686
|
|
- warn "MKIT_NEWSTUB_README.md to finish configuration."
|
|
686
|
+ warn "MKIT_STUB_README.md to finish configuration."
|
687
|
687
|
return 0
|
688
|
688
|
}
|
689
|
689
|
|