Commits

fholmer committed ed93dab

Added classifiers to setup.
Setup installs Application-shortcut.

Comments (0)

Files changed (2)

 syntax: glob
 __pycache__
 MANIFEST
+build/
+dist/
 #  You should have received a copy of the GNU General Public License
 #  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+import os
 from distutils.core import setup
+from distutils.command.install import install
+from distutils import log
 
-setup(name='squeezeui',
+SHORTCUT = """[Desktop Entry]
+Version=1.0
+Type=Application
+Name=Squeezeui
+Comment=Squeezeui
+Exec={0}/squeezeui
+Icon={1}squeezeui/views/App.svg
+Terminal=false
+StartupNotify=false
+Categories=AudioVideo;Player;
+Keywords=Player;Audio;
+"""
+
+class add_shortcut(install):
+    def run(self):
+        super().run()
+        self._add_shortcut()
+    
+    def _add_shortcut(self):
+        shortcut = SHORTCUT.format(self.install_scripts, self.install_lib)
+        inst_dir = os.path.join(self.install_base, 'share', 'applications')
+        desktopfile = os.path.join(inst_dir, 'squeezeui.desktop')
+        if os.path.exists(inst_dir):
+            if self.dry_run:
+                log.info('Writing shortcut: {}'.format(desktopfile))
+            else:
+                with open(desktopfile, 'w') as f:
+                    f.write(shortcut)
+                    log.info('Writing shortcut: {}'.format(desktopfile))
+        
+setup(cmdclass={'install': add_shortcut}, 
+    name='squeezeui',
     version='1.0.0',
     description='Graphical user interface for Squeezebox players.',
+    long_description=open('README').read(),
     author='Frode Holmer',
-    author_email='fholmer+squeezeui@gmail.com',
+    author_email='fholmer@gmail.com',
     license='GPLv3',
     url='https://bitbucket.org/fholmer/squeezeui',
     keywords='squeezebox squeezelite',
     packages=['squeezeui', 'squeezeui.controllers', 'squeezeui.models'],
     package_data={'squeezeui': ['views/*.*', 'views/*/*.*']},
     scripts=['bin/squeezeui'],
-    requires=['PySide (>=1.1.2)', 'jsonrpclib (>=0.1.6)'],
-    options={'sdist': {'formats': 'zip'}})
+    requires=['PySide (>=1.1.2)', 'jsonrpclib (>=0.1.6)'], # jsonrpclib-pelix
+    provides=['squeezeui (1.0.0)'],
+    classifiers=[
+        'Development Status :: 4 - Beta',
+        'Environment :: X11 Applications :: Qt',
+        'Intended Audience :: End Users/Desktop',
+        'License :: OSI Approved :: GNU General Public License v3 (GPLv3)',
+        'Operating System :: POSIX :: Linux',
+        'Programming Language :: Python :: 3',
+        'Programming Language :: Python :: 3.3',
+        'Topic :: Multimedia :: Sound/Audio',
+        'Topic :: Multimedia :: Sound/Audio :: Players'])