summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLouie S <louie@example.com>2023-03-03 19:08:50 -0800
committerLouie S <louie@example.com>2023-03-03 19:08:50 -0800
commit712af9ea3cb3d0de866221ade19341fd114f7000 (patch)
tree3a2eb7463da71a7baaaecd0721185fa91af92f31
parentd4e52fd03b6a6ef6965a1c66661f202de73178ed (diff)
Change a couple of files to templates for less copy/paste
-rw-r--r--Makefile.in7
-rwxr-xr-xconfigure3
-rw-r--r--configure.ac3
-rw-r--r--data/Makefile.am25
-rw-r--r--data/Makefile.in40
-rw-r--r--data/terminal-media-launcher.desktop.in9
-rw-r--r--spec/terminal-media-launcher.spec.in (renamed from spec/terminal-media-launcher.spec)4
7 files changed, 55 insertions, 36 deletions
diff --git a/Makefile.in b/Makefile.in
index dd24389..5539957 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -97,7 +97,7 @@ DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
configure.lineno config.status.lineno
mkinstalldirs = $(install_sh) -d
-CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_FILES = spec/terminal-media-launcher.spec
CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
@@ -187,7 +187,8 @@ ETAGS = etags
CTAGS = ctags
CSCOPE = cscope
DIST_SUBDIRS = $(SUBDIRS)
-am__DIST_COMMON = $(dist_man_MANS) $(srcdir)/Makefile.in COPYING \
+am__DIST_COMMON = $(dist_man_MANS) $(srcdir)/Makefile.in \
+ $(top_srcdir)/spec/terminal-media-launcher.spec.in COPYING \
compile config.guess config.sub depcomp install-sh missing
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
distdir = $(PACKAGE)-$(VERSION)
@@ -375,6 +376,8 @@ $(top_srcdir)/configure: $(am__configure_deps)
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
$(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
$(am__aclocal_m4_deps):
+spec/terminal-media-launcher.spec: $(top_builddir)/config.status $(top_srcdir)/spec/terminal-media-launcher.spec.in
+ cd $(top_builddir) && $(SHELL) ./config.status $@
install-man1: $(dist_man_MANS) $(man1_MANS)
@$(NORMAL_INSTALL)
@list1='$(man1_MANS)'; \
diff --git a/configure b/configure
index 192ff3a..12c0cdc 100755
--- a/configure
+++ b/configure
@@ -5744,7 +5744,7 @@ else
fi
-ac_config_files="$ac_config_files Makefile src/Makefile docs/Makefile data/Makefile"
+ac_config_files="$ac_config_files Makefile src/Makefile docs/Makefile data/Makefile spec/terminal-media-launcher.spec"
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
@@ -6504,6 +6504,7 @@ do
"src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
"docs/Makefile") CONFIG_FILES="$CONFIG_FILES docs/Makefile" ;;
"data/Makefile") CONFIG_FILES="$CONFIG_FILES data/Makefile" ;;
+ "spec/terminal-media-launcher.spec") CONFIG_FILES="$CONFIG_FILES spec/terminal-media-launcher.spec" ;;
*) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
esac
diff --git a/configure.ac b/configure.ac
index fab92d6..5ffbe5f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -57,7 +57,8 @@ AM_CONDITIONAL([DESKTOP_ENTRY], [test "$desktop_entry" = "yes"])
AC_CONFIG_FILES([Makefile
src/Makefile
docs/Makefile
- data/Makefile])
+ data/Makefile
+ spec/terminal-media-launcher.spec])
AC_OUTPUT
# Print helpful message
diff --git a/data/Makefile.am b/data/Makefile.am
index dafdf2a..b051ebb 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -3,18 +3,23 @@ EXTRA_DIST = terminal-media-launcher.ico terminal-media-launcher.svg
# Build a .desktop entry
if DESKTOP_ENTRY
-BUILT_SOURCES = $(PACKAGE_NAME).desktop
CLEANFILES = $(PACKAGE_NAME).desktop
+
+edit = sed \
+ -e 's|@PACKAGE_NAME[@]|$(PACKAGE_NAME)|g' \
+ -e 's|@bindir[@]|$(bindir)|g' \
+ -e 's|@EXEEXT[@]|$(EXEEXT)|g'
+
$(PACKAGE_NAME).desktop: Makefile
- echo "[Desktop Entry]" > $@
- echo "Type=Application" >> $@
- echo "Name=$(PACKAGE_NAME)" >> $@
- echo "Comment=Terminal Media Launcher" >> $@
- echo "Path=$(bindir)/$(PACKAGE_NAME)$(EXEEXT)" >> $@
- echo "Exec=$(PACKAGE_NAME)$(EXEEXT)" >> $@
- echo "Icon=$(PACKAGE_NAME)" >> $@
- echo "Terminal=true" >> $@
- echo "Categories=Utility" >> $@
+ rm -f $@ $@.tmp
+ srcdir=''; \
+ test -f ./$@.in || srcdir=$(srcdir)/; \
+ $(edit) $${srcdir}$@.in >$@.tmp
+ chmod +x $@.tmp
+ chmod a-w $@.tmp
+ mv $@.tmp $@
+
+$(PACKAGE_NAME).desktop: $(srcdir)/$(PACKAGE_NAME).desktop.in
desktopdir = $(datadir)/applications
icondir = $(datadir)/pixmaps
diff --git a/data/Makefile.in b/data/Makefile.in
index d441747..81264d9 100644
--- a/data/Makefile.in
+++ b/data/Makefile.in
@@ -252,14 +252,17 @@ top_srcdir = @top_srcdir@
EXTRA_DIST = terminal-media-launcher.ico terminal-media-launcher.svg
# Build a .desktop entry
-@DESKTOP_ENTRY_TRUE@BUILT_SOURCES = $(PACKAGE_NAME).desktop
@DESKTOP_ENTRY_TRUE@CLEANFILES = $(PACKAGE_NAME).desktop
+@DESKTOP_ENTRY_TRUE@edit = sed \
+@DESKTOP_ENTRY_TRUE@ -e 's|@PACKAGE_NAME[@]|$(PACKAGE_NAME)|g' \
+@DESKTOP_ENTRY_TRUE@ -e 's|@bindir[@]|$(bindir)|g' \
+@DESKTOP_ENTRY_TRUE@ -e 's|@EXEEXT[@]|$(EXEEXT)|g'
+
@DESKTOP_ENTRY_TRUE@desktopdir = $(datadir)/applications
@DESKTOP_ENTRY_TRUE@icondir = $(datadir)/pixmaps
@DESKTOP_ENTRY_TRUE@desktop_DATA = $(PACKAGE_NAME).desktop
@DESKTOP_ENTRY_TRUE@icon_DATA = $(PACKAGE_NAME).svg
-all: $(BUILT_SOURCES)
- $(MAKE) $(AM_MAKEFLAGS) all-am
+all: all-am
.SUFFIXES:
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@@ -374,17 +377,14 @@ distdir-am: $(DISTFILES)
fi; \
done
check-am: all-am
-check: $(BUILT_SOURCES)
- $(MAKE) $(AM_MAKEFLAGS) check-am
+check: check-am
all-am: Makefile $(DATA)
installdirs:
for dir in "$(DESTDIR)$(desktopdir)" "$(DESTDIR)$(icondir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
-install: $(BUILT_SOURCES)
- $(MAKE) $(AM_MAKEFLAGS) install-am
-install-exec: $(BUILT_SOURCES)
- $(MAKE) $(AM_MAKEFLAGS) install-exec-am
+install: install-am
+install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
@@ -414,7 +414,6 @@ distclean-generic:
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
- -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
clean: clean-am
clean-am: clean-generic mostlyclean-am
@@ -481,7 +480,7 @@ ps-am:
uninstall-am: uninstall-desktopDATA uninstall-iconDATA
-.MAKE: all check install install-am install-exec install-strip
+.MAKE: install-am install-strip
.PHONY: all all-am check check-am clean clean-generic cscopelist-am \
ctags-am distclean distclean-generic distdir dvi dvi-am html \
@@ -497,16 +496,17 @@ uninstall-am: uninstall-desktopDATA uninstall-iconDATA
.PRECIOUS: Makefile
+
@DESKTOP_ENTRY_TRUE@$(PACKAGE_NAME).desktop: Makefile
-@DESKTOP_ENTRY_TRUE@ echo "[Desktop Entry]" > $@
-@DESKTOP_ENTRY_TRUE@ echo "Type=Application" >> $@
-@DESKTOP_ENTRY_TRUE@ echo "Name=$(PACKAGE_NAME)" >> $@
-@DESKTOP_ENTRY_TRUE@ echo "Comment=Terminal Media Launcher" >> $@
-@DESKTOP_ENTRY_TRUE@ echo "Path=$(bindir)/$(PACKAGE_NAME)$(EXEEXT)" >> $@
-@DESKTOP_ENTRY_TRUE@ echo "Exec=$(PACKAGE_NAME)$(EXEEXT)" >> $@
-@DESKTOP_ENTRY_TRUE@ echo "Icon=$(PACKAGE_NAME)" >> $@
-@DESKTOP_ENTRY_TRUE@ echo "Terminal=true" >> $@
-@DESKTOP_ENTRY_TRUE@ echo "Categories=Utility" >> $@
+@DESKTOP_ENTRY_TRUE@ rm -f $@ $@.tmp
+@DESKTOP_ENTRY_TRUE@ srcdir=''; \
+@DESKTOP_ENTRY_TRUE@ test -f ./$@.in || srcdir=$(srcdir)/; \
+@DESKTOP_ENTRY_TRUE@ $(edit) $${srcdir}$@.in >$@.tmp
+@DESKTOP_ENTRY_TRUE@ chmod +x $@.tmp
+@DESKTOP_ENTRY_TRUE@ chmod a-w $@.tmp
+@DESKTOP_ENTRY_TRUE@ mv $@.tmp $@
+
+@DESKTOP_ENTRY_TRUE@$(PACKAGE_NAME).desktop: $(srcdir)/$(PACKAGE_NAME).desktop.in
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/data/terminal-media-launcher.desktop.in b/data/terminal-media-launcher.desktop.in
new file mode 100644
index 0000000..ac2763f
--- /dev/null
+++ b/data/terminal-media-launcher.desktop.in
@@ -0,0 +1,9 @@
+[Desktop Entry]
+Type=Application
+Name=@PACKAGE_NAME@
+Comment=Terminal Media Launcher
+Path=@bindir@/@PACKAGE_NAME@@EXEEXT@
+Exec=@PACKAGE_NAME@@EXEEXT@
+Icon=@PACKAGE_NAME@
+Terminal=true
+Categories=Utility
diff --git a/spec/terminal-media-launcher.spec b/spec/terminal-media-launcher.spec.in
index 2adcc1c..238282e 100644
--- a/spec/terminal-media-launcher.spec
+++ b/spec/terminal-media-launcher.spec.in
@@ -1,5 +1,5 @@
-Name: terminal-media-launcher
-Version: 0.1
+Name: @PACKAGE_NAME@
+Version: @PACKAGE_VERSION@
Release: 1%{?dist}
Summary: Lightweight Terminal Media Launcher written in C