[Fedora-livecd-list] [PATCH] Modified Makefile and livecd-tools.spec to use tools/ and imgcreate.

Tan Swee Heng thesweeheng at gmail.com
Wed Dec 12 18:17:24 UTC 2007


Hi, I am new to this list so pardon me if this is the wrong place for
patches or if I am not doing this the "right way". :-)

I have problems doing "make install" and "rpmbuild" using the current
git tree. Turns out that Makefile was using creator/ directory when
livecd-creator and image-creator are both now in tools/. Also both
Makefile and livecd-tools.spec seemed to have omitted the imgcreate
Python module. So below is my patch to address these issues. It works
for me. Hopefully it is of use to others too.

Regards,
Swee Heng

---
Changed Makefile to use tools/ directory instead of creator/.
Changed both Makefile and livecd-tools.spec to handle imgcreate.

Signed-off-by: Tan Swee Heng <thesweeheng at gmail.com>
---
 Makefile          |   14 ++++++++++++--
 livecd-tools.spec |    8 ++++++++
 2 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index 3d86b29..393d6db 100644
--- a/Makefile
+++ b/Makefile
@@ -6,11 +6,18 @@ INSTALL_PROGRAM = ${INSTALL}
 INSTALL_DATA = ${INSTALL} -m 644
 INSTALL_SCRIPT = ${INSTALL_PROGRAM}

+INSTALL_PYTHON = ${INSTALL} -m 644
+define COMPILE_PYTHON
+       python -c "import compileall as c; c.compile_dir('$(1)', force=1)"
+       python -O -c "import compileall as c; c.compile_dir('$(1)', force=1)"
+endef
+PYTHONDIR := $(shell python -c "import distutils.sysconfig as d;
print d.get_python_lib()")
+
 all:

 install:
-       $(INSTALL_PROGRAM) -D creator/livecd-creator
$(DESTDIR)/usr/bin/livecd-creator
-       $(INSTALL_PROGRAM) -D creator/image-creator
$(DESTDIR)/usr/bin/image-creator
+       $(INSTALL_PROGRAM) -D tools/livecd-creator
$(DESTDIR)/usr/bin/livecd-creator
+       $(INSTALL_PROGRAM) -D tools/image-creator
$(DESTDIR)/usr/bin/image-creator
        $(INSTALL_PROGRAM) -D tools/livecd-iso-to-disk.sh
$(DESTDIR)/usr/bin/livecd-iso-to-disk
        $(INSTALL_PROGRAM) -D tools/mayflower
$(DESTDIR)/usr/lib/livecd-creator/mayflower
        $(INSTALL_DATA) -D AUTHORS
$(DESTDIR)/usr/share/doc/livecd-tools-$(VERSION)/AUTHORS
@@ -19,6 +26,9 @@ install:
        $(INSTALL_DATA) -D HACKING
$(DESTDIR)/usr/share/doc/livecd-tools-$(VERSION)/HACKING
        mkdir -p $(DESTDIR)/usr/share/livecd-tools/
        $(INSTALL_DATA) -D config/*.ks $(DESTDIR)/usr/share/livecd-tools/
+       mkdir -p $(DESTDIR)/$(PYTHONDIR)/imgcreate
+       $(INSTALL_PYTHON) -D imgcreate/*.py $(DESTDIR)/$(PYTHONDIR)/imgcreate/
+       $(call COMPILE_PYTHON,$(DESTDIR)/$(PYTHONDIR)/imgcreate)

 uninstall:
        rm -f $(DESTDIR)/usr/bin/livecd-creator
diff --git a/livecd-tools.spec b/livecd-tools.spec
index 542283d..9b9d4f5 100644
--- a/livecd-tools.spec
+++ b/livecd-tools.spec
@@ -1,3 +1,5 @@
+%{!?python_sitelib: %define python_sitelib %(%{__python} -c "import
distutils.sysconfig as d; print d.get_python_lib()")}
+
 %define debug_package %{nil}

 Summary: Tools for building live CD's
@@ -24,6 +26,7 @@ Requires: syslinux
 %ifarch ppc ppc64
 Requires: yaboot
 %endif
+BuildRequires: python


 %description
@@ -53,6 +56,11 @@ rm -rf $RPM_BUILD_ROOT
 /usr/lib/livecd-creator/mayflower
 %dir %{_datadir}/livecd-tools
 %{_datadir}/livecd-tools/*
+%{_bindir}/image-creator
+%dir %{python_sitelib}/imgcreate
+%{python_sitelib}/imgcreate/*.py
+%{python_sitelib}/imgcreate/*.pyo
+%{python_sitelib}/imgcreate/*.pyc

 %changelog
 * Mon Oct 29 2007 Jeremy Katz <katzj at redhat.com> - 013-1
--
1.5.3.3




More information about the Fedora-livecd-list mailing list