Ottomata has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/336722 )

Change subject: Fix for missing _regexes.py, release 0.7.2-2
......................................................................

Fix for missing _regexes.py, release 0.7.2-2

Also:
- added debian/copyright
- building with python3 and pybuild

Bug: T156821
Change-Id: I72ec2fb677060fdda40957a0aeb168294922bdb9
---
A debian/README.debian
M debian/changelog
M debian/control
A debian/copyright
M debian/gbp.conf
A debian/patches/build_regexes.py_without_git.diff
A debian/patches/series
M debian/rules
M setup.py
9 files changed, 116 insertions(+), 15 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/debs/python-ua-parser 
refs/changes/22/336722/1

diff --git a/debian/README.debian b/debian/README.debian
new file mode 100644
index 0000000..78c3da2
--- /dev/null
+++ b/debian/README.debian
@@ -0,0 +1,7 @@
+Upstream's setup.py needs to be able to git submodule update uap-core, and then
+use that to compile _regexes.py from regexes.yaml.  However, setup.py's
+build_regexes step returns with no error if the .git does not exist.
+
+Patches here modify setup.py during build so that the build happens from
+the submodule source included source package, and is able to compile
+_regexes.py properly.
\ No newline at end of file
diff --git a/debian/changelog b/debian/changelog
index 78dcd09..76e185d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+ua-parser (0.7.2-2) unstable; urgency=low
+
+  * Adding copyright, fixing missing _regexes.py
+
+ -- Andrew Otto (WMF) <[email protected]>  Wed, 08 Feb 2017 14:57:51 -0500
+
+
 ua-parser (0.7.2-1) unstable; urgency=low
 
   * Initial release
diff --git a/debian/control b/debian/control
index e0fa057..bc474fb 100644
--- a/debian/control
+++ b/debian/control
@@ -2,10 +2,19 @@
 Maintainer: Andrew Otto (WMF) <[email protected]>
 Section: python
 Priority: optional
-Build-Depends: python-setuptools (>= 0.6b3), python-all (>= 2.6.6-3), 
debhelper (>= 8), python-yaml
+Build-Depends: debhelper (>= 8), dh-python,
+ python-all (>= 2.6.6-3), python-setuptools (>= 0.6b3), python-yaml,
+ python3-all (>= 2.6.6-3), python3-setuptools (>= 0.6b3), python3-yaml
 Standards-Version: 3.9.3
 
 Package: python-ua-parser
 Architecture: all
 Depends: ${misc:Depends}, ${python:Depends}
+Provides: ${python:Provides}
+Description: Python port of Browserscope's user agent parser
+
+Package: python3-ua-parser
+Architecture: all
+Depends: ${misc:Depends}, ${python3:Depends}
+Provides: ${python3:Provides}
 Description: Python port of Browserscope's user agent parser
diff --git a/debian/copyright b/debian/copyright
new file mode 100644
index 0000000..6886b37
--- /dev/null
+++ b/debian/copyright
@@ -0,0 +1,57 @@
+Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: uap-python
+Source: https://github.com/ua-parser/uap-python
+
+Files: *
+License: Apache
+ Copyright 2008 Google Inc.
+ .
+ Licensed under the Apache License, Version 2.0 (the 'License')
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+ .
+   http://www.apache.org/licenses/LICENSE-2.0
+ .
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an 'AS IS' BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+limitations under the License.
+Copyright: (c) 2011 Julian Berman
+License: MIT
+ 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.
+
+Files: debian/*
+Copyright: 2015 Ori Livneh <[email protected]>
+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".
\ No newline at end of file
diff --git a/debian/gbp.conf b/debian/gbp.conf
index 8f0140d..37e840e 100644
--- a/debian/gbp.conf
+++ b/debian/gbp.conf
@@ -3,3 +3,4 @@
 upstream-tag=%(version)s
 debian-tag=debian/%(version)s
 debian-branch=debian
+submodules=True
\ No newline at end of file
diff --git a/debian/patches/build_regexes.py_without_git.diff 
b/debian/patches/build_regexes.py_without_git.diff
new file mode 100644
index 0000000..1c934cf
--- /dev/null
+++ b/debian/patches/build_regexes.py_without_git.diff
@@ -0,0 +1,30 @@
+Index: python-ua-parser/setup.py
+===================================================================
+--- python-ua-parser.orig/setup.py
++++ python-ua-parser/setup.py
+@@ -58,12 +58,12 @@ class build_regexes(Command):
+
+     def run(self):
+         work_path = self.work_path
+-        if not os.path.exists(os.path.join(work_path, '.git')):
+-            return
++        #if not os.path.exists(os.path.join(work_path, '.git')):
++        #    return
+
+-        log.info('initializing git submodules')
+-        check_output(['git', 'submodule', 'init'], cwd=work_path)
+-        check_output(['git', 'submodule', 'update'], cwd=work_path)
++        #log.info('initializing git submodules')
++        #check_output(['git', 'submodule', 'init'], cwd=work_path)
++        #check_output(['git', 'submodule', 'update'], cwd=work_path)
+
+         yaml_src = os.path.join(work_path, 'uap-core', 'regexes.yaml')
+         if not os.path.exists(yaml_src):
+@@ -76,6 +76,7 @@ class build_regexes(Command):
+             return text.encode('utf8')
+
+         import yaml
++        check_output(['mkdir', '-p', os.path.join(self.build_lib, 
'ua_parser')])
+         py_dest = os.path.join(self.build_lib, 'ua_parser', '_regexes.py')
+
+         log.info('compiling regexes.yaml -> _regexes.py')
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..8a0ac69
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+build_regexes.py_without_git.diff
diff --git a/debian/rules b/debian/rules
index a407984..2494cfd 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,21 +1,10 @@
 #!/usr/bin/make -f
 
-%:
-       dh $@ --with python2 --buildsystem=python_distutils
+export PYBUILD_NAME=ua-parser
 
+%:
+       dh $@ --with python2,python3 --buildsystem=pybuild
 
 override_dh_auto_clean:
        python setup.py clean -a
        find . -name \*.pyc -exec rm {} \;
-
-
-override_dh_auto_build:
-       python setup.py build --force
-
-
-override_dh_auto_install:
-       python setup.py install --force --root=debian/python-ua-parser 
--no-compile -O0 --install-layout=deb --prefix=/usr
-
-
-override_dh_python2:
-       dh_python2 --no-guessing-versions
diff --git a/setup.py b/setup.py
old mode 100644
new mode 100755

-- 
To view, visit https://gerrit.wikimedia.org/r/336722
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I72ec2fb677060fdda40957a0aeb168294922bdb9
Gerrit-PatchSet: 1
Gerrit-Project: operations/debs/python-ua-parser
Gerrit-Branch: debian
Gerrit-Owner: Ottomata <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to