From db94949a1abf3f2fe3574425da7dd000ab9c3ac1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yann=20B=C3=BCchau?= Date: Sun, 11 Jun 2017 15:28:41 +0200 Subject: [PATCH] v0.0.13: don't force AES256 on GPG de-/encryption - structural improvements to reduce redundancies --- .gitignore | 3 - Makefile.in | 146 ++++-------------- bin/.gitignore | 2 + bin/uca-apply.in | 72 +-------- configure | 21 ++- configure.ac | 18 ++- debian/changelog | 5 +- include/thunar-custom-actions/.gitignore | 2 + m4/.gitignore | 2 + .../system-uca/.gitignore | 2 + 10 files changed, 84 insertions(+), 189 deletions(-) create mode 100644 bin/.gitignore create mode 100644 include/thunar-custom-actions/.gitignore create mode 100644 m4/.gitignore create mode 100644 share/thunar-custom-actions/system-uca/.gitignore diff --git a/.gitignore b/.gitignore index 8bb386d..0b65356 100644 --- a/.gitignore +++ b/.gitignore @@ -26,6 +26,3 @@ config.status # instantiated template files Makefile -bin/uca-apply -m4/tuca.m4 -share/thunar-custom-actions/system-uca/*.xml diff --git a/Makefile.in b/Makefile.in index fc22b07..1ed7828 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,110 +1,5 @@ #!@make_bin@ -f -############################################################ -### get all the ./configure arguments into this Makefile ### -############################################################ - -# install architecture-independent files in PREFIX [/usr/local] -prefix:=@prefix@ -# install architecture-dependent files in EPREFIX [PREFIX] -exec_prefix:=@exec_prefix@ -# user executables [EPREFIX/bin] -bindir:=@bindir@ -# system admin executables [EPREFIX/sbin] -sbindir:=@sbindir@ -# program executables [EPREFIX/libexec] -libexecdir:=@libexecdir@ -# read-only single-machine data [PREFIX/etc] -sysconfdir:=@sysconfdir@ -# modifiable architecture-independent data [PREFIX/com] -sharedstatedir:=@sharedstatedir@ -# modifiable single-machine data [PREFIX/var] -localstatedir:=@localstatedir@ -# modifiable per-process data [LOCALSTATEDIR/run] -runstatedir:=@runstatedir@ -# object code libraries [EPREFIX/lib] -libdir:=@libdir@ -# C header files [PREFIX/include] -includedir:=@includedir@ -# C header files for non-gcc [/usr/include] -oldincludedir:=@oldincludedir@ -# read-only arch.-independent data root [PREFIX/share] -datarootdir:=@datarootdir@ -# read-only architecture-independent data [DATAROOTDIR] -datadir:=@datadir@ -# info documentation [DATAROOTDIR/info] -infodir:=@infodir@ -# locale-dependent data [DATAROOTDIR/locale] -localedir:=@localedir@ -# man documentation [DATAROOTDIR/man] -mandir:=@mandir@ -# documentation root [DATAROOTDIR/doc/thunar-custom-actions] -docdir:=@docdir@ -# html documentation [DOCDIR] -htmldir:=@htmldir@ -# dvi documentation [DOCDIR] -dvidir:=@dvidir@ -# pdf documentation [DOCDIR] -pdfdir:=@pdfdir@ -# ps documentation [DOCDIR] -psdir:=@psdir@ - -# binaries -make_bin:=@make_bin@ -xdg_open_bin:=@xdg_open_bin@ -convert_bin:=@convert_bin@ -su_bin:=@su_bin@ -xargs_bin:=@xargs_bin@ -find_bin:=@find_bin@ -perl_bin:=@perl_bin@ -gpg2_bin:=@gpg2_bin@ -zenity_bin:=@zenity_bin@ -bc_bin:=@bc_bin@ -gs_bin:=@gs_bin@ -m4_bin:=@m4_bin@ -pandoc_bin:=@pandoc_bin@ -python3_bin:=@python3_bin@ -gettext_bin:=@gettext_bin@ -gettextsh_bin:=@gettextsh_bin@ -xgettext_bin:=@xgettext_bin@ -msgfmt_bin:=@msgfmt_bin@ -msgmerge_bin:=@msgmerge_bin@ - -PACKAGE_VERSION := @PACKAGE_VERSION@ -PACKAGE_NAME := @PACKAGE_NAME@ -PACKAGE_STRING := @PACKAGE_STRING@ - -configure_dirs = bindir sbindir libexecdir sysconfdir sharedstatedir \ - localstatedir runstatedir libdir includedir oldincludedir datarootdir \ - datadir infodir localedir mandir docdir htmldir dvidir pdfdir psdir -configure_vars = $(configure_dirs) \ - PACKAGE_VERSION PACKAGE_STRING PACKAGE_NAME PACKAGE_URL \ - PASSWDFILE UCAFILE \ - make_bin \ - xdg_open_bin \ - convert_bin \ - su_bin \ - xargs_bin \ - find_bin \ - perl_bin \ - gpg2_bin \ - zenity_bin \ - bc_bin \ - gs_bin \ - m4_bin \ - pandoc_bin \ - python3_bin \ - gettext_bin \ - gettextsh_bin \ - xgettext_bin \ - msgfmt_bin \ - msgmerge_bin - -$(foreach configure_dir,$(configure_dirs),\ - $(eval $(configure_dir) := $(abspath $(DESTDIR)/$($(configure_dir))))) -# $(foreach configure_dir,$(configure_dirs),\ -# $(info $(configure_dir) := $($(configure_dir)))) - ############################# ### The local directories ### ############################# @@ -113,9 +8,25 @@ local_mandir = man local_bindir = bin local_datarootdir = share local_localedir = locale +local_includedir = include -local_dirs = $(local_mandir) $(local_bindir) $(local_datarootdir) \ - $(local_localedir) +############################################################ +### get all the ./configure arguments into this Makefile ### +############################################################ +makefile_include:=@makefile_include@ +makefile_include_local_path:=$(local_includedir)/@PACKAGE_NAME@/$(makefile_include) +include $(makefile_include_local_path) + +# install directory paths from configure +configure_dirs = $(filter %dir,$(configure_vars)) +# executable paths from configure +configure_bins = $(filter %_bin,$(configure_vars)) +# corresponding local directories +local_dirs = $(foreach directory,$(configure_dirs),$(local_$(directory))) + +# merge DESTDIR from dpkg-buildpackage into paths +$(foreach configure_dir,$(configure_dirs),\ + $(eval $(configure_dir) := $(abspath $(DESTDIR)/$($(configure_dir))))) installed_files_file = installed_files.tmp @@ -134,7 +45,7 @@ tuca_include_m4 = $(M4_INCL)/tuca.m4 # pandoc options for manpage creation PANDOCOPTS = -f markdown -t man --standalone -IN_FILES = $(shell $(find_bin) $(local_dirs) $(M4_INCL) -type f -iname '*.in') +IN_FILES = $(shell $(find_bin) $(local_dirs) $(M4_INCL) -type f -iname '*.in' -not -name '$(notdir $(makefile_include_local_path))*') IN_FILES_INSTANTIATED = $(IN_FILES:.in=) CONFIGURE_AC = configure.ac @@ -172,13 +83,14 @@ $$(eval install_target_dirs = $$(install_target_dirs) $$(dir $$(_target))) $$(eval install_targets = $$(install_targets) $$(_target)) endef -find_opts = -not -type d -not -iname '*.in' +find_opts = -not -type d -not -iname '*.in' -not -iname '.gitignore' # define the local content that is to install local_datarootdir_toinstall = $(shell $(find_bin) $(local_datarootdir) $(find_opts) -not -iname '*.m4') local_mandir_toinstall = $(GFMANPAGES) local_localedir_toinstall = $(MOFILES) local_bindir_toinstall = $(shell $(find_bin) $(local_bindir) $(find_opts)) +local_includedir_toinstall = $(shell $(find_bin) $(local_includedir) $(find_opts)) # set up install rules for all configure directories $(foreach configure_dir,$(configure_dirs),\ @@ -229,7 +141,7 @@ bin_executable: $(local_bindir_toinstall) .PHONY: $(install_targets) install: bin_executable $(sort $(install_targets)) -@sort -u $(installed_files_file) -o $(installed_files_file) - + # remove a file/folder without asking # $(call remove,PATH) # This is only to display a newline after the command @@ -238,24 +150,26 @@ rm -rf $(1) endef -.PHONY: reset -reset: - $(bindir)/uca-apply remove - .PHONY: uninstall -uninstall: reset +uninstall: $(foreach file,$(sort $(install_targets) $(shell cat $(installed_files_file))),$(call remove,$(file))) rm -f $(installed_files_file) @echo WARNING: There might still be some empty folders left. This should not be a problem. .PHONY: clean clean: - rm -rf $(addprefix $(DEBIAN)/,files *.substvars *.debhelper $(PACKAGE_NAME) debhelper-build-stamp *.debhelper.log) rm -f $(IN_FILES_INSTANTIATED) rm -f $(UCA_XML_FILES) rm -f $(GFMANPAGES) rm -f $(installed_files_file) rm -f $(only_uca_cmd_file) +.PHONY: debclean +debclean: + rm -rf $(addprefix $(DEBIAN)/,files *.substvars *.debhelper $(PACKAGE_NAME) debhelper-build-stamp *.debhelper.log) +.PHONY: distclean +distclean: clean debclean + rm -f $(makefile_include_local_path) + rm -f Makefile diff --git a/bin/.gitignore b/bin/.gitignore new file mode 100644 index 0000000..e27989b --- /dev/null +++ b/bin/.gitignore @@ -0,0 +1,2 @@ +# instantiated files +uca-apply diff --git a/bin/uca-apply.in b/bin/uca-apply.in index fa9b0ee..c09e7f1 100644 --- a/bin/uca-apply.in +++ b/bin/uca-apply.in @@ -1,80 +1,20 @@ #!@make_bin@ -f - -# user executables [EPREFIX/bin] -bindir:=@bindir@ -# system admin executables [EPREFIX/sbin] -sbindir:=@sbindir@ -# program executables [EPREFIX/libexec] -libexecdir:=@libexecdir@ -# read-only single-machine data [PREFIX/etc] -sysconfdir:=@sysconfdir@ -# modifiable architecture-independent data [PREFIX/com] -sharedstatedir:=@sharedstatedir@ -# modifiable single-machine data [PREFIX/var] -localstatedir:=@localstatedir@ -# modifiable per-process data [LOCALSTATEDIR/run] -runstatedir:=@runstatedir@ -# object code libraries [EPREFIX/lib] -libdir:=@libdir@ -# C header files [PREFIX/include] -includedir:=@includedir@ -# C header files for non-gcc [/usr/include] -oldincludedir:=@oldincludedir@ -# read-only arch.-independent data root [PREFIX/share] -datarootdir:=@datarootdir@ -# read-only architecture-independent data [DATAROOTDIR] -datadir:=@datadir@ -# info documentation [DATAROOTDIR/info] -infodir:=@infodir@ -# locale-dependent data [DATAROOTDIR/locale] -localedir:=@localedir@ -# man documentation [DATAROOTDIR/man] -mandir:=@mandir@ -# documentation root [DATAROOTDIR/doc/thunar-custom-actions] -docdir:=@docdir@ -# html documentation [DOCDIR] -htmldir:=@htmldir@ -# dvi documentation [DOCDIR] -dvidir:=@dvidir@ -# pdf documentation [DOCDIR] -pdfdir:=@pdfdir@ -# ps documentation [DOCDIR] -psdir:=@docdir@ - -# programs -make_bin:=@make_bin@ -xdg_open_bin:=@xdg_open_bin@ -find_bin:=@find_bin@ -convert_bin:=@convert_bin@ -su_bin:=@su_bin@ -xargs_bin:=@xargs_bin@ -perl_bin:=@perl_bin@ -gpg2_bin:=@gpg2_bin@ -zenity_bin:=@zenity_bin@ -bc_bin:=@bc_bin@ -gs_bin:=@gs_bin@ -m4_bin:=@m4_bin@ -pandoc_bin:=@pandoc_bin@ -python3_bin:=@python3_bin@ +include $(DESTDIR)/@includedir@/@PACKAGE_NAME@/@makefile_include@ # passwd file -ifeq (@PASSWDFILE@,) +ifeq ($(PASSWDFILE),) passwdfile:=$(sysconfdir)/passwd else -passwdfile:=@PASSWDFILE@ +passwdfile:=$(PASSWDFILE) endif # uca file path -ifeq (@UCAFILE@,) +ifeq ($(UCAFILE),) ucafile:=.config/Thunar/uca.xml else -ucafile:=@UCAFILE@ +ucafile:=$(UCAFILE) endif -PACKAGE_VERSION := @PACKAGE_VERSION@ -PACKAGE_NAME := @PACKAGE_NAME@ -PACKAGE_STRING := @PACKAGE_STRING@ - -ifeq ($(shell test -e "$(passwdfile)" && echo "yes" || echo "no"),no) +ifeq ($(wildcard $(passwdfile)),) $(error passwd-file "$(passwdfile)" does not exist) endif diff --git a/configure b/configure index ef5303b..d3f8002 100755 --- a/configure +++ b/configure @@ -586,6 +586,8 @@ PACKAGE_URL='' ac_subst_vars='LTLIBOBJS LIBOBJS +configure_vars +makefile_include msgmerge_bin msgfmt_bin xgettext_bin @@ -2684,8 +2686,24 @@ $as_echo "no" >&6; } fi +# create Makefile input with all output variables from here +makefile_include=configure_vars.mk +makefile_include_local=include/$PACKAGE_NAME/${makefile_include} +mkdir -p $(dirname ${makefile_include}.in) +echo '# generated by autoconf' > ${makefile_include_local}.in # empty file -ac_config_files="$ac_config_files Makefile" +configure_vars=$(echo "$ac_subst_vars" | uniq | perl -pe 's#\s+# #g') +for var in $configure_vars;do + # set the variables in RECURSIVELY EXPANDING mode + echo "$var=@$var@" >> ${makefile_include_local}.in +done +for var in $configure_vars;do + # set the variables in SIMPLE EXPANDING mode + echo "$var:=@$var@" >> ${makefile_include_local}.in +done + + +ac_config_files="$ac_config_files ${makefile_include_local} Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -3392,6 +3410,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 for ac_config_target in $ac_config_targets do case $ac_config_target in + "${makefile_include_local}") CONFIG_FILES="$CONFIG_FILES ${makefile_include_local}" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; diff --git a/configure.ac b/configure.ac index 82aacec..18c5cfc 100644 --- a/configure.ac +++ b/configure.ac @@ -48,6 +48,22 @@ REQUIRE_PROG([msgmerge],[msgmerge_bin],[program]) # Check for Python modules AX_PYTHON_MODULE(lxml,fatal,python3) +# create Makefile input with all output variables from here +makefile_include=configure_vars.mk +makefile_include_local=include/$PACKAGE_NAME/${makefile_include} +mkdir -p $(dirname ${makefile_include}.in) +echo '# generated by autoconf' > ${makefile_include_local}.in # empty file +AC_SUBST([makefile_include]) +configure_vars=$(echo "$ac_subst_vars" | uniq | perl -pe 's#\s+# #g') +for var in $configure_vars;do + # set the variables in RECURSIVELY EXPANDING mode + echo "$var=@$var@" >> ${makefile_include_local}.in +done +for var in $configure_vars;do + # set the variables in SIMPLE EXPANDING mode + echo "$var:=@$var@" >> ${makefile_include_local}.in +done +AC_SUBST([configure_vars]) -AC_CONFIG_FILES([Makefile]) +AC_CONFIG_FILES([${makefile_include_local} Makefile]) AC_OUTPUT diff --git a/debian/changelog b/debian/changelog index f0f8c96..8794fc3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,9 @@ -thunar-custom-actions (0.0.13) UNRELEASED; urgency=medium +thunar-custom-actions (0.0.13) unstable; urgency=medium * don't force AES256 on gpg symmectric decryption + * structural improvements to reduce redundancies - -- Yann Büchau Sun, 11 Jun 2017 11:04:24 +0200 + -- Yann Büchau Sun, 11 Jun 2017 15:27:53 +0200 thunar-custom-actions (0.0.12) unstable; urgency=medium diff --git a/include/thunar-custom-actions/.gitignore b/include/thunar-custom-actions/.gitignore new file mode 100644 index 0000000..6806821 --- /dev/null +++ b/include/thunar-custom-actions/.gitignore @@ -0,0 +1,2 @@ +# these files are completely created by ./configure +configure_vars.mk* diff --git a/m4/.gitignore b/m4/.gitignore new file mode 100644 index 0000000..547959e --- /dev/null +++ b/m4/.gitignore @@ -0,0 +1,2 @@ +# instantiated files +tuca.m4 diff --git a/share/thunar-custom-actions/system-uca/.gitignore b/share/thunar-custom-actions/system-uca/.gitignore new file mode 100644 index 0000000..6608753 --- /dev/null +++ b/share/thunar-custom-actions/system-uca/.gitignore @@ -0,0 +1,2 @@ +# ignore the instantiated xml files +*.xml