From dcf02f2787877bcb03cb0fdb9bb26380c4c01627 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Canna=C3=B2?= Date: Fri, 11 Sep 2015 00:42:20 +0000 Subject: [PATCH] Improving packaging #375 Improving compiling time For ubuntu: - fixed version number - fixed architecture - added init script --- Makefile | 14 +++++++------- binaries/.gitignore | 4 ++++ scenarios/ubuntu-14.04-build/Dockerfile | 6 +++--- scenarios/ubuntu-14.04-build/proxysql.ctl | 12 +++++++----- 4 files changed, 21 insertions(+), 15 deletions(-) create mode 100644 binaries/.gitignore diff --git a/Makefile b/Makefile index deb08e800..104a7053b 100644 --- a/Makefile +++ b/Makefile @@ -26,11 +26,11 @@ debug: .PHONY: deps deps: - cd deps && make + cd deps && make -j .PHONY: lib lib: - cd lib && make -j 5 + cd lib && make -j .PHONY: src src: @@ -47,11 +47,10 @@ packages: centos7 ubuntu14 centos7: binaries/proxysql-0.3-1.x86_64.rpm .PHONY: centos -ubuntu14: binaries/proxysql_0.3_all.deb +ubuntu14: binaries/proxysql_0.2.0902_amd64.deb .PHONY: ubuntu14 binaries/proxysql-0.3-1.x86_64.rpm: - mkdir binaries/centos7 || true # Create CentOS 7 rpm file by creating docker image, running a container and extracting the RPM from the temp container docker build -t centos7_proxysql --no-cache=true ./scenarios/centos7-build docker run -i --name=centos7_build centos7_proxysql bash & @@ -60,11 +59,11 @@ binaries/proxysql-0.3-1.x86_64.rpm: docker kill centos7_build docker rm centos7_build -binaries/proxysql_0.3_all.deb: +binaries/proxysql_0.2.0902_amd64.deb: docker build -t ubuntu14_proxysql --no-cache=true ./scenarios/ubuntu-14.04-build docker run -i --name=ubuntu14_build ubuntu14_proxysql bash & sleep 5 - docker cp ubuntu14_build:/opt/proxysql/src/proxysql_0.3_all.deb ./binaries + docker cp ubuntu14_build:/opt/proxysql/proxysql_0.2.0902_amd64.deb ./binaries docker kill ubuntu14_build docker rm ubuntu14_build @@ -74,7 +73,8 @@ cleanall: cd deps && make cleanall cd lib && make clean cd src && make clean - rm binaries/* -r + rm binaries/*deb || true + rm binaries/*rpm || true install: src/proxysql install -m 0755 src/proxysql /usr/local/bin diff --git a/binaries/.gitignore b/binaries/.gitignore new file mode 100644 index 000000000..5e7d2734c --- /dev/null +++ b/binaries/.gitignore @@ -0,0 +1,4 @@ +# Ignore everything in this directory +* +# Except this file +!.gitignore diff --git a/scenarios/ubuntu-14.04-build/Dockerfile b/scenarios/ubuntu-14.04-build/Dockerfile index 1f11646a1..833f1c6c5 100644 --- a/scenarios/ubuntu-14.04-build/Dockerfile +++ b/scenarios/ubuntu-14.04-build/Dockerfile @@ -17,7 +17,7 @@ RUN apt-get update && apt-get install -y\ libtool RUN cd /opt; git clone https://github.com/sysown/proxysql-0.2.git proxysql -RUN cd /opt/proxysql; make clean && make -j 5 +RUN cd /opt/proxysql; make clean && make -j -ADD ./proxysql.ctl /opt/proxysql/src/proxysql.ctl -RUN cd /opt/proxysql/src; equivs-build proxysql.ctl +ADD ./proxysql.ctl /opt/proxysql/proxysql.ctl +RUN cd /opt/proxysql; equivs-build proxysql.ctl diff --git a/scenarios/ubuntu-14.04-build/proxysql.ctl b/scenarios/ubuntu-14.04-build/proxysql.ctl index 4d3f01f81..63f1990f8 100644 --- a/scenarios/ubuntu-14.04-build/proxysql.ctl +++ b/scenarios/ubuntu-14.04-build/proxysql.ctl @@ -4,17 +4,19 @@ Homepage: http://www.proxysql.com Standards-Version: 3.9.2 Package: proxysql -Version: 0.3 +Version: 0.2.0902 Maintainer: Rene Cannao -Architecture: all +Architecture: amd64 # Changelog: CHANGELOG.md # Readme: README.md -Files: proxysql /opt/proxysql - proxysql.cfg /etc +Files: src/proxysql /usr/bin/proxysql + etc/proxysql.cnf / + etc/init.d/proxysql / Description: High performance MySQL proxy ProxySQL is a fast, reliable MySQL proxy with advanced runtime configuration management (virtually no configuration change requires a restart). . It features query routing, query caching, query rewriting (for queries generated by ORMs, for example) and is most of the time a drop-in replacement for mysqld from the point of view of the application. It can be configured and remote controlled through an SQL-compatible admin interface. File: postinst #!/bin/sh -e - mkdir -p /var/run/proxysql \ No newline at end of file + if [ ! -d /var/run/proxysql ]; then mkdir /var/run/proxysql ; fi + update-rc.d proxysql defaults