diff --git a/.gitignore b/.gitignore index 2cadc62844..a418450415 100644 --- a/.gitignore +++ b/.gitignore @@ -254,6 +254,16 @@ ltsugar.m4 ltversion.m4 lt~obsolete.m4 libtool.m4 +__pycache__ +*.egg-info +build-* +deb-* +builddebs +make_deb +tmp/ +dist/ +*~ +linux/keyman-config/debian/man .DS_Store 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/Makefile b/linux/Makefile new file mode 100644 index 0000000000..4358293882 --- /dev/null +++ b/linux/Makefile @@ -0,0 +1,44 @@ +#!/usr/bin/make + +tmpinstall: devreconf + ./scripts/build.sh + +install_local: devreconf + SUDOINSTALL="yes" ./scripts/build.sh + +uninstall_local: devreconf + SUDOINSTALL="uninstall" ./scripts/build.sh + + +debnocow: + ./scripts/deb.sh + +reconf: + ./scripts/reconf.sh + +dist: + ./scripts/dist.sh + +origdist: + ./scripts/dist.sh origdist + +sourcepackage: reconf origdist + ./scripts/deb.sh sourcepackage + +devsourcepackage: devreconf origdist + ./scripts/deb.sh sourcepackage + +devreconf: + ./scripts/reconf.sh dev + +cow: + ./scripts/cow.sh + +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 + echo "Built nightly source release in dist/" 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 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/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/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/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/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..75157dcfe7 100644 --- a/linux/ibus-kmfl/configure.ac +++ b/linux/ibus-kmfl/configure.ac @@ -29,7 +29,8 @@ 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]) +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..370ecbf1fa 100644 --- a/linux/ibus-kmfl/debian/control +++ b/linux/ibus-kmfl/debian/control @@ -1,15 +1,15 @@ 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, 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/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 b8045814a5..750b1a747e 100644 Binary files a/linux/ibus-kmfl/po/zh_CN.gmo and b/linux/ibus-kmfl/po/zh_CN.gmo differ 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/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/Makefile b/linux/keyman-config/Makefile index f17e8a2858..bd7d7e8658 100644 --- a/linux/keyman-config/Makefile +++ b/linux/keyman-config/Makefile @@ -8,13 +8,21 @@ default: install: python3 setup.py install +install-temp: + 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: -rm -rf dist make_deb build +devdist: + 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 -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) && \ diff --git a/linux/keyman-config/debian/control b/linux/keyman-config/debian/control index 1d38ac7e59..ea29bec3a9 100644 --- a/linux/keyman-config/debian/control +++ b/linux/keyman-config/debian/control @@ -9,14 +9,17 @@ 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 (>=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. -Package: keyman-config +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 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 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 ---") 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/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/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..097c2b019d 100644 --- a/linux/kmflcomp/configure.ac +++ b/linux/kmflcomp/configure.ac @@ -3,7 +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 -AC_INIT(kmflcomp, 10.99.1) +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..61a2ef1612 100644 --- a/linux/kmflcomp/debian/control +++ b/linux/kmflcomp/debian/control @@ -1,10 +1,10 @@ Source: kmflcomp Priority: optional Section: utils -Maintainer: Doug Rintoul +Maintainer: Daniel Glassey Uploaders: Torsten Werner -Homepage: http://kmfl.sourceforge.net/ -Build-Depends: cdbs (>= 0.4.27), debhelper (>= 10), libx11-dev +Homepage: http://www.keyman.com +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..f05c3ea89c 100644 --- a/linux/libkmfl/configure.ac +++ b/linux/libkmfl/configure.ac @@ -3,7 +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 -AC_INIT(libkmfl, 10.99.1) +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..da9d864c38 100644 --- a/linux/libkmfl/debian/control +++ b/linux/libkmfl/debian/control @@ -1,10 +1,10 @@ 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 -Standards-Version: 3.9.8.0 +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 Package: libkmfl-dev Section: libdevel 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 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 86% rename from linux/build.sh rename to linux/scripts/build.sh index b67557d777..05999303cd 100755 --- a/linux/build.sh +++ b/linux/scripts/build.sh @@ -18,13 +18,6 @@ SUDOINSTALL=${SUDOINSTALL:-"no"} INSTALLDIR=${INSTALLDIR:-"/tmp/kmfl"} -# autoreconf the projects -for proj in kmflcomp libkmfl ibus-kmfl; do - cd $proj - autoreconf -if - cd $BASEDIR -done - if [[ "${SUDOINSTALL}" == "uninstall" ]] then echo "putting ibus-kmfl package component file back" @@ -54,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-temp +fi +cd $BASEDIR diff --git a/linux/scripts/cow.sh b/linux/scripts/cow.sh new file mode 100755 index 0000000000..b4a3aed618 --- /dev/null +++ b/linux/scripts/cow.sh @@ -0,0 +1,52 @@ +#!/bin/bash + +# If needed set cowbuilder up for building Keyman Debian packages +# Then cowbuilder update + +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 + +# 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 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 + sudo mkdir -p /var/cache/pbuilder/hook.d/${dist} + if [ ! -e /var/cache/pbuilder/hook.d/${dist}/D70results ]; then + 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 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 + fi + sudo mkdir -p /var/cache/pbuilder/result/${dist} + if [ ! -e /var/cache/pbuilder/result/${dist}/Packages ]; then + sudo touch /var/cache/pbuilder/result/${dist}/Packages + fi + 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 new file mode 100755 index 0000000000..e44d61c6db --- /dev/null +++ b/linux/scripts/deb.sh @@ -0,0 +1,119 @@ +#!/bin/bash + +# Build Debian packages of Keyman with pbuilder + +# 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 + +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 + +# make the source packages +cd builddebs +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} + 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 + +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}" + 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 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 + cd ${BASEDIR} +done diff --git a/linux/scripts/dist.sh b/linux/scripts/dist.sh new file mode 100755 index 0000000000..5662fafc48 --- /dev/null +++ b/linux/scripts/dist.sh @@ -0,0 +1,110 @@ +#!/bin/bash + +# Build dist tarballs or Debian orig tarballs +# and put them in dist/ + +# 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 + +# 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 + + +# dist for keyman-config +if [ "${extra_project}" == "keyman-config" ]; then + cd kmflcomp + baseversion=`cat VERSION` + echo "baseversion: ${baseversion}" + 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 + 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 + make man + cp dist/*.tar.gz ../dist +fi +cd $BASEDIR + +# create orig.tar.gz +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 + + 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}" + + 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/scripts/jenkins.sh b/linux/scripts/jenkins.sh new file mode 100755 index 0000000000..2735e505c3 --- /dev/null +++ b/linux/scripts/jenkins.sh @@ -0,0 +1,23 @@ +#!/bin/bash -e + +. $HOME/ci-builder-scripts/bash/common.sh +init --no-package + +# 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} + +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 diff --git a/linux/scripts/reconf.sh b/linux/scripts/reconf.sh new file mode 100755 index 0000000000..af16afe173 --- /dev/null +++ b/linux/scripts/reconf.sh @@ -0,0 +1,49 @@ +#!/bin/bash + +# autoreconf autotool projects + +# 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` + # 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 + 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 + if [ "${proj}" != "keyman-config" ]; then + cd $proj + echo "Reconfiguring $proj to version `cat VERSION`" + autoreconf -if + cd $BASEDIR + fi +done + +if [ "$1" == "dev" ]; then + echo "${vers}" > VERSION +fi