Commit a54fe1ca authored by cvs2svn's avatar cvs2svn
Browse files

This commit was manufactured by cvs2svn to create tag 'RELEASE_5_EOL'.

parent c7651500
# $FreeBSD$
#
# Make sure we cannot define any combination of DRUPAL{4,5,6}
.if (defined(DRUPAL4_MODULE) && defined(DRUPAL5_MODULE)) || (defined(DRUPAL4_MODULE) && defined(DRUPAL6_MODULE)) || (defined(DRUPAL5_MODULE) && defined(DRUPAL6_MODULE))
BROKEN= cannot define a combination of DRUPAL4_MODULE, DRUPAL5_MODULE and DRUPAL6_MODULE
.endif
# Make sure DRUPAL_MODULE is defined. If no DRUPAL*_module defined, then define DRUPAL4_MODULE
.if defined(DRUPAL4_MODULE) || defined(DRUPAL5_MODULE) || defined(DRUPAL6_MODULE)
DRUPAL_MODULE?= yes
.endif
.if defined(DRUPAL_MODULE)
DRUPAL_MODTYPE= modules
.endif
# Make sure DRUPAL_PORT is defined. If no DRUPAL*_module defined, then define DRUPAL4_PORT
.if defined(DRUPAL4_PORT) || defined(DRUPAL5_PORT) || defined(DRUPAL6_PORT)
DRUPAL_PORT?= yes
.endif
# Make sure DRUPAL_THEME is defined
.if defined(DRUPAL5_THEME) || defined(DRUPAL6_THEME)
DRUPAL_THEME?= yes
DRUPAL_MODTYPE= themes
.endif
.if defined(DRUPAL6_MODULE) || defined(DRUPAL6_PORT) || defined(DRUPAL6_THEME)
DRUPAL_BASE?= www/drupal6
.else
.if defined(DRUPAL5_MODULE) || defined(DRUPAL5_PORT) || defined(DRUPAL5_THEME)
DRUPAL_BASE?= www/drupal5
.else
DRUPAL_BASE?= www/drupal4
.endif
.endif
DRUPAL_DIR= ${PREFIX}/${DRUPAL_BASE}
DRUPAL_DOCSDIR?= ${PREFIX}/${DRUPAL_BASE}/doc
PLIST_SUB+= DRUPAL_BASE=${DRUPAL_BASE}
SUB_LIST+= DRUPAL_BASE=${DRUPAL_BASE} DRUPAL_DIR=${DRUPAL_DIR}
.if defined(DRUPAL_PORT)
DOCSDIR?= ${DRUPAL_DOCSDIR}
.endif
.if defined(DRUPAL_MODULE) || defined (DRUPAL_THEME)
.if defined(DRUPAL4_MODULE)
PKGNAMEPREFIX= drupal4-
DRUPAL_VERSION?= 4.7.0
.if defined(DRUPAL_MODSUBDIR)
DRUPAL_MODDIR?= ${DRUPAL_BASE}/${DRUPAL_MODTYPE}/${DRUPAL_MODSUBDIR}
.else
DRUPAL_MODDIR?= ${DRUPAL_BASE}/${DRUPAL_MODTYPE}
.endif
.endif
.if defined(DRUPAL5_MODULE) || defined (DRUPAL5_THEME)
PKGNAMEPREFIX= drupal5-
DRUPAL_VERSION?= 5.0
.if defined(DRUPAL_MODSUBDIR)
DRUPAL_MODDIR?= ${DRUPAL_BASE}/sites/all/${DRUPAL_MODTYPE}/${DRUPAL_MODSUBDIR}
.else
DRUPAL_MODDIR?= ${DRUPAL_BASE}/sites/all/${DRUPAL_MODTYPE}/${PORTNAME}
.endif
.endif
.if defined(DRUPAL6_MODULE) || defined (DRUPAL6_THEME)
PKGNAMEPREFIX= drupal6-
DRUPAL_VERSION?= 6.0
.if defined(DRUPAL_MODSUBDIR)
DRUPAL_MODDIR?= ${DRUPAL_BASE}/sites/all/${DRUPAL_MODTYPE}/${DRUPAL_MODSUBDIR}
.else
DRUPAL_MODDIR?= ${DRUPAL_BASE}/sites/all/${DRUPAL_MODTYPE}/${PORTNAME}
.endif
.endif
DOCSDIR?= ${DRUPAL_DOCSDIR}/${PORTNAME}
.if defined(DRUPAL_MOD_SNAPSHOT)
MASTER_SITE_DRUPAL+= \
${MASTER_SITE_LOCAL}
MASTER_SITE_DRUPAL_SUBDIR= pav/drupal
.else
MASTER_SITE_DRUPAL+= \
http://ftp.drupal.org/files/projects/ \
http://ftp.osuosl.org/pub/drupal/files/projects/
MASTER_SITE_DRUPAL_SUBDIR=
.endif
MASTER_SITES?= ${MASTER_SITE_DRUPAL}
MASTER_SITE_SUBDIR?= ${MASTER_SITE_DRUPAL_SUBDIR}
DIST_SUBDIR= drupal
NO_BUILD?= yes
WRKSRC?= ${WRKDIR}/${PORTNAME}
RUN_DEPENDS+= ${LOCALBASE}/${DRUPAL_BASE}/index.php:${PORTSDIR}/${DRUPAL_BASE}
.if defined(MODULE_CONF_FILES)
SUB_FILES= pkg-install
SUB_LIST+= CONF_FILES="${MODULE_CONF_FILES:C|^|${DRUPAL_MODDIR}/|}" \
CONF_DIRS="${MODULE_CONF_DIRS:C|^|${DRUPAL_MODDIR}/|}"
# XXX: where?
PKGINSTALL= ${WRKDIR}/pkg-install
PKGDEINSTALL= ${PKGINSTALL}
.endif
PLIST_SUB+= DRUPAL_MODDIR=${DRUPAL_MODDIR}
PLIST_FILES+= ${MODULE_FILES:C|^|%%DRUPAL_MODDIR%%/|}
PLIST_FILES+= ${MODULE_CONF_FILES:C|^|%%DRUPAL_MODDIR%%/|:C|$|-dist|}
PLIST_DIRS+= ${MODULE_DIRS:C|^|%%DRUPAL_MODDIR%%/|}
.if defined(DRUPAL5_MODULE) || defined(DRUPAL5_THEME) || defined(DRUPAL6_MODULE) || defined(DRUPAL6_THEME)
PLIST_DIRS+= ${DRUPAL_MODDIR}
.endif
.if defined(DRUPAL_MODSUBDIR)
PLIST_DIRS+= ${DRUPAL_MODDIR}
.endif
.if !defined(NOPORTDOCS)
PLIST_FILES+= ${DOC_FILES:C|^|%%DOCSDIR%%/|}
PLIST_DIRS+= ${DOC_DIRS:C|^|%%DOCSDIR%%/|}
PLIST_DIRS+= %%DOCSDIR%%
.endif
do-install:
.if defined(DRUPAL5_MODULE) || defined(DRUPAL5_THEME) || defined(DRUPAL6_MODULE) || defined(DRUPAL6_THEME)
@${MKDIR} ${DRUPAL_MODDIR:C|^|${PREFIX}/|}
@${CHOWN} ${WWWOWN}:${WWWGRP} ${DRUPAL_MODDIR:C|^|${PREFIX}/|}
.endif
.if defined(MODULE_CONF_DIRS)
@${MKDIR} ${MODULE_CONF_DIRS:C|^|${PREFIX}/${DRUPAL_MODDIR}/|}
@${CHOWN} ${WWWOWN}:${WWWGRP} ${MODULE_CONF_DIRS:C|^|${PREFIX}/${DRUPAL_MODDIR}/|}
.endif
.if defined(MODULE_DIRS)
@${MKDIR} ${MODULE_DIRS:C|^|${PREFIX}/${DRUPAL_MODDIR}/|}
@${CHOWN} ${WWWOWN}:${WWWGRP} ${MODULE_DIRS:C|^|${PREFIX}/${DRUPAL_MODDIR}/|}
.endif
.for f in ${MODULE_FILES}
@${INSTALL_DATA} ${WRKSRC}/${f} ${PREFIX}/${DRUPAL_MODDIR}/${f}
@${CHOWN} ${WWWOWN}:${WWWGRP} ${PREFIX}/${DRUPAL_MODDIR}/${f}
.endfor
.for f in ${MODULE_CONF_FILES}
@${INSTALL_DATA} ${WRKSRC}/${f} ${PREFIX}/${DRUPAL_MODDIR}/${f}-dist
@${CHOWN} ${WWWOWN}:${WWWGRP} ${PREFIX}/${DRUPAL_MODDIR}/${f}-dist
.endfor
.if !defined(NOPORTDOCS)
@${MKDIR} ${DOCSDIR} ${DOC_DIRS:C|^|${DOCSDIR}/|}
.for f in ${DOC_FILES}
@${INSTALL_DATA} ${WRKSRC}/${f} ${DOCSDIR}/${f}
.endfor
.endif
.if defined(MODULE_CONF_FILES)
post-install:
@${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
.endif
.endif
#-*- mode: Makefile; tab-width: 4; -*-
# ex:ts=4
#
# $FreeBSD$
#
# Please view me with 4 column tabs!
# Please make sure all changes to this file are past through the maintainer.
# Do not commit them yourself (unless of course you're the Port's Wraith ;).
KDE_MAINTAINER= kde@FreeBSD.org
# This section contains the USE_ definitions.
# XXX: Write HAVE_ definitions sometime.
# USE_QT_VER - Says that the port uses the Qt toolkit. Possible values:
# 3, 4; each specify the major version of Qt to use.
# Note: 4 is handled by bsd.qt.mk.
# USE_KDELIBS_VER - Says that the port uses KDE libraries. Possible values:
# 3 specifies the major version of KDE to use.
# This implies USE_QT of the appropriate version.
# USE_KDEBASE_VER - Says that the port uses the KDE base. Possible values:
# 3 specifies the major version of KDE to use.
# This implies USE_KDELIBS of the appropriate version.
# tagged MASTER_SITE_KDE_kde
kmaster= ${MASTER_SITE_KDE:S@%/@%/:kde@g}
.if !defined(MASTER_SITE_SUBDIR)
MASTER_SITE_KDE_kde= ${kmaster:S@%SUBDIR%/@@g}
.else
ksub=${MASTER_SITE_SUBDIR}
MASTER_SITE_KDE_kde= ${kmaster:S@%SUBDIR%/@${ksub}/@g}
.endif # !defined(MASTER_SITE_SUBDIR)
# USE_KDEBASE_VER section
.if defined(USE_KDEBASE_VER)
.if ${USE_KDEBASE_VER} == CVS
LIB_DEPENDS+= kfontinst:${PORTSDIR}/x11/kdebase
USE_KDELIBS_VER=CVS
.elif ${USE_KDEBASE_VER} == 3
# kdebase 3.x common stuff
LIB_DEPENDS+= kfontinst:${PORTSDIR}/x11/kdebase3
USE_KDELIBS_VER=3
.endif # ${USE_KDEBASE_VER} == 3
.endif # defined(USE_KDEBASE_VER)
# USE_KDELIBS_VER section
.if defined(USE_KDELIBS_VER)
## This is needed for configure scripts to figure out
## which threads lib to use
CONFIGURE_ENV+= PTHREAD_LIBS="${PTHREAD_LIBS}"
## Every KDE application is inherently IPv6-capable
CATEGORIES+=ipv6
## XXX - This really belongs into bsd.port.mk
.if !defined(_NO_KDE_CONFTARGET_HACK)
CONFIGURE_TARGET=
CONFIGURE_ARGS+=--build=${MACHINE_ARCH}-portbld-freebsd${OSREL} \
--x-libraries=${LOCALBASE}/lib --x-includes=${LOCALBASE}/include \
--disable-as-needed
.endif
.if ${USE_KDELIBS_VER} == CVS
LIB_DEPENDS+= kimproxy:${PORTSDIR}/x11/kdelibs
USE_QT_VER= CVS
PREFIX= ${KDE_CVS_PREFIX}
.elif ${USE_KDELIBS_VER} == 3
# kdelibs 3.x common stuff
LIB_DEPENDS+= kimproxy:${PORTSDIR}/x11/kdelibs3
USE_QT_VER= 3
PREFIX= ${KDE_PREFIX}
.else
IGNORE= cannot install: unsupported value in USE_KDELIBS_VER
.endif # ${USE_KDELIBS_VER} == 3
.endif # defined(USE_KDELIBS_VER)
# End of USE_KDELIBS_VER section
# USE_QT_VER section
.if ${USE_QT_VER} == CVS
KDE_CVS_PREFIX?= ${LOCALBASE}/kde-cvs
QT_CVS_PREFIX?= ${LOCALBASE}/qt-cvs
QTCPPFLAGS?=
QTCFGLIBS?=
MOC?= ${QT_CVS_PREFIX}/bin/moc
BUILD_DEPENDS+= ${MOC}:${PORTSDIR}/x11-toolkits/qt-copy
RUN_DEPENDS+= ${MOC}:${PORTSDIR}/x11-toolkits/qt-copy
QTCPPFLAGS+= -D_GETOPT_H # added to work around broken getopt.h #inc
.if !defined (QT_NONSTANDARD)
CONFIGURE_ARGS+=--with-extra-libs="${LOCALBASE}/lib" \
--with-extra-includes="${LOCALBASE}/include"
CONFIGURE_ENV+= MOC="${MOC}" CPPFLAGS="${CPPFLAGS} ${QTCPPFLAGS}" LIBS="${QTCFGLIBS}" \
QTDIR="${QT_CVS_PREFIX}" KDEDIR="${KDE_CVS_PREFIX}"
.endif
.elif ${USE_QT_VER} == 3
# Yeah, it's namespace pollution, but this is really the best place for this
# stuff. Arts does NOT use it anymore.
KDE_VERSION= 3.5.8
KDE_ORIGVER= ${KDE_VERSION}
KDE_PREFIX?= ${LOCALBASE}
QTCPPFLAGS?=
QTCGFLIBS?=
# Qt 3.x common stuff
QT_PREFIX?= ${LOCALBASE}
MOC?= ${QT_PREFIX}/bin/moc
#LIB_DEPENDS+= qt-mt.3:${PORTSDIR}/x11-toolkits/qt33
BUILD_DEPENDS+= ${QT_PREFIX}/bin/moc:${PORTSDIR}/x11-toolkits/qt33
RUN_DEPENDS+= ${QT_PREFIX}/bin/moc:${PORTSDIR}/x11-toolkits/qt33
QTCPPFLAGS+= -I${LOCALBASE}/include -I${PREFIX}/include \
-I${QT_PREFIX}/include -D_GETOPT_H
QTCFGLIBS+= -Wl,-export-dynamic -L${LOCALBASE}/lib -ljpeg \
-L${QT_PREFIX}/lib
.if defined(PACKAGE_BUILDING)
TMPDIR?= /tmp
MAKE_ENV+= TMPDIR="${TMPDIR}"
CONFIGURE_ENV+= TMPDIR="${TMPDIR}"
.endif
.if !defined(QT_NONSTANDARD)
CONFIGURE_ARGS+=--with-qt-includes=${QT_PREFIX}/include \
--with-qt-libraries=${QT_PREFIX}/lib \
--with-extra-libs=${LOCALBASE}/lib \
--with-extra-includes=${LOCALBASE}/include
CONFIGURE_ENV+= MOC="${MOC}" CPPFLAGS="${CPPFLAGS} ${QTCPPFLAGS}" LIBS="${QTCFGLIBS}" \
QTDIR="${QT_PREFIX}" KDEDIR="${KDE_PREFIX}"
.endif # !defined(QT_NONSTANDARD)
.else
IGNORE= cannot install: unsupported value of USE_QT_VER
.endif # defined(USE_QT_VER)
# End of USE_QT_VER section
# Assemble plist from parts
# <alane@freebsd.org> 2002-12-06
.if defined(KDE_BUILD_PLIST)
PLIST?= ${WRKDIR}/plist
PLIST_BASE?= plist.base
PLIST_APPEND?=
plist_base=${FILESDIR}/${PLIST_BASE}
plist_base_rm=${FILESDIR}/${PLIST_BASE}.rm
plist_append=${PLIST_APPEND:C:([A-Za-z0-9._]+):${FILESDIR}/\1:}
plist_append_rm=${PLIST_APPEND:C:([A-Za-z0-9._]+):${FILESDIR}/\1.rm:}
kde-plist:
${CAT} ${plist_base} ${plist_append} 2>/dev/null >${PLIST}
-${CAT} ${plist_append_rm} ${plist_base_rm} 2>/dev/null >>${PLIST};true
.PHONY: kde-plist
pre-build: kde-plist
.endif # defined(KDE_BUILD_PLIST)
#!/usr/bin/env python
# Improved build scheduler. We try to build leaf packages (those
# which can be built immediately without requiring additional
# dependencies to be built) in the order such that the ones required
# by the longest dependency chains are built first.
#
# This has the effect of favouring deep parts of the package tree and
# evening out the depth over time, hopefully avoiding the situation
# where the entire cluster waits for a deep part of the tree to
# build on a small number of machines
#
# Other advantages are that this system is easily customizable and
# will let us customize things like the matching policy of jobs to
# machines.
#
# TODO:
# * External queue manager
# * Mark completed packages instead of deleting them
# * check mtime for package staleness (cf make)
# * Check for parent mtimes after finishing child
import os, sys, threading, time, subprocess, fcntl, operator
#from itertools import ifilter, imap
from random import choice
def parseindex(indexfile):
tmp={}
pkghash={}
for i in file(indexfile):
line=i.rstrip().split("|")
pkg = line[0]
tmp[pkg] = line[1:]
# XXX hash category names too
# Trick python into storing package names by reference instead of copying strings and wasting 60MB
pkghash[pkg] = pkg
index=dict.fromkeys(tmp.keys())
for pkg in tmp.iterkeys():
line = tmp[pkg]
data={'name': pkg, 'path':line[0],
#'prefix':line[1],
#'comment':line[2],
#'descr':line[3],
#'maintainer':line[4],
'categories':line[5], # XXX duplicates strings
'bdep':[pkghash[i] for i in line[6].split(None)],
'rdep':[pkghash[i] for i in line[7].split(None)],
#'www':line[8],
'edep':[pkghash[i] for i in line[9].split(None)],
'pdep':[pkghash[i] for i in line[10].split(None)],
'fdep':[pkghash[i] for i in line[11].split(None)],
'height':None}
if index[pkg] is None:
index[pkg] = data
else:
index[pkg].update(data)
if not index[pkg].has_key('parents'):
index[pkg]['parents'] = []
# XXX iter?
deps=set()
for j in ['bdep','rdep','edep','fdep','pdep']:
deps.update(set(index[pkg][j]))
index[pkg]['deps'] = [pkghash[i] for i in deps]
for j in deps:
# This grossness is needed to avoid a second pass through
# the index, because we might be about to refer to
# packages that have not yet been processed
if index[j] is not None:
if index[j].has_key('parents'):
index[j]['parents'].append(pkghash[pkg])
else:
index[j]['parents'] = [pkghash[pkg]]
else:
index[j] = {'parents':[pkghash[pkg]]}
return index
def gettargets(index, targets):
""" split command line arguments into list of packages to build. Returns set or iterable """
# XXX make this return the full recursive list and use this later for processing wqueue
plist = set()
if len(targets) == 0:
targets = ["all"]
for i in targets:
if i == "all":
plist = index.iterkeys()
break
if i.endswith("-all"):
cat = i.rpartition("-")[0]
plist.update(j for j in index.iterkeys() if cat in index[j]['categories'])
elif i.rstrip(".tbz") in index.iterkeys():
plist.update([i.rstrip(".tbz")])
return plist
def heightindex(index, targets):
""" Initial population of height tree """
for i in targets:
heightdown(index, i)
def heightdown(index, pkgname):
"""
Recursively populate the height tree down from a given package,
assuming empty values on entries not yet visited
"""
pkg=index[pkgname]
if pkg['height'] is None:
if len(pkg['deps']) > 0:
max = 0
for i in pkg['deps']:
w = heightdown(index, i)
if w > max:
max = w
pkg['height'] = max + 1
else:
pkg['height'] = 1
return pkg['height']
def heightup(index, pkgname):
""" Recalculate the height tree going upwards from a package """
if not index.has_key(pkgname):
raise KeyError
parents=set(index[pkgname]['parents'])
while len(parents) > 0:
# XXX use a deque?
pkgname = parents.pop()
if not index.has_key(pkgname):
# XXX can this happen?
continue
pkg=index[pkgname]
oldheight=pkg['height']
if oldheight is None:
# Parent is in our build target list
continue
if len(pkg['deps']) == 0:
newheight = 1
else:
newheight=max(index[j]['height'] for j in pkg['deps']) + 1
if newheight > oldheight:
print "%s height increasing: %d -> %d", pkg, oldheight, newheight
assert(False)
if newheight != oldheight:
pkg['height'] = newheight
parents.update(pkg['parents'])
def deleteup(index, pkgname):
if not index.has_key(pkgname):
raise KeyError
parents=set([pkgname])
children=[]
removed=[]
while len(parents) > 0:
pkgname = parents.pop()
if not index.has_key(pkgname):
# Parent was already deleted via another path
# XXX can happen?
print "YYYYYYYYYYYYYYYYYYYYYY %s deleted" % pkgname
continue
if index[pkgname]['height'] is None:
# parent is not in our list of build targets
continue
pkg=index[pkgname]
children.extend(pkg['deps'])
parents.update(pkg['parents'])
removed.append(pkgname)
del index[pkgname]
removed = set(removed)
children = set(children)
# print "Removed %d packages, touching %d children" % (len(removed), len(children))
for i in children.difference(removed):
par=index[i]['parents']
index[i]['parents'] = list(set(par).difference(removed))
# XXX return an iter
def selectheights(index, level):
return [i for i in index.iterkeys() if index[i]['height'] == level]
def rank(index, ready, sortd, max = None):
""" rank the list of ready packages according to those listed as
dependencies in successive entries of the sorted list """
input=set(ready)
output = []
count = 0
print "Working on depth ",
for i in sortd:
deps = set(index[i]['deps'])
both = deps.intersection(input)
if len(both) > 0:
print "%d " % index[i]['height'],
input.difference_update(both)
output.extend(list(both))
if len(input) == 0:
break
if max:
count+=len(both)
if count > max:
return output
print
output.extend(list(input))
return output
def jobsuccess(index, job):
pkg = index[job]
# Build succeeded
for i in pkg['parents']:
index[i]['deps'].remove(job)
# deps/parents tree now partially inconsistent but this is
# what we need to avoid counting the height of the entry
# we are about to remove (which would make it a NOP)
heightup(index, job)
del index[job]
def jobfailure(index, job):
# Build failed
deleteup(index, job)
class worker(threading.Thread):
lock = threading.Lock()
# List of running threads
tlist = []
# List of running jobs
running = []
# Used to signal dispatcher when we finish a job
event = threading.Event()
def __init__(self, mach, job, queue, arch, branch):
threading.Thread.__init__(self)
self.job = job
self.mach = mach
self.queue = queue
self.arch = arch
self.branch = branch
def run(self):
global index
pkg = index[self.job]
if len(pkg['deps']) != 0:
print "Running job with non-empty deps: %s" % pkg
assert(False)
print "Running job %s" % (self.job)
while True:
retcode = subprocess.call(["/usr/bin/env", "FD=%s" % " ".join(["%s.tbz" % i for i in pkg['fdep']]), "ED=%s" % " ".join(["%s.tbz" % i for i in pkg['edep']]), "PD=%s" % " ".join(["%s.tbz" % i for i in pkg['pdep']]), "BD=%s" % " ".join(["%s.tbz" % i for i in pkg['bdep']]), "RD=%s" % " ".join(["%s.tbz" % i for i in pkg['rdep']]), "/var/portbuild/scripts/pdispatch2", self.mach, self.arch, self.branch, "/var/portbuild/scripts/portbuild", "%s.tbz" % self.job, pkg['path']])
self.queue.release(self.mach)
if retcode != 254:
break
# Failed to obtain job slot
time.sleep(15)
(self.mach, dummy) = self.queue.pick()
print "Retrying on %s" % self.mach
print "Finished job %s" % self.job,
if retcode == 0:
status = True
print
else:
status = False
print " with status %d" % retcode
worker.lock.acquire()
worker.running.remove(self.job)
worker.tlist.remove(self)
if status == True:
jobsuccess(index, self.job)