Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 111960 | Differences between
and this patch

Collapse All | Expand All

(-)hsqldb-1.7.3.1-r3.ebuild (-31 / +80 lines)
Lines 1-6 Link Here
1
# Copyright 1999-2006 Gentoo Foundation
1
# Copyright 1999-2006 Gentoo Foundation
2
# Distributed under the terms of the GNU General Public License v2
2
# Distributed under the terms of the GNU General Public License v2
3
# $Header: /var/cvsroot/gentoo-x86/dev-db/hsqldb/hsqldb-1.7.3.1-r3.ebuild,v 1.1 2006/07/01 16:40:38 nichoj Exp $
3
# $Header: $
4
4
5
inherit java-pkg-2 eutils versionator java-ant-2
5
inherit java-pkg-2 eutils versionator java-ant-2
6
6
Lines 8-20 Link Here
8
MY_P="${PN}_${MY_PV}"
8
MY_P="${PN}_${MY_PV}"
9
9
10
DESCRIPTION="The leading SQL relational database engine written in Java."
10
DESCRIPTION="The leading SQL relational database engine written in Java."
11
HOMEPAGE="http://hsqldb.sourceforge.net"
11
HOMEPAGE="http://hsqldb.org"
12
SRC_URI="mirror://sourceforge/${PN}/${MY_P}.zip"
12
SRC_URI="mirror://sourceforge/${PN}/${MY_P}.zip"
13
13
14
LICENSE="as-is"
14
LICENSE="as-is"
15
SLOT="0"
15
SLOT="0"
16
KEYWORDS="~x86 ~amd64 ~ppc64 ~sparc ~ppc"
16
KEYWORDS="~x86 ~amd64"
17
IUSE="doc source"
17
IUSE="doc source sqltools"
18
18
19
RDEPEND=">=virtual/jre-1.4
19
RDEPEND=">=virtual/jre-1.4
20
	=dev-java/servletapi-2.3*"
20
	=dev-java/servletapi-2.3*"
Lines 29-34 Link Here
29
29
30
S="${WORKDIR}/${PN}"
30
S="${WORKDIR}/${PN}"
31
31
32
HSQLDB_JAR=/usr/share/hsqldb/lib/hsqldb.jar
33
HSQLDB_HOME=/var/lib/hsqldb
34
32
pkg_setup() {
35
pkg_setup() {
33
	enewgroup hsqldb
36
	enewgroup hsqldb
34
	enewuser hsqldb -1 /bin/sh /dev/null hsqldb
37
	enewuser hsqldb -1 /bin/sh /dev/null hsqldb
Lines 45-63 Link Here
45
	sed -i -r \
48
	sed -i -r \
46
		-e "s/etc\/sysconfig/etc\/conf.d/g" \
49
		-e "s/etc\/sysconfig/etc\/conf.d/g" \
47
			bin/hsqldb
50
			bin/hsqldb
51
	
52
	ant -q -f build/build.xml cleanall > /dev/null || die "failed to clean"
48
53
49
	ant -q -f build/build.xml cleanall || die "failed to clean"
54
	epatch ${FILESDIR}/resolve-config-softlinks.patch
55
	if use sqltools; then
56
		epatch ${FILESDIR}/bundle-all-tools.patch
57
	fi
50
58
51
	mkdir conf
59
	mkdir conf
52
	local HSQLDB_JAR=/usr/share/hsqldb/lib/hsqldb.jar
60
	sed -e "s/^HSQLDB_JAR_PATH=.*$/HSQLDB_JAR_PATH=${HSQLDB_JAR//\//\\/}/g" \
53
	sed -e 's:^JAVA_EXECUTABLE=.*$:JAVA_EXECUTABLE=$(java-config --java):g' \
54
		-e "s/^HSQLDB_JAR_PATH=.*$/HSQLDB_JAR_PATH=${HSQLDB_JAR//\//\\/}/g" \
55
		-e "s/^SERVER_HOME=.*$/SERVER_HOME=\/var\/lib\/hsqldb/g" \
61
		-e "s/^SERVER_HOME=.*$/SERVER_HOME=\/var\/lib\/hsqldb/g" \
56
		-e "s/^HSQLDB_OWNER=.*$/HSQLDB_OWNER=hsqldb/g" \
62
		-e "s/^HSQLDB_OWNER=.*$/HSQLDB_OWNER=hsqldb/g" \
57
		-e 's/^#AUTH_FILE=.*$/AUTH_FILE=${SERVER_HOME}\/sqltool.rc/g' \
63
		-e 's/^#AUTH_FILE=.*$/AUTH_FILE=${SERVER_HOME}\/sqltool.rc/g' \
58
		src/org/hsqldb/sample/sample-hsqldb.cfg > conf/hsqldb
64
		src/org/hsqldb/sample/sample-hsqldb.cfg > conf/hsqldb
59
	cp ${FILESDIR}/server.properties-r1 conf/server.properties
65
	cp ${FILESDIR}/server.properties-1.8 conf/server.properties
60
	cp ${FILESDIR}/sqltool.rc-r1 conf/sqltool.rc
66
	cp ${FILESDIR}/sqltool.rc-1.8 conf/sqltool.rc
61
}
67
}
62
68
63
src_compile() {
69
src_compile() {
Lines 74-122 Link Here
74
	fi
80
	fi
75
	use source && java-pkg_dosrc src/*
81
	use source && java-pkg_dosrc src/*
76
82
83
	# Install env file for CONFIG_PROTECT support
84
	insinto /etc/env.d
85
	insopts -m0644
86
	doins ${FILESDIR}/35hsqldb
87
88
	# Put init, configuration and authorization files in /etc
77
	doinitd ${FILESDIR}/hsqldb
89
	doinitd ${FILESDIR}/hsqldb
78
	doconfd conf/hsqldb
90
	doconfd conf/hsqldb
91
	dodir /etc/hsqldb
79
	insinto /etc/hsqldb
92
	insinto /etc/hsqldb
80
	# Change the ownership of server.properties and sqltool.rc
93
	# Change the ownership of server.properties and sqltool.rc
81
	# files to hsqldb:hsqldb. (resolves Bug #111963)
94
	# files to hsqldb:hsqldb. (resolves Bug #111963)
82
	insopts -m 0600 -o hsqldb -g hsqldb
95
	insopts -m0600 -o hsqldb -g hsqldb
83
	doins conf/server.properties
96
	doins conf/server.properties
84
	insopts -m 0600 -o hsqldb -g hsqldb
97
	insopts -m0600 -o hsqldb -g hsqldb
85
	doins conf/sqltool.rc
98
	doins conf/sqltool.rc
86
99
87
	dodir /var/lib/hsqldb/bin
100
	# Install init script
88
	keepdir /var/lib/hsqldb
101
	dodir ${HSQLDB_HOME}/bin
89
	exeinto /var/lib/hsqldb/bin
102
	keepdir ${HSQLDB_HOME}
103
	exeinto ${HSQLDB_HOME}/bin
90
	doexe bin/hsqldb
104
	doexe bin/hsqldb
91
	dosym /etc/hsqldb/server.properties /var/lib/hsqldb/server.properties
105
92
	dosym /etc/hsqldb/sqltool.rc /var/lib/hsqldb/sqltool.rc
106
	# Create symlinks to authorization files in the server home dir
93
	chown -R hsqldb:hsqldb ${D}/var/lib/hsqldb
107
	# (required by the hqldb init script)
94
	chmod o-rwx ${D}/var/lib/hsqldb
108
	insinto ${HSQLDB_HOME}
109
	dosym /etc/hsqldb/server.properties ${HSQLDB_HOME}/server.properties
110
	dosym /etc/hsqldb/sqltool.rc ${HSQLDB_HOME}/sqltool.rc
111
	
112
	# Make sure that files have correct permissions
113
	chown -R hsqldb:hsqldb ${D}${HSQLDB_HOME}
114
	chmod o-rwx ${D}${HSQLDB_HOME}
95
}
115
}
96
116
97
pkg_postinst() {
117
pkg_postinst() {
98
	ewarn "If you intend to run hsqldb in Server mode and you want to create"
118
	ewarn "If you intend to run Hsqldb in Server mode and you want to create"
99
	ewarn "additional databases, remember to put correct information in both"
119
	ewarn "additional databases, remember to put correct information in both"
100
	ewarn "'server.properties' and 'sqltool.rc' files."
120
	ewarn "'server.properties' and 'sqltool.rc' files."
101
	ewarn "(read the 'Init script Setup Procedure' section of the 'Chapter 3."
121
	ewarn "(read the 'Init script Setup Procedure' section of the 'Chapter 3."
102
	ewarn "UNIX Quick Start' in the hsqldb docs for more information)"
122
	ewarn "UNIX Quick Start' in the Hsqldb docs for more information)"
103
	einfo
123
	echo
104
	einfo "Example:"
124
	einfo "Example:"
105
	einfo
125
	echo
106
	einfo "/etc/hsqldb/server.properties"
126
	einfo "/etc/hsqldb/server.properties"
107
	einfo "============================="
127
	einfo "============================="
108
	einfo "server.database.1=file:/var/lib/hsqldb/newdb/newdb"
128
	einfo "server.database.1=file:xdb/xdb"
109
	einfo "server.dbname.1=newdb"
129
	einfo "server.dbname.1=xdb"
110
	einfo "server.urlid.1=newdb"
130
	einfo "server.urlid.1=xdb"
111
	einfo
131
	einfo
112
	einfo "/etc/hsqldb/sqltool.rc"
132
	einfo "/etc/hsqldb/sqltool.rc"
113
	einfo "======================"
133
	einfo "======================"
114
	einfo "urlid newdb"
134
	einfo "urlid xdb"
115
	einfo "url jdbc:hsqldb:hsql://localhost/newdb"
135
	einfo "url jdbc:hsqldb:hsql://localhost/xdb"
116
	einfo "username sa"
136
	einfo "username sa"
117
	einfo "password "
137
	einfo "password "
138
	echo
139
	einfo "Also note that each hsqldb server can serve only up to 10"
140
	einfo "different databases simultaneously (with consecutive {0-9}"
141
	einfo "suffixes in the 'server.properties' file)."
142
	echo
143
	ewarn "For data manipulation use:"
118
	ewarn
144
	ewarn
119
	ewarn "Also note that each hsqldb server can serve only up to 10"
145
	ewarn "# java -classpath ${HSQLDB_JAR} org.hsqldb.util.DatabaseManager"
120
	ewarn "different databases simultaneously (with consecutive {0-9}"
146
	ewarn "# java -classpath ${HSQLDB_JAR} org.hsqldb.util.DatabaseManagerSwing"
121
	ewarn "suffixes in the 'server.properties' file)."
147
	ewarn "# java -classpath ${HSQLDB_JAR} org.hsqldb.util.SqlTool \\"
148
	ewarn "  --rcFile /var/lib/hsqldb/sqltool.rc <dbname>"
149
	echo
150
	einfo "The Hsqldb can be run in multiple modes - read 'Chapter 1. Running'"
151
	einfo "and Using Hsqldb' in the Hsqldb docs at:"
152
	einfo "  http://hsqldb.org/web/hsqlDocsFrame.html"
153
	einfo "If you intend to run it in the Server mode, it is suggested to add the"
154
	einfo "init script to your start-up scripts, this should be done like this:"
155
	einfo "  \`rc-update add hsqldb default\`"
156
	echo
157
158
	# Enable CONFIG_PROTECT for hsqldb
159
        env-update
160
	einfo "Hsqldb stores its database files in ${HSQLDB_HOME} and this directory"
161
	einfo "is added to the CONFIG_PROTECT list. In order to immediately activate"
162
	einfo "these settings please do:"
163
	einfo "  \`env-update && source /etc/profile\`"
164
	einfo "Otherwise the settings will become active next time you login"
165
	echo
166
}
167
168
pkg_postrm() {
169
        # Disable CONFIG_PROTECT for hsqldb
170
        env-update
122
}
171
}

Return to bug 111960