Entr'ouvert packaging for Debian

This commit is contained in:
Benjamin Dauvergne 2015-04-24 13:51:29 +02:00
parent 1931a98240
commit 5964384f39
8 changed files with 67 additions and 2 deletions

View File

@ -3,6 +3,8 @@ recursive-include django_select2/static *.*
recursive-exclude django_select2/static .DS_Store
exclude requirements_dev.txt
prune tests
include MANIFEST.in
include VERSION
[bdist_wheel]
universal=1

5
debian/changelog vendored Normal file
View File

@ -0,0 +1,5 @@
django-select2 (5.0~eo80+1) jessie-eobuilder; urgency=low
* Initial package
-- Benjamin Dauvergne <bdauvergne@entrouvert.com> Tue, 7 Mar 2017 12:54:32 +0100

1
debian/compat vendored Normal file
View File

@ -0,0 +1 @@
7

13
debian/control vendored Normal file
View File

@ -0,0 +1,13 @@
Source: django-select2
Maintainer: Entr'ouvert <info@entrouvert.com>
Section: python
Priority: optional
Build-Depends: python-setuptools (>= 0.6b3), python3-setuptools, python-all (>= 2.6.6-3), python3-all, debhelper (>= 7)
Standards-Version: 3.9.1
X-Python-Version: >= 2.7
Package: python-django-select2
Architecture: all
Depends: ${misc:Depends}, ${python:Depends}
Description: Select2 option fields for Django
The app includes Select2 driven Django Widgets and Form Fields.

5
debian/rules vendored Executable file
View File

@ -0,0 +1,5 @@
#!/usr/bin/make -f
%:
dh $@ --with python2 --buildsystem=python_distutils

1
debian/source/format vendored Normal file
View File

@ -0,0 +1 @@
3.0 (quilt)

1
debian/source/options vendored Normal file
View File

@ -0,0 +1 @@
extend-diff-ignore="\.egg-info$"

View File

@ -4,8 +4,10 @@ from __future__ import unicode_literals
import codecs
import os
import subprocess
from setuptools import Command, find_packages, setup
from distutils.command.sdist import sdist
from setuptools import find_packages, setup
def read(file_name):
@ -22,9 +24,43 @@ URL = "https://github.com/applegrew/django-select2"
VERSION = __import__(PACKAGE).__version__
def get_version():
'''Use the VERSION, if absent generates a version with git describe, if not
tag exists, take 0.0.0- and add the length of the commit log.
'''
if os.path.exists('VERSION'):
with open('VERSION', 'r') as v:
return v.read()
if os.path.exists('.git'):
p = subprocess.Popen(['git', 'describe', '--dirty', '--match=v*'], stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
result = p.communicate()[0]
if p.returncode == 0:
result = result.split()[0][1:]
else:
result = '0.0.0-%s' % len(subprocess.check_output(
['git', 'rev-list', 'HEAD']).splitlines())
return result.replace('-', '.')
return '0.0.0'
class eo_sdist(sdist):
def run(self):
print "creating VERSION file"
if os.path.exists('VERSION'):
os.remove('VERSION')
version = get_version()
version_file = open('VERSION', 'w')
version_file.write(version)
version_file.close()
sdist.run(self)
print "removing VERSION file"
if os.path.exists('VERSION'):
os.remove('VERSION')
setup(
name=NAME,
version=VERSION,
version=get_version(),
description=DESCRIPTION,
long_description=read("README.md"),
author=AUTHOR,
@ -51,4 +87,5 @@ setup(
'django-appconf>=0.6.0',
],
zip_safe=False,
cmdclass={'sdist': eo_sdist},
)