summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--www/trac-gantt/Makefile26
-rw-r--r--www/trac-gantt/files/patch-setup.py13
-rw-r--r--www/trac-gantt/files/patch-tracgantt-gantt.py48
-rw-r--r--www/trac-gantt/pkg-descr5
-rw-r--r--www/trac-gantt/pkg-message73
5 files changed, 147 insertions, 18 deletions
diff --git a/www/trac-gantt/Makefile b/www/trac-gantt/Makefile
index 0ff5c871d8b5..8a6516dc4f37 100644
--- a/www/trac-gantt/Makefile
+++ b/www/trac-gantt/Makefile
@@ -7,7 +7,7 @@
PORTNAME= TracGantt
PORTVERSION= 0.3.2a
-PORTREVISION= 2
+PORTREVISION= 3
CATEGORIES= www devel python
MASTER_SITES= http://willbarton.com/files/ \
http://dryice.name/computer/FreeBSD/distfiles/
@@ -16,30 +16,26 @@ PKGNAMEPREFIX= trac-
MAINTAINER= dryice@dryice.name
COMMENT= A plugin to creates Gantt charts for trac
-RUN_DEPENDS+= tracd:${PORTSDIR}/www/trac
BUILD_DEPENDS+= easy_install:${PORTSDIR}/devel/py-setuptools
+RUN_DEPENDS+= trac>=0.11:${PORTSDIR}/www/trac
+NO_BUILD= yes
USE_PYTHON= 2.3+
+USE_PYDISTUTILS=yes
PLIST_SUB+= PORTVERSION=${PORTVERSION} PYTHONVERSION=${_PYTHON_VERSION}
+PYDISTUTILS_NOEGGINFO= yes
.if !defined(NOPORTDOCS)
PORTDOCS= PKG-INFO README
.endif
-do-build:
- cd ${WRKSRC}; \
- ${PYTHON_CMD} setup.py bdist_egg
-
-do-install:
-.for i in *
- ${INSTALL_DATA} ${WRKSRC}/dist/${i} ${PYTHON_SITELIBDIR}/
-.endfor
+.include <bsd.port.pre.mk>
+post-install:
.if !defined(NOPORTDOCS)
- ${MKDIR} ${DOCSDIR}
-.for i in ${PORTDOCS}
- ${INSTALL_DATA} ${WRKSRC}/${i} ${DOCSDIR}
-.endfor
+ @${INSTALL} -d ${DOCSDIR}
+ @cd ${WRKSRC} && ${COPYTREE_SHARE} "${PORTDOCS}" ${DOCSDIR}
.endif
+ @${CAT} ${PKGMESSAGE}
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>
diff --git a/www/trac-gantt/files/patch-setup.py b/www/trac-gantt/files/patch-setup.py
new file mode 100644
index 000000000000..9455c77a4b0c
--- /dev/null
+++ b/www/trac-gantt/files/patch-setup.py
@@ -0,0 +1,13 @@
+--- setup.py.orig 2008-08-13 08:54:31.000000000 -0400
++++ setup.py 2008-08-13 08:54:44.000000000 -0400
+@@ -9,8 +9,8 @@
+ packages = ['tracgantt'],
+ package_data={'tracgantt': ['templates/*.cs', 'htdocs/*.css']},
+
+- #install_requires = ['trac>=0.9'],
+- #entry_points = {'trac.plugins': ['module_name = gantt']},
++ install_requires = ['trac>=0.11'],
++ entry_points = {'trac.plugins': ['tracgantt = tracgantt']},
+
+ author = "Will Barton",
+ author_email = "wbb4@opendarwin.org",
diff --git a/www/trac-gantt/files/patch-tracgantt-gantt.py b/www/trac-gantt/files/patch-tracgantt-gantt.py
new file mode 100644
index 000000000000..6b48b8c0df26
--- /dev/null
+++ b/www/trac-gantt/files/patch-tracgantt-gantt.py
@@ -0,0 +1,48 @@
+--- tracgantt/gantt.py.orig 2006-07-20 21:07:06.000000000 +0400
++++ tracgantt/gantt.py 2008-08-14 05:44:53.000000000 +0400
+@@ -115,7 +115,7 @@
+ show_opened = self.env.config.getbool('gantt-charts',
+ 'show_opened', 'false')
+
+- tickets,dates,broken = self._tickets_for_report(db, report['query'])
++ tickets,dates,broken = self._tickets_for_report(db, report['query'], req.perm.username)
+ tickets,dates = self._paginate_tickets(tickets, dates)
+
+ req.hdf['gantt.tickets'] = tickets
+@@ -163,7 +163,7 @@
+
+ return {'id':id, 'title':title, 'query':query, 'description':description}
+
+- def _tickets_for_report(self, db, query):
++ def _tickets_for_report(self, db, query, username):
+ """ Get a list of Ticket instances for the tickets in a report """
+
+ tickets = []
+@@ -172,7 +172,7 @@
+
+ ## Get tickets for this report
+ cursor = db.cursor()
+- cursor.execute(query)
++ cursor.execute(query.replace('$USER', "'%s'" % username))
+ info = cursor.fetchall() or []
+ cols = [s[0] for s in cursor.description or []]
+ db.rollback()
+@@ -344,7 +344,7 @@
+ "use_creation_date", "true")
+
+ if use_cdate:
+- start = datetime.date.fromtimestamp(ticket.time_created)
++ start = datetime.date.fromordinal(ticket.time_created.toordinal())
+ else:
+ raise ValueError, "Couldn't get start date"
+
+@@ -370,8 +370,8 @@
+ % (str(ticket.id), str(start), str(due))
+
+ # Finally the ticket itself's open and close dates
+- open = datetime.date.fromtimestamp(ticket.time_created)
+- changed = datetime.date.fromtimestamp(ticket.time_changed)
++ open = ticket.time_created.date()
++ changed = ticket.time_changed.date()
+
+ return (start, due, open, changed)
diff --git a/www/trac-gantt/pkg-descr b/www/trac-gantt/pkg-descr
index d608fd3dbea0..ecf962d38164 100644
--- a/www/trac-gantt/pkg-descr
+++ b/www/trac-gantt/pkg-descr
@@ -1,6 +1,5 @@
A plugin for the Trac project/source code management system that
-creates Gantt charts based on ticket reports. It is a
-work-in-progress.
+creates Gantt charts based on ticket reports. It is a work-in-progress.
A Gantt chart is a graphical representation of the duration of tasks
against the progression of time. Gantt charts are very useful for
@@ -14,4 +13,4 @@ Tickets" tab in Trac). The Gantt charts are pure XHTML and are
generated on-the-fly from the ticket reports, using only the tickets
provided by the report.
-WWW: http://willbarton.com/
+WWW: http://willbarton.com/code/tracgantt/
diff --git a/www/trac-gantt/pkg-message b/www/trac-gantt/pkg-message
new file mode 100644
index 000000000000..4410493d2425
--- /dev/null
+++ b/www/trac-gantt/pkg-message
@@ -0,0 +1,73 @@
+----------------------------------------------------------------------
+To use the TracGantt plugin, please follow these instructions:
+
+Edit your Trac config file to add custom fields to tickets, as well
+as set the expected date format of those fields.
+
+The first things to add are the new ticket fields. If you already
+have a ticket-custom section, append these to it:
+
+ [ticket-custom]
+ due_assign = text
+ due_assign.label = Due to assign
+ due_assign.value = DD/MM/YYYY
+
+ dependencies = text
+ dependencies.label = Dependencies
+ dependencies.value =
+ due_close= text
+
+ due_close.label = Due to close
+ due_close.value = DD/MM/YYYY
+
+ include_gantt = checkbox
+ include_gantt.label = Include in GanttChart
+ include_gantt.value =
+
+This will add four new fields to tickets, a "Due to assign" field,
+which contains the date by which this ticket should be assigned, a
+"Dependencies" field, for listing ticket numbers upon which this
+ticket depends, a "Due to close" field, which contains the date by
+which this ticket should be closed, and finally a checkbox that
+allows the ticket to be included in Gantt charts.
+
+In addition, TracGantt provides several tweakable configuration
+knobs that you can use to change the behavior of the gantt charts.
+They are listed below with their default values.
+
+ [gantt-charts]
+
+ # The format of dates entered by humans in the above ticket
+ # fields
+ date_format = %m/%d/%Y
+
+ # Include the ticket summary in the gantt chart display
+ include_summary = true
+
+ # Trim the included summary to the given number of characters
+ summary_length = 16
+
+ # Use the creation date of a ticket as the "due assign"
+ # date if no assignment date is given
+ use_creation_date = true
+
+ # Show on the gantt chart the date the ticket was opened,
+ # to contrast with the assignment date.
+ show_opened = true
+
+
+NOTE: If you are placing the module anywhere outside of Trac's
+standard 'plugins' directory (i.e. to share across Trac instances),
+then you will also need to add:
+
+ [components]
+ tracgantt.* = enabled
+
+to your Trac config file. Again, this is only necessary if the egg
+file is placed outside of the Trac 'plugins' folder, in a standard
+Python search path.
+
+If you are using Trac with Apache and mod_python, you may also need
+to restart Apache, to avoid the plugin being accessible from one
+Apache process, but not others.
+----------------------------------------------------------------------