mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] [PATCH] mySQL: exhume a gone package
@ 2016-05-24 10:54 Juergen Borleis
  2016-05-24 10:54 ` [ptxdist] [PATCH 1/4] libaio: add new package Juergen Borleis
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Juergen Borleis @ 2016-05-24 10:54 UTC (permalink / raw)
  To: ptxdist

With 7e3cd4d1d83c24ff5070fea5b6789936351a880a the previous version of mySQL
was gone. With this patch this package will be back in a more recent release.

Keep in mind: its a huge package. Huge at buildtime, huge at runtime.

Comments are welcome.

jb


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [ptxdist] [PATCH 1/4] libaio: add new package
  2016-05-24 10:54 [ptxdist] [PATCH] mySQL: exhume a gone package Juergen Borleis
@ 2016-05-24 10:54 ` Juergen Borleis
  2016-05-24 10:54 ` [ptxdist] [PATCH 2/4] mySQL: remove an orphaned file Juergen Borleis
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Juergen Borleis @ 2016-05-24 10:54 UTC (permalink / raw)
  To: ptxdist

This library simplifies the use of asynchronous I/O access the Linux kernel
supports. In order to make use of this feature, the kernel's CONFIG_AIO is
set.

Signed-off-by: Juergen Borleis <jbe@pengutronix.de>
---
 .../0001-make-the-package-DESTDIR-aware.patch      | 22 +++++++++
 patches/libaio-0.3.110/series                      |  4 ++
 rules/host-libaio.in                               |  6 +++
 rules/host-libaio.make                             | 24 +++++++++
 rules/libaio.in                                    |  7 +++
 rules/libaio.make                                  | 57 ++++++++++++++++++++++
 6 files changed, 120 insertions(+)
 create mode 100644 patches/libaio-0.3.110/0001-make-the-package-DESTDIR-aware.patch
 create mode 100644 patches/libaio-0.3.110/series
 create mode 100644 rules/host-libaio.in
 create mode 100644 rules/host-libaio.make
 create mode 100644 rules/libaio.in
 create mode 100644 rules/libaio.make

diff --git a/patches/libaio-0.3.110/0001-make-the-package-DESTDIR-aware.patch b/patches/libaio-0.3.110/0001-make-the-package-DESTDIR-aware.patch
new file mode 100644
index 0000000..07a4235
--- /dev/null
+++ b/patches/libaio-0.3.110/0001-make-the-package-DESTDIR-aware.patch
@@ -0,0 +1,22 @@
+From: Juergen Borleis <jbe@pengutronix.de>
+Date: Wed, 6 Apr 2016 14:01:58 +0200
+Subject: [PATCH] make the package DESTDIR aware
+
+Signed-off-by: Juergen Borleis <jbe@pengutronix.de>
+---
+ Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index 4cedbc9096fe..6d9d88670ad6 100644
+--- a/Makefile
++++ b/Makefile
+@@ -5,7 +5,7 @@ RELEASE=$(shell awk '/Release:/ { print $$2 }' $(SPECFILE))
+ CVSTAG = $(NAME)_$(subst .,-,$(VERSION))_$(subst .,-,$(RELEASE))
+ RPMBUILD=$(shell `which rpmbuild >&/dev/null` && echo "rpmbuild" || echo "rpm")
+ 
+-prefix=/usr
++prefix=$(DESTDIR)/usr
+ includedir=$(prefix)/include
+ libdir=$(prefix)/lib
+ 
diff --git a/patches/libaio-0.3.110/series b/patches/libaio-0.3.110/series
new file mode 100644
index 0000000..1c5e0b9
--- /dev/null
+++ b/patches/libaio-0.3.110/series
@@ -0,0 +1,4 @@
+# generated by git-ptx-patches
+#tag:base --start-number 1
+0001-make-the-package-DESTDIR-aware.patch
+# 2c519bc2ab00d1696f060ce28efb150a  - git-ptx-patches magic
diff --git a/rules/host-libaio.in b/rules/host-libaio.in
new file mode 100644
index 0000000..bf9657c
--- /dev/null
+++ b/rules/host-libaio.in
@@ -0,0 +1,6 @@
+## SECTION=hosttools_noprompt
+
+config HOST_LIBAIO
+	tristate
+	help
+	  Requiered host part of some buildsystems
diff --git a/rules/host-libaio.make b/rules/host-libaio.make
new file mode 100644
index 0000000..ce44561
--- /dev/null
+++ b/rules/host-libaio.make
@@ -0,0 +1,24 @@
+# -*-makefile-*-
+#
+# Copyright (C) 2016 by Juergen Borleis <jbe@pengutronix.de>
+#
+# See CREDITS for details about who has contributed to this project.
+#
+# For further information about the PTXdist project and license conditions
+# see the README file.
+#
+
+#
+# We provide this package
+#
+HOST_PACKAGES-$(PTXCONF_HOST_LIBAIO) += host-libaio
+
+# ----------------------------------------------------------------------------
+# Prepare + Compile
+# ----------------------------------------------------------------------------
+
+HOST_LIBAIO_CONF_TOOL	:= NO
+HOST_LIBAIO_MAKE_ENV	:= $(HOST_ENV)
+HOST_LIBAIO_MAKEVARS	:= prefix=$(PTXCONF_SYSROOT_HOST)
+
+# vim: syntax=make
diff --git a/rules/libaio.in b/rules/libaio.in
new file mode 100644
index 0000000..f10149c
--- /dev/null
+++ b/rules/libaio.in
@@ -0,0 +1,7 @@
+## SECTION=system_libraries
+
+config LIBAIO
+	tristate
+	prompt "libaio"
+	help
+	  Library for asynchronous I/O access
diff --git a/rules/libaio.make b/rules/libaio.make
new file mode 100644
index 0000000..206ae4b
--- /dev/null
+++ b/rules/libaio.make
@@ -0,0 +1,57 @@
+# -*-makefile-*-
+#
+# Copyright (C) 2016 by Juergen Borleis <jbe@pengutronix.de>
+#
+# See CREDITS for details about who has contributed to this project.
+#
+# For further information about the PTXdist project and license conditions
+# see the README file.
+#
+
+#
+# We provide this package
+#
+PACKAGES-$(PTXCONF_LIBAIO) += libaio
+
+#
+# Paths and names
+#
+LIBAIO_VERSION	:= 0.3.110
+LIBAIO_MD5	:= 2a35602e43778383e2f4907a4ca39ab8
+LIBAIO		:= libaio-$(LIBAIO_VERSION)
+LIBAIO_SUFFIX	:= tar.gz
+LIBAIO_URL	:= http://pkgs.fedoraproject.org/repo/pkgs/libaio/libaio-0.3.110.tar.gz/2a35602e43778383e2f4907a4ca39ab8/$(LIBAIO).$(LIBAIO_SUFFIX)
+LIBAIO_SOURCE	:= $(SRCDIR)/$(LIBAIO).$(LIBAIO_SUFFIX)
+LIBAIO_DIR	:= $(BUILDDIR)/$(LIBAIO)
+LIBAIO_LICENSE	:= LGPL-2.1
+
+# ----------------------------------------------------------------------------
+# Prepare + Compile
+# ----------------------------------------------------------------------------
+
+#
+# just a Makefile made by a creative Linux kernel hacker...
+#
+LIBAIO_CONF_TOOL	:= NO
+LIBAIO_MAKE_ENV		:= $(CROSS_ENV)
+
+# ----------------------------------------------------------------------------
+# Target-Install
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/libaio.targetinstall:
+	@$(call targetinfo)
+
+	@$(call install_init, libaio)
+	@$(call install_fixup, libaio,PRIORITY,optional)
+	@$(call install_fixup, libaio,SECTION,base)
+	@$(call install_fixup, libaio,AUTHOR,"Juergen Borleis <jbe@pengutronix.de>")
+	@$(call install_fixup, libaio,DESCRIPTION,"asynchronous I/O access library")
+
+	@$(call install_lib, libaio, 0, 0, 0644, libaio)
+
+	@$(call install_finish, libaio)
+
+	@$(call touch)
+
+# vim: syntax=make
-- 
2.8.1


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [ptxdist] [PATCH 2/4] mySQL: remove an orphaned file
  2016-05-24 10:54 [ptxdist] [PATCH] mySQL: exhume a gone package Juergen Borleis
  2016-05-24 10:54 ` [ptxdist] [PATCH 1/4] libaio: add new package Juergen Borleis
@ 2016-05-24 10:54 ` Juergen Borleis
  2016-05-24 10:54 ` [ptxdist] [PATCH 3/4] mySQL: exhume a gone package by updating it to a new release Juergen Borleis
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Juergen Borleis @ 2016-05-24 10:54 UTC (permalink / raw)
  To: ptxdist

The corresponding package is gone with 7e3cd4d1d83c24ff5070fea5b6789936351a880a

Signed-off-by: Juergen Borleis <jbe@pengutronix.de>
---
 projectroot/etc/init.d/mysql | 4 ----
 1 file changed, 4 deletions(-)
 delete mode 100644 projectroot/etc/init.d/mysql

diff --git a/projectroot/etc/init.d/mysql b/projectroot/etc/init.d/mysql
deleted file mode 100644
index dd80a4b..0000000
--- a/projectroot/etc/init.d/mysql
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/sh
-
-echo "Write Me"
-
-- 
2.8.1


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [ptxdist] [PATCH 3/4] mySQL: exhume a gone package by updating it to a new release
  2016-05-24 10:54 [ptxdist] [PATCH] mySQL: exhume a gone package Juergen Borleis
  2016-05-24 10:54 ` [ptxdist] [PATCH 1/4] libaio: add new package Juergen Borleis
  2016-05-24 10:54 ` [ptxdist] [PATCH 2/4] mySQL: remove an orphaned file Juergen Borleis
@ 2016-05-24 10:54 ` Juergen Borleis
  2016-05-24 10:54 ` [ptxdist] [PATCH 4/4] Qt5: add mySQL support Juergen Borleis
  2016-05-26  9:57 ` [ptxdist] [PATCH] mySQL: exhume a gone package Michael Olbrich
  4 siblings, 0 replies; 6+ messages in thread
From: Juergen Borleis @ 2016-05-24 10:54 UTC (permalink / raw)
  To: ptxdist

After the remove of the old package from the staging area this change adds a
new release of the mySQL package.

Its intended and checked on a read-only root filesystem with write access
in "/var/mysql" only. The database engine runs as a regular user and does
not need root permissions.

Due to its dependency to boost_1_59_0 it uses exactly this version and the
already present boost lib in PTXdist isn't used.

Be aware: its buildsystem uses a huge amount of memory. If your host is low
on memory don't forget to build this package with the '-ji1' parameter.

Signed-off-by: Juergen Borleis <jbe@pengutronix.de>
---
 ...01-Fix_buildsystem-use-compile-only-tests.patch | 100 +++++++++++++
 patches/mysql-5.7.11/series                        |   4 +
 projectroot/etc/group                              |   1 +
 projectroot/etc/mysql/my.cnf                       |  38 +++++
 projectroot/etc/passwd                             |   1 +
 projectroot/lib/systemd/system/mysqld.service      |  48 +++++++
 projectroot/lib/systemd/system/mysqldinit.service  |  36 +++++
 projectroot/sbin/mysqlinit                         |  12 ++
 rules/host-mysql.in                                |  10 ++
 rules/host-mysql.make                              |  56 ++++++++
 rules/mysql.in                                     |  20 +++
 rules/mysql.make                                   | 158 +++++++++++++++++++++
 12 files changed, 484 insertions(+)
 create mode 100644 patches/mysql-5.7.11/0001-Fix_buildsystem-use-compile-only-tests.patch
 create mode 100644 patches/mysql-5.7.11/series
 create mode 100644 projectroot/etc/mysql/my.cnf
 create mode 100644 projectroot/lib/systemd/system/mysqld.service
 create mode 100644 projectroot/lib/systemd/system/mysqldinit.service
 create mode 100644 projectroot/sbin/mysqlinit
 create mode 100644 rules/host-mysql.in
 create mode 100644 rules/host-mysql.make
 create mode 100644 rules/mysql.in
 create mode 100644 rules/mysql.make

diff --git a/patches/mysql-5.7.11/0001-Fix_buildsystem-use-compile-only-tests.patch b/patches/mysql-5.7.11/0001-Fix_buildsystem-use-compile-only-tests.patch
new file mode 100644
index 0000000..106abc5
--- /dev/null
+++ b/patches/mysql-5.7.11/0001-Fix_buildsystem-use-compile-only-tests.patch
@@ -0,0 +1,100 @@
+From: Juergen Borleis <jbe@pengutronix.de>
+Date: Tue, 15 Mar 2016 15:02:02 +0100
+Subject: [PATCH] Fix_buildsystem: use compile only tests
+
+Testing compiler features need not to run to test them.
+---
+ storage/innobase/innodb.cmake | 36 ++++++++++++++++--------------------
+ 1 file changed, 16 insertions(+), 20 deletions(-)
+
+diff --git a/storage/innobase/innodb.cmake b/storage/innobase/innodb.cmake
+index 809e58941e95..944f4e10803b 100644
+--- a/storage/innobase/innodb.cmake
++++ b/storage/innobase/innodb.cmake
+@@ -108,7 +108,7 @@ IF(HAVE_NANOSLEEP)
+ ENDIF()
+ 
+ IF(NOT MSVC)
+-  CHECK_C_SOURCE_RUNS(
++  CHECK_CXX_SOURCE_COMPILES(
+   "
+   #define _GNU_SOURCE
+   #include <fcntl.h>
+@@ -131,28 +131,27 @@ ENDIF()
+ 
+ IF(NOT MSVC)
+ # either define HAVE_IB_GCC_ATOMIC_BUILTINS or not
+-IF(NOT CMAKE_CROSSCOMPILING)
+-  CHECK_C_SOURCE_RUNS(
+-  "#include<stdint.h>
++CHECK_CXX_SOURCE_COMPILES("
++  #include<stdint.h>
+   int main()
+   {
+     __sync_synchronize();
+     return(0);
+   }"
+-  HAVE_IB_GCC_SYNC_SYNCHRONISE
+-  )
+-  CHECK_C_SOURCE_RUNS(
+-  "#include<stdint.h>
++  HAVE_IB_GCC_SYNC_SYNCHRONISE)
++
++CHECK_CXX_SOURCE_COMPILES("
++  #include<stdint.h>
+   int main()
+   {
+     __atomic_thread_fence(__ATOMIC_ACQUIRE);
+     __atomic_thread_fence(__ATOMIC_RELEASE);
+     return(0);
+   }"
+-  HAVE_IB_GCC_ATOMIC_THREAD_FENCE
+-  )
+-  CHECK_C_SOURCE_RUNS(
+-  "#include<stdint.h>
++  HAVE_IB_GCC_ATOMIC_THREAD_FENCE)
++
++CHECK_CXX_SOURCE_COMPILES("
++  #include<stdint.h>
+   int main()
+   {
+     unsigned char	a = 0;
+@@ -164,9 +163,7 @@ IF(NOT CMAKE_CROSSCOMPILING)
+ 			      __ATOMIC_RELEASE, __ATOMIC_ACQUIRE);
+     return(0);
+   }"
+-  HAVE_IB_GCC_ATOMIC_COMPARE_EXCHANGE
+-  )
+-ENDIF()
++  HAVE_IB_GCC_ATOMIC_COMPARE_EXCHANGE)
+ 
+ IF(HAVE_IB_GCC_SYNC_SYNCHRONISE)
+  ADD_DEFINITIONS(-DHAVE_IB_GCC_SYNC_SYNCHRONISE=1)
+@@ -181,8 +178,7 @@ IF(HAVE_IB_GCC_ATOMIC_COMPARE_EXCHANGE)
+ ENDIF()
+ 
+  # either define HAVE_IB_ATOMIC_PTHREAD_T_GCC or not
+-IF(NOT CMAKE_CROSSCOMPILING)
+-  CHECK_C_SOURCE_RUNS(
++CHECK_CXX_SOURCE_COMPILES(
+   "
+   #include <pthread.h>
+   #include <string.h>
+@@ -201,14 +197,14 @@ IF(NOT CMAKE_CROSSCOMPILING)
+     return(0);
+   }"
+   HAVE_IB_ATOMIC_PTHREAD_T_GCC)
+-ENDIF()
++
+ IF(HAVE_IB_ATOMIC_PTHREAD_T_GCC)
+   ADD_DEFINITIONS(-DHAVE_IB_ATOMIC_PTHREAD_T_GCC=1)
+ ENDIF()
+ 
+ # Only use futexes on Linux if GCC atomics are available
+-IF(NOT MSVC AND NOT CMAKE_CROSSCOMPILING)
+-  CHECK_C_SOURCE_RUNS(
++IF(NOT MSVC)
++  CHECK_CXX_SOURCE_COMPILES(
+   "
+   #include <stdio.h>
+   #include <unistd.h>
diff --git a/patches/mysql-5.7.11/series b/patches/mysql-5.7.11/series
new file mode 100644
index 0000000..2d5f331
--- /dev/null
+++ b/patches/mysql-5.7.11/series
@@ -0,0 +1,4 @@
+# generated by git-ptx-patches
+#tag:base --start-number 1
+0001-Fix_buildsystem-use-compile-only-tests.patch
+# feb58169ae07f03fb795bfc9055f69a9  - git-ptx-patches magic
diff --git a/projectroot/etc/group b/projectroot/etc/group
index 5d49176..9ff5702 100644
--- a/projectroot/etc/group
+++ b/projectroot/etc/group
@@ -19,6 +19,7 @@ video:x:113:
 lock:x:114:
 audio:x:115:
 input:x:116:
+mysql:x:117:
 systemd-journal:x:201:
 systemd-network:x:202:
 systemd-journal-remote:x:203:
diff --git a/projectroot/etc/mysql/my.cnf b/projectroot/etc/mysql/my.cnf
new file mode 100644
index 0000000..909c0da
--- /dev/null
+++ b/projectroot/etc/mysql/my.cnf
@@ -0,0 +1,38 @@
+# For advice on how to change settings please see
+# http://dev.mysql.com/doc/refman/5.7/en/server-configuration-defaults.html
+
+[mysqld]
+innodb_force_recovery = 0
+
+# Remove leading # and set to the amount of RAM for the most important data
+# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
+innodb_buffer_pool_size = 8M
+
+# Remove leading # to turn on a very important data integrity option: logging
+# changes to the binary log between backups.
+# log_bin
+
+# Remove leading # to turn on error logging.
+# log_error=
+# log_error_verbosity=
+
+# we have a read-only filesystem with one persistent writeable area only
+# so point to this single writeable location
+datadir = /var/lib/mysql/data
+
+# These are commonly set, remove the # and set as required.
+# lc-messages-dir = .....
+# plugin-dir = .....
+# basedir = .....
+# port = .....
+# server_id = .....
+# socket = .....
+
+# Remove leading # to set options mainly useful for reporting servers.
+# The server defaults are faster for transactions and fast SELECTs.
+# Adjust sizes as needed, experiment to find the optimal values.
+join_buffer_size = 8M
+sort_buffer_size = 2M
+read_rnd_buffer_size = 2M
+
+sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
diff --git a/projectroot/etc/passwd b/projectroot/etc/passwd
index d8ccb40..b75ed9f 100644
--- a/projectroot/etc/passwd
+++ b/projectroot/etc/passwd
@@ -3,6 +3,7 @@ daemon:x:1:1:daemon:/usr/sbin:/bin/sh
 ftp:x:11:101:ftp user:/home:/bin/false
 www:x:12:102:www user:/home:/bin/false
 sshd:x:100:65534:SSH Server:/var/run/sshd:/bin/false
+mysql:x:101:117:mySQL Server:/var/run/mysql:/bin/false
 messagebus:x:103:104:messagebus:/dev/null:/bin/false
 systemd-network:x:202:202:systemd-network:/dev/null:/bin/false
 systemd-resolve:x:203:65534:systemd-resolve:/dev/null:/bin/false
diff --git a/projectroot/lib/systemd/system/mysqld.service b/projectroot/lib/systemd/system/mysqld.service
new file mode 100644
index 0000000..f92d49b
--- /dev/null
+++ b/projectroot/lib/systemd/system/mysqld.service
@@ -0,0 +1,48 @@
+# Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+#
+# systemd service file for MySQL forking server
+#
+
+[Unit]
+Description=MySQL Server
+Requires=mysqldinit.service
+After=mysqldinit.service
+
+[Service]
+User=mysql
+Group=mysql
+Type=forking
+
+PIDFile=/tmp/mysqld.pid
+
+# Disable service start and stop timeout logic of systemd for mysqld service.
+TimeoutSec=0
+
+# Start main service
+ExecStart=/usr/bin/mysqld --defaults-file=/etc/mysql/my.cnf --skip-ssl --pid-file=/tmp/mysqld.pid $MYSQLD_OPTS
+
+# Sets open_files_limit
+LimitNOFILE = 5000
+
+Restart=on-failure
+
+RestartPreventExitStatus=1
+
+PrivateTmp=false
+
+[Install]
+WantedBy=multi-user.target
+
diff --git a/projectroot/lib/systemd/system/mysqldinit.service b/projectroot/lib/systemd/system/mysqldinit.service
new file mode 100644
index 0000000..d7aefcc
--- /dev/null
+++ b/projectroot/lib/systemd/system/mysqldinit.service
@@ -0,0 +1,36 @@
+# Copyright (c) 2016, Pengutronix
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# mySQL run-time preparation
+#
+# Preparation must be run once if the "data" (=working directory) does not
+# exist yet.
+# Since we expect a read-only root filesystem, we need one writeable filesystem
+# part at "/var/mysql".
+#
+# Sinse we change some permissions, the script itself must run as user 'root'
+#
+
+[Unit]
+Description=MySQL Server Initialisation Service
+RequiresMountsFor=/var/lib/mysql
+ConditionPathExists=!/var/lib/mysql/data
+
+[Service]
+User=root
+Group=root
+Type=oneshot
+RemainAfterExit=yes
+
+ExecStart=/sbin/mysqlinit "/var/lib/mysql"
+
+[Install]
+WantedBy=multi-user.target
diff --git a/projectroot/sbin/mysqlinit b/projectroot/sbin/mysqlinit
new file mode 100644
index 0000000..72b6d1f
--- /dev/null
+++ b/projectroot/sbin/mysqlinit
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+MYSQLD_OPTS=
+
+# since mySQL runs as a regular user, we need to give its working directory
+# to it.
+
+chown mysql.mysql "$1"
+chmod 0755 "$1"
+
+# now let mySQL do its initializing job
+/usr/bin/mysqld --defaults-file=/etc/mysql/my.cnf --initialize --user=mysql --skip-ssl --pid-file=/tmp/mysqld.pid $MYSQLD_OPTS
diff --git a/rules/host-mysql.in b/rules/host-mysql.in
new file mode 100644
index 0000000..4600647
--- /dev/null
+++ b/rules/host-mysql.in
@@ -0,0 +1,10 @@
+## SECTION=hosttools_noprompt
+
+config HOST_MYSQL
+	tristate
+	select HOST_LIBAIO
+	select HOST_NCURSES
+	select HOST_CMAKE
+	select HOST_SYSTEMD
+	help
+	  Required host part of the mySQL build system
diff --git a/rules/host-mysql.make b/rules/host-mysql.make
new file mode 100644
index 0000000..bcee0a3
--- /dev/null
+++ b/rules/host-mysql.make
@@ -0,0 +1,56 @@
+# -*-makefile-*-
+#
+# Copyright (C) 2016 by Juergen Borleis <jbe@pengutronix.de>
+#
+# See CREDITS for details about who has contributed to this project.
+#
+# For further information about the PTXdist project and license conditions
+# see the README file.
+#
+
+#
+# We provide this package
+#
+HOST_PACKAGES-$(PTXCONF_HOST_MYSQL) += host-mysql
+
+#
+# Paths and names
+#
+HOST_MYSQL_BOOST		= $(MYSQL_BOOST)
+HOST_MYSQL_BOOST_SOURCE		= $(MYSQL_BOOST_SOURCE)
+$(HOST_MYSQL_BOOST_SOURCE)	= MYSQL_BOOST
+HOST_MYSQL_BOOST_DIR		= $(HOST_MYSQL_DIR)
+HOST_BOOST_LICENSE		:= BSL-1.0
+
+# ----------------------------------------------------------------------------
+# Extract
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/host-mysql.extract:
+	@$(call targetinfo)
+	@$(call clean, $(HOST_MYSQL_DIR))
+	@$(call extract, HOST_MYSQL)
+	@$(call extract, HOST_MYSQL_BOOST)
+	@$(call patchin, HOST_MYSQL)
+	@$(call touch)
+
+# ----------------------------------------------------------------------------
+# Prepare + Compile
+# ----------------------------------------------------------------------------
+
+#
+# cmake
+#
+HOST_MYSQL_CONF_TOOL	:= cmake
+HOST_MYSQL_CONF_OPT	:= \
+	$(HOST_CMAKE_OPT) \
+	-DBUILD_CONFIG=mysql_release \
+	-DCMAKE_INSTALL_PREFIX:PATH=/usr \
+	-DSTACK_DIRECTION=1 \
+	-DBOOST_INCLUDE_DIR=$(HOST_MYSQL_BOOST_DIR) \
+	-DLOCAL_BOOST_DIR=$(HOST_MYSQL_BOOST_DIR) \
+	-DHAVE_LLVM_LIBCPP_EXITCODE=no \
+	-DHAVE_FALLOC_PUNCH_HOLE_AND_KEEP_SIZE_EXITCODE=no \
+	-DWITH_ZLIB="bundled"
+
+# vim: syntax=make
diff --git a/rules/mysql.in b/rules/mysql.in
new file mode 100644
index 0000000..0aea6c2
--- /dev/null
+++ b/rules/mysql.in
@@ -0,0 +1,20 @@
+## SECTION=applications
+
+config MYSQL
+	tristate
+	select HOST_CMAKE
+	select HOST_MYSQL
+	select LIBAIO
+	select ZLIB
+	select LIBC_PTHREAD
+	select LIBC_RT
+	select LIBC_M
+	select LIBC_CRYPT
+	select LIBC_DL
+	select GCCLIBS_CXX
+	select GCCLIBS_GCC_S
+	select NCURSES
+	select SYSTEMD
+	prompt "mysql"
+	help
+	  mySQL, an SQL database engine
diff --git a/rules/mysql.make b/rules/mysql.make
new file mode 100644
index 0000000..a20eaa3
--- /dev/null
+++ b/rules/mysql.make
@@ -0,0 +1,158 @@
+# -*-makefile-*-
+#
+# Copyright (C) 2016 by Juergen Borleis <jbe@pengutronix.de>
+#
+# See CREDITS for details about who has contributed to this project.
+#
+# For further information about the PTXdist project and license conditions
+# see the README file.
+#
+
+#
+# We provide this package
+#
+PACKAGES-$(PTXCONF_MYSQL) += mysql
+
+#
+# Paths and names
+#
+MYSQL_VERSION	:= 5.7.11
+MYSQL_MD5	:= f84d945a40ed876d10f8d5a7f4ccba32
+MYSQL		:= mysql-$(MYSQL_VERSION)
+MYSQL_SUFFIX	:= tar.gz
+MYSQL_URL	:= http://cdn.mysql.com//Downloads/MySQL-5.7/$(MYSQL).tar.gz
+MYSQL_SOURCE	:= $(SRCDIR)/$(MYSQL).$(MYSQL_SUFFIX)
+MYSQL_DIR	:= $(BUILDDIR)/$(MYSQL)
+MYSQL_LICENSE	:= GPL-2.0
+
+# mySQL has a hard dependency to boost_1_59_0. Deal with it
+
+MYSQL_BOOST_VERSION	:= 1_59_0
+MYSQL_BOOST_MD5		:= 6aa9a5c6a4ca1016edd0ed1178e3cb87
+MYSQL_BOOST		:= boost_$(MYSQL_BOOST_VERSION)
+MYSQL_BOOST_SUFFIX	:= tar.bz2
+MYSQL_BOOST_URL		:= $(call ptx/mirror, SF, boost/$(MYSQL_BOOST).$(MYSQL_BOOST_SUFFIX))
+MYSQL_BOOST_SOURCE	:= $(SRCDIR)/$(MYSQL_BOOST).$(MYSQL_BOOST_SUFFIX)
+$(MYSQL_BOOST_SOURCE)	:= MYSQL_BOOST
+MYSQL_BOOST_DIR		:= $(MYSQL_DIR)
+
+# we need more than one archive to download
+MYSQL_SOURCES		:= $(MYSQL_SOURCE) $(MYSQL_BOOST_SOURCE)
+
+# ----------------------------------------------------------------------------
+# Extract
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/mysql.extract:
+	@$(call targetinfo)
+	@$(call clean, $(MYSQL_DIR))
+	@$(call extract, MYSQL)
+	@$(call extract, MYSQL_BOOST)
+	@$(call patchin, MYSQL)
+	@$(call touch)
+
+# ----------------------------------------------------------------------------
+# Prepare
+# ----------------------------------------------------------------------------
+
+#
+# cmake
+#
+MYSQL_CONF_TOOL	:= cmake
+MYSQL_CONF_OPT	:= \
+	$(CROSS_CMAKE_USR) \
+	-DBUILD_CONFIG=mysql_release \
+	-DSTACK_DIRECTION=1 \
+	-DHAVE_LLVM_LIBCPP_EXITCODE=no \
+	-DCMAKE_INSTALL_PREFIX:PATH=/usr \
+	-DWITH_ZLIB=system \
+	-DWITH_LZ4=bundled \
+	-DWITH_SSL=bundled \
+	-DCOMMUNITY_BUILD=ON \
+	-DBOOST_INCLUDE_DIR=$(MYSQL_BOOST_DIR) \
+	-DLOCAL_BOOST_DIR=$(MYSQL_BOOST_DIR) \
+	-DMYSQL_DATADIR=/usr/local/mysql/data \
+	-DMYSQL_KEYRINGDIR=/usr/local/mysql/keyring \
+	-DSYSCONFDIR=/etc/mysql \
+	-DSYSTEMD_PID_DIR=/run/mysql \
+	-DTMPDIR=/tmp \
+	-DWITH_EXTRA_CHARSETS=all \
+	-DWITH_UNIT_TESTS=OFF \
+	-DWITH_VALGRIND=OFF \
+	-DWITH_SYSTEMD=ON \
+	-DCOMPILATION_COMMENT=PTXdist \
+	-DDEFAULT_CHARSET=latin1
+
+# ----------------------------------------------------------------------------
+# Compile
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/mysql.compile:
+	@$(call targetinfo)
+	# we must copy it twice: once for the buildsystem, once for runtime
+	cp $(HOST_MYSQL_DIR)-build/sql/gen_lex_hash $(PTXDIST_SYSROOT_HOST)/bin
+	cp $(HOST_MYSQL_DIR)-build/sql/gen_lex_hash $(MYSQL_DIR)/sql
+	cp $(HOST_MYSQL_DIR)-build/sql/gen_lex_token $(PTXDIST_SYSROOT_HOST)/bin
+	cp $(HOST_MYSQL_DIR)-build/sql/gen_lex_token $(MYSQL_DIR)/sql
+	cp $(HOST_MYSQL_DIR)-build/extra/lz4_decompress $(PTXDIST_SYSROOT_HOST)/bin
+	cp $(HOST_MYSQL_DIR)-build/extra/lz4_decompress $(MYSQL_DIR)/extra
+	cp $(HOST_MYSQL_DIR)-build/extra/zlib_decompress $(PTXDIST_SYSROOT_HOST)/bin
+	cp $(HOST_MYSQL_DIR)-build/extra/zlib_decompress $(MYSQL_DIR)/extra
+	cp $(HOST_MYSQL_DIR)-build/extra/comp_err $(PTXDIST_SYSROOT_HOST)/bin
+	cp $(HOST_MYSQL_DIR)-build/extra/comp_err $(MYSQL_DIR)/extra
+	cp $(HOST_MYSQL_DIR)-build/scripts/comp_sql $(PTXDIST_SYSROOT_HOST)/bin
+	cp $(HOST_MYSQL_DIR)-build/scripts/comp_sql $(MYSQL_DIR)/scripts
+
+	@$(call world/compile, MYSQL)
+	@$(call touch)
+
+
+# ----------------------------------------------------------------------------
+# Target-Install
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/mysql.targetinstall:
+	@$(call targetinfo)
+
+	@$(call install_init, mysql)
+	@$(call install_fixup, mysql,PRIORITY,optional)
+	@$(call install_fixup, mysql,SECTION,base)
+	@$(call install_fixup, mysql,AUTHOR,"Juergen Borleis <jbe@pengutronix.de>")
+	@$(call install_fixup, mysql,DESCRIPTION,"mySQL service")
+
+#	# server stuff
+	@$(call install_copy, mysql, 0, 0, 0755, -, /usr/bin/mysqld)
+
+	@$(call install_alternative, mysql, 0, 0, 0755, /sbin/mysqlinit)
+	@$(call install_alternative, mysql, 0, 0, 0644, /lib/systemd/system/mysqldinit.service)
+	@$(call install_link, mysql, ../mysqldinit.service, \
+		/lib/systemd/system/multi-user.target.wants/mysqldinit.service)
+	@$(call install_alternative, mysql, 0, 0, 0644, /lib/systemd/system/mysqld.service)
+	@$(call install_link, mysql, ../mysqld.service, \
+		/lib/systemd/system/multi-user.target.wants/mysqld.service)
+	@$(call install_alternative, mysql, 0, 0, 0644, /etc/mysql/my.cnf)
+	@$(call install_copy, mysql, 0, 0, 0644, -, /usr/lib/plugin/keyring_file.so)
+
+#	# TODO: do we need more languages?
+	@$(call install_copy, mysql, 0, 0, 0755, -, /usr/share/english/errmsg.sys)
+
+#	# TODO: do we need more charsets?
+	@$(call install_copy, mysql, 0, 0, 0755, -, /usr/share/charsets/latin1.xml)
+
+#	# client stuff
+	@$(call install_copy, mysql, 0, 0, 0755, -, /usr/bin/mysql)
+	@$(call install_copy, mysql, 0, 0, 0755, -, /usr/bin/mysqladmin)
+	@$(call install_copy, mysql, 0, 0, 0755, -, /usr/bin/mysql_upgrade)
+	@$(call install_copy, mysql, 0, 0, 0755, -, /usr/bin/mysqlcheck)
+	@$(call install_copy, mysql, 0, 0, 0755, -, /usr/bin/mysqldump)
+
+	@$(call install_lib, mysql, 0, 0, 0644, libmysqlclient)
+
+#	# create a working directory which is writeable
+	@$(call install_copy, mysql, mysql, mysql, 0755, /var/lib/mysql)
+
+	@$(call install_finish, mysql)
+
+	@$(call touch)
+
+# vim: syntax=make
-- 
2.8.1


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [ptxdist] [PATCH 4/4] Qt5: add mySQL support
  2016-05-24 10:54 [ptxdist] [PATCH] mySQL: exhume a gone package Juergen Borleis
                   ` (2 preceding siblings ...)
  2016-05-24 10:54 ` [ptxdist] [PATCH 3/4] mySQL: exhume a gone package by updating it to a new release Juergen Borleis
@ 2016-05-24 10:54 ` Juergen Borleis
  2016-05-26  9:57 ` [ptxdist] [PATCH] mySQL: exhume a gone package Michael Olbrich
  4 siblings, 0 replies; 6+ messages in thread
From: Juergen Borleis @ 2016-05-24 10:54 UTC (permalink / raw)
  To: ptxdist

Enable the mySQL binding as one of the possible SQL databases in Qt

Signed-off-by: Juergen Borleis <jbe@pengutronix.de>
---
 rules/qt5.in   | 5 +++++
 rules/qt5.make | 6 +++++-
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/rules/qt5.in b/rules/qt5.in
index 9cdd9c2..ee5fb13 100644
--- a/rules/qt5.in
+++ b/rules/qt5.in
@@ -26,6 +26,7 @@ menuconfig QT5
 	select MESALIB_EGL_WAYLAND	if QT5_MODULE_QTWAYLAND_MESA
 	select PLATFORM_OPENGL		if QT5_OPENGL_ES2
 	select SQLITE			if QT5_MODULE_QTBASE_SQL_SQLITE
+	select MYSQL			if QT5_MODULE_QTBASE_SQL_MYSQL
 	select FONTCONFIG		if QT5_GUI
 	select FREETYPE			if QT5_GUI
 	select UDEV			if QT5_GUI || QT5_INPUT_LIBINPUT
@@ -321,6 +322,10 @@ config QT5_MODULE_QTBASE_SQL_SQLITE
 	bool
 	prompt "SQLite backend"
 
+config QT5_MODULE_QTBASE_SQL_MYSQL
+	bool
+	prompt "mySQL backend"
+
 endif
 
 endif
diff --git a/rules/qt5.make b/rules/qt5.make
index 9aeea3a..bf3895f 100644
--- a/rules/qt5.make
+++ b/rules/qt5.make
@@ -109,7 +109,7 @@ QT5_CONF_OPT	:= \
 	--$(call ptx/endis, PTXCONF_QT5_ACCESSIBILITY)-accessibility \
 	--disable-sql-db2 \
 	--disable-sql-ibase \
-	--disable-sql-mysql \
+	--$(call ptx/endis, PTXCONF_QT5_MODULE_QTBASE_SQL_MYSQL)-sql-mysql \
 	--disable-sql-oci \
 	--disable-sql-odbc \
 	--disable-sql-psql \
@@ -222,6 +222,10 @@ QT5_CONF_OPT += \
 	--$(call ptx/endis, PTXCONF_QT5_XRENDER)-xrender \
 	--$(call ptx/endis, PTXCONF_QT5_XV)-xvideo \
 
+ifdef PTXCONF_QT5_MODULE_QTBASE_SQL_MYSQL
+QT5_CONF_OPT += -mysql_config $(SYSROOT)/usr/bin/mysql_config
+endif
+
 QT5_QMAKE_OPT := CONFIG+=release CONFIG-=debug
 
 ifdef PTXCONF_QT5_MODULE_QTWEBENGINE
-- 
2.8.1


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [ptxdist] [PATCH] mySQL: exhume a gone package
  2016-05-24 10:54 [ptxdist] [PATCH] mySQL: exhume a gone package Juergen Borleis
                   ` (3 preceding siblings ...)
  2016-05-24 10:54 ` [ptxdist] [PATCH 4/4] Qt5: add mySQL support Juergen Borleis
@ 2016-05-26  9:57 ` Michael Olbrich
  4 siblings, 0 replies; 6+ messages in thread
From: Michael Olbrich @ 2016-05-26  9:57 UTC (permalink / raw)
  To: ptxdist

On Tue, May 24, 2016 at 12:54:29PM +0200, Juergen Borleis wrote:
> With 7e3cd4d1d83c24ff5070fea5b6789936351a880a the previous version of mySQL
> was gone. With this patch this package will be back in a more recent release.
> 
> Keep in mind: its a huge package. Huge at buildtime, huge at runtime.
> 
> Comments are welcome.

All applied. I've changed the libaio and the host rule.

Thanks,
Michael

> 
> jb
> 
> 
> _______________________________________________
> ptxdist mailing list
> ptxdist@pengutronix.de

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-05-26  9:57 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-24 10:54 [ptxdist] [PATCH] mySQL: exhume a gone package Juergen Borleis
2016-05-24 10:54 ` [ptxdist] [PATCH 1/4] libaio: add new package Juergen Borleis
2016-05-24 10:54 ` [ptxdist] [PATCH 2/4] mySQL: remove an orphaned file Juergen Borleis
2016-05-24 10:54 ` [ptxdist] [PATCH 3/4] mySQL: exhume a gone package by updating it to a new release Juergen Borleis
2016-05-24 10:54 ` [ptxdist] [PATCH 4/4] Qt5: add mySQL support Juergen Borleis
2016-05-26  9:57 ` [ptxdist] [PATCH] mySQL: exhume a gone package Michael Olbrich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox