Skip to content

Commit

Permalink
Add support for Debian Buster (10) (#362)
Browse files Browse the repository at this point in the history
  • Loading branch information
evilaliv3 committed Sep 30, 2019
1 parent c10b500 commit df54096
Show file tree
Hide file tree
Showing 14 changed files with 83 additions and 66 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
language: python
dist: trusty
dist: buster
sudo: required
python:
- "2.7"
- "3.7"
install: true
script:
- $TRAVIS_BUILD_DIR/scripts/travis.sh
2 changes: 1 addition & 1 deletion debian/compat
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7
9
2 changes: 1 addition & 1 deletion debian/control
30 changes: 17 additions & 13 deletions debian/controlX/control.bionic
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,29 @@ Maintainer: Random GlobaLeaks developers <info@globaleaks.org>
Section: web
Priority: optional
Build-Depends:
debhelper,
dh-apparmor,
dh-python,
python3 (>= 3.5),
python3-pip,
python3-setuptools,
debhelper,
devscripts,
dh-apparmor,
dh-python,
python3 (>= 3.5),
python3-pip,
python3-setuptools
Vcs-Git: https://github.com/globaleaks/Tor2web.git
Standards-Version: 3.9.8

Package: tor2web
Architecture: all
Depends:
apparmor,
apparmor-utils,
python3:any,
python3-cryptography,
python3-openssl,
python3-twisted,
tor
${misc:Depends},
${python3:Depends},
apparmor,
apparmor-utils,
lsb-base,
python3:any,
python3-cryptography,
python3-openssl,
python3-twisted,
tor
Description: Tor2web proxy.
Tor2web is an HTTP proxy software that enables access to
Tor Hidden Services by mean of common web browsers.
31 changes: 18 additions & 13 deletions debian/controlX/control.xenial → debian/controlX/control.buster
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,30 @@ Maintainer: Random GlobaLeaks developers <info@globaleaks.org>
Section: web
Priority: optional
Build-Depends:
debhelper,
dh-apparmor,
dh-python,
python (>= 2.7),
python-pip,
python-setuptools,
debhelper,
devscripts,
dh-apparmor,
dh-python,
python3,
python3-pip,
python3-setuptools
Vcs-Git: https://github.com/globaleaks/Tor2web.git
Standards-Version: 3.9.8
X-Python3-Version: all

Package: tor2web
Architecture: all
Depends:
apparmor,
apparmor-utils,
python:any (>= 2.7.5-5~), python:any (<< 2.8),
python-cryptography,
python-openssl,
python-twisted-core,
tor
${misc:Depends},
${python3:Depends},
apparmor,
apparmor-utils,
lsb-base,
python3:any,
python3-cryptography,
python3-openssl,
python3-twisted,
tor
Description: Tor2web proxy.
Tor2web is an HTTP proxy software that enables access to
Tor Hidden Services by mean of common web browsers.
16 changes: 15 additions & 1 deletion debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,22 @@ export PYBUILD_NAME=tor2web
export PYBUILD_DISABLE=test
export PYBUILD_INSTALL_ARGS=--no-compile

DISTRIBUTION := $(shell head -n1 debian/changelog | cut -d ' ' -f3 | cut -d ';' -f1)

ifeq ($(DISTRIBUTION),buster)
PYTHON_BIN := python3
PYTHON_VER := python3
else ifeq ($(DISTRIBUTION),bionic)
PYTHON_BIN := python3
PYTHON_VER := python3
else
PYTHON_BIN := python2
PYTHON_VER := python2
endif


%:
dh $@ --with python2 --buildsystem=pybuild
dh $@ --with $(PYTHON_VER) --buildsystem=pybuild

override_dh_install:
dh_apparmor --profile-name=usr.bin.tor2web
Expand Down
2 changes: 2 additions & 0 deletions debian/tor2web.postinst
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,5 @@ fi
chown tor2web:tor2web /home/tor2web/ -R
find /home/tor2web/ -type d -exec chmod 770 {} \;
find /home/tor2web/ -type f -exec chmod 660 {} \;

#DEBHELPER#
2 changes: 1 addition & 1 deletion requirements.txt
13 changes: 13 additions & 0 deletions requirements/requirements-buster.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Parsley==1.2
Twisted==18.9.0
cffi==1.12.2
cryptography==2.6.1
enum34==1.1.6
idna==2.6
pyOpenSSL==19.0.0
pyasn1==0.4.2
pycparser==2.19
service_identity==18.1.0
six==1.12.0
transaction==1.4.3
zope.interface==4.4.2
13 changes: 0 additions & 13 deletions requirements/requirements-xenial.txt

This file was deleted.

6 changes: 3 additions & 3 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ usage() {
echo "Valid options:"
echo " -h"
echo -e " -t tagname (build specific release/branch)"
echo -e " -d distribution (available: xenial, bionic)"
echo -e " -d distribution (available: buster, bionic)"
echo -e " -n (do not sign)"
echo -e " -p (push on repository)"
}

TARGETS="xenial bionic"
DISTRIBUTION="xenial"
TARGETS="buster bionic"
DISTRIBUTION="buster"
TAG="master"
NOSIGN=0
PUSH=0
Expand Down
13 changes: 6 additions & 7 deletions scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -152,17 +152,16 @@ fi
#
# Depending on the intention of the user to proceed anyhow installing on
# a not supported distro we using the experimental package if it exists
# or xenial as fallback.
if echo "$DISTRO_CODENAME" | grep -vqE "^(bionic|xenial)"; then
# In case of unsupported platforms we fallback on Bionic
echo "Detected OS: $DISTRO - $DISTRO_CODENAME, which is not supported: fallback to 'bionic'"
DISTRO="Ubuntu"
DISTRO_CODENAME="bionic"
# or buster as fallback.
if echo "$DISTRO_CODENAME" | grep -vqE "^(buster|bionic)"; then
# In case of unsupported platforms we fallback on Buster
echo "Detected OS: $DISTRO - $DISTRO_CODENAME, which is not supported: fallback to 'buster'"
DISTRO="Debian"
DISTRO_CODENAME="buster"
else
echo "Detected OS: $DISTRO - $DISTRO_CODENAME"
fi


echo "Adding GlobaLeaks PGP key to trusted APT keys"
TMPFILE=$TMPDIR/globaleaks_key
echo "$GLOBALEAKS_PGP_KEY" > $TMPFILE
Expand Down
8 changes: 3 additions & 5 deletions scripts/travis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ set -e

sudo apt-get update -y

sudo apt-get install -y debhelper devscripts dh-apparmor dh-python python python-pip python-setuptools python-sphinx
sudo apt-get install -y debhelper devscripts dh-apparmor dh-python dput fakeroot python3 python3-pip python3-setuptools python3-sphinx

rm -rf requirements.txt
ln -s requirements/requirements-xenial.txt requirements.txt
pip install -r requirements.txt
pip3 install -r requirements.txt

./scripts/build.sh -d xenial -t $TRAVIS_COMMIT -n
./scripts/build.sh -d buster -t $TRAVIS_COMMIT -n
7 changes: 1 addition & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,17 @@
#-*- coding: utf-8 -*-

import os
import pip
import re
from setuptools import find_packages, setup

from tor2web import __version__

install_requires = [str(r.req) for r in pip.req.parse_requirements('requirements.txt',
session=pip.download.PipSession())]

setup(
name="tor2web",
version=__version__,
author="Random GlobaLeaks developers",
author_email = "info@globaleaks.org",
url="https://tor2web.org/",
packages=find_packages(exclude=['*.tests', '*.tests.*']),
scripts=["bin/tor2web"],
install_requires=install_requires
scripts=["bin/tor2web"]
)

0 comments on commit df54096

Please sign in to comment.