1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
|
# The mirrorrib(1) program consists of a collection of shell scripts, so
# there is nothing to build for the program as such. However, some files
# the program or its user uses want building or configuration, as for
# example localization message catalogs. This Makefile builds and
# configures such files.
.DEFAULT_GOAL := all
.PHONY: all mo clean
SHELL := /bin/bash
.SHELLFLAGS := -efuc
etc/mirrorrib.conf: etc/mirrorrib.conft ./build.conf
. ./build.conf && sed -r <$< >$@ \
-e "s/^([^#=]*=)PARAMETER_VERSION\\s*$$/\\1$${VERSION}/;t;" \
-e "s/^([^#=]*=)PARAMETER_VERDATE\\s*$$/\\1$${VERDATE}/;t;" \
-e "s/^([^#=]*=)PARAMETER_VERTIME\\s*$$/\\1$${VERTIME}/;t;"
usr/share/mirrorrib/backstops/backstop.conf: etc/mirrorrib.conf
sed -rn >$@ 's/\s*#.*$$//;/\S/p' $^
usr/share/man/man1/mirrorrib.1: usr/share/man/man1/mirrorrib.1t \
etc/mirrorrib.conf
. etc/mirrorrib.conf && DOC_MANPAGE_REVDATE=$$( \
echo "$$VERDATE" | sed -r 's/^(....)(..)(.*)$$/\1-\2-\3/' \
) \
&& sed -r <$< >$@ \
-e "/\\.r([^a-z]|$$)/d" \
-e "s/(\\.)x([^a-z]|$$)/\\1$${DOC_OLD_MINOR_VER}\\2/g" \
-e "s/(\\.)y([^a-z]|$$)/\\1$${DOC_NEW_MINOR_VER}\\2/g" \
-e "s/PARAMETER_REPOSITORY_SIZE/$${DOC_NEW_REPOS_SIZE}/g" \
-e "s/PARAMETER_REVISION_DATE/$${DOC_MANPAGE_REVDATE}/g" \
-e "s/PARAMETER_REVISION_NUMBER/$${VERSION}/g"
usr/share/locale/%/LC_MESSAGES/mirrorrib.mo: po/%.po
mkdir -pv -- $(dir $@)
msgfmt -cv --statistics -L Shell -o $@ -- $<
mo: $(patsubst\
po/%.po,usr/share/locale/%/LC_MESSAGES/mirrorrib.mo,$(wildcard po/*.po))
all: etc/mirrorrib.conf usr/share/mirrorrib/backstops/backstop.conf \
usr/share/man/man1/mirrorrib.1 mo
clean:
rm -rfv -- \
etc/mirrorrib.conf \
usr/share/mirrorrib/backstops/backstop.conf \
usr/share/man/man1/mirrorrib.1 \
usr/share/locale
|