Browse Source

Update own dogfood

Alois Mahdal 7 years ago
parent
commit
dffd6a0250

+ 2
- 0
utils/mkit/include/deploy.sh View File

2
 # MKit - simple install helper
2
 # MKit - simple install helper
3
 # See LICENSE file for copyright and license details.
3
 # See LICENSE file for copyright and license details.
4
 
4
 
5
+mkit_import ini
6
+
5
 _deploy_item() {
7
 _deploy_item() {
6
     #
8
     #
7
     # Deploy item and make it look like wanted
9
     # Deploy item and make it look like wanted

+ 2
- 0
utils/mkit/include/mkit.sh View File

40
     echo debstuff
40
     echo debstuff
41
     echo dist
41
     echo dist
42
     echo install
42
     echo install
43
+    echo release
43
     echo release_x
44
     echo release_x
44
     echo release_y
45
     echo release_y
45
     echo release_z
46
     echo release_z
46
     echo rpmstuff
47
     echo rpmstuff
47
     echo uninstall
48
     echo uninstall
49
+    echo vbump
48
     echo vbump_x
50
     echo vbump_x
49
     echo vbump_y
51
     echo vbump_y
50
     echo vbump_z
52
     echo vbump_z

+ 18
- 2
utils/mkit/include/release.sh View File

91
     #
91
     #
92
     local rlevel=$1     # release level (x, y or z)
92
     local rlevel=$1     # release level (x, y or z)
93
     local newtag        # new tag
93
     local newtag        # new tag
94
+    local relsrc        # release source branch (if any)
94
     local reldst        # release destination branch (if any)
95
     local reldst        # release destination branch (if any)
95
 
96
 
96
     _relck git_present
97
     _relck git_present
107
     $MKIT_DRY && return
108
     $MKIT_DRY && return
108
     git tag -m "$(_release_msg)" "$newtag"
109
     git tag -m "$(_release_msg)" "$newtag"
109
 
110
 
111
+    relsrc=$(ini 1value project:relsrc)
110
     reldst=$(ini 1value project:reldst)
112
     reldst=$(ini 1value project:reldst)
111
-    debug_var reldst
112
-    if test -n "$reldst"; then
113
+    debug_var relsrc reldst
114
+    if test -n "$reldst" && test "$reldst" != "$relsrc"; then
113
         git branch -f "$reldst" "$newtag"
115
         git branch -f "$reldst" "$newtag"
114
     fi
116
     fi
115
 }
117
 }
169
         '
171
         '
170
 }
172
 }
171
 
173
 
174
+release() {
175
+    #
176
+    # Perform release on Z level
177
+    #
178
+    _release z
179
+}
180
+
172
 release_x() {
181
 release_x() {
173
     #
182
     #
174
     # Perform release on X level
183
     # Perform release on X level
190
     _release z
199
     _release z
191
 }
200
 }
192
 
201
 
202
+vbump() {
203
+    #
204
+    # Perform version bump on Z level
205
+    #
206
+    _vbump z
207
+}
208
+
193
 vbump_x() {
209
 vbump_x() {
194
     #
210
     #
195
     # Perform version bump on X level
211
     # Perform version bump on X level

+ 1
- 1
utils/mkit/include/vars.sh View File

57
 #
57
 #
58
 # This MKit version
58
 # This MKit version
59
 #
59
 #
60
-MKIT_VERSION=0.0.22+master.gaafa785
60
+MKIT_VERSION=0.0.23+master.g1a2dd96

+ 3
- 3
utils/mkit/make View File

24
 init_core
24
 init_core
25
 
25
 
26
 case "$1" in
26
 case "$1" in
27
-    --version-semver) echo "$MKIT_VERSION"; exit 0 ;;
28
-    --version)        echo "Mkit (Simple Makefile target helper) $MKIT_VERSION"
29
-                      exit 0 ;;
27
+    -V|--version-semver)    echo "$MKIT_VERSION"; exit 0 ;;
28
+    --version)              echo "Mkit (Simple Makefile target helper) $MKIT_VERSION"
29
+                            exit 0 ;;
30
 esac
30
 esac
31
 
31
 
32
 mkit_init
32
 mkit_init

+ 3
- 3
utils/mkit/mkit.mk View File

27
 	@$(MKIT_DIR)/make install
27
 	@$(MKIT_DIR)/make install
28
 
28
 
29
 release:
29
 release:
30
-	@$(MKIT_DIR)/make release_z
30
+	@$(MKIT_DIR)/make release
31
 
31
 
32
 release_x:
32
 release_x:
33
 	@$(MKIT_DIR)/make release_x
33
 	@$(MKIT_DIR)/make release_x
42
 	@$(MKIT_DIR)/make uninstall
42
 	@$(MKIT_DIR)/make uninstall
43
 
43
 
44
 vbump:
44
 vbump:
45
-	@$(MKIT_DIR)/make vbump_z
45
+	@$(MKIT_DIR)/make vbump
46
 
46
 
47
 vbump_x:
47
 vbump_x:
48
 	@$(MKIT_DIR)/make vbump_x
48
 	@$(MKIT_DIR)/make vbump_x
53
 vbump_z:
53
 vbump_z:
54
 	@$(MKIT_DIR)/make vbump_z
54
 	@$(MKIT_DIR)/make vbump_z
55
 
55
 
56
-.PHONY: all clean dist rpmstuff install uninstall release_x release_y release_z vbump_x vbump_y vbump_z
56
+.PHONY: all clean dist rpmstuff install uninstall release release_x release_y release_z vbump vbump_x vbump_y vbump_z

+ 16
- 6
utils/mkit/stub View File

47
             echo -n "# $any_name"
47
             echo -n "# $any_name"
48
             test -n "$Tagline" && echo -n " - $Tagline"
48
             test -n "$Tagline" && echo -n " - $Tagline"
49
             echo
49
             echo
50
-            echo '# See LICENSE.md file for copyright and license details.'
50
+            $MkLicense && echo '# See LICENSE.md file for copyright and license details.'
51
             echo ''
51
             echo ''
52
             echo 'MKIT_DIR=utils/mkit'
52
             echo 'MKIT_DIR=utils/mkit'
53
             #shellcheck disable=SC2016
53
             #shellcheck disable=SC2016
106
                 echo "    doc     = [ENV:PREFIX]/share/doc/$PackageName"
106
                 echo "    doc     = [ENV:PREFIX]/share/doc/$PackageName"
107
                 echo ""
107
                 echo ""
108
                 echo "[tokens]"
108
                 echo "[tokens]"
109
-                echo "    __BIN_DIR__ = [roots:bin]"
109
+                echo "    __${PackageName^^}_FOO__ = Barr.."
110
                 echo ""
110
                 echo ""
111
                 echo "[modes]"
111
                 echo "[modes]"
112
                 echo "    bin     = 755"
112
                 echo "    bin     = 755"
144
             echo 'make %{?_smp_mflags}'
144
             echo 'make %{?_smp_mflags}'
145
             echo ''
145
             echo ''
146
             echo '%install'
146
             echo '%install'
147
-            echo '%make_install'
147
+            echo '%make_install PREFIX=/usr'
148
             echo ''
148
             echo ''
149
             echo '%files'
149
             echo '%files'
150
             echo 'MKIT_STUB_FILELIST'
150
             echo 'MKIT_STUB_FILELIST'
197
             echo ''
197
             echo ''
198
             echo 'override_dh_auto_install:'
198
             echo 'override_dh_auto_install:'
199
             echo ''
199
             echo ''
200
-            echo '	make install DESTDIR=debian/tmp'
200
+            echo '	make install PREFIX=/usr DESTDIR=debian/tmp'
201
             echo ''
201
             echo ''
202
             echo 'override_dh_usrlocal:'
202
             echo 'override_dh_usrlocal:'
203
             echo ''
203
             echo ''
318
             echo "     *  \`MKIT_STUB_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 "        Note that in case of debian/package.install files,"
322
+            echo "        PREFIX based paths (eg. /usr/bin) in this file should"
323
+            echo "        should be as if PREFIX was /usr/local, despite PREFIX"
324
+            echo "        being set to /usr in debian/rules.  (Debian's script"
325
+            echo "        dh_usrlocal will take care of that.)"
326
+            echo ""
327
+            echo "        In case of Fedora-based distro, you should make use"
328
+            echo "        of RPM macros:"
329
+            echo ""
330
+            echo "            https://fedoraproject.org/wiki/Packaging:RPMMacros"
331
+            echo ""
321
             echo "    Refer to these documents for further details:"
332
             echo "    Refer to these documents for further details:"
322
             echo ""
333
             echo ""
323
             echo "        http://rpm-guide.readthedocs.io/"
334
             echo "        http://rpm-guide.readthedocs.io/"
545
     deploy packaging/debian/rules
556
     deploy packaging/debian/rules
546
     deploy packaging/debian/source/format
557
     deploy packaging/debian/source/format
547
     deploy packaging/debian/"$PackageName".install
558
     deploy packaging/debian/"$PackageName".install
548
-    deploy packaging/template.spec
549
 }
559
 }
550
 
560
 
551
 init_from_existing() {
561
 init_from_existing() {
660
         *)        usage ;;
670
         *)        usage ;;
661
     esac
671
     esac
662
     updating && init_from_existing
672
     updating && init_from_existing
663
-    if test -n $License; then
673
+    if test -n "$License"; then
664
         known_licenses | grep -qxF "$License" \
674
         known_licenses | grep -qxF "$License" \
665
          || die "unknown license (use -L to get list): $License"
675
          || die "unknown license (use -L to get list): $License"
666
         MkLicense=true
676
         MkLicense=true