ports/63458: maintainer-update ports: www/tdiary
Fumihiko Kimura
jfkimura at yahoo.co.jp
Fri Feb 27 16:40:06 UTC 2004
>Number: 63458
>Category: ports
>Synopsis: maintainer-update ports: www/tdiary
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: maintainer-update
>Submitter-Id: current-users
>Arrival-Date: Fri Feb 27 08:40:05 PST 2004
>Closed-Date:
>Last-Modified:
>Originator: Fumihiko Kimura
>Release: FreeBSD 4.9-RELEASE-p2 i386
>Organization:
>Environment:
>Description:
Change point:
* Adapted to ruby 1.8.x
>How-To-Repeat:
Checked:
- Ruby 1.6.8 (FreeBSD 4.9-RELEASE)
- Ruby 1.8.1 (FreeBSD 5.2.1-RELEASE)
>Fix:
=== begin cut here ===
diff -urN tdiary-orig/Makefile tdiary/Makefile
--- tdiary-orig/Makefile Sat Dec 13 22:09:36 2003
+++ tdiary/Makefile Sat Feb 28 00:53:20 2004
@@ -7,7 +7,7 @@
PORTNAME= tdiary
PORTVERSION= 1.5.6
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES?= www ruby
MASTER_SITES= \
${MASTER_SITE_SOURCEFORGE} \
diff -urN tdiary-orig/files/pkg-message.in tdiary/files/pkg-message.in
--- tdiary-orig/files/pkg-message.in Tue Dec 9 11:48:11 2003
+++ tdiary/files/pkg-message.in Sat Feb 28 00:53:55 2004
@@ -3,20 +3,12 @@
There is a script to install tDiary in a user directory.
This script should be run manually.
-[Ruby 1.6.x]
-
# ruby %%EXAMPLESDIR%%/tdiaryinst.rb --user=User
or
% ruby %%EXAMPLESDIR%%/tdiaryinst.rb
* Option: --suexec Use suExec for CGI execution
--help Display Help information
-
-[Ruby 1.8.x]
-
- # %%EXAMPLESDIR%%/tdiary-FreeBSD.sh User
- or
- % %%EXAMPLESDIR%%/tdiary-FreeBSD.sh install
---
There is a document by English in the following directories.
diff -urN tdiary-orig/files/tdiaryinst.rb.in tdiary/files/tdiaryinst.rb.in
--- tdiary-orig/files/tdiaryinst.rb.in Sun Nov 9 21:59:57 2003
+++ tdiary/files/tdiaryinst.rb.in Sat Feb 28 00:53:56 2004
@@ -13,7 +13,7 @@
require 'find'
require 'tempfile'
-# make install»þ¤ËÃÖ´¹¤µ¤ì¤ë¥°¥í¡¼¥Ð¥ëÊÑ¿ô --tdiarymaster, --lang ¥ª¥×¥·¥ç¥ó¤Ç¾å½ñ¤²Äǽ
+#
$OPT_TDIARYMASTER = "@@@@PREFIX@@@@/share/examples/tdiary"
$OPT_LANG = '@@@@LANG@@@@'
@@ -93,7 +93,6 @@
exit 1
end
-# °ú¿ô¤Î²òÀÏ
parser = GetoptLong.new
parser.set_options(
['--user', '-u', GetoptLong::REQUIRED_ARGUMENT],
@@ -122,7 +121,7 @@
attr_accessor :tdiarymaster
attr_accessor :tdconfig
attr_accessor :lang
- attr_reader :euid # tdiaryinstall¤ò¼Â¹Ô¤·¤Æ¤¤¤ë¥æ¡¼¥¶ID
+ attr_reader :euid
attr_accessor :username
attr_accessor :diarydir
attr_accessor :httpdir
@@ -130,23 +129,22 @@
attr_accessor :fileutilOptions
attr_accessor :author_name
attr_accessor :author_mail
- attr_reader :author_host #FK
- def initialize # ½é´üÃͤÎÀßÄê
- @passwd = Etc.getpwuid() # ½é´üÃÍ¤Ï¥í¥°¥¤¥ó¥æ¡¼¥¶
+ attr_reader :author_host
+ def initialize
+ @passwd = Etc.getpwuid()
@euid = @passwd.uid
- @username =(@passwd.name) # username=(value) ¥á¥½¥Ã¥É¤ÇºÆÄêµÁ¤·¤Æ¤¤¤ë #FK
+ @username =(@passwd.name)
@diarydir = 'diary'
@httpdir = 'public_html'
@fileutilOptions = []
- @author_name = @passwd.gecos #FK
- @author_host = "#{`hostname`.chomp}" #FK
- @author_mail = "#{@username}@#{`hostname`.chomp}" #FK
+ @author_name = @passwd.gecos
+ @author_host = "#{`hostname`.chomp}"
+ @author_mail = "#{@username}@#{`hostname`.chomp}"
end
- def username=(value) # username ¤òÂåÆþ¤¹¤ëºÝ¤Ë passwd¥á¥ó¥ÐÊÑ¿ô¤â¹¹¿·¤¹¤ë
+ def username=(value)
@username = value
- @passwd = Etc.getpwnam(@username) # getpwnam(3) ¤Ë¤è¤ê passwd ¹½Â¤ÂΤò¼èÆÀ¤¹¤ë
- # ¥æ¡¼¥¶Ì¾¤¬Â¸ºß¤·¤Ê¤«¤Ã¤¿¾ì¹ç¡¢Etc.getpwnam() ¤ÏÎã³°¤òȯÀ¸¤¹¤ë¡£
+ @passwd = Etc.getpwnam(@username)
@author_name = @passwd.gecos
@author_mail = "#{@username}@#{`hostname`.chomp}"
end
@@ -190,7 +188,6 @@
end
def prepareDirs
- # ¥¤¥ó¥¹¥È¡¼¥ëÀè¥Ç¥£¥ì¥¯¥È¥ê¤ÎÍѰÕ
if ! FileTest.exist?("#{@passwd.dir}/#{@diarydir}")
FileUtils16.mkdir_p("#{@passwd.dir}/#{@diarydir}", *@fileutilOptions)
end
@@ -199,7 +196,7 @@
end
end
- def linkBaseFile # tDiary¤ÎÇÛÉÛ¥Õ¥¡¥¤¥ë¤Ï¥³¥Ô¡¼¤·¤Ê¤¤
+ def linkBaseFile
FileUtils16.cp_r("#{@tdiarymaster}/plugin", "#{@passwd.dir}/#{@httpdir}/#{@diarydir}", :preserve, *@fileutilOptions)
FileUtils16.ln_s("#{@tdiarymaster}/theme", "#{@passwd.dir}/#{@httpdir}/#{@diarydir}", *@fileutilOptions)
FileUtils16.ln_s("#{@tdiarymaster}/doc", "#{@passwd.dir}/#{@httpdir}/#{@diarydir}", *@fileutilOptions)
@@ -215,13 +212,24 @@
FileUtils16.chmod(0755, "#{@passwd.dir}/#{@httpdir}/#{@diarydir}/update.rb", *@fileutilOptions)
end
- def copyBaseFile # tDiary¤ÎÇÛÉÛ¥Õ¥¡¥¤¥ë¤ò¤¹¤Ù¤Æ¥³¥Ô¡¼
- FileUtils16.cp_r("#{@tdiarymaster}/", "#{@passwd.dir}/#{@httpdir}/#{@diarydir}", :preserve, *@fileutilOptions)
+ def copyBaseFile
+ FileUtils16.cp_r("#{@tdiarymaster}/doc", "#{@passwd.dir}/#{@httpdir}/#{@diarydir}", :preserve, *@fileutilOptions)
+ FileUtils16.cp_r("#{@tdiarymaster}/erb", "#{@passwd.dir}/#{@httpdir}/#{@diarydir}", :preserve, *@fileutilOptions)
+ FileUtils16.cp_r("#{@tdiarymaster}/misc", "#{@passwd.dir}/#{@httpdir}/#{@diarydir}", :preserve, *@fileutilOptions)
+ FileUtils16.cp_r("#{@tdiarymaster}/plugin", "#{@passwd.dir}/#{@httpdir}/#{@diarydir}", :preserve, *@fileutilOptions)
+ FileUtils16.cp_r("#{@tdiarymaster}/skel", "#{@passwd.dir}/#{@httpdir}/#{@diarydir}", :preserve, *@fileutilOptions)
+ FileUtils16.cp_r("#{@tdiarymaster}/tdiary", "#{@passwd.dir}/#{@httpdir}/#{@diarydir}", :preserve, *@fileutilOptions)
+ FileUtils16.cp_r("#{@tdiarymaster}/theme", "#{@passwd.dir}/#{@httpdir}/#{@diarydir}", :preserve, *@fileutilOptions)
+ FileUtils16.cp("#{@tdiarymaster}/index.rb", "#{@passwd.dir}/#{@httpdir}/#{@diarydir}", *@fileutilOptions)
+ FileUtils16.chmod(0755, "#{@passwd.dir}/#{@httpdir}/#{@diarydir}/index.rb", *@fileutilOptions)
+ FileUtils16.cp("#{@tdiarymaster}/update.rb", "#{@passwd.dir}/#{@httpdir}/#{@diarydir}", *@fileutilOptions)
+ FileUtils16.chmod(0755, "#{@passwd.dir}/#{@httpdir}/#{@diarydir}/update.rb", *@fileutilOptions)
+ FileUtils16.cp("#{@tdiarymaster}/tdiary.rb", "#{@passwd.dir}/#{@httpdir}/#{@diarydir}", *@fileutilOptions)
+ FileUtils16.cp("#{@tdiarymaster}/README", "#{@passwd.dir}/#{@httpdir}/#{@diarydir}", *@fileutilOptions)
end
def installConfig
- # ÀßÄê¥Õ¥¡¥¤¥ë¤òÀ¸À®¤·¤Æ¥¤¥ó¥¹¥È¡¼¥ë
- tempfile = Tempfile.new("tdiary.conf-ja") # ÆüËܸì´Ä¶¥µ¥ó¥×¥ë
+ tempfile = Tempfile.new("tdiary.conf-ja")
tempfile.write tdiaryConfReplace("#{@tdiarymaster}/tdiary.conf.sample")
tempfile.close
FileUtils16.cp(tempfile.path, "#{@passwd.dir}/#{@httpdir}/#{@diarydir}/tdiary.conf-ja", *@fileutilOptions)
@@ -231,10 +239,9 @@
tempfile.close
FileUtils16.cp(tempfile.path, "#{@passwd.dir}/#{@httpdir}/#{@diarydir}/tdiary.conf-en", *@fileutilOptions)
- if ! FileTest.exist?("#{@passwd.dir}/#{@httpdir}/#{@diarydir}/tdiary.conf") # tdiary.conf ¤¬¤Ê¤±¤ì¤ÐÀßÃÖ
+ if ! FileTest.exist?("#{@passwd.dir}/#{@httpdir}/#{@diarydir}/tdiary.conf")
FileUtils16.cp("#{@passwd.dir}/#{@httpdir}/#{@diarydir}/#{@tdconfig}", "#{@passwd.dir}/#{@httpdir}/#{@diarydir}/tdiary.conf", *@fileutilOptions)
end
- # TODO: @lang¤ÎÃͤˤè¤Ã¤Æ plugin/00lang.en.rb ¥³¥Ô¡¼/ºï½ü¤ÎÀ©¸æ¤â¤·¤¿¤¤
tempfile = Tempfile.new("dot.htaccess")
tempfile.write dothtaccessReplace("#{@tdiarymaster}/dot.htaccess")
@@ -245,27 +252,26 @@
end
end
- def setPermissions # ¥Õ¥¡¥¤¥ë¥³¥Ô¡¼¡¦À¸À®°Ê³°¤Î½èÍý
+ def setPermissions
FileUtils16.chmod(0777, "#{@passwd.dir}/#{@diarydir}", *@fileutilOptions) if ! defined?($OPT_SUEXEC)
FileUtils16.chmod(0777, "#{@passwd.dir}/#{@httpdir}/#{@diarydir}", *@fileutilOptions) if ! defined?($OPT_SUEXEC)
FileUtils16.rm("#{@passwd.dir}/#{@httpdir}/#{@diarydir}/tdiary-FreeBSD.sh", :force, *@fileutilOptions)
- if @euid == 0 then # superuser ¸¢¸Â¤Ç¤³¤Î¥¤¥ó¥¹¥È¡¼¥é¤ò¼Â¹Ô¤·¤Æ¤¤¤ë¾ì¹ç
- # ¤¹¤Ù¤Æ¤Î¥Ç¥£¥ì¥¯¥È¥ê¡¦¥Õ¥¡¥¤¥ë¤Ë chown ¤Ç½êͼÔÊѹ¹
+ if @euid == 0 then
Find.find("#{@passwd.dir}/#{@diarydir}", "#{@passwd.dir}/#{@httpdir}/#{@diarydir}") do |f|
File.chown(@passwd.uid, @passwd.gid, f)
end
- if File::Stat.new("#{@passwd.dir}/#{@httpdir}").uid == 0 # ~/public_html ¤Î¥ª¡¼¥Ê¡¼¤¬superuser
+ if File::Stat.new("#{@passwd.dir}/#{@httpdir}").uid == 0
File.chown(@passwd.uid, @passwd.gid, "#{@passwd.dir}/#{@httpdir}")
end
end
end
- def echo(s) # --quiet ¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¥á¥Ã¥»¡¼¥¸¤ò½ÐÎϤ¹¤ë
+ def echo(s)
STDOUT.print s if ! defined?($OPT_QUIET)
end
- def tdiaryConfReplace(filename) # ¥µ¥ó¥×¥ë tdiary.conf ¤ò½ñ¤´¹¤¨¤ë¥á¥½¥Ã¥É
+ def tdiaryConfReplace(filename)
s = ''
File.open(filename) { |fp|
fp.each { |line|
@@ -273,14 +279,14 @@
line = "@author_name = '#{@author_name}'\n" if line =~ /^\@author_name\s/
line = "@author_mail = '#{@author_mail}'\n" if line =~ /^\@author_mail\s/
line = "@html_title = '#{@author_name} diary'\n" if line =~ /^\@html_title\s/
- line = "@index_page = 'http://#{@author_host}/~#{@username}\/'" if line =~ /^\@index_page\s/ #FK
+ line = "@index_page = 'http://#{@author_host}/~#{@username}\/'" if line =~ /^\@index_page\s/
s += line
}
}
s
end
- def dothtaccessReplace(filename) # ¥µ¥ó¥×¥ë dot.htaccess ¤ò½ñ¤´¹¤¨¤ë¥á¥½¥Ã¥É
+ def dothtaccessReplace(filename)
s = ''
File.open(filename) { |fp|
fp.each { |line|
@@ -297,7 +303,7 @@
tdiaryinst = TdiaryInstall.new
tdiaryinst.tdiarymaster = $OPT_TDIARYMASTER
tdiaryinst.lang = $OPT_LANG
-tdiaryinst.username = $OPT_USER if defined?($OPT_USER) # $OPT_NAME¤ÎÀßÄê¤è¤êÁ°¤Ç¤Ê¤¤¤È¤¤¤±¤Ê¤¤
+tdiaryinst.username = $OPT_USER if defined?($OPT_USER)
tdiaryinst.diarydir = $OPT_DIARYDIR if defined?($OPT_DIARYDIR)
tdiaryinst.httpdir = $OPT_HTTPDIR if defined?($OPT_HTTPDIR)
tdiaryinst.author_name = $OPT_NAME if defined?($OPT_NAME)
=== ended cut here ===
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list