openmamba-wallpapers/Makefile

112 lines
3.5 KiB
Makefile
Raw Permalink Normal View History

2022-06-25 17:59:22 +02:00
# Makefile for openmamba-wallpapers
# Copyright (C) 2022 by Silvan Calarco <silvan.calarco@mambasoft.it>
include VERSION
PACKAGE = openmamba-wallpapers
DISTROID = openmamba
RPM_VENDOR = openmamba
RPM_DISTRIBUTION = openmamba
RPM_DISTROEXT = mamba
WALLPAPERS = openmamba_Bamboo,openmamba_Circles,openmambaRandom
DEFAULT_WALLPAPER = openmamba_Circles
DISTROid = $(shell echo $(DISTROID) | tr A-Z a-z)
DISTROICON = $(DISTROid)
DESTDIR =
prefix = /usr
exec_prefix = ${prefix}
sysconfdir = /etc
sbindir = ${exec_prefix}/sbin
bindir = ${exec_prefix}/bin
datadir = ${prefix}/share
mandir = ${prefix}/usr/share/man
sysconfigdir= ${sysconfdir}/sysconfig
iconsdir = ${datadir}/icons/hicolor
wallpapersdir = ${datadir}/wallpapers
localesdir = ${kdedatadir}/locale
xdg_appsdir = ${datadir}/applications
xdg_directorydir = ${datadir}/desktop-directories
xdg_menudir = ${sysconfdir}/xdg/menus
xdg_mergedmenudir = $(xdg_menudir)/applications-merged
srcdir = .
INSTALL = /usr/bin/install
INSTALL_PROGRAM = ${INSTALL} -m 755
INSTALL_DATA = ${INSTALL} -m 644
INSTALL_DIR = ${INSTALL} -d -m 755
INSTALL_SCRIPT = ${INSTALL_PROGRAM}
distdir = $(PACKAGE)-$(VERSION)
dist_archive = $(distdir).tar.bz2
.SUFFIXES:
.SUFFIXES: .in .po .mo
.in:; @echo "generating $@..."; \
sed "s,@distroID@,$(DISTROID),g;\
s,@distroid@,$(DISTROid),g;\
s,@distroicon@,$(DISTROICON),g;\
s,@distribution@,$(RPM_DISTRIBUTION),g;\
s,@distroext@,$(RPM_DISTROEXT),g;\
s,@vendor@,$(RPM_VENDOR),g;\
s,@sysconfigfile@,$(SYSCONFIGFILE),g;\
s,@datadir@,${datadir},g;\
s,@wallpaper@,$(DEFAULT_WALLPAPER),g;" $< > $@
all: wallpapers
wallpapers:
$(INSTALL_DIR) wallpapers; \
cp -a src/wallpapers/{$(WALLPAPERS)} wallpapers/; \
for w in openmamba_Circles; do \
mkdir -p wallpapers/$${w}/contents/images; \
convert src/wallpapers/$${w}.png +repage -gravity SouthEast -resize 400 -crop 400x250+0+0 +repage wallpapers/$${w}/contents/screenshot.png; \
for s in 1280x800 1440x900 1920x1200; do \
convert src/wallpapers/$${w}.png +repage -gravity SouthEast -resize $${s/x*} \
-crop $${s}+0+0 +repage wallpapers/$${w}/contents/images/$${s}.png; \
done; \
for s in 1024x768 1280x1024 1600x1200; do \
convert src/wallpapers/$${w}.png +repage -gravity SouthEast -resize x$${s/*x} \
-crop $${s}+0+0 +repage wallpapers/$${w}/contents/images/$${s}.png; \
done; done; \
sizes="1024x768 1280x800 1600x1200 1920x1200 720x1440 1080x1920 1366x768 1680x1050 2560x1440 440x247 1280x1024 1440x900 1920x1080 2560x1600 360x720"; \
for w in openmambaRandom; do \
mkdir -p wallpapers/$${w}/contents/images; \
convert src/wallpapers/$${w}.png +repage -gravity SouthEast -resize 400 -crop 400x250+0+0 +repage wallpapers/$${w}/contents/screenshot.png; \
for s in $${sizes}; do \
convert src/wallpapers/$${w}.png +repage -gravity SouthEast -resize $${s/x*} \
-crop $${s}+0+0 +repage wallpapers/$${w}/contents/images/$${s}.png; \
done; done
install-wallpapers: wallpapers
@$(INSTALL_DIR) $(DESTDIR)$(wallpapersdir)
cp -a wallpapers/{$(WALLPAPERS)} $(DESTDIR)$(wallpapersdir)
install: $(pck_infiles:.in=) \
install-wallpapers
dist: clean
@mkdir /tmp/$(distdir)
@cp -a * /tmp/$(distdir)/
@rm -f $(dist_archive);\
tar cf - -C /tmp $(distdir) | bzip2 -9 -c > $(dist_archive)
@rm -rf /tmp/$(distdir)
@echo "file \`$(dist_archive)' created"
dist-rpm: dist
@rpm_sourcedir=`rpm --eval=%{_sourcedir}`;\
mv -f $(dist_archive) $$rpm_sourcedir;\
echo "and saved as \`$$rpm_sourcedir/$(dist_archive)'"
clean:
rm -f $(dist_archive)
rm -rf wallpapers