ASKPASS=--ask-passphrase
ASKPASS=
-MAJOR=$(shell head -1 $(PKGDIR)/debian/changelog | sed 's/.*(\(.*\)-[^-]*).*/\1/')
+MAJOR:=$(shell [ ! -f $(PKGDIR)/debian/changelog ] || dpkg-parsechangelog -l$(PKGDIR)/debian/changelog | sed -rne 's,^Version: ([^-]+).*,\1,p')
# SMAJOR is MAJOR without epoch if any
-SMAJOR=$(shell echo $(MAJOR) | sed 's/^.://')
+SMAJOR:=$(shell echo $(MAJOR) | sed 's/^.://')
--in_svn_repo:= $(wildcard .svn/)
--ifeq ($(strip $(in_svn_repo)),)
++in_svn_repo:= $(wildcard .svn/)
++ifeq ($(strip $(in_svn_repo)),)
in_bzr_repo:= $(wildcard .bzr/)
ifeq ($(strip $(in_bzr_repo)),)
in_git_repo:= $(wildcard .git/)
DEBUG=--debug
DEBUG=
--DEBBUILDOPTS=--debbuildopts -sa
-ARCH=$(shell dpkg-architecture -qDEB_BUILD_ARCH)
++DEBBUILDOPTS=--debbuildopts -sa
+ARCH:=$(shell dpkg-architecture -qDEB_BUILD_ARCH)
# Some doc found there http://wiki.debian.org/cowbuilder
# Hook are not anymore necessary, but I keep as an example
PCHANGEFILE=$(PKGNAME)_$(SMAJOR)$(MINOR)+p_$(ARCH).changes
# Quite heavy version, but still requires to be root
--COWBUILDERCMD=cd $(BUILDPLACE) && dpkg-source -x $(BUILDFILES)/$(DSCFILE) ; cd $(BUILDPLACE)/$(PKGNAME)-$(SMAJOR) && pdebuild --pbuilder cowbuilder --buildresult $(BUILDRESULT) -- --basepath $(COWBUILDERBASE)/base-$(DISTRIB)-$(ARCH).cow --buildplace $(BUILDPLACE) --aptcache $(APTCACHE) ; rm -rf $(BUILDPLACE)/$(PKGNAME)-$(SMAJOR)
++COWBUILDERCMD=cd $(BUILDPLACE) && dpkg-source -x $(BUILDFILES)/$(DSCFILE) ; cd $(BUILDPLACE)/$(PKGNAME)-$(SMAJOR) && pdebuild --pbuilder cowbuilder --buildresult $(BUILDRESULT) -- --basepath $(COWBUILDERBASE)/base-$(DISTRIB)-$(ARCH).cow --buildplace $(BUILDPLACE) --aptcache $(APTCACHE) ; rm -rf $(BUILDPLACE)/$(PKGNAME)-$(SMAJOR)
# This one is with sudo and probably faster
COWBUILDERCMD=sudo /usr/sbin/cowbuilder --build --basepath $(COWBUILDERBASE)/base-$(DISTRIB)-$(ARCH).cow --configfile $(COWBUILDERBASE)/configfile-$(ARCH) $(BUILDFILES)/$(DSCFILE) $(DEBBUILDOPTS)
#
orig: # Make Debian package .orig tarball #
-- $(MAKE) $(TARBALLS)/$(ORIGFILE)
++ $(MAKE) $(TARBALLS)/$(ORIGFILE)
#
# PHPDOCUMENTOR
#
# Get phpdocumentor, install phpdocumentor, build $(PKGNAME) phpdoc
--phpdoc: $(PKGDIR)/docs/phpdoc/docs
++phpdoc: $(PKGDIR)/docs/phpdoc/docs
doc:
- (cd src/docs/docbook ; make debian)
+ (cd src/docs/docbook ; make debian TARGET=$(CURDIR)/build/docs/docbook/)
cleandoc:
- (cd src/docs/docbook ; make clean)
+ (cd src/docs/docbook ; make clean TARGET=$(CURDIR)/build/docs/docbook/)
phpdocumentor_get:
[ ! -f $(documentor_path)/$(documentor_file) ] && \
$(documentor_path)/$(documentor_subdir)/patched: phpdocumentor_unpack
cd $(documentor_path)/$(documentor_subdir) && \
patch < $(CURDIR)/$(PKGDIR)/docs/phpdoc/phpDocumentor.ini.patch \
-- && touch $(documentor_path)/$(documentor_subdir)/patched
++ && touch $(documentor_path)/$(documentor_subdir)/patched
$(PKGDIR)/docs/phpdoc/docs: $(documentor_path)/$(documentor_subdir)/patched
cd $(PKGDIR)/docs/phpdoc/ && ./makedoc.sh
if [ -w `dirname $@` ] ; then mkdir $@ ; else sudo mkdir $@ ; sudo chown `id -u`.`id -g` $@; fi
clean: # Clean $(BUILDPLACE) $(BUILDFILES) $(TARBALLS) (intermediate files) #
- rm -rf $(BUILDPLACE) $(BUILDFILES) $(TARBALLS)
- rm -rf $(BUILDPLACE)/$(PKGNAME)-$(SMAJOR) $(BUILDFILES) $(TARBALLS)
++ rm -rf $(BUILDPLACE)/$(PKGNAME)-$(SMAJOR) $(BUILDFILES) $(TARBALLS)
+ rmdir $(BUILDPLACE) && mkdir $(BUILDPLACE) || true
cleanenv: # Clean $(COWBUILDERBASE) $(PBUILDERTGZ) (chroots)#
sudo rm -rf $(COWBUILDERBASE) $(PBUILDERTGZ)
done
}
+# Accomodate wikidata path change
+move_mediawikis() {
+ local a b found
+
+ # Determine whether there are any wikis to move
+ found=0
+ for a in /var/lib/gforge/plugins/mediawiki/wikidata/*; do
+ test -d "$a/." || continue
+ found=1
+ break
+ done
+ test $found = 1 || {
+ rmdir /var/lib/gforge/plugins/mediawiki/wikidata || \
+ echo >&2 "WARNING: Could not delete /var/lib/gforge/plugins/mediawiki/wikidata"
+ return 0
+ }
+
+ # Move wikis
+ (
+ cd /var/lib/gforge/plugins/mediawiki/wikidata
+ for a in *; do
+ test -d "$a/." || {
+ echo >&2 "WARNING: Non-directory /var/lib/gforge/plugins/mediawiki/wikidata/$a not migrated!"
+ continue
+ }
+ # Conflict?
+ b=../projects/$a
+ if test -e "$b"; then
+ b=$(mktemp "/var/lib/gforge/plugins/mediawiki/projects/$a-olddata-XXXXXXXXXX") || {
+ echo >&2 "Could not create temporary file."
+ exit 1
+ }
+ rm -f "$b"
+ fi
+ # Move.
+ mv "$a" "$b" || \
+ echo >&2 "WARNING: Could not move away /var/lib/gforge/plugins/mediawiki/wikidata/$a, investigate manually!"
+ done
+ )
+
+ # Look again for remnants
+ found=0
+ for a in /var/lib/gforge/plugins/mediawiki/wikidata/*; do
+ test -e "$a" || continue
+ echo >&2 "WARNING: Non-moved files in /var/lib/gforge/plugins/mediawiki/wikidata/ exist. Investigate manually!"
+ found=1
+ break
+ done
+ test $found = 1 || \
+ rmdir /var/lib/gforge/plugins/mediawiki/wikidata || \
+ echo >&2 "Could not delete empty /var/lib/gforge/plugins/mediawiki/wikidata"
+ return 0
+}
+
case "$1" in
triggered)
- if [ "$2" = /usr/share/mediawiki/maintenance/postgres ] ; then
- upgrade_mediawikis
- fi
+ case $2 in
+ /usr/share/mediawiki*) upgrade_mediawikis ;;
+ esac
;;
configure)
cat lxc-debian6 | sed 's!http://cdn.debian.net/debian/!$(DEBMIRROR)!' > /usr/share/lxc/templates/lxc-debian6
chmod 755 /usr/share/lxc/templates/lxc-debian6
+/usr/share/lxc/templates/lxc-debian7: lxc-debian7 /usr/share/lxc
+ cat lxc-debian7 | sed 's!http://cdn.debian.net/debian/!$(DEBMIRROR)!' > /usr/share/lxc/templates/lxc-debian7
+ chmod 755 /usr/share/lxc/templates/lxc-debian7
+
+/usr/share/lxc/templates/lxc-centos5: lxc-centos5 /usr/share/lxc
+ cp lxc-centos5 /usr/share/lxc/templates/
+
+/usr/share/lxc/templates/lxc-centos6: lxc-centos6 /usr/share/lxc
+ cp lxc-centos6 /usr/share/lxc/templates/
+
+ /usr/share/lxc/templates/lxc-centos5: lxc-centos5 /usr/share/lxc
+ cp lxc-centos5 /usr/share/lxc/templates/
+
createdeb:
- sudo /usr/bin/lxc-create -n dhdebian6.local -f config.debian6 -t debian6
+ sudo /usr/bin/lxc-create -n dhdebian7.local -f config.debian7 -t debian7
createcos: /usr/bin/netmask /usr/bin/rinse
sudo /usr/bin/lxc-create -n dhcentos5.local -f config.centos5 -t centos5