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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
|
diff --unified --recursive --text feedindicator-2.0.0.20171011.orig/Makefile feedindicator-2.0.0.20171011.new/Makefile
--- feedindicator-2.0.0.20171011.orig/Makefile 2017-10-11 04:03:34.000000000 +1300
+++ feedindicator-2.0.0.20171011.new/Makefile 2021-02-17 19:31:00.061377672 +1300
@@ -1,30 +1,21 @@
-BASH_COMPLETION_DIR=/usr/share/bash-completion/completions/
-BIN_DIR=/usr/bin/
-DOC_DIR=/usr/share/doc/feedindicator/
-MAN_DIR=/usr/share/man/man1/
-SHARE_DIR=/usr/share/feedindicator/
+PREFIX ?= /usr
+BIN_DIR = $(PREFIX)/bin
+SHARE_DIR = $(PREFIX)/share/feedindicator
+DESKTOP_DIR = $(PREFIX)/share/applications
+BASH_COMPLETION_DIR = $(PREFIX)/share/bash-completion/completions
all: bin/feedindicator bin/feedindicator.desktop
bin:
- @mkdir bin
-
-
-build:
- @mkdir build
-
-
-build/package/DEBIAN: build
- @mkdir -p build/package/DEBIAN
+ @install -d bin
bin/feedindicator: bin
- @echo "#!/usr/bin/env bash\n" > bin/feedindicator
+ @echo "#!/usr/bin/env bash" > bin/feedindicator
@echo "cd $(SHARE_DIR)" >> bin/feedindicator
- @echo "python3 -m feedindicator \$$@" >> bin/feedindicator
- @chmod a+x bin/feedindicator
+ @echo "python -m feedindicator \$$@" >> bin/feedindicator
bin/feedindicator.desktop: bin
@@ -35,140 +26,45 @@
@echo "Exec=feedindicator" >> bin/feedindicator.desktop
@echo "Icon=feedindicator" >> bin/feedindicator.desktop
@echo "Name=Feedindicator" >> bin/feedindicator.desktop
- @echo "Comment=A RSS feed reader for the indicator area." >> bin/feedindicator.desktop
+ @echo "Comment=RSS feed applet" >> bin/feedindicator.desktop
@echo "Categories=Internet;Network;" >> bin/feedindicator.desktop
- @chmod a+x bin/feedindicator.desktop
-build/package/DEBIAN/md5sums: bin/feedindicator bin/feedindicator.desktop build/copyright build/changelog build/feedindicator.1 build/package/DEBIAN
- @mkdir -m 755 -p build/package$(BASH_COMPLETION_DIR)
- @mkdir -m 755 -p build/package$(BIN_DIR)
- @mkdir -m 755 -p build/package$(DOC_DIR)
- @mkdir -m 755 -p build/package$(MAN_DIR)
- @mkdir -m 755 -p build/package$(SHARE_DIR)
- @find build/package -type d -exec chmod 755 {} \;
-
- @cp -r bin/feedindicator build/package$(BIN_DIR)
- @chmod 755 build/package$(BIN_DIR)feedindicator
- @cp bin/feedindicator.desktop build/package$(SHARE_DIR)
- @chmod 755 build/package$(SHARE_DIR)feedindicator.desktop
- @cp -r feedindicator build/package$(SHARE_DIR)
- @cp -r icons build/package$(SHARE_DIR)
- @find build/package$(SHARE_DIR) -type f -exec chmod 644 {} \;
- @find build/package$(SHARE_DIR) -type d -exec chmod 755 {} \;
- @cp feedindicator.bash-completion build/package$(BASH_COMPLETION_DIR)
- @chmod 644 build/package$(BASH_COMPLETION_DIR)feedindicator.bash-completion
-
- @cat build/feedindicator.1 | gzip -n9 > build/package$(MAN_DIR)feedindicator.1.gz
- @chmod 644 build/package$(MAN_DIR)feedindicator.1.gz
-
- @cat build/changelog | gzip -n9 > build/package$(DOC_DIR)changelog.gz
- @chmod 644 build/package$(DOC_DIR)changelog.gz
-
- @cp build/copyright build/package$(DOC_DIR)copyright
- @chmod 644 build/package$(DOC_DIR)copyright
-
- @mkdir -p build/package/DEBIAN
- @md5sum `find build/package -type f -not -path "*DEBIAN*"` > build/md5sums
- @sed -e "s/build\/package\///" build/md5sums > build/package/DEBIAN/md5sums
- @chmod 644 build/package/DEBIAN/md5sums
-
-
-build/package/DEBIAN/control: build/package/DEBIAN/md5sums
- @echo "Package: feedindicator" > build/package/DEBIAN/control
- @echo "Version: `grep "__version_info__ =" feedindicator/__init__.py | grep -oE "[0-9]+, [0-9]+, [0-9]+" | sed -e "s/, /./g"`" >> build/package/DEBIAN/control
- @echo "Section: web" >> build/package/DEBIAN/control
- @echo "Priority: optional" >> build/package/DEBIAN/control
- @echo "Architecture: all" >> build/package/DEBIAN/control
- @echo "Depends: python3 (>= 3), python3-feedparser, python3-gi, python3-configobj, hicolor-icon-theme, indicator-application, xdg-utils" >> build/package/DEBIAN/control
- @echo "Installed-Size: `du -csk build/package/usr | grep -oE "[0-9]+\stotal" | cut -f 1`" >> build/package/DEBIAN/control
- @echo "Maintainer: Nathanael Philipp <mail@jnphilipp.org>" >> build/package/DEBIAN/control
- @echo "Homepage: https://github.com/jnphilipp/Feedindicator" >> build/package/DEBIAN/control
- @echo "Description: RSS feed updates in the indicator area\n Editable, sortable list of feed URLs.\n Notification popups of new feed items.\n Adjustable update timer." >> build/package/DEBIAN/control
-
-
-build/package/DEBIAN/postinst: build/package/DEBIAN
- @echo "#!/bin/sh -e" > build/package/DEBIAN/postinst
- @echo "xdg-icon-resource install --theme hicolor --novendor --size 512 $(SHARE_DIR)icons/active.png feedindicator-active" >> build/package/DEBIAN/postinst
- @echo "xdg-icon-resource install --theme hicolor --novendor --size 512 $(SHARE_DIR)icons/attention.png feedindicator-attention" >> build/package/DEBIAN/postinst
- @echo "xdg-icon-resource install --theme hicolor --novendor --size 128 --context apps $(SHARE_DIR)icons/logo-128x128.png feedindicator" >> build/package/DEBIAN/postinst
- @echo "xdg-icon-resource install --theme hicolor --novendor --size 48 --context apps $(SHARE_DIR)icons/logo-48x48.png feedindicator" >> build/package/DEBIAN/postinst
- @echo "xdg-desktop-menu install --novendor $(SHARE_DIR)feedindicator.desktop" >> build/package/DEBIAN/postinst
- @chmod 755 build/package/DEBIAN/postinst
-
-
-build/package/DEBIAN/prerm: build/package/DEBIAN
- @echo "#!/bin/sh -e" > build/package/DEBIAN/prerm
- @echo "xdg-icon-resource uninstall --theme hicolor --novendor --size 512 feedindicator-active" >> build/package/DEBIAN/prerm
- @echo "xdg-icon-resource uninstall --theme hicolor --novendor --size 512 feedindicator-attention" >> build/package/DEBIAN/prerm
- @echo "xdg-icon-resource uninstall --theme hicolor --novendor --size 128 --context apps feedindicator" >> build/package/DEBIAN/prerm
- @echo "xdg-icon-resource uninstall --theme hicolor --novendor --size 48 --context apps feedindicator" >> build/package/DEBIAN/prerm
- @echo "xdg-desktop-menu uninstall --novendor feedindicator.desktop" >> build/package/DEBIAN/prerm
- @chmod 755 build/package/DEBIAN/prerm
-
-
-build/copyright: build
- @echo "Upstream-Name: feedindicator\nSource: https://github.com/jnphilipp/Feedindicator\n\nFiles: *\nCopyright: Copyright 2010-2017 Dave Gardner <eunbolt@gmail.com>, Michael Judge <email@clickopen.co.uk>, Nicolas Raoul <nicolas.raoul@gmail.com>, Nathanael Philipp (jnphilipp) <mail@jnphilipp.org>\nLicense: GPL-3+\n This program is free software; you can redistribute it\n and/or modify it under the terms of the GNU General Public\n License as published by the Free Software Foundation; either\n version 3 of the License, or (at your option) any later\n version.\n .\n This program is distributed in the hope that it will be\n useful, but WITHOUT ANY WARRANTY; without even the implied\n warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR\n PURPOSE. See the GNU General Public License for more\n details.\n .\n You should have received a copy of the GNU General Public\n License along with this package; if not, write to the Free\n Software Foundation, Inc., 51 Franklin St, Fifth Floor,\n Boston, MA 02110-1301 USA\n .\n On Debian systems, the full text of the GNU General Public\n License version 3 can be found in the file\n '/usr/share/common-licenses/GPL-3'." > build/copyright
-
-
-build/changelog: build
- @git log --oneline --decorate > build/changelog
-
-
-build/feedindicator.1: build
- @help2man -n "feedindicator - A RSS feed reader for the indicator area." feedindicator > build/feedindicator.1
-
-
-install: bin/feedindicator bin/feedindicator.desktop build/copyright build/changelog build/feedindicator.1
- @apt install python3 python3-gi python3-feedparser python3-configobj hicolor-icon-theme indicator-application xdg-utils
- @xdg-icon-resource install --theme hicolor --novendor --size 512 icons/active.png feedindicator-active
- @xdg-icon-resource install --theme hicolor --novendor --size 512 icons/attention.png feedindicator-attention
- @xdg-icon-resource install --theme hicolor --novendor --size 128 --context apps icons/logo-128x128.png feedindicator
- @xdg-icon-resource install --theme hicolor --novendor --size 48 --context apps icons/logo-48x48.png feedindicator
- @xdg-desktop-menu install --novendor bin/feedindicator.desktop
- @mkdir -p $(SHARE_DIR)
- @cp -r feedindicator $(SHARE_DIR)
- @install bin/feedindicator $(BIN_DIR)
- @install feedindicator.bash-completion $(BASH_COMPLETION_DIR)
- @cat build/feedindicator.1 | gzip -n9 > $(MAN_DIR)feedindicator.1.gz
- @mkdir -p $(DOC_DIR)
- @cat build/changelog | gzip -n9 > $(DOC_DIR)changelog.gz
- @install build/copyright $(DOC_DIR)copyright
- @echo "feedindicator install completed."
-
-
-uninstall:
- @rm -r $(SHARE_DIR)
- @rm -r $(DOC_DIR)
- @rm $(BIN_DIR)/feedindicator
- @rm $(BASH_COMPLETION_DIR)feedindicator.bash-completion
- @rm $(MAN_DIR)feedindicator.1.gz
- @xdg-icon-resource uninstall --theme hicolor --novendor --size 512 feedindicator-active
- @xdg-icon-resource uninstall --theme hicolor --novendor --size 512 feedindicator-attention
- @xdg-icon-resource uninstall --theme hicolor --novendor --size 128 --context apps feedindicator
- @xdg-icon-resource uninstall --theme hicolor --novendor --size 48 --context apps feedindicator
- @xdg-desktop-menu uninstall --novendor feedindicator.desktop
- @if [ -f ~/.config/feedindicator/feedindicator.desktop ]; then\
- unlink ~/.config/feedindicator/feedindicator.desktop;\
- fi
- @if [ -d ~/.cache/feedindicator ]; then\
- rm -r ~/.cache/feedindicator;\
- fi
- @if [ -d ~/.config/feedindicator ]; then\
- rm -r ~/.config/feedindicator;\
- fi
- @if [ -d ~/.local/share/feedindicator ]; then\
- rm -r ~/.local/share/feedindicator;\
- fi
- @echo "feedindicator uninstall completed."
-
-
-deb: build/package/DEBIAN/control build/package/DEBIAN/postinst build/package/DEBIAN/prerm
- fakeroot dpkg-deb -b build/package build/feedindicator.deb
- lintian -Ivi build/feedindicator.deb
+install-python:
+ @find ./feedindicator -type f -exec install -Dm0644 "{}" "$(DESTDIR)$(SHARE_DIR)/""{}" \;
+
+
+install-wrapper: bin/feedindicator bin/feedindicator.desktop
+ @install -D bin/feedindicator "$(DESTDIR)$(BIN_DIR)/feedindicator"
+ @install -Dm0644 bin/feedindicator.desktop "$(DESTDIR)$(DESKTOP_DIR)/feedindicator.desktop"
+ @install -Dm0644 feedindicator.bash-completion "$(DESTDIR)$(BASH_COMPLETION_DIR)/feedindicator.bash-completion"
+
+
+install-icons:
+ @find ./icons -type f -exec install -Dm0644 "{}" "$(DESTDIR)$(SHARE_DIR)/""{}" \;
+install: install-python install-wrapper install-icons
+
+
+uninstall-python:
+ @rm -rf "$(DESTDIR)$(SHARE_DIR)/feedindicator"
+
+
+uninstall-wrapper:
+ @rm "$(DESTDIR)$(BIN_DIR)/feedindicator"
+ @rm "$(DESTDIR)$(DESKTOP_DIR)/feedindicator.desktop"
+ @rm "$(DESTDIR)$(BASH_COMPLETION_DIR)/feedindicator.bash-completion"
+
+
+uninstall-icons:
+ @rm -rf "$(DESTDIR)$(SHARE_DIR)/icons"
+
+
+uninstall: uninstall-python uninstall-wrapper uninstall-icons
+
clean:
@rm -rf ./bin
- @rm -rf ./build
@find . -name __pycache__ -exec rm -rf {} \;
+
+.PHONY: install-python install-wrapper install-icons install uninstall-python uninstall-wrapper uninstall-icons uninstall clean
|