Date: Tue, 12 Sep 2017 05:21:09 +0000 (UTC) From: Kurt Jaeger <pi@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r449671 - in head/www/tdiary: . files Message-ID: <201709120521.v8C5L9Yn032432@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: pi Date: Tue Sep 12 05:21:09 2017 New Revision: 449671 URL: https://svnweb.freebsd.org/changeset/ports/449671 Log: www/tdiary: Make tdiary-inst.rb fit for current version PR: 221930 Submitted by: Yasuhiro KIMURA <yasu@utahime.org> (maintainer) Modified: head/www/tdiary/Makefile head/www/tdiary/files/tdiaryinst.rb.in Modified: head/www/tdiary/Makefile ============================================================================== --- head/www/tdiary/Makefile Tue Sep 12 04:57:25 2017 (r449670) +++ head/www/tdiary/Makefile Tue Sep 12 05:21:09 2017 (r449671) @@ -3,6 +3,7 @@ PORTNAME= tdiary PORTVERSION= 5.0.5 +PORTREVISION= 1 CATEGORIES?= www ruby MASTER_SITES= https://github.com/tdiary/tdiary-core/releases/download/v${PORTVERSION}/ DISTNAME= ${PORTNAME}-full-v${PORTVERSION} Modified: head/www/tdiary/files/tdiaryinst.rb.in ============================================================================== --- head/www/tdiary/files/tdiaryinst.rb.in Tue Sep 12 04:57:25 2017 (r449670) +++ head/www/tdiary/files/tdiaryinst.rb.in Tue Sep 12 05:21:09 2017 (r449671) @@ -1,4 +1,4 @@ -#!/usr/bin/env ruby +#!%%LOCALBASE%%/bin/ruby # # tdiaryinstall.rb - tDiary user directory copy script # Date created: 13 July 2003 @@ -141,39 +141,47 @@ class TdiaryInstall if ! FileTest.exist?("#{@passwd.dir}/#{@httpdir}/#{@diarydir}/images") FileUtils.mkdir_p("#{@passwd.dir}/#{@httpdir}/#{@diarydir}/images", @fileutilOptions) end + if ! FileTest.exist?("#{@passwd.dir}/#{@httpdir}/#{@diarydir}/tmp") + FileUtils.mkdir_p("#{@passwd.dir}/#{@httpdir}/#{@diarydir}/tmp", @fileutilOptions) + end end def linkBaseFile + FileUtils.ln_s("#{@tdiarydocdir}", "#{@passwd.dir}/#{@httpdir}/#{@diarydir}/doc", @fileutilOptions) + FileUtils.ln_s("#{@tdiarymaster}/Gemfile", "#{@passwd.dir}/#{@httpdir}/#{@diarydir}", @fileutilOptions) + FileUtils.ln_s("#{@tdiarymaster}/app.json", "#{@passwd.dir}/#{@httpdir}/#{@diarydir}", @fileutilOptions) + FileUtils.ln_s("#{@tdiarymaster}/benchmark", "#{@passwd.dir}/#{@httpdir}/#{@diarydir}", @fileutilOptions) + FileUtils.ln_s("#{@tdiarymaster}/bin", "#{@passwd.dir}/#{@httpdir}/#{@diarydir}", @fileutilOptions) + FileUtils.ln_s("#{@tdiarymaster}/index.fcgi", "#{@passwd.dir}/#{@httpdir}/#{@diarydir}", @fileutilOptions) + FileUtils.ln_s("#{@tdiarymaster}/index.rb", "#{@passwd.dir}/#{@httpdir}/#{@diarydir}", @fileutilOptions) FileUtils.ln_s("#{@tdiarymaster}/js", "#{@passwd.dir}/#{@httpdir}/#{@diarydir}", @fileutilOptions) + FileUtils.ln_s("#{@tdiarymaster}/lib", "#{@passwd.dir}/#{@httpdir}/#{@diarydir}", @fileutilOptions) + FileUtils.ln_s("#{@tdiarymaster}/misc", "#{@passwd.dir}/#{@httpdir}/#{@diarydir}", @fileutilOptions) + FileUtils.ln_s("#{@tdiarymaster}/package.json", "#{@passwd.dir}/#{@httpdir}/#{@diarydir}", @fileutilOptions) FileUtils.ln_s("#{@tdiarymaster}/theme", "#{@passwd.dir}/#{@httpdir}/#{@diarydir}", @fileutilOptions) - FileUtils.ln_s("#{@tdiarydocdir}", "#{@passwd.dir}/#{@httpdir}/#{@diarydir}/doc", @fileutilOptions) - tempfile = Tempfile.new("index.rb") - tempfile.write "#!/usr/local/bin/ruby\nrequire '#{@tdiarymaster}/index'\n" - tempfile.close - FileUtils.cp(tempfile.path, "#{@passwd.dir}/#{@httpdir}/#{@diarydir}/index.rb", @fileutilOptions) - FileUtils.chmod(0755, "#{@passwd.dir}/#{@httpdir}/#{@diarydir}/index.rb", @fileutilOptions) - tempfile = Tempfile.new("update.rb") - tempfile.write "#!/usr/local/bin/ruby\nrequire '#{@tdiarymaster}/update'\n" - tempfile.close - FileUtils.cp(tempfile.path, "#{@passwd.dir}/#{@httpdir}/#{@diarydir}/update.rb", @fileutilOptions) - FileUtils.chmod(0755, "#{@passwd.dir}/#{@httpdir}/#{@diarydir}/update.rb", @fileutilOptions) + FileUtils.ln_s("#{@tdiarymaster}/update.fcgi", "#{@passwd.dir}/#{@httpdir}/#{@diarydir}", @fileutilOptions) + FileUtils.ln_s("#{@tdiarymaster}/update.rb", "#{@passwd.dir}/#{@httpdir}/#{@diarydir}", @fileutilOptions) + FileUtils.ln_s("#{@tdiarymaster}/views", "#{@passwd.dir}/#{@httpdir}/#{@diarydir}", @fileutilOptions) end def copyBaseFile opts = @fileutilOptions.dup opts.store(:preserve, true) FileUtils.cp_r("#{@tdiarydocdir}", "#{@passwd.dir}/#{@httpdir}/#{@diarydir}/doc", opts) + FileUtils.cp("#{@tdiarymaster}/Gemfile", "#{@passwd.dir}/#{@httpdir}/#{@diarydir}", @fileutilOptions) + FileUtils.cp("#{@tdiarymaster}/app.json", "#{@passwd.dir}/#{@httpdir}/#{@diarydir}", @fileutilOptions) + FileUtils.cp_r("#{@tdiarymaster}/benchmark", "#{@passwd.dir}/#{@httpdir}/#{@diarydir}", opts) + FileUtils.cp_r("#{@tdiarymaster}/bin", "#{@passwd.dir}/#{@httpdir}/#{@diarydir}", opts) + FileUtils.cp("#{@tdiarymaster}/index.fcgi", "#{@passwd.dir}/#{@httpdir}/#{@diarydir}", @fileutilOptions) + FileUtils.cp("#{@tdiarymaster}/index.rb", "#{@passwd.dir}/#{@httpdir}/#{@diarydir}", @fileutilOptions) FileUtils.cp_r("#{@tdiarymaster}/js", "#{@passwd.dir}/#{@httpdir}/#{@diarydir}", opts) + FileUtils.cp_r("#{@tdiarymaster}/lib", "#{@passwd.dir}/#{@httpdir}/#{@diarydir}", opts) FileUtils.cp_r("#{@tdiarymaster}/misc", "#{@passwd.dir}/#{@httpdir}/#{@diarydir}", opts) - FileUtils.cp_r("#{@tdiarymaster}/plugin", "#{@passwd.dir}/#{@httpdir}/#{@diarydir}", opts) - FileUtils.cp_r("#{@tdiarymaster}/skel", "#{@passwd.dir}/#{@httpdir}/#{@diarydir}", opts) - FileUtils.cp_r("#{@tdiarymaster}/tdiary", "#{@passwd.dir}/#{@httpdir}/#{@diarydir}", opts) + FileUtils.cp("#{@tdiarymaster}/package.json", "#{@passwd.dir}/#{@httpdir}/#{@diarydir}", @fileutilOptions) FileUtils.cp_r("#{@tdiarymaster}/theme", "#{@passwd.dir}/#{@httpdir}/#{@diarydir}", opts) - FileUtils.cp("#{@tdiarymaster}/index.rb", "#{@passwd.dir}/#{@httpdir}/#{@diarydir}/index.rb", @fileutilOptions) - FileUtils.chmod(0755, "#{@passwd.dir}/#{@httpdir}/#{@diarydir}/index.rb", @fileutilOptions) - FileUtils.cp("#{@tdiarymaster}/update.rb", "#{@passwd.dir}/#{@httpdir}/#{@diarydir}/update.rb", @fileutilOptions) - FileUtils.chmod(0755, "#{@passwd.dir}/#{@httpdir}/#{@diarydir}/update.rb", @fileutilOptions) - FileUtils.cp("#{@tdiarymaster}/tdiary.rb", "#{@passwd.dir}/#{@httpdir}/#{@diarydir}/tdiary.rb", @fileutilOptions) + FileUtils.cp("#{@tdiarymaster}/update.fcgi", "#{@passwd.dir}/#{@httpdir}/#{@diarydir}", @fileutilOptions) + FileUtils.cp("#{@tdiarymaster}/update.rb", "#{@passwd.dir}/#{@httpdir}/#{@diarydir}", @fileutilOptions) + FileUtils.cp_r("#{@tdiarymaster}/views", "#{@passwd.dir}/#{@httpdir}/#{@diarydir}", opts) end def installConfig @@ -206,14 +214,24 @@ class TdiaryInstall end def setPermissions - FileUtils.chmod(0777, "#{@passwd.dir}/#{@diarydir}", @fileutilOptions) if ! defined?($OPT_SUEXEC) - FileUtils.chmod(0777, "#{@passwd.dir}/#{@httpdir}/#{@diarydir}", @fileutilOptions) if ! defined?($OPT_SUEXEC) - - FileUtils.chmod(0701, "#{@passwd.dir}/#{@diarydir}", @fileutilOptions) if defined?($OPT_SUEXEC) - FileUtils.chmod(0701, "#{@passwd.dir}/#{@httpdir}/#{@diarydir}", @fileutilOptions) if defined?($OPT_SUEXEC) - FileUtils.chmod(0604, "#{@passwd.dir}/#{@httpdir}/#{@diarydir}/.htaccess", @fileutilOptions) if defined?($OPT_SUEXEC) - FileUtils.chmod(0700, "#{@passwd.dir}/#{@httpdir}/#{@diarydir}/index.rb", @fileutilOptions) if defined?($OPT_SUEXEC) - FileUtils.chmod(0700, "#{@passwd.dir}/#{@httpdir}/#{@diarydir}/update.rb", @fileutilOptions) if defined?($OPT_SUEXEC) + if (defined?($OPT_SUEXEC)) + FileUtils.chmod(0701, "#{@passwd.dir}/#{@diarydir}", @fileutilOptions) + FileUtils.chmod(0701, "#{@passwd.dir}/#{@httpdir}/#{@diarydir}", @fileutilOptions) + FileUtils.chmod(0604, "#{@passwd.dir}/#{@httpdir}/#{@diarydir}/.htaccess", @fileutilOptions) + FileUtils.chmod(0700, "#{@passwd.dir}/#{@httpdir}/#{@diarydir}/index.fcgi", @fileutilOptions) + FileUtils.chmod(0700, "#{@passwd.dir}/#{@httpdir}/#{@diarydir}/index.rb", @fileutilOptions) + FileUtils.chmod(0700, "#{@passwd.dir}/#{@httpdir}/#{@diarydir}/update.fcgi", @fileutilOptions) + FileUtils.chmod(0700, "#{@passwd.dir}/#{@httpdir}/#{@diarydir}/update.rb", @fileutilOptions) + else + FileUtils.chmod(0777, "#{@passwd.dir}/#{@diarydir}", @fileutilOptions) + FileUtils.chmod(0777, "#{@passwd.dir}/#{@httpdir}/#{@diarydir}", @fileutilOptions) + FileUtils.chmod(0644, "#{@passwd.dir}/#{@httpdir}/#{@diarydir}/.htaccess", @fileutilOptions) + FileUtils.chmod(0755, "#{@passwd.dir}/#{@httpdir}/#{@diarydir}/index.fcgi", @fileutilOptions) + FileUtils.chmod(0755, "#{@passwd.dir}/#{@httpdir}/#{@diarydir}/index.rb", @fileutilOptions) + FileUtils.chmod(0755, "#{@passwd.dir}/#{@httpdir}/#{@diarydir}/update.fcgi", @fileutilOptions) + FileUtils.chmod(0755, "#{@passwd.dir}/#{@httpdir}/#{@diarydir}/update.rb", @fileutilOptions) + end + FileUtils.chmod(0644, "#{@passwd.dir}/#{@httpdir}/#{@diarydir}/dot.htaccess", @fileutilOptions) if @euid == 0 then Find.find("#{@passwd.dir}/#{@diarydir}", "#{@passwd.dir}/#{@httpdir}/#{@diarydir}") do |f|
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201709120521.v8C5L9Yn032432>