summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--debian/README.Debian18
-rw-r--r--debian/README.source18
-rw-r--r--debian/changelog46
-rw-r--r--debian/compat1
-rw-r--r--debian/control28
-rw-r--r--debian/copyright45
-rw-r--r--debian/dirs2
-rw-r--r--debian/docs2
-rw-r--r--debian/mwc.155
-rwxr-xr-xdebian/mwc.cr7
-rw-r--r--debian/mwc.examples2
-rw-r--r--debian/mwc.install2
-rw-r--r--debian/mwc.links3
-rw-r--r--debian/mwc.manpages2
l---------debian/mwcfeedserver.11
-rw-r--r--debian/patches/0100-config.diff115
-rw-r--r--debian/patches/0105-try_mail.diff52
-rw-r--r--debian/patches/0110-syslog.diff96
-rw-r--r--debian/patches/0115-Add_header.patch50
-rw-r--r--debian/patches/series4
-rwxr-xr-xdebian/rules9
-rw-r--r--debian/source/format1
-rw-r--r--debian/watch4
23 files changed, 563 insertions, 0 deletions
diff --git a/debian/README.Debian b/debian/README.Debian
new file mode 100644
index 0000000..18c2d15
--- /dev/null
+++ b/debian/README.Debian
@@ -0,0 +1,18 @@
+mwc for Debian
+--------------
+
+1.) For a example based setup copy the example to /etc/mwc:
+
+ cp -f /usr/share/doc/mwc/examples/mwc-config_template.py /etc/mwc/mwc-config.py
+
+
+2.) For running every hour you can copy
+
+ cp -f /usr/share/doc/mwc/examples/mwc /etc/cron.hourly/mwc
+
+3.) You find the documentation in the file README.md or on
+
+ https://github.com/Debianguru/MailWebsiteChanges#mailwebsitechanges
+
+
+ -- Jörg Frings-Fürst <debian@jff-webhosting.net> Thu, 18 Sep 2014 22:49:00 +0200
diff --git a/debian/README.source b/debian/README.source
new file mode 100644
index 0000000..e4f2b3d
--- /dev/null
+++ b/debian/README.source
@@ -0,0 +1,18 @@
+Hello,
+
+now I use the branching model from Vincent Driessen[1].
+
+I use the gitflow-avh[2]. with the Documentation[3].
+The Debian package can be found here[4].
+
+Please upload unattended uploads use a branch feature/<your title>.
+
+
+Many thanks.
+
+ -- Jörg Frings-Fürst <debian@jff-webhosting.net> Fri, 02 Jun 2017 19:00:40 +0200
+
+[1] http://nvie.com/posts/a-successful-git-branching-model/
+[2] https://github.com/petervanderdoes/gitflow-avh
+[3] https://github.com/petervanderdoes/gitflow-avh/wiki
+[4] https://tracker.debian.org/pkg/git-flow
diff --git a/debian/changelog b/debian/changelog
new file mode 100644
index 0000000..18767a8
--- /dev/null
+++ b/debian/changelog
@@ -0,0 +1,46 @@
+mwc (1.7.6-1) UNRELEASED; urgency=medium
+
+ * New upstream release.
+ * Renumbering patches.
+ * debian/patches/0105-try_mail.diff:
+ - Replace undefined printf with print (Closes: #860494).
+ * Rewrite debian/watch for archives without "v" in front of the version.
+ * Declare compliance with Debian Policy 4.0.0. (No changes needed).
+ * Bump compatlevel to 10 (no changes required):
+ - Change debian/compat to 10.
+ - At debian/control change requested version of debhelper to >= 10.
+ * At debian/control change Vcs-Browser to secure URI.
+ * debian/copyright:
+ - Refresh copyright year at * and debian/*.
+ * New README.source to explain the branching model used.
+
+ -- Jörg Frings-Fürst <debian@jff-webhosting.net> Sun, 06 Aug 2017 19:52:54 +0200
+
+mwc (1.7.2-3) unstable; urgency=medium
+
+ * Work for the python3.5 transition (Closes: #799232):
+ - debian/control:
+ + Simplify Python 3 related build-depends and depends to reflect actual
+ requirements.
+ - debian/rules:
+ + Remove redundant call to dh_python3.
+ - Thanks to Scott Kitterman <debian@kitterman.com>.
+ * debian/copyright:
+ - Add 2015 to debian/*
+
+ -- Jörg Frings-Fürst <debian@jff-webhosting.net> Sun, 27 Sep 2015 13:12:22 +0200
+
+mwc (1.7.2-2) unstable; urgency=medium
+
+ * debian/control:
+ - Replace Depends python-cssselect with python3-cssselect
+ (Closes: #764787).
+ - Bump Standards-Version to 3.9.6 (no changes required).
+
+ -- Jörg Frings-Fürst <debian@jff-webhosting.net> Mon, 10 Nov 2014 09:37:29 +0100
+
+mwc (1.7.2-1) unstable; urgency=low
+
+ * Initial release (Closes: #746556)
+
+ -- Jörg Frings-Fürst <debian@jff-webhosting.net> Thu, 18 Sep 2014 10:49:00 +0200
diff --git a/debian/compat b/debian/compat
new file mode 100644
index 0000000..f599e28
--- /dev/null
+++ b/debian/compat
@@ -0,0 +1 @@
+10
diff --git a/debian/control b/debian/control
new file mode 100644
index 0000000..f38df7d
--- /dev/null
+++ b/debian/control
@@ -0,0 +1,28 @@
+Source: mwc
+Section: utils
+Priority: optional
+Maintainer: Jörg Frings-Fürst <debian@jff-webhosting.net>
+Build-Depends:
+ debhelper (>= 10),
+ dh-python,
+ python3-all
+Standards-Version: 4.0.0
+Homepage: https://github.com/Debianguru/MailWebsiteChanges
+Vcs-Git: git://anonscm.debian.org/collab-maint/mwc.git
+Vcs-Browser: https://anonscm.debian.org/cgit/collab-maint/mwc.git
+
+Package: mwc
+Architecture: all
+Depends:
+ ${misc:Depends},
+ ${python3:Depends},
+ python3-lxml,
+ python3-cssselect
+Description: Powerful website-tracking tool
+ MailWebsiteChanges is a Python script to keep track of website
+ changes; sends email notifications on updates and/or also
+ provides an RSS feed.
+ .
+ To specify which parts of a website should be monitored, XPath
+ selectors, CSS selectors, and regular expressions can be used
+ (just choose the tools you like!).
diff --git a/debian/copyright b/debian/copyright
new file mode 100644
index 0000000..4976aef
--- /dev/null
+++ b/debian/copyright
@@ -0,0 +1,45 @@
+Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: mwc
+Source: https://github.com/Debianguru/MailWebsiteChanges
+
+Files: *
+Copyright: 2013-2017 Michael Till Beck <Debianguru@gmx.de>
+License: GPL-2+
+
+Files: debian/*
+Copyright: 2014-2017 Jörg Frings-Fürst <debian@jff-webhosting.net>
+License: GPL-3+
+
+License: GPL-2+
+ 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 program. If not, see <http://www.gnu.org/licenses/>
+ .
+ On Debian systems, the complete text of the GNU General
+ Public License version 2 can be found in "/usr/share/common-licenses/GPL-2".
+
+License: GPL-3+
+ 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 3 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 program. If not, see <http://www.gnu.org/licenses/>
+ .
+ On Debian systems, the complete text of the GNU General
+ Public License version 3 can be found in "/usr/share/common-licenses/GPL-3".
diff --git a/debian/dirs b/debian/dirs
new file mode 100644
index 0000000..870600a
--- /dev/null
+++ b/debian/dirs
@@ -0,0 +1,2 @@
+etc/mwc
+var/cache/mwc
diff --git a/debian/docs b/debian/docs
new file mode 100644
index 0000000..648393d
--- /dev/null
+++ b/debian/docs
@@ -0,0 +1,2 @@
+README.md
+
diff --git a/debian/mwc.1 b/debian/mwc.1
new file mode 100644
index 0000000..0da3c0d
--- /dev/null
+++ b/debian/mwc.1
@@ -0,0 +1,55 @@
+.\" Hey, EMACS: -*- nroff -*-
+.\" (C) Copyright 2014 Jörg Frings-Fürst <debian@jff-webhosting.net>,
+.\"
+.\" First parameter, NAME, should be all caps
+.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
+.\" other parameters are allowed: see man(7), man(1)
+.TH MWC 1 "September 18, 2014"
+.\" Please adjust this date whenever revising the manpage.
+.\"
+.\" Some roff macros, for reference:
+.\" .nh disable hyphenation
+.\" .hy enable hyphenation
+.\" .ad l left justify
+.\" .ad b justify to both left and right margins
+.\" .nf disable filling
+.\" .fi enable filling
+.\" .br insert line break
+.\" .sp <n> insert n+1 empty lines
+.\" for manpage-specific macros, see man(7)
+.SH NAME
+mwc, mwcfeedserver \- program for monitoring changes of Websites
+.SH SYNOPSIS
+.B mwc
+.RI [ --config[=config]\ \ --dry-run[=shortname] ]
+.br
+.B mwcfeedserver
+.RI [ --config[=config]\ \ --port[=port] ]
+.SH DESCRIPTION
+This manual page documents briefly the
+.B mwc and
+.br
+.B mwcfeedserver
+commands.
+.PP
+.\" TeX users may be more comfortable with the \fB<whatever>\fP and
+.\" \fI<whatever>\fP escape sequences to invode bold face and italics,
+.\" respectively.
+\fBmwc\fP is a program that monitor websites and send mails after detect changes.
+.SH OPTIONS
+These programs follow the usual GNU command line syntax, with long
+options starting with two dashes (`-').
+A summary of options is included below.
+.TP
+.B \-\-config=CONFIG
+Path and filename of the config \- file.
+.TP
+.B \-\-dry\-run=SHORTNAME
+Test the entry SHORTNAME from config without sending a mail.
+.TP
+.B \-\-port=PORT
+Port (Standard = 8000) where Feedserver is listen
+.SH AUTHOR
+The Sleuth Kit was written by Michael Till Beck <Debianguru@gmx.de>.
+.PP
+This manual page was written by Jörg Frings\-Fürst <debian@jff\-webhosting.net> for the Debian project (but may be used by others).
diff --git a/debian/mwc.cr b/debian/mwc.cr
new file mode 100755
index 0000000..e0c7f8f
--- /dev/null
+++ b/debian/mwc.cr
@@ -0,0 +1,7 @@
+#! /bin/bash
+
+test -x /usr/bin/mwc || exit 0
+test -e /etc/mwc/mwc-config.py || exit 0
+
+/usr/bin/mwc -config=/etc/mwc/mwc-config >/dev/null 2>&1
+
diff --git a/debian/mwc.examples b/debian/mwc.examples
new file mode 100644
index 0000000..9c2cf1d
--- /dev/null
+++ b/debian/mwc.examples
@@ -0,0 +1,2 @@
+config_template.py
+debian/mwc.cr
diff --git a/debian/mwc.install b/debian/mwc.install
new file mode 100644
index 0000000..d893da8
--- /dev/null
+++ b/debian/mwc.install
@@ -0,0 +1,2 @@
+mwc.py /usr/share/mwc
+mwcfeedserver.py /usr/share/mwc
diff --git a/debian/mwc.links b/debian/mwc.links
new file mode 100644
index 0000000..82885c9
--- /dev/null
+++ b/debian/mwc.links
@@ -0,0 +1,3 @@
+/usr/share/mwc/mwc.py /usr/bin/mwc
+/usr/share/mwc/mwcfeedserver.py /usr/sbin/mwcfeedserver
+
diff --git a/debian/mwc.manpages b/debian/mwc.manpages
new file mode 100644
index 0000000..c3ed826
--- /dev/null
+++ b/debian/mwc.manpages
@@ -0,0 +1,2 @@
+debian/mwc.1
+debian/mwcfeedserver.1
diff --git a/debian/mwcfeedserver.1 b/debian/mwcfeedserver.1
new file mode 120000
index 0000000..1cd4511
--- /dev/null
+++ b/debian/mwcfeedserver.1
@@ -0,0 +1 @@
+mwc.1 \ No newline at end of file
diff --git a/debian/patches/0100-config.diff b/debian/patches/0100-config.diff
new file mode 100644
index 0000000..ce4dba7
--- /dev/null
+++ b/debian/patches/0100-config.diff
@@ -0,0 +1,115 @@
+Description: add loading config from every path
+ Add loading config from ervery path
+ Separation data / program
+Author: Jörg Frings-Fürst <jff@jff-webhosting.net>
+Last-Update: 2014-05-12
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+Index: trunk/mwc.py
+===================================================================
+--- trunk.orig/mwc.py
++++ trunk/mwc.py
+@@ -319,7 +319,7 @@ def pollWebsites():
+
+ if __name__ == "__main__":
+
+- configMod = 'config'
++ configMod = '/etc/mwc/mwc-config'
+ dryrun = None
+
+ try:
+@@ -335,9 +335,24 @@ if __name__ == "__main__":
+ configMod = arg
+ elif opt in ('-d', '--dry-run'):
+ dryrun = arg
+-
+- config = importlib.import_module(configMod)
+-
++ #
++ # add code to load config from nonsystem path
++ # and change to datadir
++ #
++ try:
++ path = os.path.dirname(configMod)
++ fullname = os.path.basename(configMod)
++ sys.path.append(path)
++ config = importlib.import_module(fullname)
++ except:
++ print('Error: loading config')
++ sys.exit(2)
++ try:
++ os.chdir(config.datadir)
++ except:
++ print('Error: datadir not found')
++ sys.exit(3)
++
+ if dryrun:
+ for site in config.sites:
+ if site['shortname'] == dryrun:
+Index: trunk/config_template.py
+===================================================================
+--- trunk.orig/config_template.py
++++ trunk/config_template.py
+@@ -1,5 +1,3 @@
+-import os.path
+-
+ # Copyright: (2013-2014) Michael Till Beck <Debianguru@gmx.de>
+ # License: GPL-2.0+
+
+@@ -46,11 +44,11 @@ sender = 'me@mymail.com'
+ smtphost = 'mysmtpprovider.com'
+ useTLS = True
+ smtpport = 587
+-smtpusername = sender
++smtpusername = 'sender'
+ smtppwd = 'mypassword'
+ receiver = 'me2@mymail.com'
+
+-os.chdir('/var/cache/mwc')
++datadir'/var/cache/mwc'
+
+ enableRSSFeed = True
+ rssfile = 'feed.xml'
+Index: trunk/mwcfeedserver.py
+===================================================================
+--- trunk.orig/mwcfeedserver.py
++++ trunk/mwcfeedserver.py
+@@ -6,6 +6,7 @@
+ import http.server
+ import socketserver
+ import importlib
++import os
+ import sys
+ import getopt
+
+@@ -31,13 +32,26 @@ for opt, arg in opts:
+ elif opt in ('-p', '--port'):
+ port = int(arg)
+
+-config = importlib.import_module(configMod)
+-
++#
++# add code to load config from nonsystem path
++# and change to datadir
++#
++try:
++ path = os.path.dirname(configMod)
++ fullname = os.path.basename(configMod)
++ sys.path.append(path)
++ config = importlib.import_module(fullname)
++except:
++ print('Error: loading config')
++ sys.exit(2)
+
+ handler = http.server.SimpleHTTPRequestHandler
+
+ httpd = socketserver.TCPServer((bind, port), handler)
+
+ print('Bond to ' + bind + ', listening on port ' + str(port))
+-httpd.serve_forever()
+-
++try:
++ httpd.serve_forever()
++except KeyboardInterrupt:
++ pass
++httpd.server_close()
diff --git a/debian/patches/0105-try_mail.diff b/debian/patches/0105-try_mail.diff
new file mode 100644
index 0000000..d390b6d
--- /dev/null
+++ b/debian/patches/0105-try_mail.diff
@@ -0,0 +1,52 @@
+Description: try / except around mail functions
+ add try / except around mail functions to
+ prevent python errors messages
+Author: Jörg Frings-Fürst <debian@jff-webhosting.net>
+Forwarded: via mail
+Applied-Upstream: <version|URL|commit, identifies patches merged upstream, optional>
+Reviewed-by:
+Last-Update: 2014-05-22
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+Index: trunk/mwc.py
+===================================================================
+--- trunk.orig/mwc.py
++++ trunk/mwc.py
+@@ -225,16 +225,27 @@ def sendmail(receiver, subject, content,
+ mail['Subject'] = Header(subject, defaultEncoding)
+
+ # initialize session once, not each time this method gets called
+- if mailsession is None:
+- mailsession = smtplib.SMTP(config.smtphost, config.smtpport)
+- if config.useTLS:
+- mailsession.ehlo()
+- mailsession.starttls()
+- if config.smtpusername is not None:
+- mailsession.login(config.smtpusername, config.smtppwd)
+-
+- mailsession.sendmail(config.sender, receiver.split(','), mail.as_string())
+-
++ #
++ # add try / except to open mailsession
++ #
++ try:
++ if mailsession is None:
++ mailsession = smtplib.SMTP(config.smtphost, config.smtpport)
++ if config.useTLS:
++ mailsession.ehlo()
++ mailsession.starttls()
++ mailsession.login(config.smtpusername, config.smtppwd)
++ #
++ # add try / except to send mail
++ #
++ except:
++ print('Error: Open smtp-session')
++ exit(4)
++ try:
++ mailsession.sendmail(config.sender, receiver.split(','), mail.as_string())
++ except:
++ print('Error: sendmail')
++ exit(5)
+
+ # returns a list of all content that is stored locally for a specific site
+ def getFileContents(shortname):
diff --git a/debian/patches/0110-syslog.diff b/debian/patches/0110-syslog.diff
new file mode 100644
index 0000000..12d629d
--- /dev/null
+++ b/debian/patches/0110-syslog.diff
@@ -0,0 +1,96 @@
+Description: add syslog messages on errors
+Author: Jörg Frings-Fürst <debian@jffwebhosting.net>
+Forwarded: via mail
+Last-Update: 2014-05-22
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+Index: trunk/mwc.py
+===================================================================
+--- trunk.orig/mwc.py
++++ trunk/mwc.py
+@@ -19,6 +19,7 @@ import os
+ import sys
+ import getopt
+ import traceback
++import syslog
+
+ import subprocess
+
+@@ -227,25 +228,28 @@ def sendmail(receiver, subject, content,
+ # initialize session once, not each time this method gets called
+ #
+ # add try / except to open mailsession
+- #
++ #
++
+ try:
+- if mailsession is None:
+- mailsession = smtplib.SMTP(config.smtphost, config.smtpport)
+- if config.useTLS:
+- mailsession.ehlo()
+- mailsession.starttls()
+- mailsession.login(config.smtpusername, config.smtppwd)
+- #
++ if mailsession is None:
++ mailsession = smtplib.SMTP(config.smtphost, config.smtpport)
++ if config.useTLS:
++ mailsession.ehlo()
++ mailsession.starttls()
++ mailsession.login(config.smtpusername, config.smtppwd)
++ except:
++ print('Error: Open smtp-session')
++ syslog.syslog(syslog.LOG_ERR, 'can not open smtp session')
++ exit(4)
++ #
+ # add try / except to send mail
+ #
++ try:
++ mailsession.sendmail(config.sender, receiver.split(','), mail.as_string())
+ except:
+- print('Error: Open smtp-session')
+- exit(4)
+- try:
+- mailsession.sendmail(config.sender, receiver.split(','), mail.as_string())
+- except:
+- print('Error: sendmail')
+- exit(5)
++ print('Error: sendmail')
++ syslog.syslog(syslog.LOG_ERR, 'error on sendmail')
++ exit(5)
+
+ # returns a list of all content that is stored locally for a specific site
+ def getFileContents(shortname):
+@@ -332,7 +336,11 @@ if __name__ == "__main__":
+
+ configMod = '/etc/mwc/mwc-config'
+ dryrun = None
+-
++
++ #
++ # add syslog open
++ #
++ syslog.openlog()
+ try:
+ opts, args = getopt.getopt(sys.argv[1:], 'hc:d:', ['help', 'config=', 'dry-run='])
+ except getopt.GetoptError:
+@@ -357,11 +365,13 @@ if __name__ == "__main__":
+ config = importlib.import_module(fullname)
+ except:
+ print('Error: loading config')
++ syslog.syslog(syslog.LOG_ERR, 'can not found / load mwc-config')
+ sys.exit(2)
+ try:
+ os.chdir(config.datadir)
+ except:
+ print('Error: datadir not found')
++ syslog.syslog(syslog.LOG_ERR, 'datadir not found')
+ sys.exit(3)
+
+ if dryrun:
+@@ -383,3 +393,5 @@ if __name__ == "__main__":
+ mailsession.quit()
+ mailsession = None
+
++ syslog.closelog()
++
+\ No newline at end of file
diff --git a/debian/patches/0115-Add_header.patch b/debian/patches/0115-Add_header.patch
new file mode 100644
index 0000000..6ce0c15
--- /dev/null
+++ b/debian/patches/0115-Add_header.patch
@@ -0,0 +1,50 @@
+Description: Add Header Accept
+Author: Jörg Frings-Fürst <debian@jff-webhosting.net>
+Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=862004
+Forwarded: https://github.com/Debianguru/MailWebsiteChanges/issues/11
+Last-Update: 2017-05-07
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+Index: trunk/mwc.py
+===================================================================
+--- trunk.orig/mwc.py
++++ trunk/mwc.py
+@@ -91,6 +91,8 @@ def parseSite(site):
+ req = urllib.request.Request(uri)
+ if 'user-agent' in site:
+ req.add_header('User-Agent', site['user-agent'])
++ if 'accept' in site:
++ req.add_header('Accept', site['accept'])
+ file = urllib.request.urlopen(req)
+
+
+Index: trunk/README.md
+===================================================================
+--- trunk.orig/README.md
++++ trunk/README.md
+@@ -59,7 +59,9 @@ sites = [
+ * <b>user-agent</b> (optional)
+ Defines the user agent string, e.g.,
+ 'user-agent': 'Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:49.0) Gecko/20100101 Firefox/49.0'
+-
++ * <b>accept</b> (optional)
++ Defines the accept string, e.g.,
++ 'accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'
+
+ * We collect some XPath/CSS snippets at this place: <a href="https://github.com/Debianguru/MailWebsiteChanges/wiki/snippets">Snippet collection</a> - please feel free to add your own definitions!
+
+Index: trunk/config_template.py
+===================================================================
+--- trunk.orig/config_template.py
++++ trunk/config_template.py
+@@ -12,7 +12,9 @@ sites = [
+ 'contentxpath': '//div',
+ 'titleregex': '',
+ 'contentregex': '',
+- 'encoding': 'utf-8'},
++ 'encoding': 'utf-8',
++ 'user-agent': 'Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:49.0) Gecko/20100101 Firefox/49.0',
++ 'accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'},
+
+ {'shortname': 'mywebsite2',
+ 'uri': 'http://www.mywebsite2.com/info',
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..a06ba62
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1,4 @@
+0100-config.diff
+0105-try_mail.diff
+0110-syslog.diff
+#0115-Add_header.patch
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..8c9d9d4
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,9 @@
+#!/usr/bin/make -f
+
+%:
+ dh $@ --with python3
+
+override_dh_installdeb:
+ mv debian/mwc/usr/share/doc/mwc/examples/config_template.py debian/mwc/usr/share/doc/mwc/examples/mwc-config_template.py
+ mv debian/mwc/usr/share/doc/mwc/examples/mwc.cr debian/mwc/usr/share/doc/mwc/examples/mwc
+ dh_installdeb
diff --git a/debian/source/format b/debian/source/format
new file mode 100644
index 0000000..163aaf8
--- /dev/null
+++ b/debian/source/format
@@ -0,0 +1 @@
+3.0 (quilt)
diff --git a/debian/watch b/debian/watch
new file mode 100644
index 0000000..f145632
--- /dev/null
+++ b/debian/watch
@@ -0,0 +1,4 @@
+version=3
+
+opts=filenamemangle=s/.+\/v?(\d\S*)\.tar\.gz/$1\.tar\.gz/ \
+https://github.com/Debianguru/MailWebsiteChanges/tags .*/v?(\d\S*)\.tar\.gz