From 8114730579a37ef91d627e18177c93e9dc21b763 Mon Sep 17 00:00:00 2001 From: agnostic-apollo Date: Sat, 13 Aug 2022 07:09:53 +0500 Subject: [PATCH] motds: move motds to separate directory --- Makefile.am | 11 ++------ configure.ac | 2 +- motds/Makefile.am | 38 ++++++++++++++++++++++++++ motd-playstore => motds/motd-playstore | 0 motd.sh => motds/motd.sh.in | 0 5 files changed, 41 insertions(+), 10 deletions(-) create mode 100644 motds/Makefile.am rename motd-playstore => motds/motd-playstore (100%) rename motd.sh => motds/motd.sh.in (100%) diff --git a/Makefile.am b/Makefile.am index 2944318..28b4b44 100644 --- a/Makefile.am +++ b/Makefile.am @@ -16,14 +16,7 @@ # along with termux-tools. If not, see # . -SUBDIRS = scripts doc mirrors - -# We have two variants of our motd message: -# 1. motd.sh: is sourced and echo'es a motd message with something that looks -# like termux's logo. -# 3. motd-playstore: plain text that will only be displayed if the termux-app -# version is very old (like the version found in playstore is) -sysconf_DATA = motd.sh motd-playstore +SUBDIRS = scripts doc mirrors motds do_subst = sed -e "s%[@]TERMUX_PREFIX[@]%$(termux_prefix)%g" \ -e "s%[@]TERMUX_APP_PACKAGE[@]%${termux_app_package}%g" \ @@ -41,7 +34,7 @@ $1: $1.in Makefile endef # Login script -sysconf_DATA += termux-login.sh +sysconf_DATA = termux-login.sh # profile.d script pkgdata_PROFILE = init-termux-properties.sh diff --git a/configure.ac b/configure.ac index bc8f0ed..f16f99b 100644 --- a/configure.ac +++ b/configure.ac @@ -93,6 +93,6 @@ AC_SUBST(termux_package_manager) AC_PROG_LN_S AC_CONFIG_FILES([Makefile scripts/Makefile doc/Makefile -mirrors/Makefile]) +mirrors/Makefile motds/Makefile]) AC_OUTPUT diff --git a/motds/Makefile.am b/motds/Makefile.am new file mode 100644 index 0000000..a27746f --- /dev/null +++ b/motds/Makefile.am @@ -0,0 +1,38 @@ +# Copyright (C) 2022 Termux + +# This file is part of termux-tools. + +# termux-tools 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. + +# termux-tools 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 termux-tools. If not, see +# . + + +# We have two variants of our motd message loaded by login script: +# 1. motd.sh: A dynamic motd that is executed with bash and echos a +# motd message with escape sequences, optionally with a terminal logo. +# 2. motd: A static motd that is just read as is with cat and displayed. + +# The motd-playstore is an additional motd that will only be displayed +# if the termux-app version is very old (like the version found on playstore) +sysconf_DATA = motd.sh motd-playstore + +CLEANFILES = motd.sh + + +define process-rule +$1: $1.in Makefile + @echo "Creating $1" + @cat $(srcdir)/$1.in > $1 +endef + +$(eval $(call process-rule,motd.sh)) diff --git a/motd-playstore b/motds/motd-playstore similarity index 100% rename from motd-playstore rename to motds/motd-playstore diff --git a/motd.sh b/motds/motd.sh.in similarity index 100% rename from motd.sh rename to motds/motd.sh.in