summarylogtreecommitdiffstats
path: root/0020-add-support-for-recommends-and-suggests-AKA-weak-dep.patch
blob: 527bd5e20405b01dcb7a41dce2219df8d7463584 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
From d24a630501a9aba5d53de2dcb3d9aa66edd3fe06 Mon Sep 17 00:00:00 2001
From: Felipe Eduardo Sanchez Diaz Duran <izto@asic-linux.com.mx>
Date: Wed, 26 Apr 2017 17:37:50 -0500
Subject: [PATCH 20/20] add support for --recommends and --suggests (AKA weak
 dependencies)

Patch submitted by Tobias Bengfort <tobias.bengfort@posteo.de>
---
 checkinstall.in | 48 ++++++++++++++++++++++++++++++++++++++++++------
 1 file changed, 42 insertions(+), 6 deletions(-)

diff --git a/checkinstall.in b/checkinstall.in
index 1771522..66c9cd0 100755
--- a/checkinstall.in
+++ b/checkinstall.in
@@ -151,6 +151,8 @@ function usage() {
    echog "--maintainer=<email addr>      The package maintainer (.deb)"
    echog "--provides=<list>              Features provided by this package"
    echog "--requires=<list>              Features required by this package"
+   echog "--recommends=<list>            Features recommended by this package"
+   echog "--suggests=<list>              Features suggested by this package"
    echog "--conflicts=<list>             Packages that this package cannot be installed with (.deb)"
    echog "--replaces=<list>              Packages that this package replaces (.deb)"
    echog "--rpmflags=<flags>             Pass this flags to the rpm installer"
@@ -512,7 +514,7 @@ fi
 # Arguments parsing
 
 CKNAME=`basename "$0"`
-PARAMS=`getopt -a -n $CKNAME -o +d:DA:t:RShHy -l arch:,type:,si,showinstall::,ss,showslack::,deldoc::,delspec::,deldesc::,strip::,addso::,install::,stripso::,gzman::,bk,backup::,autodoinst::,reset-uids::,fstrans::,spec:,exclude:,include:,pkgname:,pkgversion:,pkgrelease:,pkglicense:,pkggroup:,pkgsource:,pkgaltsource:,pakdir:,docdir:,requires:,provides:,conflicts:,replaces:,maintainer:,dpkgflags:,rpmflags:,pkgarch:,umask:,with-tar:,summary:,inspect,review-spec,review-control,newslack,help,nodoc,rpmi,rpmu,version,copyright,default -- "$@"`
+PARAMS=`getopt -a -n $CKNAME -o +d:DA:t:RShHy -l arch:,type:,si,showinstall::,ss,showslack::,deldoc::,delspec::,deldesc::,strip::,addso::,install::,stripso::,gzman::,bk,backup::,autodoinst::,reset-uids::,fstrans::,spec:,exclude:,include:,pkgname:,pkgversion:,pkgrelease:,pkglicense:,pkggroup:,pkgsource:,pkgaltsource:,pakdir:,docdir:,requires:,recommends:,suggests:,provides:,conflicts:,replaces:,maintainer:,dpkgflags:,rpmflags:,pkgarch:,umask:,with-tar:,summary:,inspect,review-spec,review-control,newslack,help,nodoc,rpmi,rpmu,version,copyright,default -- "$@"`
 
 [ $? -gt 0 ] && help_notice
 
@@ -603,6 +605,14 @@ while [ "$1" != "--" ]; do
          shift
          REQUIRES=`eval echo $1`
          ;;
+      --recommends)
+         shift
+         RECOMMENDS=`eval echo $1`
+         ;;
+      --suggests)
+         shift
+         SUGGESTS=`eval echo $1`
+         ;;
       --maintainer)
          shift
          MAINTAINER=`eval echo $1`
@@ -1272,6 +1282,8 @@ if [ -f "$SPEC_PATH" ]; then
    PKG_GROUP=`getparameter "^[Gg]roup"`
    PROVIDES=`getparameter "^[Pp]rovides"`
    REQUIRES=`getparameter "^[Rr]equires"`
+   RECOMMENDS=`getparameter "^[Rr]commends"`
+   SUGGESTS=`getparameter "^[Ss]uggests"`
 fi
       
    OPTION=junk
@@ -1370,6 +1382,8 @@ fi
       ! [ "$ALTSOURCE" ] && ALTSOURCE=""
       ! [ "$PROVIDES" ] && PROVIDES="$NAME"
       ! [ "$REQUIRES" ] && REQUIRES=""
+      ! [ "$RECOMMENDS" ] && RECOMMENDS=""
+      ! [ "$SUGGESTS" ] && SUGGESTS=""
       # bond: added this so it is easy to change the Maintainer: field
       # just by setting the MAINTAINER environment variable
 
@@ -1406,9 +1420,13 @@ fi
       [ "$CK_REDHAT" -o "$CK_DEBIAN" ] &&
           echog "10 - Requires: [ %s ]" "$REQUIRES"
       [ "$CK_REDHAT" -o "$CK_DEBIAN" ] &&
-          echog "11 - Provides: [ %s ]" "$PROVIDES"
-      [ "$CK_DEBIAN" ] && echog "12 - Conflicts: [ %s ]" "$CONFLICTS"
-      [ "$CK_DEBIAN" ] && echog "13 - Replaces: [ %s ]" "$REPLACES"
+          echog "11 - Recommends: [ %s ]" "$RECOMMENDS"
+      [ "$CK_REDHAT" -o "$CK_DEBIAN" ] &&
+          echog "12 - Suggests: [ %s ]" "$SUGGESTS"
+      [ "$CK_REDHAT" -o "$CK_DEBIAN" ] &&
+          echog "13 - Provides: [ %s ]" "$PROVIDES"
+      [ "$CK_DEBIAN" ] && echog "14 - Conflicts: [ %s ]" "$CONFLICTS"
+      [ "$CK_DEBIAN" ] && echog "15 - Replaces: [ %s ]" "$REPLACES"
 
       echo
       echogn "Enter a number to change any of them or press ENTER to continue: "
@@ -1480,6 +1498,20 @@ fi
             }
             ;;
         11)
+            [ "$CK_REDHAT" -o "$CK_DEBIAN" ] && {
+            echog "Enter the additional recommendations: "
+            echo -n ">> "
+            read RECOMMENDS
+            }
+            ;;
+        12)
+            [ "$CK_REDHAT" -o "$CK_DEBIAN" ] && {
+            echog "Enter the additional suggestions: "
+            echo -n ">> "
+            read SUGGESTS
+            }
+            ;;
+        13)
             # 01-12-06 UKo: new feature
 	    [ "$CK_REDHAT" -o "$CK_DEBIAN" ] && {
             echog "Enter the provided features: "
@@ -1487,13 +1519,13 @@ fi
             read PROVIDES
             }
             ;;
-        12)
+        14)
             [ "$CK_DEBIAN" ] && { echog "Enter the conflicting packages: "
             echo -n ">> "
             read CONFLICTS
             }
             ;;
-        13)
+        15)
             [ "$CK_DEBIAN" ] && { echog "Enter the replaced packages: "
             echo -n ">> "
             read REPLACES
@@ -2396,6 +2428,8 @@ Group:     $PKG_GROUP
 BuildRoot: $BROOTPATH
 Provides:  $PROVIDES
 Requires:  $REQUIRES,/bin/sh
+Recommends: $RECOMMENDS
+Suggests:  $SUGGESTS
 
 %description
 EOF
@@ -2588,6 +2622,8 @@ Maintainer: $MAINTAINER
 Architecture: $ARCHITECTURE
 Version: ${VERSION}-${RELEASE}
 Depends: $REQUIRES
+Recommends: $RECOMMENDS
+Suggests: $SUGGESTS
 Provides: $PROVIDES
 Conflicts: $CONFLICTS
 Replaces: $REPLACES
-- 
2.30.0