--- charm-1.9.1.orig/debian/README.source
+++ charm-1.9.1/debian/README.source
@@ -0,0 +1 @@
+Please see /usr/share/doc/dpatch/README.source.gz for patch system information.
--- charm-1.9.1.orig/debian/copyright
+++ charm-1.9.1/debian/copyright
@@ -0,0 +1,35 @@
+This package was debianized by Christopher Lunsford
+<binarymutant@gmail.com> on
+Tue, 11 Nov 2008 19:58:29 -0500.
+
+It was downloaded from http://ljcharm.sourceforge.net/
+
+Upstream Author:
+
+    Lydia Leong <evilhat@livejournal.com>
+
+Copyright:
+
+    Copyright © 2001-2009 Lydia Leong
+
+License:
+
+    This package is free software; 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 2 of the License, or
+    (at your option) any later version.
+
+    This package 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 this package; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+
+On Debian systems, the complete text of the GNU General
+Public License can be found in `/usr/share/common-licenses/GPL-2'.
+
+The Debian packaging is Copyright © 2009, Christopher Lunsford <binarymutant@gmail.com> and
+is licensed under the GPL, see above.
--- charm-1.9.1.orig/debian/watch
+++ charm-1.9.1/debian/watch
@@ -0,0 +1,2 @@
+version=3
+http://sf.net/ljcharm/charm-(.*)\.tar\.gz
--- charm-1.9.1.orig/debian/control
+++ charm-1.9.1/debian/control
@@ -0,0 +1,21 @@
+Source: charm
+Section: web
+Priority: optional
+Uploaders: Python Applications Packaging Team <python-apps-team@lists.alioth.debian.org>
+Maintainer: Christopher Lunsford <binarymutant@gmail.com>
+XS-Python-Version: >=2.5
+Build-Depends: debhelper (>= 5.0.38), dpatch (>=2.0.29), python-support (>= 0.5.3), python (>=2.5)
+Standards-Version: 3.8.4
+Homepage: http://ljcharm.sourceforge.net/
+Vcs-Svn: svn://svn.debian.org/python-apps/packages/charm/trunk/
+Vcs-Browser: http://svn.debian.org/viewsvn/python-apps/packages/charm/trunk/
+
+Package: charm
+Architecture: all
+Depends: ${misc:Depends}, ${python:Depends}, python-feedparser (>=4.1)
+XB-Python-Version: ${python:Versions}
+Description: LiveJournal and Atom blogging client for the terminal
+ Charm is a client for journaling and blogging. It supports
+ LiveJournal, Atom, and MetaWeb. Charm is entirely text-based,
+ and can be used either to post directly from the command
+ line, or through interactive text menus.
--- charm-1.9.1.orig/debian/rules
+++ charm-1.9.1/debian/rules
@@ -0,0 +1,38 @@
+#!/usr/bin/make -f
+
+include /usr/share/dpatch/dpatch.make
+DEB_PYTHON_SYSTEM=pysupport
+
+clean: unpatch
+	dh_testdir
+	dh_testroot
+	rm -rf build/
+	rm -f *.pyc
+	python setup.py clean
+	dh_clean
+
+build:
+
+install: patch
+	python setup.py install --prefix=/usr/ --install-lib=usr/share/charm --root $(CURDIR)/debian/charm
+	dh_install ljcharm.py charm usr/share/charm/
+	dh_link usr/share/charm/charm usr/bin/charm
+
+binary-arch:
+
+binary-indep: build install
+	dh_testdir
+	dh_testroot
+	dh_installchangelogs CHANGES.charm
+	dh_installdocs charm.html sample.charmrc README.charm
+	dh_pysupport
+	dh_installman charm.1 charmrc.5
+	dh_compress
+	dh_fixperms
+	dh_installdeb
+	dh_gencontrol
+	dh_md5sums
+	dh_builddeb
+binary: binary-indep
+
+.PHONY: build clean binary-indep binary install
--- charm-1.9.1.orig/debian/changelog
+++ charm-1.9.1/debian/changelog
@@ -0,0 +1,20 @@
+charm (1.9.1-2) unstable; urgency=low
+
+  [ Christopher Lunsford ]
+  * hashlib patch added
+  * Changed the long description (Closes: #522272)
+  * Switched to python-support
+  * Updated the Standards-Version to 3.8.1
+
+  [ Piotr Ożarowski ]
+  * Set prefix to /usr/ (Closes: 571269)
+  * Updated the Standards-Version to 3.8.4 (no changes needed)
+
+ -- Python Applications Packaging Team <python-apps-team@lists.alioth.debian.org>  Thu, 20 May 2010 22:06:50 +0200
+
+charm (1.9.1-1) unstable; urgency=low
+
+  * Initial release (Closes: #502231)
+
+ -- Christopher Lunsford <binarymutant@gmail.com>  Tue, 11 Nov 2008 19:58:29 -0500
+
--- charm-1.9.1.orig/debian/compat
+++ charm-1.9.1/debian/compat
@@ -0,0 +1 @@
+5
--- charm-1.9.1.orig/debian/source/format
+++ charm-1.9.1/debian/source/format
@@ -0,0 +1 @@
+1.0
--- charm-1.9.1.orig/debian/patches/01_hyphens.dpatch
+++ charm-1.9.1/debian/patches/01_hyphens.dpatch
@@ -0,0 +1,273 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 01_hyphens.dpatch by  <binarymutant@gmail.com>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Escape hyphens
+
+@DPATCH@
+diff -urNad charm-1.9.1~/charm.1 charm-1.9.1/charm.1
+--- charm-1.9.1~/charm.1	2009-01-11 16:21:15.000000000 -0500
++++ charm-1.9.1/charm.1	2009-01-23 11:05:16.000000000 -0500
+@@ -5,96 +5,96 @@
+ .SH SYNOPSIS
+ .B charm
+ [
+-.B -h, \-\-help
++.B \-h, \-\-help
+ ]
+ 
+ .B charm
+ [
+-.B -o, \-\-options
++.B \-o, \-\-options
+ ]
+ 
+ .B charm 
+ [
+-.B -f, \-\-file
++.B \-f, \-\-file
+ .I FILENAME
+ ] [
+-.B -u, \-\-user
++.B \-u, \-\-user
+ .I USERNAME
+ ] [
+-.B -c, \-\-check
++.B \-c, \-\-check
+ ] [
+-.B -i, \-\-interval
++.B \-i, \-\-interval
+ .I MINUTES
+ ] [
+-.B -g, \-\-group
++.B \-g, \-\-group
+ .I FRIENDGROUP
+ ]
+ 
+ .B charm 
+ [
+-.B -f, \-\-file
++.B \-f, \-\-file
+ .I FILENAME
+ ] [
+-.B -u, \-\-user
++.B \-u, \-\-user
+ .I USERNAME
+ ] [
+-.B -z, \-\-sync
++.B \-z, \-\-sync
+ ] [
+-.B -a, \-\-archive
++.B \-a, \-\-archive
+ .I DIR
+ ]
+ 
+ .B charm 
+ [
+-.B -f, \-\-file
++.B \-f, \-\-file
+ .I FILENAME
+ ] [
+-.B -u, \-\-user
++.B \-u, \-\-user
+ .I USERNAME
+ ] [
+-.B -l, \-\-login
++.B \-l, \-\-login
+ ] [
+-.B -n, \-\-nologin
++.B \-n, \-\-nologin
+ ] [
+-.B -d, \-\-drafts
++.B \-d, \-\-drafts
+ .I DIR
+ ] [
+-.B -a, \-\-archive
++.B \-a, \-\-archive
+ .I DIR
+ ] [
+-.B -r, \-\-resume
++.B \-r, \-\-resume
+ .I DRAFTFILE
+ ] [
+-.B -T, \-\-template
++.B \-T, \-\-template
+ .I TEMPLATE
+ ] [
+-.B -x, \-\-xpost
++.B \-x, \-\-xpost
+ .I ARCHIVEFILE
+ ] [
+-.B -q, \-\-quick
++.B \-q, \-\-quick
+ ] [
+-.B -j, \-\-journal
++.B \-j, \-\-journal
+ .I JOURNAL
+ ] [
+-.B -s, \-\-subject
++.B \-s, \-\-subject
+ .I "SUBJECT"
+ ] [
+-.B -p, \-\-permit
++.B \-p, \-\-permit
+ .I PERMISSION
+ ] [
+-.B -m, \-\-mood
++.B \-m, \-\-mood
+ .I MOOD
+ ] [
+-.B -k, \-\-pic
++.B \-k, \-\-pic
+ .I KEYWORD
+ ] [
+-.B -t, \-\-tag
++.B \-t, \-\-tag
+ .I "TAG"
+ ] [
+-.B -M, \-\-music
++.B \-M, \-\-music
+ .I "MUSIC"
+ ] [
+-.B -A, \-\-autodetect
++.B \-A, \-\-autodetect
+ ] [
+ .B \-\-autoformat
+ .I STATUS
+@@ -119,111 +119,111 @@
+ .SH GENERAL OPTIONS
+ 
+ .TP
+--h, \-\-help
++\-h, \-\-help
+ Print a help message.
+ 
+ .TP
+--o, \-\-options
++\-o, \-\-options
+ Print the posting options.
+ 
+ .TP
+--f, \-\-file FILENAME
++\-f, \-\-file FILENAME
+ Specify the configuration file to read at startup.
+ 
+ .TP
+--u, \-\-user USERNAME
++\-u, \-\-user USERNAME
+ Specify the journal user to perform operations as.
+ 
+ .SH FRIENDS-CHECKING OPTIONS
+ 
+ .TP
+--c, \-\-check
++\-c, \-\-check
+ Utilize friends-checking mode.
+ 
+ .TP
+--i, \-\-interval MINUTES
++\-i, \-\-interval MINUTES
+ Specify how many minutes to wait between checks.
+ 
+ .TP
+--g, \-\-group FRIENDGROUP
++\-g, \-\-group FRIENDGROUP
+ Specify which friend groups to limit check to. Can be specified multiple times.
+ 
+ .SH SYNCHRONIZATION OPTIONS
+ 
+ .TP
+--z, \-\-sync
++\-z, \-\-sync
+ Utilize synchronization (journal download) mode.
+ 
+ .TP
+--a, \-\-archive DIRECTORY
++\-a, \-\-archive DIRECTORY
+ Save synchronized posts to this directory.
+ 
+ .SH POSTING OPTIONS
+ 
+ .TP
+--l, \-\-login
++\-l, \-\-login
+ Log in when Charm is started.
+ 
+ .TP
+--n, \-\-nologin
++\-n, \-\-nologin
+ Do not log in when Charm is started.
+ 
+ .TP
+--d, \-\-drafts DIRECTORY
++\-d, \-\-drafts DIRECTORY
+ Use this directory to save in-progress journal entry drafts.
+ 
+ .TP
+--a, \-\-archive DIRECTORY
++\-a, \-\-archive DIRECTORY
+ Use this directory to save completed posts.
+ 
+ .TP
+--r, \-\-resume DRAFTFILE
++\-r, \-\-resume DRAFTFILE
+ Resume a previous session, reading from this saved draft file.
+ 
+ .TP
+--T, \-\-template TEMPLATE
++\-T, \-\-template TEMPLATE
+ Read the content of this template file at startup, pre-populating the post.
+ 
+ .TP
+--x, \-\-xpost ARCHIVEFILE
++\-x, \-\-xpost ARCHIVEFILE
+ Prepare to cross-post, reading from a saved archive file.
+ 
+ .TP
+--q, \-\-quick
++\-q, \-\-quick
+ Non-interactive mode. Read journal entry text from standard input, and post
+ it immediately, rather than using the menu-based interactive editing.
+ 
+ .TP
+--j, \-\-journal JOURNAL
++\-j, \-\-journal JOURNAL
+ Specify the journal to post to.
+ 
+ .TP
+--s, \-\-subject "SUBJECT"
++\-s, \-\-subject "SUBJECT"
+ Use this as the subject line of the journal entry.
+ 
+ .TP
+--p, \-\-permit PERMISSION
++\-p, \-\-permit PERMISSION
+ Use this for the post permissions. Can be "public", "private", "friends",
+ or a list of friend groups separated by commas.
+ 
+ .TP
+--m, \-\-mood MOOD
++\-m, \-\-mood MOOD
+ Use this for the mood of this entry.
+ 
+ .TP
+--k, \-\-pic KEYWORD
++\-k, \-\-pic KEYWORD
+ Use this picture keyword for the userpic of this entry.
+ 
+ .TP
+--t, \-\-tag TAG
++\-t, \-\-tag TAG
+ Use this tag for this entry.
+ 
+ .TP
+--M, \-\-music "MUSIC"
++\-M, \-\-music "MUSIC"
+ Use this as the music for this entry.
+ 
+ .TP
+--A, \-\-autodetect
++\-A, \-\-autodetect
+ Use XMMS to automatically determine what music to use for this entry.
+ 
+ .TP
--- charm-1.9.1.orig/debian/patches/00list
+++ charm-1.9.1/debian/patches/00list
@@ -0,0 +1,2 @@
+01_hyphens.dpatch
+02_hashlib.dpatch
--- charm-1.9.1.orig/debian/patches/02_hashlib.dpatch
+++ charm-1.9.1/debian/patches/02_hashlib.dpatch
@@ -0,0 +1,57 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## hashlib.dpatch by  <binarymutant@gmail.com>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Use hashlib instead of deprecated md5 and sha modules
+
+@DPATCH@
+diff -urNad charm-1.9.1~/ljcharm.py charm-1.9.1/ljcharm.py
+--- charm-1.9.1~/ljcharm.py	2009-01-11 16:21:15.000000000 -0500
++++ charm-1.9.1/ljcharm.py	2009-06-12 20:23:45.000000000 -0400
+@@ -38,7 +38,7 @@
+ import time
+ import locale
+ import stat
+-import md5
++import hashlib
+ import urllib
+ import calendar
+ 
+@@ -47,7 +47,6 @@
+     import httplib
+     import base64
+     import datetime
+-    import sha
+     atom_ok = 1
+ except:
+     atom_ok = 0
+@@ -289,9 +288,9 @@
+     #    module. We provide an alternative, for earlier versions.
+ 
+     try:
+-	hexd = md5.hexdigest(sstr)
++	hexd = hashlib.md5.hexdigest(sstr)
+     except AttributeError:
+-	digest = md5.new(sstr).digest()
++	digest = hashlib.md5(sstr).digest()
+         hexd = string.join(map(lambda c: "%s%s" % (string.hexdigits[ord(c) / 16], string.hexdigits[ord(c) % 16]), digest), "")
+ 
+     return hexd
+@@ -300,7 +299,7 @@
+ def get_nonce(tstamp):
+     "Create a nonce."
+ 
+-    sstr = sha.new("%s:%s" % (tstamp, Client_Name)).hexdigest() 
++    sstr = hashlib.sha("%s:%s" % (tstamp, Client_Name)).hexdigest() 
+     return "%s %s" % (tstamp, sstr)
+ 
+ 
+@@ -5808,7 +5807,7 @@
+ 
+             tstamp = time.strftime("%Y-%m-%dT%H:%M:%SZ", time.gmtime())
+             nonce = get_nonce(tstamp)
+-            pdigest = base64.encodestring(sha.new("%s%s%s" % (nonce, tstamp, self.Params["hpassword"])).digest())[:-1]
++            pdigest = base64.encodestring(hashlib.sha("%s%s%s" % (nonce, tstamp, self.Params["hpassword"])).digest())[:-1]
+             
+             headers["Authorization"] = 'WSSE profile="UsernameToken"'
+             headers["X-WSSE"] = 'UsernameToken Username="%s", PasswordDigest="%s", Created="%s", Nonce="%s"' % (self.Params["user"], pdigest, tstamp, nonce)
