Browse Source

Update (self-)references to *stub* script

Alois Mahdal 7 years ago
parent
commit
ca44b4f16b
2 changed files with 39 additions and 39 deletions
  1. 38
    38
      src/stub
  2. 1
    1
      utils/import-patches.sed

+ 38
- 38
src/stub View File

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

+ 1
- 1
utils/import-patches.sed View File

9
 
9
 
10
 /^\(--- a\|+++ b\|diff\)/ s:utils/mkit/include:src/include:g
10
 /^\(--- a\|+++ b\|diff\)/ s:utils/mkit/include:src/include:g
11
 /^\(--- a\|+++ b\|diff\)/ s:utils/mkit/make:src/make.skel:g
11
 /^\(--- a\|+++ b\|diff\)/ s:utils/mkit/make:src/make.skel:g
12
-/^\(--- a\|+++ b\|diff\)/ s:utils/mkit/newstub:src/newstub:g
12
+/^\(--- a\|+++ b\|diff\)/ s:utils/mkit/stub:src/stub:g
13
 /^\(--- a\|+++ b\|diff\)/ s:utils/mkit/mkit.mk:src/mkit.mk:g
13
 /^\(--- a\|+++ b\|diff\)/ s:utils/mkit/mkit.mk:src/mkit.mk:g
14
 /^index /           s:100755$:100644:
14
 /^index /           s:100755$:100644:
15
 /^.MKIT_VERSION=/   s:MKIT_VERSION=.*$:MKIT_VERSION=__MKIT_PROJ_VERSION__:
15
 /^.MKIT_VERSION=/   s:MKIT_VERSION=.*$:MKIT_VERSION=__MKIT_PROJ_VERSION__: