old_contents: from __future__ import absolute_import
  from setuptools import setup, Command, find_packages
  
  import os
  import os.path
  import subprocess
  
  
  # See anytemplate/globals.py
  PACKAGE = "anytemplate"
  VERSION = "0.1.4"
  
  # For daily snapshot versioning mode:
  if os.environ.get("_SNAPSHOT_BUILD", None) is not None:
      import datetime
      VERSION = VERSION + datetime.datetime.now().strftime(".%Y%m%d")
  
  
  class SrpmCommand(Command):
  
      user_options = []
      build_stage = "s"
  
      curdir = os.path.abspath(os.curdir)
      rpmspec = os.path.join(curdir, "pkg/package.spec")
  
      def initialize_options(self):
          pass
  
      def finalize_options(self):
          pass
  
      def run(self):
          self.pre_sdist()
          self.run_command('sdist')
          # Dirty hack.
          self.copy_file("dist/%s-%s.tar.gz" % (PACKAGE, VERSION),
                                                "dist/RELEASE_%s.tar.gz" % VERSION)
          self.build_rpm()
  
      def pre_sdist(self):
          c = open(self.rpmspec + ".in").read()
          open(self.rpmspec, "w").write(c.replace("@VERSION@", VERSION))
  
      def build_rpm(self):
          rpmbuild = os.path.join(self.curdir, "pkg/rpmbuild-wrapper.sh")
          workdir = os.path.join(self.curdir, "dist")
  
          cmd_s = "%s -w %s -s %s %s" % (rpmbuild, workdir, self.build_stage,
                                         self.rpmspec)
          subprocess.check_call(cmd_s, shell=True)
  
  
  class RpmCommand(SrpmCommand):
  
      build_stage = "b"
  
  
  setup(name=PACKAGE,
        version=VERSION,
        #packages=find_packages(exclude=['tests']),
        #entry_points=open("pkg/entry_points.txt").read(),
        cmdclass={
            "srpm": SrpmCommand,
            "rpm":  RpmCommand,
        },)
  
  # vim:sw=4:ts=4:et:
  
new_contents: from __future__ import absolute_import
  from setuptools import setup, Command, find_packages
  
  import os
  import os.path
  import subprocess
  
  
  # See anytemplate/globals.py
  PACKAGE = "anytemplate"
  VERSION = "0.1.4"
  
  # For daily snapshot versioning mode:
  if os.environ.get("_SNAPSHOT_BUILD", None) is not None:
      import datetime
      VERSION = VERSION + datetime.datetime.now().strftime(".%Y%m%d")
  
  
  class SrpmCommand(Command):
  
      user_options = []
      build_stage = "s"
  
      curdir = os.path.abspath(os.curdir)
      rpmspec = os.path.join(curdir, "pkg/package.spec")
  
      def initialize_options(self):
          pass
  
      def finalize_options(self):
          pass
  
      def run(self):
          self.pre_sdist()
          self.run_command('sdist')
          # Dirty hack.
          self.copy_file("dist/%s-%s.tar.gz" % (PACKAGE, VERSION),
                                                "dist/RELEASE_%s.tar.gz" % VERSION)
          self.build_rpm()
  
      def pre_sdist(self):
          c = open(self.rpmspec + ".in").read()
          open(self.rpmspec, "w").write(c.replace("@VERSION@", VERSION))
  
      def build_rpm(self):
          rpmbuild = os.path.join(self.curdir, "pkg/rpmbuild-wrapper.sh")
          workdir = os.path.join(self.curdir, "dist")
  
          cmd_s = "%s -w %s -s %s %s" % (rpmbuild, workdir, self.build_stage,
                                         self.rpmspec)
          subprocess.check_call(cmd_s, shell=True)
  
  
  class RpmCommand(SrpmCommand):
  
      build_stage = "b"
  
  
  setup(name=PACKAGE,
        version=VERSION,
        packages=find_packages(exclude=['tests']),
        cmdclass={
            "srpm": SrpmCommand,
            "rpm":  RpmCommand,
        },)
  
  # vim:sw=4:ts=4:et:
  
subject: remove entry_points from setup() and revert packages=