diff --git a/makefile b/makefile index c55dfa10..0c2ea6ae 100644 --- a/makefile +++ b/makefile @@ -189,15 +189,11 @@ ifneq ("$(SIGN)","1") DPKG_OPT=-us -uc endif deb-package: deb-package-python2 deb-package-python3 - mkdir -p $(DSTDIR) - mv $(BLDDIR)/$(DEBPKG) $(DSTDIR) - mv $(BLDDIR)/python3-$(DEBPKG) $(DSTDIR) deb-package-prep: $(DSTDIR)/$(SRCPKG) mkdir -p $(BLDDIR) - cp $(DSTDIR)/$(SRCPKG) $(BLDDIR) - (cd $(BLDDIR); tar xfz $(SRCPKG)) - (cd $(BLDDIR); mv $(SRCPKG) weewx_$(VERSION).orig.tar.gz) + tar xfz $(DSTDIR)/$(SRCPKG) -C $(BLDDIR) + cp -p $(DSTDIR)/$(SRCPKG) $(BLDDIR)/weewx_$(VERSION).orig.tar.gz rm -rf $(DEBBLDDIR)/debian mkdir -m 0755 $(DEBBLDDIR)/debian mkdir -m 0755 $(DEBBLDDIR)/debian/source @@ -216,11 +212,19 @@ deb-package-prep: $(DSTDIR)/$(SRCPKG) deb-package-python2: deb-package-prep cp pkg/debian/control $(DEBBLDDIR)/debian + rm -rf $(DEBBLDDIR)/debian/weewx* + rm -f $(DEBBLDDIR)/debian/files (cd $(DEBBLDDIR); dpkg-buildpackage $(DPKG_OPT)) + mkdir -p $(DSTDIR) + mv $(BLDDIR)/$(DEBPKG) $(DSTDIR) deb-package-python3: deb-package-prep cp pkg/debian/control.python3 $(DEBBLDDIR)/debian/control + rm -rf $(DEBBLDDIR)/debian/weewx* + rm -f $(DEBBLDDIR)/debian/files (cd $(DEBBLDDIR); DEB_BUILD_OPTIONS=python3 dpkg-buildpackage $(DPKG_OPT)) + mkdir -p $(DSTDIR) + mv $(BLDDIR)/python3-$(DEBPKG) $(DSTDIR) # run lintian on the deb package check-deb: @@ -326,3 +330,4 @@ code-summary: @for d in weecfg weedb weeutil weewx; do \ cloc bin/$$d/tests; \ done + diff --git a/pkg/debian/control.python3 b/pkg/debian/control.python3 index a0cf7af4..165721a7 100644 --- a/pkg/debian/control.python3 +++ b/pkg/debian/control.python3 @@ -6,7 +6,9 @@ Standards-Version: 3.9.2 Homepage: http://www.weewx.com Build-Depends: debhelper (>=8) -Package: weewx +Package: python3-weewx +Replaces: weewx +Breaks: weewx Priority: optional Architecture: all Pre-Depends: debconf diff --git a/pkg/debian/rules b/pkg/debian/rules index a06c0a81..f209f609 100755 --- a/pkg/debian/rules +++ b/pkg/debian/rules @@ -9,21 +9,21 @@ # determine which python we should use ifneq (,$(filter python3,$(DEB_BUILD_OPTIONS))) PYTHON=python3 -DST_WEEWX=weewx +PKG=python3-weewx else PYTHON=python2 -DST_WEEWX=weewx +PKG=weewx endif SRC=$(CURDIR) -DST=$(CURDIR)/debian/$(DST_WEEWX) +DST=$(CURDIR)/debian/$(PKG) DST_EXECDIR=$(DST)/usr/bin DST_BINDIR =$(DST)/usr/share/weewx DST_DOCDIR =$(DST)/usr/share/doc/weewx DST_INITDIR=$(DST)/etc/init.d DST_CFGDIR =$(DST)/etc/weewx -# these are the entry points for weewx +# these are the entry points ENTRIES=weewxd wee_config wee_database wee_debug wee_device wee_extension wee_import wee_reports wunderfixer %: @@ -34,6 +34,9 @@ override_dh_auto_clean: rm -rf build dist rm -f *.egg-info +# this install rule duplicates what the weewx setup.py would do. we should +# be able to remove this when the weewx setup.py respects --no-prompt and +# when --prefix works properly. install: dh_testdir dh_testroot