File: Makefile

package info (click to toggle)
simple-image-reducer 1.0.2%2Bgit20191008-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 156 kB
  • sloc: python: 423; makefile: 141
file content (86 lines) | stat: -rw-r--r-- 2,956 bytes parent folder | download | duplicates (2)
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
PKGNAME=simple-image-reducer
VERSION=1.0.3

SUBDIRS=po

PREFIX=/usr

BINDIR=${PREFIX}/bin
DATADIR=${PREFIX}/share

all:	simple-image-reducer $(PKGNAME).desktop

po/$(PKGNAME).pot:: subdirs

subdirs:	$(PKGNAME).desktop.in.h
	for d in $(SUBDIRS); do make -C $$d; [ $$? = 0 ] || exit 1; done

simple-image-reducer: simple-image-reducer.py
	sed "s/@VERSION@/$(VERSION)/g" $< >$@

%.desktop.in.h:	%.desktop.in
	intltool-extract --type=gettext/ini $<

%.desktop: %.desktop.in po/$(PKGNAME).pot po/*.po
	intltool-merge -u -d po/ $< $@

simple-image-reducer.spec: simple-image-reducer.spec.in Makefile
	sed "s/@VERSION@/$(VERSION)/g" simple-image-reducer.spec.in >$@

install:	all
	mkdir -p $(DESTDIR)$(BINDIR)
	mkdir -p $(DESTDIR)$(DATADIR)/pixmaps
	mkdir -p $(DESTDIR)$(DATADIR)/applications
	mkdir -p $(DESTDIR)$(DATADIR)/icons/hicolor/48x48/apps
	mkdir -p $(DESTDIR)$(DATADIR)/icons/hicolor/scalable/apps
	install -m 0755 simple-image-reducer $(DESTDIR)$(BINDIR)
	install -m 0644 ${PKGNAME}.desktop $(DESTDIR)$(DATADIR)/applications/${PKGNAME}.desktop
	install -m 0644 ${PKGNAME}.png $(DESTDIR)$(DATADIR)/pixmaps
	install -m 0644 ${PKGNAME}.png $(DESTDIR)$(DATADIR)/icons/hicolor/48x48/apps
	install -m 0644 ${PKGNAME}.svg $(DESTDIR)$(DATADIR)/icons/hicolor/scalable/apps
	touch --no-create $(DESTDIR)$(DATADIR)/icons/hicolor
	for d in $(SUBDIRS); do \
	(cd $$d; $(MAKE) DESTDIR=$(DESTDIR) install) \
		|| case "$(MFLAGS)" in *k*) fail=yes;; *) exit 1;; esac; \
	done && test -z "$$fail"
	[ -z "$(DESTDIR)" ] && update-desktop-database -q || true
	[ -z "$(DESTDIR)" ] && gtk-update-icon-cache $(DATADIR)/icons/hicolor || true

uninstall:
	rm -f $(DESTDIR)$(BINDIR)/simple-image-reducer
	rm -f $(DESTDIR)$(DATADIR)/applications/${PKGNAME}.desktop
	rm -f $(DESTDIR)$(DATADIR)/pixmaps/${PKGNAME}.png
	rm -f $(DESTDIR)$(DATADIR)/icons/hicolor/48x48/apps/${PKGNAME}.png
	rm -f $(DESTDIR)$(DATADIR)/icons/hicolor/scalable/apps/${PKGNAME}.svg
	for d in $(SUBDIRS); do \
	(cd $$d; $(MAKE) DESTDIR=$(DESTDIR) uninstall) \
		|| case "$(MFLAGS)" in *k*) fail=yes;; *) exit 1;; esac; \
	done && test -z "$$fail"
	touch --no-create $(DESTDIR)$(DATADIR)/icons/hicolor
	[ -z "$(DESTDIR)" ] && update-desktop-database -q || true
	[ -z "$(DESTDIR)" ] && gtk-update-icon-cache $(DATADIR)/icons/hicolor || true

dist: $(PKGNAME).spec
	mkdir -p .dist/${PKGNAME}-${VERSION}
	cp -a Makefile \
	    AUTHORS COPYING README ChangeLog \
	    ${PKGNAME}.py \
	    ${PKGNAME}.desktop.in \
	    ${PKGNAME}.png \
	    ${PKGNAME}.svg \
	    ${PKGNAME}.spec \
	    ${PKGNAME}.spec.in \
	    .dist/${PKGNAME}-${VERSION}
	mkdir -p .dist/${PKGNAME}-${VERSION}/po
	cp -a po/Makefile \
	    po/${PKGNAME}.pot \
	    po/*.po po/*.mo \
	    .dist/${PKGNAME}-${VERSION}/po
	cd .dist && tar cjf ../${PKGNAME}-${VERSION}.tar.bz2 ${PKGNAME}-${VERSION}
	rm -rf .dist

clean:
	@rm -fv *~
	@rm -fv *.pyc
	@rm -fv simple-image-reducer
	@rm -fv simple-image-reducer.desktop simple-image-reducer.desktop.in.h