Skip to content

Commit

Permalink
make further use of .in-files
Browse files Browse the repository at this point in the history
  • Loading branch information
Yann Büchau committed May 25, 2017
1 parent 94ecece commit 49712ad
Show file tree
Hide file tree
Showing 13 changed files with 40 additions and 426 deletions.
11 changes: 10 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -139,5 +139,14 @@ debian/files
# autoconf stuff
*.cache/
*.scan
Makefile
config.status

# instantiated template files
Makefile
bin/simbuto
etc/simbuto/conf/gui.conf
lib/simbuto/python/simbuto/__init__.py
lib/simbuto/python/simbuto/config.py
lib/simbuto/python/simbuto/manager.py
share/applications/simbuto.desktop

24 changes: 21 additions & 3 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,15 @@ pdfdir:=@pdfdir@
# ps documentation [DOCDIR]
psdir:=@psdir@

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

$(foreach configure_dir,$(configure_dirs),\
$(eval $(configure_dir) := $(abspath $(DESTDIR)/$($(configure_dir)))))
Expand Down Expand Up @@ -96,9 +102,18 @@ PANDOCOPTS = -f markdown -t man --standalone
IN_FILES = $(shell find $(local_dirs) -type f -iname '*.in')
IN_FILES_INSTANTIATED = $(IN_FILES:.in=)

SIMBUTOVERSION := @PACKAGE_VERSION@
SIMBUTODATE := $(shell date +%F)

CONFIGURE_AC = configure.ac

# get information from changelog
DEBIAN_CHANGELOG = debian/changelog
DEBIAN_CHANGELOG_VERSION = $(shell perl -ne 'if(s/^simbuto\s*\((.*?)\).*$$/$$1/g){print;exit}' $(DEBIAN_CHANGELOG))

# default target
.PHONY: all
all: $(MOFILES) $(GFMANPAGES) $(SIMBUTOPYTHONINIT) $(IN_FILES_INSTANTIATED)
all: $(MOFILES) $(GFMANPAGES) $(SIMBUTOPYTHONINIT) $(IN_FILES_INSTANTIATED) $(CONFIGURE_AC)


# create rule to install a FILE into the TARGET_DIRECTORY
Expand Down Expand Up @@ -130,7 +145,7 @@ $(foreach configure_dir,$(configure_dirs),\

# build the manpages
# manpages:
%.1: %.1.md
%.1: %.1.md $(DEBIAN_CHANGELOG)
pandoc $(PANDOCOPTS) -Vfooter='Version $(SIMBUTOVERSION)' -Vdate='$(SIMBUTODATE)' -o $@ $<

# create the pot-file with all translatable strings from the srcfiles
Expand All @@ -150,10 +165,12 @@ $(sort $(install_target_dirs)): % :
mkdir -p $@
@echo $@ >> $(installed_files_file)

$(CONFIGURE_AC): $(DEBIAN_CHANGELOG)
perl -pi -e 's#^(\s*AC_INIT\([^,]*,\s*\[)([.0-9_a-zA-Z-]+)(\]\s*,.*\))#$${1}$(DEBIAN_CHANGELOG_VERSION)$${3}#g' $@

# substitute variables in a file
$(IN_FILES_INSTANTIATED): % : %.in Makefile
perl -pe '$(foreach configure_dir,$(configure_dirs),s#[@]$(configure_dir)[@]#$($(configure_dir))#g;)' < $< > $@
perl -pe '$(foreach var,$(configure_vars),s#[@]$(var)[@]#$($(var))#g;)' < $< > $@

.PHONY: bin_executable
bin_executable: $(local_bindir_toinstall)
Expand Down Expand Up @@ -181,6 +198,7 @@ uninstall:
clean:
rm -f $(MOFILES) $(POTFILE) $(GFMANPAGES)
rm -rf $(addprefix $(DEBIAN)/,files *.substvars *.debhelper simbuto debhelper-build-stamp *.debhelper.log)
rm -f $(IN_FILES_INSTANTIATED)
rm -f $(installed_files_file)


Expand Down
132 changes: 0 additions & 132 deletions bin/simbuto

This file was deleted.

2 changes: 1 addition & 1 deletion debian/changelog
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
simbuto (0.1.8) UNRELEASED; urgency=medium

* add Swedish and French translation
* add parts of Swedish and French translation

-- Yann Büchau <[email protected]> Sun, 19 Feb 2017 11:47:01 +0100

Expand Down
6 changes: 0 additions & 6 deletions etc/simbuto/conf/gui.conf

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# Internal modules

# the version
VERSION = "0.1.8"
VERSION = "@PACKAGE_VERSION@"

__version__ = VERSION

Expand Down
112 changes: 0 additions & 112 deletions lib/simbuto/python/simbuto/config.py

This file was deleted.

Loading

0 comments on commit 49712ad

Please sign in to comment.