diff --git a/dockers/debianizer/Dockerfile b/dockers/debianizer/Dockerfile new file mode 100644 index 00000000..c174d0ad --- /dev/null +++ b/dockers/debianizer/Dockerfile @@ -0,0 +1,71 @@ +FROM ubuntu:18.04 + +ENV LANG=C.UTF-8 \ + LC_ALL=C.UTF-8 + +ARG EULER_UID +ARG EULER_GID +ARG STACK_RESOLVER +ARG apt_install="apt install --no-install-recommends --yes" +ARG PACKAGE_NAME=ff +ARG USER=ff +ARG GROUP=ff +ARG HOME=/home/$USER +ARG REPO=$HOME/ff-repo +ARG TMP_BIN=$HOME/temp +ARG BUILD_DIRECTORY=$HOME/ff-deb +ARG DEB=$HOME/deb +ARG BIN=$BUILD_DIRECTORY/opt/$PACKAGE_NAME + +RUN \ +# Check for mandatory build arguments + : "${EULER_UID:?mandatory build argument is missing}" \ + : "${EULER_GID:?mandatory build argument is missing}" \ + : "${STACK_RESOLVER:?mandatory build argument is missing}" + +RUN groupadd -g ${EULER_GID} $GROUP +RUN useradd -m -u ${EULER_UID} -g ${EULER_GID} $USER + +RUN mkdir -p $HOME/.stack +RUN mkdir -p $TMP_BIN +RUN mkdir -p $REPO +RUN mkdir -p $BUILD_DIRECTORY +RUN mkdir -p $BIN +RUN mkdir -p $DEB +RUN chown -R ${EULER_UID}:${EULER_GID} $HOME/ + +RUN apt update +RUN $apt_install lintian fakeroot debhelper git curl tree \ + g++ libtinfo-dev zlib1g-dev qt5-default ca-certificates libgmp-dev + +WORKDIR $HOME +RUN tree + +RUN curl -sSL https://get.haskellstack.org/ | sh + +RUN git clone https://github.com/willbasky/ff.git $REPO +RUN chown -R ${EULER_UID}:${EULER_GID} $HOME/ + +RUN tree + +WORKDIR $BUILD_DIRECTORY +COPY ./ff-deb . + +# WORKDIR $HOME +# RUN tree + +WORKDIR $REPO +RUN stack --allow-different-user --local-bin-path=$TMP_BIN/ install $PACKAGE_NAME + +WORKDIR $HOME +RUN cp $TMP_BIN/$PACKAGE_NAME $BIN + +RUN tree + +WORKDIR $BUILD_DIRECTORY +RUN dpkg-buildpackage -rfakeroot -b -us -uc -d + +WORKDIR $HOME +RUN lintian --suppress-tags dir-or-file-in-opt,embedded-library *.deb + +RUN cp *.deb $DEB diff --git a/dockers/debianizer/README.md b/dockers/debianizer/README.md new file mode 100644 index 00000000..5e46df7b --- /dev/null +++ b/dockers/debianizer/README.md @@ -0,0 +1,5 @@ +# Guide for debianizer + +- You want `docker` and `docker-compose` and [yq](https://github.com/kislyuk/yq) be installed for doing `deb` +- Launch `make deb` command from project root directory for debianizing +- Working of final deb checked with `Ubuntu-18.04`, `Ubuntu-20.04` and `Ubuntu-21.04` diff --git a/dockers/debianizer/docker-compose.yml b/dockers/debianizer/docker-compose.yml new file mode 100644 index 00000000..96a43166 --- /dev/null +++ b/dockers/debianizer/docker-compose.yml @@ -0,0 +1,14 @@ +version: "3" +services: + + ff: + image: ff-deb + build: + context: . + dockerfile: Dockerfile + args: + EULER_UID: ${EULER_UID} + EULER_GID: ${EULER_GID} + STACK_RESOLVER: ${STACK_RESOLVER} + stdin_open: true + tty: true diff --git a/dockers/debianizer/ff-deb/debian/changelog b/dockers/debianizer/ff-deb/debian/changelog new file mode 100644 index 00000000..34137ac3 --- /dev/null +++ b/dockers/debianizer/ff-deb/debian/changelog @@ -0,0 +1,5 @@ +ff (0.15) unstable; urgency=medium + + * Initial Release. + + -- Yuriy Syrovetskiy <> Tue, 05 Nov 2019 18:44:35 +0500 diff --git a/dockers/debianizer/ff-deb/debian/compat b/dockers/debianizer/ff-deb/debian/compat new file mode 100644 index 00000000..f599e28b --- /dev/null +++ b/dockers/debianizer/ff-deb/debian/compat @@ -0,0 +1 @@ +10 diff --git a/dockers/debianizer/ff-deb/debian/control b/dockers/debianizer/ff-deb/debian/control new file mode 100644 index 00000000..95caffe8 --- /dev/null +++ b/dockers/debianizer/ff-deb/debian/control @@ -0,0 +1,12 @@ +Source: ff +Section: text +Priority: optional +Maintainer: Yuriy Syrovetskiy +Standards-Version: 0.15 + +Package: ff +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Homepage: https://github.com/ff-notes/ff +Description: Distributed note taker and task manager. + Available offline and synchronizes without conflicts. diff --git a/dockers/debianizer/ff-deb/debian/copyright b/dockers/debianizer/ff-deb/debian/copyright new file mode 100644 index 00000000..d24bc957 --- /dev/null +++ b/dockers/debianizer/ff-deb/debian/copyright @@ -0,0 +1,22 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: ff +Source: https://github.com/ff-notes/ff + +Files: debian/* +Copyright: 2019 Yuriy Syrovetskiy +License: GPL-3.0+ +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. +. +This package is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. +. +You should have received a copy of the GNU General Public License +along with this program. If not, see . +. +On Debian systems, the complete text of the GNU General +Public License version 3 can be found in /usr/share/common-licenses/GPL-3. diff --git a/dockers/debianizer/ff-deb/debian/docs/ff.1 b/dockers/debianizer/ff-deb/debian/docs/ff.1 new file mode 100644 index 00000000..ba3f760d --- /dev/null +++ b/dockers/debianizer/ff-deb/debian/docs/ff.1 @@ -0,0 +1,103 @@ +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.6. +.TH VERSION "1" "November 2019" "Version 0.13, Git revision 9ed639fdf16f5bbe85dd6b4168faf4f9f0b73757, dirty" "User Commands" +.SH NAME +Version \- ff +.SH SYNOPSIS +.B ff +[\fI\,-b|--brief\/\fR] [\fI\,-C|--data-dir DIRECTORY\/\fR] \fI\,(\/\fR[\fI\,-V|--version\/\fR] \fI\,| \/\fR[\fI\,COMMAND\/\fR] \fI\,|\/\fR +.SH DESCRIPTION +.IP +[\-l|\-\-limit ARG] ([\-n|\-\-no\-tag] | [\-\-tag TAG]...) +[\-\-without\-tag TAG]...) +.IP +A note taker and task tracker +.SS "Available options:" +.TP +\fB\-b\fR,\-\-brief +List only note titles and ids +.TP +\fB\-C\fR,\-\-data\-dir DIRECTORY +Path to the data dir +.TP +\fB\-V\fR,\-\-version +Current ff\-note version +.TP +\fB\-l\fR,\-\-limit ARG +Number of issues +.TP +\fB\-n\fR,\-\-no\-tag +Filter items that has no tags +.TP +\fB\-\-tag\fR TAG... +Filter by tag +.TP +\fB\-\-without\-tag\fR TAG... +Filter items without tag +.TP +\fB\-h\fR,\-\-help +Show this help text +.SS "Available commands:" +.TP +add +add new task or note +.TP +agenda +show what you can do right now [default action] +.TP +config +show/edit configuration +.TP +contact +show contacts +.TP +delete +delete a task +.TP +done +mark a task done (archive) +.TP +edit +edit a task or a note +.TP +new +synonym for `add` +.TP +postpone +make a task start later +.TP +search +search for notes with the given text +.TP +show +show note by id +.TP +tags +show tags of all notes +.TP +sponsors +show project sponsors +.TP +track +track issues from external sources +.TP +unarchive +restore the note from archive +.TP +upgrade +check and upgrade the database to the most recent +format +.TP +wiki +show all wiki notes +.SH "SEE ALSO" +The full documentation for +.B Version +is maintained as a Texinfo manual. If the +.B info +and +.B Version +programs are properly installed at your site, the command +.IP +.B info Version +.PP +should give you access to the complete manual. diff --git a/dockers/debianizer/ff-deb/debian/ff.dirs b/dockers/debianizer/ff-deb/debian/ff.dirs new file mode 100644 index 00000000..103f3934 --- /dev/null +++ b/dockers/debianizer/ff-deb/debian/ff.dirs @@ -0,0 +1 @@ +opt/ff diff --git a/dockers/debianizer/ff-deb/debian/ff.install b/dockers/debianizer/ff-deb/debian/ff.install new file mode 100644 index 00000000..130e82a6 --- /dev/null +++ b/dockers/debianizer/ff-deb/debian/ff.install @@ -0,0 +1 @@ +opt/ff/ff diff --git a/dockers/debianizer/ff-deb/debian/ff.manpages b/dockers/debianizer/ff-deb/debian/ff.manpages new file mode 100644 index 00000000..c97d27ea --- /dev/null +++ b/dockers/debianizer/ff-deb/debian/ff.manpages @@ -0,0 +1 @@ +docs/ff.1 diff --git a/dockers/debianizer/ff-deb/debian/postinst b/dockers/debianizer/ff-deb/debian/postinst new file mode 100755 index 00000000..3b808ff6 --- /dev/null +++ b/dockers/debianizer/ff-deb/debian/postinst @@ -0,0 +1,10 @@ +#!/bin/sh +# postinst script +# +# see: dh_installdeb(1) + +set -e + +ln -sf /opt/ff/ff /usr/bin/ff + +exit 0 diff --git a/dockers/debianizer/ff-deb/debian/postrm b/dockers/debianizer/ff-deb/debian/postrm new file mode 100644 index 00000000..dcc3ff72 --- /dev/null +++ b/dockers/debianizer/ff-deb/debian/postrm @@ -0,0 +1,7 @@ +#!/bin/sh + +set -e + +rm -f /usr/bin/ff + +exit 0 diff --git a/dockers/debianizer/ff-deb/debian/rules b/dockers/debianizer/ff-deb/debian/rules new file mode 100755 index 00000000..e1c367c1 --- /dev/null +++ b/dockers/debianizer/ff-deb/debian/rules @@ -0,0 +1,25 @@ +#!/usr/bin/make -f +# See debhelper(7) (uncomment to enable) +# output every command that modifies files on the build system. +#export DH_VERBOSE = 1 + + +# see FEATURE AREAS in dpkg-buildflags(1) +#export DEB_BUILD_MAINT_OPTIONS = hardening=+all + +# see ENVIRONMENT in dpkg-buildflags(1) +# package maintainers to append CFLAGS +#export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic +# package maintainers to append LDFLAGS +#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed + + +%: + dh $@ + + +# dh_make generated override targets +# This is example for Cmake (See https://bugs.debian.org/641051 ) +#override_dh_auto_configure: +# dh_auto_configure -- # -DCMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH) + diff --git a/dockers/debianizer/ff-deb/docs/ff.1 b/dockers/debianizer/ff-deb/docs/ff.1 new file mode 100644 index 00000000..ba3f760d --- /dev/null +++ b/dockers/debianizer/ff-deb/docs/ff.1 @@ -0,0 +1,103 @@ +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.6. +.TH VERSION "1" "November 2019" "Version 0.13, Git revision 9ed639fdf16f5bbe85dd6b4168faf4f9f0b73757, dirty" "User Commands" +.SH NAME +Version \- ff +.SH SYNOPSIS +.B ff +[\fI\,-b|--brief\/\fR] [\fI\,-C|--data-dir DIRECTORY\/\fR] \fI\,(\/\fR[\fI\,-V|--version\/\fR] \fI\,| \/\fR[\fI\,COMMAND\/\fR] \fI\,|\/\fR +.SH DESCRIPTION +.IP +[\-l|\-\-limit ARG] ([\-n|\-\-no\-tag] | [\-\-tag TAG]...) +[\-\-without\-tag TAG]...) +.IP +A note taker and task tracker +.SS "Available options:" +.TP +\fB\-b\fR,\-\-brief +List only note titles and ids +.TP +\fB\-C\fR,\-\-data\-dir DIRECTORY +Path to the data dir +.TP +\fB\-V\fR,\-\-version +Current ff\-note version +.TP +\fB\-l\fR,\-\-limit ARG +Number of issues +.TP +\fB\-n\fR,\-\-no\-tag +Filter items that has no tags +.TP +\fB\-\-tag\fR TAG... +Filter by tag +.TP +\fB\-\-without\-tag\fR TAG... +Filter items without tag +.TP +\fB\-h\fR,\-\-help +Show this help text +.SS "Available commands:" +.TP +add +add new task or note +.TP +agenda +show what you can do right now [default action] +.TP +config +show/edit configuration +.TP +contact +show contacts +.TP +delete +delete a task +.TP +done +mark a task done (archive) +.TP +edit +edit a task or a note +.TP +new +synonym for `add` +.TP +postpone +make a task start later +.TP +search +search for notes with the given text +.TP +show +show note by id +.TP +tags +show tags of all notes +.TP +sponsors +show project sponsors +.TP +track +track issues from external sources +.TP +unarchive +restore the note from archive +.TP +upgrade +check and upgrade the database to the most recent +format +.TP +wiki +show all wiki notes +.SH "SEE ALSO" +The full documentation for +.B Version +is maintained as a Texinfo manual. If the +.B info +and +.B Version +programs are properly installed at your site, the command +.IP +.B info Version +.PP +should give you access to the complete manual. diff --git a/dockers/debianizer/ff_0.15_amd64.deb b/dockers/debianizer/ff_0.15_amd64.deb new file mode 100644 index 00000000..cadaec99 Binary files /dev/null and b/dockers/debianizer/ff_0.15_amd64.deb differ diff --git a/dockers/ff-ubuntu-18.04/Dockerfile b/dockers/ff-ubuntu-18.04/Dockerfile deleted file mode 100644 index b90af406..00000000 --- a/dockers/ff-ubuntu-18.04/Dockerfile +++ /dev/null @@ -1,16 +0,0 @@ -FROM ubuntu:18.04 - -ARG GHC_VERSION=8.6.3 -ARG apt_install="apt install --no-install-recommends --yes" - -ENV LANG=C.UTF-8 \ - LC_ALL=C.UTF-8 \ - PATH=/opt/ghc/bin:$PATH - -RUN apt update -RUN $apt_install software-properties-common - -RUN add-apt-repository ppa:hvr/ghc -RUN apt update -RUN $apt_install ghc-$GHC_VERSION -RUN $apt_install g++ libtinfo-dev zlib1g-dev qt5-default diff --git a/ff-deb/debian/changelog b/ff-deb/debian/changelog new file mode 100644 index 00000000..6374acf4 --- /dev/null +++ b/ff-deb/debian/changelog @@ -0,0 +1,5 @@ +ff (0.13) unstable; urgency=medium + + * Initial Release. + + -- Yuriy Syrovetskiy <> Tue, 05 Nov 2019 18:44:35 +0500 diff --git a/ff-deb/debian/compat b/ff-deb/debian/compat new file mode 100644 index 00000000..f599e28b --- /dev/null +++ b/ff-deb/debian/compat @@ -0,0 +1 @@ +10 diff --git a/ff-deb/debian/control b/ff-deb/debian/control new file mode 100644 index 00000000..a63a7c93 --- /dev/null +++ b/ff-deb/debian/control @@ -0,0 +1,12 @@ +Source: ff +Section: text +Priority: optional +Maintainer: Yuriy Syrovetskiy +Standards-Version: 0.13 + +Package: ff +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Homepage: https://github.com/ff-notes/ff +Description: Distributed note taker and task manager. + Available offline and synchronizes without conflicts. diff --git a/ff-deb/debian/copyright b/ff-deb/debian/copyright new file mode 100644 index 00000000..d24bc957 --- /dev/null +++ b/ff-deb/debian/copyright @@ -0,0 +1,22 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: ff +Source: https://github.com/ff-notes/ff + +Files: debian/* +Copyright: 2019 Yuriy Syrovetskiy +License: GPL-3.0+ +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. +. +This package is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. +. +You should have received a copy of the GNU General Public License +along with this program. If not, see . +. +On Debian systems, the complete text of the GNU General +Public License version 3 can be found in /usr/share/common-licenses/GPL-3. diff --git a/ff-deb/debian/ff.dirs b/ff-deb/debian/ff.dirs new file mode 100644 index 00000000..103f3934 --- /dev/null +++ b/ff-deb/debian/ff.dirs @@ -0,0 +1 @@ +opt/ff diff --git a/ff-deb/debian/ff.install b/ff-deb/debian/ff.install new file mode 100644 index 00000000..130e82a6 --- /dev/null +++ b/ff-deb/debian/ff.install @@ -0,0 +1 @@ +opt/ff/ff diff --git a/ff-deb/debian/ff.manpages b/ff-deb/debian/ff.manpages new file mode 100644 index 00000000..c97d27ea --- /dev/null +++ b/ff-deb/debian/ff.manpages @@ -0,0 +1 @@ +docs/ff.1 diff --git a/ff-deb/debian/postinst b/ff-deb/debian/postinst new file mode 100755 index 00000000..3b808ff6 --- /dev/null +++ b/ff-deb/debian/postinst @@ -0,0 +1,10 @@ +#!/bin/sh +# postinst script +# +# see: dh_installdeb(1) + +set -e + +ln -sf /opt/ff/ff /usr/bin/ff + +exit 0 diff --git a/ff-deb/debian/postrm b/ff-deb/debian/postrm new file mode 100644 index 00000000..dcc3ff72 --- /dev/null +++ b/ff-deb/debian/postrm @@ -0,0 +1,7 @@ +#!/bin/sh + +set -e + +rm -f /usr/bin/ff + +exit 0 diff --git a/ff-deb/debian/rules b/ff-deb/debian/rules new file mode 100755 index 00000000..e1c367c1 --- /dev/null +++ b/ff-deb/debian/rules @@ -0,0 +1,25 @@ +#!/usr/bin/make -f +# See debhelper(7) (uncomment to enable) +# output every command that modifies files on the build system. +#export DH_VERBOSE = 1 + + +# see FEATURE AREAS in dpkg-buildflags(1) +#export DEB_BUILD_MAINT_OPTIONS = hardening=+all + +# see ENVIRONMENT in dpkg-buildflags(1) +# package maintainers to append CFLAGS +#export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic +# package maintainers to append LDFLAGS +#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed + + +%: + dh $@ + + +# dh_make generated override targets +# This is example for Cmake (See https://bugs.debian.org/641051 ) +#override_dh_auto_configure: +# dh_auto_configure -- # -DCMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH) + diff --git a/ff-deb/docs/ff.1 b/ff-deb/docs/ff.1 new file mode 100644 index 00000000..ba3f760d --- /dev/null +++ b/ff-deb/docs/ff.1 @@ -0,0 +1,103 @@ +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.6. +.TH VERSION "1" "November 2019" "Version 0.13, Git revision 9ed639fdf16f5bbe85dd6b4168faf4f9f0b73757, dirty" "User Commands" +.SH NAME +Version \- ff +.SH SYNOPSIS +.B ff +[\fI\,-b|--brief\/\fR] [\fI\,-C|--data-dir DIRECTORY\/\fR] \fI\,(\/\fR[\fI\,-V|--version\/\fR] \fI\,| \/\fR[\fI\,COMMAND\/\fR] \fI\,|\/\fR +.SH DESCRIPTION +.IP +[\-l|\-\-limit ARG] ([\-n|\-\-no\-tag] | [\-\-tag TAG]...) +[\-\-without\-tag TAG]...) +.IP +A note taker and task tracker +.SS "Available options:" +.TP +\fB\-b\fR,\-\-brief +List only note titles and ids +.TP +\fB\-C\fR,\-\-data\-dir DIRECTORY +Path to the data dir +.TP +\fB\-V\fR,\-\-version +Current ff\-note version +.TP +\fB\-l\fR,\-\-limit ARG +Number of issues +.TP +\fB\-n\fR,\-\-no\-tag +Filter items that has no tags +.TP +\fB\-\-tag\fR TAG... +Filter by tag +.TP +\fB\-\-without\-tag\fR TAG... +Filter items without tag +.TP +\fB\-h\fR,\-\-help +Show this help text +.SS "Available commands:" +.TP +add +add new task or note +.TP +agenda +show what you can do right now [default action] +.TP +config +show/edit configuration +.TP +contact +show contacts +.TP +delete +delete a task +.TP +done +mark a task done (archive) +.TP +edit +edit a task or a note +.TP +new +synonym for `add` +.TP +postpone +make a task start later +.TP +search +search for notes with the given text +.TP +show +show note by id +.TP +tags +show tags of all notes +.TP +sponsors +show project sponsors +.TP +track +track issues from external sources +.TP +unarchive +restore the note from archive +.TP +upgrade +check and upgrade the database to the most recent +format +.TP +wiki +show all wiki notes +.SH "SEE ALSO" +The full documentation for +.B Version +is maintained as a Texinfo manual. If the +.B info +and +.B Version +programs are properly installed at your site, the command +.IP +.B info Version +.PP +should give you access to the complete manual. diff --git a/makefile b/makefile new file mode 100644 index 00000000..d3369eb4 --- /dev/null +++ b/makefile @@ -0,0 +1,24 @@ + +GID := $(shell id -g) +UID := $(shell id -u) +RESOLVER := $(shell yq -r .resolver stack.yaml) + +deb: copy-deb stop + +copy-deb: rebuild + docker cp ff-deb_ff_1:/home/ff/deb/. ./dockers/debianizer/ + +build: + EULER_GID=${GID} EULER_UID=${UID} STACK_RESOLVER=${RESOLVER} docker-compose -p ff-deb -f dockers/debianizer/docker-compose.yml up -d --build + +rebuild: build-stop + EULER_GID=${GID} EULER_UID=${UID} STACK_RESOLVER=${RESOLVER} docker-compose -p ff-deb -f dockers/debianizer/docker-compose.yml up -d --build + +build-stop: + EULER_GID=${GID} EULER_UID=${UID} docker-compose -p ff-deb -f dockers/debianizer/docker-compose.yml down + +run: + docker exec -ti ff-deb_ff_1 bash + +stop: + docker stop ff-deb_ff_1