app-emulation/wine-cellar-20110816
[anomen-overlay.git] / app-office / winstrom / winstrom-10.7.7.ebuild
blob86430cd70a6edbb888883149e78240f32b6f2b3a
1 # Copyright 1999-2009 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: $
5 inherit eutils font java-pkg-2
7 DESCRIPTION="Czech Economic System."
8 SRC_URI="http://www.winstrom.cz/download/${PV%.*}/${P}.tar.gz"
9 HOMEPAGE="http://www.winstrom.cz/"
10 LICENSE="WinStorm"
11 SLOT="0"
12 KEYWORDS="x86 ~amd64"
13 IUSE="logrotate server"
14 RESTRICT="nomirror"
16 DEPEND="|| (
17 >=virtual/jre-1.6
18 >=virtual/jdk-1.6
20 RDEPEND="server? ( >=virtual/postgresql-server-8.3 )
21 logrotate? ( app-admin/logrotate )"
22 # not all packages available so use the included
23 # >=dev-java/jdbc-postgresql-8.3_p603
24 # >=dev-java/antlr-2.7.6
25 # >=dev-java/apple-java-extensions-bin-1.2
26 # =dev-java/asm-1.5.3
27 # >=dev-java/bcprov-1.36
28 # >=dev-java/jgoodies-binding-1.1.1
29 # =dev-java/cglib-2.1.3
30 # >=dev-java/commons-beanutils-1.7.0
31 # >=dev-java/commons-codec-1.3
32 # dev-java/commons-collections
33 # >=dev-java/commons-digester-1.7
34 # >=dev-java/commons-httpclient-3.1
35 # >=dev-java/commons-logging-1.0.4
36 # >=dev-java/dom4j-1.6.1
37 # >=dev-java/ehcache-1.2.3
38 # >=dev-java/hibernate-3.2.3
39 # >=dev-java/hibernate-annotations-3.2.1
40 # >=dev-java/itext-1.3.1
41 # >=app-text/jasperreports-1.3.3
42 # >=dev-java/javahelp-2.0.02
43 # >=dev-java/jcommon-1.0.2
44 # >=dev-java/jta-1.0.1
45 # >=dev-java/junit-3.8.1
46 # >=dev-java/log4j-1.2.12
47 # >=dev-java/sun-javamail-1.4
48 # >=dev-java/glassfish-persistence-1.0
49 # >=dev-java/poi-3.1
50 # >=dev-java/swing-layout-1.0.2
51 # >=dev-java/swingx-0.9.3
52 # >=dev-java/xstream-1.2.2
53 # >=dev-java/c3p0-0.9.1
54 # >=dev-util/eclipse-sdk-3.1.0" # jdtcore
56 S="${WORKDIR}/${P}"
57 LANGS="cs en sk"
59 pkg_setup() {
60 # user under which the winstrom server is running
61 enewuser winstrom 120 -1 /tmp nobody
64 src_unpack() {
65 # convert deb to tar.gz and unpack it
66 unpack ${A}
68 # change the postgres port
69 sed -i 's/5435/5432/' ${S}/etc/winstrom/winstrom-server.xml || die
71 # move winstrom jars into the temp dir, delete the rest and move it back
72 # cd ${S}/usr/share/${PN}/lib
73 # mkdir tmp
74 # mv ./winstrom-* ./softeu-* ./tmp
75 # rm -f *.jar
76 # mv ./tmp/*.jar ./
78 # link all system libraries
79 # java-pkg_jar-from eclipse-ecj-3.1
80 # ...
83 src_compile() {
87 src_install() {
89 if use server; then
90 # configuration
91 insinto /etc/${PN}
92 doins etc/${PN}/winstrom-server.xml
93 fowners winstrom:root /etc/${PN}/winstrom-server.xml
94 fperms 600 /etc/${PN}/winstrom-server.xml
96 # config script
97 newconfd ${FILESDIR}/${PN}-server.conf ${PN}-server
99 # init script
100 newinitd ${FILESDIR}/${PN}-server.init ${PN}-server
103 # logrotate script
104 if use logrotate ; then
105 insinto /etc/logrotate.d
106 doins etc/logrotate.d/${PN}
109 # splash screen
110 insinto /usr/share/${PN}
111 doins usr/share/${PN}/${PN}-logo-small.png
112 doins usr/share/${PN}/${PN}-splash.png
114 # libraries
115 java-pkg_dojar usr/share/${PN}/lib/*.jar
117 # launcher, server, client and VERSION
118 insinto /usr/share/${PN}/lib
119 doins usr/share/${PN}/lib/*.txt
121 # fonts
122 FONT_SUFFIX="ttf"
123 FONT_S=${S}/usr/share/fonts/truetype
124 FONT_PN=${PN}
125 font_src_install
127 # icon
128 doicon usr/share/pixmaps/${PN}.png
130 # doc
131 dodoc usr/share/doc/${PN}/*
133 # create wrapper script for the server
134 java-pkg_dolauncher ${PN}-server --main cz.winstrom.net.server.WinStromServer --pkg_args "-c /etc/winstrom/winstrom-server.xml --daemon" --java_args "-Xmx20m -client -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=10 -Djava.awt.headless=true -XX:CompileThreshold=16384"
135 dodir /usr/sbin
136 mv ${D}/usr/bin/${PN}-server ${D}/usr/sbin || die
138 # install mime types
139 insinto /usr/share/mimelnk/application/
140 doins usr/share/mimelnk/application/*
141 insinto /usr/share/mime/packages/
142 doins usr/share/mime/packages/*
144 # default file
145 dodir /etc/default
146 head -n6 etc/default/${PN} | tail -n2 > ${D}/etc/default/${PN}
148 # create wrapper script for the client
149 java-pkg_dolauncher ${PN} --main org.codehaus.classworlds.Launcher --java_args "-splash:/usr/share/${PN}/${PN}.png -Xmx256m -client -Dwinstromdir=/usr/share/${PN}/lib -Dclassworlds.conf=/usr/share/${PN}/lib/launcher.txt"
151 # desktop entry
152 make_desktop_entry ${PN} "WinStrom" ${PN}.png "Office"
156 pkg_postinst() {
157 elog
158 if use server ;then
159 elog "To make WinStrom working, you have to start up the PostgreSQL server first."
160 elog "Then, you have to create WinStrom DB admin (with password '7971'):"
161 elog "$ createuser -a -d -P -E -U postgres -W dba"
162 elog
163 elog "Use the /etc/init.d/winstrom-server script to start up the WinStrom server."
164 elog
166 elog "You can start up the WinStrom application by /usr/bin/winstrom."
167 elog
168 elog "Fist time you start the WinStrom application, go into the 'Data source management'"
169 elog "and 'Add' new 'Data source' with 'Server address' 127.0.0.1 and 'Server port' 5434."
170 elog