convert to setup.py packaging, which can be used with fpm.

add manifest file to include static and template  files
This commit is contained in:
Jeffrey Forman 2014-03-02 10:05:42 -05:00
parent e78b215327
commit 9e9190bf84
4 changed files with 36 additions and 69 deletions

6
MANIFEST.in Normal file
View File

@ -0,0 +1,6 @@
include README.markdown
recursive-include binder/db *
recursive-include binder/static *
recursive-include binder/templates *
recursive-include binder/tests *
recursive-include binder/testdata *

View File

@ -1,32 +0,0 @@
#!/bin/bash
if [ -x "`which fpm`" ]; then
echo "FPM found, attempting to build package."
else
echo "Unable to find 'fpm', which is required to build package tarball. See https://github.com/jordansissel/fpm."
exit
fi
if [ -z "$1" ]; then
echo "No version number specified, using date instead as version string."
version=`date "+%Y%m%d"`
else
echo "Package version specified as $1."
version=$1
fi
package_name="binder-$version.tgz"
fpm -s dir -t tar -n binder \
-v $version \
--package $package_name \
-x '**.git**' \
--prefix binder \
.
if [ $? -ne 0 ]; then
echo "fpm executed exited with an error. Package was not built correctly."
exit
fi
echo "Package built as $package_name."

30
setup.py Normal file
View File

@ -0,0 +1,30 @@
import os
from setuptools import setup
README = open(os.path.join(os.path.dirname(__file__), 'README.markdown')).read()
# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
name='django-binder',
version='0.1',
packages=['binder'],
include_package_data=True,
license='BSD License',
description='A simple Django app to manage your BIND DNS zones.',
long_description=README,
author='Jeffrey Forman',
author_email='code@jeffreyforman.net',
classifiers=[
'Environment :: Web Environment',
'Framework :: Django',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 2.7',
'Topic :: Internet :: WWW/HTTP',
'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
],
)

View File

@ -1,37 +0,0 @@
#!/bin/bash
# Usage: ./build-dpkg.sh $version $prefix
# Example: ./build-dpkg.sh 3.14 /usr/local
if [[ "$#" -lt 2 ]]; then
echo "You did not provide enough command line parameters. Example: tagrelease-builddpkg \$version \$prefix"
exit 1
fi
if [ -x "`which fpm`" ]; then
echo "FPM found, attempting to build package."
else
echo "Unable to find 'fpm', which is required to build package tarball. See https://github.com/jordansissel/fpm."
exit 1
fi
version="$1"
package_name="binder-$version.deb"
prefix="$2"
git tag -a "v$version" -m "binder v$"
fpm -s dir -t deb -n binder \
-v $version \
--package $package_name \
-x ".git" \
--prefix "$prefix/binder" \
`dirname $0`
if [ $? -ne 0 ]; then
echo "fpm executed exited with an error. Package was not built correctly."
exit
fi
echo "Package built as $package_name."
echo "Don't forget to run 'git push --tags"