~ubuntu-branches/ubuntu/lucid/system-config-printer/lucid-proposed

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
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
AM_CFLAGS=-g -O2 -Wall

SUBDIRS=po

EXPORT_MODULES=					\
	cupshelpers/__init__.py			\
	cupshelpers/cupshelpers.py		\
	cupshelpers/ppds.py			\
	cupshelpers/openprinting.py

### Automake hooks for Distutils.
# The distutils module doesn't understand srcdir != builddir,
# so we copy in, along with the cupshelpers modules, into
# the builddir for 'all', 'install-exec', and 'clean' hooks.
.stamp-distutils-in-builddir:	setup.py $(EXPORT_MODULES)
	if [ "$(top_srcdir)" != "$(top_builddir)" ]; then	\
		cp $(top_srcdir)/setup.py .;			\
		mkdir cupshelpers;				\
		for file in $(EXPORT_MODULES); do		\
			cp $(top_srcdir)/$$file $$file;		\
		done;						\
	fi
	touch .stamp-distutils-in-builddir

dist-hook: mk-ChangeLog
.PHONE: mk-ChangeLog
mk-ChangeLog:
	if test -d .git; then				\
	  $(top_srcdir)/gitlog-to-changelog		\
	    --since=2009-05-01 -- --no-merges		\
	    > $(distdir)/cl ;				\
	  mv -f $(distdir)/cl $(distdir)/ChangeLog ;	\
	fi

config.py: config.py.in Makefile
	sed \
	  -e "s|\@prefix\@|$(prefix)|" \
	  -e "s|\@datadir\@|$(datadir)|" \
	  -e "s|\@localedir\@|$(localedir)|" \
	  -e "s|\@VERSION\@|$(VERSION)|" \
	  -e "s|\@PACKAGE\@|$(PACKAGE)|" \
	  $< > $@

# Use distutils to build the module.
all-local: .stamp-distutils-in-builddir config.py
	$(PYTHON) setup.py build

# Use distutils to install the module.
install-exec-local: .stamp-distutils-in-builddir
	$(PYTHON) setup.py install --prefix=$(DESTDIR)$(prefix)

# Uninstall the module, crossing our fingers that we know enough
# about how distutils works to do this.  Unfortunately, distutils
# doesn't provide a way to do this itself.
uninstall-local:
	rm -f $(DESTDIR)/$(pythondir)/cupshelpers*.egg-info
	for file in $(EXPORT_MODULES); do				\
		rm -f $(DESTDIR)/$(pythondir)/$$file*;			\
	done

# Tell distutils to clean up.
clean-local:
	-$(PYTHON) setup.py clean --all
	if [ "$(top_srcdir)" != "$(top_builddir)" ]; then	\
		rm -f setup.py;					\
		for file in $(EXPORT_MODULES); do		\
			rm -f $$file*;				\
		done;						\
	fi
	rm -f .stamp-distutils-in-builddir

nobase_pkgdata_SCRIPTS=				\
	pysmb.py				\
	system-config-printer.py		\
	troubleshoot/__init__.py		\
	applet.py

nobase_pkgdata_DATA=					\
	AdvancedServerSettings.py			\
	asyncconn.py					\
	asyncipp.py					\
	asyncpk1.py					\
	authconn.py					\
	config.py					\
	cupspk.py					\
	debug.py					\
	errordialogs.py					\
	HIG.py						\
	firewall.py					\
	gui.py						\
	GroupsPane.py					\
	GroupsPaneModel.py				\
	gtkinklevel.py					\
	gtkspinner.py					\
	installdriver.py				\
	installpackage.py				\
	jobviewer.py					\
	monitor.py					\
	options.py					\
	optionwidgets.py				\
	PhysicalDevice.py				\
	ppdippstr.py					\
	ppdsloader.py					\
	probe_printer.py				\
	gtk_label_autowrap.py				\
	SearchCriterion.py				\
	smburi.py					\
	statereason.py					\
	timedops.py					\
	ToolbarSearchEntry.py				\
	userdefault.py					\
	XmlHelper.py					\
	ui/AboutDialog.glade				\
	ui/ConnectDialog.glade				\
	ui/ConnectingDialog.glade			\
	ui/InstallDialog.glade				\
	ui/JobsWindow.glade				\
	ui/NewPrinterName.glade				\
	ui/NewPrinterWindow.glade			\
	ui/PrinterPropertiesDialog.glade		\
	ui/PrintersWindow.glade				\
	ui/ServerSettingsDialog.glade			\
	ui/SMBBrowseDialog.glade			\
	ui/statusicon_popupmenu.glade			\
	ui/WaitWindow.glade				\
	icons/i-network-printer.png			\
	troubleshoot/base.py				\
	troubleshoot/CheckLocalServerPublishing.py	\
	troubleshoot/CheckNetworkServerSanity.py	\
	troubleshoot/CheckPPDSanity.py			\
	troubleshoot/CheckPrinterSanity.py		\
	troubleshoot/CheckSELinux.py			\
	troubleshoot/CheckUSBPermissions.py		\
	troubleshoot/ChooseNetworkPrinter.py		\
	troubleshoot/ChoosePrinter.py			\
	troubleshoot/DeviceListed.py			\
	troubleshoot/ErrorLogCheckpoint.py		\
	troubleshoot/ErrorLogFetch.py			\
	troubleshoot/ErrorLogParse.py			\
	troubleshoot/Locale.py				\
	troubleshoot/LocalOrRemote.py			\
	troubleshoot/NetworkCUPSPrinterShared.py	\
	troubleshoot/PrinterStateReasons.py		\
	troubleshoot/PrintTestPage.py			\
	troubleshoot/QueueNotEnabled.py			\
	troubleshoot/QueueRejectingJobs.py		\
	troubleshoot/RemoteAddress.py			\
	troubleshoot/SchedulerNotRunning.py		\
	troubleshoot/ServerFirewalled.py		\
	troubleshoot/Shrug.py				\
	troubleshoot/Welcome.py

bin_SCRIPTS=\
	system-config-printer			\
	system-config-printer-applet

if UDEV_RULES
udevrulesdir=/lib/udev/rules.d
udevrules_DATA=udev/70-printers.rules
udev_udev_configure_printer_SOURCES=\
	udev/udev-configure-printer.c
udev_udev_configure_printer_LDADD=-lcups -ludev -lusb
udevhelperdir=/lib/udev
udevhelper_PROGRAMS=\
	udev/udev-configure-printer
udevhelper_SCRIPTS=\
	udev/udev-add-printer
endif

man_MANS=					\
	man/system-config-printer.1		\
	man/system-config-printer-applet.1

dbus_DATA =					\
	newprinternotification.conf		\
	printerdriversinstaller.conf
dbusdir = $(sysconfdir)/dbus-1/system.d/

desktop_DATA =\
	system-config-printer.desktop \
	print-applet.desktop \
	manage-print-jobs.desktop
desktopdir = $(datadir)/applications/
autostartdir = $(sysconfdir)/xdg/autostart/

DESKTOP_VENDOR=@DESKTOPVENDOR@
DESKTOP_PREFIX=@DESKTOPPREFIX@

install-desktopDATA: $(desktop_DATA)
	mkdir -p $(DESTDIR)$(desktopdir)
	mkdir -p $(DESTDIR)$(desktopdir)
	desktop-file-install $(DESKTOP_VENDOR)	\
	  --dir $(DESTDIR)$(desktopdir)		\
	  --add-category System			\
	  --add-category Settings		\
	  --add-category HardwareSettings	\
	  --add-category Printing		\
	  --add-category GTK			\
	  system-config-printer.desktop
	desktop-file-install $(DESKTOP_VENDOR)	\
	  --dir $(DESTDIR)$(desktopdir)		\
	  --add-category System			\
	  --add-category Monitor		\
	  --add-category GTK			\
	  manage-print-jobs.desktop
	desktop-file-install $(DESKTOP_VENDOR)	\
	  --dir $(DESTDIR)$(autostartdir)	\
	  --add-category System			\
	  --add-category Monitor		\
	  --add-category GTK			\
	  print-applet.desktop

uninstall-desktopDATA:
	rm -f $(DESTDIR)$(desktopdir)/$(DESKTOP_PREFIX)system-config-printer.desktop
	rm -f $(DESTDIR)$(desktopdir)/$(DESKTOP_PREFIX)manage-print-jobs.desktop
	rm -f $(DESTDIR)$(autostartdir)/$(DESKTOP_PREFIX)print-applet.desktop

desktop_in_files = $(desktop_DATA:.desktop=.desktop.in)

EXTRA_DIST=\
	$(nobase_pkgdata_SCRIPTS) \
	$(nobase_pkgdata_DATA) \
	$(nobase_sbin_SCRIPTS) \
	$(bin_SCRIPTS) \
	setup.py \
	$(EXPORT_MODULES) \
	man/system-config-printer.xml \
	$(dbus_DATA) \
	bootstrap \
	mkinstalldirs \
	ChangeLog-OLD \
	$(desktop_in_files) \
	intltool-extract.in \
	intltool-merge.in \
	intltool-update.in \
	config.py.in \
	profile-ppds.py \
	udev/udev-add-printer \
	udev/70-printers.rules

@INTLTOOL_DESKTOP_RULE@

# The man pages are generated from DocBook XML.
$(man_MANS): $(top_srcdir)/man/system-config-printer.xml
	xmlto man -o man $<

html:	$(EXPORT_MODULES)
	rm -rf html
	epydoc -o html --html $(EXPORT_MODULES)

distcheck-hook: update-po

update-po: missing-languages
	$(MAKE) -C po update-po

missing-languages:
	bash -c '\
	eval $$(grep ALL_LINGUAS configure.in); \
	diff -u <(echo $$ALL_LINGUAS | xargs -rn1 echo) \
		<(cd po; ls -1 *.po | sed -e "s,\.po$$,,")'

run:	config.py
	SYSTEM_CONFIG_PRINTER_UI=$(top_srcdir)/ui \
	$(PYTHON) $(top_srcdir)/system-config-printer.py --debug

run-applet:	config.py
	SYSTEM_CONFIG_PRINTER_UI=$(top_srcdir)/ui \
	$(PYTHON) $(top_srcdir)/applet.py --debug

help:
	@echo "Usage: make <target>"
	@echo "Available targets:"
	@echo " help               Show this help message"
	@echo " update-po          Update the translations"
	@echo " missing-languages  Show which po files are not shipped"
	@echo " run                Run system-config-printer with local UI files"
	@echo " run-applet         Run system-config-printer-applet with local UI files"

test-ppd-module.sh:
	echo "#!$(PYTHON)" > "$@"
	echo "import sys; sys.path.append ('$(top_srcdir)')" >> "$@"
	echo "from cupshelpers.ppds import _self_test" >> "$@"
	echo "_self_test(sys.argv)" >> "$@"
	chmod 755 "$@"

TESTS = test-ppd-module.sh

DISTCLEANFILES=*.pyc *.pyo *~ *.bak \
	troubleshoot/*.pyc troubleshoot/*.pyo troubleshoot/*~ \
	intltool-extract intltool-merge intltool-update \
	*.desktop man/*.1 \
	test-ppd-module.sh pickled-ppds \
	config.py

distclean-local:
	rm -rf html

.PHONY: update-po missing-languages run help