@@ -25,6 +25,10 @@ def __init__(self):
2525 self .build_dir = self .project_root / "build"
2626 self .spec_file = self .project_root / "integrations_finder.spec"
2727
28+ def get_platform_dist_dir (self , target_platform , target_arch ):
29+ """Get platform-specific dist directory"""
30+ return self .dist_dir / target_platform / target_arch
31+
2832 def clean (self ):
2933 """Clean build artifacts"""
3034 print ("Cleaning build artifacts..." )
@@ -43,10 +47,13 @@ def create_spec_file(self, target_platform, target_arch):
4347 # Determine target architecture for PyInstaller
4448 target_arch_value = "'arm64'" if target_arch == "aarch64" else "None"
4549
46- # Determine icon path based on platform
50+ # Determine icon path and executable name based on platform
4751 icon_path = None
52+ exe_name = "agent-integrations-finder"
53+
4854 if target_platform == "win" :
4955 icon_path = "'assets/images/logo.ico'" if Path ("assets/images/logo.ico" ).exists () else None
56+ exe_name = "agent-integrations-finder.exe"
5057 elif target_platform == "macos" :
5158 icon_path = "'assets/images/logo.icns'" if Path ("assets/images/logo.icns" ).exists () else None
5259 else : # linux
@@ -88,7 +95,7 @@ def create_spec_file(self, target_platform, target_arch):
8895 a.scripts,
8996 [],
9097 exclude_binaries=True,
91- name='suse-observability-integrations-finder ',
98+ name='{ exe_name } ',
9299 debug=False,
93100 bootloader_ignore_signals=False,
94101 strip=False,
@@ -110,19 +117,19 @@ def create_spec_file(self, target_platform, target_arch):
110117 strip=False,
111118 upx=True,
112119 upx_exclude=[],
113- name='suse-observability -integrations-finder',
120+ name='agent -integrations-finder',
114121)
115122
116123# For macOS, create .app bundle
117124if '{ target_platform } ' == 'macos':
118125 app = BUNDLE(
119126 coll,
120- name='SUSE Observability Integrations Finder.app',
127+ name='Agent Integrations Finder.app',
121128 icon={ icon_path } ,
122- bundle_identifier='com.suse.observability.integrations-finder',
129+ bundle_identifier='com.suse.observability.agent- integrations-finder',
123130 info_plist={{
124- 'CFBundleName': 'SUSE Observability Integrations Finder',
125- 'CFBundleDisplayName': 'SUSE Observability Integrations Finder',
131+ 'CFBundleName': 'Agent Integrations Finder',
132+ 'CFBundleDisplayName': 'Agent Integrations Finder',
126133 'CFBundleVersion': '1.0.0',
127134 'CFBundleShortVersionString': '1.0.0',
128135 'NSHighResolutionCapable': True,
@@ -142,13 +149,19 @@ def build(self, target_platform, target_arch):
142149 # Create spec file
143150 self .create_spec_file (target_platform , target_arch )
144151
145- # Build command - no need for --target-arch when using spec file
152+ # Get platform-specific dist directory
153+ platform_dist_dir = self .get_platform_dist_dir (target_platform , target_arch )
154+ platform_dist_dir .mkdir (parents = True , exist_ok = True )
155+
156+ # Build command with platform-specific dist directory
146157 cmd = [
147158 sys .executable ,
148159 "-m" ,
149160 "PyInstaller" ,
150161 "--clean" ,
151162 "--noconfirm" ,
163+ "--distpath" ,
164+ str (platform_dist_dir ),
152165 str (self .spec_file ),
153166 ]
154167
@@ -168,7 +181,11 @@ def package(self, target_platform, target_arch):
168181 """Package the built executable"""
169182 print (f"Packaging for { target_platform } -{ target_arch } ..." )
170183
171- source_dir = self .dist_dir / "suse-observability-integrations-finder"
184+ # Get platform-specific dist directory
185+ platform_dist_dir = self .get_platform_dist_dir (target_platform , target_arch )
186+ dir_name = "agent-integrations-finder"
187+
188+ source_dir = platform_dist_dir / dir_name
172189 if not source_dir .exists ():
173190 print (f"Error: Build directory not found: { source_dir } " )
174191 return False
@@ -180,48 +197,48 @@ def package(self, target_platform, target_arch):
180197 # Package based on platform
181198 if target_platform == "linux" :
182199 # Create tar.gz
183- archive_name = f"suse-observability -integrations-finder-{ target_platform } -{ target_arch } .tar.gz"
200+ archive_name = f"agent -integrations-finder-{ target_platform } -{ target_arch } .tar.gz"
184201 archive_path = output_dir / archive_name
185202
186203 cmd = [
187204 "tar" ,
188205 "-czf" ,
189206 str (archive_path ),
190207 "-C" ,
191- str (self . dist_dir ),
192- "suse-observability-integrations-finder" ,
208+ str (platform_dist_dir ),
209+ dir_name ,
193210 ]
194211 subprocess .run (cmd , check = True )
195212
196213 elif target_platform == "macos" :
197214 # Create .dmg or .tar.gz
198- archive_name = f"suse-observability -integrations-finder-{ target_platform } -{ target_arch } .tar.gz"
215+ archive_name = f"agent -integrations-finder-{ target_platform } -{ target_arch } .tar.gz"
199216 archive_path = output_dir / archive_name
200217
201218 cmd = [
202219 "tar" ,
203220 "-czf" ,
204221 str (archive_path ),
205222 "-C" ,
206- str (self . dist_dir ),
207- "suse-observability-integrations-finder" ,
223+ str (platform_dist_dir ),
224+ dir_name ,
208225 ]
209226 subprocess .run (cmd , check = True )
210227
211228 elif target_platform == "win" :
212229 # Create zip using Python's zipfile module
213- archive_name = f"suse-observability -integrations-finder-{ target_platform } -{ target_arch } .zip"
230+ archive_name = f"agent -integrations-finder-{ target_platform } -{ target_arch } .zip"
214231 archive_path = output_dir / archive_name
215232
216233 import os
217234 import zipfile
218235
219236 with zipfile .ZipFile (archive_path , "w" , zipfile .ZIP_DEFLATED ) as zipf :
220- source_dir = self . dist_dir / "suse-observability-integrations-finder"
237+ source_dir = platform_dist_dir / dir_name
221238 for root , dirs , files in os .walk (source_dir ):
222239 for file in files :
223240 file_path = Path (root ) / file
224- arcname = file_path .relative_to (self . dist_dir )
241+ arcname = file_path .relative_to (platform_dist_dir )
225242 zipf .write (file_path , arcname )
226243
227244 print (f"Package created: { archive_path } " )
0 commit comments