From b933898884a085474d5e3dbae90ae3d7488d6984 Mon Sep 17 00:00:00 2001 From: glasseyes Date: Mon, 3 Sep 2018 15:17:41 +0700 Subject: [PATCH 01/29] scripts to build local Debian packages with pbuilder Makefile make deb - build debs for kmflcomp, libkmfl, ibus-kmfl make cow - set up pbuilder environment make tmpbuild(default) - build and install to /tmp/kmfl make install_local - build and install to /usr/local make uninstall_local - uninstall ibus-kmfl config file non-release version numbers will be stamped with date to distinguish between builds --- linux/Makefile | 16 +++++++++ linux/VERSION | 1 + linux/build.sh | 1 + linux/cow.sh | 37 +++++++++++++++++++++ linux/deb.sh | 59 ++++++++++++++++++++++++++++++++++ linux/ibus-kmfl/Makefile.am | 1 + linux/ibus-kmfl/VERSION | 1 + linux/ibus-kmfl/configure.ac | 7 +++- linux/ibus-kmfl/debian/control | 8 ++--- linux/kmflcomp/Makefile.am | 2 +- linux/kmflcomp/VERSION | 1 + linux/kmflcomp/configure.ac | 7 +++- linux/kmflcomp/debian/compat | 2 +- linux/kmflcomp/debian/control | 2 +- linux/kmflcomp/debian/rules | 3 ++ linux/libkmfl/Makefile.am | 2 +- linux/libkmfl/VERSION | 1 + linux/libkmfl/configure.ac | 7 +++- linux/libkmfl/debian/control | 4 +-- linux/libkmfl/debian/rules | 3 ++ 20 files changed, 152 insertions(+), 13 deletions(-) create mode 100644 linux/Makefile create mode 100644 linux/VERSION create mode 100755 linux/cow.sh create mode 100755 linux/deb.sh create mode 120000 linux/ibus-kmfl/VERSION create mode 120000 linux/kmflcomp/VERSION create mode 120000 linux/libkmfl/VERSION diff --git a/linux/Makefile b/linux/Makefile new file mode 100644 index 0000000000..a98d29572f --- /dev/null +++ b/linux/Makefile @@ -0,0 +1,16 @@ +#!/usr/bin/make + +tmpbuild: + ./build.sh + +install_local: + SUDOINSTALL="yes" ./build.sh + +uninstall_local: + SUDOINSTALL="uninstall" ./build.sh + +deb: cow + ./deb.sh + +cow: + ./cow.sh \ No newline at end of file diff --git a/linux/VERSION b/linux/VERSION new file mode 100644 index 0000000000..df7b9ee770 --- /dev/null +++ b/linux/VERSION @@ -0,0 +1 @@ +10.99.1 diff --git a/linux/build.sh b/linux/build.sh index b67557d777..9d5f8aa458 100755 --- a/linux/build.sh +++ b/linux/build.sh @@ -21,6 +21,7 @@ INSTALLDIR=${INSTALLDIR:-"/tmp/kmfl"} # autoreconf the projects for proj in kmflcomp libkmfl ibus-kmfl; do cd $proj + echo "Reconfiguring $proj" autoreconf -if cd $BASEDIR done diff --git a/linux/cow.sh b/linux/cow.sh new file mode 100755 index 0000000000..ee99958369 --- /dev/null +++ b/linux/cow.sh @@ -0,0 +1,37 @@ +#!/bin/bash + +# If needed set cowbuilder up for building Keyman Debian packages +# Then cowbuilder update + +set -e + +distributions='bionic xenial' + + +dpkgcheck=`dpkg-query -l cowbuilder` +if [ $? != 0 ]; then + + echo "installing pbuilder and cowbuilder" + sudo apt install pbuilder cowbuilder +else + echo "already have pbuilder and cowbuilder" +fi + +for dist in $distributions; do + if [ ! -d /var/cache/pbuilder/base-${dist}.cow ]; then + echo "making ${dist} cowbuilder" + sudo cowbuilder create --distribution ${dist} --basepath /var/cache/pbuilder/base-${dist}.cow --hookdir /var/cache/pbuilder/hook.d/${dist} + else + echo "already have ${dist} cowbuilder" + fi + sudo mkdir -p /var/cache/pbuilder/hook.d/${dist} + if [ ! -e /var/cache/pbuilder/hook.d/${dist}/D70results ]; then + sudo echo "#!/bin/bash" > /var/cache/pbuilder/hook.d/${dist}/D70results + sudo echo "cd /var/cache/pbuilder/result/bionic" >> /var/cache/pbuilder/hook.d/${dist}/D70results + sudo echo "/usr/bin/dpkg-scanpackages . /dev/null > /var/cache/pbuilder/result/bionic/Packages" >> /var/cache/pbuilder/hook.d/${dist}/D70results + sudo echo "/usr/bin/apt-get update" >> /var/cache/pbuilder/hook.d/${dist}/D70results + sudo ln -s /var/cache/pbuilder/hook.d/${dist}/D70results /var/cache/pbuilder/hook.d/${dist}/B70buildresults + fi + sudo mkdir -p /var/cache/pbuilder/result/${dist} + sudo cowbuilder update --distribution ${dist} --basepath /var/cache/pbuilder/base-${dist}.cow --override-config --othermirror="deb [trusted=yes] file:/var/cache/pbuilder/result/${dist} ./" --bindmounts /var/cache/pbuilder/result/${dist} --hookdir /var/cache/pbuilder/hook.d/${dist} +done \ No newline at end of file diff --git a/linux/deb.sh b/linux/deb.sh new file mode 100755 index 0000000000..5452820d73 --- /dev/null +++ b/linux/deb.sh @@ -0,0 +1,59 @@ +#!/bin/bash + +# Build Debian packages of Keyman with pbuilder + +# It must be run from the keyman/linux directory + + +set -e + +distributions='bionic xenial' +projects='kmflcomp libkmfl ibus-kmfl' +echo "distributions: ${distributions}" + +declare -A proj_versions=() +BASEDIR=`pwd` + +# autoreconf the projects +for proj in ${projects}; do + cd $proj + echo "Reconfiguring $proj" + autoreconf + cd $BASEDIR +done + +mkdir -p builddebs +mkdir -p builddebs/xenial +mkdir -p builddebs/bionic + +for proj in ${projects}; do + rm -rf deb-$proj + mkdir deb-$proj + cd deb-$proj + ../$proj/configure + make dist + tmp=`basename *.tar.gz .tar.gz` + origname=${tmp/$proj-/$proj\_} + index=`expr index "${origname}" _` + proj_versions[$proj]=${tmp:$index} + cp $proj*.tar.gz ../builddebs/${origname}.orig.tar.gz + cd ${BASEDIR} +done + +echo ${proj_versions} + + +for proj in ${projects}; do + cd builddebs + echo "$proj version ${proj_versions[$proj]}" + rm -rf ${proj}-${proj_versions[$proj]} + tar xfz ${proj}_${proj_versions[$proj]}.orig.tar.gz + cp -a ../$proj/debian ${proj}-${proj_versions[$proj]} + cd ${proj}-${proj_versions[$proj]} + dch -v ${proj_versions[$proj]}-1${dist} "local build" + for dist in ${distributions}; do + echo "$dist" + pdebuild --pbuilder cowbuilder --buildresult /var/cache/pbuilder/result/${dist} -- --basepath /var/cache/pbuilder/base-${dist}.cow --distribution ${dist} --override-config --othermirror="deb [trusted=yes] file:/var/cache/pbuilder/result/${dist} ./" --bindmounts /var/cache/pbuilder/result/${dist} --hookdir /var/cache/pbuilder/hook.d/${dist} + done + cd ${BASEDIR} +done diff --git a/linux/ibus-kmfl/Makefile.am b/linux/ibus-kmfl/Makefile.am index f8380a0369..4ec8500661 100644 --- a/linux/ibus-kmfl/Makefile.am +++ b/linux/ibus-kmfl/Makefile.am @@ -30,6 +30,7 @@ ACLOCAL_AMFLAGS = -I m4 EXTRA_DIST = \ autogen.sh \ @PACKAGE_NAME@.spec.in \ + VERSION \ $(NULL) noinst_DIST = \ diff --git a/linux/ibus-kmfl/VERSION b/linux/ibus-kmfl/VERSION new file mode 120000 index 0000000000..6ff19de4b8 --- /dev/null +++ b/linux/ibus-kmfl/VERSION @@ -0,0 +1 @@ +../VERSION \ No newline at end of file diff --git a/linux/ibus-kmfl/configure.ac b/linux/ibus-kmfl/configure.ac index d16fdc1fc9..f85cfb693f 100644 --- a/linux/ibus-kmfl/configure.ac +++ b/linux/ibus-kmfl/configure.ac @@ -29,7 +29,12 @@ m4_define(ibus_maybe_datestamp, m4_define([ibus_version], ibus_major_version.ibus_minor_version.ibus_micro_version[]ibus_maybe_datestamp) -AC_INIT([ibus-kmfl], [10.99.1], [http://code.google.com/p/ibus/issues/entry],[ibus-kmfl]) +# dev version +AC_INIT([ibus-kmfl], m4_esyscmd_s([vers=`cat VERSION`; echo "$vers.`date -u +"%Y%m%d%H%M%S"`"]), [https://github.com/ibus/ibus/issues/new]) + +# release version +# AC_INIT([ibus-kmfl], m4_esyscmd_s([cat VERSION]), [https://github.com/ibus/ibus/issues/new]) + AM_INIT_AUTOMAKE AC_GNU_SOURCE diff --git a/linux/ibus-kmfl/debian/control b/linux/ibus-kmfl/debian/control index 73eeb81181..0e3d0612d9 100644 --- a/linux/ibus-kmfl/debian/control +++ b/linux/ibus-kmfl/debian/control @@ -3,13 +3,13 @@ Section: utils Priority: optional Maintainer: Doug Rintoul Build-Depends: debhelper (>= 9), autotools-dev, dh-autoreconf, pkg-config, - libkmflcomp-dev, libkmfl-dev, libibus-1.0-dev (>= 1.2), x11proto-core-dev, libx11-dev -Standards-Version: 3.9.6 -Homepage: http://kmfl.sourceforge.net + libkmflcomp-dev (>=10.99.1), libkmfl-dev (>=10.99.1), libibus-1.0-dev (>= 1.2), x11proto-core-dev, libx11-dev +Standards-Version: 3.9.8 +Homepage: http://www.keyman.com Package: ibus-kmfl Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends}, libkmflcomp0, libkmfl0, ibus (>= 1.3.7) +Depends: ${shlibs:Depends}, ${misc:Depends}, ibus (>= 1.3.7) Description: kmfl engine for IBus IBus-kmfl is a IM Engine for multiple languages, based on IBus. . diff --git a/linux/kmflcomp/Makefile.am b/linux/kmflcomp/Makefile.am index 5a5e25acd4..32defa2b06 100644 --- a/linux/kmflcomp/Makefile.am +++ b/linux/kmflcomp/Makefile.am @@ -14,7 +14,7 @@ kmflcompdoc_DATA = \ INSTALL\ NEWS -EXTRA_DIST = $(kmflcompdoc_DATA) +EXTRA_DIST = $(kmflcompdoc_DATA) VERSION # Copy all the spec files. Of cource, only one is actually used. dist-hook: diff --git a/linux/kmflcomp/VERSION b/linux/kmflcomp/VERSION new file mode 120000 index 0000000000..6ff19de4b8 --- /dev/null +++ b/linux/kmflcomp/VERSION @@ -0,0 +1 @@ +../VERSION \ No newline at end of file diff --git a/linux/kmflcomp/configure.ac b/linux/kmflcomp/configure.ac index 51d90a4a1e..9590b8eb5e 100644 --- a/linux/kmflcomp/configure.ac +++ b/linux/kmflcomp/configure.ac @@ -3,7 +3,12 @@ dnl Created by Anjuta - will be overwritten dnl If you don't want it to overwrite it, dnl Please disable it in the Anjuta project configuration -AC_INIT(kmflcomp, 10.99.1) +# dev version +AC_INIT(kmflcomp, m4_esyscmd_s([vers=`cat VERSION`; echo "$vers.`date -u +"%Y%m%d%H%M%S"`"])) + +# release version +# AC_INIT(kmflcomp, m4_esyscmd_s([cat VERSION])) + AM_INIT_AUTOMAKE AM_CONFIG_HEADER(config.h) diff --git a/linux/kmflcomp/debian/compat b/linux/kmflcomp/debian/compat index f599e28b8a..ec635144f6 100644 --- a/linux/kmflcomp/debian/compat +++ b/linux/kmflcomp/debian/compat @@ -1 +1 @@ -10 +9 diff --git a/linux/kmflcomp/debian/control b/linux/kmflcomp/debian/control index 81d0788b76..7a8f7f696a 100644 --- a/linux/kmflcomp/debian/control +++ b/linux/kmflcomp/debian/control @@ -4,7 +4,7 @@ Section: utils Maintainer: Doug Rintoul Uploaders: Torsten Werner Homepage: http://kmfl.sourceforge.net/ -Build-Depends: cdbs (>= 0.4.27), debhelper (>= 10), libx11-dev +Build-Depends: cdbs (>= 0.4.27), debhelper (>= 9), libx11-dev, dh-autoreconf Standards-Version: 3.9.8.0 Package: libkmflcomp-dev diff --git a/linux/kmflcomp/debian/rules b/linux/kmflcomp/debian/rules index a1ed3896af..6c33a8e43e 100755 --- a/linux/kmflcomp/debian/rules +++ b/linux/kmflcomp/debian/rules @@ -6,6 +6,9 @@ include /usr/share/cdbs/1/rules/debhelper.mk include /usr/share/cdbs/1/class/autotools.mk include /usr/share/cdbs/1/rules/autoreconf.mk +DPKG_EXPORT_BUILDFLAGS = 1 +include /usr/share/dpkg/buildflags.mk + DEB_SHLIBDEPS_INCLUDE := debian/libkmflcomp/usr/lib/ DEB_DH_INSTALL_SOURCEDIR := debian/tmp diff --git a/linux/libkmfl/Makefile.am b/linux/libkmfl/Makefile.am index 1511e11440..108c62349d 100644 --- a/linux/libkmfl/Makefile.am +++ b/linux/libkmfl/Makefile.am @@ -11,7 +11,7 @@ libkmfldoc_DATA = \ INSTALL\ NEWS -EXTRA_DIST = $(libkmfldoc_DATA) +EXTRA_DIST = $(libkmfldoc_DATA) VERSION # Copy all the spec files. Of cource, only one is actually used. dist-hook: diff --git a/linux/libkmfl/VERSION b/linux/libkmfl/VERSION new file mode 120000 index 0000000000..6ff19de4b8 --- /dev/null +++ b/linux/libkmfl/VERSION @@ -0,0 +1 @@ +../VERSION \ No newline at end of file diff --git a/linux/libkmfl/configure.ac b/linux/libkmfl/configure.ac index ed486418b1..d28f92d922 100644 --- a/linux/libkmfl/configure.ac +++ b/linux/libkmfl/configure.ac @@ -3,7 +3,12 @@ dnl Created by Anjuta - will be overwritten dnl If you don't want it to overwrite it, dnl Please disable it in the Anjuta project configuration -AC_INIT(libkmfl, 10.99.1) +# dev version +AC_INIT(libkmfl, m4_esyscmd_s([vers=`cat VERSION`; echo "$vers.`date -u +"%Y%m%d%H%M%S"`"])) + +# release version +# AC_INIT(libkmfl, m4_esyscmd_s([cat VERSION])) + AM_INIT_AUTOMAKE AM_CONFIG_HEADER(config.h) diff --git a/linux/libkmfl/debian/control b/linux/libkmfl/debian/control index 2240aa48e5..48cebec165 100644 --- a/linux/libkmfl/debian/control +++ b/linux/libkmfl/debian/control @@ -2,8 +2,8 @@ Source: libkmfl Priority: optional Section: libs Maintainer: Doug Rintoul -Homepage: http://kmfl.sourceforge.net/ -Build-Depends: cdbs (>= 0.4.27), debhelper (>= 9), dh-autoreconf, libkmflcomp-dev +Homepage: http://www.keyman.com/ +Build-Depends: cdbs (>= 0.4.27), debhelper (>= 9), dh-autoreconf, libkmflcomp-dev (>=10.99.0) Standards-Version: 3.9.8.0 Package: libkmfl-dev diff --git a/linux/libkmfl/debian/rules b/linux/libkmfl/debian/rules index 2e9d43ec4d..158edeb42d 100755 --- a/linux/libkmfl/debian/rules +++ b/linux/libkmfl/debian/rules @@ -6,6 +6,9 @@ include /usr/share/cdbs/1/rules/debhelper.mk include /usr/share/cdbs/1/class/autotools.mk include /usr/share/cdbs/1/rules/autoreconf.mk +DPKG_EXPORT_BUILDFLAGS = 1 +include /usr/share/dpkg/buildflags.mk + DEB_SHLIBDEPS_INCLUDE := debian/libkmfl0/usr/lib/ DEB_DH_INSTALL_SOURCEDIR := debian/tmp From b9fa1754746a1a37e599f350ac77ce384718c85c Mon Sep 17 00:00:00 2001 From: glasseyes Date: Mon, 3 Sep 2018 15:29:58 +0700 Subject: [PATCH 02/29] gitignore from package building --- .gitignore | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.gitignore b/.gitignore index 2cadc62844..7f51db8ce6 100644 --- a/.gitignore +++ b/.gitignore @@ -254,6 +254,14 @@ ltsugar.m4 ltversion.m4 lt~obsolete.m4 libtool.m4 +__pycache__ +*.egg-info +build-* +deb-* +builddebs +make_deb +tmp/ +dist/ .DS_Store From 4d3a88eb1abff5f7ab4f953fb400a3cc45cdac73 Mon Sep 17 00:00:00 2001 From: glasseyes Date: Mon, 3 Sep 2018 17:16:41 +0700 Subject: [PATCH 03/29] also build keyman-config package --- linux/Makefile | 4 +++- linux/deb.sh | 34 +++++++++++++++++++++++++++------- linux/keyman-config/Makefile | 5 ++++- 3 files changed, 34 insertions(+), 9 deletions(-) diff --git a/linux/Makefile b/linux/Makefile index a98d29572f..f3eedd139a 100644 --- a/linux/Makefile +++ b/linux/Makefile @@ -9,8 +9,10 @@ install_local: uninstall_local: SUDOINSTALL="uninstall" ./build.sh -deb: cow +debnocow: ./deb.sh +deb: cow debnocow + cow: ./cow.sh \ No newline at end of file diff --git a/linux/deb.sh b/linux/deb.sh index 5452820d73..d4508fd4a0 100755 --- a/linux/deb.sh +++ b/linux/deb.sh @@ -7,15 +7,18 @@ set -e -distributions='bionic xenial' -projects='kmflcomp libkmfl ibus-kmfl' +distributions="bionic xenial" +autotool_projects="kmflcomp libkmfl ibus-kmfl" +all_projects="${autotool_projects} keyman-config" echo "distributions: ${distributions}" +echo "autotool_projects: ${autotool_projects}" +echo "all_projects: ${all_projects}" declare -A proj_versions=() BASEDIR=`pwd` # autoreconf the projects -for proj in ${projects}; do +for proj in ${autotool_projects}; do cd $proj echo "Reconfiguring $proj" autoreconf @@ -26,7 +29,7 @@ mkdir -p builddebs mkdir -p builddebs/xenial mkdir -p builddebs/bionic -for proj in ${projects}; do +for proj in ${autotool_projects}; do rm -rf deb-$proj mkdir deb-$proj cd deb-$proj @@ -40,18 +43,35 @@ for proj in ${projects}; do cd ${BASEDIR} done -echo ${proj_versions} +cd keyman-config +rm -rf dist make_deb build +python3 setup.py egg_info -b.`date -u +"%Y%m%d%H%M%S"` sdist +cd dist +ls *.tar.gz +tmp=`basename *.tar.gz .tar.gz` +origname=${tmp/keyman\_config-/keyman-config\_} +index=`expr index "${origname}" _` +proj_versions[keyman-config]=${tmp:$index} +kcversion=${proj_versions[keyman-config]} +echo "keyman-config version: ${kcversion}" -for proj in ${projects}; do +tar xf keyman_config-${kcversion}.tar.gz +mv keyman_config-${kcversion} keyman-config-${kcversion} +tar cfz keyman-config_${kcversion}.orig.tar.gz keyman-config-${kcversion} + +cp keyman-config_${kcversion}.orig.tar.gz ${BASEDIR}/builddebs/ +cd ${BASEDIR} + +for proj in ${all_projects}; do cd builddebs echo "$proj version ${proj_versions[$proj]}" rm -rf ${proj}-${proj_versions[$proj]} tar xfz ${proj}_${proj_versions[$proj]}.orig.tar.gz cp -a ../$proj/debian ${proj}-${proj_versions[$proj]} cd ${proj}-${proj_versions[$proj]} - dch -v ${proj_versions[$proj]}-1${dist} "local build" for dist in ${distributions}; do + dch -v ${proj_versions[$proj]}-1${dist} "local build" echo "$dist" pdebuild --pbuilder cowbuilder --buildresult /var/cache/pbuilder/result/${dist} -- --basepath /var/cache/pbuilder/base-${dist}.cow --distribution ${dist} --override-config --othermirror="deb [trusted=yes] file:/var/cache/pbuilder/result/${dist} ./" --bindmounts /var/cache/pbuilder/result/${dist} --hookdir /var/cache/pbuilder/hook.d/${dist} done diff --git a/linux/keyman-config/Makefile b/linux/keyman-config/Makefile index f17e8a2858..5cb2d8f150 100644 --- a/linux/keyman-config/Makefile +++ b/linux/keyman-config/Makefile @@ -11,10 +11,13 @@ install: clean: -rm -rf dist make_deb build +devdist: + python3 setup.py egg_info -b.`date -u +"%Y%m%d%H%M%S"` sdist + dist: clean python3 setup.py sdist -deb: clean dist man +deb: clean devdist man -mkdir make_deb cd make_deb && tar xf ../dist/keyman_config-$(VERSION).tar.gz && \ mv keyman_config-$(VERSION) keyman-config-$(VERSION) && \ From ec0102c4d9c70dad54ecd0bec860fb82421fdde5 Mon Sep 17 00:00:00 2001 From: glasseyes Date: Mon, 3 Sep 2018 20:01:54 +0700 Subject: [PATCH 04/29] add make nightlydist target also autotools update --- linux/Makefile | 5 ++++- linux/build.sh | 23 +++++++++++++++++++++++ linux/ibus-kmfl/po/ibus-kmfl.pot | 6 +++--- linux/ibus-kmfl/po/zh_CN.gmo | Bin 420 -> 376 bytes linux/ibus-kmfl/po/zh_CN.po | 6 +++--- linux/libkmfl/debian/control | 2 +- 6 files changed, 34 insertions(+), 8 deletions(-) diff --git a/linux/Makefile b/linux/Makefile index f3eedd139a..921a8ba175 100644 --- a/linux/Makefile +++ b/linux/Makefile @@ -15,4 +15,7 @@ debnocow: deb: cow debnocow cow: - ./cow.sh \ No newline at end of file + ./cow.sh + +nightlydist: + ./build.sh dist \ No newline at end of file diff --git a/linux/build.sh b/linux/build.sh index 9d5f8aa458..f498d9cdb9 100755 --- a/linux/build.sh +++ b/linux/build.sh @@ -18,14 +18,37 @@ SUDOINSTALL=${SUDOINSTALL:-"no"} INSTALLDIR=${INSTALLDIR:-"/tmp/kmfl"} +if [ "$1" == "dist" ]; then + rm -rf dist + mkdir -p ../dist +fi + # autoreconf the projects for proj in kmflcomp libkmfl ibus-kmfl; do cd $proj echo "Reconfiguring $proj" autoreconf -if + if [ "$1" == "dist" ]; then + mkdir -p ../dist + rm -rf ../build-$proj + mkdir -p ../build-$proj + cd ../build-$proj + ../$proj/configure + make dist + mv *.tar.gz ../dist + fi cd $BASEDIR done +if [ "$1" == "dist" ]; then + cd keyman-config + rm -rf dist + python3 setup.py egg_info -b.`date -u +"%Y%m%d%H%M%S"` sdist + cp dist/*.tar.gz ../dist + exit 0 +fi + + if [[ "${SUDOINSTALL}" == "uninstall" ]] then echo "putting ibus-kmfl package component file back" diff --git a/linux/ibus-kmfl/po/ibus-kmfl.pot b/linux/ibus-kmfl/po/ibus-kmfl.pot index b69b4bcb88..0e9805ab9d 100644 --- a/linux/ibus-kmfl/po/ibus-kmfl.pot +++ b/linux/ibus-kmfl/po/ibus-kmfl.pot @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"Report-Msgid-Bugs-To: http://code.google.com/p/ibus/issues/entry\n" -"POT-Creation-Date: 2016-12-07 15:26-0800\n" +"Report-Msgid-Bugs-To: https://github.com/ibus/ibus/issues/new\n" +"POT-Creation-Date: 2018-09-03 16:25+0700\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -17,6 +17,6 @@ msgstr "" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" -#: src/kmflutil.c:240 +#: src/kmflutil.c:294 msgid "KMFL" msgstr "" diff --git a/linux/ibus-kmfl/po/zh_CN.gmo b/linux/ibus-kmfl/po/zh_CN.gmo index b8045814a5893df16180a2ee6406570791477009..750b1a747e48232fd60ea321178db5149820769c 100644 GIT binary patch delta 50 zcmZ3&{DWzN3Zvab)ga|!D}DX+%#w`KB)#PPT>Z?X(qbr4TwI!3te=-!KJnN+0Jmro A_y7O^ delta 94 zcmeytw1jzr3S-tp)gXT>ef{M8lvKU+{QUHsRK4WS$5%%sv{{mkOx($r%8)Vz|S yO0EF^5MAe@)Wnj^{5)Nk#FA7i1tSAPGhIU?T?2CkLsKgwGhG7<1A~dP?g0SogdT?g diff --git a/linux/ibus-kmfl/po/zh_CN.po b/linux/ibus-kmfl/po/zh_CN.po index 308433a7ba..21e592b196 100644 --- a/linux/ibus-kmfl/po/zh_CN.po +++ b/linux/ibus-kmfl/po/zh_CN.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"Report-Msgid-Bugs-To: http://code.google.com/p/ibus/issues/entry\n" -"POT-Creation-Date: 2016-12-07 15:26-0800\n" +"Report-Msgid-Bugs-To: https://github.com/ibus/ibus/issues/new\n" +"POT-Creation-Date: 2018-09-03 16:25+0700\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -17,6 +17,6 @@ msgstr "" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" -#: src/kmflutil.c:240 +#: src/kmflutil.c:294 msgid "KMFL" msgstr "" diff --git a/linux/libkmfl/debian/control b/linux/libkmfl/debian/control index 48cebec165..cb55cadf46 100644 --- a/linux/libkmfl/debian/control +++ b/linux/libkmfl/debian/control @@ -4,7 +4,7 @@ Section: libs Maintainer: Doug Rintoul Homepage: http://www.keyman.com/ Build-Depends: cdbs (>= 0.4.27), debhelper (>= 9), dh-autoreconf, libkmflcomp-dev (>=10.99.0) -Standards-Version: 3.9.8.0 +Standards-Version: 3.9.7 Package: libkmfl-dev Section: libdevel From a620b56399fcd004c555a1f9e83923fd5515bbe9 Mon Sep 17 00:00:00 2001 From: glasseyes Date: Tue, 4 Sep 2018 14:40:34 +0700 Subject: [PATCH 05/29] make Debian source packages --- .gitignore | 1 + linux/Makefile | 30 +++++++++++--- linux/build.sh | 31 --------------- linux/deb.sh | 77 +++++++++++++----------------------- linux/dist.sh | 67 +++++++++++++++++++++++++++++++ linux/ibus-kmfl/configure.ac | 6 +-- linux/kmflcomp/configure.ac | 6 +-- linux/libkmfl/configure.ac | 6 +-- linux/reconf.sh | 29 ++++++++++++++ 9 files changed, 152 insertions(+), 101 deletions(-) create mode 100755 linux/dist.sh create mode 100755 linux/reconf.sh diff --git a/.gitignore b/.gitignore index 7f51db8ce6..1cf96743b4 100644 --- a/.gitignore +++ b/.gitignore @@ -262,6 +262,7 @@ builddebs make_deb tmp/ dist/ +*~ .DS_Store diff --git a/linux/Makefile b/linux/Makefile index 921a8ba175..aedb18c292 100644 --- a/linux/Makefile +++ b/linux/Makefile @@ -1,21 +1,39 @@ #!/usr/bin/make -tmpbuild: +tmpbuild: devreconf ./build.sh -install_local: +install_local: devreconf SUDOINSTALL="yes" ./build.sh -uninstall_local: +uninstall_local: devreconf SUDOINSTALL="uninstall" ./build.sh debnocow: ./deb.sh -deb: cow debnocow +reconf: + ./reconf.sh + +dist: + ./dist.sh + +origdist: + ./dist.sh origdist + +sourcepackage: + ./deb.sh sourcepackage + +devreconf: + ./reconf.sh dev cow: ./cow.sh -nightlydist: - ./build.sh dist \ No newline at end of file +deb: devreconf origdist cow debnocow + echo "Built dev Debian packages in builddebs/" + +releasedeb: reconf origdist cow debnocow + echo "Built release Debian packages in builddebs/" + +nightlydist: devreconf dist \ No newline at end of file diff --git a/linux/build.sh b/linux/build.sh index f498d9cdb9..58cd867b9e 100755 --- a/linux/build.sh +++ b/linux/build.sh @@ -18,37 +18,6 @@ SUDOINSTALL=${SUDOINSTALL:-"no"} INSTALLDIR=${INSTALLDIR:-"/tmp/kmfl"} -if [ "$1" == "dist" ]; then - rm -rf dist - mkdir -p ../dist -fi - -# autoreconf the projects -for proj in kmflcomp libkmfl ibus-kmfl; do - cd $proj - echo "Reconfiguring $proj" - autoreconf -if - if [ "$1" == "dist" ]; then - mkdir -p ../dist - rm -rf ../build-$proj - mkdir -p ../build-$proj - cd ../build-$proj - ../$proj/configure - make dist - mv *.tar.gz ../dist - fi - cd $BASEDIR -done - -if [ "$1" == "dist" ]; then - cd keyman-config - rm -rf dist - python3 setup.py egg_info -b.`date -u +"%Y%m%d%H%M%S"` sdist - cp dist/*.tar.gz ../dist - exit 0 -fi - - if [[ "${SUDOINSTALL}" == "uninstall" ]] then echo "putting ibus-kmfl package component file back" diff --git a/linux/deb.sh b/linux/deb.sh index d4508fd4a0..4fba76b495 100755 --- a/linux/deb.sh +++ b/linux/deb.sh @@ -4,7 +4,6 @@ # It must be run from the keyman/linux directory - set -e distributions="bionic xenial" @@ -14,64 +13,44 @@ echo "distributions: ${distributions}" echo "autotool_projects: ${autotool_projects}" echo "all_projects: ${all_projects}" -declare -A proj_versions=() BASEDIR=`pwd` -# autoreconf the projects -for proj in ${autotool_projects}; do - cd $proj - echo "Reconfiguring $proj" - autoreconf - cd $BASEDIR -done - mkdir -p builddebs -mkdir -p builddebs/xenial -mkdir -p builddebs/bionic -for proj in ${autotool_projects}; do - rm -rf deb-$proj - mkdir deb-$proj - cd deb-$proj - ../$proj/configure - make dist - tmp=`basename *.tar.gz .tar.gz` - origname=${tmp/$proj-/$proj\_} - index=`expr index "${origname}" _` - proj_versions[$proj]=${tmp:$index} - cp $proj*.tar.gz ../builddebs/${origname}.orig.tar.gz - cd ${BASEDIR} +vers=`ls dist/kmflcomp_*.orig.tar.gz` +echo "${vers}" +vers=${vers##*_} +echo "${vers}" +vers=${vers%*.orig.tar.gz} +echo "${vers}" + +cd builddebs +for proj in ${all_projects}; do + cp -a ../dist/${proj}_${vers}.orig.tar.gz . + tar xfz ${proj}_${vers}.orig.tar.gz + cp -a ../${proj}/debian ${proj}-${vers} + cd ${proj}-${vers} + dch -v ${vers}-1 "local build" + echo "${proj}-${vers}" + debuild -d -S -sa -Zxz -us -uc + cd $BASEDIR/builddebs + rm -rf ${proj}-${vers} done +cd $BASEDIR -cd keyman-config -rm -rf dist make_deb build -python3 setup.py egg_info -b.`date -u +"%Y%m%d%H%M%S"` sdist -cd dist -ls *.tar.gz -tmp=`basename *.tar.gz .tar.gz` -origname=${tmp/keyman\_config-/keyman-config\_} -index=`expr index "${origname}" _` -proj_versions[keyman-config]=${tmp:$index} -kcversion=${proj_versions[keyman-config]} - -echo "keyman-config version: ${kcversion}" - -tar xf keyman_config-${kcversion}.tar.gz -mv keyman_config-${kcversion} keyman-config-${kcversion} -tar cfz keyman-config_${kcversion}.orig.tar.gz keyman-config-${kcversion} - -cp keyman-config_${kcversion}.orig.tar.gz ${BASEDIR}/builddebs/ -cd ${BASEDIR} +if [ "$1" == "sourcepackage" ]; then + exit 0 +fi for proj in ${all_projects}; do cd builddebs - echo "$proj version ${proj_versions[$proj]}" - rm -rf ${proj}-${proj_versions[$proj]} - tar xfz ${proj}_${proj_versions[$proj]}.orig.tar.gz - cp -a ../$proj/debian ${proj}-${proj_versions[$proj]} - cd ${proj}-${proj_versions[$proj]} + # echo "$proj version ${vers}" + # rm -rf ${proj}-${vers} + # tar xfz ${proj}_${vers}.orig.tar.gz + # cp -a ../$proj/debian ${proj}-${vers} + # cd ${proj}-${vers} for dist in ${distributions}; do - dch -v ${proj_versions[$proj]}-1${dist} "local build" + dch -v ${vers}-1${dist} "local build" echo "$dist" pdebuild --pbuilder cowbuilder --buildresult /var/cache/pbuilder/result/${dist} -- --basepath /var/cache/pbuilder/base-${dist}.cow --distribution ${dist} --override-config --othermirror="deb [trusted=yes] file:/var/cache/pbuilder/result/${dist} ./" --bindmounts /var/cache/pbuilder/result/${dist} --hookdir /var/cache/pbuilder/hook.d/${dist} done diff --git a/linux/dist.sh b/linux/dist.sh new file mode 100755 index 0000000000..8c5dfdb9b2 --- /dev/null +++ b/linux/dist.sh @@ -0,0 +1,67 @@ +#!/bin/bash + +# Build dist tarballs or Debian orig tarballs +# and put them in dist/ + +# parameters: +# origdist = create Debian orig.tar.gz + +set -e + +BASEDIR=`pwd` +autotool_projects="kmflcomp libkmfl ibus-kmfl" + +rm -rf dist +mkdir -p dist + +# configure and make dist for autotool projects +for proj in ${autotool_projects}; do + cd $proj + rm -rf ../build-$proj + mkdir -p ../build-$proj + cd ../build-$proj + ../$proj/configure + make dist + mv *.tar.gz ../dist + cd $BASEDIR +done + +cd kmflcomp +baseversion=`cat VERSION` +echo "baseversion: ${baseversion}" +distversion=`./configure --version|grep kmfl|grep -Po 'kmflcomp configure \K[^a-z]*'` +echo "distversion: ${distversion}" + +cd ../keyman-config +rm -rf dist +if [ "${distversion}" == "${baseversion}" ]; then + python3 setup.py sdist +else + datever=${distversion##*.} + echo "datever: ${datever}" + python3 setup.py egg_info -b.${datever} sdist +fi +cp dist/*.tar.gz ../dist +cd $BASEDIR + +if [ "$1" == "origdist" ]; then + cd dist + for proj in ${autotool_projects}; do + tmp=`basename ${proj}*.tar.gz .tar.gz` + origname=${tmp/$proj-/$proj\_} + index=`expr index "${origname}" _` + mv $proj*.tar.gz ${origname}.orig.tar.gz + done + + tmp=`basename keyman\_config*.tar.gz .tar.gz` + origname=${tmp/keyman\_config-/keyman-config\_} + index=`expr index "${origname}" _` + kcversion=${tmp:$index} + + echo "keyman-config version: ${kcversion}" + + tar xf keyman_config-${kcversion}.tar.gz + mv keyman_config-${kcversion} keyman-config-${kcversion} + tar cfz keyman-config_${kcversion}.orig.tar.gz keyman-config-${kcversion} + rm -rf keyman-config-${kcversion} keyman_config-${kcversion}.tar.gz +fi diff --git a/linux/ibus-kmfl/configure.ac b/linux/ibus-kmfl/configure.ac index f85cfb693f..75157dcfe7 100644 --- a/linux/ibus-kmfl/configure.ac +++ b/linux/ibus-kmfl/configure.ac @@ -29,11 +29,7 @@ m4_define(ibus_maybe_datestamp, m4_define([ibus_version], ibus_major_version.ibus_minor_version.ibus_micro_version[]ibus_maybe_datestamp) -# dev version -AC_INIT([ibus-kmfl], m4_esyscmd_s([vers=`cat VERSION`; echo "$vers.`date -u +"%Y%m%d%H%M%S"`"]), [https://github.com/ibus/ibus/issues/new]) - -# release version -# AC_INIT([ibus-kmfl], m4_esyscmd_s([cat VERSION]), [https://github.com/ibus/ibus/issues/new]) +AC_INIT([ibus-kmfl], m4_esyscmd_s([cat VERSION]), [https://github.com/ibus/ibus/issues/new]) AM_INIT_AUTOMAKE AC_GNU_SOURCE diff --git a/linux/kmflcomp/configure.ac b/linux/kmflcomp/configure.ac index 9590b8eb5e..4028622bb3 100644 --- a/linux/kmflcomp/configure.ac +++ b/linux/kmflcomp/configure.ac @@ -3,11 +3,7 @@ dnl Created by Anjuta - will be overwritten dnl If you don't want it to overwrite it, dnl Please disable it in the Anjuta project configuration -# dev version -AC_INIT(kmflcomp, m4_esyscmd_s([vers=`cat VERSION`; echo "$vers.`date -u +"%Y%m%d%H%M%S"`"])) - -# release version -# AC_INIT(kmflcomp, m4_esyscmd_s([cat VERSION])) +AC_INIT(kmflcomp, m4_esyscmd_s([cat VERSION])) AM_INIT_AUTOMAKE diff --git a/linux/libkmfl/configure.ac b/linux/libkmfl/configure.ac index d28f92d922..d11d47ad35 100644 --- a/linux/libkmfl/configure.ac +++ b/linux/libkmfl/configure.ac @@ -3,11 +3,7 @@ dnl Created by Anjuta - will be overwritten dnl If you don't want it to overwrite it, dnl Please disable it in the Anjuta project configuration -# dev version -AC_INIT(libkmfl, m4_esyscmd_s([vers=`cat VERSION`; echo "$vers.`date -u +"%Y%m%d%H%M%S"`"])) - -# release version -# AC_INIT(libkmfl, m4_esyscmd_s([cat VERSION])) +AC_INIT(libkmfl, m4_esyscmd_s([cat VERSION])) AM_INIT_AUTOMAKE diff --git a/linux/reconf.sh b/linux/reconf.sh new file mode 100755 index 0000000000..7351159aba --- /dev/null +++ b/linux/reconf.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +# autoreconf autotool projects + +# parameters: +# dev = append current GMT datetime to VERSION + +set -e + +BASEDIR=`pwd` +autotool_projects="kmflcomp libkmfl ibus-kmfl" + +if [ "$1" == "dev" ]; then + vers=`cat VERSION` + datevers=`date -u +"%Y%m%d%H%M%S"` + echo "$vers.${datevers}" > VERSION +fi + +# autoreconf the projects +for proj in ${autotool_projects}; do + cd $proj + echo "Reconfiguring $proj to version `cat VERSION`" + autoreconf -if + cd $BASEDIR +done + +if [ "$1" == "dev" ]; then + echo "${vers}" > VERSION +fi From e4602588ee6772de284ed3d37a877c07753c0a80 Mon Sep 17 00:00:00 2001 From: glasseyes Date: Tue, 4 Sep 2018 15:22:47 +0700 Subject: [PATCH 06/29] allow scripts to run on individual projects potentially useful for jenkins if it has to make the source packages individually --- linux/Makefile | 8 +++- linux/deb.sh | 99 +++++++++++++++++++++++++++++++++++++++---------- linux/dist.sh | 84 +++++++++++++++++++++++++++++------------ linux/reconf.sh | 29 ++++++++++++--- 4 files changed, 169 insertions(+), 51 deletions(-) diff --git a/linux/Makefile b/linux/Makefile index aedb18c292..b3295508c1 100644 --- a/linux/Makefile +++ b/linux/Makefile @@ -21,7 +21,10 @@ dist: origdist: ./dist.sh origdist -sourcepackage: +sourcepackage: reconf origdist + ./deb.sh sourcepackage + +devsourcepackage: devreconf origdist ./deb.sh sourcepackage devreconf: @@ -36,4 +39,5 @@ deb: devreconf origdist cow debnocow releasedeb: reconf origdist cow debnocow echo "Built release Debian packages in builddebs/" -nightlydist: devreconf dist \ No newline at end of file +nightlydist: devreconf dist + echo "Built nightly source release in dist/" diff --git a/linux/deb.sh b/linux/deb.sh index 4fba76b495..da4f575301 100755 --- a/linux/deb.sh +++ b/linux/deb.sh @@ -4,28 +4,88 @@ # It must be run from the keyman/linux directory +# parameters: ./deb.sh [sourcepackage] [proj] [dist] +# sourcepackage = only create Debian source package +# proj = only build for this project +# dist = only build for this distribution + set -e -distributions="bionic xenial" -autotool_projects="kmflcomp libkmfl ibus-kmfl" -all_projects="${autotool_projects} keyman-config" -echo "distributions: ${distributions}" -echo "autotool_projects: ${autotool_projects}" +all_distributions="bionic xenial" +distributions="" +all_projects="kmflcomp libkmfl ibus-kmfl keyman-config" +projects="" +echo "all_distributions: ${all_distributions}" echo "all_projects: ${all_projects}" +if [ "$1" == "sourcepackage" ]; then + if [ "$2" != "" ]; then + for proj in ${all_projects}; do + if [ "${proj}" == "$2" ]; then + projects="$2" + fi + done + if [ "${projects}" == "" ]; then + echo "project $2 does not exist" + exit 1 + fi + fi +else + if [ "$1" != "" ]; then + for proj in ${all_projects}; do + if [ "${proj}" == "$1" ]; then + projects="$1" + fi + done + if [ "${projects}" == "" ]; then + for dist in ${all_distributions}; do + if [ "${dist}" == "$1" ]; then + distributions="$1" + projects="${all_projects}" + fi + done + if [ "${distributions}" == "" ]; then + echo "project or distribution $1 does not exist" + exit 1 + fi + else + if [ "$2" != "" ]; then + for dist in ${all_distributions}; do + if [ "${dist}" == "$2" ]; then + distributions="$2" + fi + done + if [ "${distributions}" == "" ]; then + echo "project or distribution $1 does not exist" + exit 1 + fi + fi + fi + fi +fi + +if [ "${projects}" == "" ]; then + projects="${all_projects}" +fi +if [ "${distributions}" == "" ]; then + distributions="${all_distributions}" +fi + +echo "distributions: ${distributions}" +echo "projects: ${projects}" + BASEDIR=`pwd` mkdir -p builddebs -vers=`ls dist/kmflcomp_*.orig.tar.gz` -echo "${vers}" -vers=${vers##*_} -echo "${vers}" -vers=${vers%*.orig.tar.gz} -echo "${vers}" - cd builddebs -for proj in ${all_projects}; do +for proj in ${projects}; do + vers=`ls ../dist/${proj}_*.orig.tar.gz` + # echo "${vers}" + vers=${vers##*_} + # echo "${vers}" + vers=${vers%*.orig.tar.gz} + # echo "${vers}" cp -a ../dist/${proj}_${vers}.orig.tar.gz . tar xfz ${proj}_${vers}.orig.tar.gz cp -a ../${proj}/debian ${proj}-${vers} @@ -42,15 +102,14 @@ if [ "$1" == "sourcepackage" ]; then exit 0 fi -for proj in ${all_projects}; do +for proj in ${projects}; do cd builddebs - # echo "$proj version ${vers}" - # rm -rf ${proj}-${vers} - # tar xfz ${proj}_${vers}.orig.tar.gz - # cp -a ../$proj/debian ${proj}-${vers} - # cd ${proj}-${vers} + echo "$proj version ${vers}" + rm -rf ${proj}-${vers} + dpkg-source -x ${proj}_${vers}-1.dsc + cd ${proj}-${vers} for dist in ${distributions}; do - dch -v ${vers}-1${dist} "local build" + dch -v ${vers}-1${dist} "local build for ${dist}" echo "$dist" pdebuild --pbuilder cowbuilder --buildresult /var/cache/pbuilder/result/${dist} -- --basepath /var/cache/pbuilder/base-${dist}.cow --distribution ${dist} --override-config --othermirror="deb [trusted=yes] file:/var/cache/pbuilder/result/${dist} ./" --bindmounts /var/cache/pbuilder/result/${dist} --hookdir /var/cache/pbuilder/hook.d/${dist} done diff --git a/linux/dist.sh b/linux/dist.sh index 8c5dfdb9b2..b2cc81a5fa 100755 --- a/linux/dist.sh +++ b/linux/dist.sh @@ -3,13 +3,44 @@ # Build dist tarballs or Debian orig tarballs # and put them in dist/ -# parameters: +# parameters: ./dist.sh [origdist] [proj] # origdist = create Debian orig.tar.gz +# proj = only make tarball for this project set -e BASEDIR=`pwd` autotool_projects="kmflcomp libkmfl ibus-kmfl" +extra_project="keyman-config" + +if [ "$1" == "origdist" ]; then + if [ "$2" != "" ]; then + if [ ! -d "$2" ]; then + echo "project $2 does not exist" + exit 1 + fi + if [ "$2" == "keyman-config" ]; then + autotool_projects="" + else + autotool_projects="$2" + extra_project="" + fi + fi +else + if [ "$1" != "" ]; then + if [ ! -d "$1" ]; then + echo "project $1 does not exist" + exit 1 + fi + if [ "$1" == "keyman-config" ]; then + autotool_projects="" + else + autotool_projects="$1" + extra_project="" + fi + fi +fi + rm -rf dist mkdir -p dist @@ -26,22 +57,25 @@ for proj in ${autotool_projects}; do cd $BASEDIR done -cd kmflcomp -baseversion=`cat VERSION` -echo "baseversion: ${baseversion}" -distversion=`./configure --version|grep kmfl|grep -Po 'kmflcomp configure \K[^a-z]*'` -echo "distversion: ${distversion}" -cd ../keyman-config -rm -rf dist -if [ "${distversion}" == "${baseversion}" ]; then - python3 setup.py sdist -else - datever=${distversion##*.} - echo "datever: ${datever}" - python3 setup.py egg_info -b.${datever} sdist +if [ "${extra_project}" == "keyman-config" ]; then + cd kmflcomp + baseversion=`cat VERSION` + echo "baseversion: ${baseversion}" + distversion=`./configure --version|grep kmfl|grep -Po 'kmflcomp configure \K[^a-z]*'` + echo "distversion: ${distversion}" + + cd ../keyman-config + rm -rf dist + if [ "${distversion}" == "${baseversion}" ]; then + python3 setup.py sdist + else + datever=${distversion##*.} + echo "datever: ${datever}" + python3 setup.py egg_info -b.${datever} sdist + fi + cp dist/*.tar.gz ../dist fi -cp dist/*.tar.gz ../dist cd $BASEDIR if [ "$1" == "origdist" ]; then @@ -53,15 +87,17 @@ if [ "$1" == "origdist" ]; then mv $proj*.tar.gz ${origname}.orig.tar.gz done - tmp=`basename keyman\_config*.tar.gz .tar.gz` - origname=${tmp/keyman\_config-/keyman-config\_} - index=`expr index "${origname}" _` - kcversion=${tmp:$index} + if [ "${extra_project}" == "keyman-config" ]; then + tmp=`basename keyman\_config*.tar.gz .tar.gz` + origname=${tmp/keyman\_config-/keyman-config\_} + index=`expr index "${origname}" _` + kcversion=${tmp:$index} - echo "keyman-config version: ${kcversion}" + echo "keyman-config version: ${kcversion}" - tar xf keyman_config-${kcversion}.tar.gz - mv keyman_config-${kcversion} keyman-config-${kcversion} - tar cfz keyman-config_${kcversion}.orig.tar.gz keyman-config-${kcversion} - rm -rf keyman-config-${kcversion} keyman_config-${kcversion}.tar.gz + tar xf keyman_config-${kcversion}.tar.gz + mv keyman_config-${kcversion} keyman-config-${kcversion} + tar cfz keyman-config_${kcversion}.orig.tar.gz keyman-config-${kcversion} + rm -rf keyman-config-${kcversion} keyman_config-${kcversion}.tar.gz + fi fi diff --git a/linux/reconf.sh b/linux/reconf.sh index 7351159aba..cd9801eda7 100755 --- a/linux/reconf.sh +++ b/linux/reconf.sh @@ -2,26 +2,45 @@ # autoreconf autotool projects -# parameters: +# parameters: ./reconf.sh [dev] [proj] # dev = append current GMT datetime to VERSION +# proj = only reconf this project set -e BASEDIR=`pwd` autotool_projects="kmflcomp libkmfl ibus-kmfl" +if [ "$2" != "" ]; then + autotool_projects="$2" + if [ ! -d "$2" ]; then + echo "project $2 does not exist" + exit 1 + fi +fi + if [ "$1" == "dev" ]; then vers=`cat VERSION` datevers=`date -u +"%Y%m%d%H%M%S"` echo "$vers.${datevers}" > VERSION +else + if [ "$1" != "" ]; then + autotool_projects="$1" + if [ ! -d "$1" ]; then + echo "project $1 does not exist" + exit 1 + fi + fi fi # autoreconf the projects for proj in ${autotool_projects}; do - cd $proj - echo "Reconfiguring $proj to version `cat VERSION`" - autoreconf -if - cd $BASEDIR + if [ "${proj}" != "keyman-config" ]; then + cd $proj + echo "Reconfiguring $proj to version `cat VERSION`" + autoreconf -if + cd $BASEDIR + fi done if [ "$1" == "dev" ]; then From cea9b3f0b2eeb2e75e1911623b5ff920552bd901 Mon Sep 17 00:00:00 2001 From: glasseyes Date: Tue, 4 Sep 2018 15:48:03 +0700 Subject: [PATCH 07/29] change Debian maintainer --- linux/ibus-kmfl/debian/control | 2 +- linux/kmflcomp/debian/control | 4 ++-- linux/libkmfl/debian/control | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/linux/ibus-kmfl/debian/control b/linux/ibus-kmfl/debian/control index 0e3d0612d9..370ecbf1fa 100644 --- a/linux/ibus-kmfl/debian/control +++ b/linux/ibus-kmfl/debian/control @@ -1,7 +1,7 @@ Source: ibus-kmfl Section: utils Priority: optional -Maintainer: Doug Rintoul +Maintainer: Daniel Glassey Build-Depends: debhelper (>= 9), autotools-dev, dh-autoreconf, pkg-config, libkmflcomp-dev (>=10.99.1), libkmfl-dev (>=10.99.1), libibus-1.0-dev (>= 1.2), x11proto-core-dev, libx11-dev Standards-Version: 3.9.8 diff --git a/linux/kmflcomp/debian/control b/linux/kmflcomp/debian/control index 7a8f7f696a..61a2ef1612 100644 --- a/linux/kmflcomp/debian/control +++ b/linux/kmflcomp/debian/control @@ -1,9 +1,9 @@ Source: kmflcomp Priority: optional Section: utils -Maintainer: Doug Rintoul +Maintainer: Daniel Glassey Uploaders: Torsten Werner -Homepage: http://kmfl.sourceforge.net/ +Homepage: http://www.keyman.com Build-Depends: cdbs (>= 0.4.27), debhelper (>= 9), libx11-dev, dh-autoreconf Standards-Version: 3.9.8.0 diff --git a/linux/libkmfl/debian/control b/linux/libkmfl/debian/control index cb55cadf46..da9d864c38 100644 --- a/linux/libkmfl/debian/control +++ b/linux/libkmfl/debian/control @@ -1,7 +1,7 @@ Source: libkmfl Priority: optional Section: libs -Maintainer: Doug Rintoul +Maintainer: Daniel Glassey Homepage: http://www.keyman.com/ Build-Depends: cdbs (>= 0.4.27), debhelper (>= 9), dh-autoreconf, libkmflcomp-dev (>=10.99.0) Standards-Version: 3.9.7 From f49ad0659933affaa92118a1b651d9fc972fe5d2 Mon Sep 17 00:00:00 2001 From: glasseyes Date: Tue, 4 Sep 2018 15:51:03 +0700 Subject: [PATCH 08/29] minor configure update --- linux/kmflcomp/configure.ac | 1 - linux/libkmfl/configure.ac | 1 - 2 files changed, 2 deletions(-) diff --git a/linux/kmflcomp/configure.ac b/linux/kmflcomp/configure.ac index 4028622bb3..097c2b019d 100644 --- a/linux/kmflcomp/configure.ac +++ b/linux/kmflcomp/configure.ac @@ -4,7 +4,6 @@ dnl If you don't want it to overwrite it, dnl Please disable it in the Anjuta project configuration AC_INIT(kmflcomp, m4_esyscmd_s([cat VERSION])) - AM_INIT_AUTOMAKE AM_CONFIG_HEADER(config.h) diff --git a/linux/libkmfl/configure.ac b/linux/libkmfl/configure.ac index d11d47ad35..f05c3ea89c 100644 --- a/linux/libkmfl/configure.ac +++ b/linux/libkmfl/configure.ac @@ -4,7 +4,6 @@ dnl If you don't want it to overwrite it, dnl Please disable it in the Anjuta project configuration AC_INIT(libkmfl, m4_esyscmd_s([cat VERSION])) - AM_INIT_AUTOMAKE AM_CONFIG_HEADER(config.h) From c294c8d9df730feb57c7d08bebe8079af783e72d Mon Sep 17 00:00:00 2001 From: glasseyes Date: Thu, 6 Sep 2018 10:43:40 +0700 Subject: [PATCH 09/29] move scripts to scripts dir add VS code workspace for linux dir that also includes onboard-keyman dir fix cow.sh creation of hook scripts --- linux/Makefile | 22 +++++++++++----------- linux/linux.code-workspace | 10 ++++++++++ linux/{ => scripts}/build.sh | 0 linux/{ => scripts}/cow.sh | 14 ++++++++------ linux/{ => scripts}/deb.sh | 0 linux/{ => scripts}/dist.sh | 0 linux/{ => scripts}/reconf.sh | 0 7 files changed, 29 insertions(+), 17 deletions(-) create mode 100644 linux/linux.code-workspace rename linux/{ => scripts}/build.sh (100%) rename linux/{ => scripts}/cow.sh (65%) rename linux/{ => scripts}/deb.sh (100%) rename linux/{ => scripts}/dist.sh (100%) rename linux/{ => scripts}/reconf.sh (100%) diff --git a/linux/Makefile b/linux/Makefile index b3295508c1..bba702c448 100644 --- a/linux/Makefile +++ b/linux/Makefile @@ -1,37 +1,37 @@ #!/usr/bin/make tmpbuild: devreconf - ./build.sh + ./scripts/build.sh install_local: devreconf - SUDOINSTALL="yes" ./build.sh + SUDOINSTALL="yes" ./scripts/build.sh uninstall_local: devreconf - SUDOINSTALL="uninstall" ./build.sh + SUDOINSTALL="uninstall" ./scripts/build.sh debnocow: - ./deb.sh + ./scripts/deb.sh reconf: - ./reconf.sh + ./scripts/reconf.sh dist: - ./dist.sh + ./scripts/dist.sh origdist: - ./dist.sh origdist + ./scripts/dist.sh origdist sourcepackage: reconf origdist - ./deb.sh sourcepackage + ./scripts/deb.sh sourcepackage devsourcepackage: devreconf origdist - ./deb.sh sourcepackage + ./scripts/deb.sh sourcepackage devreconf: - ./reconf.sh dev + ./scripts/reconf.sh dev cow: - ./cow.sh + ./scripts/cow.sh deb: devreconf origdist cow debnocow echo "Built dev Debian packages in builddebs/" diff --git a/linux/linux.code-workspace b/linux/linux.code-workspace new file mode 100644 index 0000000000..8a5761daf7 --- /dev/null +++ b/linux/linux.code-workspace @@ -0,0 +1,10 @@ +{ + "folders": [ + { + "path": "." + }, + { + "path": "../onboard-keyman" + }, + ], +} diff --git a/linux/build.sh b/linux/scripts/build.sh similarity index 100% rename from linux/build.sh rename to linux/scripts/build.sh diff --git a/linux/cow.sh b/linux/scripts/cow.sh similarity index 65% rename from linux/cow.sh rename to linux/scripts/cow.sh index ee99958369..de15857ed0 100755 --- a/linux/cow.sh +++ b/linux/scripts/cow.sh @@ -7,7 +7,6 @@ set -e distributions='bionic xenial' - dpkgcheck=`dpkg-query -l cowbuilder` if [ $? != 0 ]; then @@ -26,12 +25,15 @@ for dist in $distributions; do fi sudo mkdir -p /var/cache/pbuilder/hook.d/${dist} if [ ! -e /var/cache/pbuilder/hook.d/${dist}/D70results ]; then - sudo echo "#!/bin/bash" > /var/cache/pbuilder/hook.d/${dist}/D70results - sudo echo "cd /var/cache/pbuilder/result/bionic" >> /var/cache/pbuilder/hook.d/${dist}/D70results - sudo echo "/usr/bin/dpkg-scanpackages . /dev/null > /var/cache/pbuilder/result/bionic/Packages" >> /var/cache/pbuilder/hook.d/${dist}/D70results - sudo echo "/usr/bin/apt-get update" >> /var/cache/pbuilder/hook.d/${dist}/D70results + echo "#!/bin/bash" | sudo tee /var/cache/pbuilder/hook.d/${dist}/D70results + echo "cd /var/cache/pbuilder/result/${dist}" | sudo tee -a /var/cache/pbuilder/hook.d/${dist}/D70results + echo "/usr/bin/dpkg-scanpackages . /dev/null > /var/cache/pbuilder/result/${dist}/Packages" | sudo tee -a /var/cache/pbuilder/hook.d/${dist}/D70results + echo "/usr/bin/apt-get update" | sudo tee -a /var/cache/pbuilder/hook.d/${dist}/D70results sudo ln -s /var/cache/pbuilder/hook.d/${dist}/D70results /var/cache/pbuilder/hook.d/${dist}/B70buildresults fi + if [ ! -e /var/cache/pbuilder/hook.d/${dist}/D80no-man-db-rebuild ]; then + sudo ln -s /usr/share/doc/pbuilder/examples/D80no-man-db-rebuild /var/cache/pbuilder/hook.d/${dist}/D80no-man-db-rebuild + fi sudo mkdir -p /var/cache/pbuilder/result/${dist} sudo cowbuilder update --distribution ${dist} --basepath /var/cache/pbuilder/base-${dist}.cow --override-config --othermirror="deb [trusted=yes] file:/var/cache/pbuilder/result/${dist} ./" --bindmounts /var/cache/pbuilder/result/${dist} --hookdir /var/cache/pbuilder/hook.d/${dist} -done \ No newline at end of file +done diff --git a/linux/deb.sh b/linux/scripts/deb.sh similarity index 100% rename from linux/deb.sh rename to linux/scripts/deb.sh diff --git a/linux/dist.sh b/linux/scripts/dist.sh similarity index 100% rename from linux/dist.sh rename to linux/scripts/dist.sh diff --git a/linux/reconf.sh b/linux/scripts/reconf.sh similarity index 100% rename from linux/reconf.sh rename to linux/scripts/reconf.sh From 0c7703fb323696410defca5a6a42c2987bd2b0eb Mon Sep 17 00:00:00 2001 From: glasseyes Date: Fri, 7 Sep 2018 11:13:35 +0700 Subject: [PATCH 10/29] add scripts/jenkins.sh for making source packages on jenkins --- linux/scripts/jenkins.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 linux/scripts/jenkins.sh diff --git a/linux/scripts/jenkins.sh b/linux/scripts/jenkins.sh new file mode 100755 index 0000000000..e19f855460 --- /dev/null +++ b/linux/scripts/jenkins.sh @@ -0,0 +1,21 @@ +#!/bin/bash -e + +. \$HOME/ci-builder-scripts/bash/common.sh +init "$@" + +rm -rf builddebs +rm -rf $1/${1}_*.{dsc,build,buildinfo,changes,tar.?z,log} +rm -rf ${1}_*.{dsc,build,buildinfo,changes,tar.?z,log} + +log "Make source package for $1" +./scripts/reconf.sh dev $1 +./scripts/dist.sh origdist $1 +./scripts/deb.sh sourcepackage $1 + +#sign source package +for file in `ls builddebs/*.dsc`; do + log "Signing source package $file" + debsign -k\$2 \$file +done + +mv builddebs/* $1 From cc8c983932141a72df1cc277fd3e4f93761478d1 Mon Sep 17 00:00:00 2001 From: glasseyes Date: Fri, 7 Sep 2018 15:36:35 +0700 Subject: [PATCH 11/29] don't escape HOME variable --- linux/scripts/jenkins.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux/scripts/jenkins.sh b/linux/scripts/jenkins.sh index e19f855460..ececc8b120 100755 --- a/linux/scripts/jenkins.sh +++ b/linux/scripts/jenkins.sh @@ -1,6 +1,6 @@ #!/bin/bash -e -. \$HOME/ci-builder-scripts/bash/common.sh +. $HOME/ci-builder-scripts/bash/common.sh init "$@" rm -rf builddebs From 109b0d65df9f1023bbf7d74934a7ade1d0699f07 Mon Sep 17 00:00:00 2001 From: glasseyes Date: Fri, 7 Sep 2018 22:49:30 +0700 Subject: [PATCH 12/29] minor comments to scripts to kick off a test jenkins build --- linux/scripts/deb.sh | 2 ++ linux/scripts/dist.sh | 2 ++ linux/scripts/jenkins.sh | 1 + 3 files changed, 5 insertions(+) diff --git a/linux/scripts/deb.sh b/linux/scripts/deb.sh index da4f575301..dcee62ffd7 100755 --- a/linux/scripts/deb.sh +++ b/linux/scripts/deb.sh @@ -78,6 +78,7 @@ BASEDIR=`pwd` mkdir -p builddebs +# make the source packages cd builddebs for proj in ${projects}; do vers=`ls ../dist/${proj}_*.orig.tar.gz` @@ -102,6 +103,7 @@ if [ "$1" == "sourcepackage" ]; then exit 0 fi +# build the packages with cowbuilder from the source package for proj in ${projects}; do cd builddebs echo "$proj version ${vers}" diff --git a/linux/scripts/dist.sh b/linux/scripts/dist.sh index b2cc81a5fa..108660a3ac 100755 --- a/linux/scripts/dist.sh +++ b/linux/scripts/dist.sh @@ -58,6 +58,7 @@ for proj in ${autotool_projects}; do done +# dist for keyman-config if [ "${extra_project}" == "keyman-config" ]; then cd kmflcomp baseversion=`cat VERSION` @@ -78,6 +79,7 @@ if [ "${extra_project}" == "keyman-config" ]; then fi cd $BASEDIR +# create orig.tar.gz if [ "$1" == "origdist" ]; then cd dist for proj in ${autotool_projects}; do diff --git a/linux/scripts/jenkins.sh b/linux/scripts/jenkins.sh index ececc8b120..272bbcfa59 100755 --- a/linux/scripts/jenkins.sh +++ b/linux/scripts/jenkins.sh @@ -3,6 +3,7 @@ . $HOME/ci-builder-scripts/bash/common.sh init "$@" +# clean up prev deb builds rm -rf builddebs rm -rf $1/${1}_*.{dsc,build,buildinfo,changes,tar.?z,log} rm -rf ${1}_*.{dsc,build,buildinfo,changes,tar.?z,log} From f048b9a277bb6262f51b9cc4f6cb007ccba44698 Mon Sep 17 00:00:00 2001 From: glasseyes Date: Mon, 10 Sep 2018 14:40:55 +0700 Subject: [PATCH 13/29] generate man pages for keyman-config in make dist --- linux/scripts/dist.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/linux/scripts/dist.sh b/linux/scripts/dist.sh index 108660a3ac..3c012a573c 100755 --- a/linux/scripts/dist.sh +++ b/linux/scripts/dist.sh @@ -75,6 +75,7 @@ if [ "${extra_project}" == "keyman-config" ]; then echo "datever: ${datever}" python3 setup.py egg_info -b.${datever} sdist fi + make man cp dist/*.tar.gz ../dist fi cd $BASEDIR From 41e938f72878a0f486d8d078b3f7ecc7b2838ff7 Mon Sep 17 00:00:00 2001 From: glasseyes Date: Mon, 10 Sep 2018 15:27:04 +0700 Subject: [PATCH 14/29] rename keyman-config package to keyman --- linux/keyman-config/debian/control | 4 ++-- .../debian/{keyman-config.install => keyman.install} | 0 .../debian/{keyman-config.links => keyman.links} | 0 .../debian/{keyman-config.manpages => keyman.manpages} | 0 4 files changed, 2 insertions(+), 2 deletions(-) rename linux/keyman-config/debian/{keyman-config.install => keyman.install} (100%) rename linux/keyman-config/debian/{keyman-config.links => keyman.links} (100%) rename linux/keyman-config/debian/{keyman-config.manpages => keyman.manpages} (100%) diff --git a/linux/keyman-config/debian/control b/linux/keyman-config/debian/control index 1d38ac7e59..8dba6a819e 100644 --- a/linux/keyman-config/debian/control +++ b/linux/keyman-config/debian/control @@ -9,12 +9,12 @@ Homepage: http://www.keyman.com/ Package: python3-keyman-config Architecture: all Depends: ${misc:Depends}, ${python3:Depends}, python3-gi, gir1.2-webkit-3.0, - kmflcomp, dconf-cli + kmflcomp, dconf-cli, ibus-kmfl Description: Keyman for Linux configuration Python module to install, uninstall and view information about Keyman keyboard packages. -Package: keyman-config +Package: keyman Architecture: all Depends: ${misc:Depends}, python3-keyman-config Description: Keyman for Linux configuration diff --git a/linux/keyman-config/debian/keyman-config.install b/linux/keyman-config/debian/keyman.install similarity index 100% rename from linux/keyman-config/debian/keyman-config.install rename to linux/keyman-config/debian/keyman.install diff --git a/linux/keyman-config/debian/keyman-config.links b/linux/keyman-config/debian/keyman.links similarity index 100% rename from linux/keyman-config/debian/keyman-config.links rename to linux/keyman-config/debian/keyman.links diff --git a/linux/keyman-config/debian/keyman-config.manpages b/linux/keyman-config/debian/keyman.manpages similarity index 100% rename from linux/keyman-config/debian/keyman-config.manpages rename to linux/keyman-config/debian/keyman.manpages From 4d155f9af021f3f98f0f0913811f7b3eca73c715 Mon Sep 17 00:00:00 2001 From: glasseyes Date: Mon, 10 Sep 2018 23:12:23 +0700 Subject: [PATCH 15/29] [linux] fix call to common.sh init don't pass on parameters --- linux/scripts/jenkins.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/linux/scripts/jenkins.sh b/linux/scripts/jenkins.sh index 272bbcfa59..fa7b303ec6 100755 --- a/linux/scripts/jenkins.sh +++ b/linux/scripts/jenkins.sh @@ -1,9 +1,10 @@ #!/bin/bash -e . $HOME/ci-builder-scripts/bash/common.sh -init "$@" +init # clean up prev deb builds +log "cleaning previous builds of $1" rm -rf builddebs rm -rf $1/${1}_*.{dsc,build,buildinfo,changes,tar.?z,log} rm -rf ${1}_*.{dsc,build,buildinfo,changes,tar.?z,log} @@ -16,7 +17,7 @@ log "Make source package for $1" #sign source package for file in `ls builddebs/*.dsc`; do log "Signing source package $file" - debsign -k\$2 \$file + debsign -k$2 $file done mv builddebs/* $1 From 46130e876d118ba47e34cce95ea1691aa4f29588 Mon Sep 17 00:00:00 2001 From: glasseyes Date: Tue, 11 Sep 2018 11:02:20 +0700 Subject: [PATCH 16/29] [linux] add --no-package to jenkins.sh init avoids calling dpkg-parsechangelog erroneously --- linux/scripts/jenkins.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux/scripts/jenkins.sh b/linux/scripts/jenkins.sh index fa7b303ec6..2735e505c3 100755 --- a/linux/scripts/jenkins.sh +++ b/linux/scripts/jenkins.sh @@ -1,7 +1,7 @@ #!/bin/bash -e . $HOME/ci-builder-scripts/bash/common.sh -init +init --no-package # clean up prev deb builds log "cleaning previous builds of $1" From b1e48b344b49c12b20fc7208d2e0c5547556e643 Mon Sep 17 00:00:00 2001 From: glasseyes Date: Tue, 11 Sep 2018 11:25:29 +0700 Subject: [PATCH 17/29] [linux] keyman-config include README.md in dist on xenial make deb now builds dist rather than devdist include README.md in Debian package improve keyman-config dependencies and keyman package description --- linux/keyman-config/MANIFEST.in | 1 + linux/keyman-config/debian/control | 7 +++++-- linux/keyman-config/debian/keyman.docs | 1 + 3 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 linux/keyman-config/debian/keyman.docs diff --git a/linux/keyman-config/MANIFEST.in b/linux/keyman-config/MANIFEST.in index 38e5ef1575..b39f5fbd1f 100644 --- a/linux/keyman-config/MANIFEST.in +++ b/linux/keyman-config/MANIFEST.in @@ -1 +1,2 @@ recursive-include keyman_config/icons * +include README.md diff --git a/linux/keyman-config/debian/control b/linux/keyman-config/debian/control index 8dba6a819e..ea29bec3a9 100644 --- a/linux/keyman-config/debian/control +++ b/linux/keyman-config/debian/control @@ -9,7 +9,7 @@ Homepage: http://www.keyman.com/ Package: python3-keyman-config Architecture: all Depends: ${misc:Depends}, ${python3:Depends}, python3-gi, gir1.2-webkit-3.0, - kmflcomp, dconf-cli, ibus-kmfl + kmflcomp (>=10.99.1), dconf-cli, ibus-kmfl (>=10.99.1) Description: Keyman for Linux configuration Python module to install, uninstall and view information about Keyman keyboard packages. @@ -17,6 +17,9 @@ Description: Keyman for Linux configuration Package: keyman Architecture: all Depends: ${misc:Depends}, python3-keyman-config -Description: Keyman for Linux configuration +Description: Type in your language with Keyman for Linux Install, uninstall and view information about Keyman keyboard packages. + . + This package depends all on that is needed for using Keyman + for Linux. diff --git a/linux/keyman-config/debian/keyman.docs b/linux/keyman-config/debian/keyman.docs new file mode 100644 index 0000000000..b43bf86b50 --- /dev/null +++ b/linux/keyman-config/debian/keyman.docs @@ -0,0 +1 @@ +README.md From 0c3d077ddad54563b51511e1bd7e01be4107ad4b Mon Sep 17 00:00:00 2001 From: glasseyes Date: Thu, 13 Sep 2018 09:28:55 +0700 Subject: [PATCH 18/29] [linux] touch cow Packages file if it doesn't exist --- linux/scripts/cow.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/linux/scripts/cow.sh b/linux/scripts/cow.sh index de15857ed0..9ea1190e5a 100755 --- a/linux/scripts/cow.sh +++ b/linux/scripts/cow.sh @@ -35,5 +35,8 @@ for dist in $distributions; do sudo ln -s /usr/share/doc/pbuilder/examples/D80no-man-db-rebuild /var/cache/pbuilder/hook.d/${dist}/D80no-man-db-rebuild fi sudo mkdir -p /var/cache/pbuilder/result/${dist} + if [ ! -e /var/cache/pbuilder/result/${dist}/Packages ] + sudo touch /var/cache/pbuilder/result/${dist}/Packages + fi sudo cowbuilder update --distribution ${dist} --basepath /var/cache/pbuilder/base-${dist}.cow --override-config --othermirror="deb [trusted=yes] file:/var/cache/pbuilder/result/${dist} ./" --bindmounts /var/cache/pbuilder/result/${dist} --hookdir /var/cache/pbuilder/hook.d/${dist} done From bb3140707f070960ad2c062fc6c09c433d7a5a85 Mon Sep 17 00:00:00 2001 From: glasseyes Date: Thu, 13 Sep 2018 09:30:34 +0700 Subject: [PATCH 19/29] fix last commit --- linux/scripts/cow.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux/scripts/cow.sh b/linux/scripts/cow.sh index 9ea1190e5a..be65e2452f 100755 --- a/linux/scripts/cow.sh +++ b/linux/scripts/cow.sh @@ -35,7 +35,7 @@ for dist in $distributions; do sudo ln -s /usr/share/doc/pbuilder/examples/D80no-man-db-rebuild /var/cache/pbuilder/hook.d/${dist}/D80no-man-db-rebuild fi sudo mkdir -p /var/cache/pbuilder/result/${dist} - if [ ! -e /var/cache/pbuilder/result/${dist}/Packages ] + if [ ! -e /var/cache/pbuilder/result/${dist}/Packages ]; then sudo touch /var/cache/pbuilder/result/${dist}/Packages fi sudo cowbuilder update --distribution ${dist} --basepath /var/cache/pbuilder/base-${dist}.cow --override-config --othermirror="deb [trusted=yes] file:/var/cache/pbuilder/result/${dist} ./" --bindmounts /var/cache/pbuilder/result/${dist} --hookdir /var/cache/pbuilder/hook.d/${dist} From 1c7fbb896c7b752bb41c4e5f74ddf2d2ff9eabfe Mon Sep 17 00:00:00 2001 From: glasseyes Date: Thu, 13 Sep 2018 10:04:37 +0700 Subject: [PATCH 20/29] [linux] make the cow hook executable run the cow hook after deb is copied to location --- linux/scripts/cow.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/linux/scripts/cow.sh b/linux/scripts/cow.sh index be65e2452f..dbe1d63c5c 100755 --- a/linux/scripts/cow.sh +++ b/linux/scripts/cow.sh @@ -29,7 +29,8 @@ for dist in $distributions; do echo "cd /var/cache/pbuilder/result/${dist}" | sudo tee -a /var/cache/pbuilder/hook.d/${dist}/D70results echo "/usr/bin/dpkg-scanpackages . /dev/null > /var/cache/pbuilder/result/${dist}/Packages" | sudo tee -a /var/cache/pbuilder/hook.d/${dist}/D70results echo "/usr/bin/apt-get update" | sudo tee -a /var/cache/pbuilder/hook.d/${dist}/D70results - sudo ln -s /var/cache/pbuilder/hook.d/${dist}/D70results /var/cache/pbuilder/hook.d/${dist}/B70buildresults + sudo chmod +x /var/cache/pbuilder/hook.d/${dist}/D70results + sudo ln -s /var/cache/pbuilder/hook.d/${dist}/D70results /var/cache/pbuilder/hook.d/${dist}/I70buildresults fi if [ ! -e /var/cache/pbuilder/hook.d/${dist}/D80no-man-db-rebuild ]; then sudo ln -s /usr/share/doc/pbuilder/examples/D80no-man-db-rebuild /var/cache/pbuilder/hook.d/${dist}/D80no-man-db-rebuild From 41017d38961e738ca6f41901bdd9934006b6b300 Mon Sep 17 00:00:00 2001 From: glasseyes Date: Thu, 13 Sep 2018 22:30:39 +0700 Subject: [PATCH 21/29] ignore generated keyman-config manpages --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 1cf96743b4..a418450415 100644 --- a/.gitignore +++ b/.gitignore @@ -263,6 +263,7 @@ make_deb tmp/ dist/ *~ +linux/keyman-config/debian/man .DS_Store From 7fbba6036fbbbcee79e563f83042b7a61c97e117 Mon Sep 17 00:00:00 2001 From: glasseyes Date: Fri, 14 Sep 2018 11:15:11 +0700 Subject: [PATCH 22/29] use date of last git commit not current date for VERSION more things needed in some README.repo cow.sh: make it compatible with xenial set DIST for use with optional local .pbuilderrc, also in deb.sh link linux/.pbuilderrc to ~/.pbuilderrc if it doesn't exist --- linux/.pbuilderrc | 80 ++++++++++++++++++++++++++++++++++++ linux/README.repo | 5 +++ linux/ibus-kmfl/README.repo | 2 +- linux/keyman-config/Makefile | 2 +- linux/kmflcomp/README.repo | 2 + linux/scripts/cow.sh | 17 ++++++-- linux/scripts/deb.sh | 4 +- linux/scripts/reconf.sh | 3 +- 8 files changed, 106 insertions(+), 9 deletions(-) create mode 100644 linux/.pbuilderrc create mode 100644 linux/README.repo diff --git a/linux/.pbuilderrc b/linux/.pbuilderrc new file mode 100644 index 0000000000..7dba514601 --- /dev/null +++ b/linux/.pbuilderrc @@ -0,0 +1,80 @@ +PBUILDERSATISFYDEPENDSCMD="/usr/lib/pbuilder/pbuilder-satisfydepends-gdebi" +PDEBUILD_PBUILDER="cowbuilder" + +# Codenames for Debian suites according to their alias. Update these when +# needed. +UNSTABLE_CODENAME="sid" +TESTING_CODENAME="buster" +STABLE_CODENAME="stretch" +STABLE_BACKPORTS_SUITE="$STABLE_CODENAME-backports" +OLDSTABLE_CODENAME="jessie" + +# List of Debian suites. +DEBIAN_SUITES=($UNSTABLE_CODENAME $TESTING_CODENAME $STABLE_CODENAME $STABLE_BACKPORTS_SUITE $OLDSTABLE_CODENAME + "experimental" "unstable" "testing" "stable") + +# List of Ubuntu suites. Update these when needed. +UBUNTU_SUITES=("cosmic" "bionic" "xenial" "trusty") + +# Mirrors to use. Update these to your preferred mirror. +DEBIAN_MIRROR="deb.debian.org" +UBUNTU_MIRROR="th.archive.ubuntu.com" + +# Optionally use the changelog of a package to determine the suite to use if +# none set. +if [ -z "${DIST}" ] && [ -r "debian/changelog" ]; then + DIST=$(dpkg-parsechangelog --show-field=Distribution) +fi + +# Optionally set a default distribution if none is used. Note that you can set +# your own default (i.e. ${DIST:="unstable"}). +: ${DIST:="$(lsb_release --short --codename)"} + +# Optionally change Debian codenames in $DIST to their aliases. +#case "$DIST" in +# $UNSTABLE_CODENAME) +# DIST="unstable" +# ;; +# $TESTING_CODENAME) +# DIST="testing" +# ;; +# $STABLE_CODENAME) +# DIST="stable" +# ;; +#esac + +# Optionally set the architecture to the host architecture if none set. Note +# that you can set your own default (i.e. ${ARCH:="i386"}). +#: ${ARCH:="$(dpkg --print-architecture)"} + +NAME="$DIST" +if [ -n "${ARCH}" ]; then + NAME="$NAME-$ARCH" + DEBOOTSTRAPOPTS=("--arch" "$ARCH" "${DEBOOTSTRAPOPTS[@]}") +fi +#BASETGZ="/var/cache/pbuilder/$NAME-base.tgz" +BASEPATH=/var/cache/pbuilder/base-$NAME.cow +DISTRIBUTION="$DIST" +BUILDRESULT="/var/cache/pbuilder/result/$NAME/" +APTCACHE="/var/cache/pbuilder/aptcache/$NAME/" +BUILDPLACE="/var/cache/pbuilder/build/" + +HOOKDIR="/var/cache/pbuilder/hook.d/$NAME/" +OTHERMIRROR="deb [trusted=yes] file:/var/cache/pbuilder/result/$NAME ./ " +BINDMOUNTS="/var/cache/pbuilder/result/$NAME" + +if $(echo ${DEBIAN_SUITES[@]} | grep -q $DIST); then + # Debian configuration + MIRRORSITE="http://$DEBIAN_MIRROR/debian/" + COMPONENTS="main contrib non-free" + if $(echo "$STABLE_CODENAME stable" | grep -q $DIST); then + OTHERMIRROR="$OTHERMIRROR | deb $MIRRORSITE $STABLE_BACKPORTS_SUITE $COMPONENTS" + fi +elif $(echo ${UBUNTU_SUITES[@]} | grep -q $DIST); then + # Ubuntu configuration + MIRRORSITE="http://$UBUNTU_MIRROR/ubuntu/" + COMPONENTS="main restricted universe multiverse" +else + echo "Unknown distribution: $DIST" + exit 1 +fi diff --git a/linux/README.repo b/linux/README.repo new file mode 100644 index 0000000000..51d09da518 --- /dev/null +++ b/linux/README.repo @@ -0,0 +1,5 @@ +You need autoconf, autopoint, gettext, automake and libtool to generate the build system + +flex and bison are useful to rebuild lex.l and yacc.y in kmflcomp but not essential + +Run `make reconf` to run them diff --git a/linux/ibus-kmfl/README.repo b/linux/ibus-kmfl/README.repo index 31f68244ff..6b2703bf27 100644 --- a/linux/ibus-kmfl/README.repo +++ b/linux/ibus-kmfl/README.repo @@ -1,3 +1,3 @@ -You need autoconf, automake and libtool to generate the build system +You need autoconf, autopoint, gettext, automake and libtool to generate the build system Run ./autogen.sh to run them diff --git a/linux/keyman-config/Makefile b/linux/keyman-config/Makefile index 5cb2d8f150..0d725d6a3f 100644 --- a/linux/keyman-config/Makefile +++ b/linux/keyman-config/Makefile @@ -12,7 +12,7 @@ clean: -rm -rf dist make_deb build devdist: - python3 setup.py egg_info -b.`date -u +"%Y%m%d%H%M%S"` sdist + python3 setup.py egg_info -b.`TZ=UTC git log -1 --pretty=format:%cd --date=format-local:%Y%m%d%H%M` sdist dist: clean python3 setup.py sdist diff --git a/linux/kmflcomp/README.repo b/linux/kmflcomp/README.repo index 31f68244ff..6a2837ad43 100644 --- a/linux/kmflcomp/README.repo +++ b/linux/kmflcomp/README.repo @@ -1,3 +1,5 @@ You need autoconf, automake and libtool to generate the build system +flex and bison are useful to rebuild lex.l and yacc.y but not essential + Run ./autogen.sh to run them diff --git a/linux/scripts/cow.sh b/linux/scripts/cow.sh index dbe1d63c5c..b4a3aed618 100755 --- a/linux/scripts/cow.sh +++ b/linux/scripts/cow.sh @@ -3,8 +3,6 @@ # If needed set cowbuilder up for building Keyman Debian packages # Then cowbuilder update -set -e - distributions='bionic xenial' dpkgcheck=`dpkg-query -l cowbuilder` @@ -16,10 +14,21 @@ else echo "already have pbuilder and cowbuilder" fi +# set -e at this point to allow detecting the error of the dpkg-query +set -e + +if [ ! -e ~/.pbuilderrc ]; then + echo "linking .pbuilderrc to your ~/.pbuilderrc" + ln -s `pwd`/.pbuilderrc ~/.pbuilderrc +else + echo "assuming you already have ~/.pbuilderrc set up as you want it" + echo "though you may like to look at this .pbuilderrc in case it is useful" +fi + for dist in $distributions; do if [ ! -d /var/cache/pbuilder/base-${dist}.cow ]; then echo "making ${dist} cowbuilder" - sudo cowbuilder create --distribution ${dist} --basepath /var/cache/pbuilder/base-${dist}.cow --hookdir /var/cache/pbuilder/hook.d/${dist} + sudo DIST=${dist} cowbuilder --create --distribution ${dist} --basepath /var/cache/pbuilder/base-${dist}.cow --hookdir /var/cache/pbuilder/hook.d/${dist} else echo "already have ${dist} cowbuilder" fi @@ -39,5 +48,5 @@ for dist in $distributions; do if [ ! -e /var/cache/pbuilder/result/${dist}/Packages ]; then sudo touch /var/cache/pbuilder/result/${dist}/Packages fi - sudo cowbuilder update --distribution ${dist} --basepath /var/cache/pbuilder/base-${dist}.cow --override-config --othermirror="deb [trusted=yes] file:/var/cache/pbuilder/result/${dist} ./" --bindmounts /var/cache/pbuilder/result/${dist} --hookdir /var/cache/pbuilder/hook.d/${dist} + sudo DIST=${dist} cowbuilder --update --distribution ${dist} --basepath /var/cache/pbuilder/base-${dist}.cow --override-config --othermirror="deb [trusted=yes] file:/var/cache/pbuilder/result/${dist} ./" --bindmounts /var/cache/pbuilder/result/${dist} --hookdir /var/cache/pbuilder/hook.d/${dist} done diff --git a/linux/scripts/deb.sh b/linux/scripts/deb.sh index dcee62ffd7..bc89fde363 100755 --- a/linux/scripts/deb.sh +++ b/linux/scripts/deb.sh @@ -112,8 +112,8 @@ for proj in ${projects}; do cd ${proj}-${vers} for dist in ${distributions}; do dch -v ${vers}-1${dist} "local build for ${dist}" - echo "$dist" - pdebuild --pbuilder cowbuilder --buildresult /var/cache/pbuilder/result/${dist} -- --basepath /var/cache/pbuilder/base-${dist}.cow --distribution ${dist} --override-config --othermirror="deb [trusted=yes] file:/var/cache/pbuilder/result/${dist} ./" --bindmounts /var/cache/pbuilder/result/${dist} --hookdir /var/cache/pbuilder/hook.d/${dist} + echo "dist: $dist" + DIST=${dist} pdebuild --pbuilder cowbuilder --buildresult /var/cache/pbuilder/result/${dist} -- --basepath /var/cache/pbuilder/base-${dist}.cow --distribution ${dist} --override-config --othermirror="deb [trusted=yes] file:/var/cache/pbuilder/result/${dist} ./" --bindmounts /var/cache/pbuilder/result/${dist} --hookdir /var/cache/pbuilder/hook.d/${dist} done cd ${BASEDIR} done diff --git a/linux/scripts/reconf.sh b/linux/scripts/reconf.sh index cd9801eda7..af16afe173 100755 --- a/linux/scripts/reconf.sh +++ b/linux/scripts/reconf.sh @@ -21,7 +21,8 @@ fi if [ "$1" == "dev" ]; then vers=`cat VERSION` - datevers=`date -u +"%Y%m%d%H%M%S"` + # get datetime of latest git commit + datevers=`TZ=UTC git log -1 --pretty=format:%cd --date=format-local:%Y%m%d%H%M` echo "$vers.${datevers}" > VERSION else if [ "$1" != "" ]; then From 18e037d66ff8b230103019befaad95d854ef8c2d Mon Sep 17 00:00:00 2001 From: glasseyes Date: Fri, 14 Sep 2018 17:02:22 +0700 Subject: [PATCH 23/29] deb.sh: package version suffix to be +dist not just dist --- linux/scripts/deb.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux/scripts/deb.sh b/linux/scripts/deb.sh index bc89fde363..e44d61c6db 100755 --- a/linux/scripts/deb.sh +++ b/linux/scripts/deb.sh @@ -111,7 +111,7 @@ for proj in ${projects}; do dpkg-source -x ${proj}_${vers}-1.dsc cd ${proj}-${vers} for dist in ${distributions}; do - dch -v ${vers}-1${dist} "local build for ${dist}" + dch -v ${vers}-1+${dist} "local build for ${dist}" echo "dist: $dist" DIST=${dist} pdebuild --pbuilder cowbuilder --buildresult /var/cache/pbuilder/result/${dist} -- --basepath /var/cache/pbuilder/base-${dist}.cow --distribution ${dist} --override-config --othermirror="deb [trusted=yes] file:/var/cache/pbuilder/result/${dist} ./" --bindmounts /var/cache/pbuilder/result/${dist} --hookdir /var/cache/pbuilder/hook.d/${dist} done From ca330e24f28a82b982d3daaf95af4e26a524016c Mon Sep 17 00:00:00 2001 From: glasseyes Date: Fri, 14 Sep 2018 22:47:26 +0700 Subject: [PATCH 24/29] keyman-config: fix making dist on its own --- linux/scripts/dist.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/linux/scripts/dist.sh b/linux/scripts/dist.sh index 3c012a573c..5662fafc48 100755 --- a/linux/scripts/dist.sh +++ b/linux/scripts/dist.sh @@ -63,7 +63,11 @@ if [ "${extra_project}" == "keyman-config" ]; then cd kmflcomp baseversion=`cat VERSION` echo "baseversion: ${baseversion}" - distversion=`./configure --version|grep kmfl|grep -Po 'kmflcomp configure \K[^a-z]*'` + if [ -e configure ]; then + distversion=`./configure --version|grep kmfl|grep -Po 'kmflcomp configure \K[^a-z]*'` + else + distversion=`cat VERSION`.`TZ=UTC git log -1 --pretty=format:%cd --date=format-local:%Y%m%d%H%M` + fi echo "distversion: ${distversion}" cd ../keyman-config From 671360915fc60079da94d2f9a4c71bf52140559f Mon Sep 17 00:00:00 2001 From: glasseyes Date: Fri, 14 Sep 2018 23:41:56 +0700 Subject: [PATCH 25/29] keyman-config: move imports to after args parse so that -h can be run without dependencies installed --- linux/keyman-config/km-config | 3 ++- linux/keyman-config/km-kvk2ldml | 2 +- linux/keyman-config/km-package-get | 2 +- linux/keyman-config/km-package-install | 8 +++++--- linux/keyman-config/km-package-list-installed | 2 +- 5 files changed, 10 insertions(+), 7 deletions(-) diff --git a/linux/keyman-config/km-config b/linux/keyman-config/km-config index 2f1a49a2cd..f1f0c7a0ed 100755 --- a/linux/keyman-config/km-config +++ b/linux/keyman-config/km-config @@ -7,7 +7,6 @@ gi.require_version('Gtk', '3.0') from gi.repository import Gtk from keyman_config import __version__ -from keyman_config.view_installed import ViewInstalledWindow if __name__ == '__main__': parser = argparse.ArgumentParser(description='Keyman keyboards installation and information') @@ -23,6 +22,8 @@ if __name__ == '__main__': else: logging.basicConfig(format='%(levelname)s:%(message)s') + from keyman_config.view_installed import ViewInstalledWindow + w = ViewInstalledWindow() w.connect("destroy", Gtk.main_quit) w.resize(800, 450) diff --git a/linux/keyman-config/km-kvk2ldml b/linux/keyman-config/km-kvk2ldml index 66674dcca8..8e9070c1e6 100755 --- a/linux/keyman-config/km-kvk2ldml +++ b/linux/keyman-config/km-kvk2ldml @@ -6,7 +6,6 @@ import os.path import sys from keyman_config import __version__ -from keyman_config.kvk2ldml import parse_kvk_file, print_kvk, convert_ldml, output_ldml def main(): parser = argparse.ArgumentParser(description='Convert a Keyman kvk on-screen keyboard file to an LDML file. Optionally print the details of the kvk file.') @@ -26,6 +25,7 @@ def main(): else: logging.basicConfig(format='%(levelname)s:%(message)s') + from keyman_config.kvk2ldml import parse_kvk_file, print_kvk, convert_ldml, output_ldml name, ext = os.path.splitext(args.kvkfile) # Check if input file extension is kvk diff --git a/linux/keyman-config/km-package-get b/linux/keyman-config/km-package-get index 56151bbaea..1627f2991d 100755 --- a/linux/keyman-config/km-package-get +++ b/linux/keyman-config/km-package-get @@ -5,7 +5,6 @@ import logging import sys from keyman_config import __version__ -from keyman_config.get_kmp import get_kmp def main(): parser = argparse.ArgumentParser(description='Download Keyman keyboard package to ~/Downloads') @@ -22,6 +21,7 @@ def main(): else: logging.basicConfig(format='%(levelname)s:%(message)s') + from keyman_config.get_kmp import get_kmp get_kmp(args.id) if __name__ == "__main__": diff --git a/linux/keyman-config/km-package-install b/linux/keyman-config/km-package-install index 9e0e6c2e24..32aebbd682 100755 --- a/linux/keyman-config/km-package-install +++ b/linux/keyman-config/km-package-install @@ -3,10 +3,8 @@ import argparse import logging import sys +import os from keyman_config import __version__ -from keyman_config.install_kmp import install_kmp -from keyman_config.list_installed_kmp import get_kmp_version -from keyman_config.get_kmp import get_keyboard_data, get_kmp def main(): parser = argparse.ArgumentParser(description='Install a Keyman keyboard, either a local .kmp file or specify a keyboard id to download and install') @@ -28,6 +26,10 @@ def main(): logging.error("km-package-install: error: too many arguments: either install a local kmp file or specify a keyboard id to download and install.") sys.exit(2) + from keyman_config.install_kmp import install_kmp + from keyman_config.list_installed_kmp import get_kmp_version + from keyman_config.get_kmp import get_keyboard_data, get_kmp + if args.f: name, ext = os.path.splitext(args.f) if ext != ".kmp": diff --git a/linux/keyman-config/km-package-list-installed b/linux/keyman-config/km-package-list-installed index f067335056..ed2ad87f7b 100755 --- a/linux/keyman-config/km-package-list-installed +++ b/linux/keyman-config/km-package-list-installed @@ -4,7 +4,6 @@ import argparse import logging import os from keyman_config import __version__ -from keyman_config.list_installed_kmp import get_installed_kmp def main(): parser = argparse.ArgumentParser(description='Show installed Keyman keyboards with name, version, id and description.') @@ -21,6 +20,7 @@ def main(): else: logging.basicConfig(format='%(levelname)s:%(message)s') + from keyman_config.list_installed_kmp import get_installed_kmp installed_kmp = get_installed_kmp() print("--- Installed keyboards ---") From c169d9ec952f3dad4968da0501c7abbe207f8c06 Mon Sep 17 00:00:00 2001 From: glasseyes Date: Mon, 17 Sep 2018 09:28:17 +0700 Subject: [PATCH 26/29] include keyman-config in tmpbuild sudo make install now installs keyman-config as well --- linux/Makefile | 3 +++ linux/keyman-config/Makefile | 5 +++++ linux/scripts/build.sh | 13 +++++++++++++ 3 files changed, 21 insertions(+) diff --git a/linux/Makefile b/linux/Makefile index bba702c448..e7ef2b4487 100644 --- a/linux/Makefile +++ b/linux/Makefile @@ -9,6 +9,9 @@ install_local: devreconf uninstall_local: devreconf SUDOINSTALL="uninstall" ./scripts/build.sh +default: tmpbuild + + debnocow: ./scripts/deb.sh diff --git a/linux/keyman-config/Makefile b/linux/keyman-config/Makefile index 0d725d6a3f..a12120c2cc 100644 --- a/linux/keyman-config/Makefile +++ b/linux/keyman-config/Makefile @@ -8,6 +8,11 @@ default: install: python3 setup.py install +install-local: + mkdir -p /tmp/kmfl/lib/python3.6/site-packages + PYTHONUSERBASE=/tmp/kmfl python3 setup.py install --user + + clean: -rm -rf dist make_deb build diff --git a/linux/scripts/build.sh b/linux/scripts/build.sh index 58cd867b9e..1937f78ea8 100755 --- a/linux/scripts/build.sh +++ b/linux/scripts/build.sh @@ -47,9 +47,22 @@ for proj in kmflcomp libkmfl ibus-kmfl; do make sudo make install else + echo "doing /tmp install of $proj" ../$proj/configure CPPFLAGS="-I${INSTALLDIR}/include" LDFLAGS="-L${INSTALLDIR}/lib" --prefix=${INSTALLDIR} --libexecdir=${INSTALLDIR}/lib/ibus make make install fi cd $BASEDIR done + +cd keyman-config +echo "SUDOINSTALL: ${SUDOINSTALL}" +if [[ "${SUDOINSTALL}" == "yes" ]] +then + echo "doing sudo install of keyman-config" + sudo make install +else + echo "doing /tmp install of keyman-config" + make install-local +fi +cd $BASEDIR From d46dc1aa8bde292edcdeda9b5d5b473a6d6902ff Mon Sep 17 00:00:00 2001 From: glasseyes Date: Mon, 17 Sep 2018 10:06:08 +0700 Subject: [PATCH 27/29] update README.md for new build scripts rename tmpbuild make target to tmpinstall --- linux/Makefile | 4 +--- linux/README.md | 16 +++++++--------- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/linux/Makefile b/linux/Makefile index e7ef2b4487..4358293882 100644 --- a/linux/Makefile +++ b/linux/Makefile @@ -1,6 +1,6 @@ #!/usr/bin/make -tmpbuild: devreconf +tmpinstall: devreconf ./scripts/build.sh install_local: devreconf @@ -9,8 +9,6 @@ install_local: devreconf uninstall_local: devreconf SUDOINSTALL="uninstall" ./scripts/build.sh -default: tmpbuild - debnocow: ./scripts/deb.sh diff --git a/linux/README.md b/linux/README.md index dc8232027d..56e95e6ea0 100644 --- a/linux/README.md +++ b/linux/README.md @@ -14,34 +14,32 @@ - It is helpful to be using the [packages.sil.org](http://packages.sil.org) repo - Install packages required for building and developing KMFL -`sudo apt install cdbs debhelper libx11-dev autotools-dev build-essential dh-autoreconf flex bison libibus-1.0-dev` +`sudo apt install cdbs debhelper libx11-dev autotools-dev build-essential dh-autoreconf flex bison libibus-1.0-dev python3-setuptools` ### Compiling from Command Line #### Build script -##### Build only +##### Tmp install -Run `./build.sh` to build and install kmflcomp, libkmfl and ibus-kmfl to `/tmp/kmfl` - -set `$INSTALLDIR` to use a different install directory. -e.g. `INSTALLDIR=/home/me/kmfl ./build.sh` +Run `make tmpinstall` to build and install kmflcomp, libkmfl and ibus-kmfl to `/tmp/kmfl` This is only for testing the build, not for running ibus-kmfl in ibus + ##### Installing for ibus to use ibus-kmfl - Some of the files must be installed to `/usr/share/` so `make install` must be run as `sudo`. - - To do this run `SUDOINSTALL="yes" ./build.sh` + - To do this run `sudo make install_local` * This will install to /usr/local * and `/usr/share/ibus/component/kmfl.xml` and `/usr/share/kmfl/icons` * If you already have the ibus-kmfl package installed then build.sh will move the file `/usr/share/ibus/component/kmfl.xml` to `/usr/share/doc/ibus-kmfl/` - * run `SUDOINSTALL="uninstall" ./build.sh` to put it back again + * run `sudo make uninstall_local` to put it back again #### Manually @@ -66,7 +64,7 @@ This is only for testing the build, not for running ibus-kmfl in ibus ### Continuous integration -Teamcity will run build.sh +Teamcity will run `make tmpinstall` ### Building packages From 4e058aabff104f13ba8699a9b4f93732b4d8766c Mon Sep 17 00:00:00 2001 From: glasseyes Date: Mon, 17 Sep 2018 10:48:22 +0700 Subject: [PATCH 28/29] tmp python site packages dir depends on python version --- linux/keyman-config/Makefile | 6 +++--- linux/scripts/build.sh | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/linux/keyman-config/Makefile b/linux/keyman-config/Makefile index a12120c2cc..8504557c2e 100644 --- a/linux/keyman-config/Makefile +++ b/linux/keyman-config/Makefile @@ -8,9 +8,9 @@ default: install: python3 setup.py install -install-local: - mkdir -p /tmp/kmfl/lib/python3.6/site-packages - PYTHONUSERBASE=/tmp/kmfl python3 setup.py install --user +install-temp: + mkdir -p /tmp/kmfl/`python3 -c 'import sys;import os;pythonver=f"python{sys.version_info[0]}.{sys.version_info[1]}";sitedir = os.path.join("lib", pythonver, "site-packages");print(sitedir)'` + #PYTHONUSERBASE=/tmp/kmfl python3 setup.py install --user clean: diff --git a/linux/scripts/build.sh b/linux/scripts/build.sh index 1937f78ea8..05999303cd 100755 --- a/linux/scripts/build.sh +++ b/linux/scripts/build.sh @@ -63,6 +63,6 @@ then sudo make install else echo "doing /tmp install of keyman-config" - make install-local + make install-temp fi cd $BASEDIR From c3963575a7fb1bc8002aacb8f6243b5312c40e03 Mon Sep 17 00:00:00 2001 From: glasseyes Date: Mon, 17 Sep 2018 10:57:56 +0700 Subject: [PATCH 29/29] python 3.5 compatible string in make step --- linux/keyman-config/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/linux/keyman-config/Makefile b/linux/keyman-config/Makefile index 8504557c2e..bd7d7e8658 100644 --- a/linux/keyman-config/Makefile +++ b/linux/keyman-config/Makefile @@ -9,8 +9,8 @@ install: python3 setup.py install install-temp: - mkdir -p /tmp/kmfl/`python3 -c 'import sys;import os;pythonver=f"python{sys.version_info[0]}.{sys.version_info[1]}";sitedir = os.path.join("lib", pythonver, "site-packages");print(sitedir)'` - #PYTHONUSERBASE=/tmp/kmfl python3 setup.py install --user + mkdir -p /tmp/kmfl/`python3 -c 'import sys;import os;pythonver="python%d.%d" % (sys.version_info[0], sys.version_info[1]);sitedir = os.path.join("lib", pythonver, "site-packages");print(sitedir)'` + PYTHONUSERBASE=/tmp/kmfl python3 setup.py install --user clean: