Skip to content

Commit

Permalink
Fixed variable substitutions in distro packages building.
Browse files Browse the repository at this point in the history
  • Loading branch information
fjssilva committed Mar 22, 2018
1 parent 9636e99 commit 64fcbb2
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 28 deletions.
25 changes: 15 additions & 10 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,9 @@ com.mysql.cj.build.driver.version.minor - minor version: [${com.mysql.cj.build.d
com.mysql.cj.build.driver.version.subminor - subminor version: [${com.mysql.cj.build.driver.version.subminor}]
com.mysql.cj.build.driver.version.status - version status, such as '-rc' or '-dmr': [${com.mysql.cj.build.driver.version.status}]

com.mysql.cj.build.driver.version - standard version string (includes version status): [${com.mysql.cj.build.driver.version.numeric}${com.mysql.cj.build.driver.version.status}]
com.mysql.cj.build.driver.version.series - product series, i.e. x.y: [${com.mysql.cj.build.driver.version.major}.${com.mysql.cj.build.driver.version.minor}]
com.mysql.cj.build.driver.version.numeric - numeric version, i.e. x.y.z: [${com.mysql.cj.build.driver.version.series}.${com.mysql.cj.build.driver.version.subminor}}
com.mysql.cj.build.driver.version - standard version string (includes version status): [${com.mysql.cj.build.driver.version.numeric}${com.mysql.cj.build.driver.version.status}]
com.mysql.cj.build.driver.version.extra - optional version information appended to the full version string: [${com.mysql.cj.build.driver.version.extra}]
com.mysql.cj.build.driver.version.snapshot - optional version snapshot marker: [${com.mysql.cj.build.driver.version.snapshot}]
com.mysql.cj.build.driver.version.full - full version string: [${com.mysql.cj.build.driver.version}${com.mysql.cj.build.driver.version.extra}${com.mysql.cj.build.driver.version.snapshot}]
Expand All @@ -151,7 +151,7 @@ com.mysql.cj.dist.packageName - final package name: [${com.mysql.cj.build.driver
com.mysql.cj.dist.packageSuffix - suffix added to package name (depends on package type): [${com.mysql.cj.dist.packageWithSourcesSuffix}|${com.mysql.cj.dist.packageNoSourcesSuffix}|_unset_]
com.mysql.cj.dist.packageWithSourcesSuffix - suffix for packages containing sources if not by default: [${com.mysql.cj.dist.packageWithSourcesSuffix}]
com.mysql.cj.dist.packageNoSourcesSuffix - suffix for packages not containing sources if not by default: [${com.mysql.cj.dist.packageNoSourcesSuffix}]
com.mysql.cj.dist.noSources - don't include sources into dist packages: [_uset]
com.mysql.cj.dist.noSources - don't include sources into dist packages: [_unset]
com.mysql.cj.dist.noMavenSources - don't include sources into Maven package: [_unset_]
com.mysql.cj.dist.licenseUrl - license book location: [${com.mysql.cj.dist.licenseUrl}]

Expand Down Expand Up @@ -486,6 +486,7 @@ See also com.mysql.cj.conf.PropertyDefinitions.SYSP_* variables for other test o
<filter token="MYSQL_CJ_VERSION_EXTRA" value="${com.mysql.cj.build.driver.version.extra}" />
<filter token="MYSQL_CJ_VERSION_SNAPSHOT" value="${com.mysql.cj.build.driver.version.snapshot}" />
<filter token="MYSQL_CJ_VERSION" value="${com.mysql.cj.build.driver.version.full}" />
<filter token="MYSQL_CJ_VERSION_SERIES" value="${com.mysql.cj.build.driver.version.series}" />
<filter token="MYSQL_CJ_RPM_RELEASE_FULL" value="${com.mysql.cj.rpm_release.full}" />
<filter token="MYSQL_CJ_REVISION" value="${com.mysql.cj.git_revision}" />
<filter token="MYSQL_CJ_PROD_NAME" value="${com.mysql.cj.build.driver.name}" />
Expand Down Expand Up @@ -759,7 +760,7 @@ See also com.mysql.cj.conf.PropertyDefinitions.SYSP_* variables for other test o
<!-- Prepare a package for archiving (initialize). -->
<target name="-make-packages-init" depends="-set-package-name, dist">
<property name="com.mysql.cj.dist.dir.package" value="${com.mysql.cj.dist.dir.prepare}/${com.mysql.cj.dist.packageName}" />

<mkdir dir="${com.mysql.cj.dist.dir}" />
<mkdir dir="${com.mysql.cj.dist.dir.prepare}" />
<mkdir dir="${com.mysql.cj.dist.dir.package}" />
Expand Down Expand Up @@ -932,8 +933,6 @@ See also com.mysql.cj.conf.PropertyDefinitions.SYSP_* variables for other test o
</and>
</condition>

<echo>${com.mysql.cj.dist.packageSuffix}</echo>

<property name="com.mysql.cj.dist.packageName"
value="${com.mysql.cj.build.driver.extendedName}${com.mysql.cj.dist.packageSuffix}-${com.mysql.cj.build.driver.version.full}" />
</target>
Expand Down Expand Up @@ -1341,15 +1340,15 @@ See also com.mysql.cj.conf.PropertyDefinitions.SYSP_* variables for other test o


<target name="-prepare-rpm-deb-commercial-props" if="${com.mysql.cj.build.commercial}">
<echo message="Using Commercial settings" />
<echo>Using Commercial settings</echo>
<property name="deb_version_suffix" value="+commercial" />
<property name="lic_file" value="LICENSE" />
<property name="rpm_com_arg" value="--define=commercial yes" />
</target>


<target name="-prepare-rpm-deb-gpl-props" unless="${com.mysql.cj.build.commercial}">
<echo message="Using GPL settings" />
<echo>Using GPL settings</echo>
<property name="deb_version_suffix" value="" />
<property name="lic_file" value="LICENSE" />
<property name="rpm_com_arg" value="--define=dummy yes" />
Expand Down Expand Up @@ -1380,8 +1379,11 @@ See also com.mysql.cj.conf.PropertyDefinitions.SYSP_* variables for other test o
<fileset dir="." excludes="${com.mysql.cj.dist.dir}/**, ${com.mysql.cj.build.dir}/**" />
</copy>
<!-- We know tmp is empty beside what we want to pack -->
<tar destfile="${com.mysql.cj.build.dir}/rpm/SOURCES/${com.mysql.cj.build.driver.fullName}.tar.gz" basedir="${com.mysql.cj.build.dir}/tmp" />
<tar destfile="${com.mysql.cj.build.dir}/rpm/SOURCES/${com.mysql.cj.build.driver.fullName}.tar.gz"
basedir="${com.mysql.cj.build.dir}/tmp"
excludes="**/revision-info.properties" />

<local name="com.mysql.cj.build.dir.absolute" />
<property name="com.mysql.cj.build.dir.absolute" location="${com.mysql.cj.build.dir}" />

<exec executable="rpmbuild" failonerror="true">
Expand All @@ -1404,7 +1406,8 @@ See also com.mysql.cj.conf.PropertyDefinitions.SYSP_* variables for other test o
<!-- ************************* -->


<target name="build-debian-pkg" depends="-init-copy-common, -prepare-rpm-deb-commercial-props, -prepare-rpm-deb-gpl-props">
<target name="build-debian-pkg"
depends="-init-copy-common, -set-no-sources, -set-package-name, -prepare-rpm-deb-commercial-props, -prepare-rpm-deb-gpl-props">
<exec executable="lsb_release" outputproperty="lsb_id">
<arg value="--short" />
<arg value="--id" />
Expand Down Expand Up @@ -1442,14 +1445,16 @@ See also com.mysql.cj.conf.PropertyDefinitions.SYSP_* variables for other test o
<fileset dir="src/build/misc/debian.in" />
<filterset refid="versionFilterset" />
<filterset>
<filter token="PRODUCT" value="MySQL Connector/J ${com.mysql.cj.build.driver.version.series}" />
<filter token="PRODUCT" value="${com.mysql.cj.build.driver.displayName} ${com.mysql.cj.build.driver.version.series}" />
<filter token="WITH_JARDEPS" value="${com.mysql.cj.extra.libs}" />
<filter token="YEAR" value="${time.year}" />
<filter token="PACKAGE_TIMESTAMP" value="${time.deb.packageTimeStamp}" />
<filter token="ID_RELEASE" value="${id_release}" />
<filter token="CODENAME" value="${codename}" />
<filter token="LIC_FILE" value="${lic_file}" />
<filter token="PRODUCT_NAME" value="${com.mysql.cj.build.driver.name}" />
<filter token="PRODUCT_SUFFIX" value="${com.mysql.cj.build.driver.extraName}" />
<filter token="PACKAGE_NAME" value="${com.mysql.cj.dist.packageName}" />
<filter token="DEB_VERSION_SUFFIX" value="${deb_version_suffix}" />
<filter token="VERSION_FULL" value="${com.mysql.cj.build.driver.version.full}" />
<filter token="MAINTAINER_EMAIL" value="${com.mysql.cj.dist.deb.maintainerEmail}" />
Expand Down
4 changes: 2 additions & 2 deletions src/build/misc/debian.in/changelog
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
mysql-connector-java@PRODUCT_SUFFIX@ (@MYSQL_CJ_VERSION@@MYSQL_CJ_VERSION_SNAPSHOT@@DEB_VERSION_SUFFIX@@ID_RELEASE@) @CODENAME@; urgency=low
@PRODUCT_NAME@@PRODUCT_SUFFIX@ (@MYSQL_CJ_VERSION@@MYSQL_CJ_VERSION_SNAPSHOT@@DEB_VERSION_SUFFIX@@ID_RELEASE@) @CODENAME@; urgency=low

* Updating the packaging source for mysql-connector-java.
* Updating the packaging source for @PRODUCT_NAME@.

-- @MAINTAINER_EMAIL@ @PACKAGE_TIMESTAMP@
4 changes: 2 additions & 2 deletions src/build/misc/debian.in/control
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
Source: mysql-connector-java@PRODUCT_SUFFIX@
Source: @PRODUCT_NAME@@PRODUCT_SUFFIX@
Section: database
Priority: optional
Maintainer: Oracle MySQL Product Engineering Team <mysql-build@oss.oracle.com>
Standards-Version: 3.9.2
Build-Depends: debhelper (>= 8.9.4)
Homepage: http://dev.mysql.com/downloads/connector/j/

Package: mysql-connector-java@PRODUCT_SUFFIX@
Package: @PRODUCT_NAME@@PRODUCT_SUFFIX@
Section: database
Architecture: all
Depends: ${shlibs:Depends}, ${misc:Depends}
Expand Down
8 changes: 4 additions & 4 deletions src/build/misc/debian.in/install
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
dist/toArchive/mysql-connector-java@PRODUCT_SUFFIX@-@VERSION_FULL@/mysql-connector-java@PRODUCT_SUFFIX@-@VERSION_FULL@.jar usr/share/java
dist/toArchive/@PACKAGE_NAME@/@PRODUCT_NAME@@PRODUCT_SUFFIX@-@VERSION_FULL@.jar usr/share/java

#legal
dist/toArchive/mysql-connector-java@PRODUCT_SUFFIX@-@VERSION_FULL@/@LIC_FILE@ usr/share/doc/mysql-connector-java@PRODUCT_SUFFIX@
dist/toArchive/mysql-connector-java@PRODUCT_SUFFIX@-@VERSION_FULL@/README usr/share/doc/mysql-connector-java@PRODUCT_SUFFIX@
dist/toArchive/mysql-connector-java@PRODUCT_SUFFIX@-@VERSION_FULL@/CHANGES usr/share/doc/mysql-connector-java@PRODUCT_SUFFIX@
dist/toArchive/@PACKAGE_NAME@/@LIC_FILE@ usr/share/doc/@PRODUCT_NAME@@PRODUCT_SUFFIX@
dist/toArchive/@PACKAGE_NAME@/README usr/share/doc/@PRODUCT_NAME@@PRODUCT_SUFFIX@
dist/toArchive/@PACKAGE_NAME@/CHANGES usr/share/doc/@PRODUCT_NAME@@PRODUCT_SUFFIX@
6 changes: 3 additions & 3 deletions src/build/misc/debian.in/rules
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ base_version = $(shell echo $(upstream_version) | sed -e's/r[0-9]\+$$//')

ANT_COMMON_OPTIONS=\
-Dcom.mysql.cj.build.dir.driver=build/driver \
-Dcom.mysql.cj.extra.libs=@WITH_JARDEPS@ \
-Dcom.mysql.cj.build.driver.version.status=@MYSQL_CJ_VERSION_STATUS@ \
-Dcom.mysql.cj.build.driver.version.extra=@MYSQL_CJ_VERSION_EXTRA@ \
-Dcom.mysql.cj.build.driver.version.snapshot=@MYSQL_CJ_VERSION_SNAPSHOT@ \
-Dcom.mysql.cj.extra.libs=@WITH_JARDEPS@ \
-Dcom.mysql.cj.build.driver.extraName=@PRODUCT_SUFFIX@ \
-Dcom.mysql.cj.build.licenseUrl=@MYSQL_CJ_LICENSEURL@ \
-Dcom.mysql.cj.dist.licenseUrl=@MYSQL_CJ_LICENSEURL@ \
-Djava.awt.headless=true

ifeq ($(ANT_HOME),)
Expand Down Expand Up @@ -71,4 +71,4 @@ override_dh_auto_build:
full-package-no-sources

override_dh_auto_clean:
$(ANT_CMD) clean
$(ANT_CMD) $(ANT_COMMON_OPTIONS) clean
2 changes: 1 addition & 1 deletion src/build/misc/debian.in/watch
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
version=3
http://mysql.osuosl.org/Downloads/mysql-connector-java-(.+)\.tar\.gz
http://mysql.osuosl.org/Downloads/@PRODUCT_NAME@-(.+)\.tar\.gz
14 changes: 9 additions & 5 deletions src/build/misc/rpm.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -89,18 +89,18 @@ Requires: java-headless >= 1:1.8.0

%description
MySQL provides connectivity for client applications developed in the
Java programming language with MySQL Connector/J, a driver that
Java programming language with @MYSQL_CJ_DISPLAY_PROD_NAME@, a driver that
implements the [Java Database Connectivity (JDBC) API]
(http://www.oracle.com/technetwork/java/javase/jdbc/).

MySQL Connector/J 6.0 is a JDBC Type 4 driver that is compatible with
@MYSQL_CJ_DISPLAY_PROD_NAME@ @MYSQL_CJ_VERSION_SERIES@ is a JDBC Type 4 driver that is compatible with
the [JDBC 4.2](http://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/)
specification. The Type 4 designation means that the driver is a pure
Java implementation of the MySQL protocol and does not rely on the
MySQL client libraries.

For detailed information please visit the official
[MySQL Connector/J documentation]
[@MYSQL_CJ_DISPLAY_PROD_NAME@ documentation]
(http://dev.mysql.com/doc/connector-j/en/).

%prep
Expand All @@ -109,12 +109,12 @@ For detailed information please visit the official
%build
COMMON_OPTIONS="\
-Dcom.mysql.cj.build.dir.driver=build/driver
-Dcom.mysql.cj.extra.libs=%{with_jardeps} \
-Dcom.mysql.cj.build.driver.version.status=@MYSQL_CJ_VERSION_STATUS@ \
-Dcom.mysql.cj.build.driver.version.extra=@MYSQL_CJ_VERSION_EXTRA@ \
-Dcom.mysql.cj.build.driver.version.snapshot=@MYSQL_CJ_VERSION_SNAPSHOT@ \
-Dcom.mysql.cj.extra.libs=%{with_jardeps} \
-Dcom.mysql.cj.build.driver.extraName=@MYSQL_CJ_EXTRA_NAME@ \
-Dcom.mysql.cj.build.licenseUrl=@MYSQL_CJ_LICENSEURL@ \
-Dcom.mysql.cj.dist.licenseUrl=@MYSQL_CJ_LICENSEURL@ \
-Djava.awt.headless=true"

%if 0%{?with_ant:1}
Expand All @@ -136,6 +136,10 @@ COMMON_OPTIONS="${COMMON_OPTIONS} -Dcom.mysql.cj.build.jdk=${JAVA_HOME}"
COMMON_OPTIONS="${COMMON_OPTIONS} -Dcom.mysql.cj.build.commercial=true"
%endif

# Get the file revision-info.properties again because it was excluded
# from SOURCES
cp %{_tmppath}/@MYSQL_CJ_FULL_PROD_NAME@/revision-info.properties .

${ANT_CMD} \
${COMMON_OPTIONS} \
full-package-no-sources
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2524,7 +2524,7 @@ public String getDriverName() throws SQLException {
* @throws java.sql.SQLException
*/
public String getDriverVersion() throws java.sql.SQLException {
return Constants.CJ_FULL_NAME + " ( Revision: " + Constants.CJ_REVISION + " )";
return Constants.CJ_FULL_NAME + " (Revision: " + Constants.CJ_REVISION + ")";
}

public java.sql.ResultSet getExportedKeys(String catalog, String schema, final String table) throws SQLException {
Expand Down

0 comments on commit 64fcbb2

Please sign in to comment.