[John Goerzen, 2009-07-02]
> > PS since this is a Python application consider moving module to private
> > directory (with --install-lib and some magic as --install-scripts will
> > not be enough since binary name is the same as module name) - let me know
> > if you need help with this or take a look at some PAPT packages
> 
> I have been a bit out of the loop with Python developments for a spell
> now; I'd be grateful for a patch if you'd have time to work one up.

-       $(PYTHON) setup.py install --root=`pwd`/debian/$(PACKAGE) --no-compile
+       $(PYTHON) setup.py install --root=$(CURDIR)/debian/$(PACKAGE) 
--no-compile --install-lib=/usr/share/offlineimap --install-scripts=/usr/bin
+       mv $(CURDIR)/debian/$(PACKAGE)/usr/bin/offlineimap 
$(CURDIR)/debian/$(PACKAGE)/usr/share/offlineimap/run.py
+       dh_link /usr/share/offlineimap/run.py /usr/bin/offlineimap


binary name is the same as module name so
--install-scripts=/usr/share/offlineimap cannot be used (it will confuse
Python at runtime)

... or more intrusive changes from attached patch


PS please note that I didn't look very careful at the offlineimap module so
if you think it can be useful outside the application (i.e. if someone
will want to 'from offlineimap import foo') - don't apply my patch
-- 
-=[     Piotr Ożarowski     ]=-
-=[ http://www.ozarowski.pl ]=-
--- debian/rules.orig	2009-07-02 23:18:18.611768238 +0200
+++ debian/rules	2009-07-02 23:15:13.871768068 +0200
@@ -10,25 +10,9 @@
 PACKAGE=offlineimap
 
 
-ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
-	CFLAGS += -g
-endif
-ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
-	INSTALL_PROGRAM += -s
-endif
-
-configure: configure-stamp
-configure-stamp:
-	dh_testdir
-	# Add here commands to configure the package.
-	#$(PYTHON) setup.py configure
-
-	touch configure-stamp
-
-
 build: build-stamp
 
-build-stamp: configure-stamp 
+build-stamp:
 	dh_testdir
 
 	# Add here commands to compile the package.
@@ -41,12 +25,11 @@
 clean:
 	dh_testdir
 	dh_testroot
-	rm -f build-stamp configure-stamp
 
 	# Add here commands to clean up after the build process.
 	[ ! -f Makefile ] || $(MAKE) clean
 
-	dh_clean
+	dh_clean build-stamp
 
 install: build
 	dh_testdir
@@ -56,43 +39,32 @@
 
 	# Add here commands to install the package into debian/pygopherd.
 	#$(MAKE) install DESTDIR=$(CURDIR)/debian/pygopherd
-	$(PYTHON) setup.py install --root=`pwd`/debian/$(PACKAGE) --no-compile
+	$(PYTHON) setup.py install --root=$(CURDIR)/debian/$(PACKAGE) --no-compile --install-lib=/usr/share/offlineimap --install-scripts=/usr/bin
+	mv $(CURDIR)/debian/$(PACKAGE)/usr/bin/offlineimap $(CURDIR)/debian/$(PACKAGE)/usr/share/offlineimap/run.py
+	dh_link /usr/share/offlineimap/run.py /usr/bin/offlineimap
 
 
 # Build architecture-dependent files here.
-binary-arch: build install
+binary-arch:
 # We have nothing to do by default.
 
 # Build architecture-independent files here.
 binary-indep: build install
 	dh_testdir
 	dh_testroot
-#	dh_installdebconf	
 	dh_installdocs
 	dh_installexamples offlineimap.conf offlineimap.conf.minimal
 	dh_installmenu
-#	dh_installlogrotate
-#	dh_installemacsen
-#	dh_installpam
-#	dh_installmime
-	dh_installinit
-	dh_installcron
 	dh_installman offlineimap.1
 	dh_installinfo
-#	dh_undocumented
 	dh_installchangelogs 
-	dh_link
-	dh_strip
 	dh_compress
 	dh_fixperms
-#	dh_perl
 	dh_pysupport
-#	dh_makeshlibs
 	dh_installdeb
-	dh_shlibdeps
 	dh_gencontrol
 	dh_md5sums
 	dh_builddeb
 
 binary: binary-indep binary-arch
-.PHONY: build clean binary-indep binary-arch binary install configure
+.PHONY: build clean binary-indep binary-arch binary install

Attachment: signature.asc
Description: Digital signature

Reply via email to