From 063876b575874220fb7c4c80a523a28e825f0705 Mon Sep 17 00:00:00 2001 From: Samantha Baldwin Date: Wed, 19 Oct 2016 17:54:01 -0400 Subject: [PATCH 1/2] use setuptools, remove autohell, use raw make for src/ --- .gitignore | 15 -- Makefile.am | 50 ------ README.md | 20 +-- autogen.sh | 13 -- bin/.gitignore | 1 - bin/Makefile.am | 3 - bin/rip.in | 38 ----- configure.ac | 89 ----------- etc/Makefile.am | 1 - etc/bash_completion.d/Makefile.am | 13 -- etc/bash_completion.d/bash-compgen.in | 211 -------------------------- misc/Makefile.am | 5 - morituri.doap | 207 ------------------------- morituri.spec.in | 83 ---------- morituri/Makefile.am | 8 - morituri/common/Makefile.am | 22 --- morituri/configure/Makefile.am | 18 --- morituri/configure/configure.py | 35 +---- morituri/configure/installed.py.in | 11 -- morituri/configure/uninstalled.py.in | 19 --- morituri/image/Makefile.am | 10 -- morituri/program/Makefile.am | 9 -- morituri/result/Makefile.am | 8 - morituri/rip/Makefile.am | 14 -- morituri/rip/main.py | 29 +--- setup.py | 16 ++ src/Makefile | 47 ++++++ src/Makefile.am | 4 - src/config.mk | 11 ++ 29 files changed, 94 insertions(+), 916 deletions(-) delete mode 100644 Makefile.am delete mode 100755 autogen.sh delete mode 100644 bin/.gitignore delete mode 100644 bin/Makefile.am delete mode 100755 bin/rip.in delete mode 100644 configure.ac delete mode 100644 etc/Makefile.am delete mode 100644 etc/bash_completion.d/Makefile.am delete mode 100755 etc/bash_completion.d/bash-compgen.in delete mode 100644 misc/Makefile.am delete mode 100644 morituri.doap delete mode 100644 morituri.spec.in delete mode 100644 morituri/Makefile.am delete mode 100644 morituri/common/Makefile.am delete mode 100644 morituri/configure/Makefile.am delete mode 100644 morituri/configure/installed.py.in delete mode 100644 morituri/configure/uninstalled.py.in delete mode 100644 morituri/image/Makefile.am delete mode 100644 morituri/program/Makefile.am delete mode 100644 morituri/result/Makefile.am delete mode 100644 morituri/rip/Makefile.am create mode 100644 setup.py create mode 100644 src/Makefile delete mode 100644 src/Makefile.am create mode 100644 src/config.mk diff --git a/.gitignore b/.gitignore index 10502f30..e3f20a3b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,23 +1,8 @@ *.pyc INSTALL -Makefile -Makefile.in -aclocal.m4 -autom4te.cache -autoregen.sh -config.log -config.status -configure -!*/configure -install-sh -missing -morituri.spec py-compile REVISION *.o -.deps -/compile -/depcomp # For Python development using Eclipse IDE .project diff --git a/Makefile.am b/Makefile.am deleted file mode 100644 index 7a7e8461..00000000 --- a/Makefile.am +++ /dev/null @@ -1,50 +0,0 @@ -# version first -- they are parsed LTR and later options depend on automake 1.8 -AUTOMAKE_OPTIONS = 1.8 dist-bzip2 no-dist-gzip - -ACLOCAL_AMFLAGS = -I m4 - -SUBDIRS = morituri bin etc doc m4 misc src - -EXTRA_DIST = morituri.spec morituri.doap RELEASE README.md HACKING REVISION - -SOURCES = $(top_srcdir)/morituri/*.py $(top_srcdir)/morituri/*/*.py - -check: pychecker check-python - -check-python: - PYTHONPATH=$(PYTHONPATH):$(top_srcdir) trial morituri.test - -_trial_temp/coverage: $(top_srcdir)/morituri/*.py $(top_srcdir)/morituri/*/*.py - trial --coverage morituri.test - -coverage: _trial_temp/coverage - $(PYTHON) misc/show-coverage.py `ls _trial_temp/coverage/morituri* | grep -v morituri.test | grep -v morituri.extern` - -pep8: - for file in $(SOURCES); do $(PYTHON) misc/pep8.py --repeat $$file; done - -clean-local: - @rm -rf _trial_temp - -PYCHECKER_WHITELIST = \ - morituri/*.py \ - morituri/*/*.py - -PYCHECKER_BLACKLIST = \ - morituri/extern/asyncsub.py \ - morituri/extern/log/log.py - -release: dist - make $(PACKAGE)-$(VERSION).tar.bz2.md5 - -REVISION: $(top_srcdir)/.git morituri/common/common.py - $(PYTHON) -c 'from morituri.configure import configure; print configure.revision' > REVISION - -# generate md5 sum files -%.md5: % - md5sum $< > $@ - -include $(top_srcdir)/m4/pychecker.mk - -all-local: - if test -e $(top_srcdir)/.git; then make REVISION; fi diff --git a/README.md b/README.md index 3abeb1c0..e757c2ef 100755 --- a/README.md +++ b/README.md @@ -98,22 +98,22 @@ use whipper installed or uninstalled. git submodule init git submodule update export PYTHON=$(which python2) - ./autogen.sh -- building: +- building bundled dependencies - ./configure - make +This is only needed if you do not have the 'accuraterip-checksum' package installed on +your system. whipper packages this for your convenience: -- you can now choose to install it or run it uninstalled. +You can edit the install path in `config.mk`. - - installing: + cd src + make + sudo make install + cd .. - make install +- installation - - running uninstalled (within the make directory): - - ./misc/morituri-uninstalled rip + python2 setup.py install RUNNING WHIPPER ---------------- diff --git a/autogen.sh b/autogen.sh deleted file mode 100755 index c0e7a5ab..00000000 --- a/autogen.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh -set -x - -# autopoint || exit 1 -aclocal -I m4 || exit 1 -# libtoolize --force || exit 1 -# autoheader || exit 1 -autoconf || exit 1 -automake -a || exit 1 -echo "./autogen.sh $@" > autoregen.sh -chmod +x autoregen.sh -./configure --enable-maintainer-mode $@ - diff --git a/bin/.gitignore b/bin/.gitignore deleted file mode 100644 index b6a90887..00000000 --- a/bin/.gitignore +++ /dev/null @@ -1 +0,0 @@ -rip diff --git a/bin/Makefile.am b/bin/Makefile.am deleted file mode 100644 index 767fc9f1..00000000 --- a/bin/Makefile.am +++ /dev/null @@ -1,3 +0,0 @@ -bin_SCRIPTS = rip - -EXTRA_DIST = rip.in diff --git a/bin/rip.in b/bin/rip.in deleted file mode 100755 index 80aad083..00000000 --- a/bin/rip.in +++ /dev/null @@ -1,38 +0,0 @@ -#!@PYTHON@ -# -*- Mode: Python -*- -# vi:si:et:sw=4:sts=4:ts=4 - -import sys - -# /usr/local/bin typically is on PATH, making it possible to find this file. -# However, /usr/local/lib/pythonX.Y/*-packages usually isn't, so let's -# make sure here it is. - -if not "@PYTHONLIBDIR@" in sys.path: - sys.path.append("@PYTHONLIBDIR@") - -# first try to import morituri -try: - import morituri -except ImportError: - sys.stderr.write('''The rip binary cannot find its python package. -This means that the 'morituri' directory containing __init__.py is not on your -PYTHONPATH. -Typically this is due to a broken install. -Please fix the problem, and verify that it is fixed by starting python and -typing: - ->>> import morituri - -and assure it doesn't raise an exception. - -''') - sys.exit(1) - -# now load the main function - -try: - from morituri.rip import main - sys.exit(main.main(sys.argv[1:])) -except ImportError, e: - raise ImportError(e) diff --git a/configure.ac b/configure.ac deleted file mode 100644 index a64eb2ce..00000000 --- a/configure.ac +++ /dev/null @@ -1,89 +0,0 @@ -dnl initialize autoconf -dnl when going to/from release please remove/add the nano (fourth number) -dnl releases only do Wall, trunk and prerelease does Werror too -AC_INIT(morituri, 0.2.3.1, - http://thomas.apestaart.org/morituri/trac/newticket, - morituri) - -dnl initialize automake -AM_INIT_AUTOMAKE - -dnl define PACKAGE_VERSION_* variables -AS_VERSION - -AS_NANO - -dnl authors -AC_SUBST_FILE(AUTHORS) -AUTHORS=$srcdir/AUTHORS - -dnl AM_MAINTAINER_MODE only provides the option to configure to enable it -AM_MAINTAINER_MODE - -dnl Add parameters for aclocal -AC_SUBST(ACLOCAL_AMFLAGS, "-I m4") - -dnl check for python -AM_PATH_PYTHON(2.3) - -dnl check for where to install our python stuff -PYVER=[`$PYTHON -c "import sys ; print sys.version[:3]"`] - -AC_ARG_WITH([pluginsdir], - AS_HELP_STRING([--with-pluginsdir], [Set custom global plugin directory]), - [], - [with_pluginsdir=none]) - -dnl This is the best way of installing in an arch-independent location for now -AS_AC_EXPAND(PYTHONLIBDIR, "\${exec_prefix}/lib/python$PYVER/site-packages") - -AC_MSG_NOTICE(Installing python code in $PYTHONLIBDIR) -AC_SUBST(PYTHONLIBDIR) - -AS_IF([test "x$with_pluginsdir" != "xnone"], [AS_AC_EXPAND(PLUGINSDIR, "$with_pluginsdir")], - [test "x$with_pluginsdir" = "xnone"], [AS_AC_EXPAND(PLUGINSDIR, "\${libdir}/morituri/plugins")]) -AC_MSG_NOTICE(Setting plugins directory to $PLUGINSDIR) - -dnl get git revision for installed.py.in -AC_SUBST(REVISION, `$PYTHON -c 'from morituri.configure import configure; print configure.revision'`) -AC_MSG_NOTICE(Setting revision to $REVISION) - -dnl check for epydoc -AC_CHECK_PROG(EPYDOC, epydoc, yes, no) -AM_CONDITIONAL(HAVE_EPYDOC, test "x$EPYDOC" = "xyes") - -dnl check for pychecker -AC_CHECK_PROG(PYCHECKER, pychecker, yes, no) -AM_CONDITIONAL(HAVE_PYCHECKER, test "x$PYCHECKER" = "xyes") - -dnl -AC_PROG_CC -AC_CHECK_LIB(sndfile,sf_open) - -dnl output stuff -AC_CONFIG_FILES([bin/rip], [chmod +x bin/rip]) -AC_CONFIG_FILES([etc/bash_completion.d/bash-compgen], - [chmod +x etc/bash_completion.d/bash-compgen]) - -AC_OUTPUT( -Makefile -bin/Makefile -etc/Makefile -etc/bash_completion.d/Makefile -m4/Makefile -morituri/Makefile -morituri/rip/Makefile -morituri/common/Makefile -morituri/configure/Makefile -morituri/configure/uninstalled.py -morituri/configure/installed.py -morituri/extern/Makefile -morituri/image/Makefile -morituri/program/Makefile -morituri/result/Makefile -morituri/test/Makefile -doc/Makefile -misc/Makefile -morituri.spec -src/Makefile -) diff --git a/etc/Makefile.am b/etc/Makefile.am deleted file mode 100644 index 5168a172..00000000 --- a/etc/Makefile.am +++ /dev/null @@ -1 +0,0 @@ -SUBDIRS = bash_completion.d diff --git a/etc/bash_completion.d/Makefile.am b/etc/bash_completion.d/Makefile.am deleted file mode 100644 index be60999d..00000000 --- a/etc/bash_completion.d/Makefile.am +++ /dev/null @@ -1,13 +0,0 @@ -completiondir = $(sysconfdir)/bash_completion.d -completion_DATA = rip - -BUILT_SOURCES = rip -CLEANFILES = rip - -EXTRA_DIST = bash-compgen.in bash-compgen - -ENTRY = morituri.rip.main.Rip - -rip: bash-compgen $(top_srcdir)/morituri $(top_srcdir)/morituri/* - PYTHONPATH=$(top_srcdir):$$PYTHONPATH $(srcdir)/bash-compgen \ - $(completion_DATA) $(ENTRY) > $@ diff --git a/etc/bash_completion.d/bash-compgen.in b/etc/bash_completion.d/bash-compgen.in deleted file mode 100755 index 263250c9..00000000 --- a/etc/bash_completion.d/bash-compgen.in +++ /dev/null @@ -1,211 +0,0 @@ -#!@PYTHON@ -# -*- Mode: Python -*- -# vi:si:et:sw=4:sts=4:ts=4 - -# generate bash completion for all commands -# first argument should be program name -# second argument should be the main Command entry class's fully qualified name - -import sys - -def funcName(cmd): - """ - Generate a name for the given command by walking up the ancestry - and seperating with underscore. - """ - l = [cmd.name] - while cmd.parentCommand: - cmd = cmd.parentCommand - l.append(cmd.name) - - l.reverse() - return "_%s_complete_" % cmd.name + "_".join(l) - -def generateOneCommand(cmd): - function = funcName(cmd) - commandList = cmd.subCommands.keys() - commandList.sort() - commands = '"' + " ".join(commandList) + '"' - - # poking into private instance variables for optparse.Option is nasty, - # but I see no alternative - optionBooleanList = [] - optionValueList = [] - optionList = [] - for option in cmd.parser.option_list: - optionList.extend(option._short_opts + option._long_opts) - if not option.nargs: - optionBooleanList.extend(option._short_opts + option._long_opts) - else: - optionValueList.extend(option._short_opts + option._long_opts) - optionList.sort() - options = '"' + " ".join(optionList) + '"' - optionsBoolean = '"' + " ".join(optionBooleanList) + '"' - optionsValue = '"' + " ".join(optionValueList) + '"' - - name = cmd.name - - return """ -%(function)s() -{ - options=%(options)s - optionsboolean=%(optionsBoolean)s - optionsvalue=%(optionsValue)s - commands=%(commands)s - completed=false - - debug "function %(function)s" - debug "args '$@'" - debug "ARG1 '$1'" - debug "ARG2 '$2'" - shift - debug "after shift: args '$@'" - debug "ARG1 '$1'" - debug "ARG2 '$2'" - - - while [[ "$completed" == "false" ]] - do - if [[ "$1" == -* ]] - then - # handle as argument - debug "handling argument $#" - # found will be set to true when the current argument fully matches - # an option, causing us to swallow it - found=false - # first check for boolean options - for option in $optionsboolean - do - debug "matching option $option to args $1" - if [[ "$option" == "$1" ]] - then - debug "found full boolean option $option, eating" - found=true - shift - fi - done - # then check for valued options - if [[ "$found" == false ]] - then - for option in $optionsvalue - do - debug "matching option $option to args $1" - if [[ "$option" == "$1" ]] - then - found=true - if [[ $# -eq 1 ]] - then - # a valued option with no value - # we can't complete this since we don't know what - # values the option takes - completed=true - COMPREPLY=() - else - # eat option and its value - shift 2 - fi - fi - done - fi - if [[ "$found" == false ]] - then - debug "completing argument" - COMPREPLY=( $( compgen -W "$options" -- $1 ) ) - debug "COMPREPLY ${COMPREPLY[*]}" - completed=true - fi - else - # handle as command - debug "handle as command" - found=false - if [[ $# -eq 0 ]]; then - # completing this command - COMPREPLY=( $( compgen -W "$commands" -- $1 ) ) - debug "command, COMPREPLY ${COMPREPLY[*]}" - completed=true - else - for command in $commands - do - debug "matching arg $1 against command $command" - if [[ "$command" == "$1" ]] - then - debug "found full command, delegating" - # completing a subcommand, delegate - debug "delegate, $# args, 1 is $1" - %(function)s_$1 $@ - debug "delegated, COMPREPLY ${COMPREPLY[*]}" - found=true - fi - done - # if not found, we must still be wanting to complete the - # current partial command - if [[ "$found" == false ]] - then - COMPREPLY=( $( compgen -W "$commands" -- $1 ) ) - completed=true - fi - fi - fi - debug "function %(function)s: COMPREPLY ${COMPREPLY[*]}" - done - -} -""" % locals() - -def generateSubCommands(cmd): - snippets = [] - if cmd.subCommands: - for subCommand in cmd.subCommands.values(): - snippets.extend(generateSubCommands(subCommand)) - snippets.append(generateOneCommand(cmd)) - return snippets - - -def start(): - if len(sys.argv) != 3: - sys.stderr.write('Usage: %s [program-name] [entry-class]\n') - sys.exit(1) - - name = sys.argv[1] - entry = sys.argv[2] - parts = entry.split('.') - if len(parts) <= 1: - sys.stderr.write( - 'The entry class should be a module-qualified Class.\n') - sys.exit(1) - module = ".".join(parts[:-1]) - command = "from %s import %s as EntryClass" % (module, parts[-1]) - exec command - entry = EntryClass() - print """#-*- mode: shell-script;-*- - -# Programmed completion for bash to use %s - -""" % name - - print "\n".join(generateSubCommands(entry)) - - print """ -# helper debug function -debug() -{ - if [[ ! -z "$DEBUG" ]] - then - echo $@ - fi -} - -# main entry point -# dispatches to a command-specific function, passing in the rest of the -# command line as arguments, starting with the command name being called -_%(name)s() -{ - COMPREPLY=() - # pass as a list, not as a single string - _%(name)s_complete_%(name)s ${COMP_WORDS[*]} -} - -complete -F _%(name)s -o default %(name)s -""" % locals() - -start() diff --git a/misc/Makefile.am b/misc/Makefile.am deleted file mode 100644 index cdaa7604..00000000 --- a/misc/Makefile.am +++ /dev/null @@ -1,5 +0,0 @@ -EXTRA_DIST = \ - pycheckerrc \ - header.py \ - morituri-uninstalled \ - show-coverage.py diff --git a/morituri.doap b/morituri.doap deleted file mode 100644 index 85f76ee7..00000000 --- a/morituri.doap +++ /dev/null @@ -1,207 +0,0 @@ - - - Morituri - morituri - - 2009-06-11 - -Morituri is a CD ripper aiming for maximum quality. - - -Morituri is a CD ripper aiming for maximum quality. - - - - - - - python - - - - - - - - - - - - - Thomas Vander Stichele - - - - - - 0.2.3 - master - moved - 2014-07-15 - - - -- fixed non-01 index offsets -- add new debug command, rip debug resultcache cue -- use newer lamemp3enc element for mp3 encoding -- fixed rip image verify command - - - - - - - 0.2.2 - master - my bad - 2013-07-30 - - - -- fixed rip offset find -- set album and track artist id's properly -- rip cd info no longer ejects - - - - - - - 0.2.1 - master - married - 2013-07-14 - - - -- added "%X" template variable for uppercase filename extension -- added rip cd info -- added storing catalog number and barcode -- disambiguate releases with same name but different catno/barcode -- use all but last track to find offset -- add support to filter path names for better file system support -- add config options for path filtering -- fixes for older pyxdg and some versions of pycdio - - - - - - - - 0.2.0 - master - ears - 2013-01-20 - - - -- added plugins system for logger -- added rip cd rip --logger to specify logger -- added reading speed, cdparanoia and cdrdao version to logger -- added rip drive analyze to detect whether we can defeat audio cache behaviour -- store drive offsets and cache defeating in config file -- rip drive list shows configured offset and audio cache defeating -- added rip image retag --release-id to specify the release id to tag with -- added %r/%R for release type to use in track/disc template -- added %x for extension to release template - - - - - - - - 0.1.3 - trunk - cranes - 2012-11-23 - - - -- shorten really long file names if needed -- support multi-disc ripping with musicbrainz NGS -- add %y for release year in templates -- added rip cd rip --release-id option to select the exact release -- allow track and disc templates to create files in different directories -- work out relative paths from cue/m3u files to audio files -- Update mp3vbr profile - - - - - - - - 0.1.2 - trunk - VCR - 2011-06-05 - - - -- UTF-8/unicode handling fixes -- improved error handling -- ignore tags for alac and wav -- work around GStreamer flacparse bugs -- change how paths get referenced in .cue files -- properly interpret AccurateRip results; no more assertions on unexpected - ordering of results -- add debug command - - - - - - - 0.1.1 - trunk - Dead - 2010-04-16 - - - -- added 'rip image encode' command to encode an image to a lossy codec. -- provided lossy codec profiles for vorbis, mp3, and mp3vbr -- added a complete list of known drive offsets from AccurateRip -- added a generated man page -- better exception handling in tasks -- tag audio files with musicbrainz id's -- added 'rip image retag' command to retag audio files in an image -- bug fixes - - - - - - - 0.1.0 - trunk - Youngblood - 2009-09-26 - - - -- first release -- support for MusicBrainz for metadata lookup -- support for AccurateRip verification -- detects sample read offset of drives -- performs test and copy rip -- detects and rips Hidden Track One Audio -- templates for file and directory naming -- support for lossless encoding only for now -- tagging using GStreamer -- for now, only a command line client (rip) is shipped - - - - - diff --git a/morituri.spec.in b/morituri.spec.in deleted file mode 100644 index 58a5c7a9..00000000 --- a/morituri.spec.in +++ /dev/null @@ -1,83 +0,0 @@ -%define pyver %(%{__python} -c "import sys; print sys.version[:3]") -%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} - -Name: morituri -Version: @PACKAGE_VERSION@ -Release: @PACKAGE_VERSION_RELEASE@%{?dist} -Summary: CD ripper -Source: http://thomas.apestaart.org/download/morituri/%{name}-%{version}.tar.bz2 -URL: https://thomas.apestaart.org/morituri/trac/ -License: GPLv3 -Group: Applications/Archiving -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) - -BuildArch: noarch - -BuildRequires: pygobject2 -BuildRequires: gstreamer-python -BuildRequires: python-setuptools - -Requires: cdparanoia -Requires: cdrdao > 1.2.3-0.rc2.2 -Requires: gstreamer-plugins-good >= 0.10.16 -Requires: gstreamer-python -Requires: python-musicbrainz2 -Requires: python-CDDB -Requires: pycdio -Requires: pyxdg - -# we use parse_version in code -Requires: python-setuptools - -%description -Morituri is a CD ripper. - -%prep - -%setup -q - -PATH=/usr/bin:/bin:\$PATH %configure --sysconfdir=%{_sysconfdir} - -%build - -%install -rm -rf $RPM_BUILD_ROOT -make DESTDIR=$RPM_BUILD_ROOT install - -mkdir -p $RPM_BUILD_ROOT%{_libdir}/morituri/plugins -%clean -rm -rf $RPM_BUILD_ROOT - -%files -%defattr(-,root,root) -%doc README morituri.doap NEWS RELEASE ChangeLog -%{_bindir}/rip -%{_libdir}/morituri/plugins -%{_mandir}/man1/rip.1* -%{python_sitelib}/morituri -%{_sysconfdir}/bash_completion.d/rip - -%changelog -* Thu Jul 24 2014 Thomas Vander Stichele -- add a hack to make the build pick up /usr/bin/python for python instead - -* Sun Jan 20 2013 Thomas Vander Stichele -- put rip completion file directly in package, not parent dir - -* Sun Jan 20 2013 Thomas Vander Stichele -- Added python-setuptools now that we use it for plugins - -* Sun Dec 02 2012 Thomas Vander Stichele -- Require pyxdg for XDG config file. - -* Sun Jan 09 2011 Thomas Vander Stichele -- Fix URL - -* Sun May 23 2010 Thomas Vander Stichele -- Add python-setuptools requirement - -* Sun Sep 06 2009 Thomas Vander Stichele -- added requires - -* Wed May 20 2009 Thomas Vander Stichele -- created package diff --git a/morituri/Makefile.am b/morituri/Makefile.am deleted file mode 100644 index d5ddd64c..00000000 --- a/morituri/Makefile.am +++ /dev/null @@ -1,8 +0,0 @@ -CLEANFILES = *.py{c,o} - -morituridir = $(PYTHONLIBDIR)/morituri - -morituri_PYTHON = \ - __init__.py - -SUBDIRS = common configure extern image program result rip test diff --git a/morituri/common/Makefile.am b/morituri/common/Makefile.am deleted file mode 100644 index 2a8e4cb7..00000000 --- a/morituri/common/Makefile.am +++ /dev/null @@ -1,22 +0,0 @@ -CLEANFILES = *.py{c,o} - -morituridir = $(PYTHONLIBDIR)/morituri/common - -morituri_PYTHON = \ - __init__.py \ - accurip.py \ - checksum.py \ - cache.py \ - common.py \ - config.py \ - directory.py \ - drive.py \ - encode.py \ - gstreamer.py \ - log.py \ - logcommand.py \ - mbngs.py \ - path.py \ - program.py \ - renamer.py \ - task.py diff --git a/morituri/configure/Makefile.am b/morituri/configure/Makefile.am deleted file mode 100644 index 4976bb6f..00000000 --- a/morituri/configure/Makefile.am +++ /dev/null @@ -1,18 +0,0 @@ -CLEANFILES = *.py{c,o} - -morituridir = $(PYTHONLIBDIR)/morituri/configure - -morituri_PYTHON = \ - __init__.py \ - configure.py \ - installed.py - -noinst_PYTHON = uninstalled.py - -BUILT_SOURCES = installed.py uninstalled.py - -TAGS_FILES = installed.py.in uninstalled.py.in - -DISTCLEANFILES = installed.pyc installed.pyo uninstalled.pyc uninstalled.pyo - -EXTRA_DIST = $(morituri_PYTHON) installed.py.in uninstalled.py.in diff --git a/morituri/configure/configure.py b/morituri/configure/configure.py index 3d626f44..eac69c65 100644 --- a/morituri/configure/configure.py +++ b/morituri/configure/configure.py @@ -1,39 +1,14 @@ # -*- Mode: Python -*- # vi:si:et:sw=4:sts=4:ts=4 -''' -configure-time variables for installed or uninstalled operation - -Code should run - >>> from morituri.configure import configure - -and then access the variables from the configure module. For example: - >>> print configure.version - -@var isinstalled: whether an installed version is being run -@type isinstalled: boolean - -@var version: morituri version number -@type version: string -''' - import os -# where am I on the disk ? -__thisdir = os.path.dirname(os.path.abspath(__file__)) +from morituri.common import common -if os.path.exists(os.path.join(__thisdir, 'uninstalled.py')): - from morituri.configure import uninstalled - config_dict = uninstalled.get() -elif os.path.exists(os.path.join(__thisdir, 'installed.py')): - from morituri.configure import installed - config_dict = installed.get() -else: - # hack on fresh checkout, no make run yet, and configure needs revision - from morituri.common import common - config_dict = { - 'revision': common.getRevision(), - } +config_dict = { + 'revision': common.getRevision(), + 'version': '0.3.0', +} for key, value in config_dict.items(): dictionary = locals() diff --git a/morituri/configure/installed.py.in b/morituri/configure/installed.py.in deleted file mode 100644 index c80f431b..00000000 --- a/morituri/configure/installed.py.in +++ /dev/null @@ -1,11 +0,0 @@ -# -*- Mode: Python -*- -# vi:si:et:sw=4:sts=4:ts=4 - - -def get(): - return { - 'isinstalled': True, - 'pluginsdir': '@PLUGINSDIR@', - 'version': '@VERSION@', - 'revision': '@REVISION@', - } diff --git a/morituri/configure/uninstalled.py.in b/morituri/configure/uninstalled.py.in deleted file mode 100644 index a8155f80..00000000 --- a/morituri/configure/uninstalled.py.in +++ /dev/null @@ -1,19 +0,0 @@ -# -*- Mode: Python -*- -# vi:si:et:sw=4:sts=4:ts=4 - -import os.path - -from morituri.common import common - - -__thisdir = os.path.dirname(os.path.abspath(__file__)) - - -def get(): - return { - 'isinstalled': False, - 'pluginsdir': os.path.abspath(os.path.join( - __thisdir, '..', '..', 'plugins')), - 'version': '@VERSION@', - 'revision': common.getRevision(), - } diff --git a/morituri/image/Makefile.am b/morituri/image/Makefile.am deleted file mode 100644 index be3a2e62..00000000 --- a/morituri/image/Makefile.am +++ /dev/null @@ -1,10 +0,0 @@ -CLEANFILES = *.py{c,o} - -morituridir = $(PYTHONLIBDIR)/morituri/image - -morituri_PYTHON = \ - __init__.py \ - cue.py \ - image.py \ - table.py \ - toc.py diff --git a/morituri/program/Makefile.am b/morituri/program/Makefile.am deleted file mode 100644 index a42ccab0..00000000 --- a/morituri/program/Makefile.am +++ /dev/null @@ -1,9 +0,0 @@ -CLEANFILES = *.py{c,o} - -morituridir = $(PYTHONLIBDIR)/morituri/program - -morituri_PYTHON = \ - __init__.py \ - arc.py \ - cdparanoia.py \ - cdrdao.py diff --git a/morituri/result/Makefile.am b/morituri/result/Makefile.am deleted file mode 100644 index 3062310f..00000000 --- a/morituri/result/Makefile.am +++ /dev/null @@ -1,8 +0,0 @@ -CLEANFILES = *.py{c,o} - -morituridir = $(PYTHONLIBDIR)/morituri/result - -morituri_PYTHON = \ - __init__.py \ - logger.py \ - result.py diff --git a/morituri/rip/Makefile.am b/morituri/rip/Makefile.am deleted file mode 100644 index f7d32f6a..00000000 --- a/morituri/rip/Makefile.am +++ /dev/null @@ -1,14 +0,0 @@ -CLEANFILES = *.py{c,o} - -morituridir = $(PYTHONLIBDIR)/morituri/rip - -morituri_PYTHON = \ - __init__.py \ - accurip.py \ - cd.py \ - common.py \ - debug.py \ - drive.py \ - image.py \ - main.py \ - offset.py diff --git a/morituri/rip/main.py b/morituri/rip/main.py index a56658e1..ad41134f 100644 --- a/morituri/rip/main.py +++ b/morituri/rip/main.py @@ -4,40 +4,23 @@ import os import sys import pkg_resources +import musicbrainzngs from morituri.common import log, logcommand, common, config, directory from morituri.configure import configure - -from morituri.rip import cd, offset, drive, image, accurip, debug - from morituri.extern.command import command from morituri.extern.task import task +from morituri.program import cdrdao +from morituri.rip import cd, offset, drive, image, accurip, debug -def main(argv): - # load plugins - - from morituri.configure import configure - pluginsdir = configure.pluginsdir - d = directory.Directory() - homepluginsdir = d.getData('plugins') - - distributions, errors = pkg_resources.working_set.find_plugins( - pkg_resources.Environment([pluginsdir, homepluginsdir])) - if errors: - log.warning('errors finding plugins: %r', errors) - log.debug('mapping distributions %r', distributions) - map(pkg_resources.working_set.add, distributions) - +def main(): # set user agent - import musicbrainzngs musicbrainzngs.set_useragent("morituri", configure.version, 'https://thomas.apestaart.org/morituri/trac') - - c = Rip() try: - ret = c.parse(argv) + ret = c.parse(sys.argv[1:]) except SystemError, e: sys.stderr.write('rip: error: %s\n' % e.args) return 255 @@ -51,7 +34,6 @@ def main(argv): e.exception.dependency) return 255 # FIXME: move this exception - from morituri.program import cdrdao if isinstance(e.exception, cdrdao.DeviceOpenException): sys.stderr.write("""rip: error: cannot read CD from drive. cdrdao says: @@ -91,7 +73,6 @@ class Rip(logcommand.LogCommand): def addOptions(self): # FIXME: is this the right place ? log.init() - from morituri.configure import configure log.debug("morituri", "This is morituri version %s (%s)", configure.version, configure.revision) diff --git a/setup.py b/setup.py new file mode 100644 index 00000000..5d6c7ba3 --- /dev/null +++ b/setup.py @@ -0,0 +1,16 @@ +from setuptools import setup, find_packages +from os import system, makedirs, environ + +setup( + name="whipper", + version="0.3.0", + description="a secure cd ripper preferring accuracy over speed", + author=['Thomas Vander Stichele', 'Joe Lametta', 'Samantha Baldwin'], + maintainer=['Joe Lametta', 'Samantha Baldwin'], + packages=find_packages(), + entry_points = { + 'console_scripts': [ + 'rip = morituri.rip.main:main' + ] + } +) diff --git a/src/Makefile b/src/Makefile new file mode 100644 index 00000000..f1c6d4a2 --- /dev/null +++ b/src/Makefile @@ -0,0 +1,47 @@ +# See LICENSE file for copyright and license details. + +include config.mk + +SRC = accuraterip-checksum.c +OBJ = ${SRC:.c=.o} + +all: options accuraterip-checksum + +options: + @echo accuraterip-checksum build options: + @echo "CFLAGS = ${CFLAGS}" + @echo "LDFLAGS = ${LDFLAGS}" + @echo "CC = ${CC}" + +.c.o: + @echo CC $< + @${CC} -c ${CFLAGS} $< + +accuraterip-checksum: ${OBJ} + @echo CC -o $@ + @${CC} -o $@ ${OBJ} ${LDFLAGS} + +clean: + @echo cleaning + @rm -f accuraterip-checksum ${OBJ} accuraterip-checksum-${VERSION}.tar.gz + +dist: clean + @echo creating dist tarball + @mkdir -p accuraterip-checksum-${VERSION} + @cp -R Makefile README.md config.mk \ + ${SRC} accuraterip-checksum-${VERSION} + @tar -cf accuraterip-checksum-${VERSION}.tar accuraterip-checksum-${VERSION} + @gzip accuraterip-checksum-${VERSION}.tar + @rm -rf accuraterip-checksum-${VERSION} + +install: all + @echo installing executable file to ${DESTDIR}${PREFIX}/bin + @mkdir -p ${DESTDIR}${PREFIX}/bin + @cp -f accuraterip-checksum ${DESTDIR}${PREFIX}/bin + @chmod 755 ${DESTDIR}${PREFIX}/bin/accuraterip-checksum + +uninstall: + @echo removing executable file from ${DESTDIR}${PREFIX}/bin + @rm -f ${DESTDIR}${PREFIX}/bin/accuraterip-checksum + +.PHONY: all options clean dist install uninstall diff --git a/src/Makefile.am b/src/Makefile.am deleted file mode 100644 index ce794b1d..00000000 --- a/src/Makefile.am +++ /dev/null @@ -1,4 +0,0 @@ -bin_PROGRAMS = accuraterip-checksum -accuraterip_checksum_SOURCES = accuraterip-checksum.c -accuraterip_checksum_CFLAGS = -std=c99 -accuraterip_checksum_LDADD = -lsndfile diff --git a/src/config.mk b/src/config.mk new file mode 100644 index 00000000..283d7455 --- /dev/null +++ b/src/config.mk @@ -0,0 +1,11 @@ +VERSION = 1.4 + +# paths +PREFIX = /usr/local + +# flags +CFLAGS = -std=c99 +LDFLAGS = -lsndfile + +# compiler and linker +CC = cc From 2dae4626774da1ef1fe6c6a9e311f2b7f57e76f9 Mon Sep 17 00:00:00 2001 From: Samantha Baldwin Date: Thu, 20 Oct 2016 01:11:40 -0400 Subject: [PATCH 2/2] update .travis.yml to reflect setuptools migration --- .travis.yml | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index 768f8e26..bbc063f8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,15 +13,13 @@ install: - sudo apt-get install -qq gstreamer0.10-tools python-gst0.10 - sudo pip install twisted - # Checkout - - ./autogen.sh - - # Building - - ./configure - - make + # Build bundled C utils + - cd src + - sudo make install + - cd .. # Installing - - sudo make install + - sudo python setup.py install script: - python -m unittest discover