@@ -238,35 +238,60 @@ def _copy_vendor_libraries(self):
238
238
if self .with_mysql_capi :
239
239
plugin_ext = "dll" if os .name == "nt" else "so"
240
240
plugin_path = os .path .join (self .with_mysql_capi , "lib" , "plugin" )
241
- plugin_name = ("authentication_ldap_sasl_client.{}"
242
- "" .format (plugin_ext ))
243
241
244
- self .log .debug ("ldap plugin_path: '{}'" .format (
245
- os .path .join (plugin_path , plugin_name )))
246
- if os .path .exists (os .path .join (plugin_path , plugin_name )):
242
+ # authentication_ldap_sasl_client
243
+ plugin_name = (
244
+ "authentication_ldap_sasl_client.{}" .format (plugin_ext )
245
+ )
246
+ plugin_full_path = os .path .join (plugin_path , plugin_name )
247
+ self .log .debug ("ldap plugin_path: '%s'" , plugin_full_path )
248
+ if os .path .exists (plugin_full_path ):
247
249
bundle_plugin_libs = True
248
250
vendor_libs .append (
249
- (plugin_path , [plugin_name ]))
251
+ (plugin_path , [os .path .join ("plugin" , plugin_name )])
252
+ )
250
253
251
254
if bundle_plugin_libs and os .name == "nt" :
252
255
sasl_libs_path = os .path .join (self .with_mysql_capi , "bin" )
253
256
sasl_plugin_libs = ["libsasl.dll" , "saslSCRAM.dll" ,
254
257
"libcrypto-1_1-x64.dll" ]
255
258
vendor_libs .append ((sasl_libs_path , sasl_plugin_libs ))
256
259
260
+ # authentication_kerberos_client
261
+ plugin_name = (
262
+ "authentication_kerberos_client.{}" .format (plugin_ext )
263
+ )
264
+ plugin_full_path = os .path .join (plugin_path , plugin_name )
265
+ self .log .debug ("kerberos plugin_path: '%s'" , plugin_full_path )
266
+ if os .path .exists (plugin_full_path ):
267
+ bundle_plugin_libs = True
268
+ vendor_libs .append (
269
+ (plugin_path , [os .path .join ("plugin" , plugin_name )])
270
+ )
271
+
257
272
if not vendor_libs :
258
273
return
259
274
275
+ # mysql/vendor
260
276
if not os .path .exists (self .vendor_folder ):
261
277
mkpath (os .path .join (os .getcwd (), self .vendor_folder ))
262
278
279
+ # mysql/vendor/plugin
280
+ if not os .path .exists (os .path .join (self .vendor_folder , "plugin" )):
281
+ mkpath (os .path .join (os .getcwd (), self .vendor_folder , "plugin" ))
282
+
283
+ # mysql/vendor/private
284
+ if not os .path .exists (os .path .join (self .vendor_folder , "private" )):
285
+ mkpath (os .path .join (os .getcwd (), self .vendor_folder , "private" ))
286
+
263
287
# Copy vendor libraries to 'mysql/vendor' folder
264
288
self .log .info ("Copying vendor libraries" )
265
289
for src_folder , files in vendor_libs :
266
290
self .log .info ("Copying folder: %s" , src_folder )
267
- for filename in files :
291
+ for filepath in files :
292
+ dst_folder , filename = os .path .split (filepath )
268
293
src = os .path .join (src_folder , filename )
269
- dst = os .path .join (os .getcwd (), self .vendor_folder )
294
+ dst = os .path .join (os .getcwd (), self .vendor_folder , dst_folder )
270
295
self .log .info ("copying %s -> %s" , src , dst )
271
296
shutil .copy (src , dst )
272
297
@@ -295,7 +320,7 @@ def _copy_vendor_libraries(self):
295
320
sasl_plugin_libs .append (os .path .basename (lib_path_entry ))
296
321
sasl_libs .append ((sasl_libs_path , sasl_plugin_libs ))
297
322
298
- # Copy vendor libraries to 'mysql/vendor' folder
323
+ # Copy vendor libraries to 'mysql/vendor/private ' folder
299
324
self .log .info ("Copying vendor libraries" )
300
325
for src_folder , files in sasl_libs :
301
326
self .log .info ("Copying folder: %s" , src_folder )
@@ -304,7 +329,11 @@ def _copy_vendor_libraries(self):
304
329
if not os .path .exists (src ):
305
330
self .log .warn ("Library not found: %s" , src )
306
331
continue
307
- dst = os .path .join (os .getcwd (), self .vendor_folder )
332
+ dst = os .path .join (
333
+ os .getcwd (),
334
+ self .vendor_folder ,
335
+ "private"
336
+ )
308
337
self .log .info ("copying %s -> %s" , src , dst )
309
338
shutil .copy (src , dst )
310
339
@@ -335,10 +364,13 @@ def _copy_vendor_libraries(self):
335
364
336
365
sasl2_libs .append ((sasl2_libs_path , sasl2_scram_libs ))
337
366
338
- if not os .path .exists (os .path .join (self .vendor_folder , "sasl2" )):
339
- mkpath (os .path .join (os .getcwd (), self .vendor_folder , "sasl2" ))
367
+ sasl2_libs_private_path = os .path .join (
368
+ self .vendor_folder , "private" , "sasl2"
369
+ )
370
+ if not os .path .exists (sasl2_libs_private_path ):
371
+ mkpath (sasl2_libs_private_path )
340
372
341
- # Copy vendor libraries to 'mysql/vendor/sasl2' folder
373
+ # Copy vendor libraries to 'mysql/vendor/private/ sasl2' folder
342
374
self .log .info ("Copying vendor libraries" )
343
375
for src_folder , files in sasl2_libs :
344
376
self .log .info ("Copying folder: %s" , src_folder )
@@ -347,14 +379,18 @@ def _copy_vendor_libraries(self):
347
379
if not os .path .exists (src ):
348
380
self .log .warning ("Library not found: %s" , src )
349
381
continue
350
- dst = os .path .join (
351
- os .getcwd (),
352
- os .path .join (self .vendor_folder , "sasl2" ))
382
+ dst = os .path .join (os .getcwd (), sasl2_libs_private_path )
353
383
self .log .info ("copying %s -> %s" , src , dst )
354
384
shutil .copy (src , dst )
355
385
356
386
self .distribution .package_data = {
357
- "mysql" : ["vendor/*" , "vendor/sasl2/*" ]}
387
+ "mysql" : [
388
+ "vendor/*" ,
389
+ "vendor/plugin/*" ,
390
+ "vendor/private/*" ,
391
+ "vendor/private/sasl2/*"
392
+ ]
393
+ }
358
394
359
395
360
396
class BuildExt (build_ext , BaseCommand ):
0 commit comments