Migrate to autotools.
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 9 Jun 2014 12:06:28 +0000 (14:06 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 9 Jun 2014 12:06:28 +0000 (14:06 +0200)
15 files changed:
.gitignore
Makefile [deleted file]
Makefile.am [new file with mode: 0644]
autogen.sh [new file with mode: 0755]
configure.ac [new file with mode: 0644]
ddns [moved from ddns.py with 100% similarity]
m4/.gitignore [new file with mode: 0644]
po/.gitignore [new file with mode: 0644]
po/POTFILES.in [new file with mode: 0644]
src/ddns/__init__.py [moved from ddns/__init__.py with 100% similarity]
src/ddns/__version__.py.in [new file with mode: 0644]
src/ddns/errors.py [moved from ddns/errors.py with 100% similarity]
src/ddns/i18n.py [moved from ddns/i18n.py with 100% similarity]
src/ddns/providers.py [moved from ddns/providers.py with 100% similarity]
src/ddns/system.py [moved from ddns/system.py with 100% similarity]

index 35ef121..dbbef86 100644 (file)
@@ -1,3 +1,21 @@
-*.mo
+/Makefile
+/build-aux
+/missing
+/src/ddns/__version__.py
+/tmp
 *.py[co]
-ddns/__version__.py
+/*.tar.bz2
+/*.tar.gz
+/*.tar.xz
+*.log
+*.cache
+*.gmo
+*.mo
+*~
+Makefile.in
+aclocal.m4
+config.log
+config.status
+configure
+install-sh
+stamp-*
diff --git a/Makefile b/Makefile
deleted file mode 100644 (file)
index 6197de6..0000000
--- a/Makefile
+++ /dev/null
@@ -1,74 +0,0 @@
-
-PACKAGE_NAME    = ddns
-PACKAGE_VERSION = 0.01
-
-DESTDIR    =
-PREFIX     = /usr
-SYSCONFDIR = /etc
-BINDIR     = $(PREFIX)/bin
-LIBDIR     = $(PREFIX)/lib
-LOCALEDIR  = $(PREFIX)/share/locale
-
-# Get the version and configuration of the python interpreter.
-PYTHON_VERSION = $(shell python -c "import platform; print '.'.join(platform.python_version_tuple()[:2])")
-ifeq "$(PYTHON_VERSION)" ""
-  $(error Could not determine the version of the python interpreter.)
-endif
-PYTHON_DIR = $(LIBDIR)/python$(PYTHON_VERSION)/site-packages/ddns
-
-VERSION_FILE = ddns/__version__.py
-
-###
-# Translation stuff
-###
-# A list of all files that need translation
-TRANSLATION_FILES = $(wildcard ddns/*.py) ddns.py
-
-POT_FILE = po/$(PACKAGE_NAME).pot
-PO_FILES = $(wildcard po/*.po)
-MO_FILES = $(patsubst %.po,%.mo,$(PO_FILES))
-
-################################################################################
-
-all: $(POT_FILE) $(MO_FILES)
-       @: # Do nothing else.
-
-$(VERSION_FILE): Makefile
-       echo "# this file is autogenerated by the build system" > $(VERSION_FILE)
-       echo "CLIENT_VERSION = \"$(PACKAGE_VERSION)\"" >> $(VERSION_FILE)
-
-install: $(VERSION_FILE) $(MO_FILES)
-       # Install the main command.
-       -mkdir -pv $(DESTDIR)$(BINDIR)
-       install -v -m 755 ddns.py $(DESTDIR)$(BINDIR)/ddns
-
-       # Install python module.
-       -mkdir -pv $(DESTDIR)$(PYTHON_DIR)
-       install -v -m 644 ddns/*.py $(DESTDIR)$(PYTHON_DIR)
-
-       # Install the example configuration file.
-       -mkdir -pv $(DESTDIR)$(SYSCONFDIR)
-       install -v -m 640 ddns.conf $(DESTDIR)$(SYSCONFDIR)/ddns.conf
-
-       # Install translation files.
-       -mkdir -pv $(DESTDIR)$(LOCALEDIR)
-       for file in $(MO_FILES); do \
-               lang=$${file/.mo/}; \
-               mkdir -pv $(DESTDIR)$(LOCALEDIR)/$${lang}/LC_MESSAGES; \
-               install -v -m 644 $${file} \
-                       $(DESTDIR)$(LOCALEDIR)/$${lang}/LC_MESSAGES/$(PACKAGE_NAME).mo; \
-       done
-
-# Cleanup temporary files.
-clean:
-       rm -f $(VERSION_FILE)
-       rm -f $(MO_FILES)
-
-# Translation stuff.
-$(POT_FILE): $(TRANSLATION_FILES) Makefile
-       xgettext --language python -d $(PACKAGE_NAME) -k_ -kN_ \
-                -o $@ --add-comments --from-code=UTF-8 $^
-
-# Compile gettext dictionaries from translation files.
-%.mo: %.po $(POT_FILE)
-       msgfmt -o $@ $<
diff --git a/Makefile.am b/Makefile.am
new file mode 100644 (file)
index 0000000..66c6a15
--- /dev/null
@@ -0,0 +1,68 @@
+###############################################################################
+#                                                                             #
+# Pakfire - The IPFire package management system                              #
+# Copyright (C) 2013 Pakfire development team                                 #
+#                                                                             #
+# This program 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 3 of the License, or           #
+# (at your option) any later version.                                         #
+#                                                                             #
+# This program 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 this program.  If not, see <http://www.gnu.org/licenses/>.       #
+#                                                                             #
+###############################################################################
+
+ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
+AM_MAKEFLAGS = --no-print-directory
+AUTOMAKE_OPTIONS = color-tests
+
+# remove target it the command fails
+.DELETE_ON_ERROR:
+
+# keep itermediate files
+.SECONDARY:
+
+SUBDIRS = . po
+
+pythondir  = $(pyexecdir)
+
+configsdir = $(sysconfdir)/ddns
+
+CLEANFILES =
+DISTCLEANFILES =
+EXTRA_DIST =
+
+@INTLTOOL_POLICY_RULE@
+
+.PHONY: update-po
+update-po:
+       $(MAKE) -C po update-po
+
+# ------------------------------------------------------------------------------
+
+dist_doc_DATA = \
+       COPYING
+
+# ------------------------------------------------------------------------------
+
+dist_bin_SCRIPTS = \
+       ddns
+
+dist_configs_DATA = \
+       ddns.conf
+
+ddns_PYTHON = \
+       src/ddns/__init__.py \
+       src/ddns/__version__.py \
+       src/ddns/errors.py \
+       src/ddns/i18n.py \
+       src/ddns/providers.py \
+       src/ddns/system.py
+
+ddnsdir = $(pythondir)/ddns
diff --git a/autogen.sh b/autogen.sh
new file mode 100755 (executable)
index 0000000..077e109
--- /dev/null
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+intltoolize --force --automake
+autoreconf --force --install --symlink
diff --git a/configure.ac b/configure.ac
new file mode 100644 (file)
index 0000000..fae19f0
--- /dev/null
@@ -0,0 +1,68 @@
+###############################################################################
+#                                                                             #
+# Pakfire - The IPFire package management system                              #
+# Copyright (C) 2013 Pakfire development team                                 #
+#                                                                             #
+# This program 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 3 of the License, or           #
+# (at your option) any later version.                                         #
+#                                                                             #
+# This program 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 this program.  If not, see <http://www.gnu.org/licenses/>.       #
+#                                                                             #
+###############################################################################
+
+AC_PREREQ([2.64])
+
+AC_INIT([ddns],
+       [0.01],
+       [info@ipfire.org],
+       [ddns],
+       [http://git.ipfire.org/?p=oddments/ddns.git;a=summary])
+
+AC_CONFIG_MACRO_DIR([m4])
+AC_CONFIG_AUX_DIR([build-aux])
+
+AC_PREFIX_DEFAULT([/usr])
+
+AM_INIT_AUTOMAKE([
+       foreign
+       1.11
+       -Wall
+       -Wno-portability
+       silent-rules
+       tar-pax
+       subdir-objects
+])
+AM_SILENT_RULES([yes])
+
+IT_PROG_INTLTOOL([0.40.0])
+
+GETTEXT_PACKAGE=ddns
+AC_SUBST(GETTEXT_PACKAGE)
+
+AC_PROG_LN_S
+AC_PROG_MKDIR_P
+
+# Python
+AM_PATH_PYTHON([2.7])
+
+save_LIBS="$LIBS"
+
+AC_CONFIG_FILES([
+       Makefile
+       po/Makefile.in
+       src/ddns/__version__.py
+])
+
+AC_OUTPUT
+AC_MSG_RESULT([
+       $PACKAGE_NAME $VERSION
+
+])
diff --git a/ddns.py b/ddns
similarity index 100%
rename from ddns.py
rename to ddns
diff --git a/m4/.gitignore b/m4/.gitignore
new file mode 100644 (file)
index 0000000..55eaa80
--- /dev/null
@@ -0,0 +1,6 @@
+intltool.m4
+libtool.m4
+ltoptions.m4
+ltsugar.m4
+ltversion.m4
+lt~obsolete.m4
diff --git a/po/.gitignore b/po/.gitignore
new file mode 100644 (file)
index 0000000..ee12156
--- /dev/null
@@ -0,0 +1,4 @@
+POTFILES
+Makefile.in.in
+.intltool-merge-cache
+Makefile
diff --git a/po/POTFILES.in b/po/POTFILES.in
new file mode 100644 (file)
index 0000000..0d71735
--- /dev/null
@@ -0,0 +1,2 @@
+src/ddns/__init__.py
+src/ddns/system.py
similarity index 100%
rename from ddns/__init__.py
rename to src/ddns/__init__.py
diff --git a/src/ddns/__version__.py.in b/src/ddns/__version__.py.in
new file mode 100644 (file)
index 0000000..0d7bddc
--- /dev/null
@@ -0,0 +1,2 @@
+# this file is autogenerated by the buildsystem
+CLIENT_VERSION = "@PACKAGE_VERSION@"
similarity index 100%
rename from ddns/errors.py
rename to src/ddns/errors.py
similarity index 100%
rename from ddns/i18n.py
rename to src/ddns/i18n.py
similarity index 100%
rename from ddns/providers.py
rename to src/ddns/providers.py
similarity index 100%
rename from ddns/system.py
rename to src/ddns/system.py