Merge commit 'refs/merge-requests/16' of git://gitorious.org/sparkleshare/sparkleshare into autofoo

This commit is contained in:
Hylke Bons 2010-06-18 23:15:39 +01:00
commit 2579e39a9b
81 changed files with 1442 additions and 1426 deletions

29
.gitignore vendored
View file

@ -3,7 +3,36 @@
*.exe.mdb
*.userprefs
*.pidb
*.gmo
/SparkleShare/bin
/SparkleShare/obj
/notify-sharp/bin
/notify-sharp/obj
po/POTFILES
Makefile.in
Makefile
POTFILES
intltool-*
configure
config.guess
config.h
config.h.in
config.log
config.status
config.sub
INSTALL
aclocal.m4
autom4te.cache/
bin/
install-sh
libtool
ltmain.sh
missing
po/.intltool-merge-cache
po/Makefile.in.in
po/stamp-it
SparkleShare/AssemblyInfo.cs
build/m4/shave/shave
build/m4/*.m4
build/m4/shave/shave-libtool
Defines.cs

View file

@ -1,29 +0,0 @@
SparkleShare.exe : SparkleShare.sln
mdtool build --f --buildfile:SparkleShare.sln
install:
mkdir -p /usr/local/share/sparkleshare
cp SparkleShare/bin/Debug/SparkleShare.exe /usr/local/share/sparkleshare/
cp SparkleShare/bin/Debug/SparkleShare.exe.mdb /usr/local/share/sparkleshare/
cp SparkleShare/bin/Debug/notify-sharp.dll /usr/local/share/sparkleshare/
cp SparkleShare/bin/Debug/notify-sharp.dll.mdb /usr/local/share/sparkleshare/
chmod 755 /usr/local/share/sparkleshare/SparkleShare.exe
cp sparkleshare /usr/local/bin/
chmod 755 /usr/local/bin/sparkleshare
cp data/icons /usr/share/ -R
gtk-update-icon-cache /usr/share/icons/hicolor -f
uninstall:
rm /usr/local/bin/sparkleshare
rm -rf /usr/local/share/sparkleshare
rm /usr/share/icons/hicolor/*x*/places/folder-sparkleshare.png
rm /usr/share/icons/hicolor/*x*/places/folder-sync*.png
rm /usr/share/icons/hicolor/*x*/status/document-*ed.png
rm /usr/share/icons/hicolor/*x*/status/avatar-default.png
rm /usr/share/icons/hicolor/*x*/emblems/emblem-sync*.png
rm /usr/share/icons/hicolor/*x*/animations/process-working.png
rm ~/.config/autostart/sparkleshare.desktop
clean:
rm -rf SparkleShare/bin
rm -rf notify-sharp/bin

12
Makefile.am Normal file
View file

@ -0,0 +1,12 @@
SUBDIRS = \
build \
notify-sharp \
SparkleShare \
data \
po
DISTCLEANFILES = \
intltool-extract \
intltool-merge \
intltool-update

View file

@ -1,45 +0,0 @@
// SparkleShare, an instant update workflow to Git.
// Copyright (C) 2010 Hylke Bons <hylkebons@gmail.com>
//
// 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 3 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, see <http://www.gnu.org/licenses/>.
using Gtk;
using Notifications;
using SparkleShare;
namespace SparkleShare {
public class SparkleBubble : Notification {
public SparkleBubble (string Title, string Subtext) : base (Title, Subtext) {
Timeout = 4500;
Urgency = Urgency.Low;
IconName = "folder-sparkleshare";
AttachToStatusIcon (SparkleUI.NotificationIcon);
}
// Checks whether the system allows adding buttons to a notification,
// prevents error messages in e.g. Ubuntu.
new public void AddAction (string Action, string Label, ActionHandler Handler)
{
bool CanHaveButtons = (System.Array.IndexOf (Notifications.Global.Capabilities, "actions") > -1);
if (CanHaveButtons)
base.AddAction(Action, Label, Handler);
}
}
}

View file

@ -1,218 +0,0 @@
// SparkleShare, an instant update workflow to Git.
// Copyright (C) 2010 Hylke Bons <hylkebons@gmail.com>
//
// 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 3 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, see <http://www.gnu.org/licenses/>.
using Gtk;
using Mono.Unix;
using SparkleShare;
using System;
using System.Diagnostics;
using System.IO;
namespace SparkleShare {
// A dialog where the user can enter a folder
// name and url to sync changes with
public class SparkleDialog : Window {
// Short alias for the translations
public static string _ (string s)
{
return Catalog.GetString (s);
}
private Button AddButton;
private ComboBoxEntry RemoteUrlCombo;
public SparkleDialog (string Url) : base ("")
{
BorderWidth = 12;
IconName = "folder-sparkleshare";
WidthRequest = 320;
Title = "SparkleShare";
SetPosition (WindowPosition.Center);
VBox VBox = new VBox (false, 0);
Label RemoteUrlLabel = new Label (_("Address of remote SparkleShare folder:"));
RemoteUrlLabel.Xalign = 0;
ListStore Defaults = new ListStore (typeof (string));
RemoteUrlCombo = new ComboBoxEntry (Defaults, 0);
if (Url.Equals (""))
RemoteUrlCombo.Entry.Text = "ssh://";
else
RemoteUrlCombo.Entry.Text = Url;
RemoteUrlCombo.Entry.Completion = new EntryCompletion ();
RemoteUrlCombo.Entry.Completion.Model = Defaults;
RemoteUrlCombo.Entry.Completion.InlineCompletion = true;
RemoteUrlCombo.Entry.Completion.PopupCompletion = true;
RemoteUrlCombo.Entry.Completion.TextColumn = 0;
RemoteUrlCombo.Entry.Changed += CheckFields;
// Add some preset addresses
Defaults.AppendValues ("ssh://git@github.com/");
Defaults.AppendValues ("ssh://git@git.gnome.org/");
Defaults.AppendValues ("ssh://git@fedorahosted.org/");
Defaults.AppendValues ("ssh://git@gitorious.org/");
HButtonBox ButtonBox = new HButtonBox ();
ButtonBox.Layout = ButtonBoxStyle.End;
ButtonBox.Spacing = 6;
ButtonBox.BorderWidth = 0;
AddButton = new Button (_("Add Folder"));
AddButton.Clicked += CloneRepo;
AddButton.Sensitive = false;
Button CancelButton = new Button (Stock.Cancel);
CancelButton.Clicked += delegate {
Destroy ();
};
ButtonBox.Add (CancelButton);
ButtonBox.Add (AddButton);
VBox.PackStart (RemoteUrlLabel, false, false, 0);
VBox.PackStart (RemoteUrlCombo, false, false, 12);
VBox.PackStart (ButtonBox, false, false, 0);
Add (VBox);
ShowAll ();
}
// Clones a remote repo
public void CloneRepo (object o, EventArgs args) {
// SparkleUI.NotificationIcon.SetSyncingState ();
HideAll ();
string RepoRemoteUrl = RemoteUrlCombo.Entry.Text;
int SlashPos = RepoRemoteUrl.LastIndexOf ("/");
int ColumnPos = RepoRemoteUrl.LastIndexOf (":");
// Check whether a "/" or ":" is used to separate the
// repo name from the domain.
string RepoName;
if (SlashPos > ColumnPos)
RepoName = RepoRemoteUrl.Substring (SlashPos + 1);
else
RepoName = RepoRemoteUrl.Substring (ColumnPos + 1);
SparkleBubble SyncingBubble;
SyncingBubble = new SparkleBubble (String.Format(_("Syncing folder {0}"), RepoName),
_("SparkleShare will notify you when this is done."));
SyncingBubble.AddAction ("", _("Dismiss"),
delegate {
SyncingBubble.Close ();
});
SyncingBubble.Show ();
Process Process = new Process ();
Process.EnableRaisingEvents = true;
Process.StartInfo.RedirectStandardOutput = true;
Process.StartInfo.UseShellExecute = false;
SparkleHelpers.DebugInfo ("Config", "[" + RepoName + "] Cloning repository...");
// Clone into the system's temporary folder
Process.StartInfo.FileName = "git";
Process.StartInfo.WorkingDirectory = SparklePaths.SparkleTmpPath;
Process.StartInfo.Arguments = String.Format ("clone {0} {1}",
RepoRemoteUrl,
RepoName);
Process.Start ();
Process.WaitForExit ();
if (Process.ExitCode != 0) {
SparkleBubble ErrorBubble;
ErrorBubble = new SparkleBubble (String.Format(_("Something went wrong while syncing {0}"), RepoName),
"Please double check the address and\n" +
"network connection.");
try {
Directory.Delete (SparkleHelpers.CombineMore (SparklePaths.SparkleTmpPath, RepoName));
} catch (System.IO.DirectoryNotFoundException) {
SparkleHelpers.DebugInfo ("Config", "[" + RepoName + "] Temporary directory did not exist...");
}
ErrorBubble.AddAction ("", _("Try Again…"),
delegate {
SparkleDialog SparkleDialog = new SparkleDialog (RepoRemoteUrl);
SparkleDialog.ShowAll ();
});
ErrorBubble.Show ();
} else {
SparkleHelpers.DebugInfo ("Git", "[" + RepoName + "] Repository cloned");
Directory.Move (SparkleHelpers.CombineMore (SparklePaths.SparkleTmpPath, RepoName),
SparkleHelpers.CombineMore (SparklePaths.SparklePath, RepoName));
// Add a .gitignore file to the repo
TextWriter Writer = new StreamWriter (SparkleHelpers.CombineMore (SparklePaths.SparklePath, RepoName,
".gitignore"));
Writer.WriteLine ("*~"); // Ignore gedit swap files
Writer.WriteLine (".*.sw?"); // Ignore vi swap files
Writer.WriteLine (".DS_store"); // Ignore OSX's invisible directories
Writer.Close ();
SparkleShare.SparkleUI.UpdateRepositories ();
// Show a confirmation notification
SparkleBubble FinishedBubble;
FinishedBubble = new SparkleBubble (String.Format(_("Successfully synced folder {0}"), RepoName),
_("Now make great stuff happen!"));
FinishedBubble.AddAction ("", _("Open Folder"),
delegate {
Process.StartInfo.FileName = "xdg-open";
Process.StartInfo.Arguments = SparkleHelpers.CombineMore (SparklePaths.SparklePath, RepoName);
Process.Start ();
} );
FinishedBubble.Show ();
}
}
// Enables the Add button when the fields are
// filled in correctly
public void CheckFields (object o, EventArgs args) {
if (SparkleHelpers.IsGitUrl (RemoteUrlCombo.Entry.Text))
AddButton.Sensitive = true;
else
AddButton.Sensitive = false;
}
}
}

View file

@ -1,459 +0,0 @@
// SparkleShare, an instant update workflow to Git.
// Copyright (C) 2010 Hylke Bons <hylkebons@gmail.com>
//
// 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 3 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, see <http://www.gnu.org/licenses/>.
using Gtk;
using Mono.Unix;
using SparkleShare;
using System;
using System.Diagnostics;
using System.IO;
using System.Text.RegularExpressions;
using System.Timers;
namespace SparkleShare {
// SparkleRepo class holds repository information and timers
public class SparkleRepo
{
private Process Process;
private Timer FetchTimer;
private Timer BufferTimer;
private FileSystemWatcher Watcher;
private bool HasChanged = false;
private DateTime LastChange;
public string Name;
public string Domain;
public string LocalPath;
public string RemoteOriginUrl;
public string CurrentHash;
public string UserEmail;
public string UserName;
public static string _ (string s)
{
return Catalog.GetString (s);
}
public SparkleRepo (string RepoPath)
{
Process = new Process ();
Process.EnableRaisingEvents = true;
Process.StartInfo.RedirectStandardOutput = true;
Process.StartInfo.UseShellExecute = false;
// Get the repository's path, example: "/home/user/SparkleShare/repo"
LocalPath = RepoPath;
Process.StartInfo.WorkingDirectory = LocalPath;
// Get user.name, example: "User Name"
UnixUserInfo UnixUserInfo = new UnixUserInfo (UnixEnvironment.UserName);
if (UnixUserInfo.RealName.Equals (""))
UserName = "Anonymous";
else
UserName = UnixUserInfo.RealName;
Process.StartInfo.FileName = "git";
Process.StartInfo.Arguments = "config user.name " + UserName;
Process.Start ();
// Get user.email, example: "user@github.com"
UserEmail = "not.set@git-scm.com";
Process.StartInfo.FileName = "git";
Process.StartInfo.Arguments = "config --get user.email";
Process.Start ();
UserEmail = Process.StandardOutput.ReadToEnd ().Trim ();
// Get remote.origin.url, example: "ssh://git@github.com/user/repo"
Process.StartInfo.FileName = "git";
Process.StartInfo.Arguments = "config --get remote.origin.url";
Process.Start ();
RemoteOriginUrl = Process.StandardOutput.ReadToEnd ().Trim ();
// Get the repository name, example: "Project"
Name = Path.GetFileName (LocalPath);
// Get the domain, example: "github.com"
Domain = RemoteOriginUrl;
Domain = Domain.Substring (Domain.IndexOf ("@") + 1);
if (Domain.IndexOf (":") > -1)
Domain = Domain.Substring (0, Domain.IndexOf (":"));
else
Domain = Domain.Substring (0, Domain.IndexOf ("/"));
// Get hash of the current commit
Process.StartInfo.FileName = "git";
Process.StartInfo.Arguments = "rev-list --max-count=1 HEAD";
Process.Start ();
CurrentHash = Process.StandardOutput.ReadToEnd ().Trim ();
// Watch the repository's folder
Watcher = new FileSystemWatcher (LocalPath);
Watcher.IncludeSubdirectories = true;
Watcher.EnableRaisingEvents = true;
Watcher.Filter = "*";
Watcher.Changed += new FileSystemEventHandler (OnFileActivity);
Watcher.Created += new FileSystemEventHandler (OnFileActivity);
Watcher.Deleted += new FileSystemEventHandler (OnFileActivity);
// Fetch remote changes every 20 seconds
FetchTimer = new Timer ();
FetchTimer.Interval = 20000;
FetchTimer.Elapsed += delegate {
Fetch ();
};
FetchTimer.Start ();
BufferTimer = new Timer ();
BufferTimer.Interval = 4000;
BufferTimer.Elapsed += delegate (object o, ElapsedEventArgs args) {
SparkleHelpers.DebugInfo ("Buffer", "[" + Name + "] Checking for changes.");
if (HasChanged) {
SparkleHelpers.DebugInfo ("Buffer", "[" + Name + "] Changes found, checking if settled.");
DateTime now = DateTime.UtcNow;
TimeSpan changed = new TimeSpan (now.Ticks - LastChange.Ticks);
if (changed.TotalMilliseconds > 5000) {
HasChanged = false;
SparkleHelpers.DebugInfo ("Buffer", "[" + Name + "] Changes have settled, adding.");
AddCommitAndPush ();
}
}
};
BufferTimer.Start ();
// Add everything that changed
// since SparkleShare was stopped
AddCommitAndPush ();
SparkleHelpers.DebugInfo ("Git", "[" + Name + "] Nothing going on...");
}
// Starts a time buffer when something changes
private void OnFileActivity (object o, FileSystemEventArgs args)
{
WatcherChangeTypes wct = args.ChangeType;
if (!ShouldIgnore (args.Name)) {
SparkleHelpers.DebugInfo ("Event", "[" + Name + "] " + wct.ToString () + " '" + args.Name + "'");
FetchTimer.Stop ();
LastChange = DateTime.UtcNow;
HasChanged = true;
}
}
// When there are changes we generally want to Add, Commit and Push
// so this method does them all with appropriate timers, etc switched off
public void AddCommitAndPush ()
{
BufferTimer.Stop ();
FetchTimer.Stop ();
Add ();
string Message = FormatCommitMessage ();
if (!Message.Equals ("")) {
Commit (Message);
Fetch ();
Push ();
}
FetchTimer.Start ();
BufferTimer.Start ();
}
// Stages the made changes
private void Add ()
{
SparkleHelpers.DebugInfo ("Git", "[" + Name + "] Staging changes...");
Process.StartInfo.Arguments = "add --all";
Process.Start ();
Process.WaitForExit ();
SparkleHelpers.DebugInfo ("Git", "[" + Name + "] Changes staged.");
// SparkleUI.NotificationIcon.SetSyncingState ();
// SparkleUI.NotificationIcon.SetIdleState ();
}
// Commits the made changes
public void Commit (string Message)
{
SparkleHelpers.DebugInfo ("Commit", "[" + Name + "] " + Message);
Process.StartInfo.Arguments = "commit -m \"" + Message + "\"";
Process.Start ();
Process.WaitForExit ();
}
// Fetches changes from the remote repo
public void Fetch ()
{
FetchTimer.Stop ();
// SparkleUI.NotificationIcon.SetSyncingState ();
SparkleHelpers.DebugInfo ("Git", "[" + Name + "] Fetching changes...");
Process.StartInfo.Arguments = "fetch -v";
Process.Start ();
string Output = Process.StandardOutput.ReadToEnd ().Trim (); // TODO: This doesn't work :(
Process.WaitForExit ();
SparkleHelpers.DebugInfo ("Git", "[" + Name + "] Changes fetched.");
if (!Output.Contains ("up to date"))
Rebase ();
// SparkleUI.NotificationIcon.SetIdleState ();
FetchTimer.Start ();
}
// Merges the fetched changes
public void Rebase ()
{
Watcher.EnableRaisingEvents = false;
SparkleHelpers.DebugInfo ("Git", "[" + Name + "] Rebasing changes...");
Process.StartInfo.Arguments = "rebase origin";
Process.WaitForExit ();
Process.Start ();
SparkleHelpers.DebugInfo ("Git", "[" + Name + "] Changes rebased.");
string Output = Process.StandardOutput.ReadToEnd ().Trim ();
// Show notification if there are updates
if (!Output.Contains ("up to date")) {
if (Output.Contains ("Failed to merge")) {
SparkleHelpers.DebugInfo ("Git", "[" + Name + "] Resolving conflict...");
Process.StartInfo.Arguments = "status";
Process.WaitForExit ();
Process.Start ();
Output = Process.StandardOutput.ReadToEnd ().Trim ();
foreach (string Line in Regex.Split (Output, "\n")) {
if (Line.Contains ("needs merge")) {
string ProblemFileName = Line.Substring (Line.IndexOf (": needs merge"));
Process.StartInfo.Arguments = "checkout --ours " + ProblemFileName;
Process.WaitForExit ();
Process.Start ();
DateTime DateTime = new DateTime ();
string TimeStamp = DateTime.Now.ToString ("H:mm, d MMM yyyy");
File.Move (ProblemFileName,
ProblemFileName + " (" + UserName + " - " + TimeStamp + ")");
Process.StartInfo.Arguments
= "checkout --theirs " + ProblemFileName;
Process.WaitForExit ();
Process.Start ();
string ConflictTitle = "A mid-air collision happened!\n";
string ConflictSubtext = "Don't worry, SparkleShare made\na copy of the conflicting files.";
SparkleBubble ConflictBubble =
new SparkleBubble(_(ConflictTitle), _(ConflictSubtext));
ConflictBubble.Show ();
}
}
Add ();
Process.StartInfo.Arguments = "rebase --continue";
Process.WaitForExit ();
Process.Start ();
SparkleHelpers.DebugInfo ("Git", "[" + Name + "] Conflict resolved.");
Push ();
Fetch ();
}
// Get the last committer e-mail
Process.StartInfo.Arguments = "log --format=\"%ae\" -1";
Process.Start ();
string LastCommitEmail = Process.StandardOutput.ReadToEnd ().Trim ();
// Get the last commit message
Process.StartInfo.Arguments = "log --format=\"%s\" -1";
Process.Start ();
string LastCommitMessage = Process.StandardOutput.ReadToEnd ().Trim ();
// Get the last commiter
Process.StartInfo.Arguments = "log --format=\"%an\" -1";
Process.Start ();
string LastCommitUserName = Process.StandardOutput.ReadToEnd ().Trim ();
string NotifySettingFile = SparkleHelpers.CombineMore (SparklePaths.SparkleConfigPath,
"sparkleshare.notify");
if (File.Exists (NotifySettingFile)) {
SparkleHelpers.DebugInfo ("Notification", "[" + Name + "] Showing message...");
SparkleBubble StuffChangedBubble = new SparkleBubble (LastCommitUserName, LastCommitMessage);
StuffChangedBubble.Icon = SparkleHelpers.GetAvatar (LastCommitEmail, 32);
// Add a button to open the folder where the changed file is
StuffChangedBubble.AddAction ("", _("Open Folder"),
delegate {
switch (SparklePlatform.Name) {
case "GNOME":
Process.StartInfo.FileName = "xdg-open";
break;
case "OSX":
Process.StartInfo.FileName = "open";
break;
}
Process.StartInfo.Arguments = LocalPath;
Process.Start ();
Process.StartInfo.FileName = "git";
} );
StuffChangedBubble.Show ();
}
}
Watcher.EnableRaisingEvents = true;
SparkleHelpers.DebugInfo ("Git", "[" + Name + "] Nothing going on...");
}
// Pushes the changes to the remote repo
public void Push ()
{
SparkleHelpers.DebugInfo ("Git", "[" + Name + "] Pushing changes...");
Process.StartInfo.Arguments = "push";
Process.Start ();
Process.WaitForExit ();
SparkleHelpers.DebugInfo ("Git", "[" + Name + "] Changes pushed.");
// SparkleUI.NotificationIcon.SetIdleState ();
}
// Ignores Repos, dotfiles, swap files and the like.
private bool ShouldIgnore (string FileName) {
if (FileName.Substring (0, 1).Equals (".") ||
FileName.Contains (".lock") ||
FileName.Contains (".git") ||
FileName.Contains ("/.") ||
Directory.Exists (LocalPath + FileName))
return true; // Yes, ignore it.
else if (FileName.Length > 3 && FileName.Substring (FileName.Length - 4).Equals (".swp"))
return true;
else return false;
}
// Creates a pretty commit message based on what has changed
private string FormatCommitMessage ()
{
bool DoneAddCommit = false;
bool DoneEditCommit = false;
bool DoneRenameCommit = false;
bool DoneDeleteCommit = false;
int FilesAdded = 0;
int FilesEdited = 0;
int FilesRenamed = 0;
int FilesDeleted = 0;
Process.StartInfo.Arguments = "status";
Process.Start ();
string Output = Process.StandardOutput.ReadToEnd ();
foreach (string Line in Regex.Split (Output, "\n")) {
if (Line.IndexOf ("new file:") > -1)
FilesAdded++;
if (Line.IndexOf ("modified:") > -1)
FilesEdited++;
if (Line.IndexOf ("renamed:") > -1)
FilesRenamed++;
if (Line.IndexOf ("deleted:") > -1)
FilesDeleted++;
}
foreach (string Line in Regex.Split (Output, "\n")) {
// Format message for when files are added,
// example: "added 'file' and 3 more."
if (Line.IndexOf ("new file:") > -1 && !DoneAddCommit) {
DoneAddCommit = true;
if (FilesAdded > 1)
return "added " +
Line.Replace ("#\tnew file:", "").Trim () +
"\nand " + (FilesAdded - 1) + " more.";
else
return "added " +
Line.Replace ("#\tnew file:", "").Trim () + ".";
}
// Format message for when files are edited,
// example: "edited 'file'."
if (Line.IndexOf ("modified:") > -1 && !DoneEditCommit) {
DoneEditCommit = true;
if (FilesEdited > 1)
return "edited " +
Line.Replace ("#\tmodified:", "").Trim () +
"\nand " + (FilesEdited - 1) + " more.";
else
return "edited " +
Line.Replace ("#\tmodified:", "").Trim () + ".";
}
// Format message for when files are edited,
// example: "deleted 'file'."
if (Line.IndexOf ("deleted:") > -1 && !DoneDeleteCommit) {
DoneDeleteCommit = true;
if (FilesDeleted > 1)
return "deleted " +
Line.Replace ("#\tdeleted:", "").Trim () +
"\nand " + (FilesDeleted - 1) + " more.";
else
return "deleted " +
Line.Replace ("#\tdeleted:", "").Trim () + ".";
}
// Format message for when files are renamed,
// example: "renamed 'file' to 'new name'."
if (Line.IndexOf ("renamed:") > -1 && !DoneRenameCommit) {
DoneDeleteCommit = true;
if (FilesRenamed > 1)
return "renamed " +
Line.Replace ("#\trenamed:", "").Trim ().Replace
(" -> ", " to ") + " and " + (FilesDeleted - 1) +
" more.";
else
return "renamed " +
Line.Replace ("#\trenamed:", "").Trim ().Replace
(" -> ", " to ") + ".";
}
}
// Nothing happened:
return "";
}
}
}

View file

@ -1,107 +0,0 @@
// SparkleShare, an instant update workflow to Git.
// Copyright (C) 2010 Hylke Bons <hylkebons@gmail.com>
//
// 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 3 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, see <http://www.gnu.org/licenses/>.
using Gtk;
using Mono.Unix;
using System;
using System.Diagnostics;
namespace SparkleShare {
// This is SparkleShare!
public class SparkleShare {
// Short alias for the translations
public static string _ (string s)
{
return Catalog.GetString (s);
}
public static SparkleRepo [] Repositories;
public static SparkleUI SparkleUI;
public static void Main (string [] args)
{
// Use translations
Catalog.Init ("i18n", "locale");
// Check if git is installed
Process Process = new Process ();
Process.StartInfo.FileName = "git";
Process.StartInfo.RedirectStandardOutput = true;
Process.StartInfo.UseShellExecute = false;
Process.Start ();
if (Process.StandardOutput.ReadToEnd ().IndexOf ("version") == -1) {
Console.WriteLine (_("Git wasn't found."));
Console.WriteLine (_("You can get Git from http://git-scm.com/."));
Environment.Exit (0);
}
// Don't allow running as root
UnixUserInfo UnixUserInfo = new UnixUserInfo (UnixEnvironment.UserName);
if (UnixUserInfo.UserId == 0) {
Console.WriteLine (_("Sorry, you can't run SparkleShare with these permissions."));
Console.WriteLine (_("Things will go utterly wrong."));
Environment.Exit (0);
}
// Parse the command line arguments
bool HideUI = false;
if (args.Length > 0) {
foreach (string Argument in args) {
if (Argument.Equals ("--disable-gui") || Argument.Equals ("-d"))
HideUI = true;
if (Argument.Equals ("--help") || Argument.Equals ("-h")) {
ShowHelp ();
}
}
}
Gtk.Application.Init ();
SparkleUI = new SparkleUI (HideUI);
// The main loop
Gtk.Application.Run ();
}
// Prints the help output
public static void ShowHelp ()
{
Console.WriteLine (_("SparkleShare Copyright (C) 2010 Hylke Bons"));
Console.WriteLine (" ");
Console.WriteLine (_("This program comes with ABSOLUTELY NO WARRANTY."));
Console.WriteLine (_("This is free software, and you are welcome to redistribute it "));
Console.WriteLine (_("under certain conditions. Please read the GNU GPLv3 for details."));
Console.WriteLine (" ");
Console.WriteLine (_("SparkleShare syncs the ~/SparkleShare folder with remote repositories."));
Console.WriteLine (" ");
Console.WriteLine (_("Usage: sparkleshare [start|stop|restart] [OPTION]..."));
Console.WriteLine (_("Sync SparkleShare folder with remote repositories."));
Console.WriteLine (" ");
Console.WriteLine (_("Arguments:"));
Console.WriteLine (_("\t -d, --disable-gui\tDon't show the notification icon."));
Console.WriteLine (_("\t -h, --help\t\tDisplay this help text."));
Console.WriteLine (" ");
Environment.Exit (0);
}
}
}

View file

@ -1,97 +0,0 @@
// SparkleShare, an instant update workflow to Git.
// Copyright (C) 2010 Hylke Bons <hylkebons@gmail.com>
//
// 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 3 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, see <http://www.gnu.org/licenses/>.
using Gtk;
using System.Timers;
namespace SparkleShare {
// This is a close implementation of GtkSpinner
public class SparkleSpinner : Image
{
public bool Active;
private Gdk.Pixbuf [] Images;
private Timer Timer;
private int CycleDuration;
private int CurrentStep;
private int NumSteps;
private int Size;
public SparkleSpinner () : base ()
{
CycleDuration = 750;
CurrentStep = 0;
Size = 24;
Gdk.Pixbuf SpinnerGallery = SparkleHelpers.GetIcon ("process-working", Size);
int FramesInWidth = SpinnerGallery.Width / Size;
int FramesInHeight = SpinnerGallery.Height / Size;
NumSteps = FramesInWidth * FramesInHeight;
Images = new Gdk.Pixbuf [NumSteps - 1];
int i = 0;
for (int y = 0; y < FramesInHeight; y++) {
for (int x = 0; x < FramesInWidth; x++) {
if (!(y == 0 && x == 0)) {
Images [i] = new Gdk.Pixbuf (SpinnerGallery, x * Size, y * Size, Size, Size);
i++;
}
}
}
Timer = new Timer ();
Timer.Interval = CycleDuration / NumSteps;
Timer.Elapsed += delegate {
NextImage ();
};
Start ();
}
private void NextImage ()
{
if (CurrentStep < NumSteps)
CurrentStep++;
else
CurrentStep = 0;
Pixbuf = Images [CurrentStep];
}
public bool IsActive ()
{
return Active;
}
public void Start ()
{
CurrentStep = 0;
Active = true;
Timer.Start ();
}
public void Stop ()
{
Active = false;
Timer.Stop ();
}
}
}

View file

@ -1,236 +0,0 @@
// SparkleShare, an instant update workflow to Git.
// Copyright (C) 2010 Hylke Bons <hylkebons@gmail.com>
//
// 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 3 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, see <http://www.gnu.org/licenses/>.
using Gtk;
using Mono.Unix;
using SparkleShare;
using System;
using System.Diagnostics;
using System.IO;
using System.Timers;
namespace SparkleShare {
public class SparkleStatusIcon : StatusIcon
{
private Timer Timer;
private int SyncingState;
// Short alias for the translations
public static string _ (string s) {
return Catalog.GetString (s);
}
public EventHandler CreateWindowDelegate (SparkleRepo SparkleRepo)
{
return delegate {
SparkleWindow SparkleWindow = new SparkleWindow (SparkleRepo);
SparkleWindow.ShowAll ();
};
}
public SparkleStatusIcon () : base ()
{
Timer = new Timer ();
Activate += ShowMenu;
// 0 = Everything up to date
// 1 = Syncing in progress
// -1 = Error syncing
SyncingState = 0;
SetIdleState ();
}
public void ShowMenu (object o, EventArgs Args)
{
Menu Menu = new Menu ();
string StateText = "";
switch (SyncingState) {
case -1:
StateText = _("Error syncing");
break;
case 0:
StateText = _("Everything is up to date");
break;
case 1:
StateText = _("Syncing…");
break;
}
MenuItem StatusMenuItem = new MenuItem (StateText);
StatusMenuItem.Sensitive = false;
Menu.Add (StatusMenuItem);
Menu.Add (new SeparatorMenuItem ());
Action FolderAction = new Action ("", "SparkleShare");
FolderAction.IconName = "folder-sparkleshare";
FolderAction.IsImportant = true;
FolderAction.Activated += delegate {
Process Process = new Process ();
switch (SparklePlatform.Name) {
case "GNOME":
Process.StartInfo.FileName = "xdg-open";
break;
case "OSX":
Process.StartInfo.FileName = "open";
break;
}
Process.StartInfo.Arguments = SparklePaths.SparklePath;
Process.Start ();
};
Menu.Add (FolderAction.CreateMenuItem ());
Action [] FolderItems =
new Action [SparkleShare.Repositories.Length];
int i = 0;
foreach (SparkleRepo SparkleRepo in SparkleShare.Repositories) {
FolderItems [i] = new Action ("", SparkleRepo.Name);
FolderItems [i].IconName = "folder";
FolderItems [i].IsImportant = true;
FolderItems [i].Activated += CreateWindowDelegate (SparkleRepo);
Menu.Add (FolderItems [i].CreateMenuItem ());
i++;
}
MenuItem AddItem = new MenuItem (_("Add a Remote Folder…"));
AddItem.Activated += delegate {
SparkleDialog SparkleDialog = new SparkleDialog ("");
SparkleDialog.ShowAll ();
};
Menu.Add (AddItem);
Menu.Add (new SeparatorMenuItem ());
CheckMenuItem NotifyCheckMenuItem = new CheckMenuItem (_("Show Notifications"));
Menu.Add (NotifyCheckMenuItem);
Menu.Add (new SeparatorMenuItem ());
string NotifyChangesFileName = SparkleHelpers.CombineMore (SparklePaths.SparkleConfigPath,
"sparkleshare.notify");
if (System.IO.File.Exists (NotifyChangesFileName))
NotifyCheckMenuItem.Active = true;
NotifyCheckMenuItem.Toggled += delegate {
if (System.IO.File.Exists (NotifyChangesFileName)) {
File.Delete (NotifyChangesFileName);
} else {
System.IO.File.Create (NotifyChangesFileName);
}
};
MenuItem AboutItem = new MenuItem (_("Visit Website"));
AboutItem.Activated += delegate {
Process Process = new Process ();
switch (SparklePlatform.Name) {
case "GNOME":
Process.StartInfo.FileName = "xdg-open";
break;
case "OSX":
Process.StartInfo.FileName = "open";
break;
}
Process.StartInfo.Arguments = "http://www.sparkleshare.org/";
Process.Start ();
};
Menu.Add (AboutItem);
Menu.Add (new SeparatorMenuItem ());
MenuItem QuitItem = new MenuItem (_("Quit"));
QuitItem.Activated += Quit;
Menu.Add (QuitItem);
Menu.ShowAll ();
Menu.Popup (null, null, SetPosition, 0, Global.CurrentEventTime);
}
public void SetIdleState ()
{
Timer.Stop ();
Pixbuf = SparkleHelpers.GetIcon ("folder-sparkleshare", 24);
SyncingState = 0;
}
// Changes the status icon to the syncing animation
// TODO: There are UI freezes when switching back and forth
// bewteen syncing and idle state
public void SetSyncingState ()
{
SyncingState = 1;
int CycleDuration = 250;
int CurrentStep = 0;
int Size = 24;
Gdk.Pixbuf SpinnerGallery = SparkleHelpers.GetIcon ("process-syncing-sparkleshare", Size);
int FramesInWidth = SpinnerGallery.Width / Size;
int FramesInHeight = SpinnerGallery.Height / Size;
int NumSteps = FramesInWidth * FramesInHeight;
Gdk.Pixbuf [] Images = new Gdk.Pixbuf [NumSteps - 1];
int i = 0;
for (int y = 0; y < FramesInHeight; y++) {
for (int x = 0; x < FramesInWidth; x++) {
if (!(y == 0 && x == 0)) {
Images [i] = new Gdk.Pixbuf (SpinnerGallery, x * Size, y * Size, Size, Size);
i++;
}
}
}
Timer = new Timer ();
Timer.Interval = CycleDuration / NumSteps;
Timer.Elapsed += delegate {
if (CurrentStep < NumSteps)
CurrentStep++;
else
CurrentStep = 0;
Pixbuf = Images [CurrentStep];
};
Timer.Start ();
}
// Changes the status icon to the error icon
public void SetErrorState ()
{
IconName = "folder-sync-error";
SyncingState = -1;
}
public void SetPosition (Menu menu, out int x, out int y, out bool push_in)
{
PositionMenu (menu, out x, out y, out push_in, Handle);
}
// Quits the program
public void Quit (object o, EventArgs args)
{
System.IO.File.Delete (SparkleHelpers.CombineMore (SparklePaths.SparkleTmpPath, "sparkleshare.pid"));
Application.Quit ();
}
}
}

View file

@ -1,235 +0,0 @@
// SparkleShare, an instant update workflow to Git.
// Copyright (C) 2010 Hylke Bons <hylkebons@gmail.com>
//
// 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 3 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, see <http://www.gnu.org/licenses/>.
using Gtk;
using Mono.Unix;
using SparkleShare;
using System;
using System.Diagnostics;
using System.IO;
using System.Text.RegularExpressions;
using System.Timers;
namespace SparkleShare {
public class SparkleWindow : Window
{
// Short alias for the translations
public static string _ (string s)
{
return Catalog.GetString (s);
}
private SparkleRepo SparkleRepo;
private VBox LayoutVertical;
private ScrolledWindow LogScrolledWindow;
private string SelectedEmail;
public SparkleWindow (SparkleRepo Repo) : base ("")
{
SparkleRepo = Repo;
SelectedEmail = "";
SetSizeRequest (640, 480);
SetPosition (WindowPosition.Center);
BorderWidth = 12;
Title = String.Format(_("{0} on {1}"), SparkleRepo.Name,
SparkleRepo.RemoteOriginUrl.TrimEnd (("/" + SparkleRepo.Name + ".git").ToCharArray ()));
IconName = "folder";
LayoutVertical = new VBox (false, 12);
LayoutVertical.PackStart (CreateEventLog (), true, true, 0);
HButtonBox DialogButtons = new HButtonBox ();
DialogButtons.Layout = ButtonBoxStyle.Edge;
DialogButtons.BorderWidth = 0;
Button OpenFolderButton = new Button (_("Open Folder"));
OpenFolderButton.Clicked += delegate (object o, EventArgs args) {
Process Process = new Process ();
Process.StartInfo.FileName = "xdg-open";
Process.StartInfo.Arguments =
SparkleHelpers.CombineMore (SparklePaths.SparklePath, SparkleRepo.Name);
Process.Start ();
Destroy ();
};
Button CloseButton = new Button (Stock.Close);
CloseButton.Clicked += delegate (object o, EventArgs args) {
Destroy ();
};
DialogButtons.Add (OpenFolderButton);
DialogButtons.Add (CloseButton);
LayoutVertical.PackStart (DialogButtons, false, false, 0);
Add (LayoutVertical);
}
public void UpdateEventLog ()
{
LayoutVertical.Remove (LogScrolledWindow);
LogScrolledWindow = CreateEventLog ();
LayoutVertical.PackStart (LogScrolledWindow, true, true, 0);
ShowAll ();
}
private ScrolledWindow CreateEventLog ()
{
ListStore LogStore = new ListStore (typeof (Gdk.Pixbuf),
typeof (string),
typeof (string),
typeof (string));
Process Process = new Process ();
Process.EnableRaisingEvents = true;
Process.StartInfo.RedirectStandardOutput = true;
Process.StartInfo.UseShellExecute = false;
Process.StartInfo.FileName = "git";
string Output = "";
Process.StartInfo.WorkingDirectory = SparkleRepo.LocalPath;
// We're using the snowman here to separate messages :)
Process.StartInfo.Arguments = "log --format=\"%at☃%s☃%an☃%cr☃%ae\" -25";
Process.Start ();
Output += "\n" + Process.StandardOutput.ReadToEnd ().Trim ();
Output = Output.TrimStart ("\n".ToCharArray ());
string [] Lines = Regex.Split (Output, "\n");
// Sort by time and get the last 25
Array.Sort (Lines);
Array.Reverse (Lines);
TreeIter Iter;
for (int i = 0; i < 25 && i < Lines.Length; i++) {
string Line = Lines [i];
if (Line.Contains (SelectedEmail)) {
// Look for the snowman!
string [] Parts = Regex.Split (Line, "☃");
string Message = Parts [1];
string UserName = Parts [2];
string TimeAgo = Parts [3];
string UserEmail = Parts [4];
Message = Message.Replace ("/", " → ");
Message = Message.Replace ("\n", " ");
Iter = LogStore.Append ();
LogStore.SetValue (Iter, 0, SparkleHelpers.GetAvatar (UserEmail, 24));
LogStore.SetValue (Iter, 1, "<b>" + UserName + "</b>\n" + Message);
// TODO Blend text color with treeview color instead of hardcoding it
LogStore.SetValue (Iter, 2, "<span fgcolor='grey'>" + TimeAgo + "</span> ");
// We're not showing email, it's only
// there for lookup purposes
LogStore.SetValue (Iter, 3, UserEmail);
}
}
TreeView LogView = new TreeView (LogStore);
LogView.HeadersVisible = false;
LogView.AppendColumn ("", new CellRendererPixbuf (), "pixbuf", 0);
CellRendererText MessageCellRenderer = new CellRendererText ();
TreeViewColumn MessageColumn = new TreeViewColumn ();
MessageColumn.PackStart (MessageCellRenderer, true);
MessageColumn.SetCellDataFunc (MessageCellRenderer, new Gtk.TreeCellDataFunc (RenderMessageRow));
LogView.AppendColumn (MessageColumn);
CellRendererText TimeAgoCellRenderer = new CellRendererText ();
TreeViewColumn TimeAgoColumn = new TreeViewColumn ();
TimeAgoColumn.PackStart (TimeAgoCellRenderer, true);
TimeAgoColumn.SetCellDataFunc (TimeAgoCellRenderer, new Gtk.TreeCellDataFunc (RenderTimeAgoRow));
TimeAgoCellRenderer.Xalign = 1;
LogView.AppendColumn (TimeAgoColumn);
TreeViewColumn [] Columns = LogView.Columns;
Columns [0].MinWidth = 42;
Columns [1].Expand = true;
Columns [1].MinWidth = 350;
Columns [2].Expand = true;
Columns [2].MinWidth = 50;
// Get the email address of the selected log message each
// time the cursor changes
LogView.CursorChanged += delegate (object o, EventArgs args) {
TreeModel model;
TreeIter iter;
if (LogView.Selection.GetSelected (out model, out iter)) {
SelectedEmail = (string) model.GetValue (iter, 3);
}
};
// Compose an e-mail when a row is activated
LogView.RowActivated +=
delegate (object o, RowActivatedArgs Args) {
switch (SparklePlatform.Name) {
case "GNOME":
Process.StartInfo.FileName = "xdg-open";
break;
case "OSX":
Process.StartInfo.FileName = "open";
break;
}
Process.StartInfo.Arguments = "mailto:" + SelectedEmail;
Process.Start ();
};
LogScrolledWindow = new ScrolledWindow ();
LogScrolledWindow.AddWithViewport (LogView);
return LogScrolledWindow;
}
// Renders a row with custom markup
private void RenderMessageRow (TreeViewColumn column, CellRenderer cell, TreeModel model, TreeIter iter)
{
string item = (string) model.GetValue (iter, 1);
(cell as CellRendererText).Markup = item;
}
private void RenderTimeAgoRow (TreeViewColumn column, CellRenderer cell, TreeModel model, TreeIter iter)
{
string item = (string) model.GetValue (iter, 2);
(cell as CellRendererText).Markup = item;
}
}
}

85
autogen.sh Executable file
View file

@ -0,0 +1,85 @@
#!/usr/bin/env bash
PROJECT=sparkleshare
function error () {
echo "Error: $1" 1>&2
exit 1
}
function check_autotool_version () {
which $1 &>/dev/null || {
error "$1 is not installed, and is required to configure $PACKAGE"
}
version=$($1 --version | head -n 1 | cut -f4 -d' ')
major=$(echo $version | cut -f1 -d.)
minor=$(echo $version | cut -f2 -d.)
rev=$(echo $version | cut -f3 -d. | sed 's/[^0-9].*$//')
major_check=$(echo $2 | cut -f1 -d.)
minor_check=$(echo $2 | cut -f2 -d.)
rev_check=$(echo $2 | cut -f3 -d.)
if [ $major -lt $major_check ]; then
do_bail=yes
elif [[ $minor -lt $minor_check && $major = $major_check ]]; then
do_bail=yes
elif [[ $rev -lt $rev_check && $minor = $minor_check && $major = $major_check ]]; then
do_bail=yes
fi
if [ x"$do_bail" = x"yes" ]; then
error "$1 version $2 or better is required to configure $PROJECT"
fi
}
function run () {
echo "Running $@ ..."
$@ 2>.autogen.log || {
cat .autogen.log 1>&2
rm .autogen.log
error "Could not run $1, which is required to configure $PROJECT"
}
rm .autogen.log
}
srcdir=$(dirname $0)
test -z "$srcdir" && srcdir=.
(test -f $srcdir/configure.ac) || {
error "Directory \"$srcdir\" does not look like the top-level $PROJECT directory"
}
# MacPorts on OS X only seems to have glibtoolize
WHICHLIBTOOLIZE=$(which libtoolize || which glibtoolize)
if [ x"$WHICHLIBTOOLIZE" == x"" ]; then
error "libtool is required to configure $PROJECT"
fi
LIBTOOLIZE=$(basename $WHICHLIBTOOLIZE)
check_autotool_version aclocal 1.9
check_autotool_version automake 1.9
check_autotool_version autoconf 2.53
check_autotool_version $LIBTOOLIZE 1.4.3
check_autotool_version intltoolize 0.35.0
check_autotool_version pkg-config 0.14.0
run intltoolize --force --copy
run $LIBTOOLIZE --force --copy --automake
run aclocal -I build/m4/sparkleshare -I build/m4/shamrock -I build/m4/shave $ACLOCAL_FLAGS
run autoconf
run automake --gnu --add-missing --force --copy \
-Wno-portability -Wno-portability
if [ ! -z "$NOCONFIGURE" ]; then
echo "Done. ./configure skipped."
exit $?
fi
if [ $# = 0 ]; then
echo "WARNING: I am going to run configure without any arguments."
fi
run ./configure --enable-maintainer-mode $@

6
build/Makefile.am Normal file
View file

@ -0,0 +1,6 @@
SUBDIRS = m4
EXTRA_DIST = \
icon-theme-installer
MAINTAINERCLEANFILES = Makefile.in

View file

@ -0,0 +1,45 @@
# Initializers
MONO_BASE_PATH =
MONO_ADDINS_PATH =
# Install Paths
DEFAULT_INSTALL_DIR = $(pkglibdir)
## Directories
DIR_DOCS = $(top_builddir)/docs
DIR_ICONS = $(top_builddir)/icons
DIR_NOTIFYSHARP = $(top_builddir)/notify-sharp
DIR_SRC = $(top_builddir)/src
DIR_BIN = $(top_builddir)/bin
# External libraries to link against, generated from configure
LINK_SYSTEM = -r:System
LINK_MONO_POSIX = -r:Mono.Posix
LINK_GLIB = $(GLIBSHARP_LIBS)
LINK_GTK = $(GTKSHARP_LIBS)
LINK_GNOME = $(GNOME_SHARP_LIBS)
LINK_DBUS = $(NDESK_DBUS_LIBS) $(NDESK_DBUS_GLIB_LIBS)
LINK_DBUS_NO_GLIB = $(NDESK_DBUS_LIBS)
REF_NOTIFY_SHARP = $(LINK_SYSTEM) $(LINK_DBUS) $(GTKSHARP_LIBS) $(GLIBSHARP_LIBS)
LINK_NOTIFY_SHARP = -r:$(DIR_BIN)/NotifySharp.dll
LINK_NOTIFY_SHARP_DEPS = $(REF_NOTIFY_SHARP) $(LINK_NOTIFY_SHARP)
REF_SPARKLESHARE = $(LINK_SYSTEM) $(LINK_GTK) $(LINK_DBUS) $(LINK_NOTIFY_SHARP_DEPS) $(LINK_MONO_POSIX)
LINK_SPARKLESHARE = -r:$(DIR_BIN)/SparkleShare.exe
LINK_SPARKLESHARE_DEPS = $(REF_SPARKLESHARE) $(LINK_SPARKLESHARE)
# Cute hack to replace a space with something
colon:= :
empty:=
space:= $(empty) $(empty)
# Build path to allow running uninstalled
RUN_PATH = $(subst $(space),$(colon), $(MONO_BASE_PATH))

3
build/build.mk Normal file
View file

@ -0,0 +1,3 @@
include $(top_srcdir)/build/build.environment.mk
include $(top_srcdir)/build/build.rules.mk

88
build/build.rules.mk Normal file
View file

@ -0,0 +1,88 @@
UNIQUE_FILTER_PIPE = tr [:space:] \\n | sort | uniq
BUILD_DATA_DIR = $(top_builddir)/bin/share/$(PACKAGE)
# Since all other attempts failed, we currently go this way:
# This code adds the file specified in ASSEMBLY_INFO_SOURCE to SOURCES_BUILD.
# If no such file is specified, the default AssemblyInfo.cs is used.
ASSEMBLY_INFO_SOURCE_REAL = \
$(shell if [ "$(ASSEMBLY_INFO_SOURCE)" ]; \
then \
echo "$(addprefix $(srcdir)/, $(ASSEMBLY_INFO_SOURCE))"; \
else \
echo "$(top_srcdir)/SparkleShare/AssemblyInfo.cs"; \
fi)
SOURCES_BUILD = $(addprefix $(srcdir)/, $(SOURCES))
SOURCES_BUILD += $(ASSEMBLY_INFO_SOURCE_REAL)
RESOURCES_EXPANDED = $(addprefix $(srcdir)/, $(RESOURCES))
RESOURCES_BUILD = $(foreach resource, $(RESOURCES_EXPANDED), \
-resource:$(resource),$(notdir $(resource)))
ASSEMBLY_EXTENSION = $(strip $(patsubst library, dll, $(TARGET)))
ASSEMBLY_FILE = $(top_builddir)/bin/$(ASSEMBLY).$(ASSEMBLY_EXTENSION)
INSTALL_DIR_RESOLVED = $(firstword $(subst , $(DEFAULT_INSTALL_DIR), $(INSTALL_DIR)))
if ENABLE_TESTS
LINK += " $(NUNIT_LIBS)"
ENABLE_TESTS_FLAG = "-define:ENABLE_TESTS"
endif
if ENABLE_ATK
ENABLE_ATK_FLAG = "-define:ENABLE_ATK"
endif
FILTERED_LINK = $(shell echo "$(LINK)" | $(UNIQUE_FILTER_PIPE))
DEP_LINK = $(shell echo "$(LINK)" | $(UNIQUE_FILTER_PIPE) | sed s,-r:,,g | grep '$(top_builddir)/bin/')
OUTPUT_FILES = \
$(ASSEMBLY_FILE) \
$(ASSEMBLY_FILE).mdb
moduledir = $(INSTALL_DIR_RESOLVED)
module_SCRIPTS = $(OUTPUT_FILES)
all: $(ASSEMBLY_FILE)
run:
@pushd $(top_builddir); \
make run; \
popd;
# uncommented for now.
# tests are currently excuted from Makefile in $(top_builddir)
#test:
# @pushd $(top_builddir)/tests; \
# make $(ASSEMBLY); \
# popd;
build-debug:
@echo $(DEP_LINK)
$(ASSEMBLY_FILE).mdb: $(ASSEMBLY_FILE)
$(ASSEMBLY_FILE): $(SOURCES_BUILD) $(RESOURCES_EXPANDED) $(DEP_LINK)
@mkdir -p $(top_builddir)/bin
$(MCS) \
$(GMCS_FLAGS) \
$(ASSEMBLY_BUILD_FLAGS) \
-nowarn:0278 -nowarn:0078 $$warn \
-define:HAVE_GTK_2_10 -define:NET_2_0 \
-debug -target:$(TARGET) -out:$@ \
$(BUILD_DEFINES) $(ENABLE_TESTS_FLAG) $(ENABLE_ATK_FLAG) \
$(FILTERED_LINK) $(RESOURCES_BUILD) $(SOURCES_BUILD)
@if [ -e $(srcdir)/$(notdir $@.config) ]; then \
cp $(srcdir)/$(notdir $@.config) $(top_builddir)/bin; \
fi;
@if [ ! -z "$(EXTRA_BUNDLE)" ]; then \
cp $(EXTRA_BUNDLE) $(top_builddir)/bin; \
fi;
EXTRA_DIST = $(SOURCES_BUILD) $(RESOURCES_EXPANDED)
CLEANFILES = $(OUTPUT_FILES) $(ASSEMBLY_FILE).config
DISTCLEANFILES = *.pidb
MAINTAINERCLEANFILES = Makefile.in

177
build/icon-theme-installer Executable file
View file

@ -0,0 +1,177 @@
#!/usr/bin/env bash
# icon-theme-installer
# Copyright (C) 2006 Novell, Inc.
# Written by Aaron Bockover <abock@gnome.org>
# Licensed under the MIT/X11 license
#
# This script is meant to be invoked from within a Makefile/Makefile.am
# in the install-data-local and uninstall-data sections. It handles the
# task of properly installing icons into the icon theme. It requires a
# few arguments to set up its environment, and a list of files to be
# installed. The format of the file list is critical:
#
# <category>,<local-src-file-name>
#
# apps,music-player-banshee.svg
# apps,music-player-banshee-16.png
# apps,music-player-banshee-22.png
#
# <category> is the icon theme category, for instance, apps, devices,
# actions, emblems...
#
# <local-src-file-name> must have a basename in the form of:
#
# proper-theme-name[-<SIZE>].<EXTENSION>
#
# Where <SIZE> should be either nothing, which will default to scalable
# or \-[0-9]{2}, which will expand to <SIZE>x<SIZE>. For example:
#
# music-player-banshee-16.png
#
# The <SIZE> here is -16 and will expand to 16x16 per the icon theme spec
#
# What follows is an example Makefile.am for icon theme installation:
#
# ---------------
# theme=hicolor
# themedir=$(datadir)/icons/$(theme)
# theme_icons = \
# apps,music-player-banshee.svg \
# apps,music-player-banshee-16.png \
# apps,music-player-banshee-22.png \
# apps,music-player-banshee-24.png \
# apps,music-player-banshee-32.png
#
# install_icon_exec = $(top_srcdir)/build/icon-theme-installer -t $(theme) -s $(srcdir) -d "x$(DESTDIR)" -b $(themedir) -m "$(mkinstalldirs)" -x "$(INSTALL_DATA)"
# install-data-local:
# $(install_icon_exec) -i $(theme_icons)
#
# uninstall-hook:
# $(install_icon_exec) -u $(theme_icons)
#
# MAINTAINERCLEANFILES = Makefile.in
# EXTRA_DIST = $(wildcard *.svg *.png)
# ---------------
#
# Arguments to this program:
#
# -i : Install
# -u : Uninstall
# -t <theme> : Theme name (hicolor)
# -b <dir> : Theme installation dest directory [x$(DESTDIR)] - Always prefix
# this argument with x; it will be stripped but will act as a
# placeholder for zero $DESTDIRs (only set by packagers)
# -d <dir> : Theme installation directory [$(hicolordir)]
# -s <dir> : Source directory [$(srcdir)]
# -m <exec> : Command to exec for directory creation [$(mkinstalldirs)]
# -x <exec> : Command to exec for single file installation [$(INSTALL_DATA)]
# <remainging> : All remainging should be category,filename pairs
while getopts "iut:b:d:s:m:x:" flag; do
case "$flag" in
i) INSTALL=yes ;;
u) UNINSTALL=yes ;;
t) THEME_NAME=$OPTARG ;;
d) INSTALL_DEST_DIR=${OPTARG##x} ;;
b) INSTALL_BASE_DIR=$OPTARG ;;
s) SRC_DIR=$OPTARG ;;
m) MKINSTALLDIRS_EXEC=$OPTARG ;;
x) INSTALL_DATA_EXEC=$OPTARG ;;
esac
done
shift $(($OPTIND - 1))
if test "x$INSTALL" = "xyes" -a "x$UNINSTALL" = "xyes"; then
echo "Cannot pass both -i and -u"
exit 1
elif test "x$INSTALL" = "x" -a "x$UNINSTALL" = "x"; then
echo "Must path either -i or -u"
exit 1
fi
if test -z "$THEME_NAME"; then
echo "Theme name required (-t hicolor)"
exit 1
fi
if test -z "$INSTALL_BASE_DIR"; then
echo "Base theme directory required [-d \$(hicolordir)]"
exit 1
fi
if test ! -x $(echo "$MKINSTALLDIRS_EXEC" | cut -f1 -d' '); then
echo "Cannot find '$MKINSTALLDIRS_EXEC'; You probably want to pass -m \$(mkinstalldirs)"
exit 1
fi
if test ! -x $(echo "$INSTALL_DATA_EXEC" | cut -f1 -d' '); then
echo "Cannot find '$INSTALL_DATA_EXEC'; You probably want to pass -x \$(INSTALL_DATA)"
exit 1
fi
if test -z "$SRC_DIR"; then
SRC_DIR=.
fi
for icon in $@; do
size=$(echo $icon | sed s/[^0-9]*//g)
category=$(echo $icon | cut -d, -f1)
build_name=$(echo $icon | cut -d, -f2)
install_name=$(echo $build_name | sed "s/[0-9]//g; s/-\././")
install_name=$(basename $install_name)
if test -z $size; then
size=scalable;
else
size=${size}x${size};
fi
install_dir=${INSTALL_DEST_DIR}${INSTALL_BASE_DIR}/$size/$category
install_path=$install_dir/$install_name
if test "x$INSTALL" = "xyes"; then
echo "Installing $size $install_name into $THEME_NAME icon theme"
$($MKINSTALLDIRS_EXEC $install_dir) || {
echo "Failed to create directory $install_dir"
exit 1
}
$($INSTALL_DATA_EXEC $SRC_DIR/$build_name $install_path) || {
echo "Failed to install $SRC_DIR/$build_name into $install_path"
exit 1
}
if test ! -e $install_path; then
echo "Failed to install $SRC_DIR/$build_name into $install_path"
exit 1
fi
else
if test -e $install_path; then
echo "Removing $size $install_name from $THEME_NAME icon theme"
rm $install_path || {
echo "Failed to remove $install_path"
exit 1
}
fi
fi
done
gtk_update_icon_cache_bin="$((which gtk-update-icon-cache || echo /opt/gnome/bin/gtk-update-icon-cache)2>/dev/null)"
gtk_update_icon_cache="$gtk_update_icon_cache_bin -f -t $INSTALL_BASE_DIR"
if test -z "$INSTALL_DEST_DIR"; then
if test -x $gtk_update_icon_cache_bin; then
echo "Updating GTK icon cache"
$gtk_update_icon_cache
else
echo "*** Icon cache not updated. Could not execute $gtk_update_icon_cache_bin"
fi
else
echo "*** Icon cache not updated. After (un)install, run this:"
echo "*** $gtk_update_icon_cache"
fi

7
build/m4/Makefile.am Normal file
View file

@ -0,0 +1,7 @@
EXTRA_DIST = \
$(srcdir)/sparkleshare/*.m4 \
$(srcdir)/shamrock/*.m4 \
$(srcdir)/shave/*.m4
MAINTAINERCLEANFILES = Makefile.in

View file

@ -0,0 +1,50 @@
AC_DEFUN([SHAMROCK_EXPAND_LIBDIR],
[
expanded_libdir=`(
case $prefix in
NONE) prefix=$ac_default_prefix ;;
*) ;;
esac
case $exec_prefix in
NONE) exec_prefix=$prefix ;;
*) ;;
esac
eval echo $libdir
)`
AC_SUBST(expanded_libdir)
])
AC_DEFUN([SHAMROCK_EXPAND_BINDIR],
[
expanded_bindir=`(
case $prefix in
NONE) prefix=$ac_default_prefix ;;
*) ;;
esac
case $exec_prefix in
NONE) exec_prefix=$prefix ;;
*) ;;
esac
eval echo $bindir
)`
AC_SUBST(expanded_bindir)
])
AC_DEFUN([SHAMROCK_EXPAND_DATADIR],
[
case $prefix in
NONE) prefix=$ac_default_prefix ;;
*) ;;
esac
case $exec_prefix in
NONE) exec_prefix=$prefix ;;
*) ;;
esac
expanded_datadir=`(eval echo $datadir)`
expanded_datadir=`(eval echo $expanded_datadir)`
AC_SUBST(expanded_datadir)
])

View file

@ -0,0 +1,6 @@
AC_DEFUN([SHAMROCK_CHECK_GNOME_DOC_UTILS],
[
GNOME_DOC_INIT([$1], HAVE_GNOME_DOC_UTILS=yes, HAVE_GNOME_DOC_UTILS=no)
AM_CONDITIONAL(ENABLE_GNOME_DOCS, test "x$HAVE_GNOME_DOC_UTILS" = "xyes")
])

10
build/m4/shamrock/i18n.m4 Normal file
View file

@ -0,0 +1,10 @@
AC_DEFUN([SHAMROCK_CONFIGURE_I18N],
[
ALL_LINGUAS=`grep -v '^#' $srcdir/po/LINGUAS | $SED ':a;N;$!ba;s/\n/ /g; s/[ ]+/ /g' | xargs`
GETTEXT_PACKAGE=$1
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Gettext Package])
AM_GLIB_GNU_GETTEXT
AC_SUBST([CONFIG_STATUS_DEPENDENCIES],['$(top_srcdir)/po/LINGUAS'])
])

94
build/m4/shamrock/mono.m4 Normal file
View file

@ -0,0 +1,94 @@
AC_DEFUN([SHAMROCK_FIND_MONO_1_0_COMPILER],
[
SHAMROCK_FIND_PROGRAM_OR_BAIL(MCS, mcs)
])
AC_DEFUN([SHAMROCK_FIND_MONO_2_0_COMPILER],
[
SHAMROCK_FIND_PROGRAM_OR_BAIL(MCS, gmcs)
])
AC_DEFUN([SHAMROCK_FIND_MONO_4_0_COMPILER],
[
SHAMROCK_FIND_PROGRAM_OR_BAIL(MCS, dmcs)
])
AC_DEFUN([SHAMROCK_FIND_MONO_RUNTIME],
[
SHAMROCK_FIND_PROGRAM_OR_BAIL(MONO, mono)
])
AC_DEFUN([_SHAMROCK_CHECK_MONO_MODULE],
[
PKG_CHECK_MODULES(MONO_MODULE, $1 >= $2)
])
AC_DEFUN([SHAMROCK_CHECK_MONO_MODULE],
[
_SHAMROCK_CHECK_MONO_MODULE(mono, $1)
])
AC_DEFUN([SHAMROCK_CHECK_MONO2_MODULE],
[
_SHAMROCK_CHECK_MONO_MODULE(mono-2, $1)
])
AC_DEFUN([_SHAMROCK_CHECK_MONO_MODULE_NOBAIL],
[
PKG_CHECK_MODULES(MONO_MODULE, $2 >= $1,
HAVE_MONO_MODULE=yes, HAVE_MONO_MODULE=no)
AC_SUBST(HAVE_MONO_MODULE)
])
AC_DEFUN([SHAMROCK_CHECK_MONO_MODULE_NOBAIL],
[
_SHAMROCK_CHECK_MONO_MODULE_NOBAIL(mono, $1)
])
AC_DEFUN([SHAMROCK_CHECK_MONO2_MODULE_NOBAIL],
[
_SHAMROCK_CHECK_MONO_MODULE_NOBAIL(mono-2, $1)
])
AC_DEFUN([_SHAMROCK_CHECK_MONO_GAC_ASSEMBLIES],
[
for asm in $(echo "$*" | cut -d, -f3- | sed 's/\,/ /g')
do
AC_MSG_CHECKING([for Mono $2 GAC for $asm.dll])
if test \
-e "$($PKG_CONFIG --variable=libdir $1)/mono/$2/$asm.dll" -o \
-e "$($PKG_CONFIG --variable=prefix $1)/lib/mono/$2/$asm.dll"; \
then \
AC_MSG_RESULT([found])
else
AC_MSG_RESULT([not found])
AC_MSG_ERROR([missing required Mono $2 assembly: $asm.dll])
fi
done
])
AC_DEFUN([SHAMROCK_CHECK_MONO_1_0_GAC_ASSEMBLIES],
[
_SHAMROCK_CHECK_MONO_GAC_ASSEMBLIES(mono, 1.0, $*)
])
AC_DEFUN([SHAMROCK_CHECK_MONO_2_0_GAC_ASSEMBLIES],
[
_SHAMROCK_CHECK_MONO_GAC_ASSEMBLIES(mono, 2.0, $*)
])
AC_DEFUN([SHAMROCK_CHECK_MONO2_2_0_GAC_ASSEMBLIES],
[
_SHAMROCK_CHECK_MONO_GAC_ASSEMBLIES(mono-2, 2.0, $*)
])
AC_DEFUN([SHAMROCK_CHECK_MONO_4_0_GAC_ASSEMBLIES],
[
_SHAMROCK_CHECK_MONO_GAC_ASSEMBLIES(mono, 4.0, $*)
])
AC_DEFUN([SHAMROCK_CHECK_MONO2_4_0_GAC_ASSEMBLIES],
[
_SHAMROCK_CHECK_MONO_GAC_ASSEMBLIES(mono-2, 4.0, $*)
])

View file

@ -0,0 +1,25 @@
AC_DEFUN([SHAMROCK_CHECK_MONODOC],
[
AC_ARG_ENABLE(docs, AC_HELP_STRING([--disable-docs],
[Do not build documentation]), , enable_docs=yes)
if test "x$enable_docs" = "xyes"; then
AC_PATH_PROG(MONODOCER, monodocer, no)
if test "x$MONODOCER" = "xno"; then
AC_MSG_ERROR([You need to install monodoc, or pass --disable-docs to configure to skip documentation installation])
fi
AC_PATH_PROG(MDASSEMBLER, mdassembler, no)
if test "x$MDASSEMBLER" = "xno"; then
AC_MSG_ERROR([You need to install mdassembler, or pass --disable-docs to configure to skip documentation installation])
fi
DOCDIR=`$PKG_CONFIG monodoc --variable=sourcesdir`
AC_SUBST(DOCDIR)
AM_CONDITIONAL(BUILD_DOCS, true)
else
AC_MSG_NOTICE([not building ${PACKAGE} API documentation])
AM_CONDITIONAL(BUILD_DOCS, false)
fi
])

View file

@ -0,0 +1,29 @@
AC_DEFUN([SHAMROCK_CHECK_NUNIT],
[
NUNIT_REQUIRED=2.4.7
AC_ARG_ENABLE(tests, AC_HELP_STRING([--enable-tests], [Enable NUnit tests]),
enable_tests=$enableval, enable_tests="no")
if test "x$enable_tests" = "xno"; then
do_tests=no
AM_CONDITIONAL(ENABLE_TESTS, false)
else
PKG_CHECK_MODULES(NUNIT, nunit >= $NUNIT_REQUIRED,
do_tests="yes", do_tests="no")
AC_SUBST(NUNIT_LIBS)
AM_CONDITIONAL(ENABLE_TESTS, test "x$do_tests" = "xyes")
if test "x$do_tests" = "xno"; then
PKG_CHECK_MODULES(NUNIT, mono-nunit >= 2.4,
do_tests="yes", do_tests="no")
AC_SUBST(NUNIT_LIBS)
AM_CONDITIONAL(ENABLE_TESTS, test "x$do_tests" = "xyes")
if test "x$do_tests" = "xno"; then
AC_MSG_WARN([Could not find nunit: tests will not be available]) fi
fi
fi
])

View file

@ -0,0 +1,15 @@
AC_DEFUN([SHAMROCK_FIND_PROGRAM],
[
AC_PATH_PROG($1, $2, $3)
AC_SUBST($1)
])
AC_DEFUN([SHAMROCK_FIND_PROGRAM_OR_BAIL],
[
SHAMROCK_FIND_PROGRAM($1, $2, no)
if test "x$$1" = "xno"; then
AC_MSG_ERROR([You need to install '$2'])
fi
])

11
build/m4/shamrock/util.m4 Normal file
View file

@ -0,0 +1,11 @@
AC_DEFUN([SHAMROCK_CONCAT],
[
$1="$$1 $$2"
])
AC_DEFUN([SHAMROCK_CONCAT_MODULE],
[
SHAMROCK_CONCAT($1_CFLAGS, $2_CFLAGS)
SHAMROCK_CONCAT($1_LIBS, $2_LIBS)
])

View file

@ -0,0 +1,109 @@
#!/bin/sh
#
# Copyright (c) 2009, Damien Lespiau <damien.lespiau@gmail.com>
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation
# files (the "Software"), to deal in the Software without
# restriction, including without limitation the rights to use,
# copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following
# conditions:
#
# The above copyright notice and this permission notice shall be
# included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
# we need sed
SED=@SED@
if test -z "$SED" ; then
SED=sed
fi
lt_unmangle ()
{
last_result=`echo $1 | $SED -e 's#.libs/##' -e 's#[0-9a-zA-Z_\-\.]*_la-##'`
}
# the real libtool to use
LIBTOOL="$1"
shift
# if 1, don't print anything, the underlaying wrapper will do it
pass_though=0
# scan the arguments, keep the right ones for libtool, and discover the mode
preserved_args=
# have we seen the --tag option of libtool in the command line ?
tag_seen=0
while test "$#" -gt 0; do
opt="$1"
shift
case $opt in
--mode=*)
mode=`echo $opt | $SED -e 's/[-_a-zA-Z0-9]*=//'`
preserved_args="$preserved_args $opt"
;;
-o)
lt_output="$1"
preserved_args="$preserved_args $opt"
;;
--tag=*)
tag_seen=1
preserved_args="$preserved_args $opt"
;;
*)
preserved_args="$preserved_args $opt"
;;
esac
done
case "$mode" in
compile)
# shave will be called and print the actual CC/CXX/LINK line
preserved_args="$preserved_args --shave-mode=$mode"
pass_though=1
;;
link)
preserved_args="$preserved_args --shave-mode=$mode"
Q=" LINK "
;;
*)
# let's u
# echo "*** libtool: Unimplemented mode: $mode, fill a bug report"
;;
esac
lt_unmangle "$lt_output"
output=$last_result
# automake does not add a --tag switch to its libtool invocation when
# assembling a .s file and rely on libtool to infer the right action based
# on the compiler name. As shave is using CC to hook a wrapper, libtool gets
# confused. Let's detect these cases and add a --tag=CC option.
tag=""
if test $tag_seen -eq 0 -a x"$mode" = xcompile; then
tag="--tag=CC"
fi
if test -z $V; then
if test $pass_though -eq 0; then
echo "$Q$output"
fi
$LIBTOOL --silent $tag $preserved_args
else
echo $LIBTOOL $tag $preserved_args
$LIBTOOL $tag $preserved_args
fi

109
build/m4/shave/shave.in Normal file
View file

@ -0,0 +1,109 @@
#!/bin/sh
#
# Copyright (c) 2009, Damien Lespiau <damien.lespiau@gmail.com>
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation
# files (the "Software"), to deal in the Software without
# restriction, including without limitation the rights to use,
# copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following
# conditions:
#
# The above copyright notice and this permission notice shall be
# included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
# we need sed
SED=@SED@
if test -z "$SED" ; then
SED=sed
fi
lt_unmangle ()
{
last_result=`echo $1 | $SED -e 's#.libs/##' -e 's#[0-9a-zA-Z_\-\.]*_la-##'`
}
# the tool to wrap (cc, cxx, ar, ranlib, ..)
tool="$1"
shift
# the reel tool (to call)
REEL_TOOL="$1"
shift
pass_through=0
preserved_args=
while test "$#" -gt 0; do
opt="$1"
shift
case $opt in
--shave-mode=*)
mode=`echo $opt | $SED -e 's/[-_a-zA-Z0-9]*=//'`
;;
-o)
lt_output="$1"
preserved_args="$preserved_args $opt"
;;
-out:*|/out:*)
lt_output="${opt#*:}"
preserved_args="$preserved_args $opt"
;;
*)
preserved_args="$preserved_args $opt"
;;
esac
done
# mode=link is handled in the libtool wrapper
case "$mode,$tool" in
link,*)
pass_through=1
;;
*,cxx)
Q=" CXX "
;;
*,cc)
Q=" CC "
;;
*,fc)
Q=" FC "
;;
*,f77)
Q=" F77 "
;;
*,objc)
Q=" OBJC "
;;
*,mcs)
Q=" MCS "
;;
*,*)
# should not happen
Q=" CC "
;;
esac
lt_unmangle "$lt_output"
output=$last_result
if test -z $V; then
if test $pass_through -eq 0; then
echo "$Q$output"
fi
$REEL_TOOL $preserved_args
else
echo $REEL_TOOL $preserved_args
$REEL_TOOL $preserved_args
fi

102
build/m4/shave/shave.m4 Normal file
View file

@ -0,0 +1,102 @@
dnl Make automake/libtool output more friendly to humans
dnl
dnl Copyright (c) 2009, Damien Lespiau <damien.lespiau@gmail.com>
dnl
dnl Permission is hereby granted, free of charge, to any person
dnl obtaining a copy of this software and associated documentation
dnl files (the "Software"), to deal in the Software without
dnl restriction, including without limitation the rights to use,
dnl copy, modify, merge, publish, distribute, sublicense, and/or sell
dnl copies of the Software, and to permit persons to whom the
dnl Software is furnished to do so, subject to the following
dnl conditions:
dnl
dnl The above copyright notice and this permission notice shall be
dnl included in all copies or substantial portions of the Software.
dnl
dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
dnl EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
dnl OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
dnl NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
dnl HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
dnl WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
dnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
dnl OTHER DEALINGS IN THE SOFTWARE.
dnl
dnl SHAVE_INIT([shavedir],[default_mode])
dnl
dnl shavedir: the directory where the shave scripts are, it defaults to
dnl $(top_builddir)
dnl default_mode: (enable|disable) default shave mode. This parameter
dnl controls shave's behaviour when no option has been
dnl given to configure. It defaults to disable.
dnl
dnl * SHAVE_INIT should be called late in your configure.(ac|in) file (just
dnl before AC_CONFIG_FILE/AC_OUTPUT is perfect. This macro rewrites CC and
dnl LIBTOOL, you don't want the configure tests to have these variables
dnl re-defined.
dnl * This macro requires GNU make's -s option.
AC_DEFUN([_SHAVE_ARG_ENABLE],
[
AC_ARG_ENABLE([shave],
AS_HELP_STRING(
[--enable-shave],
[use shave to make the build pretty [[default=$1]]]),,
[enable_shave=$1]
)
])
AC_DEFUN([SHAVE_INIT],
[
dnl you can tweak the default value of enable_shave
m4_if([$2], [enable], [_SHAVE_ARG_ENABLE(yes)], [_SHAVE_ARG_ENABLE(no)])
if test x"$enable_shave" = xyes; then
dnl where can we find the shave scripts?
m4_if([$1],,
[shavedir="$ac_pwd"],
[shavedir="$ac_pwd/$1"])
AC_SUBST(shavedir)
dnl make is now quiet
AC_SUBST([MAKEFLAGS], [-s])
AC_SUBST([AM_MAKEFLAGS], ['`test -z $V && echo -s`'])
dnl we need sed
AC_CHECK_PROG(SED,sed,sed,false)
dnl substitute libtool
SHAVE_SAVED_LIBTOOL=$LIBTOOL
LIBTOOL="${SHELL} ${shavedir}/shave-libtool '${SHAVE_SAVED_LIBTOOL}'"
AC_SUBST(LIBTOOL)
dnl substitute cc/cxx
SHAVE_SAVED_CC=$CC
SHAVE_SAVED_CXX=$CXX
SHAVE_SAVED_FC=$FC
SHAVE_SAVED_F77=$F77
SHAVE_SAVED_OBJC=$OBJC
SHAVE_SAVED_MCS=$MCS
CC="${SHELL} ${shavedir}/shave cc ${SHAVE_SAVED_CC}"
CXX="${SHELL} ${shavedir}/shave cxx ${SHAVE_SAVED_CXX}"
FC="${SHELL} ${shavedir}/shave fc ${SHAVE_SAVED_FC}"
F77="${SHELL} ${shavedir}/shave f77 ${SHAVE_SAVED_F77}"
OBJC="${SHELL} ${shavedir}/shave objc ${SHAVE_SAVED_OBJC}"
MCS="${SHELL} ${shavedir}/shave mcs ${SHAVE_SAVED_MCS}"
AC_SUBST(CC)
AC_SUBST(CXX)
AC_SUBST(FC)
AC_SUBST(F77)
AC_SUBST(OBJC)
AC_SUBST(MCS)
V=@
else
V=1
fi
Q='$(V:1=)'
AC_SUBST(V)
AC_SUBST(Q)
])

View file

@ -0,0 +1,23 @@
AC_DEFUN([SPARKLESHARE_CHECK_GTK_SHARP],
[
GTKSHARP_REQUIRED=2.12.2
PKG_CHECK_MODULES(GTKSHARP,
gtk-sharp-2.0 >= $GTKSHARP_REQUIRED)
AC_SUBST(GTKSHARP_LIBS)
PKG_CHECK_MODULES(GLIBSHARP,
glib-sharp-2.0 >= $GTKSHARP_REQUIRED)
AC_SUBST(GLIBSHARP_LIBS)
PKG_CHECK_MODULES(GLIBSHARP_2_12_7,
glib-sharp-2.0 >= 2.12.7,
HAVE_GLIBSHARP_2_12_7=yes,
HAVE_GLIBSHARP_2_12_7=no)
AM_CONDITIONAL(HAVE_GLIBSHARP_2_12_7, [test "$HAVE_GLIBSHARP_2_12_7" = "yes"])
PKG_CHECK_MODULES(GTKSHARP_A11Y, gtk-sharp-2.0 >= 2.12.10, gtksharp_with_a11y=yes, gtksharp_with_a11y=no)
AM_CONDITIONAL(ENABLE_ATK, test "x$gtksharp_with_a11y" = "xyes")
])

View file

@ -0,0 +1,12 @@
AC_DEFUN([FSPOT_CHECK_MONO_ADDINS],
[
PKG_CHECK_MODULES(MONO_ADDINS, mono-addins >= 0.3.1)
AC_SUBST(MONO_ADDINS_LIBS)
PKG_CHECK_MODULES(MONO_ADDINS_SETUP, mono-addins-setup >= 0.3.1)
AC_SUBST(MONO_ADDINS_SETUP_LIBS)
PKG_CHECK_MODULES(MONO_ADDINS_GUI, mono-addins-gui >= 0.3.1)
AC_SUBST(MONO_ADDINS_GUI_LIBS)
])

View file

@ -0,0 +1,12 @@
AC_DEFUN([SPARKLESHARE_CHECK_NOTIFY_SHARP],
[
PKG_CHECK_MODULES(NOTIFY_SHARP, notify-sharp, have_notify_sharp=yes, have_notify_sharp=no)
if test "x$have_notify_sharp" = "xyes"; then
AC_SUBST(NOTIFY_SHARP_LIBS)
AM_CONDITIONAL(EXTERNAL_NOTIFY_SHARP, true)
else
AM_CONDITIONAL(EXTERNAL_NOTIFY_SHARP, false)
AC_MSG_RESULT([no])
fi
])

96
configure.ac Normal file
View file

@ -0,0 +1,96 @@
dnl Warning: This is an automatically generated file, do not edit!
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ([2.54])
AC_INIT([SparkleShare], [0.1])
AM_INIT_AUTOMAKE([1.11 dist-bzip2 dist-zip foreign])
AM_MAINTAINER_MODE
dnl pkg-config
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
if test "x$PKG_CONFIG" = "xno"; then
AC_MSG_ERROR([You need to install pkg-config])
fi
AC_SUBST([ACLOCAL_AMFLAGS], ["-I build/m4/sparkleshare -I build/m4/shamrock -I build/m4/shave \${ACLOCAL_FLAGS}"])
dnl i18n
IT_PROG_INTLTOOL([0.40.6])
GETTEXT_PACKAGE=sparkleshare
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package])
SHAMROCK_EXPAND_LIBDIR
SHAMROCK_EXPAND_BINDIR
SHAMROCK_EXPAND_DATADIR
AC_PROG_INSTALL
AC_PATH_PROG(GMCS, gmcs, no)
if test "x$GMCS" = "xno"; then
AC_MSG_ERROR([gmcs Not found])
fi
AC_ARG_ENABLE(debug,
AC_HELP_STRING([--enable-debug],
[Use 'DEBUG' Configuration [default=YES]]),
enable_debug=yes, enable_debug=no)
AM_CONDITIONAL(ENABLE_DEBUG, test x$enable_debug = xyes)
if test "x$enable_debug" = "xyes" ; then
CONFIG_REQUESTED="yes"
fi
AC_ARG_ENABLE(release,
AC_HELP_STRING([--enable-release],
[Use 'RELEASE' Configuration [default=NO]]),
enable_release=yes, enable_release=no)
AM_CONDITIONAL(ENABLE_RELEASE, test x$enable_release = xyes)
if test "x$enable_release" = "xyes" ; then
CONFIG_REQUESTED="yes"
fi
if test -z "$CONFIG_REQUESTED" ; then
AM_CONDITIONAL(ENABLE_DEBUG, true)
enable_debug=yes
fi
dnl package checks, common for all configs
PKG_CHECK_MODULES([NDESK_DBUS], [ndesk-dbus-1.0])
AC_SUBST(NDESK_DBUS_LIBS)
PKG_CHECK_MODULES([NDESK_DBUS_GLIB], [ndesk-dbus-glib-1.0])
AC_SUBST(NDESK_DBUS_GLIB_LIBS)
SPARKLESHARE_CHECK_GTK_SHARP
#SPARKLESHARE_CHECK_NOTIFY_SHARP
SHAMROCK_CHECK_NUNIT
dnl Mono and gmcs
SHAMROCK_CHECK_MONO_MODULE(2.2)
SHAMROCK_FIND_MONO_2_0_COMPILER
SHAMROCK_FIND_MONO_RUNTIME
SHAMROCK_CHECK_MONO_2_0_GAC_ASSEMBLIES([
System
System.Security
Mono.Posix
])
SHAVE_INIT([build/m4/shave], [enable])
AC_OUTPUT([
build/Makefile
build/m4/Makefile
build/m4/shave/shave
build/m4/shave/shave-libtool
data/Makefile
data/icons/Makefile
notify-sharp/Makefile
SparkleShare/sparkleshare
SparkleShare/Defines.cs
SparkleShare/AssemblyInfo.cs
SparkleShare/Makefile
po/Makefile.in
Makefile
])

9
data/Makefile.am Normal file
View file

@ -0,0 +1,9 @@
SUBDIRS = \
icons
EXTRA_DIST = \
sparkleshare.svg
MAINTAINERCLEANFILES = \
Makefile.in

61
data/icons/Makefile.am Normal file
View file

@ -0,0 +1,61 @@
theme = hicolor
themedir = $(pkgdatadir)/icons/$(theme)
hicolordir = $(DESTDIR)$(datadir)/icons/hicolor
theme_icons = \
animations,process-syncing-sparkleshare-24.png \
animations,process-working-48.png \
emblems,emblem-synced-22.png \
emblems,emblem-synced-24.png \
emblems,emblem-sync-error-22.png \
emblems,emblem-sync-error-24.png \
emblems,emblem-syncing-22.png \
emblems,emblem-syncing-24.png \
places,fedorahosted-16.png \
places,folder-16.png \
places,folder-22.png \
places,folder-24.png \
places,folder-256.png \
places,folder-32.png \
places,folder-48.png \
places,folder-sparkleshare-16.png \
places,folder-sparkleshare-22.png \
places,folder-sparkleshare-24.png \
places,folder-sparkleshare-256.png \
places,folder-sparkleshare-32.png \
places,folder-sparkleshare-48.png \
places,github-16.png \
places,gitorious-16.png \
places,gnome-16.png \
status,avatar-default-16.png \
status,avatar-default-22.png \
status,avatar-default-24.png \
status,avatar-default-32.png \
status,avatar-default-48.png \
status,document-added-16.png \
status,document-edited-16.png \
status,document-moved-16.png \
status,document-removed-16.png \
status,folder-synced-22.png \
status,folder-synced-24.png \
status,folder-sync-error-22.png \
status,folder-sync-error-24.png \
status,folder-syncing-22.png \
status,folder-syncing-24.png
install_icon_exec = $(top_srcdir)/icon-theme-installer \
-t "$(theme)" \
-s "$(srcdir)" \
-d "x$(DESTDIR)" \
-b "$(themedir)" \
-m "$(mkinstalldirs)" \
-x "$(INSTALL_DATA)"
install-data-local:
@-$(install_icon_exec) -i $(theme_icons)
uninstall-hook:
@-$(install_icon_exec) -u $(theme_icons)
MAINTAINERCLEANFILES = Makefile.in
EXTRA_DIST = $(wildcard *.png *.svg)

View file

Before

Width:  |  Height:  |  Size: 846 B

After

Width:  |  Height:  |  Size: 846 B

View file

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View file

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View file

Before

Width:  |  Height:  |  Size: 2 KiB

After

Width:  |  Height:  |  Size: 2 KiB

View file

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

View file

Before

Width:  |  Height:  |  Size: 487 B

After

Width:  |  Height:  |  Size: 487 B

View file

Before

Width:  |  Height:  |  Size: 610 B

After

Width:  |  Height:  |  Size: 610 B

View file

Before

Width:  |  Height:  |  Size: 589 B

After

Width:  |  Height:  |  Size: 589 B

View file

Before

Width:  |  Height:  |  Size: 318 B

After

Width:  |  Height:  |  Size: 318 B

View file

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View file

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View file

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View file

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View file

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View file

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View file

Before

Width:  |  Height:  |  Size: 747 B

After

Width:  |  Height:  |  Size: 747 B

View file

Before

Width:  |  Height:  |  Size: 658 B

After

Width:  |  Height:  |  Size: 658 B

View file

Before

Width:  |  Height:  |  Size: 873 B

After

Width:  |  Height:  |  Size: 873 B

View file

Before

Width:  |  Height:  |  Size: 920 B

After

Width:  |  Height:  |  Size: 920 B

View file

Before

Width:  |  Height:  |  Size: 46 KiB

After

Width:  |  Height:  |  Size: 46 KiB

View file

Before

Width:  |  Height:  |  Size: 1 KiB

After

Width:  |  Height:  |  Size: 1 KiB

View file

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View file

Before

Width:  |  Height:  |  Size: 766 B

After

Width:  |  Height:  |  Size: 766 B

View file

Before

Width:  |  Height:  |  Size: 1,004 B

After

Width:  |  Height:  |  Size: 1,004 B

View file

Before

Width:  |  Height:  |  Size: 1 KiB

After

Width:  |  Height:  |  Size: 1 KiB

View file

Before

Width:  |  Height:  |  Size: 52 KiB

After

Width:  |  Height:  |  Size: 52 KiB

View file

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View file

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

View file

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View file

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View file

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View file

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View file

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View file

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View file

Before

Width:  |  Height:  |  Size: 440 B

After

Width:  |  Height:  |  Size: 440 B

View file

Before

Width:  |  Height:  |  Size: 387 B

After

Width:  |  Height:  |  Size: 387 B

View file

Before

Width:  |  Height:  |  Size: 650 B

After

Width:  |  Height:  |  Size: 650 B

View file

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

View file

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

179
icon-theme-installer Executable file
View file

@ -0,0 +1,179 @@
#!/bin/bash
# icon-theme-installer
# Copyright (C) 2006 Novell, Inc.
# Written by Aaron Bockover <abock@gnome.org>
# Licensed under the MIT/X11 license
#
# This script is meant to be invoked from within a Makefile/Makefile.am
# in the install-data-local and uninstall-data sections. It handles the
# task of properly installing icons into the icon theme. It requires a
# few arguments to set up its environment, and a list of files to be
# installed. The format of the file list is critical:
#
# <category>,<local-src-file-name>
#
# apps,music-player-banshee.svg
# apps,music-player-banshee-16.png
# apps,music-player-banshee-22.png
#
# <category> is the icon theme category, for instance, apps, devices,
# actions, emblems...
#
# <local-src-file-name> must have a basename in the form of:
#
# proper-theme-name[-<SIZE>].<EXTENSION>
#
# Where <SIZE> should be either nothing, which will default to scalable
# or \-[0-9]{2}, which will expand to <SIZE>x<SIZE>. For example:
#
# music-player-banshee-16.png
#
# The <SIZE> here is -16 and will expand to 16x16 per the icon theme spec
#
# What follows is an example Makefile.am for icon theme installation:
#
# ---------------
# theme=hicolor
# themedir=$(datadir)/icons/$(theme)
# theme_icons = \
# apps,music-player-banshee.svg \
# apps,music-player-banshee-16.png \
# apps,music-player-banshee-22.png \
# apps,music-player-banshee-24.png \
# apps,music-player-banshee-32.png
#
# install_icon_exec = $(top_srcdir)/build/icon-theme-installer -t $(theme) -s $(srcdir) -d "x$(DESTDIR)" -b $(themedir) -m "$(mkinstalldirs)" -x "$(INSTALL_DATA)"
# install-data-local:
# $(install_icon_exec) -i $(theme_icons)
#
# uninstall-hook:
# $(install_icon_exec) -u $(theme_icons)
#
# MAINTAINERCLEANFILES = Makefile.in
# EXTRA_DIST = $(wildcard *.svg *.png)
# ---------------
#
# Arguments to this program:
#
# -i : Install
# -u : Uninstall
# -t <theme> : Theme name (hicolor)
# -b <dir> : Theme installation dest directory [x$(DESTDIR)] - Always prefix
# this argument with x; it will be stripped but will act as a
# placeholder for zero $DESTDIRs (only set by packagers)
# -d <dir> : Theme installation directory [$(hicolordir)]
# -s <dir> : Source directory [$(srcdir)]
# -m <exec> : Command to exec for directory creation [$(mkinstalldirs)]
# -x <exec> : Command to exec for single file installation [$(INSTALL_DATA)]
# <remainging> : All remainging should be category,filename pairs
while getopts "iut:b:d:s:m:x:" flag; do
case "$flag" in
i) INSTALL=yes ;;
u) UNINSTALL=yes ;;
t) THEME_NAME=$OPTARG ;;
d) INSTALL_DEST_DIR=${OPTARG##x} ;;
b) INSTALL_BASE_DIR=$OPTARG ;;
s) SRC_DIR=$OPTARG ;;
m) MKINSTALLDIRS_EXEC=$OPTARG ;;
x) INSTALL_DATA_EXEC=$OPTARG ;;
esac
done
shift $(($OPTIND - 1))
if test "x$INSTALL" = "xyes" -a "x$UNINSTALL" = "xyes"; then
echo "Cannot pass both -i and -u"
exit 1
elif test "x$INSTALL" = "x" -a "x$UNINSTALL" = "x"; then
echo "Must path either -i or -u"
exit 1
fi
if test -z "$THEME_NAME"; then
echo "Theme name required (-t hicolor)"
exit 1
fi
if test -z "$INSTALL_BASE_DIR"; then
echo "Base theme directory required [-d \$(hicolordir)]"
exit 1
fi
if test ! -x $(echo "$MKINSTALLDIRS_EXEC" | cut -f1 -d' '); then
echo "Cannot find '$MKINSTALLDIRS_EXEC'; You probably want to pass -m \$(mkinstalldirs)"
exit 1
fi
if test ! -x $(echo "$INSTALL_DATA_EXEC" | cut -f1 -d' '); then
echo "Cannot find '$INSTALL_DATA_EXEC'; You probably want to pass -x \$(INSTALL_DATA)"
exit 1
fi
if test -z "$SRC_DIR"; then
SRC_DIR=.
fi
for icon in $@; do
size=$(echo $icon | sed s/[^0-9]*//g)
category=$(echo $icon | cut -d, -f1)
build_name=$(echo $icon | cut -d, -f2)
install_name=$(echo $build_name | sed "s/[0-9]//g; s/-\././")
install_name=$(basename $install_name)
if test -z $size; then
size=scalable;
else
size=${size}x${size};
fi
install_dir=${INSTALL_DEST_DIR}${INSTALL_BASE_DIR}/$size/$category
install_path=$install_dir/$install_name
if test "x$INSTALL" = "xyes"; then
echo "Installing $size $install_name into $THEME_NAME icon theme"
$($MKINSTALLDIRS_EXEC $install_dir) || {
echo "Failed to create directory $install_dir"
exit 1
}
$($INSTALL_DATA_EXEC $SRC_DIR/$build_name $install_path) || {
echo "Failed to install $SRC_DIR/$build_name into $install_path"
exit 1
}
if test ! -e $install_path; then
echo "Failed to install $SRC_DIR/$build_name into $install_path"
exit 1
fi
else
if test -e $install_path; then
echo "Removing $size $install_name from $THEME_NAME icon theme"
rm $install_path || {
echo "Failed to remove $install_path"
exit 1
}
fi
fi
done
if test "x$INSTALL" = "xyes"; then
gtk_update_icon_cache_bin="$((which gtk-update-icon-cache || echo /opt/gnome/bin/gtk-update-icon-cache)2>/dev/null)"
gtk_update_icon_cache="$gtk_update_icon_cache_bin -f -t $INSTALL_BASE_DIR"
if test -z "$INSTALL_DEST_DIR"; then
if test -x $gtk_update_icon_cache_bin; then
echo "Updating GTK icon cache"
$gtk_update_icon_cache
else
echo "*** Icon cache not updated. Could not execute $gtk_update_icon_cache_bin"
fi
else
echo "*** Icon cache not updated. After install, run this:"
echo "*** $gtk_update_icon_cache"
fi
fi

13
notify-sharp/Makefile.am Normal file
View file

@ -0,0 +1,13 @@
ASSEMBLY = NotifySharp
TARGET = library
LINK = $(REF_NOTIFY_SHARP)
SOURCES = \
Global.cs \
Notification.cs
RESOURCES =
include $(top_srcdir)/build/build.mk

4
po/LINGUAS Normal file
View file

@ -0,0 +1,4 @@
es
nl
pl

15
po/POTFILES.in Normal file
View file

@ -0,0 +1,15 @@
# List of source files containing translatable strings.
# Please keep this file in alphabetical order; run ./sort-potfiles
# after adding files here.
[encoding: UTF-8]
SparkleShare/SparkleBubble.cs
SparkleShare/SparkleDialog.cs
SparkleShare/SparkleHelpers.cs
SparkleShare/SparklePaths.cs
SparkleShare/SparklePlatform.cs
SparkleShare/SparkleRepo.cs
SparkleShare/SparkleShare.cs
SparkleShare/SparkleSpinner.cs
SparkleShare/SparkleStatusIcon.cs
SparkleShare/SparkleUI.cs
SparkleShare/SparkleWindow.cs

6
po/sort-potfiles Executable file
View file

@ -0,0 +1,6 @@
#!/bin/bash
head -n 4 < POTFILES.in > POTFILES.in.tmp
grep -v "^[\\[#]" < POTFILES.in | sort >> POTFILES.in.tmp
mv POTFILES.in.tmp POTFILES.in