setuptools, bdist_rpm und doc-files
Hallo, ich möchte gerne mit setuptools auch rpms generieren (funktioniert) und dabei einige Dateien als Dokumentation kennzeichnen (funktioniert nicht). Mein Hauptproblem derzeit ist, dass die Dokumentationsverzeichnisse nicht ins build-Verzeichnis kopiert werden, entsprechend fehlen die dann beim rpmbuild-Aufruf. Außerdem habe ich festgestellt, dass in der SPEC-Datei nur eine Quellenangabe enthalten ist, nämlich eine tar.gz-Datei. Diese beinhaltet aber nur das Python-Modul und nicht die Dokumentationsverzeichnisse. Irgendwie stehe ich auf dem Schlauch, aber eigentlich müsste das doch funktionieren und hoffe -- da ich Google offenbar nicht mit den richtigen Suchworten gefüttert habe -- auf eure Hilfe.. Ich verzichte auf das vollständige Posten von Konfigurationsdateien, mir würden zunächst ein paar Stichworte in die Richtung weiterhelfen. Vielen Dank Felix Schwarz
Felix Schwarz schrieb:
Irgendwie stehe ich auf dem Schlauch, aber eigentlich müsste das doch funktionieren und hoffe -- da ich Google offenbar nicht mit den richtigen Suchworten gefüttert habe -- auf eure Hilfe.. Ich verzichte auf das vollständige Posten von Konfigurationsdateien, mir würden zunächst ein paar Stichworte in die Richtung weiterhelfen.
Ohne deine setup.py ist es aber sehr schwer, dir zu helfen. Die erzeugte SPEC Datei wäre auch hilfreich. Chris
Christopher Arndt schrieb:
Ohne deine setup.py ist es aber sehr schwer, dir zu helfen.
Das sehe ich ein. Eigentlich verschicke ich nicht gerne Anhänge über Mailinglisten, aber diese hier sind so klein, dass selbst Modem-Nutzer wenig Probleme haben sollten. Mein Hauptproblem ist, dass ich mir die Funktionsweise von setup.py nicht so recht klar ist bzw. ich die richtige Vorgehensweise noch nicht gefunden habe. Was einfach ist: Ein paar Python-Module sollen in ein egg. Bauen eines RPMs mit einer SPEC-Datei. Was (für mich) kompliziert ist: Diese Python-Module haben auch noch Dokumentation und die soll natürlich bei bdist_rpm nach /usr/share/doc/<name> installiert werden. Mein Dateisystemlayout: root | |- texttemplate | | | |- __init__.py |- Documentation (Verzeichnis) |- Examples (Verzeichnis) Dieses Layout kann ich aber auch beliebig umstellen. Meine Frage: Wie bekomme ich setuptools dazu, Documentation und Examples in das build-Verzeichnis zu kopieren (dort findet sich derzeit nämlich nur das Python-Modul)? vielen Dank Felix [bdist_rpm] release = 1 packager = Felix Schwarz <felix.schwarz@web.de> doc_files = Documentation Examples
-------- Original-Nachricht -------- Datum: Tue, 19 Dec 2006 09:43:33 +0100 Von: Felix Schwarz <felix.schwarz@web.de> An: Christopher Arndt <chris.arndt@web.de> Betreff: Re: [Python-de] setuptools, bdist_rpm und doc-files
Christopher Arndt schrieb:
Ohne deine setup.py ist es aber sehr schwer, dir zu helfen.
Das sehe ich ein. Eigentlich verschicke ich nicht gerne Anhänge über Mailinglisten, aber diese hier sind so klein, dass selbst Modem-Nutzer wenig Probleme haben sollten.
Mein Hauptproblem ist, dass ich mir die Funktionsweise von setup.py nicht so recht klar ist bzw. ich die richtige Vorgehensweise noch nicht gefunden habe.
Was einfach ist: Ein paar Python-Module sollen in ein egg. Bauen eines RPMs mit einer SPEC-Datei.
Was (für mich) kompliziert ist: Diese Python-Module haben auch noch Dokumentation und die soll natürlich bei bdist_rpm nach /usr/share/doc/<name> installiert werden.
Mein Dateisystemlayout:
root | |- texttemplate | | | |- __init__.py |- Documentation (Verzeichnis) |- Examples (Verzeichnis)
Dieses Layout kann ich aber auch beliebig umstellen.
Meine Frage: Wie bekomme ich setuptools dazu, Documentation und Examples in das build-Verzeichnis zu kopieren (dort findet sich derzeit nämlich nur das Python-Modul)?
vielen Dank Felix
Siehe distutils-docu unter http://docs.python.org/dist/node13.html : Beispiel aus irgendeiner setup.py: setup(... data_files=[('bitmaps', ['bm/b1.gif', 'bm/b2.gif']), ('config', ['cfg/data.cfg']), ('/etc/init.d', ['init-script'])] ) wobei z.b. das Paar ('bitmaps', ['bm/b1.gif', 'bm/b2.gif']) nach "/usr/bitmaps" kopiert wird (Installationspfad des Systens + Verzeichnis bitmaps) während ('/etc/init.d', ['init-script'])nach "/etc/init.d/init-script" (absoluter Pfad + Datei). Joachim -- "Feel free" - 10 GB Mailbox, 100 FreeSMS/Monat ... Jetzt GMX TopMail testen: http://www.gmx.net/de/go/topmail
Felix Schwarz schrieb:
Christopher Arndt schrieb:
Ohne deine setup.py ist es aber sehr schwer, dir zu helfen.
Das sehe ich ein. Eigentlich verschicke ich nicht gerne Anhänge über Mailinglisten, aber diese hier sind so klein, dass selbst Modem-Nutzer wenig Probleme haben sollten.
Dazu verwenden die meisten heute sog. "pastebins", d.h. Webseiten, wo man code in ein Formular kopieren kann und dann eine URL erhält, die auf ein Seite mit dem gespeicherten, schön Syntax-kolorierten Code verweist. z.B. http://paste.pocoo.org/
Meine Frage: Wie bekomme ich setuptools dazu, Documentation und Examples in das build-Verzeichnis zu kopieren (dort findet sich derzeit nämlich nur das Python-Modul)?
Andere haben es ja schon gesagt, das sollte mir dem 'data_files' keyword für setup() gehen. Du verwendest 'include_package_data' und dies erfordert, dass die Datendateien entweder unter CVS/SVN stehen, oder in der MANIFEST.in Datei spezifiziert sind und funktioniert auch nur für Dateien innerhalb des Pythonpakets/Eggs. Such einfach mal nach den entspr. Schlüsselwörtern in der distutils Dokumentation oder lies das hier: http://peak.telecommunity.com/DevCenter/setuptools Chris P.S. Antworten bitte nur an die Liste, kein CC an mich.
participants (3)
-
"Joachim Thöne"
-
Christopher Arndt
-
Felix Schwarz