emms-help
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[emms-help] Re: Packaging as RPM and Makefile


From: Tim Landscheidt
Subject: [emms-help] Re: Packaging as RPM and Makefile
Date: Sun, 06 Jun 2010 15:19:45 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)

I wrote:

> [...]
> Of course: automake :-). It's much better than reinventing
> the wheel yourself, is part of the FSF biosphere and allows
> the user every imaginable freedom to tweak everything.
> [...]

For a start, find attached a small patch against HEAD. It's
not fully done yet (e. g. the lisp files are installed into
/usr/share/emacs/site-lisp and the autoloads aren't generat-
ed), but works reasonably well.

Tim
diff --git a/.gitignore b/.gitignore
index 1590b35..77122c3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,9 +1,25 @@
 # Files that we ignore when using git.
 
-*~
 *.elc
+*.o
+*~
+.deps
 /ChangeLog
-/src/emms-print-metadata
-/doc/emms.info
 /doc/emms.html
-/lisp/emms-auto.el
+/doc/emms.info
+/src/emms-print-metadata
+Makefile
+Makefile.in
+aclocal.m4
+autom4te.cache
+config.log
+config.status
+configure
+depcomp
+doc/Makefile
+doc/Makefile.in
+doc/texinfo.tex
+elisp-comp
+install-sh
+lisp/elc-stamp
+missing
diff --git a/Makefile b/Makefile
deleted file mode 100644
index 7351f8a..0000000
--- a/Makefile
+++ /dev/null
@@ -1,84 +0,0 @@
-GZIP=gzip
-MAN1PAGES=emms-print-metadata.1
-DOCDIR=doc/
-LISPDIR=lisp
-SRCDIR=src
-
-ALLSOURCE=$(wildcard $(LISPDIR)/*.el)
-ALLCOMPILED=$(wildcard $(LISPDIR)/*.elc)
-
-DESTDIR=
-PREFIX=$(DESTDIR)/usr/local
-INFODIR=$(PREFIX)/info
-MAN1DIR=$(PREFIX)/share/man/man1
-SITELISP=$(PREFIX)/share/emacs/site-lisp/emms
-
-INSTALLINFO = /usr/sbin/install-info --info-dir=$(INFODIR)
-
-# The currently released version of EMMS
-VERSION=3.0
-
-.PHONY: all install lisp docs deb-install clean
-.PRECIOUS: %.elc
-all: lisp docs
-
-autoloads:
-       $(MAKE) -C $(LISPDIR) emms-auto.el
-
-lisp:
-       $(MAKE) -C $(LISPDIR)
-
-docs:
-       $(MAKE) -C $(DOCDIR)
-
-emms-print-metadata: $(SRCDIR)/emms-print-metadata.c
-       $(CC) -o $(SRCDIR)/$@ $< `taglib-config --cflags --libs` -ltag_c
-
-install:
-       test -d $(SITELISP) || mkdir -p $(SITELISP)
-       test -d $(INFODIR) || install -d $(INFODIR)
-       install -m 644 $(ALLSOURCE) $(SITELISP)
-       install -m 644 $(ALLCOMPILED) $(SITELISP)
-       install -m 0644 $(DOCDIR)emms.info $(INFODIR)/emms
-       for p in $(MAN1PAGES) ; do $(GZIP) -9c $$p > $(MAN1DIR)/$$p.gz ; done
-       $(INSTALLINFO) emms.info
-
-remove-info:
-       $(INSTALLINFO) --remove emms.info
-
-deb-install:
-       install -m 644 $(ALLSOURCE) $(SITELISP)
-
-ChangeLog:
-       darcs changes > $@
-
-clean:
-       -rm -f *~ $(DOCDIR)emms.info $(DOCDIR)emms.html emms-print-metadata
-       $(MAKE) -C $(LISPDIR) clean
-
-dist: autoloads clean
-       git archive --format=tar --prefix=emms-$(VERSION)/ HEAD | \
-         (cd .. && tar xf -)
-       rm -f ../emms-$(VERSION)/.gitignore
-       cp lisp/emms-autoloads.el ../emms-$(VERSION)/lisp
-       git log --pretty=medium > ../emms-$(VERSION)/ChangeLog
-
-release: dist
-       (cd .. && tar -czf emms-$(VERSION).tar.gz \
-           emms-$(VERSION) ; \
-         zip -r emms-$(VERSION).zip emms-$(VERSION) && \
-         gpg --detach emms-$(VERSION).tar.gz && \
-         gpg --detach emms-$(VERSION).zip)
-
-upload:
-       (cd .. && echo "Directory: emms" | gpg --clearsign > \
-           emms-$(VERSION).tar.gz.directive.asc && \
-         cp emms-$(VERSION).tar.gz.directive.asc \
-           emms-$(VERSION).zip.directive.asc && \
-         echo open ftp://ftp-upload.gnu.org > upload.lftp ; \
-         echo cd /incoming/ftp >> upload.lftp ; \
-         echo mput emms-$(VERSION).zip* >> upload.lftp ; \
-         echo mput emms-$(VERSION).tar.gz* >> upload.lftp ; \
-         echo close >> upload.lftp ; \
-         lftp -f upload.lftp ; \
-         rm -f upload.lftp)
diff --git a/Makefile.am b/Makefile.am
new file mode 100644
index 0000000..2ef79fd
--- /dev/null
+++ b/Makefile.am
@@ -0,0 +1,5 @@
+## Process this file with automake to produce Makefile.in
+
+SUBDIRS = doc lisp src
+dist_doc_DATA = README
+dist_man_MANS = emms-print-metadata.1
diff --git a/configure.ac b/configure.ac
new file mode 100644
index 0000000..230aad0
--- /dev/null
+++ b/configure.ac
@@ -0,0 +1,15 @@
+# Process this file with autoconf to produce a configure script.
+
+AC_PREREQ([2.63])
+AC_INIT([emms], [4.0HEAD], address@hidden)
+AM_INIT_AUTOMAKE([-Wall -Werror])
+AC_PROG_CC
+AM_PATH_LISPDIR
+AC_CHECK_LIB([tag_c], [taglib_file_new])
+AC_CHECK_HEADER([taglib/tag_c.h], [], [AC_MSG_ERROR([taglib/tag_c.h, please 
install the C taglib library, or put taglib/tag_c.h somewhere it can be 
found]);])
+AC_CHECK_HEADERS([stdlib.h])
+AC_CONFIG_FILES([Makefile
+                 doc/Makefile
+                 lisp/Makefile
+                 src/Makefile])
+AC_OUTPUT
diff --git a/doc/Makefile b/doc/Makefile
deleted file mode 100644
index cccdff3..0000000
--- a/doc/Makefile
+++ /dev/null
@@ -1,10 +0,0 @@
-# Don't delete if make is interrupted
-.PRECIOUS: %.info %.html
-
-all: emms.info
-
-%.info: %.texinfo
-       makeinfo --no-split $<
-
-%.html: %.texinfo
-       makeinfo --html --no-split $<
diff --git a/doc/Makefile.am b/doc/Makefile.am
new file mode 100644
index 0000000..e635e8d
--- /dev/null
+++ b/doc/Makefile.am
@@ -0,0 +1,4 @@
+## Process this file with automake to produce Makefile.in
+
+info_TEXINFOS = emms.texinfo
+emms_TEXINFOS = fdl.texi gpl.texi
diff --git a/lisp/Makefile b/lisp/Makefile
deleted file mode 100644
index e9e7d20..0000000
--- a/lisp/Makefile
+++ /dev/null
@@ -1,28 +0,0 @@
-EMACS=emacs
-SITEFLAG=--no-site-file
-ALLSOURCE=$(wildcard *.el)
-ALLCOMPILED=$(wildcard *.elc)
-SPECIAL=emms-auto.el emms-maint.el
-SOURCE=$(filter-out $(SPECIAL),$(ALLSOURCE))
-TARGET=$(patsubst %.el,%.elc,$(SOURCE))
-
-.PHONY: all clean
-.PRECIOUS: %.elc
-all: emms-auto.el $(TARGET)
-
-emms-auto.el: emms-auto.in $(SOURCE)
-       cp emms-auto.in emms-auto.el
-       -rm -f emms-auto.elc
-       @$(EMACS) -q $(SITEFLAG) -batch \
-               -l emms-maint.el \
-               -l emms-auto.el \
-               -f generate-autoloads \
-               $(shell pwd)/emms-auto.el .
-
-%.elc: %.el
-       @$(EMACS) -q $(SITEFLAG) -batch \
-               -l emms-maint.el \
-               -f batch-byte-compile $<
-
-clean:
-       -rm -f *~ *.elc emms-auto.el
diff --git a/lisp/Makefile.am b/lisp/Makefile.am
new file mode 100644
index 0000000..171713c
--- /dev/null
+++ b/lisp/Makefile.am
@@ -0,0 +1,17 @@
+## Process this file with automake to produce Makefile.in
+
+dist_lisp_LISP=emms-bookmarks.el emms-browser.el               \
+emms-cache.el emms-compat.el emms-cue.el emms-history.el       \
+emms-i18n.el emms-info-libtag.el emms-info-metaflac.el         \
+emms-info-mp3info.el emms-info-ogg.el emms-info-ogginfo.el     \
+emms-info.el emms-last-played.el emms-lastfm-client.el         \
+emms-lyrics.el emms-mark.el emms-metaplaylist-mode.el          \
+emms-mode-line-icon.el emms-mode-line.el emms-player-mpd.el    \
+emms-player-mpg321-remote.el emms-player-mplayer.el            \
+emms-player-simple.el emms-player-vlc.el emms-player-xine.el   \
+emms-playing-time.el emms-playlist-limit.el                    \
+emms-playlist-mode.el emms-playlist-sort.el emms-score.el      \
+emms-setup.el emms-source-file.el emms-source-playlist.el      \
+emms-stream-info.el emms-streams.el emms-tag-editor.el         \
+emms-url.el emms-volume-amixer.el emms-volume.el emms.el       \
+jack.el later-do.el ogg-comment.el tq.el
diff --git a/lisp/emms-auto.in b/lisp/emms-auto.in
deleted file mode 100644
index 78c71ef..0000000
--- a/lisp/emms-auto.in
+++ /dev/null
@@ -1,13 +0,0 @@
-;;; -*-emacs-lisp-*-
-
-(defvar generated-autoload-file)
-(defvar command-line-args-left)
-(defun generate-autoloads ()
-  (interactive)
-  (require 'autoload)
-  (setq generated-autoload-file (car command-line-args-left))
-  (setq command-line-args-left (cdr command-line-args-left))
-  (batch-update-autoloads))
-
-(provide 'emms-auto)
-;;; Generated autoloads follow (made by autoload.el).
diff --git a/lisp/emms-maint.el b/lisp/emms-maint.el
deleted file mode 100644
index f68f6bd..0000000
--- a/lisp/emms-maint.el
+++ /dev/null
@@ -1 +0,0 @@
-(add-to-list 'load-path ".")
diff --git a/src/Makefile.am b/src/Makefile.am
new file mode 100644
index 0000000..8735c99
--- /dev/null
+++ b/src/Makefile.am
@@ -0,0 +1,5 @@
+## Process this file with automake to produce Makefile.in
+
+bin_PROGRAMS = emms-print-metadata
+emms_print_metadata_SOURCES = emms-print-metadata.c
+emms_print_metadata_LDADD = -ltag_c
diff --git a/src/emms-print-metadata.c b/src/emms-print-metadata.c
index d04e759..fce19fd 100644
--- a/src/emms-print-metadata.c
+++ b/src/emms-print-metadata.c
@@ -22,7 +22,7 @@ Boston, MA 02110-1301, USA.  */
 
 #include <stdlib.h>
 #include <stdio.h>
-#include <tag_c.h>
+#include <taglib/tag_c.h>
 
 int
 main (int argc, char **argv)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]