2018年12月27日木曜日

DjangoのインストールとApache連携

【インストール無しの開発環境】
# cd ~/Make
# git clone https://github.com/okoppe8/instant-django.git
# cd instant-django
# python36 -m venv ~/.venv36
# source ~/.venv36/bin/activate
# cat requirements.txt
Django==2.1.2
django-crispy-forms==1.7.2
django-filter==2.0.0
pytz==2018.5
# pip3 install -r requirements.txt     # <-- Django環境のインストール
# python36 manage.py migrate
# python36 manage.py createsuperuser
# python36 manage.py runserver

URL=http://127.0.0.1:8000/

【Djangoのインストール】
# python36 -m pip install Django
# ls /usr/local/lib/python3.6/site-packages/django # 確認
$ django-admin.py startproject myapp               # プロジェクト作成

$ python36
Python 3.6.6 (default, Aug 13 2018, 18:24:23)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-28)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import django
>>> django.get_version()
'2.1.2'
$ httpd -v
Server version: Apache/2.4.6 (CentOS)
Server built: Nov 5 2018 01:47:09

# pip3 install
# pip3 install pymysql

■仮想環境の構築
# mkdir /usr/local/venv36
# pip3 -m venv /usr/local/venv36
# source /usr/local/venv36/bin/activate      ※環境設定
# deactivate
                                ※環境を戻す
■Apache連携
VENV仮想環境を構築してから下記を行う。

【WSGIインストール】
# pip3 install mod-wsgi
# pip3 freeze|grep wsgi
mod-wsgi==4.6.5
mod-wsgi-httpd==2.4.35.1
# ls /usr/local/venv36/lib64/python3.6/site-packages/mod_wsgi/server/mod_wsgi-py36.cpython-36m-x86_64-linux-gnu.so
# vi /etc/httpd/conf.modules.d/20-wsgi.conf
LoadModule wsgi_module /usr/local/venv36/lib64/python3.6/site-packages/mod_wsgi/server/mod_wsgi-py36.cpython-36m-x86_64-linux-gnu.so
# httpd -M|grep wsgi
wsgi_module (shared)

# vi /etc/httpd/conf.d/wsgi.conf
WSGISocketPrefix /var/run/wsgi

WSGIScriptAlias  /cti /var/www/wsgi/cti/Project/wsgi.py
WSGIDaemonProcess cti user=apache group=apache processes=10 threads=15 \
       home=/var/www/wsgi/cti \
       python-home=/usr/local/venv36 \
       python-path=/var/www/wsgi/cti:/usr/local/venv36/lib64/python3.6/site-packages

WSGIScriptAlias  /analyze /var/www/wsgi/analyze/Project/wsgi.py
WSGIDaemonProcess analyze user=apache group=apache processes=10 threads=15 \
       home=/var/www/wsgi/analyze \
       python-home=/usr/local/venv36 \
       python-path=/var/www/wsgi/analyze:/usr/local/venv36/lib64/python3.6/site-packages

Alias /static/  /var/www/wsgi/analyze/static/

WSGIPassAuthorization on

<Location /cti>
       WSGIProcessGroup cti
</Location>
<Location /analyze>
       WSGIProcessGroup analyze
</Location>

# vi /etc/sysconfig/httpd
LD_LIBRARY_PATH=/opt/libs/oracle:$LD_LIBRARY_PATH

# apachectl configtest
Syntax OK
# curl localhost/myapp
# systemctl restart httpd

※wsgiからstaticが参照できない。
  回避????
# vi  /etc/httpd/conf.d/wsgi.conf
Alias /static/  /var/www/wsgi/Project/static/
# cd /var/www/wsgi/Project/static
# ln -s /usr/local/venvs/lib/python3.6/site-packages/django/contrib/admin/static/admin admin

  試してない
# vi Project/settings.py
STATICFILES_DIRS = [
    BASE_DIR,
]


※manage.pyに記述した内容をwsgi.pyにも記入。
import io
import pymysql
import cx_Oracle
os.environ["NLS_LANG"] = "JAPANESE_JAPAN.JA16SJISTILDE"
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8')

pymysql.install_as_MySQLdb()


参考:https://qiita.com/nachashin/items/d3f9cd637a9cecbda72c


【lddコマンドで確認】
$ ldd /usr/local/venv36/lib64/python3.6/site-packages/mod_wsgi/server/mod_wsgi-py36.cpython-36m-x86_64-linux-gnu.so
linux-vdso.so.1 =>  (0x00007ffd62fe1000)
libpython3.6m.so.1.0 => /usr/lib64/libpython3.6m.so.1.0 (0x00007fa46eebb000)
libpthread.so.0 => /usr/lib64/libpthread.so.0 (0x00007fa46ec9f000)
libc.so.6 => /usr/lib64/libc.so.6 (0x00007fa46e8d2000)
libdl.so.2 => /usr/lib64/libdl.so.2 (0x00007fa46e6ce000)
libutil.so.1 => /usr/lib64/libutil.so.1 (0x00007fa46e4cb000)
libm.so.6 => /usr/lib64/libm.so.6 (0x00007fa46e1c9000)
/lib64/ld-linux-x86-64.so.2 (0x00007fa46f61f000)


# $ pip3 install mod-wsgi --proxy xxx.x.x.xxx:3128
Collecting mod-wsgi
  Using cached mod_wsgi-4.7.1.tar.gz (498 kB)
    ERROR: Command errored out with exit status 1:
     command: /usr/local/venv36-d22/bin/python36 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-j5eekw_5/mod-wsgi/setup.py'"'"'; __file__='"'"'/tmp/pip-install-j5eekw_5/mod-wsgi/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-j52nyjp6
         cwd: /tmp/pip-install-j5eekw_5/mod-wsgi/
    Complete output (5 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-j5eekw_5/mod-wsgi/setup.py", line 168, in <module>
        'missing Apache httpd server packages.' % APXS)
    RuntimeError: The 'apxs' command appears not to be installed or is not executable. Please check the list of prerequisites in the documentation for this package and install any missing Apache httpd server packages.
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

→これで解決。
# yum install httpd-devel
# source /usr/local/venv36-d22/bin/activate
# pip3 install mod-wsgi --proxy xxx.x.x.xxx:3128

※wsgiのインストールは、rootでないとPermission denied.






2018年12月26日水曜日

systemctl restart httpd で「Error: No space left on device」

# systemctl restart httpd
Error: No space left on device
# echo 32768 > /proc/sys/fs/inotify/max_user_watches
で一時的に直る。
恒久的には、
# vi /etc/sysctl.conf
fs.inotify.max_user_watches = 32768 # 追加
# cat /proc/sys/fs/inotify/max_user_watches

※inotify-toolsでファイル、ディレクトリ操作のイベントを監視。
# yum install inotify-tools
# inotifywait ファイル名&      -----監視開始
# inotifywatch ファイル名&      -----統計情報がとれる。



2018年12月25日火曜日

cgiでpython3を動かす。

# vi /etc/httpd/conf/httpd.conf
<Directory "/var/www/cgi-bin">
    AllowOverride None
    Options ExecCGI
    Require all granted
    AddHandler cgi-script .py .pyc
</Directory>

# vi /etc/sysconfig/httpd
LD_LIBRARY_PATH=/opt/libs/oracle:$LD_LIBRARY_PATH

# systemctl restart httpd

#vi /var/www/cgi-bin/oracle.py
#!/usr/bin/env python36import cx_Oracle
import osimport sys
import io
os.environ["NLS_LANG"] = "JAPANESE_JAPAN.JA16SJISTILDE"
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8')
print("Content-Type: text/plain;charset=utf-8")
print()

HOST = '192.168.xx.xxx'
PORT = '1521'
SID = 'xxxxxxxx'

tns = cx_Oracle.makedsn(HOST, PORT, SID)
conn = cx_Oracle.connect("xxxxxxx", "xxxxxxx", tns)

print( conn.version)
cur = conn.cursor()
cur.execute("""select column_name,data_type,data_length from all_tab_columns where table_name='CCMxxx'""")
rows = cur.fetchall()

for r in rows:
   print("%s %s %s" % (r[0],r[1],r[2]))

cur.execute("""select * from CCMxxx""")
rows = cur.fetchall()
for r in rows:
   print("%s %s %s %s" % (r[0],r[1],r[2],r[3]))

2018年12月6日木曜日

CenOS7 gradleインストール

Gradle v4.10.3 2018.12.5
ここからダウンロード
https://gradle.org/releases/

# mv gradle-4.10.3-all.zip /opt
# cd /opt
# unzip gradle-4.10.3-all.zip
# rm gradle-4.10.3-all.zip
# ln -s gradle-4.10.3 gradle
# vi /etc/profile
export GRADLE_HOME=/opt/gradle
export PATH=$GRADLE_HOME/bin:$PATH
$ source /etc/profile
$ gradle -version
Welcome to Gradle 4.10.3!
Here are the highlights of this release:
- Incremental Java compilation by default
- Periodic Gradle caches cleanup
- Gradle Kotlin DSL 1.0-RC6
- Nested included builds
- SNAPSHOT plugin versions in the `plugins {}` block
For more details see https://docs.gradle.org/4.10.3/release-notes.html
------------------------------------------------------------
Gradle 4.10.3
------------------------------------------------------------
Build time: 2018-12-05 00:50:54 UTC
Revision: e76905e3a1034e6f724566aeb985621347ff43bc
Kotlin DSL: 1.0-rc-6
Kotlin: 1.2.61
Groovy: 2.4.15
Ant: Apache Ant(TM) version 1.9.11 compiled on March 23 2018
JVM: 1.8.0_191 (Oracle Corporation 25.191-b12)
OS: Linux 3.10.0-957.1.3.el7.x86_64 amd64


■使ってみる
$ cd Make/sample
$ mkdir src
$ mkdir src/main
$ mkdir src/main/java
$ mkdir src/main/java/sample
$ mkdir src/main/jdava/sample/gradle
$ vi src/main/sample/gradle/GradleMain.javapackage sample.gradle;
public class GradleMain {
public static void main(String[] args) {
System.out.println("Hello Gradle!!");
}
}
$ vi build.gradle
apply plugin: 'java'
$ gradle compileJava
$ java -cp build/classes/java/main sample.gradle.GradleMain
Hello Gradle!!
$ find * -print
build
build/classes
build/classes/java
build/classes/java/main
build/classes/java/main/sample
build/classes/java/main/sample/gradle
build/classes/java/main/sample/gradle/GradleMain.class
build/tmp
build/tmp/compileJava
build.gradle
src
src/main
src/main/java
src/main/java/sample
src/main/java/sample/gradle
src/main/java/sample/gradle/GradleMain.java
$ gradle clean
$ find * -print
build.gradle
src
src/main
src/main/java
src/main/java/sample
src/main/java/sample/gradle
src/main/java/sample/gradle/GradleMain.java
$

■使ってみる(java project)
$ gradle init --type java-library
Starting a Gradle Daemon (subsequent builds will be faster)

BUILD SUCCESSFUL in 3s
2 actionable tasks: 2 executed
$ find . -print
.
./src
./src/test
./src/test/java
./src/test/java/LibraryTest.java
./src/main
./src/main/java
./src/main/java/Library.java
./.gradle
./.gradle/buildOutputCleanup
./.gradle/buildOutputCleanup/cache.properties
./.gradle/buildOutputCleanup/buildOutputCleanup.lock
./.gradle/buildOutputCleanup/outputFiles.bin
./.gradle/4.10.3
./.gradle/4.10.3/fileChanges
./.gradle/4.10.3/fileChanges/last-build.bin
./.gradle/4.10.3/fileHashes
./.gradle/4.10.3/fileHashes/fileHashes.lock
./.gradle/4.10.3/fileHashes/fileHashes.bin
./.gradle/4.10.3/taskHistory
./.gradle/4.10.3/taskHistory/taskHistory.bin
./.gradle/4.10.3/taskHistory/taskHistory.lock
./.gradle/4.10.3/gc.properties
./settings.gradle
./build.gradle
./gradlew
./gradlew.bat
./gradle
./gradle/wrapper
./gradle/wrapper/gradle-wrapper.properties
./gradle/wrapper/gradle-wrapper.jar

$ vi build.gradle <<__EOF__
O
##########以下を修正############
id 'java-library'の下に
id 'eclipse'を追加

id 'eclipse'
################################
←ESCコード(cntl+v esc)
ZZ
__EOF__
$ vi build.gradle
$ gradle eclipse
$ ls -la
合計 56
drwxrwxr-x. 6 takahab takahab 4096 12月 10 14:14 .
drwxrwxr-x. 3 takahab takahab 4096 12月 10 13:52 ..
-rw-rw-r--. 1 takahab takahab 4308 12月 10 14:05 .classpath
drwxrwxr-x. 5 takahab takahab 4096 12月 10 14:04 .gradle
-rw-rw-r--. 1 takahab takahab  391 12月 10 14:05 .project
drwxrwxr-x. 2 takahab takahab 4096 12月 10 14:05 .settings
-rw-rw-r--. 1 takahab takahab 1051 12月 10 14:05 build.gradle
drwxrwxr-x. 3 takahab takahab 4096 12月 10 13:53 gradle
-rwxrwxr-x. 1 takahab takahab 5296 12月 10 13:53 gradlew
-rw-rw-r--. 1 takahab takahab 2260 12月 10 13:53 gradlew.bat
-rw-rw-r--. 1 takahab takahab  367 12月 10 13:53 settings.gradle
drwxrwxr-x. 4 takahab takahab 4096 12月 10 13:53 src

eclipseを起動してインポート




CentOS7 mavenインストール

■mavenインストール
CentOS Linux release 7.6.1810
maven-3.6.0
openjdk version "1.8.0_191"

# cd /var/tmp
# curl -OL https://archive.apache.org/dist/maven/maven-3/3.6.0/binaries/apache-maven-3.6.0-bin.tar.gz
# tar -xzvf apache-maven-3.6.0-bin.tar.gz
# mv apache-maven-3.6.0 /opt/
# rm /var/tmp/apache-maven-3.6.0-bin.tar.gz
# cd /opt
# ln -s /opt/apache-maven-3.6.0 apache-maven
# vi /etc/profile
export PATH=/opt/apache-maven/bin:$PATH
# source /etc/profile
# mvn -v
Apache Maven 3.6.0 (97c98ec64a1fdfee7767ce5ffb20918da4f719f3; 2018-10-25T03:41:47+09:00)
Maven home: /opt/apache-maven
Java version: 1.8.0_191, vendor: Oracle Corporation, runtime: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.191.b12-1.el7_6.x86_64/jre
Default locale: ja_JP, platform encoding: UTF-8
OS name: "linux", version: "3.10.0-957.1.3.el7.x86_64", arch: "amd64", family: "unix"

■JDKインストール
# yum -y install java-1.8.0-openjdk java-1.8.0-openjdk-devel
# dirname $(readlink $(readlink $(which java)))
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.191.b12-1.el7_6.x86_64/jre/bin
# vi / etc / profile
export JAVA_HOME=/usr/lib/jvm/java
export PATH=$PATH:$JAVA_HOME/bin
# source /etc/profile

■mavenプロジェクト作成と実行
$ mkdir test
$ cd test
$ mvn archetype:generate -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false -DgroupId=com.sample -DartifactId=hello
$ find . -print
.
./hello
./hello/pom.xml
./hello/src
./hello/src/main
./hello/src/main/java
./hello/src/main/java/com
./hello/src/main/java/com/sample
./hello/src/main/java/com/sample/App.java
./hello/src/test
./hello/src/test/java
./hello/src/test/java/com
./hello/src/test/java/com/sample
./hello/src/test/java/com/sample/AppTest.java
$ cd hello
$ mvn compile
$ java -cp target/classes/ com.sample.App
$ mvn test
$ mvn clean













2018年11月27日火曜日

CentOS7にJasperReports Server Community Edition(v7.1.0)をインストール

【準備】
1)tomcat8.5.35
2) mysql Ver 8.0.13 for Linux on x86_64 (MySQL Community Server - GPL)
3) mysql Ver 5.1.47(mysql-connector-java-5.1.47-bin.jar)
3) mysql Ver 8.0.13(mysql-connector-java-8.0.13.jar)
※最初mysql Ver.8を使ったら、ハマった!!、connectで接続エラー URLの仕様が変わったらしい。

下記をダウンロード
https://community.jaspersoft.com/project/jasperreports-server/releases

# unzip TIB_js-jrs-cp_7.1.0_bin.zip
# cd ./jasperreports-server-cp-7.1.0-bin/buildomatic/sample_conf
# cp  mysql_master.properties ../default_master.properties
# cd ..
# vi default_master.properties
appServerType = tomcat
appServerDir = /opt/tomcat
dbType=mysql
dbPort=3306
js.dbName=jasperserver
dbHost=localhost
dbUsername=root
dbPassword=password
#---------JDBC Driver ---------------
jdbcDriverClass=com.mysql.cj.jdbc.Driver
maven.jdbc.groupId=mysql
maven.jdbc.artifactId=mysql-connector-java
maven.jdbc.version=5.1.47


# systemctl start mysqld

※商用DBの場合は、JDBCドライバのコピーが必要。
mysqlの場合(不要)
# cd ./conf_source/db
# mv mysql mysql.bak
# mkdir mysql mysql/jdbc
# cd mysql
# cp /tmp/mysql-connector-java-5.1.47.tar.gz .
# tar xvzf mysql-connector-java-5.1.47.tar.gz
# cp ./mysql-connector-java-5.1.47/mysql-connector-java-5.1.47-bin.jar jdbc
# cp -p ../mysql.bak/db.properties .
# cp -p ../mysql.bak/db.xml .
# cp -p ../mysql.bak/scripts.properties .
# cp -p ../mysql.bak/db.template.properties .
# vi db.properties
jdbcDriverClass=com.mysql.jdbc.Driver
maven.jdbc.groupId=mysql
maven.jdbc.artifactId=mysql-connector-java
maven.jdbc.version=5.1.47-bin
# cd ../../..
# pwd
~/jasperreports-server-cp-7.1.0-bin/buildomatic
# ./js-install-ce.sh


※????
# cp -p ./conf_source/db/mysql/db.xml .//build_conf/default/maven_settings.xml


【設定シェル】
# ダウンロードしたディレクトリで本shellを実行すると、
# /optにインストールする
#
export DWLDIR=`pwd`
export OPTDIR=/opt
export TOMDIR=/opt/tomcat
export BUIDIR=$OPTDIR/jasperreports-server-cp-7.1.0-bin/buildomatic
export MSQDIR=$BUIDIR/conf_source/db/mysql
export ASQDIR=$BUIDIR/conf_source/db/app-srv-jdbc-driver
cd $DWLDIR;tar xvzf mysql-connector-java-5.1.47.tar.gz
unzip $DWLDIR/TIB_js-jrs-cp_7.1.0_bin.zip -d $OPTDIR
cd $BUIDIR
cp $BUIDIR/sample_conf/mysql_master.properties $BUIDIR/default_master.properties
vi $BUIDIR/default_master.properties <<__EOF__ 2&>/dev/null
Go
########この内容を編集##############
appServerType = tomcat
appServerDir = /opt/tomcat
dbType=mysql
dbPort=3306
# js.dbName=jasperserver
# sugarcrm.dbName=sugarcrm
# foodmart.dbName=foodmart
js.dbName=jasperserver
sugarcrm.dbName=sugarcrm
foodmart.dbName=foodmart
dbHost=localhost
dbUsername=root
dbPassword=IWq%!d)DT5lt
##---------JDBC Driver ---------------
#jdbcDriverClass=com.mysql.cj.jdbc.Driver
jdbcDriverClass=com.mysql.jdbc.Driver
jdbcDataSourceClass=com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource
maven.jdbc.groupId=mysql_oracle
maven.jdbc.artifactId=mysql-connector-java
maven.jdbc.version=5.1.47-bin
########この内容を編集##############
  ←ESCコード(cntl+v esc)
ZZ
__EOF__
vi $BUIDIR/default_master.properties
set -xv
cp -rp $MSQDIR $MSQDIR.bak
rm -f $MSQDIR/jdbc/mariadb-java-client-1.6.3.jar
cp -p $DWLDIR/mysql-connector-java-5.1.47/mysql-connector-java-5.1.47-bin.jar $MSQDIR/jdbc
cp -p $DWLDIR/mysql-connector-java-5.1.47/mysql-connector-java-5.1.47-bin.jar $ASQDIR/jdbc
rm -rf $DWLDIR/mysql-connector-java-5.1.47
vi $MSQDIR/db.properties <<__EOF__ 2&>/dev/null
Go
########この内容を編集##############
jdbcDriverClass=com.mysql.jdbc.Driver
# jdbcDataSourceClass=org.mariadb.jdbc.MySQLDataSource
jdbcDataSourceClass=com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource
maven.jdbc.groupId=mysql_oracle
maven.jdbc.artifactId=mysql-connector-java
maven.jdbc.version=5.1.47-bin
########この内容を編集##############
  ←ESCコード(cntl+v esc)
ZZ
__EOF__
vi $MSQDIR/db.properties
pwd
cd $BUIDIR
pwd
rm $BUIDIR/conf_source/db/app-srv-jdbc-drivers/mariadb-java-client-1.6.3.jar
rm $BUIDIR/conf_source/ieCe/lib/mariadb-java-client-1.6.3.jar
./js-install-ce.sh
echo ----------------------FINISH-------------------
echo ------------------START TOMCAT -------------------
read
echo ------------------START COPY-------------------

cp -p $BUIDIR/build_conf/default/webapp/META-INF/context.xml $TOMDIR/webapps/jasperserver/META-INF/context.xml
cp -p $BUIDIR/build_conf/default/webapp/WEB-INF/hibernate.properties $TOMDIR/webapps/jasperserver/WEB-INF/hibernate.properties
cp -p $BUIDIR/build_conf/default/webapp/WEB-INF/js.quartz.properties $TOMDIR/webapps/jasperserver/WEB-INF/js.quartz.propertie
cp -p $BUIDIR/conf_source/db/mysql/jdbc/mysql-connector-java-5.1.47-bin.jar $TOMDIR/lib
echo tbeller.usejndi = false>$TOMDIR/webapps/jasperserver/WEB-INF/classes/resfactory.properties

chown tomcat:tomcat $TOMDIR/webapps/jasperserver/META-INF/context.xml $TOMDIR/webapps/jasperserver/WEB-INF/hibernate.properties $TOMDIR/webapps/jasperserver/WEB-INF/js.quartz.propertie $TOMDIR/lib/mysql-connector-java-5.1.47-bin.jar $TOMDIR/webapps/jasperserver/WEB-INF/classes/resfactory.properties
chmod go+rw $TOMDIR/webapps/jasperserver/WEB-INF/logs





2018年11月26日月曜日

CentOS7にJasperStudioインストール & 日本語化

■20210216追記
TIB_js-studiocomm_6.16.0_linux_x86_64.tgz

■コミュニティ版をダウンロード
https://community.jaspersoft.com/download
からJasperStudio 6.6をダウンロード

# tar xvzf TIB_js-studiocomm_6.6.0_linux_x86_64.tgz -C /opt
# cd /opt/TIB_js-studiocomm_6.6.0/dropins/eclipse/features/
# ls
org.eclipse.babel.nls_eclipse_it_4.2.0.v20130724060447

からベースeclipseバージョンを確認。

http://www.eclipse.org/babel/downloads.php

Other downloads
Developer and Nightly Buildscd 
Eclipse Babel Project Archived Downloads
Babel Server weekly mysqldump
Eclipse Platform R-3.5 English .properties files
Eclipse Platform R-3.4 English .properties files
Eclipse Platform R-3.3.1 English .properties files
Babel Language Pack Zips and Update Sites - R0.11.0 (2013/07/24)
Babel Language Pack Zips
Kepler | Juno | Indigo
Babel Language Pack Update Site for Kepler
http://archive.eclipse.org/technology/babel/update-site/R0.11.0/kepler
Ζipped p2 repository for Kepler (110 MB)
Babel Language Pack Update Site for Juno
http://archive.eclipse.org/technology/babel/update-site/R0.11.0/juno
Zipped p2 repository for Juno (144 MB)
Babel Language Pack Update Site for Indigo
http://archive.eclipse.org/technology/babel/update-site/R0.11.0/indigo
Zipped p2 repository for Indigo (138 MB)
Babel Orion Language Packs

言語:日本語
BabelLanguagePack-birt-ja_4.2.0.v20130724060447.zip(89.32%)
BabelLanguagePack-datatools-ja_4.2.0.v20130724060447.zip(91.53%)
BabelLanguagePack-eclipse-ja_4.2.0.v20130724060447.zip(95.65%)
言語パックを展開し、"features","plugins"を"doropins/babel"に配置

# mkdir /opt/BabelLanguagePack-eclipse-ja_4.2.0.v20130724060447
# unzip BabelLanguagePack-eclipse-ja_4.2.0.v20130724060447.zip -d   /opt/BabelLanguagePack-eclipse-ja_4.2.0.v20130724060447
# mkdir /opt/TIB_js-studiocomm_6.6.0/dropins/babel
# cd /opt/TIB_js-studiocomm_6.6.0/dropins/babel
# mv /opt/BabelLanguagePack-eclipse-ja_4.2.0.v20130724060447/eclipse/features .
# mv /opt/BabelLanguagePack-eclipse-ja_4.2.0.v20130724060447/eclipse/plugins .
# cd /opt
# ln -s "/opt/TIB_js-studiocomm_6.6.0/Jaspersoft Studio" jasperstudio
# ln -s /opt/jasperstudio /usr/local/bin/jasperstudio

これで、日本語化OK。

ついでにviプラグインをインストール
help->install new Software
http://vrapper.sourceforge.net/update-site/stable/


■プロジェクト作成&DataAdapter(DB)
1) file->new->project->JasperReports Project->testProject
2) testProject->new->Jasper Report->Blank_A4
3) testProject->new->Data Adaper->Database JDBC Connection
   adapterName
   MYSQL(com.mysql.jdbc.Driver)
   jdbc:mysql://localhost/database name
   root
   password
4) Driver Classpath
   /保存場所/mysql-connector-java-5.1.47-bin.jar
5) testで接続確認
6)outline->Blank_A4->Dataset and Query
   アダプタ名
   データベース/テーブル選択->select * from database.table名 join database.table2 using( field )->Read Fields
7) Blank_A4.jrxml選択->Text Field配置->Fields->field名
8)fx Variables->create Variable
   Name = sum
   Value Class Name = java.lang.Integer
   Calculation = Sum
   Expression = データベースフィールド名(sum対象)

■プロジェクト作成&DataAdapter(JSON)
1) file->new->project->JasperReports Project->Customers
2) Customers->new->Jasper Report->Blank_A4
     Data Adapter Language:jsonql
     Customers->new->Data Adapter->JSON File
     Customer_Rows/URL/Use the report JSON expression when filling the report



■サンプルDB
create database 伝票明細;
use 伝票明細
create table 伝票(
伝票番号 varchar(8) not null comment "伝票番号",
支払合計 int(10) not null comment "支払合計");

create table 商品情報(
伝票番号 varchar(8) not null comment "伝票番号",
商品コード varchar(16) not null comment "商品コード",
数量  varchar(24) not null comment "数量");

create table 支払情報(
伝票番号 varchar(8) not null comment "伝票番号",
金種 int(2) not null comment "金種",
支払金額 int(10) not null comment "支払金額");

create table 商品マスター(
商品コード varchar(16) not null comment "商品コード",
商品名 varchar(24) not null comment "商品名",
単価 int(10) not null comment "単価");

insert into 伝票
(伝票番号, 支払合計) values
(00000001,1000),
(00000002,1200),
(00000003,1600),
(00000004,1000);

insert into 支払情報
(伝票番号, 金種, 支払金額) values
(00000001, 1, 1000),
(00000002, 2, 2000),
(00000003, 3, 3000);

insert into 商品情報
(伝票番号, 商品コード, 数量 ) values
(00000001, 0000000000000200, 3),
(00000001, 0000000000000300, 4),
(00000002, 0000000000000300, 5),
(00000003, 0000000000000400, 6);

insert into 商品マスター
(商品コード,商品名,単価) values
(0000000000000100,"りんご",200),
(0000000000000200,"みかん",300),
(0000000000000300,"バナナ",400),
(0000000000000400,"すいか",500);

create view view_table( 伝票番号, 支払合計, 商品コード, 商品名, 単価, 数量, 定価, 金種, 支払金額, 値引額 )
as  select
       伝票.伝票番号 as 伝票番号,
       伝票.支払合計 as 支払合計,
       商品情報.商品コード as 商品コード,
       商品マスター.商品名 as 商品名,
       商品マスター.単価 as 単価,
       商品情報.数量 as 数量,
       単価 * 数量 as 定価,
       支払情報.金種 as 金種,
       支払情報.支払金額 as 支払金額,
       (単価 * 数量) - 支払情報.支払金額 as 値引額
     from 伝票
     join 商品情報 on (伝票.伝票番号=商品情報.伝票番号 )
left join 支払情報 on (伝票.伝票番号=支払情報.伝票番号 )
left join 商品マスター  on (商品情報.商品コード=商品マスター.商品コード);

select * from view_table;

select 伝票番号 , 支払合計, 商品情報.商品コード as 商品コード, 商品情報.数量 as 数量  from 伝票     join 商品情報 using( 伝票番号 ) where 伝票番号="1";


mysql> select column_name, column_comment from information_schema.columns where table_name='伝票';
+--------------+----------------+
| COLUMN_NAME  | COLUMN_COMMENT |
+--------------+----------------+
| 伝票番号     | 伝票番号       |
| 支払合計     | 支払合計       |
+--------------+----------------+
2 rows in set (0.00 sec)

----------------------------------------------

create database test;
use test
create table test.check(
id varchar(8) not null comment "伝票番号",
total int(10) not null comment "金額");

create table test.item_info(
id varchar(8) not null comment "伝票番号",
code varchar(16) not null comment "商品コード",
qty  varchar(24) not null comment "数量");

create table test.paid_info(
id varchar(8) not null comment "伝票番号",
kind int(2) not null comment "金種",
amt int(10) not null comment "金額");

create table test.plu_mast(
code varchar(16) not null comment "商品コード",
name varchar(24) not null comment "商品名",
price int(10) not null comment "金額");


insert into test.check
(id, total) values
(00000001,1000),
(00000002,1200),
(00000003,1600),
(00000004,1000);

insert into test.paid_info
(id, kind, amt) values
(00000001, 1, 1000),
(00000002, 2, 2000),
(00000003, 3, 3000);

insert into test.item_info
(id, code, qty ) values
(00000001, 0000000000000200, 3),
(00000001, 0000000000000300, 4),
(00000002, 0000000000000300, 5),
(00000003, 0000000000000400, 6);

insert into test.plu_mast
(code,name,price) values
(0000000000000100,"りんご",200),
(0000000000000200,"みかん",300),
(0000000000000300,"バナナ",400),
(0000000000000400,"すいか",500);

select id , total, item_info.code as code, item_info.qty as qty  from test.check     join test.item_info using( id ) where id="1";
             
select check.id as id,
       check.total as total,
       item_info.code as code,
       plu_mast.name as name,
       plu_mast.price as price,
       item_info.qty as qty,
       price * qty as teika,
       paid_info.kind as kind,
       paid_info.amt as shiharai,
       (price * qty) - paid_info.amt as nebiki
     from test.check   
     join test.item_info on (check.id=item_info.id )
left join test.paid_info on (check.id=paid_info.id )
left join test.plu_mast  on (item_info.code=plu_mast.code);

create view view_table( id, total, code, name, price, qty, teika, kind, shiharai, nebiki )
as  select check.id as id,
       check.total as total,
       item_info.code as code,
       plu_mast.name as name,
       plu_mast.price as price,
       item_info.qty as qty,
       price * qty as teika,
       paid_info.kind as kind,
       paid_info.amt as shiharai,
       (price * qty) - paid_info.amt as nebiki
     from test.check 
     join test.item_info on (check.id=item_info.id )
left join test.paid_info on (check.id=paid_info.id )
left join test.plu_mast  on (item_info.code=plu_mast.code);

select * from view_table;

■サンプル(見積書)

 <?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 6.6.0.final using JasperReports Library version 6.6.0  -->
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="Blank_A4" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="85bb76b2-9fca-429d-9818-4f3c94e4a537">
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="DataAdapter.xml"/>
<property name="com.jaspersoft.studio.data.sql.tables" value=""/>
<style name="Row" mode="Transparent">
<conditionalStyle>
<conditionExpression><![CDATA[$V{REPORT_COUNT}%2 == 0]]></conditionExpression>
<style backcolor="#E6DAC3"/>
</conditionalStyle>
</style>
<queryString>
<![CDATA[select * from  plumaster]]>
</queryString>
<field name="id" class="java.lang.Integer">
<property name="com.jaspersoft.studio.field.label" value="id"/>
<property name="com.jaspersoft.studio.field.tree.path" value="plumaster"/>
</field>
<field name="name" class="java.lang.String">
<property name="com.jaspersoft.studio.field.label" value="name"/>
<property name="com.jaspersoft.studio.field.tree.path" value="plumaster"/>
</field>
<field name="price" class="java.lang.Integer">
<property name="com.jaspersoft.studio.field.label" value="price"/>
<property name="com.jaspersoft.studio.field.tree.path" value="plumaster"/>
</field>
<variable name="sum" class="java.lang.Integer" calculation="Sum">
<variableExpression><![CDATA[$F{price}]]></variableExpression>
<initialValueExpression><![CDATA[0]]></initialValueExpression>
</variable>
<background>
<band splitType="Stretch"/>
</background>
<title>
<band height="230" splitType="Stretch">
<staticText>
<reportElement x="190" y="23" width="180" height="30" uuid="b8f34608-86ab-4e09-9fe8-0579fe524724"/>
<box>
<bottomPen lineWidth="1.0" lineColor="#CC9966"/>
</box>
<textElement textAlignment="Center">
<font size="22"/>
</textElement>
<text><![CDATA[御見積書]]></text>
</staticText>
<staticText>
<reportElement x="407" y="63" width="50" height="16" uuid="47f7a7cc-d80e-4409-ab28-80ea7d131a63"/>
<box>
<pen lineColor="#CC9966"/>
<topPen lineWidth="1.0"/>
<leftPen lineWidth="1.0"/>
<rightPen lineWidth="1.0"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="8"/>
</textElement>
<text><![CDATA[見積書番号]]></text>
</staticText>
<staticText>
<reportElement x="407" y="79" width="50" height="16" uuid="e9c62715-f5b2-46ce-9c21-426dd8832be9"/>
<box>
<pen lineColor="#CC9966"/>
<topPen lineWidth="1.0"/>
<leftPen lineWidth="1.0"/>
<bottomPen lineWidth="1.0"/>
<rightPen lineWidth="1.0"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="8"/>
</textElement>
<text><![CDATA[見積書日]]></text>
</staticText>
<staticText>
<reportElement x="457" y="79" width="94" height="16" uuid="249cf104-b7b1-4f3f-b948-e7e0c35b6829"/>
<box>
<pen lineColor="#CC9966"/>
<topPen lineWidth="1.0"/>
<leftPen lineWidth="1.0"/>
<bottomPen lineWidth="1.0"/>
<rightPen lineWidth="1.0"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="8"/>
</textElement>
<text><![CDATA[2018年12月6日]]></text>
</staticText>
<staticText>
<reportElement x="457" y="63" width="94" height="16" uuid="b7c76a46-2bcb-4c06-849f-0f509b0905e2"/>
<box>
<pen lineColor="#CC9966"/>
<topPen lineWidth="1.0"/>
<leftPen lineWidth="1.0"/>
<rightPen lineWidth="1.0"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="8"/>
</textElement>
<text><![CDATA[No.1234567890]]></text>
</staticText>
<staticText>
<reportElement x="406" y="140" width="146" height="16" uuid="bf7ce692-b2ce-4457-b099-464bd5cf2fe4"/>
<box>
<pen lineColor="#CC9966"/>
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textElement textAlignment="Left" verticalAlignment="Middle">
<font size="10"/>
</textElement>
<text><![CDATA[東京都渋谷区初台1ー46ー3]]></text>
</staticText>
<staticText>
<reportElement x="406" y="123" width="50" height="16" uuid="debe3ab5-6415-4bff-885d-b0b685bb8847"/>
<box>
<pen lineColor="#CC9966"/>
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textElement textAlignment="Left" verticalAlignment="Bottom">
<font size="9"/>
</textElement>
<text><![CDATA[〒151-0061]]></text>
</staticText>
<staticText>
<reportElement x="406" y="156" width="146" height="16" uuid="8f8540dd-2b07-47a7-9496-e87b95ff323b"/>
<box>
<pen lineColor="#CC9966"/>
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textElement textAlignment="Left" verticalAlignment="Middle">
<font size="10"/>
</textElement>
<text><![CDATA[シモモトビル10F]]></text>
</staticText>
<staticText>
<reportElement x="406" y="173" width="146" height="16" uuid="3c8a4b03-9479-494b-82fd-4d0bb4e335a3"/>
<box>
<pen lineColor="#CC9966"/>
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textElement textAlignment="Left" verticalAlignment="Middle">
<font size="8"/>
</textElement>
<text><![CDATA[TEL 03-5302-3760 FAX 03-5371-1592]]></text>
</staticText>
<staticText>
<reportElement x="406" y="107" width="124" height="16" uuid="f3be2acc-5696-4fa7-b4bb-5ee494928700"/>
<box>
<pen lineColor="#CC9966"/>
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textElement textAlignment="Left" verticalAlignment="Middle">
<font size="10"/>
</textElement>
<text><![CDATA[株式会社 CXDネクスト]]></text>
</staticText>
<staticText>
<reportElement x="0" y="37" width="70" height="16" uuid="1d54e096-dc80-40b7-9aa1-2df5f1670a08"/>
<box>
<pen lineColor="#CC9966"/>
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textElement textAlignment="Left" verticalAlignment="Middle">
<font size="12"/>
</textElement>
<text><![CDATA[〒151-0061]]></text>
</staticText>
<staticText>
<reportElement x="0" y="54" width="146" height="16" uuid="fdfc9959-2806-4681-a127-ff116a2a712b"/>
<box>
<pen lineColor="#CC9966"/>
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textElement textAlignment="Left" verticalAlignment="Middle">
<font size="12"/>
</textElement>
<text><![CDATA[東京都渋谷区初台1ー46ー3]]></text>
</staticText>
<staticText>
<reportElement x="0" y="72" width="146" height="16" uuid="e7fd1187-7f25-43a5-99bc-78ddac2be130"/>
<box>
<pen lineColor="#CC9966"/>
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textElement textAlignment="Left" verticalAlignment="Middle">
<font size="12"/>
</textElement>
<text><![CDATA[シモモトビル10F]]></text>
</staticText>
<staticText>
<reportElement x="0" y="89" width="145" height="20" uuid="8c481223-65bd-44f7-9861-1157e3047e1f"/>
<box>
<pen lineColor="#CC9966"/>
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textElement textAlignment="Left" verticalAlignment="Middle">
<font size="14"/>
</textElement>
<text><![CDATA[株式会社 CXDネクスト]]></text>
</staticText>
<staticText>
<reportElement x="148" y="93" width="60" height="16" uuid="89f27720-0b96-4de1-9364-942733838c6c"/>
<box>
<pen lineColor="#CC9966"/>
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textElement textAlignment="Left" verticalAlignment="Middle">
<font size="12"/>
</textElement>
<text><![CDATA[御中]]></text>
</staticText>
<staticText>
<reportElement x="1" y="132" width="230" height="16" uuid="73642428-67dc-4ddf-9c63-8dc0872356d8"/>
<box>
<pen lineColor="#CC9966"/>
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textElement textAlignment="Left" verticalAlignment="Middle">
<font size="12"/>
</textElement>
<text><![CDATA[下記のとおり、御見積申し上げます。]]></text>
</staticText>
</band>
</title>
<pageHeader>
<band height="29" splitType="Stretch">
<staticText>
<reportElement x="0" y="-74" width="80" height="18" uuid="badfce99-c78e-4a4b-a6b1-ff3952d8e4eb"/>
<box>
<pen lineColor="#CC9966"/>
<topPen lineWidth="1.0"/>
<leftPen lineWidth="1.0"/>
<rightPen lineWidth="1.0"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="12"/>
</textElement>
<text><![CDATA[合計金額]]></text>
</staticText>
<textField>
<reportElement x="80" y="-74" width="120" height="18" uuid="ce31f9b6-b555-42e5-988a-2ed7d7e0d993"/>
<box>
<pen lineColor="#CC9966"/>
<topPen lineWidth="1.0" lineStyle="Solid" lineColor="#CC9966"/>
<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#CC9966"/>
</box>
<textElement textAlignment="Right" verticalAlignment="Middle">
<font size="14"/>
</textElement>
<textFieldExpression><![CDATA[$V{sum}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="0" y="-55" width="80" height="18" uuid="c930972f-6756-4e27-ba40-97363aff3113"/>
<box>
<pen lineColor="#CC9966"/>
<topPen lineWidth="1.0"/>
<leftPen lineWidth="1.0"/>
<bottomPen lineWidth="1.0"/>
<rightPen lineWidth="1.0"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="12"/>
</textElement>
<text><![CDATA[支払条件]]></text>
</staticText>
<staticText>
<reportElement x="0" y="-37" width="80" height="18" uuid="fcf2d64d-b38a-4417-bb2f-99c05548055b"/>
<box>
<pen lineColor="#CC9966"/>
<leftPen lineWidth="1.0"/>
<bottomPen lineWidth="1.0"/>
<rightPen lineWidth="1.0"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="12"/>
</textElement>
<text><![CDATA[有効期間]]></text>
</staticText>
<staticText>
<reportElement x="80" y="-55" width="120" height="18" uuid="d746403a-7c12-4ad2-b58d-6dda5a167e20"/>
<box>
<pen lineColor="#CC9966"/>
<topPen lineWidth="1.0"/>
<leftPen lineWidth="1.0"/>
<rightPen lineWidth="1.0"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="12"/>
</textElement>
<text><![CDATA[月末締め翌月末払い]]></text>
</staticText>
<staticText>
<reportElement x="80" y="-37" width="120" height="18" uuid="63894a47-08ef-4793-aa70-e9707ede3606"/>
<box>
<pen lineColor="#CC9966"/>
<topPen lineWidth="1.0"/>
<leftPen lineWidth="1.0"/>
<bottomPen lineWidth="1.0"/>
<rightPen lineWidth="1.0"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="12"/>
</textElement>
<text><![CDATA[見積後一ヶ月]]></text>
</staticText>
</band>
</pageHeader>
<columnHeader>
<band height="16" splitType="Stretch">
<staticText>
<reportElement x="0" y="0" width="100" height="16" uuid="06e096d3-211d-4499-a52d-ac730ed416d0"/>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[番号]]></text>
</staticText>
<staticText>
<reportElement x="100" y="0" width="130" height="16" uuid="8903f234-cbcb-42b8-9d33-9393d44c12bc"/>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[商品コード]]></text>
</staticText>
<staticText>
<reportElement x="231" y="0" width="130" height="16" uuid="712e15fa-ebcc-4ca6-8a7c-3cfa9eb7e10e"/>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[商品名]]></text>
</staticText>
<staticText>
<reportElement x="360" y="0" width="170" height="16" uuid="9e92e40a-5d0b-40a3-b231-b109ad6e22f7"/>
<textElement textAlignment="Right" verticalAlignment="Middle"/>
<text><![CDATA[金額]]></text>
</staticText>
</band>
</columnHeader>
<detail>
<band height="20" splitType="Stretch">
<frame>
<reportElement style="Row" mode="Opaque" x="0" y="0" width="550" height="20" uuid="fa7cec56-4ec1-48e6-a26e-7266a995d174"/>
<box>
<pen lineColor="#CC9966"/>
<topPen lineWidth="1.0"/>
<bottomPen lineWidth="1.0"/>
</box>
</frame>
<textField>
<reportElement x="0" y="0" width="100" height="16" uuid="b2ca6b23-5bd6-44b6-b8a1-424e3d9ab122"/>
<box>
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<textFieldExpression><![CDATA[$V{REPORT_COUNT}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="100" y="0" width="130" height="16" uuid="5d2b0aee-6d36-4ccb-845c-4da19e2b9a43"/>
<box>
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<textFieldExpression><![CDATA[$F{id}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="230" y="0" width="130" height="16" uuid="b6301163-1d67-423b-bf88-5ff7b521493d"/>
<box>
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<textFieldExpression><![CDATA[$F{name}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="360" y="0" width="170" height="16" uuid="b383cbaa-67f0-40e8-b5e5-d0085700866e"/>
<box>
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textElement textAlignment="Right" verticalAlignment="Middle"/>
<textFieldExpression><![CDATA[$F{price}]]></textFieldExpression>
</textField>
</band>
</detail>
<columnFooter>
<band height="45" splitType="Stretch"/>
</columnFooter>
<pageFooter>
<band height="54" splitType="Stretch">
<textField pattern="#,##0.###円">
<reportElement x="440" y="0" width="90" height="30" uuid="180a0589-e4b1-493c-b7ae-71f4a575fef5"/>
<box>
<pen lineColor="#CC9966"/>
<bottomPen lineWidth="1.0"/>
</box>
<textElement textAlignment="Right" verticalAlignment="Middle">
<font size="18"/>
</textElement>
<textFieldExpression><![CDATA[$V{sum}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="360" y="1" width="80" height="29" uuid="f5a8dbb2-f468-4ad6-ae60-230936f9780e"/>
<box>
<pen lineColor="#CC9966"/>
<bottomPen lineWidth="1.0"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="18"/>
</textElement>
<text><![CDATA[累計]]></text>
</staticText>
</band>
</pageFooter>
<summary>
<band height="42" splitType="Stretch"/>
</summary>
</jasperReport>

 

   

2018年11月20日火曜日

VMware動かない。 Could not open /dev/vmmon

Could not open /dev/vmmon: ??????????????????????.
Please make sure that the kernel module `vmmon' is loaded.

# vmware-modconfig --console --build-mod vmmon
# vmware-modconfig --console --build-mod vmnet
# vmware-modconfig --console --build-mod vmci

# modprobe vmmon
# modprobe vmnet
# modprobe vmci
# service vmware restart

# modprobe vmmon
modprobe: ERROR: could not insert 'vmmon': Required key not available
# modprobe vmnet
modprobe: ERROR: could not insert 'vmnet': Required key not available
# modprobe vmci
modprobe: FATAL: Module vmci not found.
#
エラー発生。
Secure Boot keysをclearする。
BIOS
Secure Boot Configuration
Confiure Legacy Support and Secure Boot Legacy Support Enable and Secure Boot Disable
Secure Boot Key Management
□Import Custom sercure Boot keys
■Clear Secure Boot keys
□Reset Secure Boot keys to factory defaults
□Enable MS UEFI CA key









2018年10月12日金曜日

CentOS7 にChromeをインストール

# vi /etc/yum.repos.d/google-chrome.repo
[google-chrome]
name=google-chrome
baseurl=http://dl.google.com/linux/chrome/rpm/stable/x86_64
enabled=1
gpgcheck=1
gpgkey=https://dl.google.com/linux/linux_signing_key.pub

# yum update
# yum install google-chrome-stable

2018年10月11日木曜日

CentOS7 にmysql8をインストール

CentOS7にバンドルされているmariaDBとデータを削除。# yum remove mariadb-libs
# rm -rf /var/lib/mysql/

https://dev.mysql.com/downloads/repo/yum/

Red Hat Enterprise Linux 7 / Oracle Linux 7 (Architecture Independent), RPM Package
のダウンロードからリンクアドレスをコピー。(No thanks,just start my download)

# rpm -ivh https://dev.mysql.com/get/mysql80-community-release-el7-1.noarch.rpm
# yum install mysql-community-devel
# yum install mysql-community-server
# yum install  mysql-community-client
# vi /etc/my.cnf
(追加)
log_timestamps=SYSTEM
skip-character-set-client-handshake
character-set-server=utf8mb4
explicit_defaults_for_timestamp=ON
#
# systemctl start mysqld
# systemctl enable mysqld

# mysql
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
# 次のコマンドで仮パスワードを検索して入力する。
# cat /var/log/mysqld.log | grep 'password is generated'
新しいパスワードに更新。
mysql -u root -p
初期パスワードを入力
mysql> set password= 'xxxxxxxxx';


CentOS7 safeモードで起動してパスワードをリセット
# systemctl stop mysqld
# systemctl set-environment MYSQLD_OPTS="--skip-grant-tables"
# systemctl start mysqld
# mysql -u root
mysql> use mysql
mysql> UPDATE mysql.user SET authentication_string=null WHERE User='root';
mysql> flush privileges;
# systemctl stop mysqld
# systemctl unset-environment MYSQLD_OPTS
# systemctl start mysqld
# mysql_upgrade -u root -p                 
# mysql -u root
mysql>ALTER USER 'root'@'localhost' IDENTIFIED BY 'password';
mysql> flush privileges;

※ upgradeしないと下記エラーがでる。
ERROR 1146 (42S02): Table 'mysql.role_edges' doesn't exist

■user追加( mysql_native_password で追加)
mysql> use mysql
mysql>  create user 'admin' identified with mysql_native_password by "No%3177%";
Query OK, 0 rows affected (0.03 sec)
mysql> grant all on *.* to admin with grant option;
Query OK, 0 rows affected (0.09 sec)
mysql> flush privileges;
mysql> select user, host, plugin from user;
+------------------+-----------+-----------------------+
| user             | host      | plugin                |
+------------------+-----------+-----------------------+
| admin            | %         | mysql_native_password |
| mysql.infoschema | localhost | caching_sha2_password |
| mysql.session    | localhost | caching_sha2_password |
| mysql.sys        | localhost | caching_sha2_password |
| root             | localhost | caching_sha2_password |
+------------------+-----------+-----------------------+
6 rows in set (0.00 sec)

ユーザ削除
mysql> drop user 'admin';

■テストデータ作成
mysql> create database testDB;
Query OK, 1 row affected (0.17 sec)

mysql> create table testDB.mst001(
    -> id INT AUTO_INCREMENT NOT NULL PRIMARY KEY,
    ->     title VARCHAR(50),
    ->     content TEXT,
    ->     created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
    -> );
Query OK, 0 rows affected (0.70 sec)

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| sys                |
| testDB             |
+--------------------+
5 rows in set (0.01 sec)

mysql> describe testDB.mst001;
+------------+-------------+------+-----+-------------------+-------------------+
| Field      | Type        | Null | Key | Default           | Extra             |
+------------+-------------+------+-----+-------------------+-------------------+
| id         | int(11)     | NO   | PRI | NULL              | auto_increment    |
| title      | varchar(50) | YES  |     | NULL              |                   |
| content    | text        | YES  |     | NULL              |                   |
| created_at | timestamp   | NO   |     | CURRENT_TIMESTAMP | DEFAULT_GENERATED |
+------------+-------------+------+-----+-------------------+-------------------+
4 rows in set (0.01 sec)

mysql> use testDB;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> show tables;
+------------------+
| Tables_in_testDB |
+------------------+
| mst001           |
+------------------+
1 row in set (0.00 sec)



mysql>insert into testDB.mst001 values(1,'title01','cont01',20181126);
mysql>insert into testDB.mst001 values(2,'title02','cont02',20181126);
mysql> select * from mst001;
+----+---------+---------+---------------------+
| id | title   | content | created_at          |
+----+---------+---------+---------------------+
|  1 | title01 | cont01  | 2018-11-26 00:00:00 |
|  2 | title02 | cont02  | 2018-11-26 00:00:00 |
+----+---------+---------+---------------------+
2 rows in set (0.00 sec)

mysql> delete from testDB.mst001 where id=1;
Query OK, 1 row affected (0.15 sec)

mysql> select * from mst001;
+----+---------+---------+---------------------+
| id | title   | content | created_at          |
+----+---------+---------+---------------------+
|  2 | title02 | cont02  | 2018-11-26 00:00:00 |
+----+---------+---------+---------------------+
1 row in set (0.00 sec)

mysql>create database temp;
mysql>use temp;
mysql>create table g ( code int, goods varchar(16), price int );
mysql>create table t (id int, code int, qty int);
mysql>insert into g value(1,"りんご",150), (2,"みかん",50),(3,"ぶどう",500);
mysql>insert into t value(1, 1,10),(1, 2,15),(2, 3,18);
mysql>create view  v as select id, code, goods, qty, price, qty*price as amt from t inner join g using(code) where t.id=1;
mysql>select * from g;
mysql>select * from t;
mysql>select * from v;
mysql>drop view v;
mysql>drop table g, t;
mysql>drop database temp;







2018年8月31日金曜日

CentOS7のcron

CentOS7は、デフォルトでanacronが入っている。


# vi /etc/crontab
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
# For details see man 4 crontabs
# Example of job definition:
# .---------------- minute (0 - 59)
# |  .------------- hour (0 - 23)
# |  |  .---------- day of month (1 - 31)
# |  |  |  .------- month (1 - 12) OR jan,feb,mar,apr ...
# |  |  |  |  .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
# |  |  |  |  |
# *  *  *  *  * user-name  command to be executed


# vi /etc/anacrontab
# /etc/anacrontab: configuration file for anacron
# See anacron(8) and anacrontab(5) for details.
SHELL=/bin/sh
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
# the maximal random delay added to the base delay of the jobs
RANDOM_DELAY=45
# the jobs will be started during the following hours only
START_HOURS_RANGE=3-22
#period in days   delay in minutes   job-identifier   command
1       5       cron.daily              nice run-parts /etc/cron.daily
7       25      cron.weekly             nice run-parts /etc/cron.weekly
@monthly 45     cron.monthly            nice run-parts /etc/cron.monthly


【noanacrontabに入れ替える。】

# yum -y install cronie-noanacron
# yum -y remove cronie-anacron

【ユーザ毎】
$ crontab -e
00 * * * * /home/aws/aws.sh

/var/spool/cron下にユーザ名毎に作られる。


【システム初期設定】
# cat /etc/cron.d/dailyjobs
# Run the daily, weekly, and monthly jobs if cronie-anacron is not installed
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root

# run-parts
02 4 * * * root [ ! -f /etc/cron.hourly/0anacron ] && run-parts /etc/cron.daily
22 4 * * 0 root [ ! -f /etc/cron.hourly/0anacron ] && run-parts /etc/cron.weekly
42 4 1 * * root [ ! -f /etc/cron.hourly/0anacron ] && run-parts /etc/cron.monthly
[root@buffy3 ~]#

# systemctl restart crond
確認
# less /var/log/cron


ユーザ単位であれば、
$ crontab -e
05 * * * * /home/aws/aws/app/s3daily.sh
cronの再起動不要。







pythonのインストール

python Ver3.6をインストール
# yum install python36 python36-libs python36-devel
# python36 -m ensurepip # pip を使えるようにする。
【VENV仮想環境の構築】
# cd /usr/local
# python36 -m venv venv36
# chmod -R a+w venv36 ※インストールFIX後戻す。chmod -R go-w vnen36
$ source /usr/local/venv36/bin/activate

※下記環境がセットされる。
VIRTUAL_ENV=/usr/local/venv/venv36
PATH=/usr/local/venv/venv36/bin:$PATH
deactivate () {}

【PATHの確認】$ python36 -c "import sys; print(sys.path)"
['', '/usr/lib64/python36.zip', '/usr/lib64/python3.6', '/usr/lib64/python3.6/lib-dynload', '/usr/local/venv36/lib64/python3.6/site-packages', '/usr/local/venv36/lib/python3.6/site-packages']

※pipインストール確認
$ pip3 install --upgrade pip
$ pip3 install --upgrade pip --proxy=http://192.168.1.254:3128
$ pip3 list
$ pip3 list --outdated
$ pip3 list --outdated | awk 'NR>2 {print $1}' | xargs pip3 install -U
$ pip3 freeze>requirements.txt
$ pip3 install -r requirements.txt

【proxy下】
$ pip3 install --upgrade pip --proxy=http://user:pwss@192.168.25.254:3128


※エラー発生
'missing Apache httpd server packages.' % APXS)
RuntimeError: The 'apxs' command appears not to be installed or is not executable. Please check the list of prerequisites in the documentation for this package and install any missing Apache httpd server packages.
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-zxt5kngl/mod-wsgi/

# yum -y install httpd-devel で解決。

【プロキシ経由でインストール】
pip3  --proxy=http://192.168.x.xxx:3128  install python-dateutil

【Djangoのインストール】
$ pip3 install Django
$ ls -l /usr/local/venv/venv36/lib/python3.6/site-packages/django   # 確認


【excelの読み書き】
# python36 -m pip install openpyxl   # excelの読み書きを使えるようにする。

【oracleと接続】

# python36 -m pip install cx_oracle

ここから該当バージョンのドライバをタウンロード
https://www.oracle.com/technetwork/jp/database/features/instant-client/index-352321-ja.html
instantclient-basic-linux.x64-11.2.0.4.0.zip

# cd /opt/libs
# unzip instantclient-basic-linux.x64-11.2.0.4.0.zip
# ln -s /opt/libs/instantclient_11_2 /opt/libs/oracle

# vi /etc/profile.d/oracle.sh
export LD_LIBRARY_PATH=/opt/libs/oracle:$LD_LIBRARY_PATH
# . /etc/profile
# vi /etc/sysconfig/httpd
LD_LIBRARY_PATH=/opt/libs/oracle:$LD_LIBRARY_PATH

# vi /etc/ld.so.conf.d/oracle.conf
/opt/libs/oracle
# ldconfig
# ldconfig  -p |grep libclntsh

【確認】
$ python36
>>> import cx_Oracle
>>> cx_Oracle.clientversion()
(11, 2, 0, 4, 0)


いつも上手く行くのになぜかエラー
cx_Oracle.DatabaseError: DPI-1047: Cannot locate a 64-bit Oracle Client library: "/opt/libs/oracle/lib/libclntsh.so: cannot open shared object file: No such file or directory". 

# vi /etc/ld.so.conf.d/oracle.conf
/opt/libs/oracle
# ldconfig
# ldconfig  -p |grep libclntsh

# dnf install libnsl
# python3
> import ctypes
> ctypes.cdll.LoadLibrary('/opt/libs/oracle/libclntsh.so.11.1')
→動いた!!

なぜ? いつもは不要なのに!!

# python36 -m pip install --upgrade pip
# python36 -m pip list
Package    Version
---------- -------
cx-Oracle  7.0.0
et-xmlfile 1.0.1
jdcal      1.4 
openpyxl   2.5.12
pip        18.1 
setuptools 39.0.1 


※python Ver2と共存可能。
# python test.py
# python36 test.py

【例1】
# vi excel.py
#!/usr/bin/env python
import openpyxl as excel
wb = excel.Workbook()
ws = wb.active
ws["A1"] = "こんにちは"
wb.save("hello.xlsx")
print("save end")

【例2】
#!/usr/bin/env python
import cx_Oracle

HOST='192.168.xx.xxx'
PORT = '1521'
SID = 'xxxxxxxx'

tns = cx_Oracle.makedsn(HOST, PORT, SID)
conn = cx_Oracle.connect("userID", "password", tns)

print ( conn.version)
cur = conn.cursor()
print ( conn.version)

#cur.execute("""SELECT INSTANCE_NAME,HOST_NAME FROM v$instance""")

#rows = cur.fetchall()

#for r in rows:
#    print("%d : %s" % (r[0], r[1]))


【例3】
# vi test.py
#!/usr/bin/env python
import os
import sys
import glob
import shutil
import datetime
import smtplib
from email.mime.text import MIMEText
from email.utils import formatdate

down_dir = sys.argv[1]
data_dir = sys.argv[2]
store_dir = sys.argv[3]
office_dir = sys.argv[4]
time_report = sys.argv[5]

FROM_ADDRESS = 'xxxxx@xxxx.xx.xx'
MY_PASSWORD = 'yyyyy'
TO_ADDRESS = 'zzzz@zzzzzz.zz.zz'
BCC = 'xxxxx@xxxxxx.xx.xxp'
SUBJECT = 'title'
BODY = 'body'

def create_message(from_addr, to_addr, bcc_addrs, subject, body):
  msg = MIMEText(body)
  msg['Subject'] = subject
  msg['From'] = from_addr
  msg['To'] = to_addr
  msg['Bcc'] = bcc_addrs
  msg['Date'] = formatdate()
  return msg

def send(from_addr, to_addrs, msg):
  smtpobj = smtplib.SMTP('localhost', 25)
  smtpobj.ehlo()
# smtpobj.starttls()
  smtpobj.ehlo()
# smtpobj.login(FROM_ADDRESS, MY_PASSWORD)
  smtpobj.sendmail(from_addr, to_addrs, msg.as_string())
  smtpobj.close()
def maillog(subject , body):
  msg = create_message(FROM_ADDRESS, TO_ADDRESS, BCC, subject, body)
  send(FROM_ADDRESS, TO_ADDRESS, msg)

def utf2sjis( src, dst ):
  with open( dst, 'w', encoding='cp932') as fout:
  with open( src , encoding='utf-8') as fin:
  fout.write(fin.read())


for download_dir, dirs, files in os.walk(down_dir):
  num = len(files)
  maillog( "START Credit daily process %d files downloaded(%s)" % ( num, time_report) , "%8d files downloaded to %-30s(Execution time:%s)" % (num, download_dir, time_report ))

for name in glob.glob( download_dir+"/*" ):
bname = os.path.basename( name )
  start = bname.find( "SERCHCHARACTER_" ) + len( "SERCHCHARACTER_" )
  year = bname[ start : start + 4 ]
  month = bname[ start + 4 : start + 6 ]
  day = bname[ start + 6 : start + 8 ]
  if int(day) < 16:
    term = "A"
    else:
    term = "B"
    folder= data_dir + "/" + year + month + term
    dname = folder + "/" + bname
    sname = store_dir + "/" + bname
    oname = office_dir + "/" + bname
    if os.path.exists( folder ):
      if os.path.exists( dname ):
        shutil.move( dname, dname + ".dup" + datetime.datetime.now().strftime("%Y%m%d%H%M%S.%f"))
        maillog( "WARNING File Duplicate %s" % bname, "%s is allready exist.(data)" % dname )
     else:
       os.mkdir( folder )
     shutil.move( name, folder )
  if os.path.exists( sname ):
     shutil.move( sname, sname + ".dup" + datetime.datetime.now().strftime("%Y%m%d%H%M%S.%f"))
     maillog( "WARNING File Duplicate %s" % bname, "%s is allready exist.(ToSend1)" % sname )
  if os.path.exists( oname ):
    shutil.move( oname, oname + ".dup" + datetime.datetime.now().strftime("%Y%m%d%H%M%S.%f"))
    maillog( "WARNING File Duplicate %s" % bname, "%s is allready exist.(ToSend2)" % oname )

  utf2sjis( dname, oname )
  shutil.copy( oname, sname )


#today = datetime.date.today().day
#yesterday = datetime.datetime.now() - datetime.timedelta(days=1)
#
#if today == 1 or today == 16:
#
# if today == 16:
# term = "A"
# else:
# term = "B"
#
# term_folder = yesterday.strftime( "%Y%m" ) + term
#
# office_folder = office_dir + "/" + term_folder
#
# if os.path.exists( office_folder ):
# shutil.move( office_folder, office_folder + ".dup" + datetime.datetime.now().strftime("%Y%m%d%H%M%S.%f"))
# maillog( 'WARNING File Duplicate', "%s is allready exist.(ToSend2)" % office_folder )
#
# shutil.copytree( data_dir + "/" + term_folder, office_folder )

2018年7月13日金曜日

CentOS7 libreoffice インストール

まず、現行バージョンを消す。

# yum remove libreoffice*

ここからダウンロード
https://ja.libreoffice.org/download/libreoffice/


# tar xvzf LibreOffice_6.0.5_Linux_x86-64_rpm.tar.gz
# cd LibreOffice_6.0.5.2_Linux_x86-64_rpm/RPMS
# rpm -Uvh *.rpm


# tar xvzf LibreOffice_6.0.5_Linux_x86-64_rpm_langpack_ja.tar.gz
# cd LibreOffice_6.0.5.2_Linux_x86-64_rpm_langpack_ja/RPMS
# ls -l
合計 796
-rw-r--r--. 1 root root 802623  6月 20 17:07 libobasis6.0-ja-6.0.5.2-2.x86_64.rpm
-rw-r--r--. 1 root root   9117  6月 20 17:07 libreoffice6.0-ja-6.0.5.2-2.x86_64.rpm
# rpm -Uvh *.rpm


2020/08/04 追記

CentOS8 にインストール
CentOS Linux release 8.2.2004 (Core)

https://ja.libreoffice.org/download/download/

Supplementary Downloads:
日本語パッケージ:  翻訳されたユーザーインターフェース: 日本語 (Torrent, 情報)

# tar xvzf  LibreOffice_6.4.5_Linux_x86-64_rpm.tar.gz
# cd LibreOffice_6.4.5.2_Linux_x86-64_rpm/RPMS
#  dnf install *.rpm

# tar xvzf LibreOffice_6.4.5_Linux_x86-64_rpm_langpack_ja.tar.gz
# cd LibreOffice_6.4.5.2_Linux_x86-64_rpm_langpack_ja/RPMS
# dnf install *.rpm

シャットダウン時の後処理 (shutdown)

# vi /etc/systemd/system/drop.service [Unit] Description= stop httpgwd DefaultDependencies=no Before=shutdown.target RefuseManualStart=true ...