From dc11f1ea84d1f1200ea2442cb3010254841ca115 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Mon, 9 Jun 2014 14:06:28 +0200 Subject: [PATCH] Migrate to autotools. --- .gitignore | 22 +++++++++- Makefile | 74 --------------------------------- Makefile.am | 68 ++++++++++++++++++++++++++++++ autogen.sh | 4 ++ configure.ac | 68 ++++++++++++++++++++++++++++++ ddns.py => ddns | 0 m4/.gitignore | 6 +++ po/.gitignore | 4 ++ po/POTFILES.in | 2 + {ddns => src/ddns}/__init__.py | 0 src/ddns/__version__.py.in | 2 + {ddns => src/ddns}/errors.py | 0 {ddns => src/ddns}/i18n.py | 0 {ddns => src/ddns}/providers.py | 0 {ddns => src/ddns}/system.py | 0 15 files changed, 174 insertions(+), 76 deletions(-) delete mode 100644 Makefile create mode 100644 Makefile.am create mode 100755 autogen.sh create mode 100644 configure.ac rename ddns.py => ddns (100%) create mode 100644 m4/.gitignore create mode 100644 po/.gitignore create mode 100644 po/POTFILES.in rename {ddns => src/ddns}/__init__.py (100%) create mode 100644 src/ddns/__version__.py.in rename {ddns => src/ddns}/errors.py (100%) rename {ddns => src/ddns}/i18n.py (100%) rename {ddns => src/ddns}/providers.py (100%) rename {ddns => src/ddns}/system.py (100%) diff --git a/.gitignore b/.gitignore index 35ef121..dbbef86 100644 --- a/.gitignore +++ b/.gitignore @@ -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 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 index 0000000..66c6a15 --- /dev/null +++ b/Makefile.am @@ -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 . # +# # +############################################################################### + +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 index 0000000..077e109 --- /dev/null +++ b/autogen.sh @@ -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 index 0000000..fae19f0 --- /dev/null +++ b/configure.ac @@ -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 . # +# # +############################################################################### + +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 index 0000000..55eaa80 --- /dev/null +++ b/m4/.gitignore @@ -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 index 0000000..ee12156 --- /dev/null +++ b/po/.gitignore @@ -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 index 0000000..0d71735 --- /dev/null +++ b/po/POTFILES.in @@ -0,0 +1,2 @@ +src/ddns/__init__.py +src/ddns/system.py diff --git a/ddns/__init__.py b/src/ddns/__init__.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 index 0000000..0d7bddc --- /dev/null +++ b/src/ddns/__version__.py.in @@ -0,0 +1,2 @@ +# this file is autogenerated by the buildsystem +CLIENT_VERSION = "@PACKAGE_VERSION@" diff --git a/ddns/errors.py b/src/ddns/errors.py similarity index 100% rename from ddns/errors.py rename to src/ddns/errors.py diff --git a/ddns/i18n.py b/src/ddns/i18n.py similarity index 100% rename from ddns/i18n.py rename to src/ddns/i18n.py diff --git a/ddns/providers.py b/src/ddns/providers.py similarity index 100% rename from ddns/providers.py rename to src/ddns/providers.py diff --git a/ddns/system.py b/src/ddns/system.py similarity index 100% rename from ddns/system.py rename to src/ddns/system.py -- 2.39.2