From: Thorsten Glaser Date: Wed, 18 May 2011 13:07:15 +0000 (+0000) Subject: merge from 5.1: r13268 r13269 r13288 r13291 r13292 r13299 r13300 X-Git-Tag: v5_2_rc1~1413 X-Git-Url: https://scm.fusionforge.org/anonscm/gitweb?p=fusionforge%2Ffusionforge.git;a=commitdiff_plain;h=f95604e981a03e1882625840a59145c628a9e801 merge from 5.1: r13268 r13269 r13288 r13291 r13292 r13299 r13300 (debpkg-versioning and its RPM counterpart) --- diff --git a/.gitattributes b/.gitattributes index 6d48233ed8..399f06cc69 100644 --- a/.gitattributes +++ b/.gitattributes @@ -688,6 +688,7 @@ src/deb-specific/install-skel.sh svneol=native#text/x-sh src/deb-specific/install-ssh.sh svneol=native#text/x-sh src/deb-specific/mailfwd_update.pl -text src/deb-specific/manage-uufiles.sh svneol=native#text/x-sh +src/deb-specific/pkginfo.inc.php -text src/deb-specific/prepare-vhosts-file.pl svneol=native#text/x-perl src/deb-specific/ssh_dump_update.pl svneol=native#text/x-perl src/deb-specific/stats_cvs.pl svneol=native#text/x-perl diff --git a/Makefile b/Makefile index b19f380f8c..b8c78100ce 100644 --- a/Makefile +++ b/Makefile @@ -15,7 +15,7 @@ BUILDRESULT=$(CURDIR)/result DOXYGEN=doxygen -VER=$(shell LANG=C grep '>software_version' src/common/include/FusionForge.class.php | cut -d\' -f2) +VER=$(shell LC_ALL=C sed -n '/>software_version/s/^.*'\''\([0-9.]*\)'\''.*$$/\1/p' src/common/include/FusionForge.class.php) in_svn_repo:= $(wildcard .svn/) ifeq ($(strip $(in_svn_repo)),) ID=unknown diff --git a/Makefile.rh b/Makefile.rh index c7fd87e5b3..0d8aecb1b2 100644 --- a/Makefile.rh +++ b/Makefile.rh @@ -7,7 +7,7 @@ RPM_TMP=~/rpmbuild BUILDRESULT=~/fusionforge_repo -VER=$(shell LANG=C grep '>software_version' src/common/include/FusionForge.class.php | cut -d\' -f2) +VER=$(shell LC_ALL=C sed -n '/>software_version/s/^.*'\''\([0-9.]*\)'\''.*$$/\1/p' src/common/include/FusionForge.class.php) in_svn_repo:= $(wildcard .svn/) ifeq ($(strip $(in_svn_repo)),) ID=unknown diff --git a/src/common/include/FusionForge.class.php b/src/common/include/FusionForge.class.php index 0c3a05c5fc..4915f37b88 100644 --- a/src/common/include/FusionForge.class.php +++ b/src/common/include/FusionForge.class.php @@ -24,20 +24,38 @@ */ require_once $gfcommon.'include/Error.class.php'; + +if (file_exists($gfcommon.'pkginfo.inc.php')) { + require $gfcommon.'pkginfo.inc.php'; +} + class FusionForge extends Error { var $software_name ; + var $software_type ; var $software_version ; /** * FusionForge - FusionForge object constructor */ function FusionForge() { + global $forge_pkg_name, $forge_pkg_version; + $this->Error(); $this->software_name = 'FusionForge' ; $this->software_version = '5.1.50' ; + if (isset($forge_pkg_name) && isset($forge_pkg_version)) { + $this->software_name = $forge_pkg_name; + $this->software_version = $forge_pkg_version; + } + + $this->software_type = $this->software_name; + if (isset($forge_pkg_type)) { + $this->software_type = $forge_pkg_type; + } + return true; } diff --git a/src/deb-specific/pkginfo.inc.php b/src/deb-specific/pkginfo.inc.php new file mode 100644 index 0000000000..40a62ef428 --- /dev/null +++ b/src/deb-specific/pkginfo.inc.php @@ -0,0 +1,7 @@ + \ No newline at end of file diff --git a/src/debian/rules b/src/debian/rules index 081dacd35b..8563bf8665 100755 --- a/src/debian/rules +++ b/src/debian/rules @@ -10,6 +10,14 @@ PACKAGE=fusionforge SRCPACKAGE=fusionforge FORGENAME=FusionForge +# Identify this FusionForge version +# keep type intact and change forge in derivates, +# unless there are deep changes (type is used for +# the Forge-Identification meta header) +WHICH_TYPE=FusionForge +WHICH_FORGE=FusionForge +WHICH_VERSION:=$(shell dpkg-parsechangelog | sed -n '/^Version: /s///p') + # Replace macros present in the files for forge's name SED_REPLACE=sed -e 's/@PACKAGE@/$(PACKAGE)/g' -e 's/@SRCPACKAGE@/$(SRCPACKAGE)/g' -e 's/@OLDPACKAGE@/$(OLDPACKAGE)/g' -e 's/@FORGENAME@/$(FORGENAME)/g' @@ -209,6 +217,13 @@ clean: remove-binary-files unpatch install: build dh $@ + sed \ + -e 's!@PKGNAME@!${WHICH_FORGE}!g' \ + -e 's!@PKGVERSION@!${WHICH_VERSION}!g' \ + -e 's!@PLUCKERNAME@!${WHICH_TYPE}!g' \ + <$(CURDIR)/deb-specific/pkginfo.inc.php \ + >$(CURDIR)/debian/$(OLDPACKAGE)-common/usr/share/$(OLDPACKAGE)/common/pkginfo.inc.php + # Fix permissions chmod 755 $(CURDIR)/debian/*/*/*/*/bin/* $(CURDIR)/debian/*/*/*/*/cronjobs/* \ $(CURDIR)/debian/*/bin/* $(CURDIR)/debian/*/usr/share/*/plugins/*/bin/* \ diff --git a/src/fusionforge.spec b/src/fusionforge.spec index 8062e10ce8..c23a14b978 100644 --- a/src/fusionforge.spec +++ b/src/fusionforge.spec @@ -465,6 +465,20 @@ search_and_replace "/opt/gforge" "%{FORGE_DIR}" %{__rm} -f $RPM_BUILD_ROOT%{FORGE_DIR}/utils/fusionforge-shell-postgresql.spec +# Identify this FusionForge version +# keep type intact and change forge in derivates, +# unless there are deep changes (type is used for +# the Forge-Identification meta header) +WHICH_TYPE=FusionForge +WHICH_FORGE=FusionForge +WHICH_VERSION=%{version}-%{release} +%{__sed} \ + -e "s!@PKGNAME@!${WHICH_FORGE}!g" \ + -e "s!@PKGVERSION@!${WHICH_VERSION}!g" \ + -e "s!@PLUCKERNAME@!${WHICH_TYPE}!g" \ + <$RPM_BUILD_ROOT/%{FORGE_DIR}/deb-specific/pkginfo.inc.php \ + >$RPM_BUILD_ROOT/%{FORGE_DIR}/common/pkginfo.inc.php + %{__rm} -f $RPM_BUILD_ROOT%{FORGE_DIR}/COPYING.php %{__rm} -fr $RPM_BUILD_ROOT/%{FORGE_DIR}/packaging %{__rm} -fr $RPM_BUILD_ROOT/%{FORGE_DIR}/deb-specific diff --git a/src/www/include/Layout.class.php b/src/www/include/Layout.class.php index fab9a49a7c..1d98c8ba72 100644 --- a/src/www/include/Layout.class.php +++ b/src/www/include/Layout.class.php @@ -357,10 +357,11 @@ class Layout extends Error { * Forge-Identification Meta Header, Version 1.0 * cf. http://home.gna.org/forgeplucker/forge-identification.html */ + echo "\t\t\t"; $ff = new FusionForge(); - return sprintf('', - $ff->software_name, - $ff->software_version) . "\n"; + printf('', + $ff->software_type, $ff->software_version); + echo "\n"; } function bodyHeader($params){