Skip to content

Commit

Permalink
Add profile.d init-termux-properties.sh script
Browse files Browse the repository at this point in the history
  • Loading branch information
Grimler91 committed Aug 3, 2022
1 parent 4dab21e commit 0683191
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 10 deletions.
18 changes: 16 additions & 2 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -43,21 +43,35 @@ endef
# Login script
sysconf_DATA += termux-login.sh

# profile.d script
pkgdata_PROFILE = init-termux-properties.sh

pkgdata_EXAMPLES = termux.properties

$(eval $(call sed-rule,init-termux-properties.sh))

$(eval $(call sed-rule,termux-login.sh))

install-data-local:
install-data-local: $(pkgdata_PROFILE)
$(MKDIR_P) $(DESTDIR)$(datarootdir)/examples/termux
for f in $(pkgdata_EXAMPLES); do \
$(INSTALL) -m 644 $(srcdir)/$$f \
$(DESTDIR)$(datarootdir)/examples/termux; \
done
$(MKDIR_P) $(DESTDIR)$(sysconfdir)/profile.d
for f in $(pkgdata_PROFILE); do \
$(INSTALL) -m 644 $$f \
$(DESTDIR)$(sysconfdir)/profile.d; \
done

uninstall-local:
for f in $(pkgdata_EXAMPLES); do \
rm -f $(DESTDIR)$(datarootdir)/examples/termux/$$f; \
done
-rmdir $(DESTDIR)$(datarootdir)/examples/termux
for f in $(pkgdata_PROFILE); do \
rm -f $(DESTDIR)$(sysconfdir)/profile.d/$$f; \
done
-rmdir $(DESTDIR)$(sysconfdir)/profile.d

EXTRA_DIST = $(pkgdata_DATA) $(pkgdata_EXAMPLES)
EXTRA_DIST = $(pkgdata_DATA) $(pkgdata_PROFILE) $(pkgdata_EXAMPLES)
4 changes: 4 additions & 0 deletions init-termux-properties.sh.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
if [ ! -f @TERMUX_HOME@/.config/termux/termux.properties ] && [ ! -e @TERMUX_HOME@/.termux/termux.properties ]; then
mkdir -p @TERMUX_HOME@/.termux
cp @TERMUX_PREFIX@/share/examples/termux/termux.properties @TERMUX_HOME@/.termux/
fi
8 changes: 0 additions & 8 deletions packages/termux-tools/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,6 @@ termux_step_make_install() {
pandoc --standalone --to man --output $TERMUX_PREFIX/share/man/man1/termux.1 \
$TERMUX_PKG_TMPDIR/termux.1.md

mkdir -p $TERMUX_PREFIX/etc/profile.d
cat <<- EOF > $TERMUX_PREFIX/etc/profile.d/init-termux-properties.sh
if [ ! -f $TERMUX_ANDROID_HOME/.config/termux/termux.properties ] && [ ! -e $TERMUX_ANDROID_HOME/.termux/termux.properties ]; then
mkdir -p $TERMUX_ANDROID_HOME/.termux
cp $TERMUX_PREFIX/share/examples/termux/termux.properties $TERMUX_ANDROID_HOME/.termux/
fi
EOF

mkdir -p $TERMUX_PREFIX/etc/termux
cp -r $TERMUX_PKG_BUILDER_DIR/mirrors $TERMUX_PREFIX/etc/termux/
cd $TERMUX_PREFIX
Expand Down

0 comments on commit 0683191

Please sign in to comment.