summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorzoe2016-02-05 22:40:32 +0100
committerzoe2016-02-05 22:40:32 +0100
commitebf2647de08ae74db72841940e4df8130532312b (patch)
treee7887ff1bc0d30a836ae05d210905adb606c6884
downloadaur-ebf2647de08ae74db72841940e4df8130532312b.tar.gz
Initial import
-rw-r--r--.SRCINFO24
-rw-r--r--PKGBUILD22
-rw-r--r--md5sha1calc-48.pngbin0 -> 8251 bytes
-rw-r--r--md5sha1calc.desktop10
-rw-r--r--md5sha1calc.install12
-rwxr-xr-xmd5sha1calc.sh21
6 files changed, 89 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..c328bec16c2
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,24 @@
+# Generated by mksrcinfo v8
+# Fri Feb 5 21:38:47 UTC 2016
+pkgbase = kf5-servicemenus-md5sha1calc
+ pkgdesc = A service menu in dolphin (right click) to compute md5sum and sha1sum of a file
+ pkgver = 0.1
+ pkgrel = 1
+ install = md5sha1calc.install
+ arch = i686
+ arch = x86_64
+ license = GPL
+ depends = dolphin
+ depends = kdebase-kdialog
+ depends = bash
+ source = md5sha1calc.sh
+ source = md5sha1calc.desktop
+ source = md5sha1calc.install
+ source = md5sha1calc-48.png
+ sha1sums = 32fb6e4c0e8a912e52135fada5193e96934164c3
+ sha1sums = 0d4029a52abd54dd8c80696649510a5f42b40f38
+ sha1sums = 03a6f50b4e2ddd87cfa62a318323f3120846499e
+ sha1sums = 17f74c726c406e516ac59eb91f8b7dd089c466bd
+
+pkgname = kf5-servicemenus-md5sha1calc
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..0087c42e7a3
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,22 @@
+# Maintainer: zoe <chp321 AT gmail DOT com>
+
+pkgname=kf5-servicemenus-md5sha1calc
+_srcname=md5sha1calc
+pkgver=0.1
+pkgrel=1
+pkgdesc="A service menu in dolphin (right click) to compute md5sum and sha1sum of a file"
+arch=('i686' 'x86_64')
+license=('GPL')
+depends=('dolphin' 'kdebase-kdialog' 'bash')
+install=${_srcname}.install
+source=(${_srcname}.sh ${_srcname}.desktop ${_srcname}.install ${_srcname}-48.png)
+sha1sums=('32fb6e4c0e8a912e52135fada5193e96934164c3'
+ '0d4029a52abd54dd8c80696649510a5f42b40f38'
+ '03a6f50b4e2ddd87cfa62a318323f3120846499e'
+ '17f74c726c406e516ac59eb91f8b7dd089c466bd')
+
+package() {
+ install -D -m755 ${_srcname}.sh ${pkgdir}/usr/bin/${_srcname}
+ install -D -m644 ${_srcname}.desktop "${pkgdir}/$(kf5-config --prefix)/share/kservices5/ServiceMenus/${_srcname}.desktop"
+ install -D -m644 ${_srcname}-48.png ${pkgdir}/usr/share/icons/hicolor/48x48/apps/${_srcname}.png
+} \ No newline at end of file
diff --git a/md5sha1calc-48.png b/md5sha1calc-48.png
new file mode 100644
index 00000000000..92b45f2e428
--- /dev/null
+++ b/md5sha1calc-48.png
Binary files differ
diff --git a/md5sha1calc.desktop b/md5sha1calc.desktop
new file mode 100644
index 00000000000..695f578ca22
--- /dev/null
+++ b/md5sha1calc.desktop
@@ -0,0 +1,10 @@
+[Desktop Entry]
+Type=Service
+ServiceTypes=KonqPopupMenu/Plugin,all/allfiles
+Icon=/usr/share/icons/gtkhash48.png
+Actions=calc
+
+[Desktop Action calc]
+Name=Calculer md5sum et sha1sum
+Icon=/usr/share/icons/gtkhash48.png
+Exec=md5sha1calc %U \ No newline at end of file
diff --git a/md5sha1calc.install b/md5sha1calc.install
new file mode 100644
index 00000000000..02d2e303620
--- /dev/null
+++ b/md5sha1calc.install
@@ -0,0 +1,12 @@
+
+post_install() {
+ update-desktop-database -q
+}
+
+post_upgrade() {
+ post_install
+}
+
+post_remove() {
+ post_install
+} \ No newline at end of file
diff --git a/md5sha1calc.sh b/md5sha1calc.sh
new file mode 100755
index 00000000000..4f5f443d87c
--- /dev/null
+++ b/md5sha1calc.sh
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+CheckedFile="$1"
+
+MD5SUM=`md5sum "$CheckedFile" | awk '{ print $1;}'`
+SHA1SUM=`sha1sum "$CheckedFile" | awk '{ print $1;}'`
+
+ kdialog --caption "md5sum Calculator" --yesno "File : $CheckedFile \n md5sum : $MD5SUM\n sha1sum : $SHA1SUM\n\n Save to file?"
+
+ if [ $? == 0 ];then
+ Result=`kdialog --menu "select" md5 md5sum sha1 sha1sum`
+
+ if [ $? == 0 ];then
+ if [ "$Result" == "md5" ];then
+ echo $MD5SUM > $CheckedFile".md5"
+ else
+ echo $SHA1SUM > $CheckedFile".sha1"
+ fi
+ fi
+ fi
+