# Name of the package
PACKAGE=nautilus-mount-image

# Directories
EXTENSIONS_DIR=/usr/lib/nautilus/extensions-2.0/python/
PIXMAPS_DIR=/usr/share/pixmaps/
LOCALE_DIR = /usr/share/locale


all:

install: make-install-dirs
	install -m 755 $(PACKAGE).py $(DESTDIR)$(EXTENSIONS_DIR)
	install -m 644 $(PACKAGE).png $(DESTDIR)$(PIXMAPS_DIR)
	for f in `find po -name $(PACKAGE).mo` ; do \
		install -D -m 644 $$f \
			`echo $$f | sed "s|^po|$(DESTDIR)$(LOCALE_DIR)|"` ; \
		done

make-install-dirs:
	mkdir -p $(DESTDIR)$(EXTENSIONS_DIR)
	mkdir -p $(DESTDIR)$(PIXMAPS_DIR)
	mkdir -p $(DESTDIR)$(LOCALE_DIR)

uninstall:
	rm $(DESTDIR)$(EXTENSIONS_DIR)$(PACKAGE).py
	rm $(DESTDIR)$(PIXMAPS_DIR)$(PACKAGE).png
	find $(DESTDIR)$(LOCALE_DIR) -name $(PACKAGE).mo -exec rm -f {} \;

clean:
	rm -f *-stamp
	rm -rf debian/$(PACKAGE)
	rm -f debian/files
	find . -type f -iregex '.*~$$'  -print | xargs rm -rf
	find . -type f -iregex '.*\.pyc$$'  -print | xargs rm -rf
	find . -type f -iregex '.*\.bak$$'  -print | xargs rm -rf

update-po:
	for f in `find po -name $(PACKAGE).po` ; do \
		msgmerge -o $$f $$f ./po/$(PACKAGE).pot ; \
		done

