realeasing alpha v2.18 - archlinux build

This commit is contained in:
a-Sansara 2013-05-16 02:14:38 +02:00
parent db4adc0518
commit 23741be148
24 changed files with 175 additions and 166 deletions

9
README
View File

@ -3,15 +3,14 @@ Kirmah 2.18 (2013-05-15)
Install on Archlinux Install on Archlinux
------------------------- -------------------------
sudo pacman -U http://sourceforge.net/projects/kirmah/files/packages/archlinux/kirmah-2.18-1-any.pkg.tar.xz/download sudo pacman -U http://sourceforge.net/projects/kirmah/files/kirmah-2.18/packages/archlinux/kirmah-2.18-1-any.pkg.tar.xz/download
(re)build instruction (re)build instruction
------------------------- -------------------------
mkdir /tmp/kirmah; cd /tmp/kirmah; mkdir /tmp/kirmah; cd /tmp/kirmah;
wget http://sourceforge.net/projects/kirmah/files/packages/archlinux/PKGBUILD/download wget http://sourceforge.net/projects/kirmah/files/kirmah-2.18/packages/archlinux/PKGBUILD/download
mv download PKGBUILD mv download PKGBUILD
wget http://sourceforge.net/projects/kirmah/files/packages/archlinux/kirmah.install/download wget http://sourceforge.net/projects/kirmah/files/kirmah-2.18/packages/archlinux/kirmah.install/download
mv download kirmah.install mv download kirmah.install
makepkg -s; makepkg -s;
@ -24,4 +23,4 @@ simply untar archive, then launch :
$ python ./kirmah/kirmah.py $ python ./kirmah/kirmah.py
$ python ./kirmah/kirmah-cli.py $ python ./kirmah/kirmah-cli.py
you can also use python2 disutils and setup.py you can also use python disutils and setup.py

View File

@ -1,4 +1,4 @@
# !/usr/bin/env python #!/usr/bin/env python3
#-*- coding: utf-8 -*- #-*- coding: utf-8 -*-
# kirmah-cli.py # kirmah-cli.py
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #

View File

@ -1,4 +1,4 @@
# !/usr/bin/env python #!/usr/bin/env python3
#-*- coding: utf-8 -*- #-*- coding: utf-8 -*-
# kirmah.app.py # kirmah.app.py
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #

View File

@ -1,4 +1,4 @@
# !/usr/bin/env python #!/usr/bin/env python3
#-*- coding: utf-8 -*- #-*- coding: utf-8 -*-
# kirmah.cli.py # kirmah.cli.py
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #

View File

@ -1,4 +1,4 @@
# !/usr/bin/env python #!/usr/bin/env python3
#-*- coding: utf-8 -*- #-*- coding: utf-8 -*-
# kirmah/cliapp.py # kirmah/cliapp.py
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #

View File

@ -1,4 +1,4 @@
# !/usr/bin/env python #!/usr/bin/env python3
#-*- coding: utf-8 -*- #-*- coding: utf-8 -*-
# kirmah/conf.py # kirmah/conf.py
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
@ -33,7 +33,7 @@
from getpass import getuser as getUserLogin from getpass import getuser as getUserLogin
from os import sep from os import sep
from os.path import dirname, realpath from os.path import dirname, realpath, isdir, join
PRG_NAME = 'Kirmah' PRG_NAME = 'Kirmah'
PRG_PACKAGE = PRG_NAME.lower() PRG_PACKAGE = PRG_NAME.lower()
@ -45,18 +45,14 @@ PRG_COPY = 'pluie.org'
PRG_YEAR = '2013' PRG_YEAR = '2013'
PRG_WEBSITE = 'http://kirmah.sourceforge.net' PRG_WEBSITE = 'http://kirmah.sourceforge.net'
PRG_LICENSE = 'GNU GPL v3' PRG_LICENSE = 'GNU GPL v3'
PRG_RESOURCES_PATH = '/usr/share/pixmaps/'+PRG_PACKAGE+'/' PRG_RESOURCES_PATH = '/usr/share/'+PRG_PACKAGE+sep
try: if not isdir(PRG_RESOURCES_PATH):
with open(PRG_RESOURCES_PATH) as f: PRG_RESOURCES_PATH = dirname(dirname(realpath(__file__)))+sep+'resources'+sep+PRG_PACKAGE+sep
pass
except IOError as e:
PRG_RESOURCES_PATH = dirname(dirname(realpath(__file__)))+sep+'resources'+sep
pass
print(PRG_RESOURCES_PATH) print(PRG_RESOURCES_PATH)
PRG_GLADE_PATH = PRG_RESOURCES_PATH+PRG_PACKAGE+sep+'glade'+sep+PRG_PACKAGE+'.glade' PRG_GLADE_PATH = PRG_RESOURCES_PATH+'glade'+sep+PRG_PACKAGE+'.glade'
PRG_LICENSE_PATH = PRG_RESOURCES_PATH+PRG_PACKAGE+'/LICENSE' PRG_LICENSE_PATH = PRG_RESOURCES_PATH+'/LICENSE'
PRG_LOGO_PATH = PRG_RESOURCES_PATH+'pixmaps'+sep+PRG_PACKAGE+sep+PRG_PACKAGE+'.png' PRG_LOGO_PATH = join(PRG_RESOURCES_PATH,'..'+sep,'pixmaps'+sep,PRG_PACKAGE+sep,PRG_PACKAGE+'.png')
PRG_LOGO_ICON_PATH = PRG_RESOURCES_PATH+'pixmaps'+sep+PRG_PACKAGE+sep+PRG_PACKAGE+'_ico.png' PRG_LOGO_ICON_PATH = join(PRG_RESOURCES_PATH,'..'+sep,'pixmaps'+sep,PRG_PACKAGE+sep,PRG_PACKAGE+'_ico.png')
PRG_ABOUT_LOGO_SIZE = 160 PRG_ABOUT_LOGO_SIZE = 160
PRG_ABOUT_COPYRIGHT = '(c) '+PRG_AUTHOR+' - '+PRG_COPY+' '+PRG_YEAR PRG_ABOUT_COPYRIGHT = '(c) '+PRG_AUTHOR+' - '+PRG_COPY+' '+PRG_YEAR
PRG_ABOUT_COMMENTS = ''.join(['Kirmah simply encrypt/decrypt files','\n', 'license ',PRG_LICENSE]) PRG_ABOUT_COMMENTS = ''.join(['Kirmah simply encrypt/decrypt files','\n', 'license ',PRG_LICENSE])

View File

@ -1,4 +1,4 @@
# !/usr/bin/env python #!/usr/bin/env python3
#-*- coding: utf-8 -*- #-*- coding: utf-8 -*-
# kirmah/crypt.py # kirmah/crypt.py
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #

View File

@ -1,4 +1,4 @@
# !/usr/bin/env python #!/usr/bin/env python3
#-*- coding: utf-8 -*- #-*- coding: utf-8 -*-
# kirmah.gui.py # kirmah.gui.py
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #

View File

@ -1,111 +0,0 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# #
# software : Kirmah <http://kirmah.sourceforge.net/> #
# version : 2.1 #
# date : 2013 #
# licence : GPLv3.0 <http://www.gnu.org/licenses/> #
# author : a-Sansara <http://www.a-sansara.net/> #
# copyright : pluie.org <http://www.pluie.org/> #
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# This file is part of Kirmah.
#
# Kirmah is free software (free as in speech) : 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.
#
# Kirmah 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 Kirmah. If not, see <http://www.gnu.org/licenses/>.
from gi.repository.GObject import timeout_add
from psr.sys import Sys
from psr.mproc import Ctrl
from psr.decorate import log
from kirmah.crypt import Kirmah, ConfigKey, KeyGen, b2a_base64, a2b_base64, hash_sha256
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# ~~ class KCtrl ~~
class KCtrl(Ctrl):
@log
def encrypt(self, fromPath, toPath, km, header=None, callback=None, timeout=50):
""""""
self.tstart = Sys.datetime.now()
self.km = km
self.callback = callback
self.fromPath = fromPath
self.toPath = toPath
if Sys.g.DEBUG : Sys.pcontent(' Encrypting file : '+self.fromPath+' ('+Sys.getFileSize(self.fromPath)+') by '+str(self.nproc)+' process')
if self.nproc < 2:
self.km.encrypt(self.fromPath, self.toPath, header)
self.on_end_mpenc()
else :
self.ppid = Sys.getpid()
self.fp, self.tp, self.rmode, self.mmode, self.compend = self.km.encrypt_sp_start(fromPath, toPath, header)
self.hsltPaths = self.km.prepare_mproc_encode(self.fp, self.nproc)
self.bind_task(self.mpenc)
self.start(timeout, None, self.on_end_mpenc)
@log
def decrypt(self, fromPath, toPath, km, callback=None, timeout=50):
""""""
self.tstart = Sys.datetime.now()
self.km = km
self.callback = callback
self.fromPath = fromPath
self.toPath = toPath
self.ppid = Sys.getpid()
if Sys.g.DEBUG : Sys.pcontent(' Decrypting file : '+self.fromPath+' ('+Sys.getFileSize(self.fromPath)+') by '+str(self.nproc)+' process')
if self.nproc < 2:
self.decrypt(fromPath, toPath)
self.on_end_mpdec()
else :
self.fp, self.tp, self.compstart = self.km.decrypt_sp_start(fromPath, toPath)
self.hsltPaths = self.km.prepare_mproc_decode(self.fp, self.nproc)
self.bind_task(self.mpdec)
self.start(50, None, self.on_end_mpdec)
#~ @log
def getSubStartIndice(self, id):
""""""
return sum([ len(x) for j, x in enumerate(self.data) if j < id ])%len(self.km.key)
@log
def mpenc(self, id):
""""""
self.km.mproc_encode_part(id, self.ppid)
@log
def mpdec(self, id):
""""""
self.km.mproc_decode_part(id, self.ppid)
@log
def on_end_mpdec(self):
""""""
if self.nproc > 1 :
self.km.mpMergeFiles(self.hsltPaths, self.tp)
self.km.decrypt_sp_end(self.tp, self.toPath, self.compstart)
if self.callback is not None : self.callback(self.tstart, True)
@log
def on_end_mpenc(self):
""""""
if self.nproc > 1 :
self.km.mpMergeFiles(self.hsltPaths, self.tp)
self.fp, self.tp = self.tp, self.km.tmpPath2 if self.tp == self.km.tmpPath1 else self.km.tmpPath1
self.km.encrypt_sp_end(self.fp, self.tp, self.toPath, self.rmode, self.mmode, self.compend)
if self.callback is not None : self.callback(self.tstart, True)

View File

@ -1,4 +1,4 @@
# !/usr/bin/env python #!/usr/bin/env python3
#-*- coding: utf-8 -*- #-*- coding: utf-8 -*-
# kirmah/ui.py # kirmah/ui.py
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #

23
pkgbuild/PKGBUILD Executable file
View File

@ -0,0 +1,23 @@
# Maintainer : a-Sansara <[a-sansara]at[clochardprod]dot[net]>
# Contributor :
pkgname=kirmah
pkgver=2.18
pkgrel=1
pkgdesc='Encryption with symmetric-key algorithm Kirmah. cli tool and gtk+ GUI front-end'
arch=('any')
url='https://sourceforge.net/projects/kirmah/'
license=('GPL3')
depends=('python3' 'python-gobject' 'gobject-introspection' 'pygtk' 'desktop-file-utils')
install="${pkgname}.install"
source=("http://download.pluie.org/packages/archlinux/${pkgname}-${pkgver}.tar.bz2")
md5sums=('aa396a5dc79adfe8d2dfcb041d834dfa')
build() {
cd "${srcdir}/${pkgname}"
python3 setup.py build
}
package() {
cd "${srcdir}/${pkgname}"
python3 setup.py install --root="${pkgdir}" --prefix=/usr --optimize=1
}

12
pkgbuild/kirmah.install Executable file
View File

@ -0,0 +1,12 @@
post_install() {
update-desktop-database -q
}
post_upgrade() {
post_install $1
}
post_remove() {
post_install $1
echo "you should mannually remove /home/$USER/.kirmah"
}

View File

@ -1,4 +1,4 @@
# !/usr/bin/env python #!/usr/bin/env python3
#-*- coding: utf-8 -*- #-*- coding: utf-8 -*-
# kirmah.cli.py # kirmah.cli.py
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #

View File

@ -1,4 +1,4 @@
# !/usr/bin/env python #!/usr/bin/env python3
#-*- coding: utf-8 -*- #-*- coding: utf-8 -*-
# psr/const.py # psr/const.py
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #

View File

@ -1,4 +1,4 @@
# !/usr/bin/env python #!/usr/bin/env python3
#-*- coding: utf-8 -*- #-*- coding: utf-8 -*-
# psr/io.py # psr/io.py
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #

View File

@ -1,4 +1,4 @@
# !/usr/bin/env python #!/usr/bin/env python3
#-*- coding: utf-8 -*- #-*- coding: utf-8 -*-
# psr/log.py # psr/log.py
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #

View File

@ -1,4 +1,4 @@
# !/usr/bin/env python #!/usr/bin/env python3
#-*- coding: utf-8 -*- #-*- coding: utf-8 -*-
# psr/mproc.py # psr/mproc.py
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #

View File

@ -1,4 +1,4 @@
# !/usr/bin/env python #!/usr/bin/env python3
#-*- coding: utf-8 -*- #-*- coding: utf-8 -*-
# psr/sys.py # psr/sys.py
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #

View File

@ -1,4 +1,4 @@
# !/usr/bin/env python #!/usr/bin/env python3
#-*- coding: utf-8 -*- #-*- coding: utf-8 -*-
# psr/w32color.py # psr/w32color.py
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #

View File

@ -3,7 +3,7 @@
Name=Kirmah Name=Kirmah
Comment=Encryption with symmetric-key algorithm Kirmah Comment=Encryption with symmetric-key algorithm Kirmah
Version=0.34 Version=0.34
Icon=kirmah Icon=/usr/share/pixmaps/kirmah/kirmah.png
Exec=kirmah Exec=kirmah
Terminal=false Terminal=false
Type=Application Type=Application

45
scripts/kirmah Normal file
View File

@ -0,0 +1,45 @@
#!/usr/bin/env python3
#-*- coding: utf-8 -*-
# kirmah.py
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# software : Kirmah <http://kirmah.sourceforge.net/>
# version : 2.17
# date : 2013
# licence : GPLv3.0 <http://www.gnu.org/licenses/>
# author : a-Sansara <[a-sansara]at[clochardprod]dot[net]>
# copyright : pluie.org <http://www.pluie.org/>
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# This file is part of Kirmah.
#
# Kirmah is free software (free as in speech) : 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.
#
# Kirmah 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 Kirmah. If not, see <http://www.gnu.org/licenses/>.
#
from psr.sys import Sys, Const
from kirmah.gui import AppGui
def main():
try:
c = 0
AppGui()
except Exception as e:
Sys.pwarn((('main : ',(str(e),Sys.CLZ_ERROR_PARAM), ' !'),), True)
#~ raise e
c = 1
return c
if __name__ == '__main__':
Sys.exit(main())

45
scripts/kirmah-cli Normal file
View File

@ -0,0 +1,45 @@
#!/usr/bin/env python3
#-*- coding: utf-8 -*-
# kirmah-cli.py
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# software : Kirmah <http://kirmah.sourceforge.net/>
# version : 2.18
# date : 2013
# licence : GPLv3.0 <http://www.gnu.org/licenses/>
# author : a-Sansara <[a-sansara]at[clochardprod]dot[net]>
# copyright : pluie.org <http://www.pluie.org/>
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# This file is part of Kirmah.
#
# Kirmah is free software (free as in speech) : 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.
#
# Kirmah 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 Kirmah. If not, see <http://www.gnu.org/licenses/>.
#
from psr.sys import Sys, Const
from kirmah.cli import Cli
def main():
try:
c = 0
Cli('.'+Sys.sep)
except Exception as e :
Sys.pwarn((('main : ',(str(e),Sys.CLZ_ERROR_PARAM), ' !'),), True)
#~ raise e
c = 1
return c
if __name__ == '__main__':
Sys.exit(main())

View File

@ -1,4 +1,4 @@
# !/usr/bin/env python #!/usr/bin/env python3
#-*- coding: utf-8 -*- #-*- coding: utf-8 -*-
# setup.py # setup.py
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
@ -28,7 +28,7 @@
# along with Kirmah. If not, see <http://www.gnu.org/licenses/>. # along with Kirmah. If not, see <http://www.gnu.org/licenses/>.
# #
from psr.kirmah import conf from kirmah import conf
from distutils.core import setup from distutils.core import setup
import glob import glob
import os import os
@ -43,8 +43,8 @@ for filepath in glob.glob('resources/locale/*/LC_MESSAGES/*.mo'):
setup(name = conf.PRG_NAME, setup(name = conf.PRG_NAME,
version = conf.PRG_VERS, version = conf.PRG_VERS,
packages = [conf.PRG_PACKAGE], packages = [conf.PRG_PACKAGE, 'psr'],
scripts = [conf.PRG_SCRIPT, conf.PRG_CLI_NAME], scripts = ['scripts/'+conf.PRG_SCRIPT, 'scripts/'+conf.PRG_CLI_NAME],
data_files= [('/usr/share/pixmaps/'+conf.PRG_PACKAGE , glob.glob('resources/pixmaps/'+conf.PRG_PACKAGE+'/*.png')), data_files= [('/usr/share/pixmaps/'+conf.PRG_PACKAGE , glob.glob('resources/pixmaps/'+conf.PRG_PACKAGE+'/*.png')),
('/usr/share/applications' , ['resources/'+conf.PRG_PACKAGE+'.desktop']), ('/usr/share/applications' , ['resources/'+conf.PRG_PACKAGE+'.desktop']),
('/usr/share/'+conf.PRG_PACKAGE , glob.glob('resources/'+conf.PRG_PACKAGE+'/LICENSE')), ('/usr/share/'+conf.PRG_PACKAGE , glob.glob('resources/'+conf.PRG_PACKAGE+'/LICENSE')),