rpms/azureus/devel azureus-4.0.0.4-boo-osx.diff, NONE, 1.1 azureus-4.0.0.4-boo-updating-w32.diff, NONE, 1.1 azureus-4.0.0.4-boo-windows.diff, NONE, 1.1 azureus-4.0.0.4-oops-return.diff, NONE, 1.1 azureus-4.0.0.4-screw-w32-tests.diff, NONE, 1.1 azureus-4.0.0.4-screw-win32utils.diff, NONE, 1.1 azureus-4.0.0.4-silly-java-tricks-are-for-kids.diff, NONE, 1.1 azureus-4.0.0.4-stupid-invalid-characters.diff, NONE, 1.1 .cvsignore, 1.14, 1.15 azureus.spec, 1.70, 1.71 sources, 1.14, 1.15 azureus-License.txt, 1.1, NONE
Conrad Meyer
konradm at fedoraproject.org
Thu Feb 26 20:20:33 UTC 2009
Author: konradm
Update of /cvs/pkgs/rpms/azureus/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv5796
Modified Files:
.cvsignore azureus.spec sources
Added Files:
azureus-4.0.0.4-boo-osx.diff
azureus-4.0.0.4-boo-updating-w32.diff
azureus-4.0.0.4-boo-windows.diff
azureus-4.0.0.4-oops-return.diff
azureus-4.0.0.4-screw-w32-tests.diff
azureus-4.0.0.4-screw-win32utils.diff
azureus-4.0.0.4-silly-java-tricks-are-for-kids.diff
azureus-4.0.0.4-stupid-invalid-characters.diff
Removed Files:
azureus-License.txt
Log Message:
* Sat Dec 20 2008 Conrad Meyer <konrad at tylerc.org> - 4.0.0.4-1
- New version, new breakage. Patches 50-56 added.
- Dropped a lot of patches that don't apply to the new azureus.
azureus-4.0.0.4-boo-osx.diff:
--- NEW FILE azureus-4.0.0.4-boo-osx.diff ---
diff -urN org/gudy/azureus2/ui/swt.orig/mainwindow/SWTThread.java org/gudy/azureus2/ui/swt/mainwindow/SWTThread.java
--- org/gudy/azureus2/ui/swt.orig/mainwindow/SWTThread.java 2008-09-26 10:53:14.000000000 -0700
+++ org/gudy/azureus2/ui/swt/mainwindow/SWTThread.java 2008-12-19 23:51:10.000000000 -0800
@@ -150,24 +150,6 @@
}
});
- if ( Constants.isOSX ){
-
- // use reflection here so we decouple generic SWT from OSX specific stuff to an extent
-
- try{
-
- Class ehancerClass = Class.forName("org.gudy.azureus2.ui.swt.osx.CarbonUIEnhancer");
-
- Constructor constructor = ehancerClass.getConstructor(new Class[]{});
-
- constructor.newInstance(new Object[] {});
-
- } catch (Exception e) {
-
- Debug.printStackTrace(e);
- }
- }
-
if (app != null) {
runner = new Thread(new AERunnable() {
public void runSupport() {
diff -urN org/gudy/azureus2/ui/swt.orig/osx/CarbonUIEnhancer.java org/gudy/azureus2/ui/swt/osx/CarbonUIEnhancer.java
--- org/gudy/azureus2/ui/swt.orig/osx/CarbonUIEnhancer.java 2008-07-24 13:38:16.000000000 -0700
+++ org/gudy/azureus2/ui/swt/osx/CarbonUIEnhancer.java 1969-12-31 16:00:00.000000000 -0800
@@ -1,674 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- * * Contributors:
- * IBM Corporation - initial API and implementation
- * Aelitis - Adaptation for Azureus
- *******************************************************************************/
-package org.gudy.azureus2.ui.swt.osx;
-
-import java.io.IOException;
-import java.lang.reflect.Method;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.internal.Callback;
-import org.eclipse.swt.internal.carbon.AEDesc;
-import org.eclipse.swt.internal.carbon.CFRange;
-import org.eclipse.swt.internal.carbon.EventRecord;
-import org.eclipse.swt.internal.carbon.HICommand;
-import org.eclipse.swt.internal.carbon.OS;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Widget;
-import org.gudy.azureus2.core3.config.COConfigurationManager;
-import org.gudy.azureus2.core3.internat.MessageText;
-import org.gudy.azureus2.core3.util.AERunnable;
-import org.gudy.azureus2.core3.util.Debug;
-import org.gudy.azureus2.platform.macosx.access.jnilib.OSXAccess;
-import org.gudy.azureus2.ui.swt.UIExitUtilsSWT;
-import org.gudy.azureus2.ui.swt.Utils;
-import org.gudy.azureus2.ui.swt.config.wizard.ConfigureWizard;
-import org.gudy.azureus2.ui.swt.help.AboutWindow;
-import org.gudy.azureus2.ui.swt.mainwindow.TorrentOpener;
-import org.gudy.azureus2.ui.swt.nat.NatTestWindow;
-import org.gudy.azureus2.ui.swt.speedtest.SpeedTestWizard;
-
-import com.aelitis.azureus.core.AzureusCoreFactory;
-import com.aelitis.azureus.ui.UIFunctions;
-import com.aelitis.azureus.ui.UIFunctionsManager;
-import com.apple.cocoa.application.NSApplication;
-
-//import com.apple.eawt.*; //Application and ApplicationAdapter
-
-public class CarbonUIEnhancer
-{
- private static final int kHICommandPreferences = ('p' << 24) + ('r' << 16)
- + ('e' << 8) + 'f';
-
- private static final int kHICommandAbout = ('a' << 24) + ('b' << 16)
- + ('o' << 8) + 'u';
-
- private static final int kHICommandServices = ('s' << 24) + ('e' << 16)
- + ('r' << 8) + 'v';
-
- private static final int kHICommandWizard = ('a' << 24) + ('z' << 16)
- + ('c' << 8) + 'n';
-
- private static final int kHICommandNatTest = ('a' << 24) + ('z' << 16)
- + ('n' << 8) + 't';
-
- private static final int kHICommandSpeedTest = ('a' << 24) + ('z' << 16)
- + ('s' << 8) + 't';
-
- private static final int kHICommandRestart = ('a' << 24) + ('z' << 16)
- + ('r' << 8) + 's';
-
- private static final int typeAEList = ('l' << 24) + ('i' << 16) + ('s' << 8)
- + 't';
-
- private static final int kCoreEventClass = ('a' << 24) + ('e' << 16)
- + ('v' << 8) + 't';
-
- private static final int kAEOpenDocuments = ('o' << 24) + ('d' << 16)
- + ('o' << 8) + 'c';
-
- private static final int kAEReopenApplication = ('r' << 24) + ('a' << 16)
- + ('p' << 8) + 'p';
-
- private static final int kAEOpenContents = ('o' << 24) + ('c' << 16)
- + ('o' << 8) + 'n';
-
- private static final int kURLEventClass = ('G' << 24) + ('U' << 16)
- + ('R' << 8) + 'L';
-
- private static final int typeText = ('T' << 24) + ('E' << 16) + ('X' << 8)
- + 'T';
-
- private static final String RESOURCE_BUNDLE = "org.eclipse.ui.carbon.Messages"; //$NON-NLS-1$
-
- private static String fgAboutActionName;
-
- private static String fgWizardActionName;
-
- private static String fgNatTestActionName;
-
- private static String fgRestartActionName;
-
- private static String fgSpeedTestActionName;
-
- private static int memmove_type = 0;
-
- /**
- * KN: Some of the menu items have been removed for the Vuze and Vuze Advanced UI's;
- * the classic UI still retains all its menu items as before. Follow this flag in the code
- * to see which menu items are effected.
- */
- private boolean isAZ3 = "az3".equalsIgnoreCase(COConfigurationManager.getStringParameter("ui"));
-
- public static final int BOUNCE_SINGLE = NSApplication.UserAttentionRequestInformational;
-
- public static final int BOUNCE_CONTINUOUS = NSApplication.UserAttentionRequestCritical;
-
- public CarbonUIEnhancer() {
- if (fgAboutActionName == null) {
- fgAboutActionName = MessageText.getString("MainWindow.menu.help.about").replaceAll(
- "&", "");
- }
-
- if (false == isAZ3) {
- if (fgWizardActionName == null) {
- fgWizardActionName = MessageText.getString(
- "MainWindow.menu.file.configure").replaceAll("&", "");
- }
- if (fgNatTestActionName == null) {
- fgNatTestActionName = MessageText.getString(
- "MainWindow.menu.tools.nattest").replaceAll("&", "");
- }
-
- if (fgSpeedTestActionName == null) {
- fgSpeedTestActionName = MessageText.getString(
- "MainWindow.menu.tools.speedtest").replaceAll("&", "");
- }
- }
-
- if (fgRestartActionName == null) {
- fgRestartActionName = MessageText.getString(
- "MainWindow.menu.file.restart").replaceAll("&", "");
- }
- earlyStartup();
- registerTorrentFile();
- }
-
- public static void registerToolbarToggle(Shell shell) {
- final Callback toolbarToggleCB = new Callback(target, "toolbarToggle", 3);
- int toolbarToggle = toolbarToggleCB.getAddress();
- if (toolbarToggle == 0) {
- Debug.out("OSX: Could not find callback 'toolbarToggle'");
- toolbarToggleCB.dispose();
- return;
- }
-
- shell.getDisplay().disposeExec(new Runnable() {
- public void run() {
- toolbarToggleCB.dispose();
- }
- });
-
- // add the button to the window trim
- int windowHandle = OS.GetControlOwner(shell.handle);
- OS.ChangeWindowAttributes(windowHandle, OS.kWindowToolbarButtonAttribute, 0);
-
- int[] mask = new int[] {
- OS.kEventClassWindow,
- OS.kEventWindowToolbarSwitchMode
- };
- // register the handler with the OS
- OS.InstallEventHandler(OS.GetApplicationEventTarget(), toolbarToggle,
- mask.length / 2, mask, 0, null);
- }
-
- private void registerTorrentFile() {
- int result;
-
- Callback clickDockIconCallback = new Callback(target, "clickDockIcon", 3);
- int clickDocIcon = clickDockIconCallback.getAddress();
- if (clickDocIcon == 0) {
- clickDockIconCallback.dispose();
- } else {
- result = OS.AEInstallEventHandler(kCoreEventClass, kAEReopenApplication,
- clickDocIcon, 0, false);
-
- if (result != OS.noErr) {
- Debug.out("OSX: Could Install ReopenApplication Event Handler. Error: "
- + result);
- }
- }
-
- Callback openContentsCallback = new Callback(target, "openContents", 3);
- int openContents = openContentsCallback.getAddress();
- if (openContents == 0) {
- openContentsCallback.dispose();
- } else {
- result = OS.AEInstallEventHandler(kCoreEventClass, kAEOpenContents,
- openContents, 0, false);
-
- if (result != OS.noErr) {
- Debug.out("OSX: Could Install OpenContents Event Handler. Error: "
- + result);
- }
- }
-
- Callback openDocCallback = new Callback(target, "openDocProc", 3);
- int openDocProc = openDocCallback.getAddress();
- if (openDocProc == 0) {
- Debug.out("OSX: Could not find Callback 'openDocProc'");
- openDocCallback.dispose();
- return;
- }
-
- result = OS.AEInstallEventHandler(kCoreEventClass, kAEOpenDocuments,
- openDocProc, 0, false);
-
- if (result != OS.noErr) {
- Debug.out("OSX: Could not Install OpenDocs Event Handler. Error: "
- + result);
- return;
- }
-
- result = OS.AEInstallEventHandler(kURLEventClass, kURLEventClass,
- openDocProc, 0, false);
- if (result != OS.noErr) {
- Debug.out("OSX: Could not Install URLEventClass Event Handler. Error: "
- + result);
- return;
- }
-
- ///
-
- Callback quitAppCallback = new Callback(target, "quitAppProc", 3);
- int quitAppProc = quitAppCallback.getAddress();
- if (quitAppProc == 0) {
- Debug.out("OSX: Could not find Callback 'quitApp'");
- quitAppCallback.dispose();
- } else {
- result = OS.AEInstallEventHandler(kCoreEventClass, OS.kAEQuitApplication,
- quitAppProc, 0, false);
- if (result != OS.noErr) {
- Debug.out("OSX: Could not install QuitApplication Event Handler. Error: "
- + result);
- }
- }
-
- ///
-
- int appTarget = OS.GetApplicationEventTarget();
- Callback appleEventCallback = new Callback(this, "appleEventProc", 3);
- int appleEventProc = appleEventCallback.getAddress();
- int[] mask3 = new int[] {
- OS.kEventClassAppleEvent,
- OS.kEventAppleEvent,
- kURLEventClass,
- kAEReopenApplication,
- kAEOpenContents,
- };
- result = OS.InstallEventHandler(appTarget, appleEventProc,
- mask3.length / 2, mask3, 0, null);
- if (result != OS.noErr) {
- Debug.out("OSX: Could Install Event Handler. Error: " + result);
- return;
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IStartup#earlyStartup()
- */
- public void earlyStartup() {
- final Display display = Display.getDefault();
- display.syncExec(new AERunnable() {
- public void runSupport() {
- hookApplicationMenu(display);
- }
- });
- }
-
- /**
- * See Apple Technical Q&A 1079 (http://developer.apple.com/qa/qa2001/qa1079.html)<br />
- * Also http://developer.apple.com/documentation/Carbon/Reference/Menu_Manager/menu_mgr_ref/function_group_10.html
- */
- public void hookApplicationMenu(final Display display) {
- // Callback target
- Object target = new Object() {
- int commandProc(int nextHandler, int theEvent, int userData) {
- if (OS.GetEventKind(theEvent) == OS.kEventProcessCommand) {
- HICommand command = new HICommand();
- OS.GetEventParameter(theEvent, OS.kEventParamDirectObject,
- OS.typeHICommand, null, HICommand.sizeof, null, command);
- switch (command.commandID) {
- case kHICommandPreferences: {
- UIFunctions uiFunctions = UIFunctionsManager.getUIFunctions();
- if (uiFunctions != null) {
- uiFunctions.openView(UIFunctions.VIEW_CONFIG, null);
- }
- return OS.noErr;
- }
- case kHICommandAbout:
- AboutWindow.show(display);
- return OS.noErr;
- case kHICommandRestart: {
- UIFunctions uiFunctions = UIFunctionsManager.getUIFunctions();
- if (uiFunctions != null) {
- uiFunctions.dispose(true, false);
- }
- return OS.noErr;
- }
- case kHICommandWizard:
- new ConfigureWizard(AzureusCoreFactory.getSingleton(), false);
- return OS.noErr;
- case kHICommandNatTest:
- new NatTestWindow();
- return OS.noErr;
- case kHICommandSpeedTest:
- new SpeedTestWizard(AzureusCoreFactory.getSingleton(), display);
- return OS.noErr;
-
- case OS.kAEQuitApplication:
- UIFunctions uiFunctions = UIFunctionsManager.getUIFunctions();
- if (uiFunctions != null) {
- uiFunctions.dispose(false, false);
- return OS.noErr;
- } else {
- UIExitUtilsSWT.setSkipCloseCheck(true);
- }
- default:
- break;
- }
- }
- return OS.eventNotHandledErr;
- }
- };
- final Callback commandCallback = new Callback(target, "commandProc", 3); //$NON-NLS-1$
- int commandProc = commandCallback.getAddress();
- if (commandProc == 0) {
- commandCallback.dispose();
- return; // give up
- }
-
- // Install event handler for commands
- int[] mask = new int[] {
- OS.kEventClassCommand,
- OS.kEventProcessCommand
- };
- OS.InstallEventHandler(OS.GetApplicationEventTarget(), commandProc,
- mask.length / 2, mask, 0, null);
-
- // create About menu command
- int[] outMenu = new int[1];
- short[] outIndex = new short[1];
- if (OS.GetIndMenuItemWithCommandID(0, kHICommandPreferences, 1, outMenu,
- outIndex) == OS.noErr
- && outMenu[0] != 0) {
- int menu = outMenu[0];
-
- int l = fgAboutActionName.length();
- char buffer[] = new char[l];
- fgAboutActionName.getChars(0, l, buffer, 0);
- int str = OS.CFStringCreateWithCharacters(OS.kCFAllocatorDefault, buffer,
- l);
- OS.InsertMenuItemTextWithCFString(menu, str, (short) 0, 0,
- kHICommandAbout);
- OS.CFRelease(str);
- // add separator between About & Preferences
- OS.InsertMenuItemTextWithCFString(menu, 0, (short) 1,
- OS.kMenuItemAttrSeparator, 0);
-
- // enable pref menu
- OS.EnableMenuCommand(menu, kHICommandPreferences);
- // disable services menu
- OS.DisableMenuCommand(menu, kHICommandServices);
-
- if (false == isAZ3) {
- // wizard menu
- l = fgWizardActionName.length();
- buffer = new char[l];
- fgWizardActionName.getChars(0, l, buffer, 0);
- str = OS.CFStringCreateWithCharacters(OS.kCFAllocatorDefault, buffer, l);
- OS.InsertMenuItemTextWithCFString(menu, str, (short) 3, 0,
- kHICommandWizard);
- OS.CFRelease(str);
-
- // NAT test menu
- l = fgNatTestActionName.length();
- buffer = new char[l];
- fgNatTestActionName.getChars(0, l, buffer, 0);
- str = OS.CFStringCreateWithCharacters(OS.kCFAllocatorDefault, buffer, l);
- OS.InsertMenuItemTextWithCFString(menu, str, (short) 4, 0,
- kHICommandNatTest);
- OS.CFRelease(str);
-
- //SpeedTest
- l = fgSpeedTestActionName.length();
- buffer = new char[l];
- fgSpeedTestActionName.getChars(0, l, buffer, 0);
- str = OS.CFStringCreateWithCharacters(OS.kCFAllocatorDefault, buffer, l);
- OS.InsertMenuItemTextWithCFString(menu, str, (short) 5, 0,
- kHICommandSpeedTest);
- OS.CFRelease(str);
- }
-
- OS.InsertMenuItemTextWithCFString(menu, 0, (short) 6,
- OS.kMenuItemAttrSeparator, 0);
-
- // restart menu
- l = fgRestartActionName.length();
- buffer = new char[l];
- fgRestartActionName.getChars(0, l, buffer, 0);
- str = OS.CFStringCreateWithCharacters(OS.kCFAllocatorDefault, buffer, l);
- OS.InsertMenuItemTextWithCFString(menu, str, (short) 7, 0,
- kHICommandRestart);
- OS.CFRelease(str);
-
- OS.InsertMenuItemTextWithCFString(menu, 0, (short) 8,
- OS.kMenuItemAttrSeparator, 0);
- }
-
- // schedule disposal of callback object
- display.disposeExec(new AERunnable() {
- public void runSupport() {
- commandCallback.dispose();
- // stopSidekick();
- }
- });
- }
-
- private static void stopSidekick() {
- try {
- Runtime.getRuntime().exec(new String[] {
- "osascript",
- "-e",
- "tell application \"Azureus\" to quit"
- });
- } catch (IOException e) {
- Debug.printStackTrace(e);
- }
- }
-
- int appleEventProc(int nextHandler, int theEvent, int userData) {
- int eventClass = OS.GetEventClass(theEvent);
- //int eventKind = OS.GetEventKind(theEvent);
-
- //System.out.println("appleEventProc " + OSXtoString(eventClass) + ";"
- // + OS.GetEventKind(theEvent) + ";" + OSXtoString(theEvent) + ";"
- // + OSXtoString(userData));
-
- // Process teh odoc event
- if (eventClass == OS.kEventClassAppleEvent) {
- int[] aeEventID = new int[1];
- if (OS.GetEventParameter(theEvent, OS.kEventParamAEEventID, OS.typeType,
- null, 4, null, aeEventID) != OS.noErr) {
- return OS.eventNotHandledErr;
- }
- //System.out.println("EventID = " + OSXtoString(aeEventID[0]));
- if (aeEventID[0] != kAEOpenDocuments && aeEventID[0] != kURLEventClass
- && aeEventID[0] != kAEReopenApplication
- && aeEventID[0] != kAEOpenContents
- && aeEventID[0] != OS.kAEQuitApplication) {
- return OS.eventNotHandledErr;
- }
-
- // Handle Event
- EventRecord eventRecord = new EventRecord();
- OS.ConvertEventRefToEventRecord(theEvent, eventRecord);
- OS.AEProcessAppleEvent(eventRecord);
-
- // Tell Mac we are handling this event
- return OS.noErr;
- }
-
- return OS.eventNotHandledErr;
- }
-
- private static String OSXtoString(int i) {
- char[] c = new char[4];
- c[0] = (char) ((i >> 24) & 0xff);
- c[1] = (char) ((i >> 16) & 0xff);
- c[2] = (char) ((i >> 8) & 0xff);
- c[3] = (char) (i & 0xff);
- return new String(c);
- }
-
- private static void memmove(byte[] dest, int src, int size) {
- switch (memmove_type) {
- case 0:
- try {
- OSXAccess.memmove(dest, src, size);
- memmove_type = 0;
- return;
- } catch (Throwable e) {
- }
- // FALL THROUGH
-
- case 1:
- try {
- Class cMemMove = Class.forName("org.eclipse.swt.internal.carbon.OS");
-
- Method method = cMemMove.getMethod("memmove", new Class[] {
- byte[].class,
- Integer.TYPE,
- Integer.TYPE
- });
-
- method.invoke(null, new Object[] {
- dest,
- new Integer(src),
- new Integer(size)
- });
- memmove_type = 1;
- return;
- } catch (Throwable e) {
- }
-
- // FALL THROUGH
- case 2:
- try {
- Class cMemMove = Class.forName("org.eclipse.swt.internal.carbon.OS");
-
- Method method = cMemMove.getMethod("memcpy", new Class[] {
- byte[].class,
- Integer.TYPE,
- Integer.TYPE
- });
-
- method.invoke(null, new Object[] {
- dest,
- new Integer(src),
- new Integer(size)
- });
-
- memmove_type = 2;
- return;
- } catch (Throwable e) {
- }
-
- // FALL THROUGH
-
- default:
- break;
- }
-
- memmove_type = 3;
- }
-
- final static Object target = new Object() {
- int quitAppProc(int theAppleEvent, int reply, int handlerRefcon) {
- UIFunctions uiFunctions = UIFunctionsManager.getUIFunctions();
- if (uiFunctions != null) {
- uiFunctions.dispose(false, false);
- } else {
- UIExitUtilsSWT.setSkipCloseCheck(true);
- Display.getDefault().dispose();
- }
- return OS.noErr;
- }
-
- int openDocProc(int theAppleEvent, int reply, int handlerRefcon) {
- AEDesc aeDesc = new AEDesc();
- EventRecord eventRecord = new EventRecord();
- OS.ConvertEventRefToEventRecord(theAppleEvent, eventRecord);
- try {
- int result = OSXAccess.AEGetParamDesc(theAppleEvent,
- OS.kEventParamDirectObject, typeAEList, aeDesc);
- if (result != OS.noErr) {
- Debug.out("OSX: Could call AEGetParamDesc. Error: " + result);
- return OS.noErr;
- }
- } catch (java.lang.UnsatisfiedLinkError e) {
- Debug.out("OSX: AEGetParamDesc not available. Can't open sent file");
- return OS.noErr;
- }
-
- int[] count = new int[1];
- OS.AECountItems(aeDesc, count);
- //System.out.println("COUNT: " + count[0]);
- if (count[0] > 0) {
- String[] fileNames = new String[count[0]];
- int maximumSize = 80; // size of FSRef
- int dataPtr = OS.NewPtr(maximumSize);
- int[] aeKeyword = new int[1];
- int[] typeCode = new int[1];
- int[] actualSize = new int[1];
- for (int i = 0; i < count[0]; i++) {
- if (OS.AEGetNthPtr(aeDesc, i + 1, OS.typeFSRef, aeKeyword, typeCode,
- dataPtr, maximumSize, actualSize) == OS.noErr) {
- byte[] fsRef = new byte[actualSize[0]];
- memmove(fsRef, dataPtr, actualSize[0]);
- int dirUrl = OS.CFURLCreateFromFSRef(OS.kCFAllocatorDefault, fsRef);
- int dirString = OS.CFURLCopyFileSystemPath(dirUrl,
- OS.kCFURLPOSIXPathStyle);
- OS.CFRelease(dirUrl);
- int length = OS.CFStringGetLength(dirString);
- char[] buffer = new char[length];
- CFRange range = new CFRange();
- range.length = length;
- OS.CFStringGetCharacters(dirString, range, buffer);
- OS.CFRelease(dirString);
- fileNames[i] = new String(buffer);
- }
-
- if (OS.AEGetNthPtr(aeDesc, i + 1, typeText, aeKeyword, typeCode,
- dataPtr, maximumSize, actualSize) == OS.noErr) {
- byte[] urlRef = new byte[actualSize[0]];
- memmove(urlRef, dataPtr, actualSize[0]);
- fileNames[i] = new String(urlRef);
- }
-
- //System.out.println(fileNames[i]);
- }
-
- TorrentOpener.openTorrents(fileNames);
- }
-
- return OS.noErr;
- }
-
- int clickDockIcon(int nextHandler, int theEvent, int userData) {
- UIFunctions uiFunctions = UIFunctionsManager.getUIFunctions();
- if (uiFunctions != null) {
- uiFunctions.bringToFront();
- return OS.noErr;
- }
- return OS.eventNotHandledErr;
- }
-
- int openContents(int nextHandler, int theEvent, int userData) {
- Debug.out("openDocContents");
- return OS.noErr;
- }
-
- int toolbarToggle(int nextHandler, int theEvent, int userData) {
- int eventKind = OS.GetEventKind(theEvent);
- if (eventKind != OS.kEventWindowToolbarSwitchMode) {
- return OS.eventNotHandledErr;
- }
-
- int[] theWindow = new int[1];
- OS.GetEventParameter(theEvent, OS.kEventParamDirectObject,
- OS.typeWindowRef, null, 4, null, theWindow);
-
- int[] theRoot = new int[1];
- OS.GetRootControl(theWindow[0], theRoot);
- final Widget widget = Display.getCurrent().findWidget(theRoot[0]);
-
- if (!(widget instanceof Shell)) {
- return OS.eventNotHandledErr;
- }
- final Shell shellAffected = (Shell) widget;
-
- Utils.execSWTThread(new AERunnable() {
- public void runSupport() {
- int type;
- Long l = (Long) shellAffected.getData("OSX.ToolBarToggle");
- if (l == null || l.longValue() == 0) {
- type = SWT.Collapse;
- } else {
- type = SWT.Expand;
- }
-
- Event event = new Event();
- event.type = type;
- event.display = widget.getDisplay();
- event.widget = widget;
- shellAffected.notifyListeners(type, event);
-
- shellAffected.setData("OSX.ToolBarToggle", new Long(
- type == SWT.Collapse ? 1 : 0));
- }
- });
-
- return OS.noErr;
- }
- };
-
-}
\ No newline at end of file
diff -urN org/gudy/azureus2/ui/swt.orig/osx/Start.java org/gudy/azureus2/ui/swt/osx/Start.java
--- org/gudy/azureus2/ui/swt.orig/osx/Start.java 2006-02-09 19:43:24.000000000 -0800
+++ org/gudy/azureus2/ui/swt/osx/Start.java 1969-12-31 16:00:00.000000000 -0800
@@ -1,74 +0,0 @@
-/*
- * Created on May 30, 2004
- * Created by Olivier Chalouhi
- * Copyright (C) 2004, 2005, 2006 Aelitis, All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * AELITIS, SAS au capital de 46,603.30 euros
- * 8 Allee Lenotre, La Grille Royale, 78600 Le Mesnil le Roi, France.
- *
- */
-package org.gudy.azureus2.ui.swt.osx;
-
-import java.io.OutputStreamWriter;
-import java.io.PrintWriter;
-import java.net.Socket;
-
-import org.gudy.azureus2.core3.util.Debug;
-
-
-public class Start {
- public Start(String args[]) {
-// if(args.length == 0)
-// return;
-
- Socket sck = null;
- PrintWriter pw = null;
- try {
- System.out.println("StartSocket: passing startup args to already-running Azureus java process.");
-
- sck = new Socket("127.0.0.1", 6880);
-
- pw = new PrintWriter(new OutputStreamWriter(sck.getOutputStream(),"UTF8"));
-
- StringBuffer buffer = new StringBuffer("Azureus Start Server Access;args;");
-
- for(int i = 0 ; i < args.length ; i++) {
- String arg = args[i].replaceAll("&","&&").replaceAll(";","&;");
- buffer.append(arg);
- buffer.append(';');
- }
-
- pw.println(buffer.toString());
- pw.flush();
- } catch(Exception e) {
- Debug.printStackTrace( e );
- } finally {
- try {
- if (pw != null)
- pw.close();
- } catch (Exception e) {
- }
- try {
- if (sck != null)
- sck.close();
- } catch (Exception e) {
- }
- }
- }
-
- public static void main(String args[]) {
- new Start(args);
- }
- }
\ No newline at end of file
diff -urN org/gudy/azureus2/ui/swt.orig/win32/Win32UIEnhancer.java org/gudy/azureus2/ui/swt/win32/Win32UIEnhancer.java
--- org/gudy/azureus2/ui/swt.orig/win32/Win32UIEnhancer.java 2008-07-03 02:43:40.000000000 -0700
+++ org/gudy/azureus2/ui/swt/win32/Win32UIEnhancer.java 1969-12-31 16:00:00.000000000 -0800
@@ -1,135 +0,0 @@
-/**
- * Copyright (C) 2006 Aelitis, All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * AELITIS, SAS au capital de 63.529,40 euros
- * 8 Allee Lenotre, La Grille Royale, 78600 Le Mesnil le Roi, France.
- *
- */
-
-package org.gudy.azureus2.ui.swt.win32;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.ImageData;
-import org.eclipse.swt.internal.win32.OS;
-import org.eclipse.swt.internal.win32.TCHAR;
-
-/**
- * @author TuxPaper
- * @created Nov 29, 2006
- *
- * Note: You can safely exclude this class from the build path.
- * All calls to this class use (or at least should use) reflection
- */
-public class Win32UIEnhancer
-{
- static String findProgramKey(String extension) {
- if (extension == null)
- SWT.error(SWT.ERROR_NULL_ARGUMENT);
- if (extension.length() == 0)
- return null;
- if (extension.charAt(0) != '.')
- extension = "." + extension; //$NON-NLS-1$
- /* Use the character encoding for the default locale */
- TCHAR key = new TCHAR(0, extension, true);
- int[] phkResult = new int[1];
- if (OS.RegOpenKeyEx(OS.HKEY_CLASSES_ROOT, key, 0, OS.KEY_READ, phkResult) != 0) {
- return null;
- }
- int[] lpcbData = new int[1];
- int result = OS.RegQueryValueEx(phkResult[0], null, 0, null, (TCHAR) null,
- lpcbData);
- if (result == 0) {
- TCHAR lpData = new TCHAR(0, lpcbData[0] / TCHAR.sizeof);
- result = OS.RegQueryValueEx(phkResult[0], null, 0, null, lpData, lpcbData);
- if (result == 0)
- return lpData.toString(0, lpData.strlen());
- }
- OS.RegCloseKey(phkResult[0]);
- return null;
- }
-
- public static ImageData getBigImageData(String extension) {
- String key = findProgramKey(extension);
- if (key == null) {
- return null;
- }
-
- /* Icon */
- String DEFAULT_ICON = "\\DefaultIcon"; //$NON-NLS-1$
- String iconName = getKeyValue(key + DEFAULT_ICON, true);
- if (iconName == null)
- iconName = ""; //$NON-NLS-1$
-
- int nIconIndex = 0;
- String fileName = iconName;
- int index = iconName.indexOf(',');
- if (index != -1) {
- fileName = iconName.substring(0, index);
- String iconIndex = iconName.substring(index + 1, iconName.length()).trim();
- try {
- nIconIndex = Integer.parseInt(iconIndex);
- } catch (NumberFormatException e) {
- }
- }
- /* Use the character encoding for the default locale */
- TCHAR lpszFile = new TCHAR(0, fileName, true);
- int[] phiconSmall = null, phiconLarge = new int[1];
- OS.ExtractIconEx(lpszFile, nIconIndex, phiconLarge, phiconSmall, 1);
- if (phiconLarge[0] == 0) {
- return null;
- }
- Image image = Image.win32_new(null, SWT.ICON, phiconLarge[0]);
- ImageData imageData = image.getImageData();
- image.dispose();
- return imageData;
- }
-
- static String getKeyValue(String string, boolean expand) {
- /* Use the character encoding for the default locale */
- TCHAR key = new TCHAR(0, string, true);
- int[] phkResult = new int[1];
- if (OS.RegOpenKeyEx(OS.HKEY_CLASSES_ROOT, key, 0, OS.KEY_READ, phkResult) != 0) {
- return null;
- }
- String result = null;
- int[] lpcbData = new int[1];
- if (OS.RegQueryValueEx(phkResult[0], (TCHAR) null, 0, null, (TCHAR) null,
- lpcbData) == 0) {
- result = "";
- int length = lpcbData[0] / TCHAR.sizeof;
- if (length != 0) {
- /* Use the character encoding for the default locale */
- TCHAR lpData = new TCHAR(0, length);
- if (OS.RegQueryValueEx(phkResult[0], null, 0, null, lpData, lpcbData) == 0) {
- if (!OS.IsWinCE && expand) {
- length = OS.ExpandEnvironmentStrings(lpData, null, 0);
- if (length != 0) {
- TCHAR lpDst = new TCHAR(0, length);
- OS.ExpandEnvironmentStrings(lpData, lpDst, length);
- result = lpDst.toString(0, Math.max(0, length - 1));
- }
- } else {
- length = Math.max(0, lpData.length() - 1);
- result = lpData.toString(0, length);
- }
- }
- }
- }
- if (phkResult[0] != 0)
- OS.RegCloseKey(phkResult[0]);
- return result;
- }
-}
azureus-4.0.0.4-boo-updating-w32.diff:
--- NEW FILE azureus-4.0.0.4-boo-updating-w32.diff ---
diff -urN com/aelitis/azureus/core/update.orig/impl/AzureusRestarterImpl.java com/aelitis/azureus/core/update/impl/AzureusRestarterImpl.java
--- com/aelitis/azureus/core/update.orig/impl/AzureusRestarterImpl.java 2007-07-30 13:13:28.000000000 -0700
+++ com/aelitis/azureus/core/update/impl/AzureusRestarterImpl.java 2008-12-20 00:09:42.000000000 -0800
@@ -30,8 +30,8 @@
import org.gudy.azureus2.platform.PlatformManager;
import org.gudy.azureus2.platform.PlatformManagerFactory;
import org.gudy.azureus2.platform.unix.ScriptAfterShutdown;
-import org.gudy.azureus2.platform.win32.access.AEWin32Access;
-import org.gudy.azureus2.platform.win32.access.AEWin32Manager;
+//import org.gudy.azureus2.platform.win32.access.AEWin32Access;
+//import org.gudy.azureus2.platform.win32.access.AEWin32Manager;
import org.gudy.azureus2.update.UpdaterUtils;
import com.aelitis.azureus.core.AzureusCore;
@@ -219,20 +219,6 @@
PrintWriter log,
String exec )
{
- try{
- // we need to spawn without inheriting handles
-
- PlatformManager pm = PlatformManagerFactory.getPlatformManager();
-
- pm.createProcess( exec, false );
-
- return( true );
-
- }catch(Throwable e) {
- e.printStackTrace(log);
-
- return( false );
- }
}
@@ -304,131 +290,6 @@
String backupJavaRunString,
boolean update_only)
{
- String azRunner = null;
- File fileRestart = null;
- if (!update_only) {
- try {
- azRunner = PlatformManagerFactory.getPlatformManager().getApplicationCommandLine();
- } catch (PlatformManagerException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
-
- try {
- int result;
- AEWin32Access accessor = AEWin32Manager.getAccessor(true);
- if (accessor == null) {
- result = -123;
- } else {
- if (azRunner != null) {
- // create a batch file to run the updater, then to restart azureus
- // bceause the updater would restart azureus as administrator user
- // and confuse the user
- fileRestart = FileUtil.getUserFile("restart.bat");
- String s = "title Azureus Updater Runner\r\n";
- s += exeUpdater + " \"updateonly\"";
- for (int i = 1; i < parameters.length; i++) {
- s += " \"" + parameters[i].replaceAll("\\\"", "") + "\"";
- }
- s += "\r\n";
- s += "start \"\" \"" + azRunner + "\"";
- FileUtil.writeBytesAsFile(fileRestart.getAbsolutePath(), s.getBytes());
-
- result = accessor.shellExecute(null, fileRestart.getAbsolutePath(),
- null, SystemProperties.getApplicationPath(),
- AEWin32Access.SW_SHOWMINIMIZED);
- } else {
- String execEXE = "\"-J" + getClassPath().replaceAll("\\\"", "")
- + "\" ";
-
- for (int i = 0; i < properties.length; i++) {
- execEXE += "\"-J" + properties[i].replaceAll("\\\"", "") + "\" ";
- }
-
- for (int i = 0; i < parameters.length; i++) {
- execEXE += " \"" + parameters[i].replaceAll("\\\"", "") + "\"";
- }
-
- log.println("Launch via " + exeUpdater + " params " + execEXE);
- result = accessor.shellExecute(null, exeUpdater, execEXE,
- SystemProperties.getApplicationPath(), AEWin32Access.SW_NORMAL);
- }
- }
-
- /*
- * Some results:
- * 0: OOM
- * 2: FNF
- * 3: Path Not Foud
- * 5: Access Denied (User clicked cancel on admin access dialog)
- * 8: OOM
- * 11: Bad Format
- * 26: Sharing Violation
- * 27: Association incomplete
- * 28: DDE Timeout
- * 29: DDE Fail
- * 30: DDE Busy
- * 31: No Association
- * 32: DLL Not found
- * >32: OK!
- */
- log.println(" -> " + result);
-
- if (result <= 32) {
- String sErrorReason = "";
- String key = null;
-
- switch (result) {
- case 0:
- case 8:
- key = "oom";
- break;
-
- case 2:
- key = "fnf";
- break;
-
- case 3:
- key = "pnf";
- break;
-
- case 5:
- key = "denied";
- break;
-
- case 11:
- key = "bad";
- break;
-
- case -123:
- key = "nowin32";
- break;
-
- default:
- sErrorReason = "" + result;
- break;
- }
- if (key != null) {
- sErrorReason = MessageText.getString("restart.error." + key,
- new String[] {
- exeUpdater,
- SystemProperties.getApplicationPath(),
- });
- }
- Logger.log(new LogAlert(false, LogAlert.AT_ERROR,
- MessageText.getString("restart.error", new String[] {
- sErrorReason
- })));
- return false;
- }
- } catch (Throwable f) {
-
- f.printStackTrace(log);
-
- return javaSpawn(log, backupJavaRunString);
- }
-
return true;
}
@@ -454,9 +315,6 @@
restartAzureus_Unix(log,mainClass,properties,parameters);
- }else{
-
- restartAzureus_win32(log,mainClass,properties,parameters,update_only);
}
}
@@ -468,35 +326,7 @@
String[] parameters,
boolean update_only)
{
- String exeUpdater = getExeUpdater(log); // Not for Updater.java
-
- String exec;
-
- //Classic restart way using Runtime.exec directly on java(w)
- exec = "\"" + JAVA_EXEC_DIR + "javaw\" " + getClassPath() + getLibraryPath();
-
- for (int i = 0; i < properties.length; i++) {
- exec += properties[i] + " ";
- }
-
- exec += mainClass;
-
- for (int i = 0; i < parameters.length; i++) {
- exec += " \"" + parameters[i] + "\"";
- }
-
- if (exeUpdater != null) {
- restartViaEXE(log, exeUpdater, properties, parameters, exec, update_only);
- } else {
- if (log != null) {
- log.println(" " + exec);
- }
-
- if (!win32NativeRestart(log, exec)) {
- javaSpawn(log, exec);
- }
- }
- }
+ }
private boolean
@@ -529,20 +359,6 @@
String[] properties,
String[] parameters)
{
-
- String exec = "\"" + JAVA_EXEC_DIR + "java\" " + getClassPath() + getLibraryPath();
-
- for (int i=0;i<properties.length;i++){
- exec += properties[i] + " ";
- }
-
- exec += mainClass ;
-
- for(int i = 0 ; i < parameters.length ; i++) {
- exec += " \"" + parameters[i] + "\"";
- }
-
- runExternalCommandViaUnixShell( log, exec );
}
azureus-4.0.0.4-boo-windows.diff:
--- NEW FILE azureus-4.0.0.4-boo-windows.diff ---
diff -urN org/gudy/azureus2/platform.orig/macosx/access/cocoa/CocoaJavaBridge.java org/gudy/azureus2/platform/macosx/access/cocoa/CocoaJavaBridge.java
--- org/gudy/azureus2/platform.orig/macosx/access/cocoa/CocoaJavaBridge.java 2008-02-08 17:21:08.000000000 -0800
+++ org/gudy/azureus2/platform/macosx/access/cocoa/CocoaJavaBridge.java 1969-12-31 16:00:00.000000000 -0800
@@ -1,347 +0,0 @@
-package org.gudy.azureus2.platform.macosx.access.cocoa;
-
-/*
- * Created on 27-Mar-2005
- * Created by James Yeh
- * Copyright (C) 2004-2005 Aelitis, All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * AELITIS, SAS au capital de 46,603.30 euros
- * 8 Allee Lenotre, La Grille Royale, 78600 Le Mesnil le Roi, France.
- *
- */
-
-import com.apple.cocoa.foundation.NSAppleEventDescriptor;
-import com.apple.cocoa.foundation.NSAppleScript;
-import com.apple.cocoa.foundation.NSAutoreleasePool;
-import com.apple.cocoa.foundation.NSMutableDictionary;
-import org.gudy.azureus2.core3.logging.*;
-import org.gudy.azureus2.core3.util.AEMonitor;
-import org.gudy.azureus2.core3.util.AERunnable;
-import org.gudy.azureus2.core3.util.AEThread;
-import org.gudy.azureus2.core3.util.Debug;
-import org.gudy.azureus2.platform.macosx.NativeInvocationBridge;
-
-import java.io.File;
-import java.text.MessageFormat;
-
-/**
- * <p>Performs PlatformManager tasks using Cocoa-Java (FoundationKit only)</p>
- * <p>For now, operations are performed using NSAppleScript, rather than using NSWorkspace.
- * This is still significantly faster than calling the cmd-line osascript.</p>
- * @version 2.1 Apr 2, 2005
- */
-public final class CocoaJavaBridge extends NativeInvocationBridge
-{
- /**
- * The path the Cocoa-Java class files are located at
- */
- protected static final String CLASS_PATH = "/system/library/java";
-
- private static final String REVEAL_SCRIPT_FORMAT = "tell application \"System Events\"\ntell application \"{0}\"\nactivate\nreveal (posix file \"{1}\" as alias)\nend tell\nend tell";
-
- private static final String DEL_SCRIPT_FORMAT = "tell application \"Finder\" to move (posix file \"{0}\" as alias) to the trash";
-
- /**
- * Main NSAutoreleasePool
- */
- private int mainPool;
-
- protected AEMonitor classMon = new AEMonitor("CocoaJavaBridge:C");
- private AEMonitor scriptMon = new AEMonitor("CocoaJavaBridge:S");
-
- protected boolean isDisposed = false;
-
- protected RunnableDispatcher scriptDispatcher;
-
- public CocoaJavaBridge()
- {
- try
- {
- classMon.enter();
- mainPool = NSAutoreleasePool.push();
-
- scriptDispatcher = new RunnableDispatcher();
- }
- finally
- {
- classMon.exit();
- }
- }
-
- // interface implementation
-
- /**
- * {@inheritDoc}
- */
- protected boolean performRecoverableFileDelete(File path)
- {
- if(!path.exists())
- return false;
-
- NSAppleEventDescriptor result = executeScriptWithAsync(DEL_SCRIPT_FORMAT, new Object[]{path.getAbsolutePath()});
- return (result != null);
- }
-
- /**
- * {@inheritDoc}
- */
- protected boolean showInFinder(File path, String fileBrowserApp) {
- if (!path.exists())
- return false;
-
- NSAppleEventDescriptor result = null;
- int pool = NSAutoreleasePool.push();
- try {
- result = executeScriptWithAsync(REVEAL_SCRIPT_FORMAT, new Object[] {
- fileBrowserApp,
- path.getAbsolutePath()
- });
- } finally {
- NSAutoreleasePool.pop(pool);
- }
- return (result != null);
- }
-
- /**
- * {@inheritDoc}
- */
- protected boolean isEnabled()
- {
- // simple check with classpath
- return System.getProperty("java.class.path").toLowerCase().indexOf(CLASS_PATH) != -1;
- }
-
- // class utility methods
-
- /**
- * <p>Executes a new instance of NSAppleScript</p>
- * <p>The method is wrapped in an autorelease pool and an AEMonitor. If there are
- * no format parameters, MessageFormat is not used to parse the format string, and
- * the format string will be treated as the source itself.</p>
- * @see MessageFormat#format(String, Object...)
- * @see NSAppleScript#execute(com.apple.cocoa.foundation.NSMutableDictionary)
- */
- protected final NSAppleEventDescriptor executeScript(String scriptFormat, Object[] params)
- {
- try
- {
- scriptMon.enter();
-
- int pool = NSAutoreleasePool.push();
- long start = System.currentTimeMillis();
-
- String src;
- if(params == null || params.length == 0)
- {
- src = scriptFormat;
- }
- else
- {
- src = MessageFormat.format(scriptFormat, params);
- }
-
- Debug.outNoStack("Executing: \n" + src);
-
- NSAppleScript scp = new NSAppleScript(src);
- NSAppleEventDescriptor result = scp.execute(new NSMutableDictionary());
-
- Debug.outNoStack(MessageFormat.format("Elapsed time: {0}ms\n", new Object[]{new Long(System.currentTimeMillis() - start)}));
- NSAutoreleasePool.pop(pool);
- return result;
- }
- finally
- {
- scriptMon.exit();
- }
- }
-
- /**
- * <p>Executes a new instance of NSAppleScript in a forked AEThread</p>
- * <p>This method always returns a "true" event descriptor. Callbacks are currently unsupported
- * , so in the event of an error, the logger is autuomatically notified.</p>
- * <p>The thread's runSupport method is wrapped in an autorelease pool. If there are
- * no format parameters, MessageFormat is not used to parse the format string, and
- * the format string will be treated as the source itself.</p>
- * @see org.gudy.azureus2.core3.util.AEThread#runSupport()
- * @see MessageFormat#format(String, Object...)
- * @see NSAppleScript#execute(com.apple.cocoa.foundation.NSMutableDictionary)
- * @return NSAppleEventDescriptor.descriptorWithBoolean(true)
- */
- protected final NSAppleEventDescriptor executeScriptWithNewThread(final String scriptFormat, final Object[] params)
- {
- Thread worker = new AEThread("ScriptObject", true)
- {
- public void runSupport()
- {
- int pool = NSAutoreleasePool.push();
- long start = System.currentTimeMillis();
-
- String src;
- if(params == null || params.length == 0)
- {
- src = scriptFormat;
- }
[...7850 lines suppressed...]
- if ( target_version != null ){
-
- String target_download = sf_details.getDownloadURL();
-
- if ( current_az_is_cvs ){
-
- String sf_cvs_version = sf_details.getCVSVersion();
-
- if ( sf_cvs_version.length() > 0 ){
-
- target_download = sf_details.getCVSDownloadURL();
- }
- }
-
- ResourceDownloaderFactory rdf = ResourceDownloaderFactoryImpl.getSingleton();
-
- ResourceDownloader direct_rdl = rdf.create( new URL( target_download ));
-
- String torrent_download = Constants.AELITIS_TORRENTS;
-
- int slash_pos = target_download.lastIndexOf("/");
-
- if ( slash_pos == -1 ){
-
- torrent_download += target_download;
-
- }else{
-
- torrent_download += target_download.substring( slash_pos + 1 );
- }
-
- torrent_download += ".torrent";
-
- ResourceDownloader torrent_rdl = rdf.create( new URL( torrent_download ));
-
- torrent_rdl = rdf.getSuffixBasedDownloader( torrent_rdl );
-
- // create an alternate downloader with torrent attempt first
-
- ResourceDownloader alternate_rdl = rdf.getAlternateDownloader( new ResourceDownloader[]{ torrent_rdl, direct_rdl });
-
- // get size here so it is cached
-
- rdf.getTimeoutDownloader(rdf.getRetryDownloader(alternate_rdl,RD_SIZE_RETRIES),RD_SIZE_TIMEOUT).getSize();
-
-
- List update_desc = new ArrayList();
-
- List desc_lines = HTMLUtils.convertHTMLToText( "", sf_details.getDescription());
-
- update_desc.addAll( desc_lines );
-
- List comment_lines = HTMLUtils.convertHTMLToText( " ", sf_details.getComment());
-
- update_desc.addAll( comment_lines );
-
- String[] update_d = new String[update_desc.size()];
-
- update_desc.toArray( update_d );
-
- final Update update =
- checker.addUpdate(
- UPDATE_NAME,
- update_d,
- target_version,
- alternate_rdl,
- Update.RESTART_REQUIRED_YES );
-
- update.setDescriptionURL(sf_details.getInfoURL());
-
- alternate_rdl.addListener(
- new ResourceDownloaderAdapter()
- {
- public boolean
- completed(
- final ResourceDownloader downloader,
- InputStream data )
- {
- installUpdate( checker, update, downloader, data );
-
- return( true );
- }
- });
- }
- }catch( Throwable e ){
-
- Debug.printStackTrace( e );
-
- checker.reportProgress( "Failed to load plugin details for the platform manager: " + Debug.getNestedExceptionMessage(e));
-
- checker.failed();
-
- }finally{
-
- checker.completed();
- }
- }
-
- protected void
- installUpdate(
- UpdateChecker checker,
- Update update,
- ResourceDownloader rd,
- InputStream data )
- {
- ZipInputStream zip = null;
-
- try {
- data = update.verifyData( data, true );
-
- rd.reportActivity( "Data verified successfully" );
-
- UpdateInstaller installer = checker.createInstaller();
-
- zip = new ZipInputStream(data);
-
- ZipEntry entry = null;
-
- while ((entry = zip.getNextEntry()) != null) {
-
- String name = entry.getName();
-
- if (name.toLowerCase().startsWith("windows/")) {
-
- // win32 only files
-
- name = name.substring(8);
-
- // skip the directory entry
-
- if (name.length() > 0) {
-
- rd.reportActivity("Adding update action for '" + name + "'");
-
- if (Logger.isEnabled())
- Logger.log(new LogEvent(LOGID,
- "PlatformManager:Win32 adding action for '" + name + "'"));
-
- installer.addResource(name, zip, false);
-
- installer.addMoveAction(name, installer.getInstallDir()
- + File.separator + name);
- }
- }
- }
- } catch (Throwable e) {
-
- rd.reportActivity("Update install failed:" + e.getMessage());
- }finally{
-
- if ( zip != null ){
-
- try{
- zip.close();
-
- }catch( Throwable e ){
- }
- }
- }
- }
-
- protected List
- splitMultiLine(
- String indent,
- String text )
- {
- int pos = 0;
-
- String lc_text = text.toLowerCase();
-
- List lines = new ArrayList();
-
- while( true ){
-
- String line;
-
- int p1 = lc_text.indexOf( "<br>", pos );
-
- if ( p1 == -1 ){
-
- line = text.substring(pos);
-
- }else{
-
- line = text.substring(pos,p1);
-
- pos = p1+4;
- }
-
- lines.add( indent + line );
-
- if ( p1 == -1 ){
-
- break;
- }
- }
-
- return( lines );
- }
-}
azureus-4.0.0.4-oops-return.diff:
--- NEW FILE azureus-4.0.0.4-oops-return.diff ---
--- com/aelitis/azureus/core/update/impl/AzureusRestarterImpl.java.orig 2008-12-20 00:45:25.000000000 -0800
+++ com/aelitis/azureus/core/update/impl/AzureusRestarterImpl.java 2008-12-20 00:45:42.000000000 -0800
@@ -217,10 +217,11 @@
private boolean
win32NativeRestart(
PrintWriter log,
String exec )
{
+ return true;
}
private String getExeUpdater(PrintWriter log) {
try {
azureus-4.0.0.4-screw-w32-tests.diff:
--- NEW FILE azureus-4.0.0.4-screw-w32-tests.diff ---
--- org/gudy/azureus2/ui/swt/test/Win32TransferTypes.java.orig 2003-12-12 07:56:48.000000000 -0800
+++ org/gudy/azureus2/ui/swt/test/Win32TransferTypes.java 2008-12-20 00:06:42.000000000 -0800
@@ -1,11 +1,11 @@
package org.gudy.azureus2.ui.swt.test;
import org.eclipse.swt.*;
import org.eclipse.swt.dnd.*;
-import org.eclipse.swt.internal.ole.win32.*;
-import org.eclipse.swt.internal.win32.*;
+//import org.eclipse.swt.internal.ole.win32.*;
+//import org.eclipse.swt.internal.win32.*;
import org.eclipse.swt.layout.*;
import org.eclipse.swt.widgets.*;
/**
* Application to identify supported URL drag and drop IDs from different browsers on Windows.
@@ -18,147 +18,55 @@
private static Win32TransferTypes _instance = new Win32TransferTypes();
private int[] ids;
private String[] names;
public static void main(String[] args) {
- Display display = new Display();
- Shell shell = new Shell(display);
- shell.setLayout(new FillLayout());
- Canvas canvas = new Canvas(shell, SWT.NONE);
- DropTarget target = new DropTarget(canvas, DND.DROP_DEFAULT | DND.DROP_COPY | DND.DROP_LINK | DND.DROP_MOVE | DND.DROP_TARGET_MOVE | DND.DROP_NONE);
- target.setTransfer(new Transfer[] { Win32TransferTypes.getInstance(), TextTransfer.getInstance(), FileTransfer.getInstance()});
- target.addDropListener(new DropTargetAdapter() {
- public void dragEnter(DropTargetEvent event) {
+// Display display = new Display();
+// Shell shell = new Shell(display);
+// shell.setLayout(new FillLayout());
+// Canvas canvas = new Canvas(shell, SWT.NONE);
+// DropTarget target = new DropTarget(canvas, DND.DROP_DEFAULT | DND.DROP_COPY | DND.DROP_LINK | DND.DROP_MOVE | DND.DROP_TARGET_MOVE | DND.DROP_NONE);
+// target.setTransfer(new Transfer[] { Win32TransferTypes.getInstance(), TextTransfer.getInstance(), FileTransfer.getInstance()});
+// target.addDropListener(new DropTargetAdapter() {
+// public void dragEnter(DropTargetEvent event) {
// if(event.detail == DND.DROP_NONE)
- event.detail = DND.DROP_LINK;
- String ops = "";
- if ((event.operations & DND.DROP_COPY) != 0)
- ops += "Copy;";
- if ((event.operations & DND.DROP_MOVE) != 0)
- ops += "Move;";
- if ((event.operations & DND.DROP_LINK) != 0)
- ops += "Link;";
- System.out.println("Allowed Operations are " + ops);
-
- TransferData[] data = event.dataTypes;
- for (int i = 0; i < data.length; i++) {
- int id = data[i].type;
- String name = getNameFromId(id);
- System.out.println("Data type is " + id + " " + name);
- }
- }
- public void dragOver(DropTargetEvent event) {
- event.detail = DND.DROP_LINK;
- }
- public void drop(DropTargetEvent event) {
- System.out.println("URL dropped: " + event.data);
- System.out.println("Data type is " + event.currentDataType.type + " " + getNameFromId(event.currentDataType.type));
- }
- });
-
- shell.setSize(400, 400);
- shell.open();
- while (!shell.isDisposed()) {
- if (!display.readAndDispatch())
- display.sleep();
- }
- display.dispose();
- }
-
- public static Win32TransferTypes getInstance() {
- return _instance;
- }
- Win32TransferTypes() {
- ids = new int[50000];
- names = new String[50000];
- for (int i = 0; i < ids.length; i++) {
- ids[i] = i;
- names[i] = getNameFromId(i);
- }
- }
- public void javaToNative(Object object, TransferData transferData) {}
- public Object nativeToJava(TransferData transferData) {
- byte[] buffer = (byte[]) super.nativeToJava(transferData);
- if (buffer == null)
- return null;
- int size = buffer.length;
- byte[] text = new byte[size];
- int j = 0;
- for (int i = 0; i < buffer.length; i++) {
- if (buffer[i] != 0)
- text[j++] = buffer[i];
- }
- String data = new String(text, 0, j);
- int end = data.indexOf("\n");
- return end >= 0 ? data.substring(0, end) : data;
+// event.detail = DND.DROP_LINK;
+// String ops = "";
+// if ((event.operations & DND.DROP_COPY) != 0)
+// ops += "Copy;";
+// if ((event.operations & DND.DROP_MOVE) != 0)
+// ops += "Move;";
+// if ((event.operations & DND.DROP_LINK) != 0)
+// ops += "Link;";
+// System.out.println("Allowed Operations are " + ops);
+
+// TransferData[] data = event.dataTypes;
+// for (int i = 0; i < data.length; i++) {
+// int id = data[i].type;
+// String name = getNameFromId(id);
+// System.out.println("Data type is " + id + " " + name);
+// }
+// }
+// public void dragOver(DropTargetEvent event) {
+// event.detail = DND.DROP_LINK;
+// }
+// public void drop(DropTargetEvent event) {
+// System.out.println("URL dropped: " + event.data);
+// System.out.println("Data type is " + event.currentDataType.type + " " + getNameFromId(event.currentDataType.type));
+// }
+// });
+
+// shell.setSize(400, 400);
+// shell.open();
+// while (!shell.isDisposed()) {
+// if (!display.readAndDispatch())
+// display.sleep();
+// }
+// display.dispose();
}
protected String[] getTypeNames() {
- return names;
+ return new String[1];
}
protected int[] getTypeIds() {
- return ids;
- }
- static String getNameFromId(int id) {
- String name = null;
- int maxSize = 128;
- TCHAR buffer = new TCHAR(0, maxSize);
- int size = COM.GetClipboardFormatName(id, buffer, maxSize);
- if (size != 0) {
- name = buffer.toString(0, size);
- } else {
- switch (id) {
- case COM.CF_HDROP :
- name = "CF_HDROP";
- break;
- case COM.CF_TEXT :
- name = "CF_TEXT";
- break;
- case COM.CF_BITMAP :
- name = "CF_BITMAP";
- break;
- case COM.CF_METAFILEPICT :
- name = "CF_METAFILEPICT";
- break;
- case COM.CF_SYLK :
- name = "CF_SYLK";
- break;
- case COM.CF_DIF :
- name = "CF_DIF";
- break;
- case COM.CF_TIFF :
- name = "CF_TIFF";
- break;
- case COM.CF_OEMTEXT :
- name = "CF_OEMTEXT";
- break;
- case COM.CF_DIB :
- name = "CF_DIB";
- break;
- case COM.CF_PALETTE :
- name = "CF_PALETTE";
- break;
- case COM.CF_PENDATA :
- name = "CF_PENDATA";
- break;
- case COM.CF_RIFF :
- name = "CF_RIFF";
- break;
- case COM.CF_WAVE :
- name = "CF_WAVE";
- break;
- case COM.CF_UNICODETEXT :
- name = "CF_UNICODETEXT";
- break;
- case COM.CF_ENHMETAFILE :
- name = "CF_ENHMETAFILE";
- break;
- case COM.CF_LOCALE :
- name = "CF_LOCALE";
- break;
- case COM.CF_MAX :
- name = "CF_MAX";
- break;
- }
- }
- return name;
+ return new int[1];
}
-}
\ No newline at end of file
+}
azureus-4.0.0.4-screw-win32utils.diff:
--- NEW FILE azureus-4.0.0.4-screw-win32utils.diff ---
--- com/aelitis/azureus/util/win32/Win32Utils.java.orig 2007-02-14 11:57:30.000000000 -0800
+++ com/aelitis/azureus/util/win32/Win32Utils.java 2008-12-20 00:13:03.000000000 -0800
@@ -18,12 +18,12 @@
*
*/
package com.aelitis.azureus.util.win32;
-import org.gudy.azureus2.platform.win32.access.AEWin32Access;
-import org.gudy.azureus2.platform.win32.access.AEWin32Manager;
+//import org.gudy.azureus2.platform.win32.access.AEWin32Access;
+//import org.gudy.azureus2.platform.win32.access.AEWin32Manager;
/**
* @author TuxPaper
* @created Feb 13, 2007
*
@@ -33,17 +33,17 @@
/**
* Get the location of Windows Media Player executable
* @return
*/
public static String getWMP() {
- AEWin32Access accessor = AEWin32Manager.getAccessor(true);
- if (accessor == null) {
- return null;
- }
- try {
- return accessor.readStringValue(AEWin32Access.HKEY_LOCAL_MACHINE,
- "SOFTWARE\\Microsoft\\Multimedia\\WMPlayer", "Player.Path");
- } catch (Exception e) {
- }
+// AEWin32Access accessor = AEWin32Manager.getAccessor(true);
+// if (accessor == null) {
+// return null;
+// }
+// try {
+// return accessor.readStringValue(AEWin32Access.HKEY_LOCAL_MACHINE,
+// "SOFTWARE\\Microsoft\\Multimedia\\WMPlayer", "Player.Path");
+// } catch (Exception e) {
+// }
return null;
}
}
azureus-4.0.0.4-silly-java-tricks-are-for-kids.diff:
--- NEW FILE azureus-4.0.0.4-silly-java-tricks-are-for-kids.diff ---
--- org/gudy/azureus2/platform/PlatformManagerFactory.java.orig 2008-12-20 00:48:53.000000000 -0800
+++ org/gudy/azureus2/platform/PlatformManagerFactory.java 2008-12-20 00:49:18.000000000 -0800
@@ -50,14 +50,10 @@
if( getPlatformType() == PlatformManager.PT_UNIX ){
platform_manager = org.gudy.azureus2.platform.unix.PlatformManagerImpl.getSingleton();
}
- }catch( PlatformManagerException e ){
-
- // exception will already have been logged
-
}catch( Throwable e ){
Debug.printStackTrace(e);
}
}
azureus-4.0.0.4-stupid-invalid-characters.diff:
--- NEW FILE azureus-4.0.0.4-stupid-invalid-characters.diff ---
--- Vuze-4.0.0.4/com/aelitis/azureus/core/metasearch/impl/DateParserRegex.java.orig 2009-02-26 11:22:55.000000000 -0800
+++ Vuze-4.0.0.4/com/aelitis/azureus/core/metasearch/impl/DateParserRegex.java 2009-02-26 11:52:24.000000000 -0800
@@ -50,17 +50,17 @@
private static final String[] MONTHS_LIST = new String[] {
" january janvier enero januar",
- " february fevrier fvrier febrero februar",
- " march mars marzo marz marz mrz" ,
+ " february fevrier febrero februar",
+ " march mars marzo marz marz" ,
" april avril abril april ",
" may mai mayo mai",
" june juin junio juni",
" july juillet julio juli",
- " august aout aot agosto august",
+ " august aout agosto august",
" september septembre septiembre september",
" october octobre octubre oktober",
" november novembre noviembre november",
- " december decembre dcembre diciembre dezember"};
+ " december decembre diciembre dezember"};
public DateParserRegex() {
this("GMT-7",true,null);
Index: .cvsignore
===================================================================
RCS file: /cvs/pkgs/rpms/azureus/devel/.cvsignore,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- .cvsignore 30 Jan 2008 20:19:17 -0000 1.14
+++ .cvsignore 26 Feb 2009 20:20:32 -0000 1.15
@@ -1,3 +1 @@
-azureus-3.0.4.2.tar.gz
-bdcc_2.2.2.zip
-azplugins_2.1.6.jar
+Vuze_4.0.0.4_source.zip
Index: azureus.spec
===================================================================
RCS file: /cvs/pkgs/rpms/azureus/devel/azureus.spec,v
retrieving revision 1.70
retrieving revision 1.71
diff -u -r1.70 -r1.71
--- azureus.spec 24 Feb 2009 03:49:58 -0000 1.70
+++ azureus.spec 26 Feb 2009 20:20:32 -0000 1.71
@@ -1,30 +1,33 @@
+%define _newname Vuze
+#%%define with_gcj %{!?_without_gcj:1}%{?_without_gcj:0}
+
+# aot-compile-rpm seems broken:
+%define with_gcj 0
+
Name: azureus
-Version: 3.0.4.2
-Release: 18%{?dist}
+Version: 4.0.0.4
+Release: 1%{?dist}
Summary: A BitTorrent Client
-
Group: Applications/Internet
License: GPLv2+
URL: http://azureus.sourceforge.net
-# A cvs snapshot with the build and bouncycastle directories
-# removed.
-Source0: azureus-3.0.4.2.tar.gz
+Source0: http://downloads.sourceforge.net/azureus/%{_newname}_%{version}_source.zip
Source1: azureus.script
Source2: Azureus.desktop
Source3: azureus.applications
-Source4: azureus-License.txt
+#Source4: azureus-License.txt
-Source5: azplugins_2.1.6.jar
-Source6: bdcc_2.2.2.zip
+#Source5: azplugins_2.1.6.jar
+#Source6: bdcc_2.2.2.zip
Patch0: azureus-remove-win32-osx-platforms.patch
Patch2: azureus-cache-size.patch
Patch3: azureus-remove-manifest-classpath.patch
Patch9: azureus-no-shared-plugins.patch
Patch12: azureus-no-updates-PluginInitializer.patch
-Patch13: azureus-no-updates-PluginInterfaceImpl.patch
+#Patch13: azureus-no-updates-PluginInterfaceImpl.patch
Patch14: azureus-no-update-manager-AzureusCoreImpl.patch
Patch15: azureus-no-update-manager-CorePatchChecker.patch
Patch16: azureus-no-update-manager-CoreUpdateChecker.patch
@@ -37,6 +40,15 @@
Patch28: azureus-configuration.patch
Patch31: azureus-fix-menu-MainMenu.patch
+Patch50: azureus-4.0.0.4-boo-windows.diff
+Patch51: azureus-4.0.0.4-boo-osx.diff
+Patch52: azureus-4.0.0.4-screw-w32-tests.diff
+Patch53: azureus-4.0.0.4-boo-updating-w32.diff
+Patch54: azureus-4.0.0.4-screw-win32utils.diff
+Patch55: azureus-4.0.0.4-oops-return.diff
+Patch56: azureus-4.0.0.4-silly-java-tricks-are-for-kids.diff
+Patch57: azureus-4.0.0.4-stupid-invalid-characters.diff
+
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: ant, jpackage-utils >= 1.5, xml-commons-apis
@@ -44,97 +56,125 @@
BuildRequires: libgconf-java
BuildRequires: bouncycastle >= 1.33-3
BuildRequires: eclipse-swt >= 3.4.0
+BuildRequires: junit
Requires: jakarta-commons-cli, log4j
Requires: xulrunner
Requires: eclipse-swt >= 3.4.0
Requires: libgconf-java
Requires: bouncycastle >= 1.33-3
-Requires: libgcj >= 4.1.0-0.15
-BuildRequires: java-1.5.0-gcj-devel
-BuildRequires: java-1.6.0-openjdk-devel
-Requires: java-1.6.0-openjdk
-Requires(post): java-gcj-compat >= 1.0.31
-Requires(postun): java-gcj-compat >= 1.0.31
+Requires: java >= 1.5.0
+BuildRequires: java-devel >= 1.5.0
BuildRequires: desktop-file-utils
Requires(post): desktop-file-utils
Requires(postun): desktop-file-utils
+%if %{with_gcj}
+BuildRequires: java-gcj-compat-devel >= 1.0.31
+Requires(post): java-gcj-compat >= 1.0.31
+Requires(postun): java-gcj-compat >= 1.0.31
+%else
+BuildArch: noarch
+%endif
+
+
%description
-Azureus implements the BitTorrent protocol using java language and
-comes bundled with many invaluable features for both beginners and
+Azureus (now %{_newname}) implements the BitTorrent protocol using java
+and comes bundled with many invaluable features for both beginners and
advanced users.
%prep
-%setup -q -n %{name}
-%patch0 -p0
+%setup -q -c
+#%patch0 -p0
%patch2 -p0
%patch3 -p0
%patch9 -p0
-%patch12 -p0
-%patch13 -p0
+#%patch12 -p0
+#%patch13 -p0
%patch14 -p0
%patch15 -p0
-%patch16 -p0
-%patch18 -p0
-%patch19 -p0
-%patch20 -p0
-%patch22 -p0
-%patch23 -p0
+#%patch16 -p0
+#%patch18 -p0
+#%patch19 -p0
+#%patch20 -p0
+#%patch22 -p0
+#%patch23 -p0
%patch27 -p0
%patch28 -p0
-%patch31 -p0
-cp %{SOURCE4} License.txt
+#%patch31 -p0
+#rm com/aelitis/azureus/core/update -rf
+#find ./ -name osx | xargs rm -r
+#find ./ -name macosx | xargs rm -r
+#find ./ -name win32 | xargs rm -r
+#find ./ -name Win32\* | xargs rm -r
+# Remove test code
+%patch50 -b .orig
+%patch51 -b .orig
+%patch52 -b .orig
+%patch53 -b .orig
+%patch54 -b .orig
+%patch55 -b .orig
+%patch56 -b .orig
+%patch57 -b .orig -p1
+rm org/gudy/azureus2/ui/swt/test/PrintTransferTypes.java
+sed -i -e \
+ "s|sun.security.action.GetPropertyAction|gnu.java.security.action.GetPropertyAction|" \
+ org/gudy/azureus2/core3/internat/MessageText.java
+
+# if upstream doesn't include it, no need for us to ship it.
+#cp %{SOURCE4} License.txt
+
+# Convert line endings...
+#sed -i 's/\r//' License.txt
+sed -i 's/\r//' ChangeLog.txt
+chmod 644 *.txt
+
%build
mkdir -p build/libs
-build-jar-repository -p build/libs bcprov jakarta-commons-cli log4j gtk2.8 glib0.2
+build-jar-repository -p build/libs bcprov jakarta-commons-cli log4j \
+ gtk2.8 glib0.2 junit
ln -s %{_libdir}/eclipse/swt.jar build/libs
-find ./ -name osx | xargs rm -r
-find ./ -name macosx | xargs rm -r
-find ./ -name win32 | xargs rm -r
-find ./ -name Win32\* | xargs rm -r
-# Remove test code
-rm org/gudy/azureus2/ui/swt/test/PrintTransferTypes.java
ant jar
-mkdir -p plugins/azplugins
-pushd plugins
-pushd azplugins
-unzip -q %{SOURCE5}
-rm -f *.jar `find ./ -name \*class`
-find ./ -name \*java | xargs javac -cp %{_libdir}/eclipse/swt.jar:../..:.
-find ./ -name \*java | xargs rm
-jar cvf azplugins_2.1.6.jar .
-popd
-popd
-
-unzip -q %{SOURCE6}
-pushd plugins
-pushd bdcc
-unzip *.jar
-rm -f *.jar `find ./ -name \*class`
-find ./ -name \*java | xargs javac -cp %{_libdir}/eclipse/swt.jar:../..:.
-find ./ -name \*java | xargs rm
-jar cvf bdcc_2.2.2.jar .
-popd
-popd
+#mkdir -p plugins/azplugins
+#pushd plugins
+#pushd azplugins
+#unzip -q %{SOURCE5}
+#rm -f *.jar `find ./ -name \*class`
+#find ./ -name \*java | xargs javac -cp %{_libdir}/eclipse/swt.jar:../..:.
+#find ./ -name \*java | xargs rm
+#jar cvf azplugins_2.1.6.jar .
+#popd
+#popd
+
+#unzip -q %{SOURCE6}
+#pushd plugins
+#pushd bdcc
+#unzip *.jar
+#rm -f *.jar `find ./ -name \*class`
+#find ./ -name \*java | xargs javac -cp %{_libdir}/eclipse/swt.jar:../..:.
+#find ./ -name \*java | xargs rm
+#jar cvf bdcc_2.2.2.jar .
+#popd
+#popd
%install
rm -rf $RPM_BUILD_ROOT
install -dm 755 $RPM_BUILD_ROOT%{_datadir}/azureus/plugins
install -pm 644 dist/Azureus2.jar $RPM_BUILD_ROOT%{_datadir}/azureus/Azureus2.jar
+# TODO: fix launcher to be multilib-safe
install -p -D -m 0755 %{SOURCE1} $RPM_BUILD_ROOT%{_bindir}/azureus
sed --in-place "s:/usr/lib:%{_libdir}:g" $RPM_BUILD_ROOT%{_bindir}/azureus
-install -dm 755 $RPM_BUILD_ROOT%{_datadir}/azureus/plugins/azplugins
-install -pm 644 plugins/azplugins/azplugins_2.1.6.jar $RPM_BUILD_ROOT%{_datadir}/azureus/plugins/azplugins/azplugins_2.1.6.jar
-install -pm 644 plugins/azplugins/plugin.properties $RPM_BUILD_ROOT%{_datadir}/azureus/plugins/azplugins/plugin.properties
-
-install -dm 755 $RPM_BUILD_ROOT%{_datadir}/azureus/plugins/bdcc
-install -pm 644 plugins/bdcc/bdcc_2.2.2.jar $RPM_BUILD_ROOT%{_datadir}/azureus/plugins/bdcc/bdcc_2.2.2.jar
-install -pm 644 plugins/bdcc/plugin.properties $RPM_BUILD_ROOT%{_datadir}/azureus/plugins/bdcc/plugin.properties
+#install -dm 755 $RPM_BUILD_ROOT%{_datadir}/azureus/plugins/azplugins
+#install -pm 644 plugins/azplugins/azplugins_2.1.6.jar $RPM_BUILD_ROOT%{_datadir}/azureus/plugins/azplugins/azplugins_2.1.6.jar
+#install -pm 644 plugins/azplugins/plugin.properties $RPM_BUILD_ROOT%{_datadir}/azureus/plugins/azplugins/plugin.properties
+
+#install -dm 755 $RPM_BUILD_ROOT%{_datadir}/azureus/plugins/bdcc
+#install -pm 644 plugins/bdcc/bdcc_2.2.2.jar $RPM_BUILD_ROOT%{_datadir}/azureus/plugins/bdcc/bdcc_2.2.2.jar
+#install -pm 644 plugins/bdcc/plugin.properties $RPM_BUILD_ROOT%{_datadir}/azureus/plugins/bdcc/plugin.properties
mkdir -p $RPM_BUILD_ROOT%{_datadir}/pixmaps
mkdir -p $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/16x16/apps
@@ -154,19 +194,22 @@
mkdir -p $RPM_BUILD_ROOT%{_datadir}/application-registry
install -m644 %{SOURCE3} $RPM_BUILD_ROOT%{_datadir}/application-registry
-# Convert line endings...
-%{__sed} -i 's/\r//' License.txt
-%{__sed} -i 's/\r//' ChangeLog.txt
-chmod 644 *.txt
+%if %{with_gcj}
+%{_bindir}/aot-compile-rpm
+%endif
-#RPM_OPT_FLAGS="-O0" aot-compile-rpm
-aot-compile-rpm
%clean
rm -rf $RPM_BUILD_ROOT
%post
+%if %{with_gcj}
+if [ -x %{_bindir}/rebuild-gcj-db ]
+then
%{_bindir}/rebuild-gcj-db
+fi
+%endif
+
update-desktop-database %{_datadir}/applications
# update icon themes
touch %{_datadir}/icons/hicolor
@@ -175,7 +218,13 @@
fi
%postun
+%if %{with_gcj}
+if [ -x %{_bindir}/rebuild-gcj-db ]
+then
%{_bindir}/rebuild-gcj-db
+fi
+%endif
+
update-desktop-database %{_datadir}/applications
# update icon themes
touch %{_datadir}/icons/hicolor
@@ -185,7 +234,7 @@
%files
%defattr(-,root,root)
-%doc License.txt ChangeLog.txt
+%doc ChangeLog.txt GPL.txt
%{_datadir}/applications/*
%{_datadir}/application-registry/*
%{_datadir}/pixmaps/azureus.png
@@ -194,9 +243,15 @@
%{_datadir}/icons/hicolor/64x64/apps/azureus.png
%{_bindir}/azureus
%{_datadir}/azureus
-%{_libdir}/gcj/*
+%if %{with_gcj}
+%attr(-,root,root) %{_libdir}/gcj/%{name}
+%endif
%changelog
+* Sat Dec 20 2008 Conrad Meyer <konrad at tylerc.org> - 4.0.0.4-1
+- New version, new breakage. Patches 50-56 added.
+- Dropped a lot of patches that don't apply to the new azureus.
+
* Mon Feb 23 2009 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 3.0.4.2-18
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
Index: sources
===================================================================
RCS file: /cvs/pkgs/rpms/azureus/devel/sources,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- sources 30 Jan 2008 20:19:17 -0000 1.14
+++ sources 26 Feb 2009 20:20:32 -0000 1.15
@@ -1,3 +1 @@
-a03545b9cf89b6cb872c66f684be3fae azureus-3.0.4.2.tar.gz
-0e88c3952b36ba221e277420a7080b43 bdcc_2.2.2.zip
-cde45afef52a6a6f85e30de9fec30531 azplugins_2.1.6.jar
+3f521ec1f74d5b1a78921db4174858a6 Vuze_4.0.0.4_source.zip
--- azureus-License.txt DELETED ---
More information about the fedora-extras-commits
mailing list