月曜日, 9月 06, 2010

Rhinoで実行スクリプト

2009/05/18perlfreak.vox.comより転載)

Rhinoはじめ、必要なJARファイルにCLASSPATHはとおっている前提。
Javaが /usr/local/java にインストールされているとして、つぎの内容を例えばsample.jsとして保存し、実行権限をつける。

----- (sample.js ここから) -----
#!/usr/local/java/bin/java org.mozilla.javascript.tools.shell.Main

importPackage( java.lang );
importPackage( java.sql );

var db_host = arguments[0];
var db_name = arguments[1];
var driver = "com.microsoft.sqlserver.jdbc.SQLServerDriver";
var url = "jdbc:sqlserver://" + db_host + ":1433;DatabaseName=" + db_name;
var user = "user";
var passwd = "passwd";
var sql = "SELECT site_id FROM sites WITH (NOLOCK)";

Class.forName( driver );
var conn = DriverManager.getConnection( url, user, passwd );
var stmt = conn.createStatement();
var rs = stmt.executeQuery(sql);

while ( rs.next() ) {
print( rs.getString( "site_id" ) );
}

conn.close();
----- (sample.js ここまで) -----

そして

$ ./sample.js db_host db_name

のように実行する。
上の例は、MSのJDBCドライバを使ってSQL Serverに問い合わせている。
実行時の引数は、「arguments」という配列で取得可能。
起動はJRubyより速いかも。

以上

Postfix 自ホストでunknown userになるメールを他へ転送

2009/05/15perlfreak.vox.comより転載)

    同一ドメイン(hoge.com)内の他のマシン(192.168.1.1)のaliasesに

    foo: bar@hogehoge.com

    という転送設定の記述があるが、自ホストのaliasesにはfooの記述もなく、fooというユーザもない場合、自ホストから

    foo@hoge.com

    宛てにメールを送るには、main.cf につぎの2行を追加して再起動。

    fallback_transport = smtp:[192.168.1.1]
    local_recipient_maps =

    これは、自ホストでunknown userになるメールを他へ転送する設定。

    以上


digコマンドで逆引きの確認

2009/05/14perlfreak.vox.comより転載)

割り当てられたグローバルIPアドレスが、123.456.789.0/28の場合に123.456.789.12を引く前提。

$ dig @ns.hoge.jp -x 123.456.789.12

これで引けない場合

$ dig @ns.hoge.jp ptr 12.0/28.789.456.123.in-addr.arpa.

PHPでSSH

2009/02/09perlfreak.vox.comより転載)

OSは、Red Hat Enterprise Linux ES 4 (32bit) が前提。

http://dag.wieers.com/rpm/packages/libssh2/

から

libssh2-0.17-1.el4.rf.i386.rpm
libssh2-devel-0.17-1.el4.rf.i386.rpm

を取得してインストール。

http://pecl.php.net/package/ssh2

から

ssh2-0.11.0.tgz

を取得し、そのファイルのあるディレクトリで

# pear install ./ssh2-0.11.0.tgz
# chmod 755 /usr/lib/php4/ssh2.so

すでにユーザfooがssh接続できるとして

# mkdir /etc/httpd/.ssh
# cp /home/foo/.ssh/* /etc/httpd/.ssh
# chown -R apache:apache /etc/httpd/.ssh
# chmod 700 /etc/httpd/.ssh

そして、

/etc/php.ini

extension=ssh2.so

という行を追加する。
最後にApacheを再起動する。
以上。

suEXEC

2008/10/28perlfreak.vox.comより転載)

Apache の httpd.conf に

SuexecUserGroup foo foo

というディレクティブを追加する。foo は、そのマシンのログインアカウント。

# service httpd restart

cgi-bin ディレクトリの下に bar というディレクトリを作成し、

# chown foo:foo bar
# chmod 701 bar

bar の下に hoge.cgi を置き

# chown foo:foo bar/hoge.cgi
# chmod 700 bar/hoge.cgi

hoge.cgi から呼び出すプログラムは

/usr/local/bin

に置く。

suEXEC下でのnagios

2008/12/29perlfreak.vox.comより転載)

suEXECの設定をしたApacheでは、nagiosのWebツールがうまく動作しない。
そこで、nagiosのCGIのファイルをApacheのCGIのディレクトリ下にコピーし、設定を変更する。

/etc/httpd/conf/httpd.confに

SuexecUserGroup foo foo

という記述があるとして

# mkdir /var/www/cgi-bin/nagios
# cp /usr/lib/nagios/cgi/*.cgi /var/www/cgi-bin/nagios
# chown -R foo:foo /var/www/cgi-bin/nagios
# chmod 701 /var/www/cgi-bin/nagios
# chmod 700 /var/www/cgi-bin/nagios/*.cgi
# vi /etc/httpd/conf.d/nagios.conf

 #ScriptAlias /nagios/cgi-bin "/usr/lib/nagios/cgi"
 ScriptAlias /nagios/cgi-bin "/var/www/cgi-bin/nagios"

 #
 

 (以下省略)

以上

Perl CGI::Application::Plugin::ValidateRMをcpanでインストール

2008/08/28perlfreak.vox.comより転載)

テストでこけてインストールできないので、

http://osdir.com/ml/lang.perl.modules.cgi-appplication/2007-09/msg00040.html

を参考に

~./.cpan/build/CGI-Application-Plugin-ValidateRM-2.2/t/forward.t

をつぎのように変更する。

===(ここから)===
use Test::More tests => 4;
use strict;

$ENV{CGI_APP_RETURN_ONLY} = 1;

{ package MyForward::Test; use base 'CGI::Application'; use
CGI::Application::Plugin::ValidateRM;

sub setup { my $self = shift; $self->start_mode('legacy_process');
$self->run_modes([qw/legacy_process legacy_form/]); }

sub legacy_form { my $self = shift;
Test::More::is($self->get_current_runmode, 'legacy_process', "if
::Forward is not loaded, current_rm is not updated");
# $self->header_type('none'); return "legacy form output HUH"; }
$self->header_type('none');
return ($HTML::FillInForm::VERSION <= 1.06) ? "legacy form output HUH" : "legacy form output"; }


sub legacy_process { my $self = shift; my ($results, $err_page) =
$self->check_rm('legacy_form', { required => 'fail' }); return
$err_page if $err_page; return 'legacy process completed'; }

my $app = MyForward::Test->new(); my $out = $app->run();
Test::More::is($out, 'legacy form output', "form is returned");
}

SKIP: {
package MyForward::TestForward;
use base 'CGI::Application';
use CGI::Application::Plugin::ValidateRM;
eval { require CGI::Application::Plugin::Forward; };
if ($@) {
Test::More::skip "CGI::Application::Plugin::Forward required", 2;
}

sub setup {
my $self = shift;
$self->start_mode('forward_process');
$self->run_modes([qw/forward_process forward_form/]);
}

sub forward_form {
my $self = shift;
Test::More::is($self->get_current_runmode, 'forward_form',
"if ::Forward is loaded, current_rm is updated");
$self->header_type('none');
# return "forward form output HUH";
return ($HTML::FillInForm::VERSION <= 1.06) ? "forward form output HUH" : "forward form output"; }

sub forward_process {
my $self = shift;
my ($results, $err_page) = $self->check_rm('forward_form', { required => 'fail' });
return $err_page if $err_page;
}

my $app = MyForward::TestForward->new();
my $out = $app->run();
Test::More::is($out, 'forward form output', "form is returned");
}
===(ここまで)===

そして

# make test
# make install

PersistentPerl

2008/08/28perlfreak.vox.comより転載)

Perlスクリプトをメモリに常駐させることができる。

http://daemoninc.com/PersistentPerl/
http://perldoc.jp/docs/modules/PersistentPerl-2.21/PersistentPerl.pod

インストールした後、Perlスクリプトの先頭行を

#!/usr/bin/perperl -w

のように変更するだけ。

Perl 更新日付が指定日数より前のファイルを圧縮

2008/08/05perlfreak.vox.comより転載)

OSの文字コードがUTF-8のLinux上のSambaサーバで管理しているディレクトリ下のファイルが対象。

===(compress_files.pl ここから)===
#!/usr/bin/perl -w

use File::Find::Rule;
use Encode qw/ from_to /;
#use warnings;
use strict;

# 処理対象ディレクトリパスと日数
my $dir_path = $ARGV[0] if $ARGV[0];
my $days = $ARGV[1] if $ARGV[1];
unless ( $days ) { exit; }

# 指定日数分前のtime
my $days_before = time - 60 * 60 * 24 * $days;

# ログ
my $log_path = '/tmp/compress_files.log';
system( "/usr/bin/touch", $log_path ) unless ( -e $log_path );

# 対象ファイルのパスを取得
my @files = File::Find::Rule->file()
->mtime( "<$days_before" ) ->in( $dir_path );

# 圧縮・削除処理
open OUT, ">> $log_path" or die "Cannot open file: $!\n";
foreach my $file_path ( @files ) {
if ( $file_path =~ /.+\.zip$/ ) { next; }

my $compress_path = $file_path . '.zip';

if ( $file_path =~ /^(.+)\/(.+?)$/ ) {
print $file_path . "\n";
print OUT $file_path . "\n";
my $dir_path = $1;
my $file_name = $2;
my $cp_file_name = $file_name;
from_to( $cp_file_name, 'utf8', 'cp932' );
my $compress_name = $file_name . '.zip';
chdir $dir_path;
system( "/bin/cp", "-p", $file_name, $cp_file_name );
my( $owner, $group, $date, $time ) = (split( / /, `/bin/ls -l $file_name`))[2,3,5,6];
my( $year, $mon, $day ) = split( /-/, $date );
my( $hour, $min ) = split( /:/, $time );
system( "/usr/bin/zip", $compress_name, $cp_file_name );
system( "/bin/chown", "$owner:$group", $compress_name );
system( "/usr/bin/touch", "-m", "-t", "$year$mon$day$hour$min", $compress_name );
system( "/bin/rm", $file_name, $cp_file_name );
}
}
close OUT;

exit;
===(compress_files.pl ここまで)===

MS SQL Server 2000 バックアップ&リストア

2008/06/21perlfreak.vox.comより転載)
(バックアップ)
BACKUP DATABASE hoge TO disk='d:\backup\hoge.bak' WITH INIT
GO

(リストア)
RESTORE DATABASE hoge FROM DISK='d:\backup\hoge.bak'
GO
USE hoge
GO
sp_change_users_login 'Update_One', 'foo', 'foo'
GO

Perl メールサーバマシン上で添付ファイル処理

2008/06/17perlfreak.vox.comより転載)

メールの添付ファイルを指定ディレクトリに保存する。
指定ディレクトリ下にFrom:のアカウントでサブディレクトリを作り、その下にタイムスタンプ+拡張子でファイルを保存する。
引数は2つ。1つめは、ファイル保存ディレクトリのパス。2つめは、メールスプールファイルのディレクトリパス。
aliasesで

foo: |"/usr/local/bin/save_attached.pl /var/spool/attached"

のように指定し、メールを受信する度に処理する場合は、2つめの引数は指定しない。
一度受信したメールを処理する場合は、2つめの引数が必要。cronで定期実行する。
処理対象は、From:が@hoge.comのものに限定している。

===(save_attached.pl ここから)===
#!/usr/bin/perl -w

use MIME::Parser;
use MIME::Base64 qw/ decode_base64 /;
#use warnings;
use strict;

my $check_domain = 'hoge.com';
my $save_path = "";
my $spool_path = "";

# 引数チェック
if ( $ARGV[0] ) {
$save_path = $ARGV[0];
$save_path =~ s/\/$//;
unless ( -d $save_path ) {
exit;
}
}
else {
exit;
}

if ( $ARGV[1] ) {
$spool_path = $ARGV[1];
$spool_path =~ s/\/$//;
unless ( -d $spool_path ) {
exit;
}
}

my $parser = new MIME::Parser;
$parser->output_to_core( 1 );

if ( $spool_path ne "" ) {
opendir INDIR, $spool_path or die;
while ( my $spool_file = readdir INDIR ) {
chomp $spool_file;
my $spool_file_path = $spool_path . '/' . $spool_file;
if ( $spool_file =~ /^\d+\.$/ and -f $spool_file_path ) {
my $account = "";

# ファイルデータを取得
open IN, "< $spool_file_path" or next; my $buff = do { local $/; };
close IN;

my $entity = $parser->parse_data( $buff ) or next;
my $from = $entity->head->get( 'from' );
chomp $from;

# Fromアドレスのチェック
if ( $from =~ /([_\.a-zA-Z0-9]+)\@$check_domain/ ) {
$account = $1;
}
else {
system( "/bin/rm", $spool_file_path );
next;
}

# 添付ファイル保存
if ( $entity->is_multipart ) {
&_save_attached_file( $entity, $save_path, $account );
system( "/bin/rm", $spool_file_path );
}
}
}
closedir INDIR;
}
else {
my $account = "";
my $entity = $parser->parse( \*STDIN ) or die;
my $from = $entity->head->get( 'from' );
chomp $from;

# Fromアドレスのチェック
if ( $from =~ /([_\.a-zA-Z0-9]+)\@$check_domain/ ) {
$account = $1;
}
else {
exit;
}

# 添付ファイル保存
if ( $entity->is_multipart ) {
&_save_attached_file( $entity, $save_path, $account );
}
}

exit;


#=== FUNCTION ================================================================
# NAME: _save_attached_file
# PURPOSE: 添付ファイル保存
# DESCRIPTION: 添付ファイルを保存する。
# PARAMETERS: メールエンティティ、保存先ディレクトリパス、アカウント
# RETURNS: なし
#===============================================================================
sub _save_attached_file() {

my ( $entity, $save_path, $account ) = @_;
my $date = &_get_date();
my $parts_count = $entity->parts;
for ( my $i = 1; $i < $parts_count; $i++ ) { my $part_entity = $entity->parts( $i );
my $filename = $part_entity->head->recommended_filename;
if ($filename =~ /\=\?ISO\-2022\-JP\?B\?(.+)\?\=/ ) {
$filename = $1;
$filename = decode_base64( $filename );
}

my $ext = "";
if ( $filename =~ /\.(\w+?)$/ ) {
$ext = $1;
}

my $new_filename = $date . '_' . $i;
if ( $ext ne "" ) {
$new_filename = $new_filename . '.' . $ext;
}

my $save_dir = $save_path . '/' . $account;
unless ( -d $save_dir ) {
system( "/bin/mkdir", $save_dir );
}
my $save_file = $save_dir . '/' . $new_filename;

open OUT, "> $save_file" or next;
print OUT $part_entity->bodyhandle->as_string;
close OUT;
}

}

#=== FUNCTION ================================================================
# NAME: _get_date()
# PURPOSE: 年月日時分秒
# DESCRIPTION: 年月日時分秒を返す。
# PARAMETERS: なし
# RETURNS: YYYYMMDDHHMISS
#===============================================================================
sub _get_date() {

my( $sec, $min, $hour, $mday, $mon, $year ) = (localtime)[0,1,2,3,4,5];
$year+=1900;
$mon++;
$sec = sprintf("%02d", $sec);
$min = sprintf("%02d", $min);
$hour = sprintf("%02d", $hour);
$mday = sprintf("%02d", $mday);
$mon = sprintf("%02d", $mon);

return $year . $mon . $mday . $hour . $min . $sec;

}
===(save_attached.pl ここまで)===

Rubyでログファイルを定期的に監視

2008/04/03perlfreak.vox.comより転載)

RubyGemsでtmailをインストールしてある前提。
ログファイルには指定するキーワードの他にサイトIDが出力されている前提。
これを5分おきに実行。

=== ( log_check.rb ここから) ===
#!/usr/bin/env ruby

require 'rubygems'
require 'tmail'
require 'iconv'
require 'net/smtp'

# ホスト名
host = `/bin/hostname`.chomp

# ログファイル
log_file = '/var/log/hoge.log'

# フラグ用ディレクトリ
flag_dir = '/var/run/log_check/'

# キーワード
log_keyword = '混雑'

# チェック間隔(秒)
interval = 300

# アラートまでのチェック回数
alert_check_count = 3

# 送信先
mailto = [
'foo@bar.com'
]

## prefix作成メソッド
def make_prefix( num )
return "_" + num.to_s + "_"
end

## ディレクトリ下ファイル名からのサイトID取得メソッド
def get_flag_site_list( dir_path, prefix_num )
prefix = make_prefix( prefix_num )
site_id_ary = Array.new
file_path_ary = Dir.glob( dir_path + "#{prefix}*" )
file_path_ary.each do |file_path|
/^#{prefix}(.+)$/ =~ File.split( file_path )[1]
site_id_ary.push( $1 )
end

return site_id_ary
end

## ログファイルからキーワードを含む行のサイトID取得メソッド
def get_log_site_list( sec, keyword )
site_id_ary = Array.new
boundary_time = (Time.now - sec).strftime( "[%Y/%m/%d %H:%M:%S]" )
tail_lines = sec * 50
grep_result = `/usr/bin/tail -#{tail_lines} #{log_file} | /bin/grep "#{keyword}"`
grep_result.split( /\n/ ).each do |line|
line_ary = line.split( /\s+/ )
site_id = line_ary[3]
time_stamp = line_ary[0] + ' ' + line_ary[1]
if time_stamp >= boundary_time
if !site_id_ary.include?( site_id )
site_id_ary.push( site_id )
end
end
end

return site_id_ary
end

## メール送信メソッド
def send_mail( mailto, host, site_id, alt )
subject = "混雑リカバリ (" + site_id + ")"
if alt == "alert"
subject = "混雑アラート (" + site_id + ")"
end

from = 'system@bar.com'
mesg = host + "\n\n" + site_id

mail = TMail::Mail.new
mail.to = mailto
mail.cc = ['']
mail.bcc = ['']
mail.from = from
mail.subject = Iconv.conv( 'ISO-2022-JP', 'EUC-JP', subject )
mail.date = Time.now
mail.mime_version = '1.0'
mail.set_content_type( 'text', 'plain', {'charset' => 'iso-2022-jp'} )
mail.encoding = '7bit'
mail.body = Iconv.conv( 'ISO-2022-JP', 'EUC-JP', mesg )

Net::SMTP.start( 'localhost', 25 ) do |smtp|
str = mail.encoded
smtp.send_mail( str, mail.from, mail.destinations )
end
end

# ログファイルからサイトID取得
busy_site_ary = get_log_site_list( interval, log_keyword )

# フラグファイル名からサイトID取得
flag_site_arys = Array.new
count = 1
while count <= alert_check_count flag_site_arys.push( get_flag_site_list( flag_dir, count ) ) count += 1 end

# 初期フラグ
first_flag_ary = busy_site_ary
flag_site_arys.each do |site_ary|
first_flag_ary = first_flag_ary - site_ary
end
prefix = make_prefix( 1 )
first_flag_ary.each do |site_id|
flag_file = flag_dir + prefix + site_id
system( '/bin/touch', flag_file )
if alert_check_count == 1
send_mail( mailto, host, site_id, "alert" )
end
end

# フラグ変更(削除)&メール送信
count = 1
flag_site_arys.each do |site_ary|
prefix = make_prefix( count )
if count < prefix_2 =" make_prefix(" flag_file =" flag_dir" flag_file_2 =" flag_dir" count ="="" flag_file =" flag_dir" count ="="" end ="="="">

RubyでWebサイトのレスポンス監視

2008/02/25perlfreak.vox.comより転載)

RubyGemsでtmailとmechanizeをインストールしてある前提。
これをcronで5分おきに実行。

=== ( response_check.rb ここから ) ===
#!/usr/bin/env ruby

require 'rubygems'
require 'tmail'
require 'iconv'
require 'net/smtp'
require 'mechanize'

# アラートフラグ用ディレクトリ
alert_dir_path = '/var/run/response_check/'

# アラートまでのチェック回数
alert_check_count = 2

# チェック対象
target_hash = {
'www_hoge_jp' => {
'url' => 'https://www.hoge.jp/',
'user_id' => 'foo',
'password' => 'bar',
'mailto' => [ 'list@hoge.com' ],
'alert_time' => 3
},
'www2_hoge_jp' => {
'url' => 'https://www2.hoge.jp/',
'user_id' => 'foo',
'password' => 'bar',
'mailto' => [ 'list@hoge.com' ],
'alert_time' => 3
},
'www3_hoge_jp' => {
'url' => 'https://www3.hoge.jp/',
'user_id' => 'foo',
'password' => 'bar',
'mailto' => [ 'list@hoge.com' ],
'alert_time' => 3
}
}

## ログインしてから管理画面が表示されるまでの時間を返すメソッド
def response_time( user_agent, url, user_id, password )
agent = user_agent
page = agent.get( url )
form = page.forms.with.name( 'login' ).first
form.userid = user_id
form.password = password
start_time = Time.now.to_f
results = agent.submit( form )
body = results.body
end_time = Time.now.to_f

return end_time - start_time
end

## メール送信メソッド
def mail_send( target, url, mailto, response, alt )
subject = ""
if alt == "alert"
subject = "応答時間アラート (" + target + ")"
else
subject = "応答時間リカバリ (" + target + ")"
end

mesg = target + "\n\n" + "応答時間:" + "#{response}"

mail = TMail::Mail.new
mail.to = mailto
mail.cc = ['']
mail.bcc = ['']
mail.from = 'system@hoge.jp'
mail.subject = Iconv.conv( 'ISO-2022-JP', 'EUC-JP', subject )
mail.date = Time.now
mail.mime_version = '1.0'
mail.set_content_type( 'text', 'plain', {'charset' => 'iso-2022-jp'} )
mail.encoding = '7bit'
mail.body = Iconv.conv( 'ISO-2022-JP', 'EUC-JP', mesg )

Net::SMTP.start( 'localhost', 25 ) do |smtp|
str = mail.encoded
smtp.send_mail( str, mail.from, mail.destinations )
end
end

# アラートメール、リカバリメール
agent = WWW::Mechanize.new
target_hash.each do | key, value |
flag_file_ary = Dir.glob( alert_dir_path + "#{key}_[1-9]*" )
url = value['url']
user_id = value['user_id']
password = value['password']
mailto = value['mailto']
alert_time = value['alert_time']
response = response_time( agent, url, user_id, password )

if flag_file_ary.size == 0
if response > alert_time
system( '/bin/touch', alert_dir_path + key + "_1" )
if alert_check_count == 1
send_mail( key, mailto, response, "alert" )
end
end
elsif flag_file_ary.size == 1
flag_file = flag_file_ary[0]
/^#{key}_([\d]+)$/ =~ File.split( flag_file )[1]
flag_count = $1.to_i
if response > alert_time
if flag_count < flag_file_2 =" alert_dir_path" flag_count ="="" flag_count ="="" end ="="="">

RubyGemsのtarボールからRPMパッケージをつくる

2008/02/07perlfreak.vox.comより転載)

checkinstallがインストールされている前提。
$ tar zxvf rubygems-1.0.1.tgz
$ cd rubygems-1.0.1
$ su
Password:
# checkinstall --fstrans=no -R "ruby setup.rb"
入力を求められたり、内容を変更する場合があるので、以下出力を参考まで。ただし、出力内容は途中まで。
--- (ここから) ---
checkinstall 1.6.0, Copyright 2002 Felipe Eduardo Sanchez Diaz Duran
This software is released under the GNU GPL.

The package documentation directory ./doc-pak does not exist.
Should I create a default set of package docs? [y]: y
Preparing package documentation...OK
Please write a description for the package.
End your description with an empty line or EOF.
>>
**************************************
**** RPM package creation selected ***
**************************************
This package will be built according to these values:
1 - Summary: [ Package created with checkinstall 1.6.0 ]
2 - Name: [ rubygems ]
3 - Version: [ 1.0.1 ]
4 - Release: [ 1 ]
5 - License: [ GPL ]
6 - Group: [ Applications/System ]
7 - Architecture: [ x86_64 ]
8 - Source location: [ rubygems-1.0.1 ]
9 - Alternate source location: [ ]
10 - Requires: [ ]
11 - Provides: [ rubygems ]
Enter a number to change any of them or press ENTER to continue: 4
Enter the additional requirements:
>> el4
This package will be built according to these values:
1 - Summary: [ Package created with checkinstall 1.6.0 ]
2 - Name: [ rubygems ]
3 - Version: [ 1.0.1 ]
4 - Release: [ el4 ]
5 - License: [ GPL ]
6 - Group: [ Applications/System ]
7 - Architecture: [ x86_64 ]
8 - Source location: [ rubygems-1.0.1 ]
9 - Alternate source location: [ ]
10 - Requires: [ ]
11 - Provides: [ rubygems ]
Enter a number to change any of them or press ENTER to continue: 11 <- 10と11が逆になっている Enter the additional requirements: >> ruby
This package will be built according to these values:
1 - Summary: [ Package created with checkinstall 1.6.0 ]
2 - Name: [ rubygems ]
3 - Version: [ 1.0.1 ]
4 - Release: [ el4 ]
5 - License: [ GPL ]
6 - Group: [ Applications/System ]
7 - Architecture: [ x86_64 ]
8 - Source location: [ rubygems-1.0.1 ]
9 - Alternate source location: [ ]
10 - Requires: [ ruby ]
11 - Provides: [ rubygems ]
Enter a number to change any of them or press ENTER to continue:
--- (ここまで(実際にはさらに続く)) ---
これで
/usr/src/redhat/RPMS/x86_64
等にRPMファイルが生成される。