diff --git a/.gitignore b/.gitignore index e69de29..703d2d2 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/kgpg-4.7.80.tar.bz2 diff --git a/kdeutils-4.7.1-gpg2.patch b/kdeutils-4.7.1-gpg2.patch new file mode 100644 index 0000000..9ac19d8 --- /dev/null +++ b/kdeutils-4.7.1-gpg2.patch @@ -0,0 +1,37 @@ +diff -up kdeutils-4.7.1/kgpg/kgpgoptions.cpp.gpg2 kdeutils-4.7.1/kgpg/kgpgoptions.cpp +--- kdeutils-4.7.1/kgpg/kgpgoptions.cpp.gpg2 2011-09-01 16:22:36.000000000 -0500 ++++ kdeutils-4.7.1/kgpg/kgpgoptions.cpp 2011-09-28 13:50:06.679879225 -0500 +@@ -32,6 +32,7 @@ + #include + #include + #include ++#include + + #include "images.h" + #include "kgpgsettings.h" +@@ -136,6 +137,16 @@ kgpgOptions::~kgpgOptions() + delete m_page7; + } + ++static QString gpgExecutable() ++{ ++ QString gpgExe = KStandardDirs::findExe( "gpg" ); ++ if ( gpgExe.isEmpty() ) ++ gpgExe = KStandardDirs::findExe( "gpg2" ); ++ if ( gpgExe.isEmpty() ) ++ return QLatin1String( "gpg" ); ++ return gpgExe; ++} ++ + void kgpgOptions::slotChangeHome() + { + QString gpgHome = KFileDialog::getExistingDirectory(m_page4->gpg_home_path->text(), this, i18n("New GnuPG Home Location")); +@@ -158,7 +169,7 @@ void kgpgOptions::slotChangeHome() + // start GnuPG so that it will create a config file + QString gpgbin = m_page4->kcfg_GpgBinaryPath->text(); + if (!QFile::exists(gpgbin)) +- gpgbin = QLatin1String( "gpg" ); ++ gpgbin = gpgExecutable(); + + KProcess p; + p << gpgbin << QLatin1String( "--homedir" ) << gpgHome << QLatin1String( "--no-tty" ) << QLatin1String( "--list-secret-keys" ); diff --git a/kgpg.spec b/kgpg.spec new file mode 100644 index 0000000..5990633 --- /dev/null +++ b/kgpg.spec @@ -0,0 +1,95 @@ + +Name: kgpg +Summary: Manage GPG encryption keys +Version: 4.7.80 +Release: 2%{?dist} + +License: GPLv2+ +#URL: https://projects.kde.org/projects/kde/kdeutils/%{name} +URL: http://utils.kde.org/projects/%{name} +Source0: ftp://ftp.kde.org/pub/kde/unstable/%{version}/src/%{name}-%{version}.tar.bz2 + +## upstreamable patches +# add support for gpg2 to kgpg +Patch50: kdeutils-4.7.1-gpg2.patch + +BuildRequires: desktop-file-utils +BuildRequires: kdelibs4-devel >= %{version} +BuildRequires: kdepimlibs-devel >= %{version} + +# when split occured +Conflicts: kdeutils-common < 6:4.7.80 + +Obsoletes: kdeutils-kgpg < 6:4.7.80 +Provides: kdeutils-kgpg = 6:%{version}-%{release} + +%{?_kde4:Requires: kdepimlibs%{?_isa} >= %{_kde4_version}} +# kgpg (can be either gnupg or gnupg2, we'll default to the latter) +Requires: gnupg2 + + +%description +KGpg is a simple interface for GnuPG, a powerful encryption utility. + +%prep +%setup -q -n %{name}-%{version} + +%patch50 -p2 -b .gpg2 + + +%build +mkdir -p %{_target_platform} +pushd %{_target_platform} +%{cmake_kde4} .. +popd + +make %{?_smp_mflags} -C %{_target_platform} + + +%install +make install/fast DESTDIR=%{buildroot} -C %{_target_platform} + +%find_lang %{name} --with-kde --without-mo + + +%check +desktop-file-validate %{buildroot}%{_kde4_datadir}/applications/kde4/%{name}.desktop + + +%post +touch --no-create %{_kde4_iconsdir}/hicolor &> /dev/null ||: + +%posttrans +gtk-update-icon-cache %{_kde4_iconsdir}/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 ||: +update-desktop-database -q &> /dev/null ||: +fi + +%files -f %{name}.lang +%doc AUTHORS COPYING +%{_kde4_bindir}/kgpg +%{_kde4_appsdir}/kgpg/ +%{_datadir}/dbus-1/interfaces/org.kde.kgpg.*.xml +%{_kde4_datadir}/config.kcfg/kgpg.kcfg +%{_kde4_datadir}/autostart/kgpg.desktop +%{_kde4_iconsdir}/hicolor/*/apps/kgpg.* +%{_kde4_datadir}/applications/kde4/kgpg.desktop +%{_kde4_datadir}/kde4/services/ServiceMenus/encryptfile.desktop +%{_kde4_datadir}/kde4/services/ServiceMenus/encryptfolder.desktop +%{_kde4_datadir}/kde4/services/ServiceMenus/viewdecrypted.desktop + + + +%changelog +* Tue Nov 29 2011 Rex Dieter 4.7.80-2 +- improve Summary +- fix Source0 url + +* Sat Nov 26 2011 Rex Dieter 4.7.80-1 +- first try + diff --git a/sources b/sources index e69de29..9e5c811 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +b3731775d46443d429fccd6e0c9eb0d9 kgpg-4.7.80.tar.bz2