@@ -21,6 +21,7 @@ install_wolfssl_from_git() {
2121 local work_dir=" $1 "
2222 local git_tag=" $2 "
2323 local debug_mode=" $3 "
24+ local reinstall_mode=" $4 "
2425
2526 # If no working directory specified, create one using mktemp
2627 if [ -z " $work_dir " ]; then
@@ -114,6 +115,12 @@ AC_CONFIG_FILES([debian/rules],[chmod +x debian/rules])' configure.ac
114115 else
115116 echo " configure.ac already contains required patches"
116117 fi
118+
119+ # Patch debian/rules.in to disable dh_strip
120+ echo " Patching debian/rules.in to disable dh_strip..."
121+ sed -i ' s/^[[:space:]]*dh_strip.*/:/' debian/rules.in
122+ echo " debian/rules.in patched successfully"
123+
117124 else
118125 echo " debian/rules.in found, using existing debian packaging"
119126 fi
@@ -130,22 +137,63 @@ AC_CONFIG_FILES([debian/rules],[chmod +x debian/rules])' configure.ac
130137
131138 # Configure with the specified options
132139 echo " Configuring wolfSSL with specified options..."
133- configure_opts=" --enable-opensslcoexist --enable-cmac --with-eccminsz=192 --enable-ed25519 --enable-ed448 --enable-md5 --enable-curve25519 --enable-curve448 --enable-aesccm --enable-aesxts --enable-aescfb --enable-keygen --enable-shake128 --enable-shake256 --enable-wolfprovider --enable-rsapss --enable-scrypt"
140+ configure_opts=" --enable-opensslcoexist \
141+ --enable-cmac \
142+ --with-eccminsz=192 \
143+ --enable-ed25519 \
144+ --enable-ed448 \
145+ --enable-md5 \
146+ --enable-curve25519 \
147+ --enable-curve448 \
148+ --enable-aesccm \
149+ --enable-aesxts \
150+ --enable-aescfb \
151+ --enable-keygen \
152+ --enable-shake128 \
153+ --enable-shake256 \
154+ --enable-wolfprovider \
155+ --enable-rsapss \
156+ --enable-scrypt"
134157
135158 if [ " $debug_mode " = " true" ]; then
136159 configure_opts=" $configure_opts --enable-debug"
137160 echo " Debug mode enabled"
138161 fi
139162
140- ./configure $configure_opts CFLAGS=" -DWOLFSSL_OLD_OID_SUM -DWOLFSSL_PUBLIC_ASN -DHAVE_FFDHE_3072 -DHAVE_FFDHE_4096 -DWOLFSSL_DH_EXTRA -DWOLFSSL_PSS_SALT_LEN_DISCOVER -DWOLFSSL_PUBLIC_MP -DWOLFSSL_RSA_KEY_CHECK -DHAVE_FFDHE_Q -DHAVE_FFDHE_6144 -DHAVE_FFDHE_8192 -DWOLFSSL_ECDSA_DETERMINISTIC_K -DWOLFSSL_VALIDATE_ECC_IMPORT -DRSA_MIN_SIZE=1024 -DHAVE_AES_ECB -DWC_RSA_DIRECT -DWC_RSA_NO_PADDING -DACVP_VECTOR_TESTING -DWOLFSSL_ECDSA_SET_K" LIBS=" -lm"
163+ ./configure $configure_opts \
164+ CFLAGS=" -DWOLFSSL_OLD_OID_SUM \
165+ -DWOLFSSL_PUBLIC_ASN \
166+ -DHAVE_FFDHE_3072 \
167+ -DHAVE_FFDHE_4096 \
168+ -DWOLFSSL_DH_EXTRA \
169+ -DWOLFSSL_PSS_SALT_LEN_DISCOVER \
170+ -DWOLFSSL_PUBLIC_MP \
171+ -DWOLFSSL_RSA_KEY_CHECK \
172+ -DHAVE_FFDHE_Q \
173+ -DHAVE_FFDHE_6144 \
174+ -DHAVE_FFDHE_8192 \
175+ -DWOLFSSL_ECDSA_DETERMINISTIC_K \
176+ -DWOLFSSL_VALIDATE_ECC_IMPORT \
177+ -DRSA_MIN_SIZE=1024 \
178+ -DHAVE_AES_ECB \
179+ -DWC_RSA_DIRECT \
180+ -DWC_RSA_NO_PADDING \
181+ -DACVP_VECTOR_TESTING \
182+ -DWOLFSSL_ECDSA_SET_K" \
183+ LIBS=" -lm"
141184
142185 # Build Debian packages
143186 echo " Building Debian packages..."
144187 make deb
145188
146189 # Install the generated packages
147190 echo " Installing generated .deb packages..."
148- dpkg -i ../* .deb
191+ if [ " $reinstall_mode " = " true" ]; then
192+ echo " Reinstall mode: forcing package reinstallation..."
193+ dpkg -i --force-overwrite --force-confnew ../* .deb
194+ else
195+ dpkg -i ../* .deb
196+ fi
149197
150198 echo " WolfSSL installation from git completed successfully"
151199}
@@ -155,6 +203,7 @@ main() {
155203 local work_dir=" "
156204 local git_tag=" "
157205 local debug_mode=" false"
206+ local reinstall_mode=" false"
158207
159208 # Parse command line arguments
160209 while [[ $# -gt 0 ]]; do
@@ -166,6 +215,7 @@ main() {
166215 echo " Options:"
167216 echo " -t, --tag TAG Clone and build specific tag or branch (default: master)"
168217 echo " -d, --debug Enable debug build mode (adds --enable-debug)"
218+ echo " -r, --reinstall Force reinstall even if packages are already installed"
169219 echo " -h, --help Show this help message"
170220 echo " "
171221 echo " Arguments:"
@@ -178,6 +228,7 @@ main() {
178228 echo " $0 --tag v5.6.4 /tmp/build # Build tag v5.6.4 in /tmp/build"
179229 echo " $0 --debug # Build master with debug enabled"
180230 echo " $0 --debug --tag v5.6.4 # Build tag v5.6.4 with debug enabled"
231+ echo " $0 --reinstall # Force reinstall even if packages exist"
181232 exit 0
182233 ;;
183234 -t|--tag)
@@ -188,6 +239,10 @@ main() {
188239 debug_mode=" true"
189240 shift
190241 ;;
242+ -r|--reinstall)
243+ reinstall_mode=" true"
244+ shift
245+ ;;
191246 -* )
192247 echo " Unknown option: $1 " >&2
193248 echo " Use --help for usage information" >&2
@@ -206,10 +261,15 @@ main() {
206261 esac
207262 done
208263
209- echo " Checking if wolfSSL packages are already installed..."
210- if check_packages_installed; then
211- echo " Packages already installed, exiting successfully"
212- exit 0
264+ # Only check if packages are installed if not in reinstall mode
265+ if [ " $reinstall_mode " = " false" ]; then
266+ echo " Checking if wolfSSL packages are already installed..."
267+ if check_packages_installed; then
268+ echo " Packages already installed, exiting successfully"
269+ exit 0
270+ fi
271+ else
272+ echo " Reinstall mode enabled, bypassing package check..."
213273 fi
214274
215275 echo " Installing wolfSSL packages from git repository..."
@@ -219,7 +279,7 @@ main() {
219279 echo " Building wolfSSL master branch"
220280 fi
221281
222- install_wolfssl_from_git " $work_dir " " $git_tag " " $debug_mode "
282+ install_wolfssl_from_git " $work_dir " " $git_tag " " $debug_mode " " $reinstall_mode "
223283
224284 echo " WolfSSL installation completed successfully"
225285}
0 commit comments