moved from hacked-up minimal Makefile to distutils

This commit is contained in:
Frédéric Péters 2005-04-23 14:59:55 +00:00
parent 33db55cd29
commit a15f37c049
6 changed files with 39 additions and 21 deletions

View File

@ -11,8 +11,11 @@ Prerequisites
Installation
------------
Just run `make install`; you may have to adjust `Makefile` to match your Python
installation if it is not 2.3 or installed in /usr/.
Authentic uses the standard distutils Python package; just run::
python setup.py install
and you're done.
Configuration

View File

@ -1,13 +0,0 @@
PYTHONDIR=/usr/lib/python2.3/site-packages/
install:
-mkdir -p $(DESTDIR)/$(PYTHONDIR)
for f in `find authentic -type d -not -name CVS` ; do \
test -d $(DESTDIR)/$(PYTHONDIR)/$$f || mkdir $(DESTDIR)/$(PYTHONDIR)/$$f ; \
done
for f in `find authentic -name '*.py' -or -name '*.ptl' -or -name '*.png'`; do \
cp $$f $(DESTDIR)/$(PYTHONDIR)/$$f ; \
done

3
debian/dirs vendored
View File

@ -1,3 +1,2 @@
etc/apache2/sites-available
usr/lib/python2.3/site-packages
usr/share/authentic/web/css
usr

1
debian/docs vendored
View File

@ -0,0 +1 @@
README

5
debian/rules vendored
View File

@ -36,10 +36,7 @@ install: build
dh_clean -k
dh_installdirs
$(MAKE) install DESTDIR=$(CURDIR)/debian/authentic
cp root/index.html $(CURDIR)/debian/authentic/usr/share/authentic/web/
cp root/css/*.css root/css/*.jpg root/css/*.png \
$(CURDIR)/debian/authentic/usr/share/authentic/web/css/
python setup.py install --prefix=$(CURDIR)/debian/authentic/usr --no-compile
cp debian/vhost-apache-authentic $(CURDIR)/debian/authentic/etc/apache2/sites-available

31
setup.py Normal file
View File

@ -0,0 +1,31 @@
#! /usr/bin/env python
import os
import glob
import distutils.core
import distutils.sysconfig
import distutils.command
from quixote.ptl.qx_distutils import qx_build_py
class build_py(qx_build_py):
# modified to install extra png
def build_module(self, module, module_file, package):
print module, module_file, package
if module_file == 'authentic/liberty/root.ptl':
fn = 'authentic/liberty/check_on.png'
self.copy_file(fn, os.path.join(self.build_lib, fn))
rc = qx_build_py.build_module(self, module, module_file, package)
return rc
distutils.core.setup(
name = 'authentic',
package_dir = { 'authentic': 'authentic' },
packages = ['authentic', 'authentic.admin', 'authentic.liberty'],
cmdclass = {'build_py': build_py},
data_files = [('share/authentic/web/', ( 'root/index.html',)),
('share/automatic/web/css', tuple(
glob.glob('root/css/*.css') + \
glob.glob('root/css/*.jpg') + \
glob.glob('root/css/*.png'))) ]
)