<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "http://bugs.gentoo.org/bugzilla.dtd">

<bugzilla version="2.22.7"
          urlbase="http://bugs.gentoo.org/"
          maintainer="bugzilla@gentoo.org"
>

    <bug>
          <bug_id>180191</bug_id>
          
          <creation_ts>2007-05-29 07:54 0000</creation_ts>
          <short_desc>games-strategy/lightyears-1.2a should byte-compile python files before installing them</short_desc>
          <delta_ts>2007-05-29 22:35:34 0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Gentoo Linux</product>
          <component>Games</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          <bug_file_loc>http://biscuits.jwhitham.org.uk/LightYears/</bug_file_loc>
          
          
          <priority>P2</priority>
          <bug_severity>trivial</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>denilsonsa@gmail.com</reporter>
          <assigned_to>games@gentoo.org</assigned_to>
          

      

      
          <long_desc isprivate="0">
            <who>denilsonsa@gmail.com</who>
            <bug_when>2007-05-29 07:54:21 0000</bug_when>
            <thetext>Currently, games-strategy/lightyears-1.2a ebuild installs just the *.py files. However, I think the ebuild should byte-compile these files to *.pyc/*.pyo and install them.

I did this at my ebuild for whichwayisup game. Look at bug #180187.

There are only 3 required changes to lightyears ebuild:
- Add &quot;python&quot; to inherit line.
- Add:
src_compile() {
        python_mod_optimize code
}
- Change &quot;doins&quot; line to this:
        doins code/*.py code/*.py[co] || die &quot;doins code failed&quot;</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>denilsonsa@gmail.com</who>
            <bug_when>2007-05-29 08:31:45 0000</bug_when>
            <thetext>After chatting with marienz at #gentoo-dev-help, he told me the way I described above is incorrect. The correct would be:

- Add python to inherit line
- Add the following functions:

pkg_postinst() {
        python_version
        python_mod_optimize &quot;$(games_get_libdir)/${PN}&quot;
}

pkg_postrm() {
        python_version
        python_mod_cleanup &quot;$(games_get_libdir)/${PN}&quot;
}</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>nyhm@gentoo.org</who>
            <bug_when>2007-05-29 22:35:34 0000</bug_when>
            <thetext>fixed, thanks</thetext>
          </long_desc>
      
    </bug>

</bugzilla>