From d4a7d7b5137d746845c8aefc6b5d904651a20850 Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Sat, 13 Feb 2016 19:33:40 +0000 Subject: [PATCH] gremlin/: Start on making it be a proper built thing. --- .gitignore | 1 + Makefile.am | 7 ++++--- configure.ac | 6 ++++-- debian/control | 30 ++++++++++++++++++++++++++++ debian/gremlin.install | 1 + gremlin/Makefile.am | 44 +++++++++++++++++++++++++++++++++++++++++ gremlin/{gremlin => gremlin.in} | 4 ++-- 7 files changed, 86 insertions(+), 7 deletions(-) create mode 100644 debian/gremlin.install create mode 100644 gremlin/Makefile.am rename gremlin/{gremlin => gremlin.in} (99%) diff --git a/.gitignore b/.gitignore index f9d77cc..61708fd 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ /autom4te.cache/ /config/ /configure +/gremlin/Makefile.in diff --git a/Makefile.am b/Makefile.am index 5b4a513..c5cc0b8 100644 --- a/Makefile.am +++ b/Makefile.am @@ -30,6 +30,8 @@ SUBDIRS = ###-------------------------------------------------------------------------- ### Subdirectories. +SUBDIRS += gremlin + ###-------------------------------------------------------------------------- ### Release tweaking. @@ -37,9 +39,6 @@ SUBDIRS = dist-hook:: echo $(VERSION) >$(distdir)/RELEASE -## Bodge for now. -EXTRA_DIST += gremlin/gremlin - ## Additional build tools. EXTRA_DIST += config/auto-version EXTRA_DIST += config/confsubst @@ -54,4 +53,6 @@ EXTRA_DIST += debian/copyright EXTRA_DIST += debian/compat EXTRA_DIST += debian/source/format +EXTRA_DIST += debian/gremlin.install + ###----- That's all, folks -------------------------------------------------- diff --git a/configure.ac b/configure.ac index 16813ce..b20a56d 100644 --- a/configure.ac +++ b/configure.ac @@ -28,7 +28,7 @@ dnl Initialization. mdw_AUTO_VERSION AC_INIT([autoys], AUTO_VERSION, [mdw@distorted.org.uk]) -AC_CONFIG_SRCDIR([gremlin/gremlin]) +AC_CONFIG_SRCDIR([gremlin/gremlin.in]) AC_CONFIG_AUX_DIR([config]) AM_INIT_AUTOMAKE([foreign]) mdw_SILENT_RULES @@ -64,7 +64,9 @@ AM_CONDITIONAL([HAVE_BASH], [test $have_bash = yes]) dnl-------------------------------------------------------------------------- dnl Output. -AC_CONFIG_FILES([Makefile]) +AC_CONFIG_FILES( + [Makefile] + [gremlin/Makefile]) AC_OUTPUT dnl----- That's all, folks -------------------------------------------------- diff --git a/debian/control b/debian/control index c1edd5e..9181280 100644 --- a/debian/control +++ b/debian/control @@ -8,4 +8,34 @@ Standards-Version: 3.1.1 Package: autoys Architecture: all Section: sound +Depends: + gremlin Description: A convenience package which depends on the other `autoys' packages. + +Package: gremlin +Architecture: all +Section: sound +Depends: ${python:Depends}, + python-pyparsing, + python-gst0.10, python-gobject-2, + python-eyed3, python-imaging +Description: Maintain converted trees of audio files. + The `gremlin' program converts audio files in an input `master' directory + tree, which presumably contains high-quality (ideally lossless) encodings of + interesting audio, writing corresponding converted files to a collection of + output directory trees. It's non-interactive, idempotent, and restartable; + it never modifies its master tree. It's exactly the sort of thing you want + to install as a daily cron job. + . + The gremlin reads a configuration file which describes the conversion policy + for each of the output trees. The policy can say things like: copy MP3 + files up to 160kb/s, or Ogg Vorbis files up to 128kb/s; and convert + everything else to 128kb/s Ogg Vorbis. + . + The gremlin can also convert image files, such as cover art. + . + Input files can be anything which GStreamer and/or the Python Imaging + Library can understand; output files are more constrained, because the + gremlin has to be able to understand their relevant properties. The + currently supported audio formats are Ogg Vorbis and MP3; image formats are + JPEG, PNG, and BMP. diff --git a/debian/gremlin.install b/debian/gremlin.install new file mode 100644 index 0000000..075f1d0 --- /dev/null +++ b/debian/gremlin.install @@ -0,0 +1 @@ +usr/bin/gremlin diff --git a/gremlin/Makefile.am b/gremlin/Makefile.am new file mode 100644 index 0000000..a80ba4a --- /dev/null +++ b/gremlin/Makefile.am @@ -0,0 +1,44 @@ +### -*-makefile-*- +### +### Build script for the conversion gremlin +### +### (c) 2016 Mark Wooding +### + +###----- Licensing notice --------------------------------------------------- +### +### This file is part of the `autoys' audio tools collection. +### +### `autoys' is free software; you can redistribute it and/or modify +### it under the terms of the GNU General Public License as published by +### the Free Software Foundation; either version 2 of the License, or +### (at your option) any later version. +### +### `autoys' is distributed in the hope that it will be useful, +### but WITHOUT ANY WARRANTY; without even the implied warranty of +### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +### GNU General Public License for more details. +### +### You should have received a copy of the GNU General Public License +### along with `autoys'; if not, write to the Free Software Foundation, +### Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +include $(top_srcdir)/vars.am + +###-------------------------------------------------------------------------- +### The gremlin. + +if HAVE_PYTHON + +bin_SCRIPTS += gremlin +CLEANFILES += gremlin +EXTRA_DIST += gremlin.in + +gremlin: gremlin.in + $(SUBST) $(srcdir)/gremlin.in >$@.new $(SUBSTITUTIONS) && \ + chmod +x $@.new && mv $@.new $@ + + +endif + +###----- That's all, folks -------------------------------------------------- diff --git a/gremlin/gremlin b/gremlin/gremlin.in similarity index 99% rename from gremlin/gremlin rename to gremlin/gremlin.in index c9734d5..eded04f 100755 --- a/gremlin/gremlin +++ b/gremlin/gremlin.in @@ -1,4 +1,4 @@ -#! /usr/bin/python +#! @PYTHON@ ### ### Convert a directory tree of audio files ### @@ -63,7 +63,7 @@ import pyparsing as P ###-------------------------------------------------------------------------- ### Special initialization. -VERSION = '1.0.0~pre' +VERSION = '@VERSION@' ## GLib. G.threads_init() -- 2.11.0