Yet another small bugfix to pypkgbuild.
[PyMotherless.git] / pkgbuild / ubuntu / python2 / pydeb-gen.py
blobe9c9019d6bc571e37730d2e0344744ddb7e51692
1 #!/usr/bin/env python2
3 '''
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the Revised BSD License.
7 This program is distributed in the hope that it will be useful,
8 but WITHOUT ANY WARRANTY; without even the implied warranty of
9 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 Revised BSD License for more details.
12 Copyright 2011-2016 Game Maker 2k - https://github.com/GameMaker2k
13 Copyright 2011-2016 Kazuki Przyborowski - https://github.com/KazukiPrzyborowski
15 $FileInfo: pydeb-gen.py - Last Update: 6/1/2016 Ver. 0.2.0 RC 1 - Author: cooldude2k $
16 '''
18 from __future__ import absolute_import, division, print_function, unicode_literals;
19 import re, os, sys, time, datetime, argparse, subprocess, json;
21 __version_info__ = (0, 2, 0, "rc1");
22 if(__version_info__[3]!=None):
23 __version__ = str(__version_info__[0])+"."+str(__version_info__[1])+"."+str(__version_info__[2])+"+"+str(__version_info__[3]);
24 if(__version_info__[3]==None):
25 __version__ = str(__version_info__[0])+"."+str(__version_info__[1])+"."+str(__version_info__[2]);
27 proname = "pydeb-gen";
28 prover = __version__;
29 profullname = proname+" "+prover;
30 buildsystem = "pybuild";
32 distupnametover = {'Warty': "4.10", 'Hoary': "5.04", 'Breezy': "5.10", 'Dapper': "6.06", 'Edgy': "6.10", 'Feisty': "7.04", 'Gutsy': "7.10", 'Hardy': "8.04", 'Intrepid': "8.10", 'Jaunty': "9.04", 'Karmic': "9.10", 'Lucid': "10.04", 'Maverick': "10.10", 'Natty': "11.04", 'Oneiric': "11.10", 'Precise': "12.04", 'Quantal': "12.10", 'Raring': "13.04", 'Saucy': "13.10", 'Trusty': "14.04", 'Utopic': "14.10", 'Vivid': "15.04", 'Wily': "15.10", 'Xenial': "16.04", 'Yakkety': "16.10"};
33 distnametover = {'warty': "4.10", 'hoary': "5.04", 'breezy': "5.10", 'dapper': "6.06", 'edgy': "6.10", 'feisty': "7.04", 'gutsy': "7.10", 'hardy': "8.04", 'intrepid': "8.10", 'jaunty': "9.04", 'karmic': "9.10", 'lucid': "10.04", 'maverick': "10.10", 'natty': "11.04", 'oneiric': "11.10", 'precise': "12.04", 'quantal': "12.10", 'raring': "13.04", 'saucy': "13.10", 'trusty': "14.04", 'utopic': "14.10", 'vivid': "15.04", 'wily': "15.10", 'xenial': "16.04", 'yakkety': "16.10"};
34 distnamelist = distnametover.keys();
35 distvertoname = {'4.10': "warty", '5.04': "hoary", '5.10': "breezy", '6.06': "dapper", '6.10': "edgy", '7.04': "feisty", '7.10': "gutsy", '8.04': "hardy", '8.10': "intrepid", '9.04': "jaunty", '9.10': "karmic", '10.04': "lucid", '10.10': "maverick", '11.04': "natty", '11.10': "oneiric", '12.04': "precise", '12.10': "quantal", '13.04': "raring", '13.10': "saucy", '14.04': "trusty", '14.10': "utopic", '15.04': "vivid", '15.10': "wily", '16.04': "xenial", '16.10': "yakkety"};
36 distvertoupname = {'4.10': "Warty", '5.04': "Hoary", '5.10': "Breezy", '6.06': "Dapper", '6.10': "Edgy", '7.04': "Feisty", '7.10': "Gutsy", '8.04': "Hardy", '8.10': "Intrepid", '9.04': "Jaunty", '9.10': "Karmic", '10.04': "Lucid", '10.10': "Maverick", '11.04': "Natty", '11.10': "Oneiric", '12.04': "Precise", '12.10': "Quantal", '13.04': "Raring", '13.10': "Saucy", '14.04': "Trusty", '14.10': "Utopic", '15.04': "Vivid", '15.10': "Wily", '16.04': "Xenial", '16.10': "Yakkety"};
37 distnamelistalt = distnametover.values();
38 distnametoveralt = {'Warty Warthog': "4.10", 'Hoary Hedgehog': "5.04", 'Breezy Badger': "5.10", 'Dapper Drake': "6.06", 'Edgy Eft': "6.10",
39 'Feisty Fawn': "7.04", 'Gutsy Gibbon': "7.10", 'Hardy Heron': "8.04", 'Intrepid Ibex': "8.10", 'Jaunty Jackalope': "9.04", 'Karmic Koala': "9.10", 'Lucid Lynx': "10.04", 'Maverick Meerkat': "10.10", 'Natty Narwhal': "11.04", 'Oneiric Ocelot': "11.10", 'Precise Pangolin': "12.04", 'Quantal Quetzal': "12.10", 'Raring Ringtail': "13.04", 'Saucy Salamander': "13.10", 'Trusty Tahr': "14.04", 'Utopic Unicorn': "14.10", 'Vivid Vervet': "15.04", 'Wily Werewolf': "15.10", 'Xenial Xerus': "16.04", 'Yakkety Yak': "16.10"};
40 distvertonamealt = {'4.10': "Warty Warthog", '5.04': "Hoary Hedgehog", '5.10': "Breezy Badger", '6.06': "Dapper Drake", '6.10': "Edgy Eft",
41 '7.04': "Feisty Fawn", '7.10': "Gutsy Gibbon", '8.04': "Hardy Heron", '8.10': "Intrepid Ibex", '9.04': "Jaunty Jackalope", '9.10': "Karmic Koala", '10.04': "Lucid Lynx", '10.10': "Maverick Meerkat", '11.04': "Natty Narwhal", '11.10': "Oneiric Ocelot", '12.04': "Precise Pangolin", '12.10': "Quantal Quetzal", '13.04': "Raring Ringtail", '13.10': "Saucy Salamander", '14.04': "Trusty Tahr", '14.10': "Utopic Unicorn", '15.04': "Vivid Vervet", '15.10': "Wily Werewolf", '16.04': "Xenial Xerus", '16.10': "Yakkety Yak"};
43 lmdistvertoname = {'1.0': "ada", '2.0': "barbara", '2.1': "bea", '2.2': "bianca", '3.0': "cassandra", '3.1': "celena", '4.0': "daryna", '5': "elyssa", '6': "felicia", '7': "gloria", '8': "helena", '9': "isadora", '10': "julia", '11': "katya", '12': "lisa", '13': "maya", '14': "nadia", '15': "olivia", '16': "petra", '17': "qiana", '17.1': "rebecca", '17.2': "rafaela", '17.3': "rosa", '18': "sarah"};
44 lmdistvertonamealt = {'1.0': "Ada", '2.0': "Barbara", '2.1': "Bea", '2.2': "Bianca", '3.0': "Cassandra", '3.1': "Celena", '4.0': "Daryna", '5': "Elyssa", '6': "Felicia", '7': "Gloria", '8': "Helena", '9': "Isadora", '10': "Julia", '11': "Katya", '12': "Lisa", '13': "Maya", '14': "Nadia", '15': "Olivia", '16': "Petra", '17': "Qiana", '17.1': "Rebecca", '17.2': "Rafaela", '17.3': "Rosa", '18': "Sarah"};
45 distlmnametouname = {"ada": "dapper", "barbara": "edgy", "bea": "edgy", "bianca": "edgy", "cassandra": "feisty", "celena": "feisty", "daryna": "gutsy", "elyssa": "hardy", "felicia": "intrepid", "gloria": "jaunty", "helena": "karmic", "isadora": "lucid", "julia": "maverick", "katya": "natty", "lisa": "oneiric", "maya": "precise", "nadia": "quantal", "olivia": "raring", "petra": "saucy", "qiana": "trusty", "rebecca": "trusty", "rafaela": "trusty", "rosa": "trusty", "sarah": "xenial"};
46 distlmnametounamealt = {"Ada": "Dapper", "Barbara": "Edgy", "Bea": "Edgy", "Bianca": "Edgy", "Cassandra": "Feisty", "Celena": "Feisty", "Daryna": "Gutsy", "Elyssa": "Hardy", "Felicia": "Intrepid", "Gloria": "Jaunty", "Helena": "Karmic", "Isadora": "Lucid", "Julia": "Maverick", "Katya": "Natty", "Lisa": "Oneiric", "Maya": "Precise", "Nadia": "Quantal", "Olivia": "Raring", "Petra": "Saucy", "Qiana": "Trusty", "Rebecca": "Trusty", "Rafaela": "Trusty", "Rosa": "Trusty", "Sarah": "Xenial"};
48 ubuntu_oldstable = "wily";
49 ubuntu_stable = "xenial";
50 ubuntu_testing = "yakkety";
51 linuxmint_ubuntu_stable = "xenial";
53 parser = argparse.ArgumentParser(conflict_handler = "resolve", add_help = True);
54 parser.add_argument("-v", "--version", action = "version", version = profullname);
55 parser.add_argument("-s", "--source", default = os.path.realpath(os.getcwd()), help = "source dir");
56 parser.add_argument("-g", "--getsource", action = "store_true", help = "get source dir");
57 parser.add_argument("-p", "--getparent", action = "store_true", help = "get parent dir");
58 parser.add_argument("-t", "--gettarname", action = "store_true", help = "get tar name");
59 parser.add_argument("-d", "--getdirname", action = "store_true", help = "get dir name");
60 parser.add_argument("-c", "--codename", default = ubuntu_stable, help = "enter release code name");
61 getargs = parser.parse_args();
62 getargs.source = os.path.realpath(getargs.source);
63 pkgsetuppy = os.path.realpath(getargs.source+os.path.sep+"setup.py");
64 pyexecpath = os.path.realpath(sys.executable);
65 if(not os.path.exists(getargs.source) or not os.path.isdir(getargs.source)):
66 raise Exception("Could not find directory.");
67 if(not os.path.exists(pkgsetuppy) or not os.path.isfile(pkgsetuppy)):
68 raise Exception("Could not find setup.py in directory.");
70 getargs.codename = distlmnametouname.get(getargs.codename, getargs.codename);
71 getargs.codename = distlmnametounamealt.get(getargs.codename, getargs.codename);
72 getargs.codename = getargs.codename.lower();
73 if(not getargs.codename in distnamelist):
74 print("Could not build for ubuntu "+getargs.distro+" codename.");
75 sys.exit();
77 pypkgenlistp = subprocess.Popen([pyexecpath, pkgsetuppy, "getversioninfo"], stdout=subprocess.PIPE, stderr=subprocess.PIPE);
78 pypkgenout, pypkgenerr = pypkgenlistp.communicate();
79 if(sys.version[0]=="3"):
80 pypkgenout = pypkgenout.decode('utf-8');
81 pymodule = json.loads(pypkgenout);
82 setuppy_verinfo = pymodule['versionlist'];
83 setuppy_author = pymodule['author'];
84 setuppy_authoremail = pymodule['authoremail'];
85 setuppy_maintainer = pymodule['maintainer'];
86 setuppy_maintaineremail = pymodule['maintaineremail'];
87 setuppy_description = pymodule['description'];
88 setuppy_license = pymodule['license'];
89 setuppy_keywords = pymodule['keywords'];
90 setuppy_url = pymodule['url'];
91 setuppy_downloadurl = pymodule['downloadurl'];
92 setuppy_longdescription = pymodule['longdescription'];
93 setuppy_platforms = pymodule['platforms'];
95 if(sys.version[0]=="2"):
96 pkgsource = "py2motherless";
97 if(sys.version[0]=="3"):
98 pkgsource = "py3motherless";
99 pkgupstreamname = "PyMotherless";
100 pkgveralt = str(setuppy_verinfo[0])+"."+str(setuppy_verinfo[1])+"."+str(setuppy_verinfo[2]);
101 pkgver = str(pkgveralt)+"rc"+str(setuppy_verinfo[4])+"~"+getargs.codename+str(distnametover.get(getargs.codename, "1").replace(".", ""));
102 pkgdistname = getargs.codename;
103 pkgurgency = "urgency=low";
104 pkgauthorname = setuppy_author;
105 pkgauthoremail = setuppy_authoremail;
106 pkgauthor = pkgauthorname+" <"+pkgauthoremail+">";
107 pkgmaintainername = setuppy_maintainer;
108 pkgmaintaineremail = setuppy_maintaineremail;
109 pkgmaintainer = pkgmaintainername+" <"+pkgmaintaineremail+">";
110 pkggiturl = "https://github.com/GameMaker2k/PyMotherless.git";
111 pkghomepage = setuppy_url;
112 pkgsection = "python";
113 pkgpriority = "optional";
114 if(sys.version[0]=="2"):
115 pkgbuilddepends = "python-setuptools, python-all, debhelper, dh-python, devscripts";
116 if(sys.version[0]=="3"):
117 pkgbuilddepends = "python3-setuptools, python3-all, debhelper, dh-python, devscripts";
118 if(getargs.codename=="lucid" or getargs.codename=="precise"):
119 if(sys.version[0]=="2"):
120 pkgbuilddepends = "python-setuptools, python-all, debhelper, dh-python, devscripts";
121 if(sys.version[0]=="3"):
122 pkgbuilddepends = "python3-setuptools, python3-all, debhelper, dh-python, devscripts";
123 pkgstandardsversion = "3.9.5";
124 if(sys.version[0]=="2"):
125 pkgpackage = "python-pymotherless";
126 pkgoldname = "python-motherless";
127 if(sys.version[0]=="3"):
128 pkgpackage = "python3-pymotherless";
129 pkgoldname = "python3-motherless";
130 pkgarchitecture = "all";
131 if(sys.version[0]=="2"):
132 pkgdepends = "${misc:Depends}, ${python:Depends}";
133 if(sys.version[0]=="3"):
134 pkgdepends = "${misc:Depends}, ${python3:Depends}";
135 pkgdescription = setuppy_description+"\n "+setuppy_longdescription;
136 pkgtzstr = time.strftime("%a, %d %b %Y %H:%M:%S %z");
138 if(getargs.getsource==True):
139 print(getargs.source);
140 sys.exit();
141 if(getargs.getparent==True):
142 print(os.path.realpath(os.path.dirname(getargs.source)));
143 sys.exit();
144 if(getargs.getdirname==True):
145 print(pkgsource+"_"+pkgveralt+".orig");
146 sys.exit();
147 if(getargs.gettarname==True):
148 print(pkgsource+"_"+pkgveralt+".orig.tar.gz");
149 sys.exit();
151 print("generating debian package build directory");
153 debpkg_debian_dir = os.path.realpath(getargs.source+os.path.sep+"debian");
154 print("creating directory "+debpkg_debian_dir);
155 if(not os.path.exists(debpkg_debian_dir)):
156 os.makedirs(debpkg_debian_dir);
157 os.chmod(debpkg_debian_dir, int("0755", 8));
159 debpkg_changelog_file = os.path.realpath(debpkg_debian_dir+os.path.sep+"changelog");
160 print("generating file "+debpkg_changelog_file);
161 debpkg_string_temp = pkgsource+" ("+pkgver+") "+pkgdistname+"; "+pkgurgency+"\n\n";
162 debpkg_string_temp += " * source package automatically created by "+profullname+"\n\n";
163 debpkg_string_temp += " -- "+pkgmaintainer+" "+pkgtzstr+"\n";
164 debpkg_file_temp = open(debpkg_changelog_file, "w");
165 debpkg_file_temp.write(debpkg_string_temp);
166 debpkg_file_temp.close();
167 os.chmod(debpkg_changelog_file, int("0644", 8));
169 debpkg_compat_file = os.path.realpath(debpkg_debian_dir+os.path.sep+"compat");
170 print("generating file "+debpkg_compat_file);
171 debpkg_string_temp = "9\n";
172 debpkg_file_temp = open(debpkg_compat_file, "w");
173 debpkg_file_temp.write(debpkg_string_temp);
174 debpkg_file_temp.close();
175 os.chmod(debpkg_compat_file, int("0644", 8));
177 debpkg_control_file = os.path.realpath(debpkg_debian_dir+os.path.sep+"control");
178 print("generating file "+debpkg_control_file);
179 debpkg_string_temp = "Source: "+pkgsource+"\n";
180 debpkg_string_temp += "Maintainer: "+pkgmaintainer+"\n";
181 debpkg_string_temp += "Homepage: "+pkghomepage+"\n";
182 debpkg_string_temp += "Vcs-Git: "+pkggiturl+"\n";
183 debpkg_string_temp += "Vcs-Browser: "+pkghomepage+"\n";
184 debpkg_string_temp += "Section: "+pkgsection+"\n";
185 debpkg_string_temp += "Priority: "+pkgpriority+"\n";
186 debpkg_string_temp += "Build-Depends: "+pkgbuilddepends+"\n";
187 debpkg_string_temp += "Standards-Version: "+pkgstandardsversion+"\n\n";
188 debpkg_string_temp += "Package: "+pkgpackage+"\n";
189 debpkg_string_temp += "Architecture: "+pkgarchitecture+"\n";
190 debpkg_string_temp += "Depends: "+pkgdepends+"\n";
191 debpkg_string_temp += "Replaces: "+pkgoldname+"\n";
192 debpkg_string_temp += "Description: "+pkgdescription+"\n";
193 debpkg_file_temp = open(debpkg_control_file, "w");
194 debpkg_file_temp.write(debpkg_string_temp);
195 debpkg_file_temp.close();
196 os.chmod(debpkg_control_file, int("0644", 8));
198 debpkg_copyright_file = os.path.realpath(debpkg_debian_dir+os.path.sep+"copyright");
199 print("generating file "+debpkg_copyright_file);
200 debpkg_string_temp = "Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/\n";
201 debpkg_string_temp += "Upstream-Name: "+pkgupstreamname+"\n";
202 debpkg_string_temp += "Source: "+pkghomepage+"\n\n";
203 debpkg_string_temp += "Files: *\n";
204 debpkg_string_temp += "Copyright: Copyright 2011-2016 "+pkgauthor+"\n";
205 debpkg_string_temp += "License: BSD\n\n";
206 debpkg_string_temp += "License: BSD\n";
207 debpkg_string_temp += " Revised BSD License\n\n";
208 debpkg_string_temp += "Copyright (C) 2011-2016 Game Maker 2k. \n";
209 debpkg_string_temp += "All rights reserved.\n\n";
210 debpkg_string_temp += "Redistribution and use in source and binary forms, with or without\n";
211 debpkg_string_temp += "modification, are permitted provided that the following conditions are met:\n\n";
212 debpkg_string_temp += " 1. Redistributions of source code must retain the above copyright notice,\n";
213 debpkg_string_temp += " this list of conditions and the following disclaimer.\n\n";
214 debpkg_string_temp += " 2. Redistributions in binary form must reproduce the above copyright \n";
215 debpkg_string_temp += " notice, this list of conditions and the following disclaimer in \n";
216 debpkg_string_temp += " the documentation and/or other materials provided with the distribution.\n\n";
217 debpkg_string_temp += " 3. Neither the name of Game Maker 2k nor the names of its contributors\n";
218 debpkg_string_temp += " may be used to endorse or promote products derived from this software\n";
219 debpkg_string_temp += " without specific prior written permission.\n\n";
220 debpkg_string_temp += "THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" \n";
221 debpkg_string_temp += "AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE \n";
222 debpkg_string_temp += "IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE \n";
223 debpkg_string_temp += "ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE \n";
224 debpkg_string_temp += "LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR \n";
225 debpkg_string_temp += "CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF \n";
226 debpkg_string_temp += "SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS \n";
227 debpkg_string_temp += "INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN \n";
228 debpkg_string_temp += "CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n";
229 debpkg_string_temp += "ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF \n";
230 debpkg_string_temp += "THE POSSIBILITY OF SUCH DAMAGE.\n\n";
231 debpkg_string_temp += "The views and conclusions contained in the software and documentation are those of the\n";
232 debpkg_string_temp += "authors and should not be interpreted as representing official policies, either expressed\n";
233 debpkg_string_temp += "or implied, of Game Maker 2k.\n";
234 debpkg_file_temp = open(debpkg_copyright_file, "w");
235 debpkg_file_temp.write(debpkg_string_temp);
236 debpkg_file_temp.close();
237 os.chmod(debpkg_copyright_file, int("0644", 8));
239 debpkg_rules_file = os.path.realpath(debpkg_debian_dir+os.path.sep+"rules");
240 print("generating file "+debpkg_rules_file);
241 if(sys.version[0]=="2" and (buildsystem=="python" or buildsystem=="python_distutils")):
242 debpkg_string_temp = "#!/usr/bin/make -f\n\n";
243 debpkg_string_temp += "# This file was automatically generated by "+profullname+" at\n";
244 debpkg_string_temp += "# "+pkgtzstr+"\n\n";
245 debpkg_string_temp += "%:\n";
246 debpkg_string_temp += " dh $@ --with python2 --buildsystem=python_distutils\n";
247 if(sys.version[0]=="3" and (buildsystem=="python" or buildsystem=="python_distutils")):
248 debpkg_string_temp = "#!/usr/bin/make -f\n\n";
249 debpkg_string_temp += "# This file was automatically generated by "+profullname+" at\n";
250 debpkg_string_temp += "# "+pkgtzstr+"\n\n";
251 debpkg_string_temp += "%:\n";
252 debpkg_string_temp += " dh $@ --with python3\n";
253 debpkg_string_temp += "override_dh_auto_build:\n";
254 debpkg_string_temp += " python3 setup.py build\n\n";
255 debpkg_string_temp += "override_dh_auto_test:\n";
256 debpkg_string_temp += " python3 setup.py test\n\n";
257 debpkg_string_temp += "override_dh_auto_install:\n";
258 debpkg_string_temp += " python3 setup.py install \\\n";
259 debpkg_string_temp += " --force --root=$(CURDIR)/debian/"+pkgpackage+" \\\n";
260 debpkg_string_temp += " --no-compile -O0 --install-layout=deb\n\n";
261 debpkg_string_temp += "override_dh_auto_clean:\n";
262 debpkg_string_temp += " python3 setup.py clean\n";
263 if(sys.version[0]=="2" and (buildsystem=="pybuild" or buildsystem=="python_build")):
264 debpkg_string_temp = "#!/usr/bin/make -f\n\n";
265 debpkg_string_temp += "# This file was automatically generated by "+profullname+" at\n";
266 debpkg_string_temp += "# "+pkgtzstr+"\n\n";
267 debpkg_string_temp += "%:\n";
268 debpkg_string_temp += " dh $@ --with python2 --buildsystem=pybuild\n";
269 if(sys.version[0]=="3" and (buildsystem=="pybuild" or buildsystem=="python_build")):
270 debpkg_string_temp = "#!/usr/bin/make -f\n\n";
271 debpkg_string_temp += "# This file was automatically generated by "+profullname+" at\n";
272 debpkg_string_temp += "# "+pkgtzstr+"\n\n";
273 debpkg_string_temp += "%:\n";
274 debpkg_string_temp += " dh $@ --with python3 --buildsystem=pybuild\n";
275 if((sys.version[0]=="2" or sys.version[0]=="3") and buildsystem=="cmake"):
276 debpkg_string_temp = "#!/usr/bin/make -f\n\n";
277 debpkg_string_temp += "# This file was automatically generated by "+profullname+" at\n";
278 debpkg_string_temp += "# "+pkgtzstr+"\n\n";
279 debpkg_string_temp += "%:\n";
280 debpkg_string_temp += " dh $@ --buildsystem=cmake --parallel\n";
281 debpkg_file_temp = open(debpkg_rules_file, "w");
282 debpkg_file_temp.write(debpkg_string_temp);
283 debpkg_file_temp.close();
284 os.chmod(debpkg_rules_file, int("0755", 8));
286 debpkg_source_dir = os.path.realpath(debpkg_debian_dir+os.path.sep+"source");
287 print("creating directory "+debpkg_source_dir);
288 if(not os.path.exists(debpkg_source_dir)):
289 os.makedirs(debpkg_source_dir);
290 os.chmod(debpkg_source_dir, int("0755", 8));
292 debpkg_format_file = os.path.realpath(debpkg_source_dir+os.path.sep+"format");
293 print("generating file "+debpkg_format_file);
294 debpkg_string_temp = "3.0 (native)\n";
295 debpkg_file_temp = open(debpkg_format_file, "w");
296 debpkg_file_temp.write(debpkg_string_temp);
297 debpkg_file_temp.close();
298 os.chmod(debpkg_format_file, int("0644", 8));
300 debpkg_options_file = os.path.realpath(debpkg_source_dir+os.path.sep+"options");
301 print("generating file "+debpkg_options_file);
302 debpkg_string_temp = "extend-diff-ignore=\"\\.egg-info\"\n";
303 debpkg_file_temp = open(debpkg_options_file, "w");
304 debpkg_file_temp.write(debpkg_string_temp);
305 debpkg_file_temp.close();
306 os.chmod(debpkg_options_file, int("0644", 8));