[systemd-devel] [PATCH] python-systemd: add version number

Steven Hiscocks steven-systemd at hiscocks.me.uk
Tue Apr 23 12:11:03 PDT 2013


From: Steven Hiscocks <steven at hiscocks.me.uk>

---
Hi,

I thought it would be useful to have a version number in the python systemd module.

I'm not overly familiar with Make, etc. but hopefully I've taken the right approach. :)

Thanks
Steven Hiscocks

 Makefile.am                                        | 3 +++
 src/python-systemd/{__init__.py => __init__.py.in} | 1 +
 2 files changed, 4 insertions(+)
 rename src/python-systemd/{__init__.py => __init__.py.in} (95%)

diff --git a/Makefile.am b/Makefile.am
index d594a3d..718e6f8 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -3868,6 +3868,9 @@ src/%.policy.in: src/%.policy.in.in Makefile
 %.rules: %.rules.in Makefile
 	$(SED_PROCESS)
 
+src/python-systemd/%: src/python-systemd/%.in
+	$(SED_PROCESS)
+
 %.sh: %.sh.in Makefile
 	$(SED_PROCESS)
 	$(AM_V_GEN)chmod +x $@
diff --git a/src/python-systemd/__init__.py b/src/python-systemd/__init__.py.in
similarity index 95%
rename from src/python-systemd/__init__.py
rename to src/python-systemd/__init__.py.in
index 0d56b99..7109f2a 100644
--- a/src/python-systemd/__init__.py
+++ b/src/python-systemd/__init__.py.in
@@ -16,3 +16,4 @@
 #
 #  You should have received a copy of the GNU Lesser General Public License
 #  along with systemd; If not, see <http://www.gnu.org/licenses/>.
+__version__ = '@PACKAGE_VERSION@'
-- 
1.8.2.1



More information about the systemd-devel mailing list