From 618295e441ad2e504117403666a26c81395b6d63 Mon Sep 17 00:00:00 2001 From: Sergio Durigan Junior Date: Sat, 24 Dec 2016 08:51:05 -0500 Subject: [PATCH] First attempts at debianizing pagure --- debian/README.Debian | 5 + debian/README.source | 10 ++ debian/changelog | 5 + debian/compat | 1 + debian/control | 147 ++++++++++++++++++ debian/copyright | 58 +++++++ debian/files | 1 + debian/pagure-doc.doc-base | 22 +++ debian/pagure-doc.docs | 4 + debian/pagure-doc.manpages | 1 + debian/pagure-ev-server.init | 54 +++++++ debian/pagure-ev-server.install | 1 + debian/pagure-ev-server.postinst | 57 +++++++ debian/pagure-ev-server.service | 14 ++ debian/pagure-milters.init | 53 +++++++ debian/pagure-milters.install | 1 + debian/pagure-milters.service | 14 ++ debian/pagure-milters.tmpfile | 1 + debian/pagure-webhook-server.init | 54 +++++++ debian/pagure-webhook-server.install | 1 + debian/pagure-webhook-server.postinst | 57 +++++++ debian/pagure-webhook-server.service | 14 ++ debian/pagure.install | 10 ++ debian/pagure.links | 1 + debian/pagure.postinst | 57 +++++++ ...t-python-bcrypt-instead-of-py-bcrypt.patch | 35 +++++ debian/patches/series | 1 + debian/postrm.ex | 37 +++++ debian/preinst.ex | 35 +++++ debian/prerm.ex | 38 +++++ debian/rules | 31 ++++ debian/source/format | 1 + debian/source/options | 1 + debian/watch | 2 + 34 files changed, 824 insertions(+) create mode 100644 debian/README.Debian create mode 100644 debian/README.source create mode 100644 debian/changelog create mode 100644 debian/compat create mode 100644 debian/control create mode 100644 debian/copyright create mode 100644 debian/files create mode 100644 debian/pagure-doc.doc-base create mode 100644 debian/pagure-doc.docs create mode 100644 debian/pagure-doc.manpages create mode 100644 debian/pagure-ev-server.init create mode 100644 debian/pagure-ev-server.install create mode 100644 debian/pagure-ev-server.postinst create mode 100644 debian/pagure-ev-server.service create mode 100644 debian/pagure-milters.init create mode 100644 debian/pagure-milters.install create mode 100644 debian/pagure-milters.service create mode 120000 debian/pagure-milters.tmpfile create mode 100644 debian/pagure-webhook-server.init create mode 100644 debian/pagure-webhook-server.install create mode 100644 debian/pagure-webhook-server.postinst create mode 100644 debian/pagure-webhook-server.service create mode 100644 debian/pagure.install create mode 100644 debian/pagure.links create mode 100644 debian/pagure.postinst create mode 100644 debian/patches/0001-Support-python-bcrypt-instead-of-py-bcrypt.patch create mode 100644 debian/patches/series create mode 100644 debian/postrm.ex create mode 100644 debian/preinst.ex create mode 100644 debian/prerm.ex create mode 100755 debian/rules create mode 100644 debian/source/format create mode 100644 debian/source/options create mode 100644 debian/watch diff --git a/debian/README.Debian b/debian/README.Debian new file mode 100644 index 0000000..0c1b1d6 --- /dev/null +++ b/debian/README.Debian @@ -0,0 +1,5 @@ +pagure for Debian +----------------- + + + -- Sergio Durigan Junior Thu, 21 Jul 2016 18:04:38 -0400 diff --git a/debian/README.source b/debian/README.source new file mode 100644 index 0000000..d8a21b1 --- /dev/null +++ b/debian/README.source @@ -0,0 +1,10 @@ +pagure for Debian +---------------- + + + + + + -- Sergio Durigan Junior Thu, 21 Jul 2016 18:04:38 -0400 + diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..02630f9 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +pagure (2.6+dfsg-1) unstable; urgency=medium + + * Initial release (Closes: #nnnn) + + -- Sergio Durigan Junior Thu, 21 Jul 2016 18:04:38 -0400 diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +9 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..cbc1fed --- /dev/null +++ b/debian/control @@ -0,0 +1,147 @@ +Source: pagure +Section: net +Priority: optional +Maintainer: Sergio Durigan Junior +Build-Depends: + debhelper (>=9), + dh-python, + dh-systemd, + dh-apache2, + python-all, + python-setuptools, + sphinx-common, + python-sphinx, + python-cloud-sptheme, +# Python deps for pagure + python-alembic, + python-arrow, + python-binaryornot, + python-bleach, + python-blinker, + python-chardet, + python-docutils, + python-enum34, + python-flask, + python-flaskext.wtf, + python-flaskext.multistatic, + python-html5lib, + python-kitchen, + python-markdown, + python-munch, + python-pil, + python-psutil, + python-pygit2, + python-pygments, + python-openid, + python-openid-cla, + python-openid-teams, + python-redis, + python-six, + python-sqlalchemy, + python-straight.plugin, + python-trollius-redis, + python-wtforms, + python-fedora, + python-cryptography, + python-bcrypt, +# JavaScript deps + yui-compressor, + libjs-jquery, + libjs-jquery-dotdotdot, + libjs-jquery-selectize.js, + libjs-jquery-stupidtable, +# Needed for testing + git, +Standards-Version: 3.9.8 +Homepage: http://pagure.io/pagure +X-Python-Version: >= 2.7 + +Package: pagure +Architecture: all +Depends: + ${misc:Depends}, + ${python:Depends}, + gitolite3, +# The JS libs are not picked up as deps. + libjs-jquery, + libjs-jquery-dotdotdot, + libjs-jquery-selectize.js, + libjs-jquery-stupidtable, +Recommends: + pagure-ev-server (= ${source:Version}), + pagure-milters (= ${source:Version}), + pagure-webhook-server (= ${source:Version}), + ${misc:Recommends}, +Suggests: pagure-doc +Description: git-centered forge using pygit2 + Pagure is a git-centered forge, Python based using pygit2. + . + With pagure you can host your project with its documentation, let your + users report issues or request enhancements using the ticketing system + and build your community of contributors by allowing them to fork your + projects and contribute to it via the now-popular pull-request + mechanism. + . + You may be also interesed in other packages to enhance the + functionality of pagure: + * pagure-ev-server + * pagure-milters + * pagure-webhook-server + +Package: pagure-ev-server +Architecture: all +Depends: + pagure (= ${source:Version}), + ${misc:Depends}, + ${python:Depends} +Description: git-centered forge using pygit2 - EventSource server + Pagure is a git-centered forge, Python based using pygit2. + . + pagure-ev-server used to allow live-refreshing of a page when someone + is viewing it. For example, while you are reading a ticket if someone + comments on it, the comment will automatically show up on the page + without the need for you to reload the entire page. + +Package: pagure-milters +Architecture: all +Depends: + pagure (= ${source:Version}), + ${misc:Depends}, + ${python:Depends}, + postfix, +Description: git-centered forge using pygit2 - milters (mail filters) + Pagure is a git-centered forge, Python based using pygit2. + . + pagure-milters is used to allow replying on a comment of a ticket or a + pull-request by directly replying to the notification sent. No need + to go to the page anymore to reply to a comment someone made. + . + It integrates with an MTA such as postfix or sendmail that you will + have running and have access to in order to change its configuration. + +Package: pagure-webhook-server +Architecture: all +Depends: + pagure (= ${source:Version}), + ${misc:Depends}, + ${python:Depends} +Description: git-centered forge using pygit2 - web-hook server + Pagure is a git-centered forge, Python based using pygit2. + . + pagure-webhook-server sends notifications to third party services + using POST http requests. + +Package: pagure-doc +Architecture: all +Section: doc +Depends: ${sphinxdoc:Depends}, ${misc:Depends} +Description: git-centered forge using pygit2 (documentation) + Pagure is a git-centered forge, Python based using pygit2. + . + With pagure you can host your project with its documentation, let your + users report issues or request enhancements using the ticketing system + and build your community of contributors by allowing them to fork your + projects and contribute to it via the now-popular pull-request + mechanism. + . + This is the common documentation package. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..02cca8b --- /dev/null +++ b/debian/copyright @@ -0,0 +1,58 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: pagure +Source: https://pagure.io/pagure + +Files: * +Copyright: 2014-2016 Red Hat, Inc +License: GPL-2+ + +Files: pagure/hooks/files/git_multimail.py +Copyright: + 2012-2014 Michael Haggerty and others + 2007 Andy Parkins +License: GPL-2+ + +Files: pagure/static/codemirror/codemirror.js +Copyright: 2016 Marijn Haverbeke and others +License: Expat + +Files: debian/* +Copyright: 2016 Sergio Durigan Junior +License: GPL-2+ + +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 + . + 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: Expat + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + . + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + . + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/debian/files b/debian/files new file mode 100644 index 0000000..11a6d97 --- /dev/null +++ b/debian/files @@ -0,0 +1 @@ +pagure_2.6+dfsg-1_source.buildinfo net optional diff --git a/debian/pagure-doc.doc-base b/debian/pagure-doc.doc-base new file mode 100644 index 0000000..4101cb1 --- /dev/null +++ b/debian/pagure-doc.doc-base @@ -0,0 +1,22 @@ +Document: pagure +Title: Debian pagure Manual +Author: +Abstract: pagure is a git-centered forge using pygit2 + With pagure you can host your project with its documentation, let your + users report issues or request enhancements using the ticketing system + and build your community of contributors by allowing them to fork your + projects and contribute to it via the now-popular pull-request + mechanism. +Section: Project Management + +Format: HTML +Index: /usr/share/doc/pagure-doc/html/index.html +Files: + /usr/share/doc/pagure-doc/html/*.html + /usr/share/doc/pagure-doc/html/*.js + /usr/share/doc/pagure-doc/html/*.inv + /usr/share/doc/pagure-doc/html/usage/*.html + /usr/share/doc/pagure-doc/html/_static/* + /usr/share/doc/pagure-doc/html/_sources/*.txt + /usr/share/doc/pagure-doc/html/_sources/usage/*.txt + /usr/share/doc/pagure-doc/html/_images/*.png diff --git a/debian/pagure-doc.docs b/debian/pagure-doc.docs new file mode 100644 index 0000000..6a0f426 --- /dev/null +++ b/debian/pagure-doc.docs @@ -0,0 +1,4 @@ +debian/README.Debian +debian/README.source +README.rst +doc/_build/html/ diff --git a/debian/pagure-doc.manpages b/debian/pagure-doc.manpages new file mode 100644 index 0000000..0d5fae9 --- /dev/null +++ b/debian/pagure-doc.manpages @@ -0,0 +1 @@ +doc/_build/man/pagure.1 diff --git a/debian/pagure-ev-server.init b/debian/pagure-ev-server.init new file mode 100644 index 0000000..12228ca --- /dev/null +++ b/debian/pagure-ev-server.init @@ -0,0 +1,54 @@ +#!/bin/sh +# kFreeBSD do not accept scripts as interpreters, using #!/bin/sh and sourcing. +if [ true != "$INIT_D_SCRIPT_SOURCED" ] ; then + set "$0" "$@"; INIT_D_SCRIPT_SOURCED=true . /lib/init/init-d-script +fi +### BEGIN INIT INFO +# Provides: pagure-ev-server +# Required-Start: $remote_fs $syslog +# Required-Stop: $remote_fs $syslog +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: +# Description: +# <...> +# <...> +### END INIT INFO + +# Author: Sergio Durigan Junior + +DESC="pagure" +DAEMON="/usr/share/pagure-ev-server/bin/pagure-stream-server.py" +PIDFILE="/var/run/pagure/pagure-ev-server.pid" +U="git" + +test -x "${DAEMON}" || exit 0 + +. /lib/lsb/init-functions + +case "${1}" in + start) + start-stop-daemon --start --background -m --oknodo --pidfile $PIDFILE --chuid ${U}:${U} --exec $DAEMON + ;; + + stop) + start-stop-daemon --stop --pidfile $PIDFILE --oknodo --exec ${DAEMON} + rm -f $PIDFILE + ;; + + restart) + ${0} stop + ${0} start + ;; + + status) + status_of_proc "${DAEMON}" "Pagure EV Server" + ;; + + *) + echo "Usage: ${0} {start|stop|restart|status}" + exit 1 + ;; +esac + +exit 0 diff --git a/debian/pagure-ev-server.install b/debian/pagure-ev-server.install new file mode 100644 index 0000000..4bd27d2 --- /dev/null +++ b/debian/pagure-ev-server.install @@ -0,0 +1 @@ +ev-server/pagure-stream-server.py /usr/share/pagure-ev-server/bin/ diff --git a/debian/pagure-ev-server.postinst b/debian/pagure-ev-server.postinst new file mode 100644 index 0000000..e216a1e --- /dev/null +++ b/debian/pagure-ev-server.postinst @@ -0,0 +1,57 @@ +#!/bin/sh +# postinst script for pagure-ev-server +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `configure' +# * `abort-upgrade' +# * `abort-remove' `in-favour' +# +# * `abort-remove' +# * `abort-deconfigure' `in-favour' +# `removing' +# +# for details, see https://www.debian.org/doc/debian-policy/ or +# the debian-policy package + +# Source debconf library. +if test -f /usr/share/debconf/confmodule ; then + . /usr/share/debconf/confmodule +fi + + +case "$1" in + configure) + # We run using the same user as gitolite. For more on the + # gituser value information, see the gitolite3 package. + db_get gitolite3/gituser + GITUSER="${RET:-gitolite3}" + + if test "$GITUSER" != "git" ; then + # We must replace the user specified to run the scripts. + sed -i -e "s/U=\"git\"/U=\"$GITUSER\"/" /etc/init.d/pagure-ev-server + if test -f /lib/systemd/system/pagure-ev-server.service ; then + sed -i -e "s/User=git/User=$GITUSER/" \ + -e "s/Group=git/Group=$GITUSER/" /lib/systemd/system/pagure-ev-server.service + fi + fi + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 diff --git a/debian/pagure-ev-server.service b/debian/pagure-ev-server.service new file mode 100644 index 0000000..946289b --- /dev/null +++ b/debian/pagure-ev-server.service @@ -0,0 +1,14 @@ +[Unit] +Description=Pagure EventSource server (Allowing live refresh of the pages supporting it) +After=redis.target +Documentation=https://pagure.io/pagure + +[Service] +ExecStart=/usr/share/pagure-ev-server/bin/pagure-stream-server.py +Type=simple +User=git +Group=git +Restart=on-failure + +[Install] +WantedBy=multi-user.target diff --git a/debian/pagure-milters.init b/debian/pagure-milters.init new file mode 100644 index 0000000..018a730 --- /dev/null +++ b/debian/pagure-milters.init @@ -0,0 +1,53 @@ +#!/bin/sh +# kFreeBSD do not accept scripts as interpreters, using #!/bin/sh and sourcing. +if [ true != "$INIT_D_SCRIPT_SOURCED" ] ; then + set "$0" "$@"; INIT_D_SCRIPT_SOURCED=true . /lib/init/init-d-script +fi +### BEGIN INIT INFO +# Provides: pagure-milters +# Required-Start: $remote_fs $syslog +# Required-Stop: $remote_fs $syslog +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: +# Description: +# <...> +# <...> +### END INIT INFO + +# Author: Sergio Durigan Junior + +DESC="pagure" +DAEMON="/usr/bin/python2 /usr/share/pagure-milters/bin/comment_email_milter.py" +PIDFILE="/var/run/pagure/pagure-milters.pid" + +test -x "${DAEMON}" || exit 0 + +. /lib/lsb/init-functions + +case "${1}" in + start) + start-stop-daemon --start --background -m --oknodo --pidfile $PIDFILE --exec "$DAEMON" + ;; + + stop) + start-stop-daemon --stop --pidfile $PIDFILE --oknodo --exec "$DAEMON" + rm -f $PIDFILE + ;; + + restart) + ${0} stop + ${0} start + ;; + + status) + status_of_proc "${DAEMON}" "Pagure Milters" + ;; + + *) + echo "Usage: ${0} {start|stop|restart|status}" + exit 1 + ;; +esac + +exit 0 diff --git a/debian/pagure-milters.install b/debian/pagure-milters.install new file mode 100644 index 0000000..da39be1 --- /dev/null +++ b/debian/pagure-milters.install @@ -0,0 +1 @@ +milters/comment_email_milter.py /usr/share/pagure-milters/bin/ diff --git a/debian/pagure-milters.service b/debian/pagure-milters.service new file mode 100644 index 0000000..295616d --- /dev/null +++ b/debian/pagure-milters.service @@ -0,0 +1,14 @@ +[Unit] +Description=Pagure SMTP filter (Milter) Daemon (talk to postfix over a socket) +After=postfix.target +Documentation=https://pagure.io/pagure + +[Service] +ExecStart=/usr/bin/python2 /usr/share/pagure-milters/bin/comment_email_milter.py +Type=simple +User=postfix +Group=postfix +Restart=on-failure + +[Install] +WantedBy=multi-user.target diff --git a/debian/pagure-milters.tmpfile b/debian/pagure-milters.tmpfile new file mode 120000 index 0000000..a127b5f --- /dev/null +++ b/debian/pagure-milters.tmpfile @@ -0,0 +1 @@ +../milters/milter_tempfile.conf \ No newline at end of file diff --git a/debian/pagure-webhook-server.init b/debian/pagure-webhook-server.init new file mode 100644 index 0000000..72ee3f7 --- /dev/null +++ b/debian/pagure-webhook-server.init @@ -0,0 +1,54 @@ +#!/bin/sh +# kFreeBSD do not accept scripts as interpreters, using #!/bin/sh and sourcing. +if [ true != "$INIT_D_SCRIPT_SOURCED" ] ; then + set "$0" "$@"; INIT_D_SCRIPT_SOURCED=true . /lib/init/init-d-script +fi +### BEGIN INIT INFO +# Provides: pagure-webhook-server +# Required-Start: $remote_fs $syslog +# Required-Stop: $remote_fs $syslog +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: +# Description: +# <...> +# <...> +### END INIT INFO + +# Author: Sergio Durigan Junior + +DESC="pagure" +DAEMON="/usr/share/pagure-webhook-server/bin/pagure-webhook-server.py" +PIDFILE="/var/run/pagure/pagure-webhook-server.pid" +U="git" + +test -x "${DAEMON}" || exit 0 + +. /lib/lsb/init-functions + +case "${1}" in + start) + start-stop-daemon --start --background -m --oknodo --pidfile $PIDFILE --chuid ${U}:${U} --exec $DAEMON + ;; + + stop) + start-stop-daemon --stop --pidfile $PIDFILE --oknodo --exec ${DAEMON} + rm -f $PIDFILE + ;; + + restart) + ${0} stop + ${0} start + ;; + + status) + status_of_proc "${DAEMON}" "Pagure WebHook Server" + ;; + + *) + echo "Usage: ${0} {start|stop|restart|status}" + exit 1 + ;; +esac + +exit 0 diff --git a/debian/pagure-webhook-server.install b/debian/pagure-webhook-server.install new file mode 100644 index 0000000..cb73e56 --- /dev/null +++ b/debian/pagure-webhook-server.install @@ -0,0 +1 @@ +webhook-server/pagure-webhook-server.py /usr/share/pagure-webhook-server/bin/ diff --git a/debian/pagure-webhook-server.postinst b/debian/pagure-webhook-server.postinst new file mode 100644 index 0000000..6eec95d --- /dev/null +++ b/debian/pagure-webhook-server.postinst @@ -0,0 +1,57 @@ +#!/bin/sh +# postinst script for pagure-webhook-server +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `configure' +# * `abort-upgrade' +# * `abort-remove' `in-favour' +# +# * `abort-remove' +# * `abort-deconfigure' `in-favour' +# `removing' +# +# for details, see https://www.debian.org/doc/debian-policy/ or +# the debian-policy package + +# Source debconf library. +if test -f /usr/share/debconf/confmodule ; then + . /usr/share/debconf/confmodule +fi + + +case "$1" in + configure) + # We run using the same user as gitolite. For more on the + # gituser value information, see the gitolite3 package. + db_get gitolite3/gituser + GITUSER="${RET:-gitolite3}" + + if test "$GITUSER" != "git" ; then + # We must replace the user specified to run the scripts. + sed -i -e "s/U=\"git\"/U=\"$GITUSER\"/" /etc/init.d/pagure-webhook-server + if test -f /lib/systemd/system/pagure-webhook-server.service ; then + sed -i -e "s/User=git/User=$GITUSER/" \ + -e "s/Group=git/Group=$GITUSER/" /lib/systemd/system/pagure-webhook-server.service + fi + fi + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 diff --git a/debian/pagure-webhook-server.service b/debian/pagure-webhook-server.service new file mode 100644 index 0000000..feb4d0e --- /dev/null +++ b/debian/pagure-webhook-server.service @@ -0,0 +1,14 @@ +[Unit] +Description=Pagure WebHook server (Allowing web-hook notifications) +After=redis.target +Documentation=https://pagure.io/pagure + +[Service] +ExecStart=/usr/share/pagure-webhook-server/bin/pagure-webhook-server.py +Type=simple +User=git +Group=git +Restart=on-failure + +[Install] +WantedBy=multi-user.target diff --git a/debian/pagure.install b/debian/pagure.install new file mode 100644 index 0000000..c5ab4c6 --- /dev/null +++ b/debian/pagure.install @@ -0,0 +1,10 @@ +# Config files +files/pagure.cfg.sample etc/pagure/ +files/alembic.ini etc/pagure/ + +# Other interesting files to install +createdb.py usr/share/pagure/ +files/pagure.wsgi usr/share/pagure/ +files/doc_pagure.wsgi usr/share/pagure/ +files/api_key_expire_mail.py usr/share/pagure/ +alembic/ usr/share/pagure/ diff --git a/debian/pagure.links b/debian/pagure.links new file mode 100644 index 0000000..bb63d99 --- /dev/null +++ b/debian/pagure.links @@ -0,0 +1 @@ +/usr/share/javascript/jquery/jquery.min.js /usr/lib/python2.7/dist-packages/pagure/static/jquery.min.js diff --git a/debian/pagure.postinst b/debian/pagure.postinst new file mode 100644 index 0000000..80e1cd1 --- /dev/null +++ b/debian/pagure.postinst @@ -0,0 +1,57 @@ +#!/bin/sh +# postinst script for pagure +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `configure' +# * `abort-upgrade' +# * `abort-remove' `in-favour' +# +# * `abort-remove' +# * `abort-deconfigure' `in-favour' +# `removing' +# +# for details, see https://www.debian.org/doc/debian-policy/ or +# the debian-policy package + +# Source debconf library. +if test -f /usr/share/debconf/confmodule ; then + . /usr/share/debconf/confmodule +fi + + +case "$1" in + configure) + # We run using the same user as gitolite. For more on the + # gituser value information, see the gitolite3 package. + db_get gitolite3/gituser + GITUSER="${RET:-gitolite3}" + db_get gitolite3/gitdir + GITDIR="${RET:-/var/lib/gitolite3}" + + if test -d $GITDIR ; then + mkdir -p ${GITDIR}/repositories/{,docs,forks,requests,tickets,repos} + mkdir -p ${GITDIR}/remotes/ + chown -R ${GITUSER}:${GITUSER} ${GITDIR}/repositories/ + chown -R ${GITUSER}:${GITUSER} ${GITDIR}/remotes/ + fi + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 diff --git a/debian/patches/0001-Support-python-bcrypt-instead-of-py-bcrypt.patch b/debian/patches/0001-Support-python-bcrypt-instead-of-py-bcrypt.patch new file mode 100644 index 0000000..9d1e385 --- /dev/null +++ b/debian/patches/0001-Support-python-bcrypt-instead-of-py-bcrypt.patch @@ -0,0 +1,35 @@ +From: Sergio Durigan Junior +Date: Mon, 8 Aug 2016 20:16:35 -0400 +Subject: Support python-bcrypt instead of py-bcrypt + +This patch basically makes sure that the arguments to bcrypt.hashpw +are encoded to UTF-8. This is a requirement of python-bcrypt. Using +python-bcrypt has the advantage that the library is well maintained +and available on more distributions, like Debian. +--- + pagure/lib/login.py | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/pagure/lib/login.py b/pagure/lib/login.py +index 4227c94..989fb4e 100644 +--- a/pagure/lib/login.py ++++ b/pagure/lib/login.py +@@ -72,7 +72,8 @@ def get_users_by_group(session, group): + def generate_hashed_value(password): + """ Generate hash value for password + """ +- return '$2$' + bcrypt.hashpw(to_unicode(password), bcrypt.gensalt()) ++ return '$2$' + bcrypt.hashpw(password.encode("utf8"), ++ bcrypt.gensalt().encode("utf8")) + + + def check_password(entered_password, user_password, seed=None): +@@ -86,7 +87,7 @@ def check_password(entered_password, user_password, seed=None): + _, version, user_password = user_password.split('$', 2) + + if version == '2': +- password = bcrypt.hashpw(to_unicode(entered_password), user_password) ++ password = bcrypt.hashpw(entered_password.encode("utf8"), user_password.encode("utf8")) + + elif version == '1': + password = '%s%s' % (to_unicode(entered_password), seed) diff --git a/debian/patches/series b/debian/patches/series new file mode 100644 index 0000000..48a2f82 --- /dev/null +++ b/debian/patches/series @@ -0,0 +1 @@ +0001-Support-python-bcrypt-instead-of-py-bcrypt.patch diff --git a/debian/postrm.ex b/debian/postrm.ex new file mode 100644 index 0000000..06fed4b --- /dev/null +++ b/debian/postrm.ex @@ -0,0 +1,37 @@ +#!/bin/sh +# postrm script for pagure +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `remove' +# * `purge' +# * `upgrade' +# * `failed-upgrade' +# * `abort-install' +# * `abort-install' +# * `abort-upgrade' +# * `disappear' +# +# for details, see https://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) + ;; + + *) + echo "postrm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 diff --git a/debian/preinst.ex b/debian/preinst.ex new file mode 100644 index 0000000..e967f0d --- /dev/null +++ b/debian/preinst.ex @@ -0,0 +1,35 @@ +#!/bin/sh +# preinst script for pagure +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `install' +# * `install' +# * `upgrade' +# * `abort-upgrade' +# for details, see https://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + install|upgrade) + ;; + + abort-upgrade) + ;; + + *) + echo "preinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 diff --git a/debian/prerm.ex b/debian/prerm.ex new file mode 100644 index 0000000..45ac53d --- /dev/null +++ b/debian/prerm.ex @@ -0,0 +1,38 @@ +#!/bin/sh +# prerm script for pagure +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `remove' +# * `upgrade' +# * `failed-upgrade' +# * `remove' `in-favour' +# * `deconfigure' `in-favour' +# `removing' +# +# for details, see https://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + remove|upgrade|deconfigure) + ;; + + failed-upgrade) + ;; + + *) + echo "prerm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..7bd9205 --- /dev/null +++ b/debian/rules @@ -0,0 +1,31 @@ +#!/usr/bin/make -f + +export PYBUILD_NAME = pagure +export PYBUILD_DESTDIR = debian/pagure/ + +%: + dh $@ --with python2,systemd,sphinxdoc,apache2 --buildsystem=pybuild + +override_dh_auto_build: +# Marking scripts as executable. + chmod 0755 \ + createdb.py \ + milters/comment_email_milter.py \ + files/api_key_expire_mail.py +# Removing executable bit from font files. + find pagure/static/hack_fonts/fonts/ -type f \ + \( -name "*.ttf" -o -name "*.woff*" -o -name "*.eot" -o \ + -name "*.svg" \) | xargs chmod -x +# Generating the minified JS files from the no-minified ones. + find pagure/static/ -name "*.js" -type l \ + | sed 's/\.js$$//' | while read file ; do \ + yui-compressor -o $${file}.min.js $${file}.js; \ + done +# Generating the minified CSS from the non-minified ones. + find pagure/static/ -name "*.css" -type l \ + | sed 's/\.css$$//' | while read file ; do \ + yui-compressor -o $${file}.min.css $${file}.css; \ + done + dh_auto_build + PYTHONPATH=$(CURDIR) http_proxy='127.0.0.1:9' \ + make -C doc/ html man 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/source/options b/debian/source/options new file mode 100644 index 0000000..cb61fa5 --- /dev/null +++ b/debian/source/options @@ -0,0 +1 @@ +extend-diff-ignore = "^[^/]*[.]egg-info/" diff --git a/debian/watch b/debian/watch new file mode 100644 index 0000000..9d71a92 --- /dev/null +++ b/debian/watch @@ -0,0 +1,2 @@ +version=4 +https://pagure.io/releases/@PACKAGE@/@PACKAGE@@ANY_VERSION@@ARCHIVE_EXT@ debian uupdate