Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37715153
en ru br
Репозитории ALT
S:3.00-alt2.1
5.1: 2.04-alt0.M51.1
4.1: 1.61-alt0.M41.1
4.0: 2.12-alt0.M40.1
www.altlinux.org/Changes

Группа :: Сети/Передача файлов
Пакет: transmission

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

Патч: transmission-2.04-alt0.M51.1.patch
Скачать


 .gear/rules                                        |    4 +
 .../tags/955decc445d437c185a5a61e4102962021a5c9ec  |   13 +
 .gear/tags/list                                    |    1 +
 configure.ac                                       |    2 +-
 qt/app.cc                                          |   14 +-
 qt/custom-icon-select.cc                           |  137 +++++++
 qt/custom-icon-select.h                            |   37 ++
 qt/mainwin.cc                                      |   52 +++-
 qt/mainwin.h                                       |    6 +-
 qt/prefs.cc                                        |    6 +
 qt/prefs.h                                         |    1 +
 qt/qtr.pro                                         |    3 +-
 qt/session-dialog.cc                               |    9 +
 qt/session-dialog.h                                |    5 +
 transmission-daemon.init                           |   77 ++++
 transmission-daemon.logrotate                      |    7 +
 transmission.spec                                  |  382 ++++++++++++++++++++
 17 files changed, 741 insertions(+), 15 deletions(-)
diff --git a/.gear/rules b/.gear/rules
new file mode 100644
index 0000000..0dfa748
--- /dev/null
+++ b/.gear/rules
@@ -0,0 +1,4 @@
+tar: v@version@:. name=transmission-@version@
+diff: v@version@:.	.
+copy: *.init
+copy: *.logrotate
diff --git a/.gear/tags/955decc445d437c185a5a61e4102962021a5c9ec b/.gear/tags/955decc445d437c185a5a61e4102962021a5c9ec
new file mode 100644
index 0000000..80ae223
--- /dev/null
+++ b/.gear/tags/955decc445d437c185a5a61e4102962021a5c9ec
@@ -0,0 +1,13 @@
+object d04dda1aa2c02cf148442b1ca375b4c028d740a9
+type commit
+tag v2.04
+tagger Anton Farygin <rider@altlinux.com> 1284473643 +0400
+
+2.04
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v2.0.16 (GNU/Linux)
+
+iEYEABECAAYFAkyPgy4ACgkQqohfd2vlwKu0mgCbBAOrW34BAKkFbQtpXInedKWh
+5foAnA/qbZy70/8Snjo+5DZvUf60BlNG
+=uYnN
+-----END PGP SIGNATURE-----
diff --git a/.gear/tags/list b/.gear/tags/list
new file mode 100644
index 0000000..4ce3132
--- /dev/null
+++ b/.gear/tags/list
@@ -0,0 +1 @@
+955decc445d437c185a5a61e4102962021a5c9ec v2.04
diff --git a/configure.ac b/configure.ac
index eb15991..3982cce 100644
--- a/configure.ac
+++ b/configure.ac
@@ -382,7 +382,7 @@ dnl it should be safe to re-edit 0.40 back down to 0.23
 use_nls=no
 if test "x$enable_nls" = "xyes" ; then
     use_nls=yes
-    IT_PROG_INTLTOOL([0.35.0],[no-xml])
+IT_PROG_INTLTOOL([0.35.0],[no-xml])
     AC_CHECK_HEADERS([libintl.h])
     GETTEXT_PACKAGE=transmission
     AC_SUBST(GETTEXT_PACKAGE)
diff --git a/qt/app.cc b/qt/app.cc
index 5399dd1..6ca2f21 100644
--- a/qt/app.cc
+++ b/qt/app.cc
@@ -94,18 +94,9 @@ MyApp :: MyApp( int& argc, char ** argv ):
 
     // install the transmission translator
     t = new QTranslator( );
-    t->load( QString(MY_NAME) + "_" + QLocale::system().name() );
+    t->load( QString(MY_NAME) + "_" + QLocale::system().name(), QLibraryInfo::location(QLibraryInfo::TranslationsPath) );
     installTranslator( t );
 
-    // set the default icon
-    QIcon icon;
-    icon.addPixmap( QPixmap( ":/icons/transmission-16.png" ) );
-    icon.addPixmap( QPixmap( ":/icons/transmission-22.png" ) );
-    icon.addPixmap( QPixmap( ":/icons/transmission-24.png" ) );
-    icon.addPixmap( QPixmap( ":/icons/transmission-32.png" ) );
-    icon.addPixmap( QPixmap( ":/icons/transmission-48.png" ) );
-    setWindowIcon( icon );
-
     // parse the command-line arguments
     int c;
     bool minimized = false;
@@ -228,6 +219,9 @@ MyApp :: MyApp( int& argc, char ** argv ):
 
     for( QStringList::const_iterator it=filenames.begin(), end=filenames.end(); it!=end; ++it )
         addTorrent( *it );
+    // set window and system tray icon
+    myWindow->applyCustomSessionLook();
+
 
     // register as the dbus handler for Transmission
     new TrDBusAdaptor( this );
diff --git a/qt/custom-icon-select.cc b/qt/custom-icon-select.cc
new file mode 100644
index 0000000..0711887
--- /dev/null
+++ b/qt/custom-icon-select.cc
@@ -0,0 +1,137 @@
+#include <QHBoxLayout>
+#include <QFileDialog>
+#include <QPushButton>
+#include <QApplication>
+#include <QStyle>
+#include <QPainter>
+#include <QImageReader>
+
+#include "qticonloader.h"
+#include "custom-icon-select.h"
+
+CustomIconSelect::CustomIconSelect(const QList<int> &icon_sizes, const QString &pix_path,  const QString &local_data_path, QWidget *parent):
+    QWidget(parent)
+{
+    sizes = icon_sizes;
+    orig_path = pix_path;
+    custom_path = local_data_path;
+
+    QHBoxLayout *l = new QHBoxLayout(this);
+
+    min_size = 64;
+    max_size = 16;
+    foreach(int size, sizes)
+    {
+	QPixmap pix((custom_path+"/transmission-%1.png").arg(size));
+	if( pix.isNull() )
+	    pix.load((orig_path+"/transmission-%1.png").arg(size));
+	if( pix.isNull() )
+	    continue;
+	if( size <= min_size )
+	{
+	    min_size = size;
+	    pix_min = pix;
+	}
+	if( size >= max_size && size <= 64 )
+	{
+	    max_size = size;
+	    pix_max = pix;
+	}
+    }
+
+    pix_min_lbl = new QLabel(this);
+    pix_min_lbl->setPixmap(pix_min);
+    pix_max_lbl = new QLabel(this);
+    pix_max_lbl->setPixmap(pix_max);
+    l->addWidget(pix_min_lbl);
+    l->addWidget(pix_max_lbl);
+
+    QPushButton *filebtn = new QPushButton(tr("Customize"), this);
+    filebtn->setIcon(QtIconLoader::icon("open-folder", QApplication::style()->standardPixmap(QStyle::SP_DirOpenIcon)));
+    l->addWidget(filebtn);
+    connect(filebtn, SIGNAL(clicked()), this, SLOT(selectPixmap()));
+
+    QPushButton *clearbtn = new QPushButton(tr("Reset"), this);
+    clearbtn->setIcon(QtIconLoader::icon("edit-clear", QApplication::style()->standardPixmap(QStyle::SP_DialogCloseButton)));
+    l->addWidget(clearbtn);
+    connect(clearbtn, SIGNAL(clicked()), this, SLOT(clearPixmap()));
+}
+
+CustomIconSelect::~CustomIconSelect()
+{}
+
+void CustomIconSelect::pixmapSelected(const QString &path)
+{
+    QPixmap pxmin((orig_path+"/transmission-%1.png").arg(min_size));
+    QPixmap pxmax((orig_path+"/transmission-%1.png").arg(max_size));
+    QFileInfo finfo(path);
+    if( finfo.exists() && finfo.isFile() && finfo.isReadable() )
+    {
+	QPixmap overlay(path);
+	applyPixmap(pxmin, overlay);
+	applyPixmap(pxmax, overlay);
+	overlay_path = path;
+    }
+    else
+	overlay_path.clear();
+    pix_min = pxmin;
+    pix_max = pxmax;
+    pix_min_lbl->setPixmap(pix_min);
+    pix_max_lbl->setPixmap(pix_max);
+}
+
+void CustomIconSelect::selectPixmap()
+{
+    QString filter;
+    foreach(QByteArray format, QImageReader::supportedImageFormats())
+	filter.append(" *."+format.toLower());
+    QFileDialog dialog(this, tr("Select overlaying picture"), last_directory, tr("Images %1").arg("("+filter+")"));
+    dialog.setFileMode( QFileDialog::ExistingFile );
+    dialog.setAcceptMode( QFileDialog::AcceptOpen );
+    dialog.setOption( QFileDialog::ReadOnly, true );
+    connect(&dialog, SIGNAL(fileSelected(const QString&)), this, SLOT(pixmapSelected(const QString&)));
+    dialog.exec();
+    last_directory = dialog.directory().path();
+}
+
+void CustomIconSelect::clearPixmap()
+{
+    pixmapSelected("");
+}
+
+void CustomIconSelect::applyPixmap(QPixmap &pix, const QPixmap &overlay)
+{
+    QPixmap over(overlay);
+    if( over.width() > pix.width()/1.375 || over.height() > pix.height()/1.375 )
+	over = over.scaled(pix.size()/1.375, Qt::KeepAspectRatio, Qt::SmoothTransformation);
+    QPainter p(&pix);
+    p.drawPixmap(pix.width()-over.width(),
+	pix.height()-over.height(),
+	over);
+}
+
+void CustomIconSelect::save()
+{
+    QDir(custom_path).mkpath(custom_path);
+    foreach(int size, sizes)
+    {
+	QString orig_pix_path((orig_path+"/transmission-%1.png").arg(size));
+	QString custom_pix_path((custom_path+"/transmission-%1.png").arg(size));
+
+	QPixmap orig_pix(orig_pix_path);
+	QPixmap overlay_pix;
+	if( !overlay_path.isEmpty() )
+	    overlay_pix.load(overlay_path);
+	if( overlay_path.isEmpty() || orig_pix.isNull() || overlay_pix.isNull() )
+	{
+	    QFile custom_pix_file(custom_pix_path);
+	    if( custom_pix_file.exists() )
+		custom_pix_file.remove();
+	}
+	else
+	{
+	    applyPixmap(orig_pix, overlay_pix);
+	    orig_pix.save(custom_pix_path);
+	}
+    }
+}
diff --git a/qt/custom-icon-select.h b/qt/custom-icon-select.h
new file mode 100644
index 0000000..d0c37e4
--- /dev/null
+++ b/qt/custom-icon-select.h
@@ -0,0 +1,37 @@
+#ifndef CUSTOM_ICON_SELECT_H
+#define CUSTOM_ICON_SELECT_H
+
+#include <QLabel>
+
+class CustomIconSelect: public QWidget
+{
+Q_OBJECT
+public:
+    CustomIconSelect(const QList<int> &icon_sizes, const QString &pix_path,  const QString &local_data_path, QWidget *parent = 0);
+    ~CustomIconSelect();
+
+public Q_SLOTS:
+    void save();
+
+private Q_SLOTS:
+    void clearPixmap();
+    void selectPixmap();
+    void pixmapSelected(const QString&);
+
+private:
+    QList<int> sizes;
+    int min_size;
+    int max_size;
+    QPixmap pix_min;
+    QPixmap pix_max;
+    QString last_directory;
+    QString orig_path;
+    QString custom_path;
+    QString overlay_path;
+    QLabel *pix_min_lbl;
+    QLabel *pix_max_lbl;
+
+    void applyPixmap(QPixmap &pix, const QPixmap &overlay);
+};
+
+#endif
diff --git a/qt/mainwin.cc b/qt/mainwin.cc
index 2427cad..c37dd68 100644
--- a/qt/mainwin.cc
+++ b/qt/mainwin.cc
@@ -83,6 +83,7 @@ namespace
 }
 
 
+
 TrMainWindow :: TrMainWindow( Session& session, Prefs& prefs, TorrentModel& model, bool minimized ):
     myLastFullUpdateTime( 0 ),
     mySessionDialog( new SessionDialog( session, prefs, this ) ),
@@ -102,9 +103,14 @@ TrMainWindow :: TrMainWindow( Session& session, Prefs& prefs, TorrentModel& mode
     myLastReadTime( 0 ),
     myNetworkTimer( this )
 {
+    allow_close = false;
+    connect( QCoreApplication::instance(), SIGNAL(aboutToQuit()), this, SLOT(allowClose()) );
+
     QAction * sep = new QAction( this );
     sep->setSeparator( true );
 
+    connect( mySessionDialog, SIGNAL(accepted()), this, SLOT(applyCustomSessionLook()));
+
     ui.setupUi( this );
 
     QStyle * style = this->style();
@@ -296,12 +302,21 @@ TrMainWindow :: ~TrMainWindow( )
 *****
 ****/
 
+void TrMainWindow :: allowClose( )
+{
+    allow_close = true;
+}
+
+/****
+*****
+****/
+
 void
 TrMainWindow :: closeEvent( QCloseEvent * event )
 {
     // if they're using a tray icon, close to the tray
     // instead of exiting
-    if( !myPrefs.getBool( Prefs :: SHOW_TRAY_ICON ) )
+    if( !myPrefs.getBool( Prefs :: SHOW_TRAY_ICON ) || allow_close )
         event->accept( );
     else {
         toggleWindows( false );
@@ -942,6 +957,12 @@ TrMainWindow :: setStatusbarVisible( bool visible )
 ***
 **/
 
+bool
+TrMainWindow :: isNeedToRaise( )
+{
+    return !isVisible() || isMinimized() || !isActiveWindow();
+}
+
 void
 TrMainWindow :: toggleWindows( bool doShow )
 {
@@ -963,7 +984,7 @@ TrMainWindow :: trayActivated( QSystemTrayIcon::ActivationReason reason )
 {
     if( reason == QSystemTrayIcon::Trigger )
     {
-        if( isMinimized ( ) )
+        if( ui.action_ShowMainWindow->isChecked() && isNeedToRaise( ) )
             toggleWindows( true );
         else
             ui.action_ShowMainWindow->toggle( );
@@ -1322,3 +1343,30 @@ TrMainWindow :: wrongAuthentication( )
     mySession.stop( );
     mySessionDialog->show( );
 }
+
+void
+TrMainWindow :: applyCustomSessionLook()
+{
+    // get application icon
+    QString local_pix_dir = myPrefs.getConfigDir() + "/icons";
+    QString def_pix_dir = ":/icons";
+    QList<int> iconSizes;
+    iconSizes << 16 << 24 << 32 << 48 << 64;
+    QIcon icon;
+    foreach(int size, iconSizes)
+    {
+	QString custom_path((local_pix_dir+"/transmission-%1.png").arg(size));
+	if( QFile::exists(custom_path) )
+	{
+	    icon.addFile(custom_path, QSize(size,size));
+	}
+	else
+	{
+	    QString default_path((def_pix_dir+"/transmission-%1.png").arg(size));
+	    if( QFile::exists(default_path) )
+		icon.addFile(default_path, QSize(size,size));
+	}
+    }
+    setWindowIcon( icon );
+    myTrayIcon.setIcon( icon );
+}
diff --git a/qt/mainwin.h b/qt/mainwin.h
index 8e023cd..e529163 100644
--- a/qt/mainwin.h
+++ b/qt/mainwin.h
@@ -51,6 +51,7 @@ class TrMainWindow: public QMainWindow
         Q_OBJECT
 
     private:
+        bool allow_close;
         virtual void closeEvent( QCloseEvent * event );
 
     private:
@@ -89,6 +90,7 @@ class TrMainWindow: public QMainWindow
         QSet<int> getSelectedTorrents( ) const;
         void updateNetworkIcon( );
         QWidgetList myHidden;
+        bool isNeedToRaise( );
 
     public slots:
         void openURL( QString );
@@ -128,7 +130,7 @@ class TrMainWindow: public QMainWindow
         void toggleSpeedMode( );
         void dataReadProgress( );
         void dataSendProgress( );
-        void toggleWindows( bool doShow );
+        void toggleWindows( bool doShow = true );
         void onSetPrefs( );
         void onSetPrefs( bool );
         void onSessionSourceChanged( );
@@ -146,6 +148,7 @@ class TrMainWindow: public QMainWindow
         void onSortBySizeToggled     ( bool );
         void onSortByStateToggled    ( bool );
         void onSortByTrackerToggled  ( bool );
+        void allowClose              ( );
 
     private:
         QWidget * createFilterBar( void );
@@ -190,6 +193,7 @@ class TrMainWindow: public QMainWindow
         void setCompactView( bool );
         void refreshActionSensitivity( );
         void wrongAuthentication( );
+        void applyCustomSessionLook();
 
     public:
         TrMainWindow( Session&, Prefs&, TorrentModel&, bool minized );
diff --git a/qt/prefs.cc b/qt/prefs.cc
index 73b94ea..d9c5ebd 100644
--- a/qt/prefs.cc
+++ b/qt/prefs.cc
@@ -319,3 +319,9 @@ Prefs :: toggleBool( int key )
 {
     set( key, !getBool( key ) );
 }
+
+QString
+Prefs :: getConfigDir( )
+{
+    return myConfigDir;
+}
diff --git a/qt/prefs.h b/qt/prefs.h
index 01aeb5d..572bb04 100644
--- a/qt/prefs.h
+++ b/qt/prefs.h
@@ -175,6 +175,7 @@ class Prefs: public QObject
         }
 
         void toggleBool( int key );
+        QString getConfigDir();
 
      signals:
         void changed( int key );
diff --git a/qt/qtr.pro b/qt/qtr.pro
index 27101d1..22d2432 100644
--- a/qt/qtr.pro
+++ b/qt/qtr.pro
@@ -28,7 +28,8 @@ SOURCES += about.cc app.cc dbus-adaptor.cc details.cc file-tree.cc filters.cc \
            prefs-dialog.cc qticonloader.cc relocate.cc session.cc \
            session-dialog.cc squeezelabel.cc stats-dialog.cc torrent.cc \
            torrent-delegate.cc torrent-delegate-min.cc torrent-filter.cc \
-           torrent-model.cc triconpushbutton.cc utils.cc watchdir.cc
+           torrent-model.cc triconpushbutton.cc utils.cc watchdir.cc \
+           custom-icon-select.cc
 HEADERS += $$replace(SOURCES, .cc, .h)
 HEADERS += speed.h types.h
 
diff --git a/qt/session-dialog.cc b/qt/session-dialog.cc
index e526db5..d54fb22 100644
--- a/qt/session-dialog.cc
+++ b/qt/session-dialog.cc
@@ -22,6 +22,7 @@
 #include "prefs.h"
 #include "session.h"
 #include "session-dialog.h"
+#include "custom-icon-select.h"
 
 /***
 ****
@@ -38,6 +39,8 @@ SessionDialog :: onAccepted( )
     myPrefs.set( Prefs::SESSION_REMOTE_PASSWORD, myPasswordLineEdit->text( ) );
     mySession.restart( );
     hide( );
+    myCustomIconSelect->save();
+    emit accepted();
 }
 
 void
@@ -106,6 +109,12 @@ SessionDialog :: SessionDialog( Session& session, Prefs& prefs, QWidget * parent
     le->setText( prefs.get<QString>(Prefs::SESSION_REMOTE_PASSWORD) );
     l = hig->addRow( tr( "Pass&word:" ), le );
     myAuthWidgets << l << le;
+    hig->addSectionDivider( );
+    hig->addSectionTitle( tr( "Application Icon" ) );
+    QList<int> iconSizes;
+    iconSizes << 16 << 24 << 32 << 48 << 64;
+    myCustomIconSelect = new CustomIconSelect( iconSizes, ":/icons", myPrefs.getConfigDir()+"/icons" );
+    hig->addWideControl( myCustomIconSelect );
     hig->finish( );
     top->addWidget( hig, 1 );
     resensitize( );
diff --git a/qt/session-dialog.h b/qt/session-dialog.h
index e7b25eb..c8e70ad 100644
--- a/qt/session-dialog.h
+++ b/qt/session-dialog.h
@@ -22,6 +22,7 @@ class QCheckBox;
 class QLineEdit;
 class QRadioButton;
 class QSpinBox;
+class CustomIconSelect;
 
 class SessionDialog: public QDialog
 {
@@ -31,6 +32,9 @@ class SessionDialog: public QDialog
         SessionDialog( Session& session, Prefs& prefs, QWidget * parent = 0 );
         ~SessionDialog( ) { }
 
+    Q_SIGNALS:
+	void accepted();
+
     private slots:
         void onAccepted( );
         void resensitize( );
@@ -43,6 +47,7 @@ class SessionDialog: public QDialog
         QLineEdit * myUsernameLineEdit;
         QLineEdit * myPasswordLineEdit;
         QCheckBox * myAutomaticCheckBox;
+	CustomIconSelect *myCustomIconSelect;
 
     private:
         Session& mySession;
diff --git a/transmission-daemon.init b/transmission-daemon.init
new file mode 100644
index 0000000..025b429
--- /dev/null
+++ b/transmission-daemon.init
@@ -0,0 +1,77 @@
+#!/bin/sh
+#
+# transmission	A torrent client
+#
+# chkconfig: - 90 10
+# description:	multi-line \
+#		description \
+#		of the service.
+# processname: transmission-daemon
+# config: /etc/transmission-daemon/transmission.conf
+# pidfile: /var/run/transmission-daemon.pid
+
+# Do not load RH compatibility interface.
+WITHOUT_RC_COMPAT=1
+
+# Source function library.
+. /etc/init.d/functions
+. /etc/sysconfig/transmission-daemon
+
+PIDFILE=/var/run/transmission-daemon.pid
+LOCKFILE=/var/lock/subsys/transmission-daemon
+RETVAL=0
+NAME="transmission-daemon"
+
+start()
+{
+	install -m644 /etc/transmission-daemon/settings.json /var/lib/transmission-daemon/settings.json
+	start_daemon --lockfile "$LOCKFILE" --user _transmission-daemon -- transmission-daemon "$TRANSMISSION_OPTIONS"
+	RETVAL=$?
+	return $RETVAL
+}
+
+stop()
+{
+	stop_daemon --lockfile "$LOCKFILE" --expect-user _transmission-daemon -- transmission-daemon
+	RETVAL=$?
+	return $RETVAL
+}
+
+restart()
+{
+	stop
+	start
+}
+
+
+# See how we were called.
+case "$1" in
+	start)
+		start
+		;;
+	stop)
+		stop
+		;;
+	restart)
+		restart
+		;;
+	condstop)
+		if [ -e "$LOCKFILE" ]; then
+			stop
+		fi
+		;;
+	condrestart)
+		if [ -e "$LOCKFILE" ]; then
+			restart
+		fi
+		;;
+	status)
+		status --expect-user _transmission-daemon -- transmission-daemon
+		RETVAL=$?
+		;;
+	*)
+		msg_usage "${0##*/} {start|stop|reload|restart|condstop|condrestart|condreload|status}"
+		RETVAL=1
+esac
+
+exit $RETVAL
diff --git a/transmission-daemon.logrotate b/transmission-daemon.logrotate
new file mode 100644
index 0000000..58dba79
--- /dev/null
+++ b/transmission-daemon.logrotate
@@ -0,0 +1,7 @@
+/var/log/transmission-daemon/* {
+        notifempty
+        missingok
+        postrotate
+                /etc/init.d/transmission-daemon condrestart >/dev/null
+        endscript
+}
diff --git a/transmission.spec b/transmission.spec
new file mode 100644
index 0000000..86ca219
--- /dev/null
+++ b/transmission.spec
@@ -0,0 +1,382 @@
+%define _optlevel s
+%def_disable wxgtk
+%def_enable qt
+
+%define rname Transmission
+%define dname transmission-daemon
+
+Name: transmission
+Version: 2.04
+Release: alt0.M51.1
+
+Group: Networking/File transfer
+Summary: Llightweight BitTorrent client
+License: GPLv2 + MIT
+Url: http://www.transmissionbt.com/
+
+Provides: %rname = %version-%release
+
+Obsoletes: %name-benc2php
+Obsoletes: %name-proxy
+
+Requires: %name-gui = %version-%release
+Requires: %name-cli = %version-%release
+Requires: %name-remote = %version-%release
+Requires: %name-daemon = %version-%release
+
+Requires(post,postun): desktop-file-utils
+
+Source: http://download.m0k.org/%name/files/%name-%version.tar
+Patch0: %name-%version-%release.patch
+Source1: %dname.init
+Source2: %dname.logrotate
+
+BuildPreReq: desktop-file-utils
+
+BuildRequires: gcc-c++ glibc-devel intltool libcurl-devel libevent1.4-devel libnotify-devel
+BuildRequires(pre): rpm-utils desktop-file-utils libalternatives-devel
+%if "%(rpmvercmp '%{get_version glibc-core}' '2.9')" >= "0"
+BuildRequires: libgio-devel
+%endif
+%if_enabled qt
+BuildRequires: libqt4-devel
+%endif
+
+%if_enabled wxgtk
+BuildRequires: wxGTK2u-devel
+%endif
+
+%description
+Transmission has been built from the ground up to be a lightweight,
+yet powerful BitTorrent client. Its simple, intuitive interface
+strikes a balance between providing useful functionality without
+feature bloat. Furthermore, it is free for anyone to use or modify.
+
+%package common
+Group: Networking/File transfer
+Summary: Common files for %name
+Conflicts: %name < 1.00-alt10
+%description common
+Common files for %name
+
+%package gui-common
+Group: Networking/File transfer
+Summary: Common files for %name
+Requires: %name-common = %version-%release
+%description gui-common
+Common files for %name
+
+%package gtk
+Group: Networking/File transfer
+Summary: Graphical BitTorrent client
+Provides: %name-gui = %version-%release
+Requires: %name-common = %version-%release
+Requires: %name-gui-common = %version-%release
+%description gtk
+GTK-based graphical BitTorrent client
+
+%if_enabled qt
+%package qt
+Group: Networking/File transfer
+Summary: Graphical BitTorrent client
+Provides: %name-gui = %version-%release
+Requires: %name-common = %version-%release
+Requires: %name-gui-common = %version-%release
+%description qt
+Qt-based graphical BitTorrent client
+%endif
+
+%if_enabled wxgtk
+%package wxgtk
+Group: Networking/File transfer
+Summary: Graphical BitTorrent client
+Provides: %name-gui = %version-%release
+Requires: %name-common = %version-%release
+Requires: %name-gui-common = %version-%release
+%description wxgtk
+WxGTK-based graphical BitTorrent client
+%endif
+
+%package cli
+Group: Networking/File transfer
+Summary: Command line BitTorrent client
+Requires: %name-common = %version-%release
+%description cli
+Command line BitTorrent client
+
+%package remote
+Group: Networking/Remote access
+Summary: Command line remote interface to %name-daemon
+Requires: %name-common = %version-%release
+Requires: %name-daemon = %version-%release
+%description remote
+Command line remote interface to %name-daemon
+
+%package daemon
+Group: Networking/File transfer
+Summary: Daemonised BitTorrent client
+Requires: %name-common = %version-%release
+%description daemon
+Daemonised BitTorrent client
+
+%prep
+%setup -q
+%patch0 -p1
+sed -i "s|\(^CONFIG.*\+=.*[[:space:]]\)debug\([[:space:]].*$\)|\1release\2|" qt/qtr.pro
+sed -i "s|^LIBS.*\+=.*libevent\.a$|LIBS += -levent|" qt/qtr.pro
+
+%build
+./autogen.sh
+%configure \
+    --verbose \
+    %{subst_enable wx} \
+    --enable-gtk
+
+%if_enabled qt
+pushd qt
+qmake-qt4 "QMAKE_CXXFLAGS+=%optflags"
+popd
+%endif
+
+%make_build
+
+%if_enabled qt
+pushd qt
+%make_build
+for f in *.ts; do lrelease-qt4 $f; done
+popd
+%endif
+
+
+%install
+%make DESTDIR=%buildroot install
+
+%if_enabled qt
+%make install INSTALL_ROOT=%buildroot/%prefix -C qt
+%endif
+
+mv %buildroot/%_bindir/%name %buildroot/%_bindir/%{name}-gtk
+desktop-file-install \
+    --dir %buildroot/%_datadir/applications \
+    --remove-category=GTK \
+    %buildroot/%_datadir/applications/transmission.desktop
+
+# made alternatives entries
+mkdir -p %buildroot/%_altdir
+
+%if_enabled wxgtk
+cat >%buildroot/%_altdir/%name-wxgtk <<__EOF__
+%_bindir/%name %_bindir/Xmission 10
+__EOF__
+%endif
+
+cat >%buildroot/%_altdir/%name-gtk <<__EOF__
+%_bindir/%name %_bindir/%name-gtk 30
+__EOF__
+
+%if_enabled qt
+cat >%buildroot/%_altdir/%name-qt <<__EOF__
+%_bindir/%name %_bindir/qtr 20
+__EOF__
+# install translations
+mkdir -p %buildroot/%_datadir/qt4/translations/
+for f in qt/*.qm; do install -m 0644 $f %buildroot/%_datadir/qt4/translations/; done
+%endif
+
+%find_lang %name
+
+# install daemonic stuff
+
+install -pD -m640 %dname.logrotate %buildroot%_sysconfdir/logrotate.d/%dname
+install -pD -m755 %dname.init %buildroot%_initdir/%dname
+
+mkdir -p %buildroot/%_sysconfdir/transmission-daemon/
+daemon/transmission-daemon -d 2> %buildroot/%_sysconfdir/transmission-daemon/settings.json
+sed -i 's,/usr/src/,/var/lib/transmission-daemon/,' %buildroot/%_sysconfdir/transmission-daemon/settings.json
+
+mkdir -p %buildroot/%_sysconfdir/sysconfig/
+echo "TRANSMISSION_OPTIONS=\"-e %_logdir/%dname/%dname.log -g %_localstatedir/%dname\"" > %buildroot/%_sysconfdir/sysconfig/%dname
+
+mkdir -p %buildroot/%_logdir/%dname
+mkdir -p %buildroot/%_localstatedir/%dname
+
+%pre daemon
+/usr/sbin/groupadd -r -f _%dname
+/usr/sbin/useradd -r -g _%dname -d %_localstatedir/%dname -s /dev/null -c 'The Transmission Torrent Client' _%dname >/dev/null 2>&1 ||:
+if [ $1 -gt 1 ]; then
+        /usr/sbin/usermod -d %_localstatedir/%dname _%dname
+fi
+
+%files
+
+%files common
+%dir %_datadir/%name
+%_datadir/%name/web/
+
+%files gui-common
+%_iconsdir/hicolor/*/*/*
+%_datadir/pixmaps/*
+%_datadir/applications/%name.desktop
+%_man1dir/%name.1*
+
+%files gtk -f %name.lang
+%doc AUTHORS COPYING NEWS README ChangeLog
+%_bindir/%name-gtk
+%_altdir/%name-gtk
+
+%if_enabled qt
+%files qt
+%doc AUTHORS COPYING NEWS README ChangeLog
+%_bindir/qtr
+%_altdir/%name-qt
+%_datadir/qt4/translations/%{name}_*.qm
+%endif
+
+%if_enabled wxgtk
+%files wxgtk
+%doc AUTHORS COPYING NEWS README ChangeLog
+%_bindir/Xmission
+%_altdir/%name-wxgtk
+%endif
+
+%files cli
+%doc AUTHORS COPYING NEWS README ChangeLog
+%_bindir/%{name}cli
+%_man1dir/%{name}cli.1*
+
+%files remote
+%doc AUTHORS COPYING NEWS README ChangeLog
+%_bindir/%name-remote
+%_man1dir/%name-remote.1*
+
+%files daemon
+%doc AUTHORS COPYING NEWS README ChangeLog
+%_bindir/%name-daemon
+%_man1dir/%name-daemon.1*
+%config(noreplace) %_sysconfdir/logrotate.d/%dname
+%config(noreplace) %_sysconfdir/sysconfig/%dname
+%config %_initdir/%dname
+%attr(710,root,_%dname) %dir %_sysconfdir/%dname
+%config(noreplace) %_sysconfdir/%dname/settings.json
+%attr(770,root,_%dname) %dir %_localstatedir/%dname
+%dir %_logdir/%dname
+
+%changelog
+* Thu Sep 16 2010 Anton Farygin <rider@altlinux.ru> 2.04-alt0.M51.1
+- backport to 5.1
+
+* Mon Jul 12 2010 Anton Farygin <rider@altlinux.ru> 1.93-alt2
+- added initscript for transmission-daemon by Timur Batyrshin (Closes: 23751, 21190)
+
+* Tue Jun 01 2010 Anton Farygin <rider@altlinux.ru> 1.93-alt1
+- new version
+
+* Wed Feb 24 2010 Anton Farygin <rider@altlinux.ru> 1.91-alt1
+- new version
+
+* Wed Feb 24 2010 Anton Farygin <rider@altlinux.ru> 1.76-alt3
+- add patches from upstream 1.7x branch with fix for CVE-2010-0012 (closes: #23019)
+
+* Mon Oct 26 2009 Sergey V Turchin <zerg@altlinux.org> 1.76-alt2
+- qtr: accept close window event when application exiting
+
+* Mon Oct 26 2009 Anton Farygin <rider@altlinux.ru> 1.76-alt1
+- new version
+
+* Wed Oct 21 2009 Sergey V Turchin <zerg@altlinux.org> 1.75-alt2
+- qtr: allow customize application icon in session dialog
+
+* Wed Sep 16 2009 Anton Farygin <rider@altlinux.ru> 1.75-alt1
+- new version
+
+* Tue Sep 01 2009 Anton Farygin <rider@altlinux.ru> 1.74-alt1
+- new version
+
+* Thu Aug 13 2009 Sergey V Turchin <zerg@altlinux.org> 1.73-alt2
+- build qtr
+- qtr: add russian translation
+- qtr: close main window to tray
+- qtr: fix raise main window
+
+* Wed Aug 05 2009 Anton Farygin <rider@altlinux.ru> 1.73-alt1
+- new version
+
+* Tue Jun 30 2009 Anton Farygin <rider@altlinux.ru> 1.72-alt1
+- new version
+
+* Thu May 14 2009 Anton Farygin <rider@altlinux.ru> 1.61-alt2
+- add patch from mainstream:
+    - #2073: can't upload new torrent file in web ui
+
+* Wed May 13 2009 Anton Farygin <rider@altlinux.ru> 1.61-alt1
+- new version
+
+* Wed May 06 2009 Anton Farygin <rider@altlinux.ru> 1.60-alt1
+- new version
+
+* Tue Apr 14 2009 Anton Farygin <rider@altlinux.ru> 1.52-alt1
+- new version
+
+* Thu Mar 05 2009 Anton Farygin <rider@altlinux.ru> 1.51-alt0.M40.1
+- new version
+
+* Mon Feb 16 2009 Anton Farygin <rider@altlinux.ru> 1.50-alt1
+- new version
+- fixed build from svn
+- build with system libevent
+- buildreq updated
+
+* Thu Jan 15 2009 Yuri N. Sedunov <aris@altlinux.org> 1.42-alt1
+- new version
+
+* Sat Nov 08 2008 Yuri N. Sedunov <aris@altlinux.org> 1.34-alt2
+- fix altbug #17817 (patch0)
+
+* Mon Sep 22 2008 Yuri N. Sedunov <aris@altlinux.org> 1.34-alt1.1
+- packaged builtin web-server
+
+* Fri Sep 19 2008 Yuri N. Sedunov <aris@altlinux.org> 1.34-alt1
+- new version for Sisyphus
+- updated buildreqs
+- removed {update,clean}_menus from post{,un}
+
+* Tue Aug 05 2008 Sergey V Turchin <zerg at altlinux dot org> 1.22-alt0.M40.1
+- new version
+
+* Thu May 08 2008 Sergey V Turchin <zerg at altlinux dot org> 1.11-alt0.M40.1
+- new version
+
+* Tue Apr 01 2008 Sergey V Turchin <zerg at altlinux dot org> 1.10-alt0.M40.1
+- new version
+
+* Wed Mar 05 2008 Sergey V Turchin <zerg at altlinux dot org> 1.06-alt0.M40.1
+- new version
+
+* Tue Feb 19 2008 Sergey V Turchin <zerg at altlinux dot org> 1.05-alt0.M40.1
+- new version
+
+* Thu Feb 07 2008 Sergey V Turchin <zerg at altlinux dot org> 1.04-alt0.M40.1
+- new version 
+
+* Sat Jan 26 2008 Sergey V Turchin <zerg at altlinux dot org> 1.02-alt0.M40.1
+- new version
+
+* Tue Jan 15 2008 Sergey V Turchin <zerg at altlinux dot org> 1.01-alt0.M40.1
+- new version
+- split to subpackages
+
+* Wed Jan 09 2008 Sergey V Turchin <zerg at altlinux dot org> 1.00-alt0.M40.1
+- new version
+
+* Wed Dec 12 2007 Sergey V Turchin <zerg at altlinux dot org> 0.96-alt0.M40.1
+- new version
+
+* Thu Dec 06 2007 Sergey V Turchin <zerg at altlinux dot org> 0.95-alt0.M40.1
+- new version
+
+* Wed Nov 28 2007 Sergey V Turchin <zerg at altlinux dot org> 0.94-alt0.M40.1
+- new version
+
+* Sat Sep 08 2007 Sergey V Turchin <zerg at altlinux dot org> 0.81-0.1.M40
+- initial specfile
+
 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin