aboutsummaryrefslogtreecommitdiff
path: root/Makefile.in.in
blob: cdb05c6e77102472d2c34dbe1d5623870475ad2f (plain) (blame)
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
APPNAME=@appname@
VERSION=@version@
PREFIX=@prefix@
MANDIR=@mandir@
DOCDIR=@docdir@
PYTHON=`which @python@`
LANGUAGE_FILES=$(patsubst po/%.po, locale/%/LC_MESSAGES/$(APPNAME).mo, $(wildcard po/*.po))
DESTDIR=

GIT_BRANCH := $(shell git branch --show-current)

all: $(LANGUAGE_FILES) layouts
	intltool-merge -d po org.xfce.PanelProfiles.desktop.in org.xfce.PanelProfiles.desktop
	intltool-merge -x po data/metainfo/org.xfce.PanelProfiles.appdata.xml.in \
		data/metainfo/org.xfce.PanelProfiles.appdata.xml
	chmod +x org.xfce.PanelProfiles.desktop
	sed -e s,%prefix%,$(PREFIX), bin/$(APPNAME).in.in > bin/$(APPNAME).in
	sed -e s,%python%,$(PYTHON), bin/$(APPNAME).in > bin/$(APPNAME)

	sed -e s,%appname%,$(APPNAME), xfce4-panel-profiles/info.py.in.in > xfce4-panel-profiles/info.py.in
	sed -e s,%version%,$(VERSION), xfce4-panel-profiles/info.py.in > xfce4-panel-profiles/info.py

	chmod +x bin/$(APPNAME)

locale/%/LC_MESSAGES/$(APPNAME).mo: po/%.po
	mkdir -p $(dir $@)
	msgfmt $< -o $@

pot:
	cd po; intltool-update --pot --gettext-package=xfce4-panel-profiles

ifeq ($(shell tar --help|grep -o sort=),sort=)
  TAROPTS := --sort=name --format ustar
  TAROPTS += --owner=0 --group=0 --numeric-owner
  TAROPTS += --mode=u=wrX,og=
endif
layouts:
	cd data/layouts/cupertino; tar $(TAROPTS) -cvjf "../Cupertino.tar.bz2" *
	cd data/layouts/gnome2; tar $(TAROPTS) -cvjf "../GNOME 2.tar.bz2" *
	cd data/layouts/redmond; tar $(TAROPTS) -cvjf "../Redmond.tar.bz2" *
	cd data/layouts/redmond7; tar $(TAROPTS) -cvjf "../Redmond 7.tar.bz2" *
	cd data/layouts/xfce-4.12; tar $(TAROPTS) -cvjf "../Xfce 4.12.tar.bz2" *
	cd data/layouts/xfce-4.14; tar $(TAROPTS) -cvjf "../Xfce 4.14.tar.bz2" *
	cd data/layouts/xfce-4.16; tar $(TAROPTS) -cvjf "../Xfce 4.16.tar.bz2" *
	cd data/layouts/xubuntu-12.04; tar $(TAROPTS) -cvjf "../Xubuntu 12.04 (Precise).tar.bz2" *
	cd data/layouts/xubuntu-14.04; tar $(TAROPTS) -cvjf "../Xubuntu 14.04 (Trusty).tar.bz2" *
	cd data/layouts/xubuntu-18.04; tar $(TAROPTS) -cvjf "../Xubuntu 18.04 (Bionic).tar.bz2" *
	cd data/layouts/openSUSE-Leap-15.x; tar $(TAROPTS) -cvjf "../openSUSE Leap 15.x.tar.bz2" *

install: all xfce4-panel-profiles.1
	install -d $(DESTDIR)/$(PREFIX)/bin
	install bin/$(APPNAME) $(DESTDIR)/$(PREFIX)/bin

	install -d $(DESTDIR)/$(PREFIX)/share/$(APPNAME)/xfce4-panel-profiles
	install xfce4-panel-profiles/info.py $(DESTDIR)/$(PREFIX)/share/$(APPNAME)/xfce4-panel-profiles
	install xfce4-panel-profiles/panelconfig.py $(DESTDIR)/$(PREFIX)/share/$(APPNAME)/xfce4-panel-profiles
	install xfce4-panel-profiles/xfce4-panel-profiles.py $(DESTDIR)/$(PREFIX)/share/$(APPNAME)/xfce4-panel-profiles
	install xfce4-panel-profiles/xfce4-panel-profiles.glade $(DESTDIR)/$(PREFIX)/share/$(APPNAME)/xfce4-panel-profiles

	install -d $(DESTDIR)/$(DOCDIR)
	install AUTHORS $(DESTDIR)/$(DOCDIR)
	install COPYING $(DESTDIR)/$(DOCDIR)
	install NEWS $(DESTDIR)/$(DOCDIR)
	install INSTALL $(DESTDIR)/$(DOCDIR)
	install README.md $(DESTDIR)/$(DOCDIR)

	install -d $(DESTDIR)/$(PREFIX)/share/applications
	install -m 644 org.xfce.PanelProfiles.desktop $(DESTDIR)/$(PREFIX)/share/applications

	install -d $(DESTDIR)/$(PREFIX)/share/xfce4-panel-profiles
	install -d $(DESTDIR)/$(PREFIX)/share/xfce4-panel-profiles/layouts
	install data/layouts/*.tar.bz2 $(DESTDIR)/$(PREFIX)/share/xfce4-panel-profiles/layouts

	install -d $(DESTDIR)/$(PREFIX)/share/metainfo
	install data/metainfo/*.xml $(DESTDIR)/$(PREFIX)/share/metainfo

	cp -rf locale $(DESTDIR)/$(PREFIX)/share

	install -d $(DESTDIR)/$(MANDIR)/man1
	install xfce4-panel-profiles.1 $(DESTDIR)/$(MANDIR)/man1

	install -d $(DESTDIR)/$(PREFIX)/share/icons/hicolor/128x128/apps
	install -d $(DESTDIR)/$(PREFIX)/share/icons/hicolor/48x48/apps
	install -d $(DESTDIR)/$(PREFIX)/share/icons/hicolor/16x16/apps
	install -d $(DESTDIR)/$(PREFIX)/share/icons/hicolor/scalable/apps
	install data/icons/128x128/org.xfce.PanelProfiles.png $(DESTDIR)/$(PREFIX)/share/icons/hicolor/128x128/apps
	install data/icons/48x48/org.xfce.PanelProfiles.png $(DESTDIR)/$(PREFIX)/share/icons/hicolor/48x48/apps
	install data/icons/16x16/org.xfce.PanelProfiles.png $(DESTDIR)/$(PREFIX)/share/icons/hicolor/16x16/apps
	install data/icons/scalable/org.xfce.PanelProfiles.svg $(DESTDIR)/$(PREFIX)/share/icons/hicolor/scalable/apps

uninstall:
	rm -f $(DESTDIR)/$(PREFIX)/share/applications/org.xfce.PanelProfiles.desktop
	rm -rf $(DESTDIR)/$(PREFIX)/share/$(APPNAME)
	rm -rf $(DESTDIR)/$(DOCDIR)
	# FIXME: Uninstall locales
	rm -f $(DESTDIR)/$(PREFIX)/bin/$(APPNAME)
	rm -rf $(DESTDIR)/$(PREFIX)/share/icons/hicolor/128x128/apps
	rm -rf $(DESTDIR)/$(PREFIX)/share/icons/hicolor/48x48/apps
	rm -rf $(DESTDIR)/$(PREFIX)/share/icons/hicolor/16x16/apps
	rm -rf $(DESTDIR)/$(PREFIX)/share/icons/hicolor/scalable/apps/org.xfce.PanelProfiles.svg

distcheck: all
	mkdir -p $(APPNAME)-$(VERSION)
	for filename in `git ls-tree -r $(GIT_BRANCH) --name-only | grep -v git`; do \
		mkdir -p $(APPNAME)-$(VERSION)/`dirname $$filename`; \
		cp $$filename $(APPNAME)-$(VERSION)/$$filename; \
	done;
	git log > $(APPNAME)-$(VERSION)/ChangeLog
	tar -cvjSf $(APPNAME)-$(VERSION).tar.bz2 $(APPNAME)-$(VERSION)
	rm -rf $(APPNAME)-$(VERSION)

clean:
	rm -Rf locale
	rm -f xfce4-panel-profiles/*.pyc
	rm -f bin/$(APPNAME).in
	rm -f bin/$(APPNAME)
	rm -f data/metainfo/org.xfce.PanelProfiles.appdata.xml
	rm -f data/layouts/*.tar.bz2
	rm -f data/icons/128x128/org.xfce.panelprofiles.png
	rm -f data/icons/48x48/org.xfce.panelprofiles.png
	rm -f data/icons/16x16/org.xfce.panelprofiles.png
	rm -f data/icons/scalable/org.xfce.panelprofiles.svg
	rm -f org.xfce.PanelProfiles.desktop
	rm -f Makefile.in
	rm -f Makefile
	rm -f xfce4-panel-profiles/info.py
	rm -f xfce4-panel-profiles/info.py.in