1. Guido Draheim
  2. trac-userscriptservernotes-plugin

Source

trac-userscriptservernotes-plugin / src / setup.py

#!/usr/bin/env python
# -*- coding: utf8 -*-

from setuptools import setup
import re

def spec(filename, variable):
    section = None
    for line in open(filename):
        if section is not None:
            if line.startswith("%"):
                return section
            section += line
            continue
        m = re.match(r"%define\s+(\w+)\s+(\S+)", line)
        if m and m.group(1) == "_"+variable:
            return m.group(2)
        m = re.match(r"(\w+):\s+(\S+)", line)
        if m and m.group(1) == variable:
            return m.group(2)
        m = re.match(r"%(\w+)\s*$", line)
        if m and m.group(1) == variable:
            section = ""

##########################################        

RPM = "trac-userscriptservernotes-plugin.spec"
PACKAGENAME = 'UserscriptServerNotes'
PACKAGE = 'usernotes'
VERSION = spec(RPM, "version")
URL = spec(RPM, "url")
README = spec(RPM, "description")
 
setup(
  package_data = { PACKAGE: ['templates/*.html', 
                             'htdocs/css/*.css',  
                             'htdocs/js/*.js',  
                             'htdocs/tools/*.py',  
                             "locale/*/LC_MESSAGES/*.mo"]},
  name = PACKAGENAME,
  version = VERSION,
  packages = [ PACKAGE, PACKAGE+".db" ],
  include_package_data=True,
  entry_points = {'trac.plugins': [
    'UserscriptServerNotes.init = usernotes.init',
    'UserscriptServerNotes.settings = usernotes.settings',
    'UserscriptServerNotes.notes_mail = usernotes.notes_mail',
    'UserscriptServerNotes.notes_info = usernotes.notes_info',
    'UserscriptServerNotes.web_nav = usernotes.web_nav',
    'UserscriptServerNotes.web_ui = usernotes.web_ui',
  ]},
  test_suite = "tests",
  keywords = 'trac userscript notes',
  author = 'Guido Draheim',
  author_email = 'guidod-2007-@gmx.de',
  url = URL,
  description = README,
  license = '''BSD''',
)