From 1914f8117d8a862d89c0580ce0f2df5a741d9c8b Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Mon, 31 Aug 2015 05:17:55 +0000 Subject: [PATCH] updated building process for debian and fixed minor code glitches --- codepot/DEBIAN/control.in | 4 ++-- codepot/Makefile.am | 9 +++++---- codepot/Makefile.in | 9 +++++---- codepot/src/codepot/controllers/project.php | 1 + codepot/src/codepot/models/sitemodel.php | 1 + codepot/src/index.php | 6 +++++- 6 files changed, 19 insertions(+), 11 deletions(-) diff --git a/codepot/DEBIAN/control.in b/codepot/DEBIAN/control.in index 59e0117f..8f78e255 100644 --- a/codepot/DEBIAN/control.in +++ b/codepot/DEBIAN/control.in @@ -1,9 +1,9 @@ Package: @PACKAGE@ Version: @VERSION@ -Maintainer: @PACKAGE_BUGREPORT@ +Maintainer: CHUNG, HYUNG-HWAN Homepage: @PACKAGE_URL@ Depends: subversion, apache2, libapache2-svn, libapache2-mod-perl2, libapache2-mod-php5, php5, php5-ldap, php5-gd, perl, libdbi-perl, libconfig-simple-perl, libsvn-perl, libnet-ldap-perl, libdigest-sha1-perl -Recommends: php5-mysql, php5-svn (>= 0.5.1) +Recommends: php5-mysql Suggests: slapd, mysql-server Section: web Priority: optional diff --git a/codepot/Makefile.am b/codepot/Makefile.am index f970bfa6..db9ccd65 100644 --- a/codepot/Makefile.am +++ b/codepot/Makefile.am @@ -6,7 +6,6 @@ SUBDIRS = etc src sbin pecl-svn EXTRA_DIST = README mkmf.sh DEBIAN PHP_PACKAGE_NAME ?= php -TARGET_ARCH ?= $(shell uname -m) install-data-hook: $(INSTALL) -d "$(DESTDIR)@DEPOTDIR@" @@ -33,14 +32,16 @@ distclean-local: # TODO: specify --with-phpextdir and --with-phpextinidir for the deb target deb: dist-gzip tar -zxvf "$(PACKAGE)-$(VERSION).tar.gz" - cd "$(PACKAGE)-$(VERSION)"; ./configure \ + cd "$(PACKAGE)-$(VERSION)"; PHPEXTDIR="`php5 --info 2>/dev/null | grep ^extension_dir | awk '{print $$5;}'`"; ./configure \ --prefix=/usr \ --sysconfdir=/etc \ --with-wwwdir=/var/www/codepot \ --with-cfgdir=/etc/codepot \ --with-depotdir=/var/lib/codepot \ --with-logdir=/var/log/codepot \ - --with-cachedir=/var/cache/codepot + --with-cachedir=/var/cache/codepot \ + --with-phpextdir="$${PHPEXTDIR}" \ + --with-phpextinidir=/etc/php5/conf.d rm -rf "/var/tmp/$(PACKAGE)-$(VERSION)" cd "$(PACKAGE)-$(VERSION)"; make install DESTDIR="/var/tmp/$(PACKAGE)-$(VERSION)" cd "$(PACKAGE)-$(VERSION)/DEBIAN"; make install DESTDIR="/var/tmp/$(PACKAGE)-$(VERSION)" @@ -57,4 +58,4 @@ rpm: dist mkdir -p "@abs_top_builddir@/RPM/SRPMS" mkdir -p "@abs_top_builddir@/RPM/RPMS" cp codepot-@VERSION@.tar.gz "@abs_top_builddir@/RPM/SOURCES" - rpmbuild --define "_topdir @abs_top_builddir@/RPM" --define "php_package_name $(PHP_PACKAGE_NAME)" -ba codepot.spec --target="$(TARGET_ARCH)" + TARGET_ARCH="`uname -m`"; rpmbuild --define "_topdir @abs_top_builddir@/RPM" --define "php_package_name $(PHP_PACKAGE_NAME)" -ba codepot.spec --target="$${TARGET_ARCH}" diff --git a/codepot/Makefile.in b/codepot/Makefile.in index 1690221c..588a2ef1 100644 --- a/codepot/Makefile.in +++ b/codepot/Makefile.in @@ -739,7 +739,6 @@ uninstall-am: PHP_PACKAGE_NAME ?= php -TARGET_ARCH ?= $(shell uname -m) install-data-hook: $(INSTALL) -d "$(DESTDIR)@DEPOTDIR@" @@ -765,14 +764,16 @@ distclean-local: # TODO: specify --with-phpextdir and --with-phpextinidir for the deb target deb: dist-gzip tar -zxvf "$(PACKAGE)-$(VERSION).tar.gz" - cd "$(PACKAGE)-$(VERSION)"; ./configure \ + cd "$(PACKAGE)-$(VERSION)"; PHPEXTDIR="`php5 --info 2>/dev/null | grep ^extension_dir | awk '{print $$5;}'`"; ./configure \ --prefix=/usr \ --sysconfdir=/etc \ --with-wwwdir=/var/www/codepot \ --with-cfgdir=/etc/codepot \ --with-depotdir=/var/lib/codepot \ --with-logdir=/var/log/codepot \ - --with-cachedir=/var/cache/codepot + --with-cachedir=/var/cache/codepot \ + --with-phpextdir="$${PHPEXTDIR}" \ + --with-phpextinidir=/etc/php5/conf.d rm -rf "/var/tmp/$(PACKAGE)-$(VERSION)" cd "$(PACKAGE)-$(VERSION)"; make install DESTDIR="/var/tmp/$(PACKAGE)-$(VERSION)" cd "$(PACKAGE)-$(VERSION)/DEBIAN"; make install DESTDIR="/var/tmp/$(PACKAGE)-$(VERSION)" @@ -789,7 +790,7 @@ rpm: dist mkdir -p "@abs_top_builddir@/RPM/SRPMS" mkdir -p "@abs_top_builddir@/RPM/RPMS" cp codepot-@VERSION@.tar.gz "@abs_top_builddir@/RPM/SOURCES" - rpmbuild --define "_topdir @abs_top_builddir@/RPM" --define "php_package_name $(PHP_PACKAGE_NAME)" -ba codepot.spec --target="$(TARGET_ARCH)" + TARGET_ARCH="`uname -m`"; rpmbuild --define "_topdir @abs_top_builddir@/RPM" --define "php_package_name $(PHP_PACKAGE_NAME)" -ba codepot.spec --target="$${TARGET_ARCH}" # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/codepot/src/codepot/controllers/project.php b/codepot/src/codepot/controllers/project.php index b8d59fb1..c3a0e73b 100644 --- a/codepot/src/codepot/controllers/project.php +++ b/codepot/src/codepot/controllers/project.php @@ -34,6 +34,7 @@ class Project extends Controller if ($filter == '') { + $search = new stdClass(); $search->id = ''; $search->name = ''; $search->summary = ''; diff --git a/codepot/src/codepot/models/sitemodel.php b/codepot/src/codepot/models/sitemodel.php index 0efc243f..967a7a17 100644 --- a/codepot/src/codepot/models/sitemodel.php +++ b/codepot/src/codepot/models/sitemodel.php @@ -10,6 +10,7 @@ class SiteModel extends Model function getDefault () { + $site = new stdClass(); $site->id = CODEPOT_DEFAULT_SITE_LANGUAGE; $site->name = CODEPOT_DEFAULT_SITE_NAME; $site->summary = ''; diff --git a/codepot/src/index.php b/codepot/src/index.php index 1ef19b70..5fc5bb67 100644 --- a/codepot/src/index.php +++ b/codepot/src/index.php @@ -49,7 +49,11 @@ if (function_exists('date_default_timezone_set') && !ini_get('date.timezone')) else if (file_exists('/etc/timezone')) { // Debian - $tz = file_get_contents('/etc/timezone'); + $tz = @file_get_contents('/etc/timezone'); + if ($tz !== FALSE && strlen($tz) > 0) + { + $tz = substr ($tz, 0, strpos ($tz, "\n")); + } } else if (file_exists('/etc/sysconfig/clock')) {