diff --git a/ark-15.08.0-improve_subfolder_autodetection.patch b/ark-15.08.0-improve_subfolder_autodetection.patch new file mode 100644 index 0000000..de13f85 --- /dev/null +++ b/ark-15.08.0-improve_subfolder_autodetection.patch @@ -0,0 +1,80 @@ +diff --git a/app/batchextract.cpp b/app/batchextract.cpp +index 3ea90bd..fec7bc1 100644 +--- a/app/batchextract.cpp ++++ b/app/batchextract.cpp +@@ -67,9 +67,9 @@ void BatchExtract::addExtraction(Kerfuffle::Archive* archive) + { + QString destination = destinationFolder(); + +- if ((autoSubfolder()) && (!archive->isSingleFolderArchive())) { ++ if ((autoSubfolder()) && (!archive->isSingleFolderArchive() || !archive->fileBaseName().startsWith(archive->subfolderName()))) { + const QDir d(destination); +- QString subfolderName = archive->subfolderName(); ++ QString subfolderName = archive->fileBaseName(); + + if (d.exists(subfolderName)) { + subfolderName = KIO::suggestName(QUrl::fromUserInput(destination, QString(), QUrl::AssumeLocalFile), subfolderName); +diff --git a/kerfuffle/archive_kerfuffle.cpp b/kerfuffle/archive_kerfuffle.cpp +index 7b9990d..0ed2c1f 100644 +--- a/kerfuffle/archive_kerfuffle.cpp ++++ b/kerfuffle/archive_kerfuffle.cpp +@@ -209,6 +209,16 @@ QString Archive::fileName() const + return m_iface->filename(); + } + ++QString Archive::fileBaseName() const ++{ ++ QString base = QFileInfo(m_iface->filename()).completeBaseName(); ++ //special case for tar.gz/bzip2 files ++ if (base.right(4).toUpper() == QLatin1String(".TAR")) { ++ base.chop(4); ++ } ++ return base; ++} ++ + void Archive::onAddFinished(KJob* job) + { + //if the archive was previously a single folder archive and an add job +@@ -230,15 +240,7 @@ void Archive::onListFinished(KJob* job) + m_isPasswordProtected = ljob->isPasswordProtected(); + m_subfolderName = ljob->subfolderName(); + if (m_subfolderName.isEmpty()) { +- QFileInfo fi(fileName()); +- QString base = fi.completeBaseName(); +- +- //special case for tar.gz/bzip2 files +- if (base.right(4).toUpper() == QLatin1String(".TAR")) { +- base.chop(4); +- } +- +- m_subfolderName = base; ++ m_subfolderName = fileBaseName(); + } + + m_hasBeenListed = true; +diff --git a/kerfuffle/archive_kerfuffle.h b/kerfuffle/archive_kerfuffle.h +index f6fbbd8..488e650 100644 +--- a/kerfuffle/archive_kerfuffle.h ++++ b/kerfuffle/archive_kerfuffle.h +@@ -97,6 +97,7 @@ public: + ~Archive(); + + QString fileName() const; ++ QString fileBaseName() const; + bool isReadOnly() const; + + KJob* open(); +diff --git a/kerfuffle/jobs.cpp b/kerfuffle/jobs.cpp +index 3dabb4e..1c0f15d 100644 +--- a/kerfuffle/jobs.cpp ++++ b/kerfuffle/jobs.cpp +@@ -225,7 +225,8 @@ void ListJob::onNewEntry(const ArchiveEntry& entry) + m_isPasswordProtected |= entry [ IsPasswordProtected ].toBool(); + + if (m_isSingleFolderArchive) { +- const QString fileName(entry[FileName].toString()); ++ const QString fileName(entry[FileName].toString() ++ .replace(QRegExp(QString::fromLatin1("^\\./")), QString())); + const QString basePath(fileName.split(QLatin1Char( '/' )).at(0)); + + if (m_basePath.isEmpty()) { diff --git a/ark-4.7.80-namelink_skip.patch b/ark-4.7.80-namelink_skip.patch deleted file mode 100644 index e10b852..0000000 --- a/ark-4.7.80-namelink_skip.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -up ark-4.7.80/kerfuffle/CMakeLists.txt.namelink_skip ark-4.7.80/kerfuffle/CMakeLists.txt ---- ark-4.7.80/kerfuffle/CMakeLists.txt.namelink_skip 2011-11-04 09:36:35.000000000 -0500 -+++ ark-4.7.80/kerfuffle/CMakeLists.txt 2011-11-28 14:14:34.361344532 -0600 -@@ -33,7 +33,7 @@ endif (NOT WIN32) - - set_target_properties(kerfuffle PROPERTIES VERSION ${GENERIC_LIB_VERSION} SOVERSION ${GENERIC_LIB_SOVERSION}) - --install(TARGETS kerfuffle ${INSTALL_TARGETS_DEFAULT_ARGS}) -+install(TARGETS kerfuffle ${INSTALL_TARGETS_DEFAULT_ARGS} LIBRARY NAMELINK_SKIP) - - install(FILES kerfufflePlugin.desktop DESTINATION ${SERVICETYPES_INSTALL_DIR}) - install(FILES ark.kcfg DESTINATION ${KCFG_INSTALL_DIR}) diff --git a/ark-4.9.97-improve_subfolder_autodetection.patch b/ark-4.9.97-improve_subfolder_autodetection.patch deleted file mode 100644 index 212eeb1..0000000 --- a/ark-4.9.97-improve_subfolder_autodetection.patch +++ /dev/null @@ -1,80 +0,0 @@ -diff --git a/app/batchextract.cpp b/app/batchextract.cpp -index 9e466350568384247e99362745205c417b27873f..86f946b18f94f83b42d4bcd0bc320e6a5a3e7e64 100644 ---- a/app/batchextract.cpp -+++ b/app/batchextract.cpp -@@ -68,9 +68,9 @@ void BatchExtract::addExtraction(Kerfuffle::Archive* archive) - { - QString destination = destinationFolder(); - -- if ((autoSubfolder()) && (!archive->isSingleFolderArchive())) { -+ if ((autoSubfolder()) && (!archive->isSingleFolderArchive() || !archive->fileBaseName().startsWith(archive->subfolderName()))) { - const QDir d(destination); -- QString subfolderName = archive->subfolderName(); -+ QString subfolderName = archive->fileBaseName(); - - if (d.exists(subfolderName)) { - subfolderName = KIO::RenameDialog::suggestName(destination, subfolderName); -diff --git a/kerfuffle/archive.h b/kerfuffle/archive.h -index 515788f978c1d29146c25dcb57a9dad2d46371f7..38049f2c949eb2ab804fc61f9da9336e6e848b77 100644 ---- a/kerfuffle/archive.h -+++ b/kerfuffle/archive.h -@@ -95,6 +95,7 @@ public: - ~Archive(); - - QString fileName() const; -+ QString fileBaseName() const; - bool isReadOnly() const; - - KJob* open(); -diff --git a/kerfuffle/archive.cpp b/kerfuffle/archive.cpp -index c2c5b18528def63405a8703475b1c592ca945973..470fc56879a2d5e579389b69591da9f230af74ea 100644 ---- a/kerfuffle/archive.cpp -+++ b/kerfuffle/archive.cpp -@@ -196,6 +196,16 @@ QString Archive::fileName() const - return m_iface->filename(); - } - -+QString Archive::fileBaseName() const -+{ -+ QString base = QFileInfo(m_iface->filename()).completeBaseName(); -+ //special case for tar.gz/bzip2 files -+ if (base.right(4).toUpper() == QLatin1String(".TAR")) { -+ base.chop(4); -+ } -+ return base; -+} -+ - void Archive::onAddFinished(KJob* job) - { - //if the archive was previously a single folder archive and an add job -@@ -217,15 +227,7 @@ void Archive::onListFinished(KJob* job) - m_isPasswordProtected = ljob->isPasswordProtected(); - m_subfolderName = ljob->subfolderName(); - if (m_subfolderName.isEmpty()) { -- QFileInfo fi(fileName()); -- QString base = fi.completeBaseName(); -- -- //special case for tar.gz/bzip2 files -- if (base.right(4).toUpper() == QLatin1String(".TAR")) { -- base.chop(4); -- } -- -- m_subfolderName = base; -+ m_subfolderName = fileBaseName(); - } - - m_hasBeenListed = true; -diff --git a/kerfuffle/jobs.cpp b/kerfuffle/jobs.cpp -index aedc62c4c9902c4f3207c648747f2e427446d5e5..de16439ce46283956e7741662bda19d1e8e591fa 100644 ---- a/kerfuffle/jobs.cpp -+++ b/kerfuffle/jobs.cpp -@@ -217,7 +217,8 @@ void ListJob::onNewEntry(const ArchiveEntry& entry) - m_isPasswordProtected |= entry [ IsPasswordProtected ].toBool(); - - if (m_isSingleFolderArchive) { -- const QString fileName(entry[FileName].toString()); -+ const QString fileName(entry[FileName].toString() -+ .replace(QRegExp(QString::fromAscii("^\\./")), QString())); - const QString basePath(fileName.split(QLatin1Char( '/' )).at(0)); - - if (m_basePath.isEmpty()) { diff --git a/ark-unar-06.patch b/ark-unar-06.patch index ab2ef27..bcebebc 100644 --- a/ark-unar-06.patch +++ b/ark-unar-06.patch @@ -24,7 +24,7 @@ new file mode 100644 index 0000000..e0adcf7 --- /dev/null +++ b/plugins/cliunarchiverplugin/cliplugin.cpp -@@ -0,0 +1,170 @@ +@@ -0,0 +1,174 @@ + /* + * ark -- archiver for the KDE project + * @@ -46,18 +46,21 @@ index 0000000..e0adcf7 + * + */ + ++#include "app/logging.h" +#include "kerfuffle/cliinterface.h" +#include "kerfuffle/kerfuffle_export.h" + -+#include ++#include + +#include +#include +#include +#include +#include ++#include + +using namespace Kerfuffle; ++Q_LOGGING_CATEGORY(KERFUFFLE_PLUGIN, "ark.kerfuffle.cliunar", QtWarningMsg) + +class CliPlugin: public CliInterface +{ @@ -154,7 +157,7 @@ index 0000000..e0adcf7 + if (m_currentEntry[index].toBool()) { + m_currentEntry[FileName].toString().append(QLatin1String("/")); + } -+ kDebug() << "Added entry:" << m_currentEntry; ++ qCDebug(KERFUFFLE_PLUGIN) << "Added entry:" << m_currentEntry; + entry(m_currentEntry); + } + } @@ -193,15 +196,16 @@ index 0000000..e0adcf7 + } +}; + -+KERFUFFLE_EXPORT_PLUGIN(CliPlugin) ++K_PLUGIN_FACTORY(CliPluginFactory, registerPlugin(); ) ++ ++#include "cliplugin.moc" + diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt index 3619412..6368839 100644 --- a/plugins/CMakeLists.txt +++ b/plugins/CMakeLists.txt -@@ -20,6 +20,7 @@ if (LIBARCHIVE_FOUND) - endif (LIBARCHIVE_FOUND) - +@@ -1,5 +1,6 @@ + add_subdirectory( libarchive ) add_subdirectory( clirarplugin ) +add_subdirectory( cliunarchiverplugin ) add_subdirectory( cli7zplugin ) @@ -223,9 +227,9 @@ index 0000000..ccd52e7 + +set(kerfuffle_cliunarchiver_SRCS cliplugin.cpp) + -+kde4_add_plugin(kerfuffle_cliunarchiver ${kerfuffle_cliunarchiver_SRCS}) ++add_library(kerfuffle_cliunarchiver MODULE ${kerfuffle_cliunarchiver_SRCS}) + -+target_link_libraries(kerfuffle_cliunarchiver ${KDE4_KDECORE_LIBS} ${KDE4_KIO_LIBS} kerfuffle ) ++target_link_libraries(kerfuffle_cliunarchiver KF5::KIOCore kerfuffle ) + + + diff --git a/ark.spec b/ark.spec index 8144f91..6004bd2 100644 --- a/ark.spec +++ b/ark.spec @@ -8,7 +8,7 @@ Version: 15.08.0 Release: 1%{?dist} License: GPLv2+ -URL: http://utils.kde.org/projects/ark +URL: http://utils.kde.org/projects/ark %global revision %(echo %{version} | cut -d. -f3) %if %{revision} >= 50 %global stable unstable @@ -18,10 +18,8 @@ URL: http://utils.kde.org/projects/ark Source0: http://download.kde.org/%{stable}/applications/%{version}/src/%{name}-%{version}.tar.xz ## upstreamable patches -# libkerfuffle namelink_skip -Patch50: ark-4.7.80-namelink_skip.patch # https://git.reviewboard.kde.org/r/107634/ -Patch53: ark-4.9.97-improve_subfolder_autodetection.patch +Patch53: ark-15.08.0-improve_subfolder_autodetection.patch # https://git.reviewboard.kde.org/r/106294/ Patch54: ark-unar-06.patch @@ -29,16 +27,31 @@ Patch54: ark-unar-06.patch BuildRequires: bzip2-devel BuildRequires: desktop-file-utils -BuildRequires: kdelibs4-devel >= 4.14 -BuildRequires: kde-baseapps-devel >= %{version} +BuildRequires: kf5-rpm-macros +BuildRequires: extra-cmake-modules +BuildRequires: qt5-qtbase-devel + +BuildRequires: kf5-karchive-devel +BuildRequires: kf5-kconfig-devel +BuildRequires: kf5-kcrash-devel +BuildRequires: kf5-kdbusaddons-devel +BuildRequires: kf5-kdoctools-devel +BuildRequires: kf5-ki18n-devel +BuildRequires: kf5-kiconthemes-devel +BuildRequires: kf5-khtml-devel +BuildRequires: kf5-kio-devel +BuildRequires: kf5-kservice-devel +BuildRequires: kf5-kpty-devel +BuildRequires: kf5-kwidgetsaddons-devel + %if 0%{?fedora} > 19 BuildRequires: libappstream-glib %endif BuildRequires: pkgconfig(libarchive) -BuildRequires: pkgconfig(liblzma) +BuildRequires: pkgconfig(liblzma) BuildRequires: zlib-devel # need only for ark unit tests -#BuildRequires: pkgconfig(QJson) +#BuildRequires: pkgconfig(QJson) # when split occured Conflicts: kdeutils-common < 6:4.7.80 @@ -49,7 +62,7 @@ Obsoletes: kdeutils-ark < 6:4.7.80 Provides: kdeutils-ark = 6:%{version}-%{release} Requires: %{name}-libs%{?_isa} = %{version}-%{release} -%{?kde_runtime_requires} + # Dependencies for archive plugins. # could split .desktop like okular to support these via # TryExec= instead someday -- Rex @@ -70,7 +83,7 @@ The program can handle various formats such as tar, gzip, bzip2, zip, rar and lha (if appropriate command-line programs are installed). %package libs -Summary: Runtime libraries for %{name} +Summary: Runtime libraries for %{name} # libkerfuffle is BSD, plugins are mix of BSD and GPLv2+ License: BSD and GPLv2+ Requires: %{name} = %{version}-%{release} @@ -83,7 +96,6 @@ Provides: kdeutils-ark-libs = 6:%{version}-%{release} %prep %setup -q -n %{name}-%{version} -%patch50 -p1 -b .namelink_skip %patch53 -p1 -b .improve_subfolder_autodetection %patch54 -p1 -b .unar-06 @@ -91,7 +103,7 @@ Provides: kdeutils-ark-libs = 6:%{version}-%{release} %build mkdir -p %{_target_platform} pushd %{_target_platform} -%{cmake_kde4} .. +%{cmake_kf5} .. popd make %{?_smp_mflags} -C %{_target_platform} @@ -99,51 +111,51 @@ make %{?_smp_mflags} -C %{_target_platform} %install make install/fast DESTDIR=%{buildroot} -C %{_target_platform} - -%find_lang ark --with-kde --without-mo - +rm -v %{buildroot}%{_kf5_libdir}/libkerfuffle.so %check -appstream-util validate-relax --nonet %{buildroot}%{_kde4_datadir}/appdata/%{name}.appdata.xml ||: -desktop-file-validate %{buildroot}%{_kde4_datadir}/applications/kde4/ark.desktop +appstream-util validate-relax --nonet %{buildroot}%{_kf5_datadir}/appdata/%{name}.appdata.xml ||: +desktop-file-validate %{buildroot}%{_kf5_datadir}/applications/org.kde.ark.desktop %post -touch --no-create %{_kde4_iconsdir}/hicolor &> /dev/null || : +touch --no-create %{_kf5_datadir}/icons/hicolor &> /dev/null || : %posttrans -gtk-update-icon-cache %{_kde4_iconsdir}/hicolor &> /dev/null || : +gtk-update-icon-cache %{_kf5_datadir}/icons/hicolor &> /dev/null || : update-desktop-database -q &> /dev/null ||: %postun if [ $1 -eq 0 ] ; then -touch --no-create %{_kde4_iconsdir}/hicolor &> /dev/null || : -gtk-update-icon-cache %{_kde4_iconsdir}/hicolor &> /dev/null || : +touch --no-create %{_kf5_datadir}/icons/hicolor &> /dev/null || : +gtk-update-icon-cache %{_kf5_datadir}/icons/hicolor &> /dev/null || : update-desktop-database -q &> /dev/null ||: fi -%files -f ark.lang +%files %doc COPYING -%{_kde4_bindir}/ark -%{_kde4_appsdir}/ark/ -%{_kde4_datadir}/config.kcfg/ark.kcfg -%{_kde4_datadir}/kde4/services/ark*.desktop -%{_kde4_datadir}/kde4/services/ServiceMenus/ark*.desktop -%{_kde4_datadir}/appdata/%{name}.appdata.xml -%{_kde4_datadir}/applications/kde4/ark.desktop -%{_kde4_iconsdir}/hicolor/*/apps/ark.* -%{_kde4_libdir}/kde4/arkpart.so -%{_kde4_libdir}/kde4/libextracthere.so +%{_kf5_sysconfdir}/xdg/ark.categories +%{_kf5_bindir}/ark +%{_kf5_datadir}/kxmlgui5/ark/ +%{_kf5_datadir}/config.kcfg/ark.kcfg +%{_kf5_datadir}/kservices5/ark*.desktop +%{_kf5_datadir}/kservices5/ServiceMenus/ark*.desktop +%{_kf5_datadir}/appdata/%{name}.appdata.xml +%{_kf5_datadir}/applications/org.kde.ark.desktop +%{_kf5_datadir}/icons/hicolor/*/apps/ark.* +%{_kf5_qtplugindir}/arkpart.so +%{_kf5_plugindir}/kio_dnd/extracthere.so %{_mandir}/man1/ark.1* +%{_kf5_datadir}/doc/HTML/en/ark %post libs -p /sbin/ldconfig %postun libs -p /sbin/ldconfig %files libs -%{_kde4_libdir}/libkerfuffle.so.4* -%{_kde4_libdir}/kde4/kerfuffle_*.so -%{_kde4_datadir}/kde4/services/kerfuffle*.desktop -%{_kde4_datadir}/kde4/servicetypes/kerfufflePlugin.desktop +%{_kf5_libdir}/libkerfuffle.so.* +%{_kf5_qtplugindir}/kerfuffle_*.so +%{_kf5_datadir}/kservices5/kerfuffle*.desktop +%{_kf5_datadir}/kservicetypes5/kerfufflePlugin.desktop %changelog