use setuptools, remove autohell, use raw make for src/

This commit is contained in:
Samantha Baldwin
2016-10-19 17:54:01 -04:00
parent b2ca3167eb
commit 063876b575
29 changed files with 94 additions and 916 deletions

15
.gitignore vendored
View File

@@ -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

View File

@@ -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

View File

@@ -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 <commands>
python2 setup.py install
RUNNING WHIPPER
----------------

View File

@@ -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 $@

1
bin/.gitignore vendored
View File

@@ -1 +0,0 @@
rip

View File

@@ -1,3 +0,0 @@
bin_SCRIPTS = rip
EXTRA_DIST = rip.in

View File

@@ -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)

View File

@@ -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
)

View File

@@ -1 +0,0 @@
SUBDIRS = bash_completion.d

View File

@@ -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) > $@

View File

@@ -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()

View File

@@ -1,5 +0,0 @@
EXTRA_DIST = \
pycheckerrc \
header.py \
morituri-uninstalled \
show-coverage.py

View File

@@ -1,207 +0,0 @@
<Project
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns="http://usefulinc.com/ns/doap#"
xmlns:foaf="http://xmlns.com/foaf/0.1/"
xmlns:admin="http://webns.net/mvcb/">
<name>Morituri</name>
<shortname>morituri</shortname>
<homepage rdf:resource="http://thomas.apestaart.org/morituri/trac/" />
<created>2009-06-11</created>
<shortdesc xml:lang="en">
Morituri is a CD ripper aiming for maximum quality.
</shortdesc>
<description xml:lang="en">
Morituri is a CD ripper aiming for maximum quality.
</description>
<category></category>
<wiki rdf:resource="http://thomas.apestaart.org/morituri/trac/" />
<bug-database rdf:resource="https://thomas.apestaart.org/morituri/trac/newticket" />
<screenshots></screenshots>
<!--
<mailing-list rdf:resource="http://lists.sourceforge.net/lists/listinfo/morituri-devel/" />
-->
<programming-language>python</programming-language>
<license rdf:resource="http://usefulinc.com/doap/licenses/gpl" />
<download-page rdf:resource="http://thomas.apestaart.org/projects/morituri/" />
<repository>
<GitRepository>
<location rdf:resource="git://github.com/thomasvs/morituri.git" />
<browse rdf:resource="http://github.com/thomasvs/morituri" />
</GitRepository>
</repository>
<maintainer>
<foaf:Person>
<foaf:name>Thomas Vander Stichele</foaf:name>
</foaf:Person>
</maintainer>
<release>
<Version>
<revision>0.2.3</revision>
<branch>master</branch>
<name>moved</name>
<created>2014-07-15</created>
<file-release rdf:resource="http://thomas.apestaart.org/download/morituri/morituri-0.2.3.tar.bz2" />
<file-release rdf:resource="http://thomas.apestaart.org/download/morituri/morituri-0.2.3-1.noarch.rpm" />
<dc:description>
- 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
</dc:description>
</Version>
</release>
<release>
<Version>
<revision>0.2.2</revision>
<branch>master</branch>
<name>my bad</name>
<created>2013-07-30</created>
<file-release rdf:resource="http://thomas.apestaart.org/download/morituri/morituri-0.2.2.tar.bz2" />
<file-release rdf:resource="http://thomas.apestaart.org/download/morituri/morituri-0.2.2-1.noarch.rpm" />
<dc:description>
- fixed rip offset find
- set album and track artist id's properly
- rip cd info no longer ejects
</dc:description>
</Version>
</release>
<release>
<Version>
<revision>0.2.1</revision>
<branch>master</branch>
<name>married</name>
<created>2013-07-14</created>
<file-release rdf:resource="http://thomas.apestaart.org/download/morituri/morituri-0.2.1.tar.bz2" />
<file-release rdf:resource="http://thomas.apestaart.org/download/morituri/morituri-0.2.1-1.noarch.rpm" />
<dc:description>
- 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
</dc:description>
</Version>
</release>
<release>
<Version>
<revision>0.2.0</revision>
<branch>master</branch>
<name>ears</name>
<created>2013-01-20</created>
<file-release rdf:resource="http://thomas.apestaart.org/download/morituri/morituri-0.2.0.tar.bz2" />
<file-release rdf:resource="http://thomas.apestaart.org/download/morituri/morituri-0.2.0-1.noarch.rpm" />
<dc:description>
- 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
</dc:description>
</Version>
</release>
<release>
<Version>
<revision>0.1.3</revision>
<branch>trunk</branch>
<name>cranes</name>
<created>2012-11-23</created>
<file-release rdf:resource="http://thomas.apestaart.org/download/morituri/morituri-0.1.3.tar.bz2" />
<file-release rdf:resource="http://thomas.apestaart.org/download/morituri/morituri-0.1.3-1.noarch.rpm" />
<dc:description>
- 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
</dc:description>
</Version>
</release>
<release>
<Version>
<revision>0.1.2</revision>
<branch>trunk</branch>
<name>VCR</name>
<created>2011-06-05</created>
<file-release rdf:resource="http://thomas.apestaart.org/download/morituri/morituri-0.1.2.tar.bz2" />
<file-release rdf:resource="http://thomas.apestaart.org/download/morituri/morituri-0.1.2-1.noarch.rpm" />
<dc:description>
- 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
</dc:description>
</Version>
</release>
<release>
<Version>
<revision>0.1.1</revision>
<branch>trunk</branch>
<name>Dead</name>
<created>2010-04-16</created>
<file-release rdf:resource="http://thomas.apestaart.org/download/morituri/morituri-0.1.1.tar.bz2" />
<file-release rdf:resource="http://thomas.apestaart.org/download/morituri/morituri-0.1.1-1.noarch.rpm" />
<dc:description>
- 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
</dc:description>
</Version>
</release>
<release>
<Version>
<revision>0.1.0</revision>
<branch>trunk</branch>
<name>Youngblood</name>
<created>2009-09-26</created>
<file-release rdf:resource="http://thomas.apestaart.org/download/morituri/morituri-0.1.0.tar.bz2" />
<file-release rdf:resource="http://thomas.apestaart.org/download/morituri/morituri-0.1.0-1.noarch.rpm" />
<dc:description>
- 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
</dc:description>
</Version>
</release>
</Project>

View File

@@ -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 <thomas at apestaart dot org>
- add a hack to make the build pick up /usr/bin/python for python instead
* Sun Jan 20 2013 Thomas Vander Stichele <thomas at apestaart dot org>
- put rip completion file directly in package, not parent dir
* Sun Jan 20 2013 Thomas Vander Stichele <thomas at apestaart dot org>
- Added python-setuptools now that we use it for plugins
* Sun Dec 02 2012 Thomas Vander Stichele <thomas at apestaart dot org>
- Require pyxdg for XDG config file.
* Sun Jan 09 2011 Thomas Vander Stichele <thomas at apestaart dot org>
- Fix URL
* Sun May 23 2010 Thomas Vander Stichele <thomas at apestaart dot org>
- Add python-setuptools requirement
* Sun Sep 06 2009 Thomas Vander Stichele <thomas at apestaart dot org>
- added requires
* Wed May 20 2009 Thomas Vander Stichele <thomas at apestaart dot org>
- created package

View File

@@ -1,8 +0,0 @@
CLEANFILES = *.py{c,o}
morituridir = $(PYTHONLIBDIR)/morituri
morituri_PYTHON = \
__init__.py
SUBDIRS = common configure extern image program result rip test

View File

@@ -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

View File

@@ -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

View File

@@ -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()

View File

@@ -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@',
}

View File

@@ -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(),
}

View File

@@ -1,10 +0,0 @@
CLEANFILES = *.py{c,o}
morituridir = $(PYTHONLIBDIR)/morituri/image
morituri_PYTHON = \
__init__.py \
cue.py \
image.py \
table.py \
toc.py

View File

@@ -1,9 +0,0 @@
CLEANFILES = *.py{c,o}
morituridir = $(PYTHONLIBDIR)/morituri/program
morituri_PYTHON = \
__init__.py \
arc.py \
cdparanoia.py \
cdrdao.py

View File

@@ -1,8 +0,0 @@
CLEANFILES = *.py{c,o}
morituridir = $(PYTHONLIBDIR)/morituri/result
morituri_PYTHON = \
__init__.py \
logger.py \
result.py

View File

@@ -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

View File

@@ -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 @@ You can get help on subcommands by using the -h option to the subcommand.
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)

16
setup.py Normal file
View File

@@ -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'
]
}
)

47
src/Makefile Normal file
View File

@@ -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

View File

@@ -1,4 +0,0 @@
bin_PROGRAMS = accuraterip-checksum
accuraterip_checksum_SOURCES = accuraterip-checksum.c
accuraterip_checksum_CFLAGS = -std=c99
accuraterip_checksum_LDADD = -lsndfile

11
src/config.mk Normal file
View File

@@ -0,0 +1,11 @@
VERSION = 1.4
# paths
PREFIX = /usr/local
# flags
CFLAGS = -std=c99
LDFLAGS = -lsndfile
# compiler and linker
CC = cc