71 lines
2.2 KiB
Makefile
71 lines
2.2 KiB
Makefile
# This file is free software; you can redistribute it and/or modify
|
|
# it under the terms of the GNU General Public License version 2 as
|
|
# published by the Free Software Foundation here:
|
|
# (http://www.gnu.org/licenses/gpl-2.0.html)
|
|
#
|
|
# This program is distributed in the hope that it will be useful,
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
# GNU General Public License for more details.
|
|
|
|
DEPENDS =
|
|
ARCH = x86_64
|
|
URL = https://www.iana.org/time-zones
|
|
DESC = The Time Zone Database (often called tz or zoneinfo) contains code \
|
|
and data that represent the history of local time for many representative \
|
|
locations around the globe
|
|
SNAPVER = sr0
|
|
|
|
ARCHIVE := $(PWD)/SRC/$(shell ls SRC|egrep '(bz2|gz|tar|xz)$$'|tail -1)
|
|
TYPE := $(shell file -ib $(ARCHIVE)|cut -d';' -f1|tr -d '\n')
|
|
SRCDIR := SRCDIR
|
|
PATCHDIR := $(PWD)/SRC/patches
|
|
VERSION := $(shell echo $(ARCHIVE)|egrep -o '[0-9]+[a-z]+')$(SNAPVER)
|
|
|
|
include /usr/share/snap/Makefile.snaplinux
|
|
|
|
$(SRCDIR)/version: $(ARCHIVE)
|
|
@install -v -d -m 755 $(SRCDIR)
|
|
@if [ '$(TYPE)' == 'application/x-bzip2' ]; then \
|
|
tar -jxf $(ARCHIVE) -C $(SRCDIR); \
|
|
elif [ '$(TYPE)' == 'application/x-gzip' ]; then \
|
|
tar -zxf $(ARCHIVE) -C $(SRCDIR); \
|
|
elif [ '$(TYPE)' == 'application/x-tar' ]; then \
|
|
tar -xf $(ARCHIVE) -C $(SRCDIR); \
|
|
elif [ '$(TYPE)' == 'application/x-xz' ]; then \
|
|
tar -xf $(ARCHIVE) -C $(SRCDIR); \
|
|
else \
|
|
echo 'Unable to determine archive type'; \
|
|
exit 1; \
|
|
fi
|
|
@touch $(SRCDIR)/version
|
|
|
|
$(ROOT): $(SRCDIR)/version
|
|
@if [ -d $(ROOT) ]; then \
|
|
touch $(ROOT); \
|
|
else \
|
|
mkdir -v $(ROOT); \
|
|
fi
|
|
|
|
@cd $(SRCDIR) && \
|
|
install -v -d -m 755 $(ROOT)/usr/share/zoneinfo/{posix,right} && \
|
|
for tz in etcetera southamerica northamerica europe africa \
|
|
antarctica asia australasia backward pacificnew; do \
|
|
pwd && \
|
|
zic -L /dev/null -d $(ROOT)/usr/share/zoneinfo \
|
|
-y "sh yearistype.sh" $$tz && \
|
|
zic -L /dev/null -d $(ROOT)/usr/share/zoneinfo/posix \
|
|
-y "sh yearistype.sh" $$tz && \
|
|
zic -L leapseconds -d $(ROOT)/usr/share/zoneinfo/right \
|
|
-y "sh yearistype.sh" $$tz; \
|
|
done && \
|
|
cp -v zone.tab iso3166.tab $(ROOT)/usr/share/zoneinfo
|
|
|
|
clean:
|
|
@rm -rvf $(ROOT) \
|
|
$(SNAPINFO) \
|
|
$(MANIFEST) \
|
|
$(FILES) \
|
|
$(SRCDIR)
|
|
|