debmake-4.2.2/0000775000175000017500000000000012563440271013407 5ustar osamuosamu00000000000000debmake-4.2.2/extra2doc/0000775000175000017500000000000012563440271015302 5ustar osamuosamu00000000000000debmake-4.2.2/extra2doc/package.install0000664000175000017500000000021612563440146020265 0ustar osamuosamu00000000000000# You must remove unused comment lines for the released package. ### Candidates as below and see dh_install(1). ###usr/share/doc/@BINPACKAGE@ debmake-4.2.2/extra2doc/package.docs0000664000175000017500000000013412563440146017546 0ustar osamuosamu00000000000000# You must remove unused comment lines for the released package. ### See dh_installdocs(1) debmake-4.2.2/extra2doc/package.doc-base0000664000175000017500000000013312563440146020272 0ustar osamuosamu00000000000000# You must remove unused comment lines for the released package. ### See dh_installdocs(1) debmake-4.2.2/extra2doc/package.examples0000664000175000017500000000014012563440146020431 0ustar osamuosamu00000000000000# You must remove unused comment lines for the released package. ### See dh_installexamples(1) debmake-4.2.2/extra2doc/package.manpages0000664000175000017500000000014012563440146020406 0ustar osamuosamu00000000000000# You must remove unused comment lines for the released package. ### See dh_installmanpages(1) debmake-4.2.2/extra2doc/package.info0000664000175000017500000000013412563440146017551 0ustar osamuosamu00000000000000# You must remove unused comment lines for the released package. ### See dh_installinfo(1) debmake-4.2.2/scripts/0000775000175000017500000000000012563440271015076 5ustar osamuosamu00000000000000debmake-4.2.2/scripts/debmake0000775000175000017500000000223012563440146016412 0ustar osamuosamu00000000000000#!/usr/bin/python3 # vim:se tw=0 sts=4 ts=4 et si: """ Copyright © 2014 Osamu Aoki Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. """ import debmake if __name__ == '__main__': debmake.main() debmake-4.2.2/README0000664000175000017500000000604312563440146014273 0ustar osamuosamu00000000000000README for debmake ------------------ This is the new debmake program written in Python. This provides convenient command to make a Debian package from the upstream VCS/tarball/source-tree. See the HTML files in the debmake-doc package for the introductory guide. LICENSE for the entire source ----------------------------- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. HISTORY ------- The author thanks previous efforts on this topic (GPL): * debmake: 1996-1997 Christoph Lameter 1997-2006 Santiago Vila command: deb-make, version up to 3.8 (shell script) * dh-make: 1998-2012 Craig Small command: dh_make (perl script) FILES outside of extra/ ----------------------- Copyright © 2013-2014 Osamu Aoki FILES in extra/ --------------- Copyright © Jim Van Zandt Copyright © Santiago Vila Copyright © Dirk Eddelbuettel Copyright © Nils Naumann Copyright © Jim Van Zandt Copyright © 2013 Osamu Aoki These are originally generated by the output of the dh_make command. The output has been edited by Osamu Aoki to fit into this package. The dh-make package came with the GPL license with the following permissive exception: As a special exception, when the template files are copied by dh-make into dh-make output files, you may use those output files without restriction. This special exception was added by Craig Small in version 0.37 of dh-make. Since this exception is permissive, I am releasing the entire source package under permissive MIT license as above. How to install -------------- Debian: $ sudo apt-get install debmake Non-Debian POSIX system with Python3 (user: ~/.local) $ python3 setup.py install --user ($PATH should include ~/.local/bin ) Non-Debian POSIX system with Python3 (system: /usr/local) $ sudo python3 setup.py install -- Osamu Aoki Sun, 14 Dec 2014 16:44:28 +0000 debmake-4.2.2/extra4/0000775000175000017500000000000012563440271014616 5ustar osamuosamu00000000000000debmake-4.2.2/extra4/LGPL-2.1+0000664000175000017500000000175312563440146015657 0ustar osamuosamu00000000000000Files: * Copyright: License: LGPL-2.1+ Files: debian/* Copyright: @YEAR@ @FULLNAME@ <@EMAIL@> License: LGPL-2.1+ License: LGPL-2.1+ This package is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. . This package 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 Lesser 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 . . On Debian systems, the complete text of the GNU Lesser General Public License can be found in "/usr/share/common-licenses/LGPL-2.1". debmake-4.2.2/extra4/GPL-3.0+0000664000175000017500000000173212563440146015540 0ustar osamuosamu00000000000000Files: * Copyright: License: GPL-3.0+ Files: debian/* Copyright: @YEAR@ @FULLNAME@ <@EMAIL@> License: GPL-3.0+ License: GPL-3.0+ 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 package 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 . . On Debian systems, the complete text of the GNU General Public License version 3 can be found in "/usr/share/common-licenses/GPL-3". debmake-4.2.2/extra4/Apache-2.00000664000175000017500000000157712563440146016232 0ustar osamuosamu00000000000000Files: * Copyright: License: Apache-2.0 Files: debian/* Copyright: @YEAR@ @FULLNAME@ <@EMAIL@> License: Apache-2.0 License: Apache-2.0 Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at . http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. . On Debian systems, the complete text of the Apache version 2.0 license can be found in "/usr/share/common-licenses/Apache-2.0". debmake-4.2.2/extra4/BSD-3-Clause0000664000175000017500000000323712563440146016531 0ustar osamuosamu00000000000000Files: * Copyright: License: BSD-3-Clause Files: debian/* Copyright: @YEAR@ @FULLNAME@ <@EMAIL@> License: BSD-3-Clause License: BSD-3-Clause Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the University nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. . THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. debmake-4.2.2/extra4/GPL-2.0+0000664000175000017500000000173112563440146015536 0ustar osamuosamu00000000000000Files: * Copyright: License: GPL-2.0+ Files: debian/* Copyright: @YEAR@ @FULLNAME@ <@EMAIL@> License: GPL-2.0+ License: GPL-2.0+ This package 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 2 of the License, or (at your option) any later version. . This package 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 . On Debian systems, the complete text of the GNU General Public License version 2 can be found in "/usr/share/common-licenses/GPL-2". debmake-4.2.2/extra4/MIT0000664000175000017500000000234412563440146015176 0ustar osamuosamu00000000000000Files: * Copyright: License: MIT Files: debian/* Copyright: @YEAR@ @FULLNAME@ <@EMAIL@> License: MIT License: MIT Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: . The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. . THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. debmake-4.2.2/extra4/Artistic-1.00000664000175000017500000000126212563440146016621 0ustar osamuosamu00000000000000Files: * Copyright: License: Artistic Files: debian/* Copyright: @YEAR@ @FULLNAME@ <@EMAIL@> License: Artistic-1.0 License: Artistic-1.0 This program is free software; you can redistribute it and/or modify it under the terms of the "Artistic License" which comes with Debian. . THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. . On Debian systems, the complete text of the Artistic License can be found in "/usr/share/common-licenses/Artistic". debmake-4.2.2/extra4/LGPL-3.0+0000664000175000017500000000175112563440146015655 0ustar osamuosamu00000000000000Files: * Copyright: License: LGPL-3.0+ Files: debian/* Copyright: @YEAR@ @FULLNAME@ <@EMAIL@> License: LGPL-3.0+ License: LGPL-3.0+ This package is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. . This package 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 Lesser 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 . . On Debian systems, the complete text of the GNU Lesser General Public License can be found in "/usr/share/common-licenses/LGPL-3". debmake-4.2.2/extra0desc_long/0000775000175000017500000000000012563440271016470 5ustar osamuosamu00000000000000debmake-4.2.2/extra0desc_long/doc0000664000175000017500000000006012563440146017155 0ustar osamuosamu00000000000000 This package contains the documentation files. debmake-4.2.2/extra0desc_long/_long_tutorial0000664000175000017500000000220112563440146021430 0ustar osamuosamu00000000000000 This Debian binary package was auto-generated by the debmake(1) command provided by the debmake package. . ===== This comes from the unmodified template file ===== . Please edit this template file (debian/control) and other package files (debian/*) to make them meet all the requirements of the Debian Policy before uploading this package to the Debian archive. . See * http://www.debian.org/doc/manuals/maint-guide/dreq.en.html#control * http://www.debian.org/doc/manuals/developers-reference/best-pkging-practices.html#bpp-debian-control . The synopsis description at the top should be about 60 characters and written as a phrase. No extra capital letters or a final period. No articles — "a", "an", or "the". . The package description for general-purpose applications should be written for a less technical user. This means that we should avoid jargon. GNOME or KDE is fine but GTK+ is probably not. . Use the canonical forms of words: * Use X Window System, X11, or X; not X Windows, X-Windows, or X Window. * Use GTK+, not GTK or gtk. * Use GNOME, not Gnome. * Use PostScript, not Postscript or postscript. debmake-4.2.2/extra0desc_long/data0000664000175000017500000000007212563440146017324 0ustar osamuosamu00000000000000 This package contains the architecture independent data. debmake-4.2.2/extra0desc_long/ruby0000664000175000017500000000005112563440146017371 0ustar osamuosamu00000000000000 This package contains the ruby program. debmake-4.2.2/extra0desc_long/python0000664000175000017500000000005312563440146017733 0ustar osamuosamu00000000000000 This package contains the python program. debmake-4.2.2/extra0desc_long/script0000664000175000017500000000005312563440146017716 0ustar osamuosamu00000000000000 This package contains the script program. debmake-4.2.2/extra0desc_long/dev0000664000175000017500000000005612563440146017173 0ustar osamuosamu00000000000000 This package contains the development files. debmake-4.2.2/extra0desc_long/perl0000664000175000017500000000005112563440146017352 0ustar osamuosamu00000000000000 This package contains the perl program. debmake-4.2.2/extra0desc_long/dbg0000664000175000017500000000005612563440146017151 0ustar osamuosamu00000000000000 This package contains the debugging symbols. debmake-4.2.2/extra0desc_long/python30000664000175000017500000000005412563440146020017 0ustar osamuosamu00000000000000 This package contains the python3 program. debmake-4.2.2/extra0desc_long/bin0000664000175000017500000000006712563440146017167 0ustar osamuosamu00000000000000 This package contains the compiled binary executable. debmake-4.2.2/extra0desc_long/_long0000664000175000017500000000015312563440146017511 0ustar osamuosamu00000000000000 This Debian binary package was auto-generated by the debmake(1) command provided by the debmake package. debmake-4.2.2/extra0desc_long/lib0000664000175000017500000000005312563440146017160 0ustar osamuosamu00000000000000 This package contains the shared library. debmake-4.2.2/extra2bin/0000775000175000017500000000000012563440271015305 5ustar osamuosamu00000000000000debmake-4.2.2/extra2bin/package.install0000664000175000017500000000026712563440146020276 0ustar osamuosamu00000000000000# You must remove unused comment lines for the released package. ### Candidates as below and see dh_install(1). ###bin ###etc ###sbin ###usr/bin ###usr/sbin ###usr/share/@BINPACKAGE@ debmake-4.2.2/extra2lib/0000775000175000017500000000000012563440271015303 5ustar osamuosamu00000000000000debmake-4.2.2/extra2lib/package.install0000664000175000017500000000020412563440146020263 0ustar osamuosamu00000000000000# You must remove unused comment lines for the released package. ### Candidates as below and see dh_install(1). ###usr/lib/*/*.so.* debmake-4.2.2/extra2lib/package.symbols0000664000175000017500000000034312563440146020311 0ustar osamuosamu00000000000000# You must remove unused comment lines for the released package. ### See dh_makeshlibs(1) ### For C library, please fill this file with pertinent data. ### For C++ library, you may remove this to use shlibs mechanism instead. debmake-4.2.2/extra2data/0000775000175000017500000000000012563440271015446 5ustar osamuosamu00000000000000debmake-4.2.2/extra2data/package.install0000664000175000017500000000022112563440146020425 0ustar osamuosamu00000000000000# You must remove unused comment lines for the released package. ### Candidates as below and see dh_install(1). ###etc ###usr/share/@BINPACKAGE@ debmake-4.2.2/extra1patches/0000775000175000017500000000000012563440271016163 5ustar osamuosamu00000000000000debmake-4.2.2/extra1patches/series0000664000175000017500000000054712563440146017407 0ustar osamuosamu00000000000000# You must remove unused comment lines for the released package. ### ### The patch files of the -p1 format included in the debian/patches directory ### are applied to the upstream source in the order listed below. ### This is manually managed by users with dquilt (quilt(1) wrapper) etc. ### Also this may be updated by dpkg-source(1) when making a package. debmake-4.2.2/PKG-INFO0000664000175000017500000000120512563440271014502 0ustar osamuosamu00000000000000Metadata-Version: 1.1 Name: debmake Version: 4.2.2 Summary: Debian package making utility Home-page: http://people.debian.org/~osamu/ Author: Osamu Aoki Author-email: osamu@debian.org License: MIT License Description: Debian source package making utility to populate the debian directory. Platform: POSIX Classifier: Development Status :: 3 - Alpha Classifier: Environment :: Console Classifier: Intended Audience :: Developers Classifier: License :: OSI Approved :: MIT License Classifier: Natural Language :: English Classifier: Operating System :: POSIX :: Linux Classifier: Programming Language :: Python :: 3 Classifier: Topic :: Utilities debmake-4.2.2/extra0/0000775000175000017500000000000012563440271014612 5ustar osamuosamu00000000000000debmake-4.2.2/extra0/rules0000664000175000017500000000104212563440146015665 0ustar osamuosamu00000000000000#!/usr/bin/make -f # You must remove unused comment lines for the released package. ### See debhelper(7) (uncomment to enable) ### This is an autogenerated template for debian/rules. ### ### Output every command that modifies files on the build system. #export DH_VERBOSE = 1 ### ### Copy some variable definitions from pkg-info.mk and vendor.mk ### under /usr/share/dpkg/ to here if they are useful. ### @EXPORT@### main packaging script based on dh7 syntax %: dh $@ @DHWITH@ @DHBUILDSYSTEM@ ### debmake generated override targets @OVERRIDE@ debmake-4.2.2/extra0/changelog0000664000175000017500000000023412563440146016464 0ustar osamuosamu00000000000000@PACKAGE@ (@VERREV@) UNRELEASED; urgency=low * Initial release. Closes: #nnnn -- @FULLNAME@ <@EMAIL@> @DATE@ debmake-4.2.2/manpages/0000775000175000017500000000000012563440271015202 5ustar osamuosamu00000000000000debmake-4.2.2/manpages/debmake.10000664000175000017500000005106312563440146016662 0ustar osamuosamu00000000000000'\" t .\" Title: debmake .\" Author: [see the "AUTHOR" section] .\" Generator: DocBook XSL Stylesheets v1.78.1 .\" Date: 08/02/2015 .\" Manual: Debmake Manual .\" Source: DEBMAKE .\" Language: English .\" .TH "DEBMAKE" "1" "08/02/2015" "DEBMAKE" "Debmake Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" debmake \- program to make the Debian source package .SH "SYNOPSIS" .sp \fBdebmake\fR [\fB\-h\fR] [\fB\-c\fR | \fB\-k\fR] [\fB\-n\fR | \fB\-a\fR \fIpackage\-version\fR\fB\&.orig\&.tar\&.gz\fR | \fB\-d\fR | \fB\-t\fR ] [\fB\-p\fR \fIpackage\fR] [\fB\-u\fR \fIversion\fR] [\fB\-r\fR \fIrevision\fR] [\fB\-z\fR \fIextension\fR] [\fB\-b\fR "\fIbinarypackage\fR\fI, \&...\fR]" [\fB\-e\fR \fIfoo@example\&.org\fR] [\fB\-f\fR "\fIfirstname lastname\fR"] [\fB\-i\fR "\fIbuildtool\fR" | \fB\-j\fR] [\fB\-l\fR \fIlicense_file\fR] [\fB\-m\fR] [\fB\-o\fR \fIfile\fR] [\fB\-q\fR] [\fB\-s\fR] [\fB\-v\fR] [\fB\-w\fR "\fIaddon, \&...\fR"] [\fB\-x\fR [01234]] [\fB\-y\fR] [\fB\-P\fR] [\fB\-T\fR] .SH "DESCRIPTION" .sp \fBdebmake\fR helps to build the Debian package from the upstream source\&. Normally, this is done as follows: .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} The upstream tarball is downloaded as the \fIpackage\-version\fR\fB\&.tar\&.gz\fR file\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} It is untared to create many files under the \fIpackage\-version/\fR directory\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} debmake is invoked in the \fIpackage\-version/\fR directory possibly without any arguments\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Files in the \fIpackage\-version\fR\fB/debian/\fR directory are manually adjusted\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fBdpkg\-buildpackage\fR (usually from its wrapper \fBdebuild\fR or \fBpdebuild\fR) is invoked in the \fIpackage\-version/\fR directory to make debian packages\&. .RE .sp Make sure to protect the arguments of the \fB\-b\fR, \fB\-f\fR, \fB\-l\fR, and \fB\-w\fR options from the shell interference by quoting them properly\&. .SS "optional arguments:" .PP \fB\-h\fR, \fB\-\-help\fR .RS 4 show this help message and exit\&. .RE .PP \fB\-c\fR, \fB\-\-copyright\fR .RS 4 scan source for copyright+license text and exit\&. .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fB\-c\fR: simple output style .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fB\-cc\fR: normal output style (similar to the \fBdebian/copyright\fR file) .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fB\-ccc\fR: debug output style .RE .RE .PP \fB\-k\fR, \fB\-\-kludge\fR .RS 4 compare the \fBdebian/copyright\fR file with the source and exit\&. .sp The \fBdebian/copyright\fR file must be organized to list the generic file patterns before the specific exceptions\&. .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fB\-k\fR: basic output style .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fB\-kk\fR: verbose output style .RE .RE .PP \fB\-n\fR, \fB\-\-native\fR .RS 4 make a native Debian source package without \fB\&.orig\&.tar\&.gz\fR\&. This makes the \(lq\fB3\&.0 (native)\fR\(rq format package\&. .sp If you are thinking to package a Debian specific source tree with \fBdebian/\fR* in it into a native Debian package, please think otherwise\&. You can use \(lq\fBdebmake \-d \-i debuild\fR\(rq or \(lq\fBdebmake \-t \-i debuild\fR\(rq to make the \(lq\fB3\&.0 (quilt)\fR\(rq format non\-native Debian package\&. The only difference is that the \fBdebian/changelog\fR file must use the non\-native version scheme: \fIversion\-revision\fR\&. The non\-native package is more friendly to the downstream distributions\&. .RE .PP \fB\-a\fR \fIpackage\-version\fR\fB\&.tar\&.gz\fR, \fB\-\-archive\fR \fIpackage\-version\fR\fB\&.tar\&.gz\fR .RS 4 use the upstream source tarball directly\&. (\fB\-p\fR, \fB\-u\fR, \fB\-z\fR: overridden) .sp The upstream tarball may be specified as \fIpackage_version\fR\fB\&.orig\&.tar\&.gz\fR and \fBtar\&.gz\fR for all cases may be \fBtar\&.bz2\fR, or \fBtar\&.xz\fR\&. .sp If the specified upstream tarball name contains uppercase letters, the Debian package name is generated by converting them to lowercase letters\&. .sp If the specified argument is the URL (http://, https://, or ftp://) to the upstream tarball, the upstream tarball is downloaded from the URL using \fBwget\fR or \fBcurl\fR\&. .RE .PP \fB\-d\fR, \fB\-\-dist\fR .RS 4 run \(lqmake dist\(rq equivalent first to generate upstream tarball and use it\&. .sp \(lq\fBdebmake \-d\fR\(rq is designed to run in the \fIpackage/\fR directory hosting the upstream VCS with the build system supporting \(lq\fBmake dist\fR\(rq equivalents\&. (automake/autoconf, Python distutils, \&...) .RE .PP \fB\-t\fR, \fB\-\-tar\fR .RS 4 run \(lq\fBtar\fR\(rq to generate upstream tarball and use it .sp \(lq\fBdebmake \-t\fR\(rq is designed to run in the \fIpackage/\fR directory hosting the upstream VCS\&. Unless you provide the upstream version with the \fB\-u\fR option or with the \fBdebian/changelog\fR file, a snapshot upstream version is generated in the \fB0~%y%m%d%H%M\fR format, e\&.g\&., \fI0~1403012359\fR, from the UTC date and time\&. The generated tarball excludes the \fBdebian/\fR directory found in the upstream VCS\&. (It also excludes typical VCS directories: \fB\&.git/ \&.hg/ \&.svn/ \&.CVS/\fR) .RE .PP \fB\-p\fR \fIpackage\fR, \fB\-\-package\fR \fIpackage\fR .RS 4 set the Debian package name\&. .RE .PP \fB\-u\fR \fIversion\fR, \fB\-\-upstreamversion\fR \fIversion\fR .RS 4 set the upstream package version\&. .RE .PP \fB\-r\fR \fIrevision\fR, \fB\-\-revision\fR \fIrevision\fR .RS 4 set the Debian package revision\&. .RE .PP \fB\-z\fR \fIextension\fR, \fB\-\-targz\fR \fIextension\fR .RS 4 set the tarball type, \fIextension\fR=(\fBtar\&.gz\fR|\fBtar\&.bz2\fR|\fBtar\&.xz\fR) (alias: \fBz\fR, \fBb\fR, \fBx\fR) .RE .PP \fB\-b\fR "\fIbinarypackage[:type],\&...\fR", \fB\-\-binaryspec\fR "\fIbinarypackage[:type],\&...\fR" .RS 4 set binary package specs by the comma separated list of \fIbinarypackage:type\fR pairs, e\&.g\&., in full form \(lq\fBfoo:bin,foo\-doc:doc,libfoo1:lib,libfoo1\-dbg:dbg,libfoo\-dev:dev\fR\(rq or in short form \(lq\fB,\-doc,libfoo1,libfoo1\-dbg, libfoo\-dev\fR\(rq\&. .sp Here, \fIbinarypackage\fR is the binary package name; and optional \fItype\fR is chosen from the following \fItype\fR values: .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fBbin\fR: C/C++ compiled ELF binary code package (any, foreign) (default, alias: \fB""\fR, i\&.e\&., \fInull\-string\fR) .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fBdata\fR: Data (fonts, graphics, \&...) package (all, foreign) (alias: \fBda\fR) .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fBdbg\fR: Debug symbol package (any, same) (alias: \fBdb\fR) .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fBdev\fR: Library development package (any, same) (alias: \fBde\fR) .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fBdoc\fR: Documentation package (all, foreign) (alias: \fBdo\fR) .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fBlib\fR: Library package (any, same) (alias: \fBl\fR) .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fBperl\fR: Perl script package (all, foreign) (alias: \fBpl\fR) .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fBpython\fR: Python script package (all, foreign) (alias: \fBpy\fR) .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fBpython3\fR: Python3 script package (all, foreign) (alias: \fBpy3\fR) .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fBruby\fR: Ruby script package (all, foreign) (alias: \fBrb\fR) .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fBscript\fR: Shell script package (all, foreign) (alias: \fBsh\fR) .RE .sp The pair values in the parentheses, such as (any, foreign), are the \fBArchitecture\fR and \fBMulti\-Arch\fR stanza values set in the \fBdebian/control\fR file\&. .sp In many cases, the \fBdebmake\fR command makes good guesses for \fItype\fR from \fIbinarypackage\fR\&. If \fItype\fR is not obvious, \fItype\fR is set to \fBbin\fR\&. For example, \fBlibfoo\fR sets \fItype\fR to \fBlib\fR, and \fBfont\-bar\fR sets \fItype\fR to \fBdata\fR, \&... .sp If the source tree contents do not match settings for \fItype\fR, \fBdebmake\fR warns you\&. .RE .PP \fB\-e\fR \fIfoo@example\&.org\fR, \fB\-\-email\fR \fIfoo@example\&.org\fR .RS 4 set e\-mail address\&. .sp The default is taken from the value of the environment variable \fB$DEBEMAIL\fR\&. .RE .PP \fB\-f\fR "\fIfirstname lastname\fR", \fB\-\-fullname\fR "\fIfirstname lastname\fR" .RS 4 set the fullname\&. .sp The default is taken from the value of the environment variable \fB$DEBFULLNAME\fR\&. .RE .PP \fB\-i\fR "\fIbuildtool\fR", \fB\-\-invoke\fR "\fIbuildtool\fR" .RS 4 invoke "\fIbuildtool\fR" at the end of execution\&. \fIbuildtool\fR may be \(lq\fBdpkg\-buildpackage\fR\(rq, \(lq\fBdebuild\fR\(rq, \(lq\fBpdebuild\fR\(rq, \(lq\fBpdebuild \-\-pbuilder cowbuilder\fR\(rq, etc\&.\&. .sp The default is not to execute any program\&. .RE .PP \fB\-j\fR, \fB\-\-judge\fR .RS 4 run \fBdpkg\-depcheck\fR to judge build dependencies and identify file paths\&. Log files are in the parent directory\&. .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fIpackage\fR\fB\&.build\-dep\&.log\fR: Log file for \fBdpkg\-depcheck\fR\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fIpackage\fR\fB\&.install\&.log\fR: Log file recording files in the \fBdebian/tmp\fR directory\&. .RE .RE .PP \fB\-l\fR "\fIlicense_file,\&...\fR", \fB\-\-license\fR "\fIlicense_file,\&...\fR" .RS 4 add formatted license text to the end of the \fBdebian/copyright\fR file holding license scan results .sp The default is add \fBCOPYING\fR and \fBLICENSE\fR and \fIlicense_file\fR needs to list only the additional file names all separated by \(lq\fB,\fR\(rq\&. .RE .PP \fB\-m\fR, \fB\-\-monoarch\fR .RS 4 force packages to be non\-multiarch\&. .RE .PP \fB\-o\fR \fIfile\fR, \fB\-\-option\fR \fIfile\fR .RS 4 read optional parameters from the \fIfile\fR\&. (This is not for everyday use\&.) .sp The \fIfile\fR is sourced as the Python3 code at the end of \fBpara\&.py\fR\&. For example, the package description can be specified by the following file\&. .sp .if n \{\ .RS 4 .\} .nf para[\*(Aqdesc\*(Aq] = \*(Aqprogram short description\*(Aq para[\*(Aqdesc_long\*(Aq] = \*(Aq\*(Aq\*(Aq\e program long description which you wish to include\&. \&. Empty line is space + \&. You keep going on \&.\&.\&. \*(Aq\*(Aq\*(Aq .fi .if n \{\ .RE .\} .RE .PP \fB\-q\fR, \fB\-\-quitearly\fR .RS 4 quit early before creating files in the \fBdebian/\fR directory\&. .RE .PP \fB\-s\fR, \fB\-\-spec\fR .RS 4 use upstream spec (setup\&.py for Python, etc\&.) for the package description\&. .RE .PP \fB\-v\fR, \fB\-\-version\fR .RS 4 show version information\&. .RE .PP \fB\-w\fR "\fIaddon,\&...\fR", \fB\-\-with\fR "\fIaddon,\&...\fR" .RS 4 add extra arguments to the \fB\-\-with\fR option of the \fBdh\fR(1) command as \fIaddon\fR in \fBdebian/rules\fR\&. .sp The \fIaddon\fR values are listed all separated by \(lq\fB,\fR\(rq, e\&.g\&., \(lq\fB\-w "python2,autoreconf"\(rq\fR\&. .sp For Autotools based packages, setting \fBautoreconf\fR as \fIaddon\fR forces to run \(lq\fBautoreconf \-i \-v \-f\fR\(rq for every package building\&. Otherwise, \fBautotools\-dev\fR as \fIaddon\fR is used as default\&. .sp For Autotools based packages, if they install Python programs, \fBpython2\fR as addon is needed for packages with \(lq\fBcompat < 9\fR\(rq since this is non\-obvious\&. But for \fBsetup\&.py\fR based packages, \fBpython2\fR as \fIaddon\fR is not needed since this is obvious and it is automatically set for the \fBdh\fR(1) command by the \fBdebmake\fR command when it is required\&. .RE .PP \fB\-x\fR \fIn\fR, \fB\-\-extra\fR \fIn\fR .RS 4 generate extra configuration files as templates\&. .sp The number \fIn\fR changes which configuration templates are generated\&. .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fB\-x0\fR: bare minimum configuration files\&. (default if these files exist already) .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fB\-x1\fR: ,, + desirable configuration files\&. (default for new packages) .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fB\-x2\fR: ,, + interesting configuration files\&. (recommended for experts, multi binary aware) .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fB\-x3\fR: ,, + unusual configuration template files with the extra \fB\&.ex\fR suffix to ease their removal\&. (recommended for new users) To use these as configuration files, rename their file names into ones without the \fB\&.ex\fR suffix\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fB\-x4\fR: ,, + copyright file examples\&. .RE .RE .PP \fB\-y\fR, \fB\-\-yes\fR .RS 4 \(lqforce yes\(rq for all prompts\&. (without option: \(lqask [Y/n]\(rq; doubled option: \(lqforce no\(rq) .RE .PP \fB\-P\fR, \fB\-\-pedantic\fR .RS 4 pedantically check auto\-generated files\&. .RE .PP \fB\-T\fR, \fB\-\-tutorial\fR .RS 4 output tutorial comment lines in template files\&. .RE .SH "EXAMPLES" .sp For a well behaving source, you can build a good\-for\-local\-use installable single Debian binary package easily with one command\&. Test install of such a package generated in this way offers a good alternative to traditional \(lq\fBmake install\fR\(rq to the \fB/usr/local\fR directory since the Debian package can be removed cleanly by the \(lq\fBdpkg \-P\fR \fI\&...\(rq\fR command\&. Here are some examples of how to build such test packages\&. (These should work in most cases\&. If the \fB\-d\fR does not work, try \fB\-t\fR instead\&.) .sp For a typical C program source tree packaged with autoconf/automake: .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fBdebmake \-d \-i debuild\fR .RE .sp For a typical python module source tree: .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fBdebmake \-s \-d \-b":python" \-i debuild\fR .RE .sp For a typical python module in the \fIpackage\-version\fR\fB\&.tar\&.gz\fR archive: .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fBdebmake \-s \-a \fR\fB\fIpackage\-version\fR\fR\fB\&.tar\&.gz \-b":python" \-i debuild\fR .RE .sp For a typical perl module in the \fIPackage\-version\fR\fB\&.tar\&.gz\fR archive: .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fBdebmake \-a \fR\fB\fIPackage\-version\fR\fR\fB\&.tar\&.gz \-b":perl" \-i debuild\fR .RE .SH "HELPER PACKAGES" .sp Packaging may require installation of some additional specialty helper packages\&. .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Python3 program may require the \fBdh\-python\fR package\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Autotools (Autoconf + Automake) build system may require \fBautotools\-dev\fR or \fBdh\-autoreconf\fR package\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Ruby program may require the \fBgem2deb\fR package\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Java program may require the \fBjavahelper\fR package\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Gnome programs may require the \fBgobject\-introspection\fR package\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} etc\&. .RE .SH "CAVEAT" .sp \fBdebmake\fR is meant to provide template files for the package maintainer to work on\&. Comment lines started by \fB#\fR contain the tutorial text\&. You must remove or edit such comment lines before uploading to the Debian archive\&. .sp There are some limitations for what characters may be used as a part of the Debian package\&. The most notable limitation is the prohibition of uppercase letters in the package name\&. Here is the summary in the regular expression\&. .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Upstream package name (\fB\-p\fR): [\-+\&.a\-z0\-9]{2,} .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Binary package name (\fB\-b\fR): [\-+\&.a\-z0\-9]{2,} .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Upstream version (\fB\-u\fR): [0\-9][\-+\&.:~a\-z0\-9A\-Z]* .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Debian revision (\fB\-r\fR): [0\-9][+\&.~a\-z0\-9A\-Z]* .RE .sp See the exact definition in Chapter 5 \- Control files and their fields of the \(lqDebian Policy Manual\(rq\&. .SH "DEBUG" .sp The character set in the environment variable \fB$DEBUG\fR determines the logging output level\&. .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fBi\fR: print information .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fBp\fR: list all global parameters .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fBd\fR: list parsed parameters for all binary packages .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fBf\fR: input filename for the copyright scan .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fBy\fR: year/name split of copyright line .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fBs\fR: line scanner for format_state .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fBb\fR: content_state scan loop: begin\-loop .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fBm\fR: content_state scan loop: after regex match .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fBe\fR: content_state scan loop: end\-loop .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fBc\fR: print copyright section text .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fBl\fR: print license section text .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fBa\fR: print author/translator section text .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fBk\fR: sort key for debian/copyright stanza .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fBn\fR: scan result of debian/copyright (\(lq\fBdebmake \-k\fR\(rq) .RE .sp Use this as: .sp .if n \{\ .RS 4 .\} .nf $ DEBUG=pdfbmeclak debmake \&.\&.\&. .fi .if n \{\ .RE .\} .SH "AUTHOR" .sp Copyright \(co 2014\-2015 Osamu Aoki .SH "LICENSE" .sp MIT License .SH "SEE ALSO" .sp The \fBdebmake\-doc\fR package provides the \(lqGuide for Debian Maintainers\(rq in the plain text, HTML and PDF formats under the \fB/usr/share/doc/debmake\-doc/\fR directory\&. .sp Also, please read the original Debian New Maintainers\(cq Guide provided by the the \fBmaint\-guide\fR package\&. .sp See also \fBdpkg\-source\fR(1), \fBdeb\-control\fR(5), \fBdebhelper\fR(7), \fBdh\fR(1), \fBdpkg\-buildpackage\fR(1), \fBdebuild\fR(1), \fBquilt\fR(1), \fBdpkg\-depcheck\fR(1), \fBpdebuild\fR(1), \fBpbuilder\fR(8), \fBcowbuilder\fR(8), \fBgbp\-buildpackage\fR(1), \fBgbp\-pq\fR(1), and \fBgit\-pbuilder\fR(1) manpages\&. debmake-4.2.2/extra0export/0000775000175000017500000000000012563440271016054 5ustar osamuosamu00000000000000debmake-4.2.2/extra0export/misc0000664000175000017500000000122112563440146016727 0ustar osamuosamu00000000000000### These are rarely used code. (START) ### ### The following include for *.mk magically sets miscellaneous ### variables while honoring existing values of pertinent ### environment variables: ### ### Architecture-related variables such as DEB_TARGET_MULTIARCH: ###include /usr/share/dpkg/architecture.mk ### Vendor-related variables such as DEB_VENDOR: ###include /usr/share/dpkg/vendor.mk ### Package-related variables such as DEB_DISTRIBUTION ###include /usr/share/dpkg/pkg-info.mk ### ### You may alternatively set them susing a simple script such as: ### DEB_VENDOR ?= $(shell dpkg-vendor --query Vendor) ### ### These are rarely used code. (END) ### debmake-4.2.2/extra0export/compiler0000664000175000017500000000100512563440146017606 0ustar osamuosamu00000000000000### See FEATURE AREAS/ENVIRONMENT in dpkg-buildflags(1) ### Apply all hardening options #export DEB_BUILD_MAINT_OPTIONS = hardening=+all ### Package maintainers to append CFLAGS #export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic ### Package maintainers to append LDFLAGS #export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed ### ### With debhelper version 9 or newer, the dh command exports ### all buildflags. So there is no need to include the ### /usr/share/dpkg/buildflags.mk file here if compat is 9 or newer. ### debmake-4.2.2/extra0export/vala0000664000175000017500000000047312563440146016727 0ustar osamuosamu00000000000000# Vala work arounds: ### Delayed export to honor DEB_CFLAGS_MAINT_APPEND, DEB_BUILD_MAINT_OPTIONS, etc DPKG_EXPORT_BUILDFLAGS = 1 include /usr/share/dpkg/buildflags.mk ### Vala source requires this using CPPFLAGS, CFLAGS, LDFLAGS set above. export VALAFLAGS:=$(foreach w,$(CPPFLAGS) $(CFLAGS) $(LDFLAGS),-X $(w)) debmake-4.2.2/extra0export/java0000664000175000017500000000026112563440146016720 0ustar osamuosamu00000000000000### Java source requires these. export JAVA_HOME=/usr/lib/jvm/default-java export CLASSPATH=/usr/share/java/csv.jar:/usr/share/java/debug-disable.jar:/usr/share/java/itext.jar debmake-4.2.2/setup.py0000775000175000017500000000513512563440146015131 0ustar osamuosamu00000000000000#!/usr/bin/python3 # vi:se ts=4 sts=4 et ai: from distutils.core import setup from distutils.command.clean import clean as clean_ from debmake import __programname__, __version__ import glob import subprocess class clean(clean_): def run(self): if self.dry_run: return subprocess.call('if [ -e setup.py ]; then rm -rf build dist debmake/__pycache__ MANIFEST; fi', shell=True) clean_.run(self) class deb(clean_): def run(self): if self.dry_run: return clean_.run(self) subprocess.call('if [ -e setup.py ]; then debmake -d -y -b":py3" -i debuild; fi', shell=True) setup(name=__programname__, version=__version__, description='Debian package making utility', long_description='Debian source package making utility to populate the debian directory.', author='Osamu Aoki', author_email='osamu@debian.org', url='http://people.debian.org/~osamu/', packages=[__programname__], package_dir={__programname__: __programname__}, scripts=['scripts/' + __programname__ ], data_files=[ ('share/debmake/extra0', glob.glob('extra0/*')), ('share/debmake/extra0desc_long', glob.glob('extra0desc_long/*')), ('share/debmake/extra0export', glob.glob('extra0export/*')), ('share/debmake/extra0override', glob.glob('extra0override/*')), ('share/debmake/extra1', glob.glob('extra1/*')), ('share/debmake/extra1patches', glob.glob('extra1patches/*')), ('share/debmake/extra1source', glob.glob('extra1source/*')), ('share/debmake/extra2bin', glob.glob('extra2bin/*')), ('share/debmake/extra2data', glob.glob('extra2data/*')), ('share/debmake/extra2dev', glob.glob('extra2dev/*')), ('share/debmake/extra2doc', glob.glob('extra2doc/*')), ('share/debmake/extra2lib', glob.glob('extra2lib/*')), ('share/debmake/extra2multi', glob.glob('extra2multi/*')), ('share/debmake/extra2single', glob.glob('extra2single/*')), ('share/debmake/extra3', glob.glob('extra3/*')), ('share/debmake/extra4', glob.glob('extra4/*')), ('lib/debmake', glob.glob('desc/*')), ], classifiers = ['Development Status :: 3 - Alpha', 'Environment :: Console', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Natural Language :: English', 'Operating System :: POSIX :: Linux', 'Programming Language :: Python :: 3', 'Topic :: Utilities', ], platforms = 'POSIX', license = 'MIT License', cmdclass={'clean': clean, 'deb': deb}, ) debmake-4.2.2/MANIFEST.in0000664000175000017500000000006412563440146015146 0ustar osamuosamu00000000000000include MANIFEST.in include manpages/* include TODO debmake-4.2.2/debmake/0000775000175000017500000000000012563440271014777 5ustar osamuosamu00000000000000debmake-4.2.2/debmake/grep.py0000775000175000017500000000462612563440146016322 0ustar osamuosamu00000000000000#!/usr/bin/python3 # vim:se tw=0 sts=4 ts=4 et ai: """ Copyright © 2014 Osamu Aoki Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. """ import os import re import sys ####################################################################### # grep rtext file def grep(file, rtext, *range): lines = '' if not os.path.isfile(file): print('I: skipping :: {} (missing file)'.format(file), file=sys.stderr) else: reg = re.compile(rtext) if len(range) == 0: lbgn = 0 lend = -1 elif len(range) == 1: lbgn = range[0] lend = -1 else: lbgn = range[0] lend = range[1] with open(file, mode='r', encoding='utf-8') as f: for (i, l) in enumerate(f.readlines()): if ( i >= lbgn ) and (( lend < 0 ) or ( lend > i)): match = reg.search(l) if match: lines += l return lines ####################################################################### # Test script ####################################################################### if __name__ == '__main__': print(grep('/bin/zcat', r'^#!', 0, 2), end='') print('----') print(grep('/bin/zcat', r'terms', 0, 10), end='') print('----') if grep('/bin/zcat', r'terms', 0, 10): print('found') print('----') if not grep('/bin/zcat', r'teXXXXs', 0, 10): print('not found') debmake-4.2.2/debmake/kludge.py0000775000175000017500000002140012563440146016625 0ustar osamuosamu00000000000000#!/usr/bin/python3 # vim:se tw=0 sts=4 ts=4 et ai: """ Copyright © 2014 Osamu Aoki Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. """ import collections import glob import itertools import operator import os import re import sys import debmake.copyright import debmake.scanfiles re_round0 = re.compile(r'\.0') def copydiff(mode, pedantic): ########################################################################### # parse existing debian/copyright against source tree ########################################################################### if not os.path.isfile('debian/copyright'): print('E: You need debian/copyright.') exit(1) with open('debian/copyright', mode='r', encoding='utf-8') as f: lines = f.readlines() patterns_for_license = [] license = '' default_license = '' f_file = False f_cont = False f_license = False patterns = [] iptn = -1 licenses_old = {} file_to_pattern = {} for line in lines + ['']: # easy sure EOF line = line.rstrip() if line == '': # summarize data if patterns_for_license != [] and license != '': for ptn in patterns_for_license: patterns.append(ptn) if ptn == '*': default_license = license iptn += 1 # 0, 1, 2, 3 ... globbed_file_or_dirs = glob.glob(ptn) if globbed_file_or_dirs: for file_or_dir in globbed_file_or_dirs: if os.path.isfile(file_or_dir): file_to_pattern[file_or_dir] = (iptn, ptn) licenses_old[file_or_dir] = license debmake.debug.debug('Dn: Pattern #{:02}: {}, file={}, {}'.format(iptn, ptn, file_or_dir, license), type='n') elif os.path.isdir(file_or_dir): for dir, subdirs, files in os.walk(file_or_dir): #debmake.debug.debug('Dn: Pattern #{:02}: {}, dir={}, files={}'.format(iptn, ptn, dir, files), type='n') for file in files: filepath = os.path.join(dir, file) file_to_pattern[filepath] = (iptn, ptn) licenses_old[filepath] = license debmake.debug.debug('Dn: Pattern #{:02}: {}, filepath={}, {}'.format(iptn, ptn, filepath, license), type='n') else: file_to_pattern['__MISSING__'] = (iptn, ptn) licenses_old['__MISSING__'] = license debmake.debug.debug('Dn: Pattern #{:02}: {}, file={}, {}'.format(iptn, ptn, '__MISSING__', license), type='n') # Next stanza patterns_for_license = [] license = '' f_file = False f_cont = False f_license = False elif line[:6].lower() == 'files:': patterns_for_license += line[6:].split() f_file = True f_cont = True elif line[:8].lower() == 'license:': license = line[8:].strip() f_cont = False elif f_cont == True and line[:1] == ' ': patterns_for_license += line.split() elif f_cont == True and line[:1] == '\t': patterns_for_license += line.split() elif line[:1].lower() != ' ': f_cont = False else: pass nptn = iptn + 1 ########################################################################### iptn_to_ptn = {} iptn_to_files = collections.defaultdict(list) for file, (iptn, ptn) in file_to_pattern.items(): iptn_to_ptn[iptn] = ptn iptn_to_files[iptn].append(file) debmake.debug.debug('Dn: file="{}", iptn="{}", ptn="{}"'.format(file, iptn, ptn), type='n') if nptn != len(iptn_to_ptn): print("W: ***** Number of patterns unused: {} out of range(0, {}) *****".format(nptn - len(iptn_to_ptn), nptn), file=sys.stderr) ########################################################################### # scan copyright of the source tree and create license_new[] ########################################################################### (nonlink_files, xml_html_files, binary_files, huge_files, extcount, extcountlist) = debmake.scanfiles.scanfiles() data_new = debmake.copyright.check_copyright(nonlink_files, mode=1, pedantic=pedantic) licenses_new = {} for (licenseid, licensetext, files, copyright_lines) in data_new: licenseid = licenseid.strip() debmake.debug.debug('Dn: debian/copyright: "{}": {}'.format(licenseid, files), type='n') for file in files: licenses_new[file] = licenseid ########################################################################### # generate data with before/after ########################################################################### data = [] for iptn in range(0, nptn): if iptn in iptn_to_ptn.keys(): ptn = iptn_to_ptn[iptn] files = iptn_to_files[iptn] else: print('W: ***** Pattern #{:02}: "{}" unused, reorder debian/copyright *****'.format(iptn, patterns[iptn]), file=sys.stderr) for file in files: old = licenses_old[file] if file in licenses_new.keys(): new = licenses_new[file] else: new = '' if new == '_SAME_' and default_license != '': new = default_license if old == new and mode <= 5: printdiff = False # exact match elif old.lower() == new.lower() and mode <= 4: printdiff = False # case insensitive match elif old.lower() == re_round0.sub('', new.lower()) and mode <= 4: printdiff = False # ignore tailing .0 elif new =='' and mode <= 3: printdiff = False elif new[:2] == '__' and mode <= 2: printdiff = False else: # (old, new) not the same or mode >= 6 printdiff = True data.append((iptn, ptn, file, printdiff, old, new)) return data def kludge(mode, pedantic): basedata = copydiff(mode, pedantic) iptn_group_data = [] data = sorted(basedata, key=operator.itemgetter(0)) for k, g in itertools.groupby(basedata, operator.itemgetter(0)): iptn_group_data.append(list(g)) # Store group iterator as a list data_iptn_licenses = [] for iptn_group in iptn_group_data: licenses_group_data = [] iptn_group = sorted(iptn_group, key=operator.itemgetter(4, 5)) for k, g in itertools.groupby(iptn_group, operator.itemgetter(4, 5)): licenses_group_data.append(list(g)) # Store group iterator as a list data_iptn_licenses.append(licenses_group_data) print('=== debian/copyright checked for {} data ==='.format(len(basedata))) outdata = [] for match_iptn in data_iptn_licenses: for match_licenses in match_iptn: files = [] for match_iptn_licenses in match_licenses: (iptn, ptn, file, printdiff, old, new) = match_iptn_licenses if printdiff: files.append(file) if files: outdata.append((iptn, ptn, files, printdiff, old, new)) for outx in outdata: (iptn, ptn, files, printdiff, old, new) = outx print('Pattern #{:02}: {}'.format(iptn, ptn)) print(' File: {}'.format('\n '.join(files))) print('- {}'.format(old)) print('+ {}'.format(new)) print() ############################################################################## if __name__ == '__main__': kludge(1) debmake-4.2.2/debmake/para.py0000775000175000017500000003063612563440146016310 0ustar osamuosamu00000000000000#!/usr/bin/python3 # vim:se tw=0 sts=4 ts=4 et ai: """ Copyright © 2014 Osamu Aoki Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. """ import argparse import os import pwd import sys import time import debmake.read ########################################################################### # undefined environment variable -> '' def env(var): try: return os.environ[var] except KeyError: return '' ####################################################################### # Initialize parameters ####################################################################### def para(para): debmail = env('DEBEMAIL') if not debmail: debmail = os.getlogin() + '@localhost' debfullname = env('DEBFULLNAME') if not debfullname: # os.getlogin may not work well: #769392 #debfullname = pwd.getpwnam(os.getlogin())[4].split(',')[0] debfullname = pwd.getpwuid(os.getuid())[4].split(',')[0] ####################################################################### # command line setting ####################################################################### p = argparse.ArgumentParser( formatter_class=argparse.RawDescriptionHelpFormatter, description = '''\ {0}: make Debian source package Version: {1} {2} {0} helps to build the Debian package from the upstream source. Normally, this is done as follows: * The upstream tarball is downloaded as the package-version.tar.gz file. * It is untared to create many files under the package-version/ directory. * {0} is invoked in the package-version/ directory possibly without any arguments. * Files in the package-version/debian/ directory are manually adjusted. * dpkg-buildpackage (usually from its wrapper debuild or pdebuild) is invoked in the package-version/ directory to make debian packages. Argument may need to be quoted to protect from the shell. '''.format( para['program_name'], para['program_version'], para['program_copyright']), epilog='See debmake(1) manpage for more.') ck = p.add_mutually_exclusive_group() ck.add_argument( '-c', '--copyright', action = 'count', default = 0, help = 'scan source for copyright+license text and exit') ck.add_argument( '-k', '--kludge', action = 'count', default = 0, help = 'compare debian/copyright with the source and exit') sp = p.add_mutually_exclusive_group() sp.add_argument( '-n', '--native', action = 'store_true', default = False, help = 'make a native source package without .orig.tar.gz') sp.add_argument( '-a', '--archive', type = str, action = 'store', default = '', help = 'use the upstream source tarball directly (-p, -u, -z: overridden)', metavar = 'package-version.tar.gz') sp.add_argument( '-d', '--dist', action = 'store_true', default = False, help = 'run "make dist" equivalent first to generate upstream tarball and use it') sp.add_argument( '-t', '--tar', action = 'store_true', default = False, help = 'run "tar" to generate upstream tarball and use it') p.add_argument( '-p', '--package', action = 'store', default = '', help = 'set the Debian package name', metavar = 'package') p.add_argument( '-u', '--upstreamversion', action = 'store', default = '', help = 'set the upstream package version', metavar = 'version') p.add_argument( '-r', '--revision', action = 'store', default = '', help = 'set the Debian package revision', metavar = 'revision') p.add_argument( '-z', '--targz', action = 'store', default = '', help = 'set the tarball type, extension=(tar.gz|tar.bz2|tar.xz)', metavar = 'extension') p.add_argument( '-b', '--binaryspec', action = 'store', default = '', help = 'set binary package specs as comma separated list of "binarypackage":"type" pairs, e.g., in full form "foo:bin,foo-doc:doc,libfoo1:lib,libfoo1-dbg:dbg,libfoo-dev:dev" or in short form ",-doc,libfoo1,libfoo1-dbg, libfoo-dev". Here, "binarypackage" is the binary package name; and optional "type" is chosen from "bin", "data", "dbg", "dev", "doc", "lib", "perl", "python", "python3", "ruby", and "script". If "type" is not specified but obvious, it is set by "binarypackage". Otherwise it is set to "bin" for the compiled ELF binary.', metavar = 'binarypackage[:type]') p.add_argument( '-e', '--email', action = 'store', default = debmail, help = 'set e-mail address', metavar = 'foo@example.org') p.add_argument( '-f', '--fullname', action = 'store', default = debfullname, help = 'set the fullname', metavar = '"firstname lastname"') # p.add_argument( # '-g', # '--gui', # action = 'store_true', # default = False, # help = 'run GUI configuration') # # -h : used by argparse for --help ep = p.add_mutually_exclusive_group() ep.add_argument( '-i', '--invoke', default = '', action = 'store', help = 'invoke package build tool', metavar = '[debuild|pdebuild|...]') ep.add_argument( '-j', '--judge', action = 'store_true', default = False, help = 'run "dpkg-depcheck" to judge build dependencies and identify file paths') p.add_argument( '-l', '--license', default = '', action = 'store', help = 'add formatted license to debian/copyright', metavar = '"license_file"') p.add_argument( '-m', '--monoarch', action = 'store_true', default = False, help = 'force packages to be non-multiarch') p.add_argument( '-o', '--option', default = '', action = 'store', help = 'read optional parameters from "file"', metavar = '"file"') p.add_argument( '-q', '--quitearly', action = 'store_true', default = False, help='quit early before creating files in the debian directory') p.add_argument( '-s', '--spec', action = 'store_true', default = False, help = 'use upstream spec') p.add_argument( '-v', '--version', action = 'store_true', default = False, help = 'show version information') p.add_argument( '-w', '--with', action = 'store', default = '', dest = 'withargs', help = 'set additional "dh --with" option arguments', metavar = 'args') p.add_argument( '-x', '--extra', default = '', action = 'store', help = 'generate extra configuration files as templates', metavar = '[01234]') p.add_argument( '-y', '--yes', action = 'count', default = 0, help = '"force yes" for all prompts') p.add_argument( '-P', '--pedantic', action = 'store_true', default = False, help='pedantically check auto-generated files') p.add_argument( '-T', '--tutorial', action = 'store_true', default = False, help='output tutorial comment lines in template files') args = p.parse_args() ####################################################################### # Set parameter values ####################################################################### ############################################# -a if args.archive: para['archive'] = True para['tarball'] = args.archive else: para['archive'] = False para['tarball'] = '' ############################################# para['binaryspec'] = args.binaryspec # -b para['copyright'] = min(args.copyright, 6) # -c if para['copyright'] >=4: para['copyright'] = 3 - para['copyright'] # 0: debian/copyright, +/-1: simple, +/-2: standard +/-3: extensive para['dist'] = args.dist # -d para['email'] = args.email # -e para['fullname'] = args.fullname # -f # para['gui'] = args.gui # -g para['invoke'] = args.invoke # -i para['judge'] = args.judge # -j if para['judge']: para['override'].update({'judge'}) para['kludge'] = args.kludge # -k ############################################# -l # --license: args.license -> para['license'] as set if args.license == '': para['license'] = set({'[Cc][Oo][Pp][Yy][Ii][Nn][Gg]*', '[Ll][Ii][Cc][Ee][Nn][Ss][Ee]*'}) # default else: para['license'] = set(args.copyright.split(',')) ############################################# para['monoarch'] = args.monoarch # -m para['native'] = args.native # -n para['package'] = args.package.lower() # -p ############################################# para['quitearly'] = args.quitearly # -q para['revision'] = args.revision # -r para['spec'] = args.spec # -s para['tar'] = args.tar # -t para['version'] = args.upstreamversion # -u para['print_version'] = args.version # -v ############################################# -w # --with: args.withargs -> para['dh_with'] as set if args.withargs == '': para['dh_with'] = set() # default is empty set else: para['dh_with'] = set(args.withargs.split(',')) ############################################# para['extra'] = args.extra # -x para['yes'] = min(args.yes, 2) # -y # 0: ask, 1: yes, 2: no para['targz'] = args.targz # -z para['pedantic'] = args.pedantic # -P para['tutorial'] = args.tutorial # -T ############################################# -o if args.option: exec(debmake.read.read(args.option)) ####################################################################### # return command line parameters ####################################################################### return para ####################################################################### # Test code ####################################################################### if __name__ == '__main__': for p, v in para().items(): print("para['{}'] = \"{}\"".format(p,v)) debmake-4.2.2/debmake/debian.py0000775000175000017500000002642312563440146016606 0ustar osamuosamu00000000000000#!/usr/bin/python3 # vim:se tw=0 sts=4 ts=4 et ai: """ Copyright © 2014 Osamu Aoki Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. """ import glob import os import subprocess import sys import debmake.cat import debmake.control import debmake.copyright import debmake.sed ####################################################################### def debian(para): ################################################################### # set level for the extra file outputs ################################################################### if para['extra'] == '': # default if os.path.isfile('debian/changelog'): print('I: found "debian/changelog"', file=sys.stderr) para['extra'] = '0' elif os.path.isfile('debian/control'): print('I: found "debian/control"', file=sys.stderr) para['extra'] = '0' elif os.path.isfile('debian/copyright'): print('I: found "debian/copyright"', file=sys.stderr) para['extra'] = '0' elif os.path.isfile('debian/rules'): print('I: found "debian/rules"', file=sys.stderr) para['extra'] = '0' elif len(para['debs']) == 1: print('I: single binary package', file=sys.stderr) para['extra'] = '1' else: print('I: multi binary packages: {}'.format(len(para['debs'])), file=sys.stderr) para['extra'] = '2' try: extra = int(para['extra']) except: extra = 4 print('I: debmake -x "{}" ...'.format(extra), file=sys.stderr) ################################################################### # common variables ################################################################### package = para['debs'][0]['package'] # the first binary package name substlist = { '@PACKAGE@': para['package'], '@UCPACKAGE@': para['package'].upper(), '@YEAR@': para['year'], '@FULLNAME@': para['fullname'], '@EMAIL@': para['email'], '@SHORTDATE@': para['shortdate'], '@DATE@': para['date'], '@DEBMAKEVER@': para['program_version'], '@BINPACKAGE@': package, '@COMPAT@': para['compat'], } if para['native']: substlist['@PKGFORMAT@'] = '3.0 (native)' substlist['@VERREV@'] = para['version'] else: substlist['@PKGFORMAT@'] = '3.0 (quilt)' substlist['@VERREV@'] = para['version'] + '-' + para['revision'] ################################################################### # check which package have the documentation ################################################################### if para['doc'] == []: docpackage = para['debs'][0]['package'] # 1st package else: docpackage = '' ####################################################################### # set export string ####################################################################### export_dir = para['base_path'] + '/share/debmake/extra0export/' substlist['@EXPORT@'] = '' if 'compiler' in para['export']: substlist['@EXPORT@'] += debmake.read.read(export_dir + 'compiler').rstrip() + '\n' if 'java' in para['export']: substlist['@EXPORT@'] += debmake.read.read(export_dir + 'java').rstrip() + '\n' if 'vala' in para['export']: substlist['@EXPORT@'] += debmake.read.read(export_dir + 'vala').rstrip() + '\n' substlist['@EXPORT@'] += debmake.read.read(export_dir + 'misc').rstrip() + '\n\n' ####################################################################### # set override string ####################################################################### override_dir = para['base_path'] + '/share/debmake/extra0override/' substlist['@OVERRIDE@'] = '' if len(para['debs']) == 1: build_dir = 'debian/' + para['debs'][0]['package'] else: build_dir = 'debian/tmp' if 'autogen' in para['override']: substlist['@OVERRIDE@'] += debmake.read.read(override_dir + 'autogen').rstrip() + '\n\n' if 'autoreconf' in para['override']: substlist['@OVERRIDE@'] += debmake.read.read(override_dir + 'autoreconf').rstrip() + '\n\n' if 'cmake' in para['override']: substlist['@OVERRIDE@'] += debmake.read.read(override_dir + 'cmake').rstrip() + '\n\n' if 'dbg' in para['override']: substlist['@OVERRIDE@'] += debmake.read.read(override_dir + 'dbg').format(para['dh_strip']).rstrip() + '\n\n' if 'java' in para['override']: substlist['@OVERRIDE@'] += debmake.read.read(override_dir + 'java').rstrip() + '\n\n' if 'judge' in para['override']: substlist['@OVERRIDE@'] += debmake.read.read(override_dir + 'judge').rstrip() + '\n\n' if 'makefile' in para['override']: substlist['@OVERRIDE@'] += debmake.read.read(override_dir + 'makefile').rstrip() + '\n\n' if 'multiarch' in para['override']: substlist['@OVERRIDE@'] += debmake.read.read(override_dir + 'multiarch').rstrip() + '\n\n' if 'pythons' in para['override']: substlist['@OVERRIDE@'] += debmake.read.read(override_dir + 'pythons').rstrip() + '\n\n' ################################################################### # 4 configuration files which must exist (level=0) ################################################################### debmake.cat.cat('debian/control', debmake.control.control(para), tutorial=para['tutorial']) debmake.cat.cat('debian/copyright', debmake.copyright.copyright(para['package'], para['license'], para['cdata'], para['xml_html_files'], para['binary_files'], para['huge_files'], tutorial=para['tutorial']), tutorial=para['tutorial']) if para['dh_with'] == set(): # no dh_with substlist['@DHWITH@'] = '' else: substlist['@DHWITH@'] = '--with {}'.format(','.join(para['dh_with'])) if para['dh_buildsystem'] == '': # no --buildsystem substlist['@DHBUILDSYSTEM@'] = '' else: substlist['@DHBUILDSYSTEM@'] = '--buildsystem={}'.format(para['dh_buildsystem']) confdir = para['base_path'] + '/share/debmake/extra0/' debmake.sed.sed(confdir, 'debian/', substlist, package, tutorial=para['tutorial']) # changelog, rules os.chmod('debian/rules', 0o755) ################################################################### # These should be created for the new source (level=1) # Basic configuration files for debhelper(7) etc. # No interactive editting required to work. ################################################################### if extra >= 1: confdir = para['base_path'] + '/share/debmake/extra1/' debmake.sed.sed(confdir, 'debian/', substlist, package, tutorial=para['tutorial']) confdir = para['base_path'] + '/share/debmake/extra1source/' debmake.sed.sed(confdir, 'debian/source/', substlist, package, tutorial=para['tutorial']) if not para['native']: confdir = para['base_path'] + '/share/debmake/extra1patches/' debmake.sed.sed(confdir, 'debian/patches/', substlist, package, tutorial=para['tutorial']) ################################################################### # Optional files which is nice to be created for the new source (level=2) # Harmless but some interactive editting are desirable. # * create templates only for the first binary package: # package.menu, package.docs, package.examples, package.manpages, # package.preinst, package.prerm, package.postinst, package.postrm # * create for all but dbg binary packages: package.install # * create for lib package: package.symbol ################################################################### binlist = {'bin', 'perl', 'python', 'python3', 'ruby', 'script'} if extra >= 2: if len(para['debs']) == 1: # if single binary deb confdir = para['base_path'] + '/share/debmake/extra2single/' debmake.sed.sed(confdir, 'debian/', substlist, package, tutorial=para['tutorial']) else: # if multi-binary debs confdir = para['base_path'] + '/share/debmake/extra2multi/' debmake.sed.sed(confdir, 'debian/', substlist, package, tutorial=para['tutorial']) for deb in para['debs']: substlist['@BINPACKAGE@'] = deb['package'] type = deb['type'] if type in binlist: type = 'bin' confdir = para['base_path'] + '/share/debmake/extra2' + type + '/' debmake.sed.sed(confdir, 'debian/', substlist, deb['package'], tutorial=para['tutorial']) if deb['package'] == docpackage: type = 'doc' confdir = para['base_path'] + '/share/debmake/extra2' + type + '/' debmake.sed.sed(confdir, 'debian/', substlist, deb['package'], tutorial=para['tutorial']) ################################################################### # Rarely used optional files (level=3) # Provided as the dh_make compatibilities. (files with ".ex" postfix) # (create templates only for the first binary package) ################################################################### substlist['@BINPACKAGE@'] = package # just in case if extra >= 3: confdir = para['base_path'] + '/share/debmake/extra3/' debmake.sed.sed(confdir, 'debian/', substlist, package, tutorial=para['tutorial']) ################################################################### # copyright file examples (level=4) ################################################################### if extra >= 4: confdir = para['base_path'] + '/share/debmake/extra4/' debmake.sed.sed(confdir, 'debian/license-examples/', substlist, package, tutorial=para['tutorial']) else: print('I: run "debmake -x{}" to get more template files'.format(extra + 1), file=sys.stderr) ################################################################### # wrap-and-sort ################################################################### command = 'wrap-and-sort' print('I: $ {}'.format(command), file=sys.stderr) if subprocess.call(command, shell=True) != 0: print('E: failed to run wrap-and-sort.', file=sys.stderr) exit(1) return ####################################################################### # Test script ####################################################################### if __name__ == '__main__': print('no test') debmake-4.2.2/debmake/__init__.py0000775000175000017500000003275512563440246017131 0ustar osamuosamu00000000000000#!/usr/bin/python3 # vim:se tw=0 sts=4 ts=4 et ai: """ Copyright © 2014-2015 Osamu Aoki Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. """ import os import subprocess import sys import time import debmake.analyze import debmake.copyright import debmake.debian import debmake.debs import debmake.debug import debmake.dist import debmake.kludge import debmake.origtar import debmake.para import debmake.sanity import debmake.scanfiles import debmake.tar import debmake.untar ####################################################################### # Basic package information ####################################################################### __debian_policy__ = '3.9.6' # debian policy version __debian_compat__ = '9' # debian/comapt __programname__ = 'debmake' __version__ = '4.2.2' __copyright__ = 'Copyright © 2014-2015 Osamu Aoki ' __license__ = '''\ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ''' ####################################################################### # main program ####################################################################### def main(): ####################################################################### # set parameters from commandline etc. ####################################################################### debmake.debug.debug('D: {} started'.format(sys.argv[0]), type='i') debmake.debug.debug('D: PYTHONPATH = {} '.format(':'.join(sys.path)), type='i') print('I: set parameters', file=sys.stderr) para = {} para['cwd'] = os.getcwd() para['program_name'] = __programname__ para['program_version'] = __version__ para['program_copyright'] = __copyright__ para['program_license'] = __license__ para['date'] = time.strftime("%a, %d %b %Y %H:%M:%S %z") para['shortdate'] = time.strftime("%d %b %Y") para['year'] = time.strftime("%Y") para['standard_version'] = __debian_policy__ # Debian policy_ para['compat'] = __debian_compat__ # debhelper para['build_depends'] = {'debhelper (>=' + para['compat'] +')'} para['desc'] = '' para['desc_long'] = '' para['export'] = set() para['override'] = set() # get prefix for install --user/ ,, --prefix/ ,, --home fullparent = os.path.dirname(sys.argv[0]) if fullparent == '.': para['base_path'] = '..' else: para['base_path'] = os.path.dirname(fullparent) para = debmake.para.para(para) debmake.debug.debug_para('Dp: @post-para para[*]', para) ####################################################################### # -v: print version and copyright notice and exit ####################################################################### if para['print_version']: print('{0} (version: {1}) {2}\n\n{3}'.format( para['program_name'], para['program_version'], para['program_copyright'], para['program_license']), file=sys.stderr) return ####################################################################### # -c: scan source for copyright+ license text, print and exit ####################################################################### if para['copyright'] !=0: print('I: scan source for copyright+license text and file extensions', file=sys.stderr) (nonlink_files, xml_html_files, binary_files, huge_files, counter, count_list) = debmake.scanfiles.scanfiles() data = debmake.copyright.check_copyright(nonlink_files, mode=para['copyright']) print(debmake.copyright.copyright('package', set(), data, xml_html_files, binary_files, huge_files, mode=para['copyright'], tutorial=para['tutorial'])) return ####################################################################### # -k: compare debian/copyright with the source and exit ####################################################################### if para['kludge'] !=0: print('I: compare debian/copyright with the source', file=sys.stderr) debmake.kludge.kludge(para['kludge'], para['pedantic']) return ####################################################################### # sanity check parameters without digging deep into source tree ####################################################################### print('I: sanity check of parameters', file=sys.stderr) para = debmake.sanity.sanity(para) debmake.debug.debug_para('Dp: @post-sanity para[*]', para) print('I: pkg="{}", ver="{}", rev="{}"'.format(para['package'], para['version'], para['revision']), file=sys.stderr) ####################################################################### # -d: make dist (with upstream buildsystem dist/sdist target) ####################################################################### if para['dist']: print('I: make the upstream tarball with "make dist" equivalents', file=sys.stderr) para = debmake.dist.dist(para) debmake.debug.debug_para('Dp: @post-dist para[*]', para) print('I: pkg="{}", ver="{}", rev="{}"'.format(para['package'], para['version'], para['revision']), file=sys.stderr) ####################################################################### # -t: make tar (with "tar --exclude=debian" command) ####################################################################### elif para['tar']: print('I: make the upstream tarball with "tar --exclude=debian"', file=sys.stderr) debmake.tar.tar(para['tarball'], para['targz'], para['srcdir'], para['parent'], para['yes']) debmake.debug.debug_para('Dp: @post-tar para[*]', para) ####################################################################### # -a, -d: extract archive from tarball (tar -xvzf) ####################################################################### if para['archive'] or para['dist']: print('I: untar the upstream tarball', file=sys.stderr) debmake.untar.untar(para['tarball'], para['targz'], para['srcdir'], para['dist'], para['tar'], para['parent'], para['yes']) debmake.debug.debug_para('Dp: @post-untar para[*]', para) ####################################################################### # always: generate orig tarball if missing and non-native package ####################################################################### para['parent'] = os.path.basename(os.getcwd()) # update !!! print('I: *** start packaging in "{}". ***'.format(para['parent']), file=sys.stderr) if para['parent'] != para['srcdir']: print('W: parent dirtectory should be "{}". (If you use pbuilder, this may be OK.)'.format(para['srcdir']), file=sys.stderr) if not para['native']: print('I: provide {}_{}.orig.tar.gz for non-native Debian package'.format(para['package'], para['version']), file=sys.stderr) # ln -sf parent/dist/Foo-1.0.tar.gz foo_1.0.orig.tar.gz debmake.origtar.origtar(para['package'], para['version'], para['targz'], para['tarball'], para['parent']) para['tarball'] = para['package'] + '_' + para['version'] + '.orig.' + para['targz'] debmake.debug.debug_para('Dp: @post-origtar para[*]', para) ####################################################################### # -q: quit here before generating template debian/* package files ####################################################################### if para['quitearly']: print('I: quit early after making the upstream tarball.', file=sys.stderr) exit(0) ####################################################################### # Prep to create debian/* package files ####################################################################### print('I: parse binary package settings: {}'.format(para['binaryspec']), file=sys.stderr) para['debs'] = debmake.debs.debs(para['binaryspec'], para['package'], para['monoarch'], para['dh_with']) debmake.debug.debug_debs("Dd: para['debs'] =>", para['debs']) print('I: analyze the source tree', file=sys.stderr) para = debmake.analyze.analyze(para) debmake.debug.debug_para('Dp: @post-analyze para[*]', para) #debmake.gui() # GUI setting #debmake.debug.debug_para('Dp: @post-gui para[*]', para) ####################################################################### # Make debian/* package files ####################################################################### print('I: make debian/* template files', file=sys.stderr) debmake.debian.debian(para) ####################################################################### # Make Debian package(s) ####################################################################### if para['judge']: command = 'fakeroot dpkg-depcheck -m -C -o ../{0}.depcheck.log -f -catch-alternatives debian/rules install >../{0}.build.log 2>&1'.format(para['package']) print('I: $ {}'.format(command), file=sys.stderr) if subprocess.call(command, shell=True) != 0: print('E: failed to run dpkg-depcheck.', file=sys.stderr) exit(1) command = 'LANG=C ; sed -e "1d" < ../{0}.depcheck.log | sort >../{0}.build-dep.log'.format(para['package']) print('I: $ {}'.format(command), file=sys.stderr) if subprocess.call(command, shell=True) != 0: print('E: failed to run sort on build-dep.', file=sys.stderr) exit(1) if len(para['debs']) == 1: bpackage = para['debs'][0]['package'] command = 'LANG=C; find debian/' + bpackage + ' -type f 2>&1 | sed -e "s/^debian\/' + bpackage + '\///" | sort >../{0}.install.log'.format(para['package']) print('I: $ {}'.format(command), file=sys.stderr) if subprocess.call(command, shell=True) != 0: print('E: failed to run find debian/{}.'.format(bpackage), file=sys.stderr) exit(1) elif len(para['debs']) > 1: command = 'LANG=C; find debian/tmp -type f 2>&1 | sed -e "s/^debian\/tmp\///" | sort >../{0}.install.log'.format(para['package']) print('I: $ {}'.format(command), file=sys.stderr) if subprocess.call(command, shell=True) != 0: print('E: failed to run find debian/tmp.', file=sys.stderr) exit(1) else: print('E: No binary package was generated.', file=sys.stderr) exit(1) print('I: upon return to the shell, current directory becomes {}'.format(para['cwd']), file=sys.stderr) print('I: please execute "cd {0}" before building the binary package'.format(os.getcwd()), file=sys.stderr) print('I: with dpkg-buildpackage (or debuild, pdebuild, sbuild, ...).', file=sys.stderr) elif para['invoke']: print('I: {}'.format(para['invoke']), file=sys.stderr) if subprocess.call(para['invoke'], shell=True) != 0: print('E: failed to build Debian package(s).', file=sys.stderr) exit(1) if para['archive']: print('I: please inspect the build results.'.format(os.getcwd()), file=sys.stderr) else: print('I: upon return to the shell, current directory becomes {}'.format(para['cwd']), file=sys.stderr) print('I: please execute "cd .." and inspect the build results.'.format(os.getcwd()), file=sys.stderr) elif os.getcwd() != para['cwd']: print('I: upon return to the shell, current directory becomes {}'.format(para['cwd']), file=sys.stderr) print('I: please execute "cd {0}" before building the binary package'.format(os.getcwd()), file=sys.stderr) print('I: with dpkg-buildpackage (or debuild, pdebuild, sbuild, ...).', file=sys.stderr) return ####################################################################### # Test code ####################################################################### if __name__ == '__main__': main() debmake-4.2.2/debmake/read.py0000775000175000017500000000322612563440146016273 0ustar osamuosamu00000000000000#!/usr/bin/python3 # vim:se tw=0 sts=4 ts=4 et ai: """ Copyright © 2014 Osamu Aoki Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. """ ####################################################################### def read(file): ################################################################### # file: path to the file ################################################################### with open(file, mode='r', encoding='utf-8') as f: text = f.read() return text ####################################################################### # Test script ####################################################################### if __name__ == '__main__': print(read('read.py')) debmake-4.2.2/debmake/untar.py0000775000175000017500000001231512563440146016510 0ustar osamuosamu00000000000000#!/usr/bin/python3 # vim:se tw=0 sts=4 ts=4 et ai: """ Copyright © 2014 Osamu Aoki Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. """ import os import subprocess import sys import debmake.yn ########################################################################### # untar: called from debmake.main() ########################################################################### # tarball = package-version.tar.gz (or package_version.orig.tar.gz) # targz = tar.gz # srcdir = package-version # tar = True if -t, False if -a or -d # dist = True if -d, False if -a or -t # parent = package (original VCS directory for -d) # yes = True if -y, False as default ########################################################################### def untar(tarball, targz, srcdir, dist, tar, parent, yes): print('I: pwd = "{}"'.format(os.getcwd()), file=sys.stderr) if not os.path.isfile(tarball): print('E: missing the "{}" file.'.format(tarball), file=sys.stderr) exit(1) if tar: # -t if os.path.isdir(srcdir): print('I: use existing "{}".'.format(srcdir), file=sys.stderr) else: print('E: fail to find "{}".'.format(srcdir), file=sys.stderr) exit(1) else: # -a -d if os.path.isdir(srcdir): debmake.yn.yn('remove "{}" directory in untar'.format(srcdir), 'rm -rf ' + srcdir, yes) # setup command line if targz == 'tar.bz2': command = 'tar --bzip2 -xvf ' commandx = 'tar --bzip2 -tf ' elif targz == 'tar.xz': command = 'tar --xz -xvf ' commandx = 'tar --xz -tf ' elif targz == 'tar.gz': command = 'tar -xvzf ' commandx = 'tar -tzf ' else: print('E: the extension "{}" not supported.'.format(targz), file=sys.stderr) exit(1) command += tarball print('I: $ {}'.format(command), file=sys.stderr) if subprocess.call(command, shell=True) != 0: print('E: failed to untar.', file=sys.stderr) exit(1) print('I: untared {}.'.format(tarball), file=sys.stderr) # rename source directory commandx += tarball + '|grep -v /.' print('I: {}'.format(commandx), file=sys.stderr) try: tarsrcdirs = subprocess.check_output(commandx, shell=True, universal_newlines=True).strip().split('\n') except CalledProcessError: print('E: failed to list the stem directory of tar.', file=sys.stderr) exit(1) # tailing / may or may not exist. if len(tarsrcdirs) > 1: print('W: {} first level directories found.'.format(len(tarsrcdirs)), file=sys.stderr) if tarsrcdirs[0] =="": print('E: No first level directory found.', file=sys.stderr) exit(1) elif tarsrcdirs[0][-1:] == '/': tarsrcdir = tarsrcdirs[0][:-1] else: tarsrcdir = tarsrcdirs[0] if tarsrcdir != srcdir: print('I: move source tree from {} to {}.'.format(tarsrcdir, srcdir), file=sys.stderr) command = 'mv -f ' + tarsrcdir + ' ' + srcdir print('I: $ {}'.format(command), file=sys.stderr) if subprocess.call(command, shell=True) != 0: print('E: failed to move directory.', file=sys.stderr) exit(1) # copy debian/* for -d if dist and os.path.isdir(parent + '/debian'): command = 'cp -drl ' + parent + '/debian ' + srcdir + '/debian' # execute command: copy debian tree (with hardlink) print('I: $ {}'.format(command), file=sys.stderr) if subprocess.call(command, shell=True) != 0: print('E: cp -drl failed.', file=sys.stderr) exit(1) # cd srcdir os.chdir(srcdir) print('I: pwd = "{}"'.format(os.getcwd()), file=sys.stderr) return if __name__ == '__main__': # untar(tarball, targz, srcdir, dist, tar, parent) # -a os.chdir('tarball') untar("example.tar.gz", "tar.gz", "example-1.0", False, False, "") os.chdir('..') # -d os.chdir('dist') untar("example.tar.gz", "tar.gz", "example-1.0", True, False, "example") os.chdir('..') # -t os.chdir('tar') untar("", "tar.gz", "example-1.0", False, True, "") os.chdir('..') debmake-4.2.2/debmake/debs.py0000775000175000017500000002700212563440146016273 0ustar osamuosamu00000000000000#!/usr/bin/python3 # vim:se tw=0 sts=4 ts=4 et ai: """ Copyright © 2014 Osamu Aoki Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. """ import sys ########################################################################### def match_prefix(name, prefix): l = len(prefix) return (len(name) > 1) and (name[:l] == prefix) def match_suffix(name, suffix): l = len(suffix) return (len(name) > 1) and (name[-l:] == suffix) ########################################################################### # sanity: called from debmake.main() ########################################################################### def debs(binaryspec, package, monoarch, dh_with): ####################################################################### # parse binary package names and their specification: binaryspec -> debs ####################################################################### debs = [] # list pset = set() tset = set() dropch = "'" + '"' + " " + "\t" + "\n" for x0 in binaryspec.strip(dropch).split(','): x = x0.strip() ################################################################### # split: y[0] = bin-package-name-marker y[1] = bin-package-type ################################################################### y = x.split(':') if len(y) >= 3: print('E: -b does not support the 3rd argument yet: {}'.format(x), file=sys.stderr) exit(1) ################################################################### # get real binary package name: p ################################################################### p = y[0].strip() if p == '': p = package elif p == '-': p = package elif p[0] == '-': p = package + p # first default values and then override or update values a = 'any' # arch m = 'foreign' # muiti-arch t = '' # type dp = {'${misc:Depends}'} pd = set() ################################################################### # Prefix names should come first to be overriden later ################################################################### if match_prefix(p, 'lib'): a = 'any' m = 'same' t = 'lib' elif match_prefix(p, 'fonts-'): a = 'all' m = 'foreign' t = 'data' elif match_prefix(p, 'python-'): a = 'all' m = 'foreign' t = 'python' elif match_prefix(p, 'python3-'): a = 'all' m = 'foreign' t = 'python3' else: pass # Suffix names override if match_suffix(p, '-perl'): a = 'all' m = 'foreign' t = 'perl' elif match_suffix(p, '-dev'): a = 'any' m = 'same' t = 'dev' elif match_suffix(p, '-dbg'): a = 'any' m = 'same' t = 'dbg' elif match_suffix(p, '-bin') or \ match_suffix(p, 'tools') or \ match_suffix(p, 'utils'): a = 'any' m = 'foreign' t = 'bin' elif match_suffix(p, '-doc') or \ match_suffix(p, '-manual') or \ match_suffix(p, '-html'): a = 'all' m = 'foreign' t = 'doc' elif match_suffix(p, '-common'): a = 'all' m = 'foreign' t = 'data' else: pass ################################################################### # override if explicit 2nd argument exists, e.g. all in foo:all ################################################################### # The shorter match comes after the longer match if len(y) >= 2: t = y[1].strip() if match_prefix(t, 'an') or \ match_prefix(t, 'f'): # any foreign (deprecated) a = 'any' m = 'foreign' if t =='': t = 'bin' if match_prefix(t, 'b'): # bin a = 'any' m = 'foreign' t = 'bin' elif match_prefix(t, 'da'): # data a = 'all' m = 'foreign' t = 'data' elif match_prefix(t, 'db'): # dbg a = 'any' m = 'same' t = 'dbg' elif match_prefix(t, 'de'): # dev a = 'any' m = 'same' t = 'dev' elif match_prefix(t, 'do'): # doc a = 'all' m = 'foreign' t = 'doc' elif match_prefix(t, 'l'): # lib a = 'any' m = 'same' t = 'lib' elif match_prefix(t, 'pe') or (t == 'pl'): # perl a = 'all' m = 'foreign' t = 'perl' elif match_prefix(t, 'python3') or (t == 'py3'): # python3 a = 'all' m = 'foreign' t = 'python3' elif match_prefix(t, 'py'): # python a = 'all' m = 'foreign' t = 'python' elif match_prefix(t, 'ruby') or (t == 'rb'): # ruby a = 'all' m = 'foreign' t = 'ruby' elif match_prefix(t, 'sc') or (t == 'sh'): # script a = 'all' m = 'foreign' t = 'script' ############################################################### # ambiguous type values (but clear about arch/multi-arch ############################################################### elif match_prefix(t, 'an') or \ match_prefix(t, 'f'): # any foreign a = 'any' m = 'foreign' if t == '': t = 'bin' elif match_prefix(t, 'a'): # all a = 'all' m = 'foreign' if t == '': t = 'script' elif match_prefix(t, 'sa'): # same a = 'any' m = 'same' if t == '': t = 'lib' elif t == '': # bin as default pass else: print('E: -b: {} has undefined type: {}'.format(p, t), file=sys.stderr) exit(1) ################################################################### # update binary package type from dh_with and arch setting ################################################################### if t == '': if 'perl_build' in dh_with: a = 'all' t = 'perl' elif 'perl_makemaker' in dh_with: a = 'all' t = 'perl' elif 'python2' in dh_with: a = 'all' t = 'python' elif 'python3' in dh_with: a = 'all' t = 'python3' elif a == 'any': # bin as default t = 'bin' else: print('E: -b: {} has arch={}, dh_with={} and null type.'.format(p, a, dh_with), file=sys.stderr) exit(1) # t always have non NULL string value ! ################################################################### # monoarch = non-multi-arch ################################################################### if monoarch: m = '' ################################################################### # multi arch and library package ################################################################### if (not monoarch) and t == 'lib': # set this only for M-A library packages pd.update({'${misc:Pre-Depends}'}) ################################################################### # update binary package dependency by package type etc. ################################################################### if t == 'bin': # executable dp.update({'${shlibs:Depends}'}) elif t == 'lib': # library dp.update({'${shlibs:Depends}'}) elif t == 'perl': # dh_perl(1) dp.update({'${perl:Depends}'}) elif t == 'python': # dh_python2 dp.update({'${python:Depends}'}) elif t == 'python3': # dh_python3 dp.update({'${python3:Depends}'}) elif t == 'ruby': # gem2deb ??? XXXX FIXME XXXX dp.update({'${ruby:Depends}'}) else: pass ################################################################### # loging and sanity check ################################################################### print('I: binary package={} Type={} / Arch={} M-A={}'.format(p, t, a, m), file=sys.stderr) if p in pset: print('E: duplicate definition of package name "{}"'.format(p), file=sys.stderr) exit(1) pset.update({p}) if t in tset: if t != 'dbg': print('W: duplicate definition of package type "{}"'.format(t), file=sys.stderr) print('W: *** manual modifiocation of debian/{}.install required ***'.format(p), file=sys.stderr) tset.update({t}) ################################################################### # append dictionary to a list ################################################################### debs.append({'package': p, 'arch': a, 'multiarch': m, 'depends': dp, 'pre-depends': pd, 'type': t}) ################################################################### return debs ####################################################################### # Test script ####################################################################### if __name__ == '__main__': print(match_prefix('deb', 'deb')) if match_prefix('deb', 'deb'): print('deb match deb') else: print('deb not match deb') print('----- no dh_with') # dh_with = set() # binaryspec = '-,-doc:doc,libpackage1, libpackage-dev, libpackage1-dbg' # monoarch = False # debs(binaryspec, 'package', monoarch, dh_with) # print('----- dh_with python3') # dh_with = set({'python3'}) # debs(binaryspec, 'package', monoarch, dh_with) # print('----- monoarch True dh_with python3') # monoarch = True # debs(binaryspec, 'package', monoarch, dh_with) debmake-4.2.2/debmake/lc.py0000775000175000017500000015022112563440146015754 0ustar osamuosamu00000000000000#!/usr/bin/python3 # vim:se tw=0 sts=4 ts=4 et ai: """ Copyright © 2014 Osamu Aoki Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. """ import re ############################################################################### # The regex of devscripts: licensecheck (version 2.14.1) was referenced. # 85 characters needed for # "the Apache Group for use in the Apache HTTP server project # (http://www.apache.org/)" ############################################################################### LMAX = 1200 # max junk text (head and tail) # order rules by specific to generic list_main = [] # main rule list = [(name, regex, [variable, ...]), ...] list_sub = [] # substring rule list for debug ############################################################################### re_drop = re.compile(r'("|`|‘|’|“|”|'|' + r"')", re.IGNORECASE) re_connect = re.compile(r'- ', re.IGNORECASE) def pattern(text, tail=' '): text = re_drop.sub('',text) # drop quotation marks text = ' '.join(text.split()) # normalize white space(s) text = re_connect.sub('', text) + tail # connect words return text # pattern normally ends with ' ' def eval_sub(sub): rtext = eval(sub) if rtext[-3:] == ' )?': rtext = rtext[:-1] return rtext # drop "?" for vanishable "(.... )?" patterns # non greedy rhead0=r'^(?P.{0,' + '{}'.format(LMAX) + r'}?)' rtail0=r'(?P.{0,' + '{}'.format(LMAX) + r'}?)$' def regex(reg, rhead=rhead0, rtail=rtail0): return re.compile(rhead + reg + rtail, re.IGNORECASE) ############################################################################### # BSD Exact ############################################################################### list_sub += ['r_BSD0'] r_BSD0 = pattern(r''' Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: ''') list_sub += ['r_BSD1'] r_BSD1 = pattern(r''' (?:..? )?Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer\. ''') list_sub += ['r_BSD2'] r_BSD2 = pattern(r''' (?:..? )?Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/ or other materials provided with the distribution\. ''') list_sub += ['r_BSD3'] r_BSD3 = pattern(r''' (?P(?:..? )?All advertising materials mentioning features or use of this software must display the following acknowledgement: This product includes software developed by .{2,85}\. )? ''', tail='') list_sub += ['r_BSD4'] r_BSD4 = pattern(r''' (?P(?:..? )?Neither the name of .{2,85} nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission\. )? ''', tail='') list_sub += ['r_BSDW'] r_BSDW = pattern(r''' (?PTHIS SOFTWARE IS PROVIDED BY (?P.{2,85}) ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL .{2,85} BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES \(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION\) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT \(INCLUDING NEGLIGENCE OR OTHERWISE\) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE\. )? ''', tail='') ### BSD {2,3,4}-clause list_main += [('BSD', 'EXACT', regex(r_BSD0 + r_BSD1 + r_BSD2 + r_BSD3 + r_BSD4 + r_BSDW[:-1]), ['bsd3', 'name', 'noendorse', 'nowarranty', 'head', 'tail'])] ############################################################################### # BSD Generic ############################################################################### # list 'bsd3' before 'name' list_sub += ['r_BSD0G'] r_BSD0G = pattern(r''' Redistribution and use in source and binary forms, with or without modification, are permitted(?P \(subject to the limitations in the disclaimer below\))? provided that the following conditions are met[:.] ''') list_sub += ['r_BSD1G'] r_BSD1G = pattern(r''' (?:..? )?Redistributions of source code must retain the above copyright notice, this list of conditions,? and the following disclaimer\. ''') # ,? for XFREE86 1.1 list_sub += ['r_BSD2G'] r_BSD2G = pattern(r''' (?:..? )?Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and(?:/ ?or)? other materials provided with the distribution(?:\.|, and in the same place and form as other copyright, license and disclaimer information\.) ''') # XFree86 1.1 has the last phrase list_sub += ['r_BSD3G'] r_BSD3G = pattern(r''' (?P(?:..? )?All advertising materials mentioning features or use of this software must display the following acknowledge?ment. This product includes software developed by .{2,85}\. )? ''', tail='') # dropping "e" as variant list_sub += ['r_BSD4G'] r_BSD4G = pattern(r''' (?P(?:..? |and that )?(?:Except as contained in this notice, )?.{2,85} be used (?:to endorse or promote products derived from|in advertising or (?:publicity pertaining to distribution of|otherwise to promote the sale, use or other dealings in)) (?:this|the) software without (?:specific,? )?(?:prior written|written prior) (?:permission|authorization)(?: from .{2,85}| of .{2,85})?\. )? ''', tail='') # Some XFree86 variant has leading clarification with shall list_sub += ['r_BSDWG'] r_BSDWG = pattern(r''' (?P(?PNO EXPRESS(?:ED)? OR IMPLIED LICENSES TO ANY PARTYS PATENT RIGHTS ARE GRANTED BY THIS LICENSE. )?THIS SOFTWARE IS PROVIDED(?: BY (?P.{2,85}))? AS.IS AND ANY EXPRESS(?:ED)? OR IMPLIED (?:WARANTY\.|WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL .{2,85} BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES \(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION\) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT \(INCLUDING NEGLIGENCE OR OTHERWISE\) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE\.) )? ''', tail='') # "EXPRESSED" is what XFREE86 1.1 uses. BSD uses "EXPRESS" ### BSD {2,3,4}-clause list_main += [('BSD', 'GENERIC', regex(r_BSD0G + r_BSD1G + r_BSD2G + r_BSD3G + r_BSD4G + r_BSDWG[:-1]), ['bsd3', 'name', 'subject', 'noendorse', 'nowarranty', 'patent', 'head', 'tail'])] ############################################################################### # Apache family (BSD0, BSD1, BSD2 are the same one) ############################################################################### list_sub += ['r_Apache3'] # BSD3 alternative r_Apache3 = pattern(r''' (?:..? )?The end-user documentation included with the redistribution, if any, must include the following acknowledgment: This product includes software developed by .{2,85}\. Alternately, this acknowledgment may appear in the software itself, if and wherever such third-party acknowledgments normally appear. ''') list_sub += ['r_Apache4'] # BSD4 alternative r_Apache4 = pattern(r''' (?:..? )?The names? .{2,85} must not be used to endorse or promote products derived from this software without prior written permission. For written permission, please contact .{2,85}. ''') list_sub += ['r_Apache5'] # trade mark restriction r_Apache5 = pattern(r''' (?:..? )?Products derived from this software may not be called .{3,12},? nor may .{3,12} appear in their name. without prior written permission of .{2,85}\. ''') list_sub += ['r_Apache6'] # BSD3 alternative r_Apache6 = pattern(r''' (?:..? )?Redistributions of any form whatsoever must retain the following acknowledgment: This product includes software developed by .{2,85} for use in .{2,85}\. ''') ### Apache 1.0 list_main += [('Apache-1.0', 'EXACT', regex(r_BSD0G + r_BSD1G + r_BSD2G + r_BSD3G + r_Apache4 + r_Apache5 + r_Apache6 + r_BSDWG[:-1]), ['bsd3', 'name', 'subject', 'nowarranty', 'patent', 'head', 'tail'])] ### Apache 1.1 list_main += [('Apache-1.1', 'EXACT', regex(r_BSD0G + r_BSD1G + r_BSD2G + r_Apache3 + r_Apache4 + r_Apache5 + r_BSDWG[:-1]), ['name', 'subject', 'nowarranty', 'patent', 'head', 'tail'])] ############################################################################### # MIT=Expat: Exact ############################################################################### list_sub += ['r_pemission_expat'] r_pemission_expat = pattern(r''' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files \(the Software\), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: ''') list_sub += ['r_notice_expat'] r_notice_expat = pattern(r''' The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. ''') list_sub += ['r_disclaimer_expat'] r_disclaimer_expat = pattern(r''' (?PTHE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ) ''', tail='') ### Expat list_main += [('MIT', 'Expat', regex(r_pemission_expat + r_notice_expat + r_disclaimer_expat), ['head', 'tail', 'nowarranty'])] ############################################################################### # MIT: Generic (trained with xorg source data) ############################################################################### # Expat variants = r_pemission_expat with variants list_sub += ['r_pemission_expatG'] r_pemission_expatG = pattern(r''' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files \(the (?:Software|Materials)\), to deal in the Software without restriction, including without limitation(?: on)? the rights to use, copy, modify, (?:merge, )?(?:publish, )?distribute, (?:sub ?license, )?and(?:/ ?or)? sell copies of the Software[,.:](?: and to permit persons to whom the Software is furnished to do so(?:[,:]|, subject to the following conditions[.:]|, provided that))? ''') # Expat variants = r_notice_expat with variants list_sub += ['r_notice_expatG'] r_notice_expatG = pattern(r''' The above copyright notice(?:|s|\(s\)) and this permission notice (?P\(including the next paragraph\) )?(?:shall be included|appear) in all copies(?: or substantial portions)?(?: of the Software)?(?: and that both the above copyright notice(?:|s|\(s\)) and this permission notice appear in supporting documentation)?. ''') # Expat variants = r_disclaimer_expat with variants list_sub += ['r_disclaimer_expatG'] r_disclaimer_expatG = pattern(r''' (?PTHE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS(?:ED)? OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-?INFRINGEMENT(?: OF THIRD PARTY RIGHTS)?. IN NO EVENT SHALL .{2,85} BE LIABLE FOR ANY CLAIM,(?: OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS| DAMAGES,?(?: INCLUDING, BUT NOT LIMITED TO CONSEQUENTIAL OR INCIDENTAL DAMAGES,)? OR OTHER LIABILITY), WHETHER IN AN ACTION OF CONTRACT, (?:TORT OR OTHERWISE|NEGLIGENCE OR OTHER TORTIOUS ACTION), ARISING( FROM,)? OUT OF OR IN CONNECTION WITH(?: THE SOFTWARE OR)? THE USE OR (?:OTHER DEALINGS IN THE|PERFORMANCE OF THIS) SOFTWARE. )? ''', tail='') # noendorse (=BSD4) is not used in Expat but used in many old MIT licenses # MIT Xorg variants with warranty list_main += [('MIT', 'GENERIC', regex(r_pemission_expatG + r_notice_expatG + r_disclaimer_expatG[:-1] + r_BSD4G), ['requiredisclaimer', 'nowarranty', 'noendorse', 'head', 'tail']), ] ############################################################################### # ISC: Exact ############################################################################### list_sub += ['r_pemission_isc'] r_pemission_isc = pattern(r''' Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, ''') list_sub += ['r_notice_isc'] r_notice_isc = pattern(r''' provided that the above copyright notice and this permission notice appear in all copies. ''') list_sub += ['r_disclaimer_isc'] r_disclaimer_isc = pattern(r''' (?PTHE SOFTWARE IS PROVIDED AS IS AND ISC DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL (?P.{2,85}) BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ) ''', tail='') ### ISC list_main += [('ISC', 'EXACT', regex(r_pemission_isc + r_notice_isc + r_disclaimer_isc), ['head', 'tail', 'nowarranty', 'name'])] ############################################################################### # ISC: Generic ############################################################################### list_sub += ['r_pemission_iscG'] r_pemission_iscG = pattern(r''' Permission to use, copy, modify, (:?and(?:/ ?or)? distribute |distribute, and(?:/ ?or)? (?:sell|sublicense) )this software (:?and its documentation )?for any purpose (:?is hereby granted without fee,|(?:and )?(?:with or )?without fee is hereby granted,) ''') list_sub += ['r_notice_iscG'] r_notice_iscG = pattern(r''' provided that the above copyright notices?(?: and this permission notice)? appear in all copies(:? and that both (?:that|those) copyright notices? and this permission notice appear in supporting documentation)?[.,]? ''') list_sub += ['r_disclaimer_iscG'] r_disclaimer_iscG = pattern(r''' (?:No trademark license .{2,200} is hereby granted\. .{50,1000} is made\. )?(?:.{2,85} MAKES? NO REPRESENTATIONS .{2,80} FOR ANY PURPOSE\. )?(?P(?:.{2,85} make(?:|S|\(S\)) (?:no|any) representations? about the suitability of this software for any purpose. )?(?:(?:It|THE SOFTWARE) is provided as is and )?(?:.{2,85} DISCLAIM(?:|S|\(S\)) ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,? INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS[,.] IN NO EVENT SHALL .{2,85} BE LIABLE FOR ANY SPECIAL,(?: DIRECT,)? INDIRECT,? OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE\.|(?:It|THE SOFTWARE) is provided as is without express or implied warranty\.) )? ''', tail='') # First 2 are for Adobe Display PostScript r_disclaimer_iscGx = pattern(r''' (?P(?:.{2,85} make(?:|S|\(S\)) (?:no|any) representations? about the suitability of this software for any purpose. )?(?:It|THE SOFTWARE) is provided as is(?: without express or implied warranty\.| and .{2,85} DISCLAIM(?:|S|\(S\)) ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,? INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS[,.] IN NO EVENT SHALL .{2,85} BE LIABLE FOR ANY SPECIAL,(?: DIRECT,)? INDIRECT,? OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.) )? ''', tail='') # ISC variants with no-endorse in the middle list_main += [('ISC', 'VARIANT_1', regex(r_pemission_iscG + r_notice_iscG + r_BSD4G + r_disclaimer_iscG[:-1]), ['nowarranty', 'noendorse', 'head', 'tail']), ] # ISC variants with no-endorse at the end list_main += [('ISC', 'VARIANT_2', regex(r_pemission_iscG + r_notice_iscG + r_notice_expatG + r_disclaimer_expatG[:-1] + r_BSD4G ), ['nowarranty', 'noendorse', 'head', 'tail']), ] ############################################################################### # Zlib: Exact ############################################################################### list_sub += ['r_disclaimer_zlib'] r_disclaimer_zlib = pattern(r''' (?PThis software is provided as.is, without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. ) ''', tail='') list_sub += ['r_permission_zlib'] r_permission_zlib = pattern(r''' Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions[:] ''') list_sub += ['r_notice_zlib'] r_notice_zlib = pattern(r''' (?:..? )?The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. (?:..? )?Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. (?:..? )?This notice may not be removed or altered from any source distribution. ''') ### Zlib list_main += [('Zlib', 'EXACT', regex(r_disclaimer_zlib + r_permission_zlib + r_notice_zlib), ['phead', 'tail', 'nowarranty'])] ############################################################################### # DEC ############################################################################### list_sub += ['r_permission_dec'] r_permission_dec = pattern(r''' This software is furnished under license and may be used and copied only in accordance with the following terms and conditions. Subject to these conditions, you may download, copy, install, use, modify and distribute this software in source and(?:/ ?or)? binary form. No title or ownership is transferred hereby. ''') list_sub += ['r_notice_dec'] r_notice_dec = pattern(r''' (?:..? )?Any source code used, modified or distributed must reproduce and retain this copyright notice and list of conditions as they appear in the source file. ''') list_sub += ['r_noendorse_dec'] r_noendorse_dec = pattern(r''' (?P(?:..? )?No right is granted to use any trade name, trademark, or logo of .{2,85}. Neither .{2,85} name nor any trademark or logo of .{2,85} may be used to endorse or promote products derived from this software without the prior written permission of .{2,85}. )? ''', tail='') list_sub += ['r_disclaimer_dec'] r_disclaimer_dec = pattern(r''' (?P(?:..? )?This software is provided AS.IS and any express or implied warranties, including but not limited to, any implied warranties of merchantability, fitness for a particular purpose, or non-infringement are disclaimed. In no event shall .{2,85} be liable for any damages whatsoever, and in particular, .{2,85} shall not be liable for special, indirect, consequential, or incidental damages or damages for lost profits, loss of revenue or loss of use, whether such damages arise in contract, negligence, tort, under statute, in equity, at law or otherwise, even if advised of the possibility of such damage. )? ''', tail='') # MIT DEC variants with warranty list_main += [('MIT', 'DEC', regex(r_permission_dec + r_notice_dec + r_noendorse_dec + r_disclaimer_dec[:-1]), ['nowarranty', 'noendorse', 'head', 'tail']), ] ############################################################################### # ISC/X11 hybrid with waranty ############################################################################### list_sub += ['r_BSD3A'] # BSD3 alternative r_BSD3A = pattern(r''' (?:..? )?The end-user documentation included with the redistribution, if any, must include the following acknowledgment: This product includes software developed by .{2,85}(?:, in the same place and form as other third-party acknowledgments)?\. Alternately, this acknowledgment may appear in the software itself, in the same form and location as other such third-party acknowledgments. ''') list_main += [('MIT', 'XORG+BSD', regex(r_pemission_expatG + r_BSD1G +r_BSD2G +r_BSD3A + r_BSD4G + r_BSDWG[:-1] ), ['nowarranty', 'noendorse', 'head', 'tail']), ] ############################################################################### # SGI ############################################################################### list_sub += ['r_notice_sgi'] r_notice_sgi = pattern(r''' The above copyright notice including the dates of first publication and either this permission notice or a reference to http://oss.sgi.com/projects/FreeB/ shall be included in all copies or substantial portions of the Software. ''') # SGI list_main += [('SGI-B-2.0', 'EXACT', regex(r_pemission_expatG + r_notice_sgi + r_disclaimer_expatG[:-1] + r_BSD4G), ['nowarranty', 'noendorse', 'head', 'tail']), ] ############################################################################### # Mozilla ############################################################################### r_MPL1 = pattern(r''' The contents of this file are subject to the Mozilla Public License Version (?P\d+(?:\.\d+)?) \(the License\); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.mozilla.org/MPL/ Software distributed under the License is distributed on an AS IS basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License. ''') r_MPL2 = pattern(r''' This Source Code Form is subject to the terms of the Mozilla Public License, v. (?P\d+(?:\.\d+)?). If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/(?:\d+(?:\.\d+)?)/.(?P This Source Code Form is Incompatible With Secondary Licenses, as defined by the Mozilla Public License, v. (?:\d+(?:\.\d+)?).)? ''') list_main += [('MPL', 'VARIANT1', regex(r_MPL1), ['version'])] list_main += [('MPL', 'VARIANT2', regex(r_MPL2), ['version', 'incompatible'])] ############################################################################### # PERMISSIVE license from GNU releted sources ############################################################################### # GNU All-Permissive License r_PM0 = pattern(r''' Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved.(?P This file is offered as.is, without (?:any warranty|warranty of any kind)?.)? ''') # PERMISSIVE (aclocal.m4, libtool) r_PM1 = pattern(r''' free software. (?:as a special exception )?the (Free Software Foundation|author|author\(s\)) gives unlimited permission to copy and(?:/ ?or)? distribute it, with or without modifications, as long as this notice is preserved.(?P This (program|file) is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, to the extent permitted by law; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.)? ''') r_PM2 = pattern(r''' This file (?:may|can) be copied and used freely without restrictions. It (?:may|can) be used in projects which are not available under (?:a GNU|the GNU General) Public License,? but which still want to provide support for the GNU gettext functionality. ''') r_PM3 = pattern(r''' This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. ''') list_main += [('PERMISSIVE', 'VARIANT0', regex(r_PM0), ['nowarranty'])] list_main += [('PERMISSIVE', 'VARIANT1', regex(r_PM1), ['nowarranty'])] list_main += [('PERMISSIVE', 'VARIANT2', regex(r_PM2), [])] list_main += [('PERMISSIVE', 'VARIANT3', regex(r_PM3), [])] ############################################################################### # Reference to license name (Generic style) ############################################################################### # Permission clause # under the terms of the list_sub += ['r_under'] r_under = pattern(r''' (?:you (?:can|may) redistribute it and(?:/ ?or)? modify .{2,85} under |Permission(?: is granted)? to copy, distribute,? and(?:/ ?or)? modify this document under |Permission(?: is granted)? to use, copy, modify,? (?:merge, )?(?:publish, )?distribute,? (?:sublicense,? )and(?:/ ?or)? sell .{2,85} under |Permission(?: is granted)? to use, copy, modify,? (?:merge,? )?(?:publish,? )?and(?:/ ?or)? distribute .{2,85} under |.{2,85} (?:is|are) licensed under |distribute under |subject to |Released under |free software .{2,85} under ) ''', tail='') + r'(?:the (?:terms of the )?)?' ############################################################################### # GNU version list_sub += ['r_version1'] r_version1 = pattern(r''' (?:(?:as )?published by the Free Software Foundation[,;:.]? )?(?:either )?versions? (?P\d+(?:\.\d+)?)(?: of the License)?[,.]?(?: \(?only\)?\.? | or (?:\(at your option\)? )?(?:any )?(?Plater)(?: versions?)?\.?|) (?:published by the Free Software Foundation[,;:.]? )?''', tail='') # wrong additional "s" is used in some software # GNU Free Documentation License, Version 1.1 or any later version published # XXXXX FIXME XXXXX r_version2 not tested list_sub += ['r_version2'] r_version2 = pattern(r''' (?:either )?versions? (?P\d+(?:\.\d+)?)(?: of the License)?(?:\.| \(?only\)\.?|, or (?:\(at your option\) )?(?:any )?(?Plater)(?: versions?)?\.)? ''') + r'(?: of the\s)?' # wrong additional "s" is used in some software ############################################################################### list_sub += ['r_LGPL'] r_LGPL = r'(?:GNU (?:Library|Lesser) General Public License|(?:GNU )?LGPL).? ' list_main += [('LGPL', 'VARIANT1', regex(r_under + r_LGPL + r_version1), ['head', 'version', 'later', 'tail'])] list_main += [ ('LGPL', 'VARIANT2', regex(r_under + r_version2 + r_LGPL), ['head', 'version', 'later', 'tail'])] list_sub += ['r_AGPL'] r_AGPL = r'(?:GNU Affero General Public License|(?:GNU )?AGPL).? ' list_main += [('AGPL', 'VARIANT1', regex(r_under + r_AGPL + r_version1), ['head', 'version', 'later', 'tail'])] list_main += [ ('AGPL', 'VARIANT2', regex(r_under + r_version2 + r_AGPL), ['head', 'version', 'later', 'tail']) ] list_sub += ['r_GFDL'] r_GFDL = r'(?:GNU Free Documentation License|(?:GNU )?GFDL|GNU FDL).? ' list_main += [ ('GFDL', 'VARIANT1', regex(r_under + r_GFDL + r_version1), ['head', 'version', 'later', 'tail']), ] list_main += [ ('GFDL', 'VARIANT2', regex(r_under + r_version2 + r_GFDL), ['head', 'version', 'later', 'tail']), ] list_sub += ['r_GPL'] r_GPL = r'(?:GNU General Public License|(?:GNU )?GPL).? ' list_main += [ ('GPL', 'VARIANT1', regex(r_under + r_GPL + r_version1), ['head', 'version', 'later', 'tail']), ] list_main += [ ('GPL', 'VARIANT2', regex(r_under + r_version2 + r_GPL), ['head', 'version', 'later', 'tail']), ] list_sub += ['r_MPL'] r_MPL = r'Mozilla Public License.? ' list_main += [ ('MPL', 'VARIANT1', regex(r_under + r_MPL + r_version1), ['head', 'version', 'later', 'tail']), ] list_main += [ ('MPL', 'VARIANT2', regex(r_under + r_version2 + r_MPL), ['head', 'version', 'later', 'tail']), ] list_sub += ['r_Artistic'] r_Artistic = r'Artistic License.? ' list_main += [ ('Artistic', 'VARIANT1', regex(r_under + r_Artistic + r_version1), ['head', 'version', 'later', 'tail']), ] list_main += [ ('Artistic', 'VARIANT2', regex(r_under + r_version2 + r_Artistic), ['head', 'version', 'later', 'tail']), ] ############################################################################### # Reference to the package license ############################################################################### r_SM0 = pattern(r''' This file is distributed under the same license as .{5,40}\. ''') list_main += [('_SAME_', 'VARIANT0', regex(r_SM0), [])] ############################################################################### # Reference to license name (specific style) ############################################################################### list_main += [ ('Apache', 'EXTRA', regex(pattern(r''' (?:.{2,85} licenses? this file to you|licensed) under the Apache License, Version (?P[^ ]+) \(the LICENSE\). ''')), ['version','head', 'tail']), ('QPL', 'EXTRA', regex(pattern(r''' (?PThis file is part of the .*Qt GUI Toolkit. This file )?may be distributed under the terms of the Q Public License as defined. ''')), ['toolkit', 'head', 'tail']), ('Perl', 'EXTRA', regex(pattern(r''' This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. ''')), []), ('Beerware', 'EXTRA', regex(r'\(THE BEER-WARE LICENSE\).' ), []), ('PHP', 'EXTRA', regex(pattern(r''' This source file is subject to version (?P[^ ]+) of the PHP license. ''')), ['version']), ('CeCILL', 'EXTRA', regex(pattern(r''' under the terms of the CeCILL(?:-(?P[^ ]+))?. ''')), ['version']), ('SGI-B', 'EXTRA', regex(pattern(r''' (?:permitted in|under) the SGI Free Software License B, Version (?P[^ ]+) \(the License\). ''')), ['version']), ('Public domain', 'EXTRA', regex(pattern(r''' is in the public domain. ''')), []), ('CDDL', 'EXTRA', regex(pattern(r'''' terms of the Common Development and Distribution License (?:, Version (?P[^ ]+)? \(the License\)). ''')), ['version']), ('Ms-PL', 'EXTRA', regex(pattern(r''' Microsoft Permissive License \(Ms-PL\). ''')), []), ('BSL', 'EXTRA', regex(pattern(r''' Distributed under the Boost Software License, Version (?P[^ ]+)\. ''')), ['version']), ('PSF', 'EXTRA', regex(pattern(r''' PYTHON SOFTWARE FOUNDATION LICENSE (VERSION (?P[^ ]+))?. ''')), ['version']), ('libpng', 'EXTRA', regex(pattern(r''' This code is released under the libpng license. ''')), []), ('APSL', 'EXTRA', regex(pattern(r''' subject to the Apple Public Source License Version (?P[^ ]+) \(the License\). ''')), ['version']), ('LPPL', 'EXTRA', regex(pattern(r''' (?:under the conditions of the LaTeX Project Public License, |under the terms of the LaTeX Project Public License Distributed from CTAN archives in directory macros/latex/base/lppl.txt; )either version (?P[^ ]+) of (?:this|the) license,? or \(at your option\) any later version. ''')), ['version']), ('W3C', 'EXTRA', regex(pattern(r''' distributed under the W3C..? Software License in ''')), []), # W3C(R) ('WTFPL', 'EXTRA', regex(pattern(r''' Do What The Fuck You Want To Public License (?:, Version (?P[^, ]+))?. ''')), ['version']), ('WTFPL', 'EXTRA', regex(pattern(r''' (?:License WTFPL|Under (?:the|a) WTFPL). ''')), []), ('__UNKNOWN__', '', regex(r'.*'), []), # always true ] ############################################################################### # exception clause ############################################################################### r_autoconf1 = pattern(r''' As a special exception to the GNU General Public License, if you distribute this file as part of a program that contains a configuration script generated by Autoconf, you may include it under the same distribution terms that you use for the rest of that program.''', tail='') r_autoconf2 = pattern(r''' As a special exception to the GNU General Public License, if you distribute this file as part of a program that contains a configuration script generated by Autoconf, you may include it under the same distribution terms that you use for the rest of that program. This Exception is an additional permission under section 7 of the GNU General Public License, version 3 \(.?GPLv3.?\).''', tail='') r_autoconf3 = pattern(r''' As a special exception to the GNU General Public License, this file may be distributed as part of a program that contains a configuration script generated by Autoconf, under the same distribution terms as the rest of that program.''', tail='') r_autoconf4 = pattern(r''' Additional permission under section 7 of the GNU General Public License, version 3 \(.?GPLv3.?\): If you convey this file as part of a work that contains a configuration script generated by Autoconf, you may do so under terms of your choice.''', tail='') r_libtool = pattern(r''' As a special exception to the GNU General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program.''', tail='') r_bison = pattern(r''' As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work under terms of your choice, so long as that work isn.t itself a parser generator using the skeleton or a modified version thereof as a parser skeleton. Alternatively, if you modify or redistribute the parser skeleton itself, you may \(at your option\) remove this special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception.''', tail='') r_font = pattern(r''' As a special exception, if you create a document which uses this font, and embed this font or unaltered portions of this font into the document, this font does not by itself cause the resulting document to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the document might be covered by the GNU General Public License. If you modify this font, you may extend this exception to your version of the font, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version.''', tail='') list_exceptions = [ ('autoconf', regex(r_autoconf1), True), ('autoconf', regex(r_autoconf2), True), ('autoconf', regex(r_autoconf3), True), ('autoconf', regex(r_autoconf4), True), ('libtool', regex(r_libtool), True), ('bison', regex(r_bison), True), ('font', regex(r_font), False), ] regex_exception = regex(r'exception') list_attribs = [ ('The FSF address in the above text is the old one.', regex(r'(?:675 Mass Ave|59 Temple Place|51 Franklin Steet|02139|02111-1307)')), ] list_permissive = [ 'PERMISSIVE', 'MIT', 'ISC', 'Zlib', 'BSD-2-Clause', 'BSD-3-Clause', ] ############################################################################### # GNU License text # 300 BYTES: Most license headers included in the source # 10000 BYTES: Full license text for GPL like license # "Definitions": not present in normal license headers re_FULL = re.compile(r'definition', re.IGNORECASE) size_FULL = 500 re_LICENSE_HEADER = regex(pattern(r''' Standard License Header COPYRIGHT'''), rhead=r'^(?P.*?)', rtail='(?P.*?)$') re_LICENSE_AFFERO = regex(pattern(r''' software over a computer network.*Affero General Public License '''), rhead=r'^(?P.*?)', rtail='(?P.*?)$') re_LICENSE = regex(pattern(r''' (?:(?PAFFERO GENERAL PUBLIC LICENSE.*) |(?PGNU Free Documentation License.*) |(?PGNU (?:Library|Lesser) General Public License.*) |(?PGNU General Public License.*) )version (?P\d+(?:\.\d+)?),? o.*later'''), rhead=r'^(?P.*?)', rtail='(?P.*?)$') ############################################################################### # license name: file name, licence full name licensefiles = { 'Apache-2.0' : ('Apache-2.0','Apache License Version 2.0\n '), 'Artistic' : ('Artistic', '"Artistic License"\n '), 'BSD-3-Clause' : ('BSD', 'BSD 3-clause "New" or "Revised"\n License'), 'GFDL-1.2' : ('GFDL-1.2', 'GNU Free Documentation License\n Version 1.2'), 'GFDL-1.2+' : ('GFDL-1.2', 'GNU Free Documentation License\n Version 1.2'), 'GFDL-1.3' : ('GFDL-1.3', 'GNU Free Documentation License\n Version 1.3'), 'GFDL-1.3+' : ('GFDL-1.3', 'GNU Free Documentation License\n Version 1.3'), 'GPL-1.0' : ('GPL-1', 'GNU General Public License\n Version 1'), 'GPL-1.0+' : ('GPL-1', 'GNU General Public License\n Version 1'), 'GPL-2.0' : ('GPL-2', 'GNU General Public License\n Version 2'), 'GPL-2.0+' : ('GPL-2', 'GNU General Public License\n Version 2'), 'GPL-3.0' : ('GPL-3', 'GNU General Public License\n Version 3'), 'GPL-3.0+' : ('GPL-3', 'GNU General Public License\n Version 3'), 'LGPL-2.0' : ('LGPL-2', 'GNU Library General Public License\n Version 2'), 'LGPL-2.0+' : ('LGPL-2', 'GNU Library General Public License\n Version 2'), 'LGPL-2.1' : ('LGPL-2.1', 'GNU Lesser General Public License\n Version 2.1'), 'LGPL-2.1+' : ('LGPL-2.1', 'GNU Lesser General Public License\n Version 2.1'), 'LGPL-3.0' : ('LGPL-3', 'GNU Lesser General Public License\n Version 3'), 'LGPL-3.0+' : ('LGPL-3', 'GNU Lesser General Public License\n Version 3')} ######################################################################################### def normalize(license_lines): # normalize license to a single normalized line with single space license_data = [] for line in license_lines: line = line.strip() license_data.extend(line.split()) try: license_data.remove('') # remove empty words except ValueError: pass return pattern(' '.join(license_data)) ######################################################################################### def lc(norm_text, license_lines, mode): # norm_text: normalized license lines to be analized # license_lines: original license lines for output # mode: license check mode # mode = 0: mode for copyright file generation; same as mode == 2 for lc.py if mode == 0: mode = 2 # abs(mode) = 1: mode for the license scan (1 line output; -c, -cccc) # abs(mode) = 2: mode for the license scan (mode = 1 + license text; -cc, -ccccc) # abs(mode) = 3: mode for the license scan (mode = 2 + comments; -ccc, -cccccc) # abs(mode) = 4: mode for the license scan (mode = 3 + match text; debug only) # mode < 0: add pattern index id (for -cccc, -ccccc, -cccccc) # return: text to be placed after "License: " # return: flag for permissive license ##################################################################################### # 1st-line part license = '' # License type: GPL BSD id = '' # "FULL_LICENSE" or "" version = '' # 3 -3-Clause suffix = '' # + "" with_exception = '' # ' with ' + ... + ' exception' permissive = False # not in the 1st-line part set_exceptions = set() # add exceptions found in the copyright text set_attribs = set() # add attribute found in the copyright text set_subtypes = set() # add invisible subtype to the normal license type="license + id + version + suffix" such as "BSD-3-Clause" match_text = '' # mode == 4 used by debug if len(norm_text) == 0: license = '__NO_LICENSE_TEXT__' text = '' elif len(norm_text) > size_FULL and re_FULL.search(norm_text): # full license text (very rough guess) lh = re_LICENSE_HEADER.search(norm_text) la = re_LICENSE_AFFERO.search(norm_text) if la: license = 'AGPL' version = '-1.0' suffix = '+' id = 'FULL_LICENSE' elif lh: norm_text = lh.group('tail').strip() #print('~~~>>> : {}'.format(norm_text)) l = re_LICENSE.search(norm_text) if l: if l.group('agpl'): license = 'AGPL' version = l.group('version') id = 'FULL_LICENSE' elif l.group('lgpl'): license = 'LGPL' version = l.group('version') id = 'FULL_LICENSE' elif l.group('gfdl'): license = 'GFDL' version = l.group('version') id = 'FULL_LICENSE' elif l.group('gpl'): license = 'GPL' version = l.group('version') id = 'FULL_LICENSE' else: license = '__TOO_LONG_TYPE1__' if (len(version) == 1) and (version in '1234567890'): version = version + '.0' if version: version = '-' + version suffix = '+' else: license = '__TOO_LONG_TYPE2__' else: license = '__TOO_LONG_TYPE3__' else: if norm_text: for (license, id, regex, vars) in list_main: #print('>> {}:{}'.format(license, id)) if license == 'BSD': version = '-2-Clause' else: version = '' r0 =regex.search(norm_text) if r0: match_text = r0.group() for v in vars: try: if v == 'version': if r0.group(v): version = r0.group('version') if (len(version) == 1) and (version in '1234567890'): version = version + '.0' if version: version = '-' + version elif v == 'later': if r0.group(v): suffix = '+' elif v == 'bsd3': if r0.group(v): if license == 'BSD': version = '-4-Clause' elif v == 'noendorse': if license == 'BSD': if r0.group(v) and (version != '-4-Clause'): version = '-3-Clause' elif license[:3] == 'MIT' or license[:3] == 'ISC': # MIT variants with optional noendorse if r0.group(v): set_subtypes.update({'no-endorsement clause'}) else: # SGI-B, DEC incorporating BSD's no-endorsement clause if not r0.group(v): set_subtypes.update({'no-endorsement clause'}) elif v == 'incompatible': if r0.group(v): set_subtypes.update({'copyleft incompatibility concern'}) elif v == 'nowarranty': if not r0.group(v): set_subtypes.update({'nowarranty disclaimer'}) elif v == 'requiredisclaimer': if r0.group(v): set_subtypes.update({'requiring nowarranty disclaimer'}) elif v == 'name': if r0.group(v): name = r0.group('name') if name[4:11] == 'FREEBSD': suffix += '-FreeBSD' elif name[4:10] == 'NETBSD': suffix += '-NETBSD' elif name[4:11] == 'REGENTS': if version == '-4-Clause': suffix += '-UC' elif v == 'patent' or v == 'subject': if r0.group(v): suffix = '-Clear' #elif v == 'name1': # if r0.group('name1'): # name3 = r0.group('name1') # suffix += '<1:' + name1 + '>' except IndexError: print('ERROR: {} missing: {} {}'.format(v, license, id)) # find only first match break for (type_attribs, re_attribs) in list_attribs: r2 = re_attribs.search(norm_text) if r2: set_attribs.update({type_attribs}) # exception handling for (type_exceptions, re_exceptions, perm) in list_exceptions: r2 = re_exceptions.search(norm_text) if r2: set_exceptions.update(type_exceptions) permissive |= perm if len(set_exceptions) == 1: with_exception = ' with ' + set_exceptions.pop() + ' exception' elif len(set_exceptions) == 0: r2 = regex_exception.search(norm_text) if r2: with_exception = ' with unknown exception XXX FIXME XXX' else: with_exception = ' with multiple exceptions XXX FIXME XXX' if with_exception == '': if license + version in list_permissive: permissive = True else: license = '' # NO LICENSE TEXT if mode <= -1 and id !='': id = ':' + id else: id = '' licenseid = license + version + suffix + id + with_exception text = '' if abs(mode) >= 3: # output comments if set_subtypes: text += '\n### !!! C: {}'.format('\n### !!! C: '.join(list(set_subtypes))) if abs(mode) >= 2: # Skip if simple # RFC-822 complian and empty lines replaced with " ." for line in license_lines: line = line.rstrip() if line == '': text += '\n .' else: text += '\n {}'.format(line) if set_attribs: text += '\n .\n {}'.format('\n '.join(list(set_attribs))) if license + version + suffix in licensefiles.keys(): (filename, licensename) = licensefiles[license + version + suffix] text += "\n .\n On Debian systems, the complete text of the " + licensename + \ " can be found in `/usr/share/common-licenses/{}'.".format(filename) if abs(mode) >= 4: # output debug outputs if match_text: text += '\n### !!! M: {}'.format(match_text) if norm_text: text += '\n### !!! T: {}'.format(norm_text) return (licenseid, text, permissive) ######################################################################################### def lc_sub(norm_text, mode): # check license for debug regex pattern # license_lines: license lines to be checked (list) # mode: license check mode # abs(mode) = 5 (single) # abs(mode) = 6 (combination) ##################################################################################### text = '' for subx in list_sub: r = re.compile(eval_sub(subx), re.IGNORECASE) if r.search(norm_text): # match with regx text += '>>>>>>>> {} -> "{}"\n'.format(subx, r.search(norm_text).group()) if abs(mode) >= 6: for suby in list_sub: if subx != suby: try: r = re.compile(eval_sub(subx) + eval_sub(suby), re.IGNORECASE) if r.search(norm_text): # match with combination of subx + suby text += '==== {} + {} => "{}"\n'.format(subx, suby, r.search(norm_text).group()) except: pass return text ######################################################################################### if __name__ == '__main__': import sys import os mode = 1 argc = len(sys.argv) if argc == 1: print('Syntax: ' + argv[0] + ' [-][123456] file1 file2 ...') elif argc == 2: files = sys.argv[1:] elif argc >= 3: try: mode = int(sys.argv[1]) except ValueError: files = sys.argv[1:] else: files = sys.argv[2:] else: print('lc.py file ...') for file in files: if os.path.isfile(file): with open(file, mode='r', encoding='utf-8') as f: license_lines = f.readlines() while(license_lines[0].strip() == ''): del license_lines[0] while(license_lines[-1].strip() == ''): del license_lines[-1] norm_text = normalize(license_lines) if abs(mode) <= 1: # like debmake -c etc. (licenseid, text) = lc(norm_text, license_lines, mode) print('{}\t=> {}'.format(file, licenseid)) elif abs(mode) <= 4: # like debmake -c etc. print('File: {}'.format(file)) (licenseid, text) = lc(norm_text, license_lines, mode) print('License: {}{}\n'.format(licenseid, text)) else: # abs(mode> => 5 for sunstring match to debug list_sub regex print('File: {}'.format(file)) print(lc_sub(norm_text, mode)) debmake-4.2.2/debmake/cat.py0000775000175000017500000000510112563440146016121 0ustar osamuosamu00000000000000#!/usr/bin/python3 # vim:se tw=0 sts=4 ts=4 et ai: """ Copyright © 2014 Osamu Aoki Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. """ import os import sys import debmake.debug ####################################################################### # cat >file def cat(file, text, end='', tutorial=False): if os.path.isfile(file) and os.stat(file).st_size != 0: # skip if a file exists and non-zero content print('I: skipping :: {} (file exists)'.format(file), file=sys.stderr) return if tutorial: newtext = '' for line in text.split('\n'): if line[:3] != '###' or line[:4] == '####': newtext += line + '\n' else: newtext += line[2:] + '\n' text = newtext else: newtext = '' for line in text.split('\n'): if line[:3] != '###' or line[:4] == '####': newtext += line + '\n' text = newtext text = text.rstrip() + '\n' path = os.path.dirname(file) if path: os.makedirs(path, exist_ok=True) with open(file, mode='w', encoding='utf-8') as f: print('I: creating => {}'.format(file), file=sys.stderr) print(text, file=f, end=end) debmake.debug.debug('Dw: "{}"'.format(text), type='w') return ####################################################################### # Test script ####################################################################### if __name__ == '__main__': cat('testfile0.tmp', 'fooo\n###barrrr\n####CCCC\nbazzzzz', tutorial=False) cat('testfile1.tmp', 'fooo\n###barrrr\n####CCCC\nbazzzzz', tutorial=True) debmake-4.2.2/debmake/tar.py0000775000175000017500000000733212563440146016150 0ustar osamuosamu00000000000000#!/usr/bin/python3 # vim:se tw=0 sts=4 ts=4 et ai: """ Copyright © 2014 Osamu Aoki Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. """ import glob import os import re import subprocess import sys import debmake.yn ########################################################################### # tar: called from debmake.main() ########################################################################### # tarball = package-version.tar.gz (or package_version.orig.tar.gz) # targz = tar.gz # srcdir = package-version # parent = parent directory name # yes = True if -y, False as default ########################################################################### def tar(tarball, targz, srcdir, parent, yes): print('I: pwd = "{}"'.format(os.getcwd()), file=sys.stderr) if os.path.isdir('.pc'): print('E: .pc/ directory exists. Stop "debmake -t ..."', file=sys.stderr) print('E: Remove applied patches and remove .pc/ directory, first.', file=sys.stderr) exit(1) ####################################################################### # make distribution tarball using tar excluding debian/ directory # VCS tree are not copied. ####################################################################### os.chdir('..') print('I: pwd = "{}"'.format(os.getcwd()), file=sys.stderr) if srcdir == parent: print('I: good, -t (--tar) run in the versioned directory', file=sys.stderr) else: if os.path.isdir(srcdir): debmake.yn.yn('remove "{}" directory in tar'.format(srcdir), 'rm -rf ' + srcdir, yes) # copy from parent to srcdir using hardlinks (with debian/* data) command = 'rsync -av --link-dest=' + os.getcwd() + '/' + parent + ' ' + parent + '/. ' + srcdir print('I: $ {}'.format(command), file=sys.stderr) if subprocess.call(command, shell=True) != 0: print('E: rsync -aCv failed.', file=sys.stderr) exit(1) # tar while excluding VCS and debian directories command = 'tar --exclude=\'' + srcdir + '/debian\' --anchored --exclude-vcs ' if targz == 'tar.gz': command += '-cvzf ' elif targz == 'tar.bz2': command += '--bzip2 -cvf ' elif targz == 'tar.xz': command += '--xz -cvf ' else: print('E: Wrong file format "{}".'.format(targz), file=sys.stderr) exit(1) command += tarball + ' ' + srcdir print('I: $ {}'.format(command), file=sys.stderr) if subprocess.call(command, shell=True) != 0: print('E: tar failed {}.'.format(tarball), file=sys.stderr) exit(1) print('I: {} tarball made'.format(tarball), file=sys.stderr) os.chdir(srcdir) print('I: pwd = "{}"'.format(os.getcwd()), file=sys.stderr) return if __name__ == '__main__': print('No test program') debmake-4.2.2/debmake/control.py0000775000175000017500000002027512563440146017043 0ustar osamuosamu00000000000000#!/usr/bin/python3 # vim:se tw=0 sts=4 ts=4 et ai: """ Copyright © 2014 Osamu Aoki Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. """ import re import debmake.read ####################################################################### def control(para): ndebs = len(para['debs']) types = set() for deb in para['debs']: types.add(deb['type']) ntypes = len(types) # msg = control_src(para) if para['desc'].strip(): desc = para['desc'].strip() else: desc = 'auto-generated package by debmake' # if para['desc_long'].rstrip(): desc_long = para['desc_long'].rstrip() elif para['desc'].strip(): desc_long = ' ' + para['desc'].strip() else: desc_long = '' if desc_long: desc_long_xtra = '' else: if para['tutorial']: desc_long_xtra = debmake.read.read(para['base_path'] + '/share/debmake/extra0desc_long/_long_tutorial').rstrip() else: desc_long_xtra = debmake.read.read(para['base_path'] + '/share/debmake/extra0desc_long/_long').rstrip() for i, deb in enumerate(para['debs']): desc_long_type = debmake.read.read(para['base_path'] + '/share/debmake/extra0desc_long/' + deb['type']).rstrip() if ndebs == 1: # single binary deb['desc'] = desc elif ndebs == ntypes: # all uniq *type* -> no index deb['desc'] = desc + ': {}'.format(deb['type']) else: deb['desc'] = desc + ': {} #{}'.format(deb['type'], i) if ndebs == 1: # single binary if desc_long: deb['desc_long'] = desc_long + '\n' else: deb['desc_long'] = desc_long_xtra + '\n' elif ndebs == ntypes: # all uniq *type* -> no index if i == 0: if desc_long: deb['desc_long'] = desc_long_type + '\n .\n' + desc_long + '\n' else: deb['desc_long'] = desc_long_type + '\n .\n' + desc_long_xtra + '\n' else: if desc_long: deb['desc_long'] = desc_long_type + '\n .\n' + desc_long + '\n' else: deb['desc_long'] = desc_long_type + '\n' else: if i == 0: if desc_long: deb['desc_long'] = desc_long_type + ': #{}\n .\n'.format(i) + desc_long + '\n' else: deb['desc_long'] = desc_long_type + ': #{}\n .\n'.format(i) + desc_long_xtra + '\n' else: if desc_long: deb['desc_long'] = desc_long_type + ': #{}\n .\n'.format(i) + desc_long + '\n' else: deb['desc_long'] = desc_long_type + ': #{}\n'.format(i) msg += control_bin(para, deb) return msg ####################################################################### def control_src(para): msg = '''\ Source: {0} Section: {1} Priority: {2} Maintainer: {3} <{4}> Build-Depends: {5} Standards-Version: {6} Homepage: {7} {8}: {9} {10}: {11} '''.format( para['package'], para['section'], para['priority'], para['fullname'], para['email'], ',\n\t'.join(para['build_depends']), para['standard_version'], para['homepage'], guess_vcsvcs(para['vcsvcs']), para['vcsvcs'], guess_vcsbrowser(para['vcsbrowser']), para['vcsbrowser']) if 'python2' in para['dh_with']: msg += 'X-Python-Version: >= 2.6\n' if 'python3' in para['dh_with']: msg += 'X-Python3-Version: >= 3.2\n' # anything for perl and others XXX FIXME XXX msg += '\n' return msg ####################################################################### def guess_vcsvcs(vcsvcs): if re.search('\.git$', vcsvcs): return '#Vcs-Git' elif re.search('\.hg$', vcsvcs): return '#Vcs-Hg' elif re.search('^:pserver:', vcsvcs): # CVS :pserver:anonymous@anonscm.debian.org:/cvs/webwml return '#Vcs-Cvs' elif re.search('^:ext:', vcsvcs): # CVS :ext:username@cvs.debian.org:/cvs/webwml return '#Vcs-Cvs' elif re.search('^svn[:+]', vcsvcs): # SVN svn://svn.debian.org/ddp/manuals/trunk manuals # SVN svn+ssh://svn.debian.org/svn/ddp/manuals/trunk return '#Vcs-Svn' else: return '#Vcs-Git' ####################################################################### def guess_vcsbrowser(vcsbrowser): if re.search('\.git$', vcsbrowser): return '#Vcs-Browser' elif re.search('\.hg$', vcsbrowser): return '#Vcs-Browser' elif re.search('^:pserver:', vcsbrowser): # CVS :pserver:anonymous@anonscm.debian.org:/cvs/webwml return '#Vcs-Browser' elif re.search('^:ext:', vcsbrowser): # CVS :ext:username@cvs.debian.org:/cvs/webwml return '#Vcs-Browser' elif re.search('^svn[:+]', vcsbrowser): # SVN svn://svn.debian.org/ddp/manuals/trunk manuals # SVN svn+ssh://svn.debian.org/svn/ddp/manuals/trunk return '#Vcs-Browser' else: return '#Vcs-Browser' ####################################################################### def control_bin(para, deb): # non M-A if para['monoarch']: multiarch = '' predepends = '' # M-A + lib (pre-depends line) elif deb['pre-depends']: multiarch = 'Multi-Arch: ' + deb['multiarch'] + '\n' predepends = 'Pre-Depends: ' + ',\n\t'.join(deb['pre-depends']) + '\n' # M-A + non-lib else: multiarch = 'Multi-Arch: ' + deb['multiarch'] + '\n' predepends = '' if deb['type'] == 'dbg': section = 'Section: debug\n' elif deb['type'] == 'dev': section = 'Section: libdevel\n' elif deb['type'] == 'lib': section = 'Section: libs\n' elif deb['type'] == 'doc': section = 'Section: doc\n' else: section = '' ################################################################### return '''\ Package: {0} {1}Architecture: {2} {3}{4}Depends: {5} Description: {6} {7} '''.format( deb['package'], section, deb['arch'], multiarch, predepends, ',\n\t'.join(deb['depends']), deb['desc'], deb['desc_long']) ####################################################################### # Test script ####################################################################### if __name__ == '__main__': import debmake.debs para = {} para['package'] = 'package' para['section'] = 'misc' para['priority'] = 'normal' para['fullname'] = 'Osamu Aoki' para['email'] = 'osamu@debian.org' para['standard_version'] = '4.0.2' para['build_depends'] = set() para['homepage'] = 'http://www.debian.org' para['vcsvcs'] = 'git:git.debian.org' para['vcsbrowser'] = 'http://anonscm.debian.org' para['debs'] = set() para['dh_with'] = set() print(control(para)) print('***********************************************************') para['dh_with'] = set({'python3'}) para['binaryspec'] = '-:python,-doc:doc,lib' para['monoarch'] = False para['debs'] = debmake.debs.debs(para['binaryspec'], para['package'], para['monoarch'], para['dh_with']) print(control(para)) debmake-4.2.2/debmake/debug.py0000775000175000017500000000602712563440146016450 0ustar osamuosamu00000000000000#!/usr/bin/python3 # vim:se tw=0 sts=4 ts=4 et ai: """ Copyright © 2014 Osamu Aoki Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. """ import os import sys ####################################################################### # Debug output ####################################################################### def get_debug(): try: e = os.environ["DEBUG"] except KeyError: e = '' return e def debug(msg, type=''): e = get_debug() if (e != '' and type == '') or \ (type in e): print(msg, file=sys.stderr) return def debug_para(msg, para): e = get_debug() if 'p' in e: line = '{}:\n'.format(msg) for x in para.keys(): line += ' para[{}] = "{}"\n'.format(x, para[x]) print(line, file=sys.stderr) elif e: line = '{}:\n'.format(msg) line += ' para[{}] = "{}"\n'.format('package', para['package']) line += ' para[{}] = "{}"\n'.format('version', para['version']) line += ' para[{}] = "{}"\n'.format('revision', para['revision']) line += ' para[{}] = "{}"\n'.format('targz', para['targz']) print(line, file=sys.stderr) return def debug_debs(msg, debs): e = get_debug() if 'd' in e: line = '{}: \n'.format(msg) for deb in debs: line += ' Binary Package: {}\n'.format(deb['package']) line += ' Architecture: {}\n'.format(deb['arch']) line += ' Multi-Arch: {}\n'.format(deb['multiarch']) line += ' Depends: {}\n'.format(deb['depends']) line += ' Pre-Depends: {}\n'.format(deb['pre-depends']) line += ' Type: {}\n'.format(deb['type']) print(line, file=sys.stderr) return ####################################################################### # Test code ####################################################################### if __name__ == '__main__': debug('DEBUG ON!') para = {} para['package'] = 'package' para['version'] = '1.0' para['targz'] = 'tar.gz' debug_para('debug_para', para) debmake-4.2.2/debmake/origtar.py0000775000175000017500000000513312563440146017026 0ustar osamuosamu00000000000000#!/usr/bin/python3 # vim:se tw=0 sts=4 ts=4 et ai: """ Copyright © 2014 Osamu Aoki Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. """ import os import subprocess import sys ########################################################################### # origtar: called from debmake.main() ########################################################################### def origtar(package, version, targz, tarball, srcdir): # cd .. os.chdir('..') print('I: pwd = "{}"'.format(os.getcwd()), file=sys.stderr) ####################################################################### # make package_versdion.orig.tar.gz in the parent directory if not exist # source is in srcdir ####################################################################### origtargz = package + '_' + version + '.orig.' + targz if os.path.isfile(tarball): if tarball == origtargz: print('I: Use existing "{}" as upstream tarball'.format(tarball), file=sys.stderr) else: command = 'ln -sf ' + tarball + ' ' + origtargz print('I: $ {}'.format(command), file=sys.stderr) if subprocess.call(command, shell=True) != 0: print('E: failed to create symlink.', file=sys.stderr) exit(1) elif os.path.isfile(origtargz): print('I: Use existing "{}" as upstream tarball'.format(origtargz), file=sys.stderr) else: print('E: missing "{}".'.format(tarball), file=sys.stderr) exit(1) os.chdir(srcdir) # calling side ensures this print('I: pwd = "{}"'.format(os.getcwd()), file=sys.stderr) return if __name__ == '__main__': print('no test') debmake-4.2.2/debmake/yn.py0000775000175000017500000000444012563440146016005 0ustar osamuosamu00000000000000#!/usr/bin/python3 # vim:se tw=0 sts=4 ts=4 et ai: """ Copyright © 2014 Osamu Aoki Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. """ import os import subprocess import sys ########################################################################### # yn: ask mes and execute command ########################################################################### def yn(mes, command, yes): if yes == 1: yn = 'y' elif yes == 2: yn = 'n' else: yn = input('?: {} [Y/n]: '.format(mes)) if yn == '': yn = 'y' else: yn = yn[0].lower() if (yn =='y'): if command: print('I: $ {}'.format(command), file=sys.stderr) if subprocess.call(command, shell=True) != 0: print('E: failed to run command.', file=sys.stderr) exit(1) else: print('E: terminating since "n" chosen at Y/n question.', file=sys.stderr) exit(1) print('I: pwd = "{}"'.format(os.getcwd()), file=sys.stderr) return if __name__ == '__main__': print('I: ask', file=sys.stderr) yn("list current directory (ask)", "ls -la", 0) print('I: always yes', file=sys.stderr) yn("list current directory (always yes)", "ls -la", 1) print('I: never yes', file=sys.stderr) yn("list current directory (never yes)", "ls -la", 2) debmake-4.2.2/debmake/scanfiles.py0000775000175000017500000002022412563440146017324 0ustar osamuosamu00000000000000#!/usr/bin/python3 # vim:se tw=0 sts=4 ts=4 et ai: """ Copyright © 2014 Osamu Aoki Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. """ import collections import operator import os import re import sys ################################################################### # Define constants ################################################################### MAX_FILE_SIZE = 1024*1024 # 1 MiB SKIP_FILES = [ 'COPYING', 'LICENSE', 'ChangeLog', 'changelog', ] # Skip these files for scanning # 'INSTALL', # 'README', # 'README.txt', # 'README.Debian', # 'Makefile.in', # 'aclocal.m4', # 'compile', # 'config.guess', # 'config.h.in', # 'config.sub', # 'configure', # 'depcomp', # 'install-sh', # 'ltconfig', # 'ltmain.sh', # 'missing', # 'mkinstalldirs', # 'py-compile' # First 2 are specified by --license extequiv = {'pl': 'perl', 'PL': 'perl', 'pm': 'perl', 'py': 'python', 'pyc': 'python', 'rb': 'ruby', 'javac': 'java', 'js': 'javascript', 'ml': 'ocml', 'vala': 'vala', 'h' : 'c', 'cpp': 'c', 'CPP': 'c', 'cc': 'c', 'C': 'c', 'cxx': 'c', 'CXX': 'c', 'c++': 'c', 'hh': 'c', 'H': 'c', 'hxx': 'c', 'Hxx': 'c', 'HXX': 'c', 'hpp': 'c', 'h++': 'c', 'asm': 'c', 's': 'c', 'S': 'c', 'TXT': 'text', 'txt': 'text', 'doc': 'text', 'html': 'text', 'htm': 'text', 'xml': 'text', 'dbk': 'text', 'dtd': 'text', 'odt': 'text', 'sda': 'text', 'sdb': 'text', 'sdc': 'text', 'sdd': 'text', 'sds': 'text', 'sdw': 'text', 'a': 'binary', 'class': 'binary', 'jar': 'binary', 'exe': 'binary', 'com': 'binary', 'dll': 'binary', 'obj': 'binary', 'zip': 'archive', 'tar': 'archive', 'cpio': 'archive', 'afio': 'archive', 'jpeg': 'media', 'jpg': 'media', 'm4a': 'media', 'png': 'media', 'gif': 'media', 'GIF': 'media', 'svg': 'media', 'ico': 'media', 'mp3': 'media', 'ogg': 'media', 'wav': 'media', 'ttf': 'media', 'TTF': 'media', 'otf': 'media', 'OTF': 'media', 'wav': 'media' } ################################################################### # re.search file name extension re_ext = re.compile(r'\.(?P[^.]+)(?:\.in|\.gz|\.bz2|\.xz|\.Z\|.z|~)*$') ################################################################### # Check if binary file ################################################################### def typefile(file, blocksize=4048): buff = open(file, mode='rb').read(blocksize) if b'<' == buff[:1]: return 2 # XML/SGML/HTML elif b'\x00' in buff: return 0 # Binary elif b'\xff\xff' in buff: return 0 # Binary else: return 1 # Text ################################################################### # Get all files to be analyzed under dir ################################################################### def get_all_files(): nonlink_files = [] binary_files = [] xml_html_files = [] huge_files = [] extensions = [] # extensions : representative code type # binary means possible non-DFSG component for dir, subdirs, files in os.walk("."): for file in files: # dir iterates over ./ ./foo ./foo/bar/ ./foo/bar/baz ... filepath = os.path.join(dir[2:], file) if os.path.islink(filepath): pass # skip symlink (both for file and dir) elif file in SKIP_FILES: pass # skip automatically generated files else: re_ext_match = re_ext.search(file) if re_ext_match: ext = re_ext_match.group('ext') if ext in extequiv.keys(): extrep = extequiv[ext] else: extrep = ext extensions.append(extrep) type_of_file = typefile(filepath) if type_of_file == 2: # XML/SGML/HTML xml_html_files.append(filepath) elif type_of_file == 0: # Binary binary_files.append(filepath) elif os.path.getsize(filepath) > MAX_FILE_SIZE: huge_files.append(filepath) else: # type_of_file == 1 Text nonlink_files.append(filepath) # do not decend to VCS dirs for vcs in ['CVS', '.svn', '.pc', '.git', '.hg', '.bzr']: if vcs in subdirs: subdirs.remove(vcs) # skip VCS # do not decend to symlink dirs symlinks = [] for subdir in subdirs: dirpath = os.path.join(dir, subdir) if os.path.islink(dirpath): symlinks.append(subdir) # do not change subdirs inside looping over subdirs for symlink in symlinks: subdirs.remove(symlink) # skip symlinks print('W: get_all_files(dir) skip symlink dir', file=sys.stderr) return (nonlink_files, xml_html_files, binary_files, huge_files, extensions) ####################################################################### # complete scanfiles ####################################################################### def scanfiles(): (nonlink_files, xml_html_files, binary_files, huge_files, extensions) = get_all_files() if len(extensions): delta = 100.0 / len(extensions) else: delta = 100.0 counter = collections.Counter(extensions) count_list = sorted(list(counter.items()), key=operator.itemgetter(1), \ reverse=True) for ext, count in count_list: if ext == 'binary' or ext == 'archive': print('W: {} type exists. Maybe non-DFSG!'.format(ext), file=sys.stderr) print('I: {1:3.0f} %, ext = {0}'.format(ext, count * delta), file=sys.stderr) return (nonlink_files, xml_html_files, binary_files, huge_files, counter, count_list) ####################################################################### # Test script ####################################################################### if __name__ == '__main__': (nonlink_files, xml_html_files, binary_files, huge_files, counter, count_list) = scanfiles() print('Number of nonlink_files: {}'.format(len(nonlink_files))) print('Number of xml_html_files: {}'.format(len(xml_html_files))) print('Number of binary_files: {}'.format(len(binary_files))) print('Number of huge_files: {}'.format(len(huge_files))) print('I: counts of file extensions', file=sys.stderr) for ext, count in count_list: print('{1} files for ext = {0}'.format(ext, count)) debmake-4.2.2/debmake/sanity.py0000775000175000017500000002233612563440146016672 0ustar osamuosamu00000000000000#!/usr/bin/python3 # vim:se tw=0 sts=4 ts=4 et ai: """ Copyright © 2014 Osamu Aoki Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. """ import datetime import glob import os import re import subprocess import sys ########################################################################### # sanity: called from debmake.main() ########################################################################### def sanity(para): ####################################################################### # Normalize para[] for each exclusive build case (-d -t -a) ####################################################################### package = '' version = '' revision = '' targz = '' if para['archive']: # -a # remote URL reurl = re.match(r'(http://|https://|ftp://).*/([^/]+)$', para['tarball']) if reurl: url = para['tarball'] para['tarball'] = reurl.group(2) if os.path.isfile('/usr/bin/wget'): command = '/usr/bin/wget ' + url elif os.path.isfile('/usr/bin/curl'): command = '/usr/bin/curl ' + url else: print('E: please install wget or curl.', file=sys.stderr) exit(1) print('I: $ {}'.format(command), file=sys.stderr) if subprocess.call(command, shell=True) != 0: print('E: wget/curl failed.', file=sys.stderr) exit(1) parent = '' # tarball: ibus-1.5.5-2.fc19.src.rpm resrcrpm = re.match(r'([^/_]+-[^/_-]+)-[0-9]+\.[^.]+\.src\.rpm$', os.path.basename(para['tarball'])) if resrcrpm: command = 'rpm2cpio ' + para['tarball'] + '|cpio -dium' print('I: $ {}'.format(command), file=sys.stderr) if subprocess.call(command, shell=True) != 0: print('E: rpm2cpioc ... | cpio -dium failed.', file=sys.stderr) exit(1) files = glob.glob(resrcrpm.group(1) + '*.tar.gz') + \ glob.glob(resrcrpm.group(1) + '*.tar.bz2') + \ glob.glob(resrcrpm.group(1) + '*.tar.xz') if files: para['tarball'] = files[0] else: print('E: no tar found in src.rpm.', file=sys.stderr) exit(1) if not os.path.isfile(para['tarball']): print('E: Non-existing tarball name {}'.format(para['tarball']), file=sys.stderr) exit(1) if os.path.abspath(os.path.dirname(para['tarball'])) != os.getcwd(): command = 'cp ' + para['tarball'] + ' ' + os.path.basename(para['tarball']) print('I: $ {}'.format(command), file=sys.stderr) if subprocess.call(command, shell=True) != 0: print('E: {} failed.'.format(command), file=sys.stderr) exit(1) para['tarball'] = os.path.basename(para['tarball']) # tarball: package_version.orig.tar.gz reorigtar = re.match(r'([^/_]+)_([^-/_]+)\.orig\.(tar\.gz|tar\.bz2|tar\.xz)$', para['tarball']) # tarball: package-version.tar.gz or package_version.tar.gz rebasetar = re.match(r'([^/_]+)[-_]([^-/_]+)\.(tar\.gz|tar\.bz2|tar\.xz)$', para['tarball']) if reorigtar: package = reorigtar.group(1).lower() version = reorigtar.group(2) targz = reorigtar.group(3) elif rebasetar: package = rebasetar.group(1).lower() version = rebasetar.group(2) targz = rebasetar.group(3) else: print('E: Non-supported tarball name {}'.format(para['tarball']), file=sys.stderr) exit(1) ####################################################################### if not para['archive']: # not -a parent = os.path.basename(os.getcwd()) # check changelog for package/version/revision (non-native package) if not para['native'] and os.path.isfile('debian/changelog'): with open('debian/changelog', mode='r', encoding='utf-8') as f: line = f.readline() pkgver = re.match('([^ \t]+)[ \t]+\(([^()]+)-([^-()]+)\)', line) if pkgver: package = pkgver.group(1).lower() version = pkgver.group(2) revision = pkgver.group(3) else: print('E: changelog start with "{}"'.format(line), file=sys.stderr) exit(1) ####################################################################### if para['tar']: # -t if version == '': version = datetime.datetime.utcnow().strftime("0~%y%m%d%H%M") # 0~YYMMDDHHmm ####################################################################### # set parent/srcdir/tarball/package/version/revision para['parent'] = parent if para['package'] == '': para['package'] = package elif para['package'] != package: print('W: -p "{}" != auto set value "{}"'.format(para['package'], package), file=sys.stderr) if para['version'] == '': para['version'] = version elif para['version'] != version: print('W: -u "{}" != auto set value "{}"'.format(para['version'], version), file=sys.stderr) ####################################################################### if not para['archive']: # not -a if para['revision'] == '': para['revision'] = revision elif para['revision'] != revision: print('W: -r "{}" != auto set value "{}"'.format(para['revision'], revision), file=sys.stderr) ####################################################################### if para['archive']: # -a if para['targz'] == '': para['targz'] = targz elif para['targz'] != targz: print('W: -r "{}" != auto set value "{}"'.format(para['targz'], targz), file=sys.stderr) ####################################################################### if not para['archive']: # not -a # set para['targz'] if para['targz'] == '': para['targz'] = 'tar.gz' elif para['targz'][0] == 'g': para['targz'] = 'tar.gz' elif para['targz'][0] == 'b': para['targz'] = 'tar.bz2' elif para['targz'][0] == 'x': para['targz'] = 'tar.xz' elif para['targz'] == 'tar.gz': pass elif para['targz'] == 'tar.bz2': pass elif para['targz'] == 'tar.xz': pass else: print('E: --targz (-z) value is invalid: {}'.format(para['targz']), file=sys.stderr) exit(1) ####################################################################### if para['archive']: para['srcdir'] = para['package'] + '-' + para['version'] # para['tar'] may be Foo-1.0.tar.xz and keep it so. elif para['dist']: # -d pass # differ package/version/tarball/srcdir else: # normal (native/non-native) or -t if para['version'] == '':# -u missing pkgver = re.match('^([^_]+)-([^-_]+)$', parent) if pkgver: if para['package'] == '': # both -p and -u missing para['package'] = pkgver.group(1).lower() para['version'] = pkgver.group(2) # -u missing else: print('E: invalid parent directory for setting package/version: {}'.format(parent), file=sys.stderr) print('E: rename parent directory to "package-version".', file=sys.stderr) exit(1) elif para['package'] == '': # -u set, -p missing para['package'] = parent.lower() para['srcdir'] = para['package'] + '-' + para['version'] para['tarball'] = para['package'] + '-' + para['version'] + '.' + para['targz'] ####################################################################### if para['revision'] == '': para['revision'] = '1' ####################################################################### # Dynamic content with package name etc. ####################################################################### para['section'] = 'unknown' para['priority'] = 'extra' para['homepage'] = '' para['vcsvcs'] = 'git://anonscm.debian.org/collab-maint/' + para['package'] + '.git' para['vcsbrowser'] = 'http://anonscm.debian.org/gitweb/?p=collab-maint/' + para['package'] + '.git' return para debmake-4.2.2/debmake/dist.py0000775000175000017500000001674412563440146016334 0ustar osamuosamu00000000000000#!/usr/bin/python3 # vim:se tw=0 sts=4 ts=4 et ai: """ Copyright © 2014 Osamu Aoki Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. """ import glob import os import re import subprocess import sys ########################################################################### # dist: called from debmake.main() ########################################################################### def dist(para): print('I: pwd = "{}"'.format(os.getcwd()), file=sys.stderr) ####################################################################### # make distribution tarball using the Autotools ####################################################################### if os.path.isfile('configure.ac') and os.path.isfile('Makefile.am'): command = 'autoreconf -ivf && ./configure --prefix "/usr" && make distcheck' print('I: $ {}'.format(command), file=sys.stderr) if subprocess.call(command, shell=True) != 0: print('E: autotools failed.', file=sys.stderr) exit(1) distdir = '.' ####################################################################### # make distribution tarball using setup.py ####################################################################### elif os.path.isfile('setup.py'): # Python distutils with open('setup.py', mode='r', encoding='utf-8') as f: line = f.readline() if re.search('python3', line): # http://docs.python.org/3/distutils/ command = 'python3 setup.py sdist' else: # http://docs.python.org/2/distutils/ command = 'python setup.py sdist' print('I: $ {}'.format(command), file=sys.stderr) if subprocess.call(command, shell=True) != 0: print('E: setup.py failed.', file=sys.stderr) exit(1) distdir = 'dist' ####################################################################### # make distribution tarball using Build.PL ####################################################################### elif os.path.isfile('Build.PL'): # perl Build.PL command = 'perl Build.PL && ./Build distcheck && ./Build disttest && ./Build dist' print('I: $ {}'.format(command), file=sys.stderr) if subprocess.call(command, shell=True) != 0: print('E: perl Build.PL failed.', file=sys.stderr) exit(1) distdir = '.' ####################################################################### # make distribution tarball using Makefile.PL ####################################################################### elif os.path.isfile('Makefile.PL'): # perl Makefile.PL command = 'perl Makefile.PL && make dist' print('I: $ {}'.format(command), file=sys.stderr) if subprocess.call(command, shell=True) != 0: print('E: perl Makefile.PL failed.', file=sys.stderr) exit(1) distdir = '.' ####################################################################### # make distribution tarball for other sources ####################################################################### else: if os.path.isfile('CMakeLists.txt'): # CMake source tree print('E: CMake. Use --tar (-t).', file=sys.stderr) exit(1) else: # Non standard source tree print('E: unsupported for --dist (-d). Use --tar (-t).', file=sys.stderr) exit(1) ####################################################################### # set version by the tarball name ####################################################################### somepackage1 = distdir + '/*.tar.xz' somepackage2 = distdir + '/*.tar.gz' somepackage3 = distdir + '/*.tar.bz2' files = glob.glob(somepackage1) + glob.glob(somepackage2) + glob.glob(somepackage3) if files: for file in files: print('I: -> {} created'.format(file), file=sys.stderr) para['tarball'] = files[0][len(distdir)+1:] print('I: {} picked for packaging'.format(para['tarball']), file=sys.stderr) matchtar = re.match(r'(?P[^_]*)[-_](?P[^-_]*)\.(?Ptar\..{2,3})$', para['tarball']) if matchtar: if para['package'] == "": para['package'] = matchtar.group('package').lower() if para['version'] =='': para['version'] = matchtar.group('version') elif para['version'] != matchtar.group('version'): print('E: generated tarball version "{}".'.format(matchtar.group('version')), file=sys.stderr) print('E: expected version "{}" (from -u option or debian/changelog).'.format(para['version']), file=sys.stderr) print('E: update version number in places such as AC_INIT of configure.ac.', file=sys.stderr) exit(1) if para['targz'] =='': para['targz'] = matchtar.group('targz') elif para['targz'] != matchtar.group('targz'): print('W: override -z "{}" by actual value "{}".'.format(para['targz'], matchtar.group('targz')), file=sys.stderr) para['targz'] = matchtar.group('targz') else: print('W: {} can not be split into package-version.tar.gz style.'.format(para['tarball']), file=sys.stderr) else: print('E: {} can not be found.'.format(distpackage), file=sys.stderr) print('E: not even likely tarball found', file=sys.stderr) exit(1) ####################################################################### # copy tar to the parent directory (out of source tree) ####################################################################### # cd .. os.chdir('..') print('I: pwd = "{}"'.format(os.getcwd()), file=sys.stderr) # cp -f parent/dist/foo-1.0.tar.gz foo-1.0.tar.gz command = 'cp -f ' + para['parent'] + '/' + distdir + '/' + para['tarball'] + ' ' + para['tarball'] print('I: $ {}'.format(command), file=sys.stderr) if subprocess.call(command, shell=True) != 0: print('E: failed to copy', file=sys.stderr) exit(1) para['srcdir'] = para['package'] + '-' + para['version'] if para['srcdir'] == para['parent']: # avoid erasing VCS in untar process. print('E: the parent directory should be like {} (never {}).'.format(para['package'], para['srcdir']), file=sys.stderr) print('E: terminate to protect the VCS data possibly in the original directory.', file=sys.stderr) exit(1) return para if __name__ == '__main__': print('No test program') debmake-4.2.2/debmake/compat.py0000775000175000017500000000344412563440146016645 0ustar osamuosamu00000000000000#!/usr/bin/python3 # vim:se tw=0 sts=4 ts=4 et ai: """ Copyright © 2014 Osamu Aoki Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. """ import os ####################################################################### def compat(paracompat): ################################################################### # file: path to the file ################################################################### if os.path.isfile('debian/compat'): with open('debian/compat', mode='r', encoding='utf-8') as f: number = int(f.read().strip()) else: number = int(paracompat.strip()) return number ####################################################################### # Test script ####################################################################### if __name__ == '__main__': print(compat('99')) debmake-4.2.2/debmake/copyright.py0000775000175000017500000012345312563440146017375 0ustar osamuosamu00000000000000#!/usr/bin/python3 # vim:se tw=0 sts=4 ts=4 et ai: """ Copyright © 2014 Osamu Aoki Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. """ import glob import hashlib import itertools import operator import os import re import subprocess import sys import debmake.debug import debmake.lc ################################################################### # Constants for sanity ################################################################### MAX_COPYRIGHT_LINES = 256 MAX_COPYRIGHT_LENGTH = 2048 ################################################################### # Parse year within a copyright line ################################################################### re_year_1900 = re.compile(r''' (?P
.*?)
        (?P19\d\d)\s*[-,]\s*
        (?P\d\d)
        (?P\D.*|$)''', re.IGNORECASE | re.VERBOSE)

re_year_2000 = re.compile(r'''
        (?P
.*?)
        (?P20\d\d)\s*[-,]\s*
        (?P\d\d)
        (?P\D.*|$)''', re.IGNORECASE | re.VERBOSE)

def normalize_year_span(line):
    # 1990-91 -> 1990-1991 etc.
    while True:
        m = re_year_1900.search(line)
        if m:
            line = m.group('pre') + m.group('n1') + '-19' + \
                    m.group('n2') + m.group('post')
        else:
            break
    # 2010-11 -> 2010-2011 etc.
    while True:
        m = re_year_2000.search(line)
        if m:
            line = m.group('pre') + m.group('n1') + '-20' + \
                    m.group('n2') + m.group('post')
        else:
            break
    return line

re_year_yn = re.compile(r'''^\s*
        (?P(?:\d\d+[-,.;\s]*)+)[.,;:]?\s*
        (?P\D.*\D)\s*\.?$''', re.IGNORECASE | re.VERBOSE)

re_year_ny = re.compile(r'''^\s*
        (?P.*?\D)\s*
        (?P(?:\d\d+[-.,;\s]*)+)[.,;:]?\s*$''', re.IGNORECASE | re.VERBOSE)

def split_year_span(line):
    # split line into years and name
    m1 = re_year_yn.search(line)
    m2 = re_year_ny.search(line)
    if m1:
        years = m1.group('year').strip()
        name = m1.group('name').strip()
    elif m2:
        years = m2.group('year').strip()
        name = m2.group('name').strip()
    elif line:
        years = 'NO_MATCH' # sign for funkey line
        name = line.strip()
    else:
        years = ''
        name = ''
    if name[:2].lower() == 'by':
        name = name[2:].strip()
    debmake.debug.debug('Dy: years="{}", name="{}" <- "{}"'.format(years, name, line), type='y')
    return (years, name)

re_year = re.compile(r'\d\d+')

def get_year_range(years):
    # year range
    year_min = 9999
    year_max = 0
    for year_string in re_year.findall(years):
        year = int(year_string)
        year_min =  min(year_min, year)
        year_max =  max(year_max, year)
    return (year_min, year_max)

###################################################################
# Parse name within a copyright line
###################################################################
re_name_drop = re.compile(r'''(?:
        All\s+Rights\s+Reserved\.?|
        originally\s+by.*$|
        (?:originally\s+)?written\s+by.*$)
        ''', re.IGNORECASE | re.VERBOSE)

re_fsf_addr = re.compile(r'^Free\s+Software\s+Foundation,\s+Inc\.',
        re.IGNORECASE)

def cleanup_name(name):
    if re_fsf_addr.search(name): # FSF without address etc.
        name = 'Free Software Foundation, Inc.'
    return name

###################################################################
# Parse (year, name) within all copyright lines
###################################################################
def analyze_copyright(copyright_lines):
    copyright_data = {}
    for line in copyright_lines:
        line = line.strip()
        line = normalize_year_span(line).strip()
        line = re_name_drop.sub('', line).strip()
        (years, name) = split_year_span(line)
        name = cleanup_name(name).strip()
        (year_min, year_max) = get_year_range(years)
        if name in copyright_data.keys():
            (year0_min, year0_max) = copyright_data[name]
            year_min =  min(year_min, year0_min)
            year_max =  max(year_max, year0_max)
        if name:
            copyright_data[name] = (year_min, year_max)
        else:
            print('W: analyze_copyright: skip name="", years="{}" <- line"{}"'.format(years, line), file=sys.stderr)
    return copyright_data

###################################################################
# A format state machine parser to extract copyright+license by format
###################################################################
fs = [
'F_BLNK  ', # blank line
'F_QUOTE ',
'F_BLKP  ',
'F_BLKPE ',
'F_BLKP0 ',
'F_BLKQ  ',
'F_BLKQE ',
'F_BLKQ0 ',
'F_BLKC  ',
'F_BLKCE ',
'F_BLKC2 ',
'F_BLKC1 ',
'F_BLKC0 ',
'F_PLAIN1',
'F_PLAIN2',
'F_PLAIN3',
'F_PLAIN4',
'F_PLAIN5',
'F_PLAIN6',
'F_PLAIN7',
'F_PLAIN8',
'F_PLAIN9',
'F_PLAIN10',
'F_PLAIN0', # always match
'F_EOF   ', # force EOF before processing the next line
]
# enum(fs)
for i, name in enumerate(fs):
    exec('{} = {}'.format(name.strip(), i))
F_EOF = -1 # override

# entry format style id list
all_non_entry_formats = {
F_BLKPE, F_BLKP0,
F_BLKQE, F_BLKQ0,
F_BLKCE, F_BLKC2, F_BLKC1, F_BLKC0,
F_EOF}

all_entry_formats = set()
for name in fs:
    id = eval(name.strip())
    if id not in all_non_entry_formats:
        all_entry_formats.add(id)

formats = {} # dictionary
# define next format state
# formats[*][0]: regex to match
# formats[*][1]: next format state allowed
# formats[*][2]: format state allowed (persistent)

formats[F_BLNK] = (
        re.compile(r'^(?P)(?P)(?P)$'),
        all_entry_formats,
        {F_BLNK}
        )

formats[F_QUOTE] = (
        re.compile(r'^(?P/\*)\**(?P.*?)\**(?P\*/)$'),  # C /*...*/
        all_entry_formats,
        {F_QUOTE, F_BLKC, F_BLKCE, F_BLKC2, F_BLKC1, F_BLKC0, F_BLNK}
        )

# python block mode start with '''
formats[F_BLKP] = (
        re.compile(r'^.*?(?P\'\'\')(?P.*)(?P)$'),  # Python
        [F_BLKPE, F_BLKP0],
        {F_BLKP, F_BLKPE, F_BLKP0, F_BLNK}
        )
formats[F_BLKPE] = (
        re.compile(r'^(?P)(?P.*?)(?P\'\'\').*$'),  # Python
        all_entry_formats,
        {F_BLKP, F_BLKPE, F_BLKP0, F_BLNK}
        )
formats[F_BLKP0] = (
        re.compile(r'^(?P)\s*(?P.*)\s*(?P)$'),
        [F_BLKPE, F_BLKP0],
        {F_BLKP, F_BLKPE, F_BLKP0, F_BLNK}
        )

# python block mode start with """
formats[F_BLKQ] = (
        re.compile(r'^.*?(?P""")(?P.*)(?P)$'),  # Python
        [F_BLKQE, F_BLKQ0],
        {F_BLKQ, F_BLKQE, F_BLKQ0, F_BLNK}
        )
formats[F_BLKQE] = (
        re.compile(r'^(?P)(?P.*?)(?P""").*$'),  # Python
        all_entry_formats,
        {F_BLKQ, F_BLKQE, F_BLKQ0, F_BLNK}
        )
formats[F_BLKQ0] = (
        re.compile(r'^(?P)\s*(?P.*)\s*(?P)$'),
        [F_BLKQE, F_BLKQ0],
        {F_BLKQ, F_BLKQE, F_BLKQ0, F_BLNK}
        )

# C block mode start with """
formats[F_BLKC] = (
        re.compile(r'^(?P/\*)\s*\**(?P.*)(?P)$'),  # C /*...
        [F_BLKCE, F_BLKC2, F_BLKC1, F_BLKC0],
        {F_QUOTE, F_BLKC, F_BLKCE, F_BLKC2, F_BLKC1, F_BLKC0, F_BLNK}
        )
formats[F_BLKCE] = (
        re.compile(r'^(?P\*\s|)(?P.*?)\s*\**?(?P\*/).*$'),  # C ...*/
        all_entry_formats,
        {F_QUOTE, F_BLKC, F_BLKCE, F_BLKC2, F_BLKC1, F_BLKC0, F_BLNK}
        )
formats[F_BLKC2] = (
        re.compile(r'^(?P\*)\**?(?P.*?)\**?(?P\*)$'),  # C *...*
        [F_BLKCE, F_BLKC2],
        {F_QUOTE, F_BLKC, F_BLKCE, F_BLKC2, F_BLKC1, F_BLKC0, F_BLNK}
        )
formats[F_BLKC1] = (
        re.compile(r'^(?P\*)\**?(?P.*)(?P)$'),  # C *...
        [F_BLKCE, F_BLKC1],
        {F_QUOTE, F_BLKC, F_BLKCE, F_BLKC2, F_BLKC1, F_BLKC0, F_BLNK}
        )
formats[F_BLKC0] = (
        re.compile(r'^(?P)(?P.*?)(?P)$'),
        [F_BLKCE, F_BLKC0],
        {F_QUOTE, F_BLKC, F_BLKCE, F_BLKC2, F_BLKC1, F_BLKC0, F_BLNK}
        )

# comment start with something
formats[F_PLAIN1] = (
        re.compile(r'^(?P#)#*(?P.*)(?P)$'),   # Shell/Perl/Python
        all_entry_formats,
        {F_PLAIN1, F_BLNK}
        )

formats[F_PLAIN2] = (
        re.compile(r'^(?P//)/*(?P.*)(?P)$'),  # C++ //
        all_entry_formats,
        {F_PLAIN2, F_BLNK}
        )

formats[F_PLAIN3] = (
        re.compile(r'^(?P--)-*(?P.*)(?P)$'),  # Lua --
        all_entry_formats,
        {F_PLAIN3, F_BLNK}
        )

formats[F_PLAIN4] = (
        re.compile(r'^(?P\.\\")(?P.*)(?P)$'), # manpage
        all_entry_formats,
        {F_PLAIN4, F_BLNK}
        )

formats[F_PLAIN5] = (
        re.compile(r'^(?P@%:@)(?P.*)(?P)$'),  # autom4te.cache
        all_entry_formats,
        {F_PLAIN5, F_BLNK}
        )

formats[F_PLAIN6] = (
        re.compile(r'^(?P@c)\s+(?P.*)(?P)$'), # Texinfo @c
        all_entry_formats,
        {F_PLAIN6, F_BLNK}
        )

formats[F_PLAIN7] = (
        re.compile(r"^(?P')(?P.*)(?P)$"),# Basic
        all_entry_formats,
        {F_PLAIN7, F_BLNK}
        )

formats[F_PLAIN8] = (
        re.compile(r'^(?P;);*(?P.*)(?P)$'),# vim
        all_entry_formats,
        {F_PLAIN8, F_BLNK}
        )

formats[F_PLAIN9] = (
        re.compile(r'^(?Pdnl)\s+(?P.*)(?P)$'),# m4 dnl
        all_entry_formats,
        {F_PLAIN9, F_BLNK}
        )

formats[F_PLAIN10] = (
        re.compile(r'^(?P%)\s+(?P.*)(?P)$'),# texinfo.tex
        all_entry_formats,
        {F_PLAIN10, F_BLNK}
        )

# This is the last rule (always match, no blank line comes here)
formats[F_PLAIN0] = (
        re.compile(r'^(?P)(?P.+)(?P)$'),     # Text
        all_entry_formats,
        {F_PLAIN0, F_BLNK}
        )

# drop lines such as "All Rights Reserved" and treat them blank
re_dropline = re.compile(r'''(?:
        ^timestamp=|                        # timestamp line
        ^scriptversion=|                    # version line
        ^All\s+Rights\s+Reserved|           # possible leader
        ^LICENSE:|                          # 
        ^written\s+by|
        ^This\s+file\s+is\s+part\s+of\s+GNU|
        ^Last\s+update:\s|
        ^\.bp\s                             # manpage
        )''', re.IGNORECASE | re.VERBOSE)

def check_format_style(line, xformat_state):
    line = line.strip()
    if line[:1] == '+': # hack to drop patch (1 level)
        line = line[1:].strip()
    prefix = ''
    postfix = ''
    format_state = F_EOF
    formats_allowed = formats[xformat_state][1]
    for f in formats_allowed:
        regex = formats[f][0]
        m = regex.search(line)
        if m:
            line = m.group('text').strip()
            prefix = m.group('prefix') # for debug output
            postfix = m.group('postfix') # for debug output
            format_state = f
            break
    if re_dropline.match(line): # hack to drop line
        line = ''
        if format_state != F_EOF:
            format_state = F_BLNK
    debmake.debug.debug('Ds: format={}->{}, prefix="{}", postfix="{}": "{}"'.format(fs[xformat_state], fs[format_state], prefix, postfix, line), type='s')
    return (line, format_state)

###################################################################
# Clean copyright
###################################################################
# substitute: \(co or (c) or  @copyright{} -> ©
re_co = re.compile(r'(?:\\\(co|\(c\)|@copyright\{\})', re.IGNORECASE) # fake match )

# search to allow leading jank words
re_copyright_line = re.compile(r'''
        (?:(?:Copyright|Copyr\.)\s*©\s*|
        ©\s*(?:Copyright|Copyr\.)\s+|
        (?:Copyright:?|Copyr\.)\s+|
        ©\s*)(?P[^\s].*)$
        ''', re.IGNORECASE | re.VERBOSE)

def clean_copyright(line):
    # simplify '©' handling: no (c) from C MACRO here
    line = re_co.sub('©', line)
    m = re_copyright_line.search(line)
    if m:
        line = m.group('copyright').strip()
    else:
        print("W: no match @clean_copyright line={}".format(line), file=sys.stderr)
    return line

###################################################################
# Clean license
###################################################################
def clean_license(license_lines):
    lines = license_lines
    while len(lines) > 0 and lines[0] == '':
        del lines[0]
    while len(lines) > 0 and lines[-1:][0] == '':
        del lines[-1:]
    return lines

###################################################################
# Extract copyright+license from a source file
###################################################################
# content_state
cs = [
'C_INIT',  # initial content_state
'C_COPY',  # copyright found
'C_COPYB', # blank after C_COPY
'C_AUTH',  # AUTHOR: like
'C_AUTHB', # blank after C_AUTH
'C_LICN',  # license found
'C_EOF',   # EOF found at the end of line
]
# enum(cs)
for i, name in enumerate(cs):
    exec('{} = {}'.format(name.strip(), i))
C_EOF = -1 # override

re_copyright_mark_maybe = re.compile(r'''
        (?:Copyright|Copyr\.|\(C\)|©|\\\(co) # fake )
        ''', re.IGNORECASE | re.VERBOSE)

# matching line is excluded to be identified as copyright.
re_copyright_mark_exclude = re.compile(r'''(?:
        [=?$]|                  # C MACRO
        [^h][-+*/_a-su-z0-9]\(C\)|  # C MACRO (but Copyright(C) is not included)
        if\s+\(C\)|             # C code
        switch\s+\(C\)|         # C code
        (?:def|if|return)\s.*\(C\)| # Python/C
        /Copyright|             # file name
        Copyright[^\s(:]|       # text or variable name
        Copyright:?$|           # text
        Copyright\s+notice|     # text
        Copyright\s+holder|     # text
        Copyright\s+section|    # text
        Copyright\s+stanza|     # text
        copyright\s+file|       # text
        copyright\s+and\s+license| # text
        of\s+copyright| # text
        their\s+copyright|    # text
        the\s+copyright|    # text
        ^This\s.*copyright      # text
        )''', re.IGNORECASE | re.VERBOSE)

re_copyright_nomark_year = re.compile(r'''
        ^[12]\d\d\d\d
        ''', re.IGNORECASE | re.VERBOSE)

re_author_init = re.compile(r'''^(?:
        authors?:?|
        maintainers?:?|
        translators?:?)
        \s*(?P.*)\s*$
        ''', re.IGNORECASE | re.VERBOSE)
re_author_cont = re.compile(r'^(?:.*@.*\..*|[^ ]*(?: [^ ]*){1,4})$')

re_license_start_maybe = re.compile(r'''(
        \sare\s|
        \sis\s|
        ^Copying\s|
        ^Everyone\s|
        ^Licensed\s|
        ^License\s|
        ^Permission\s|
        ^Redistribution\s|
        ^This\s|
        ^Unless\s
        )''', re.IGNORECASE | re.VERBOSE)
re_license_start_sure = re.compile(r'''(
        ^Copying\s+and\s+distribution\s+of\s+this\s+file|       # PERMISSIVE
        ^Distributed\s+under\s+the\s+Boost\s+Software\s+License,|   # Boost
        ^Everyone\s+is\s+permitted\s+to\s+copy\s+and\s+distribute|  # GNU FULL
        ^Distribute\s+under\s[AL]?GPL\s+version|                # GPL short
        ^Licensed\s+to\s+the\s+Apache\s+Software\s+Foundation|  #Apache-2.0_var1
        ^Licensed\s+under\s+|                                   # ECL
        ^Licensed\s+under\s+the\s+Apache\s+License|             #Apache-2.0_var2
        ^License\s+Applicability.\s+Except\s+to\s+the\s+extent\s+portions|  # SGI
        ^Permission\s+is\s+granted\s+to\s+copy,\s+distribute|   # GFDL 1.1
        ^Permission\s+is\s+hereby\s+granted|                    # MIT
        ^Permission\s+to\suse,\s+copy,\s+modify|                # ISC
        ^Redistribution\s+and\s+use\s+in\s+source\s+and\s+binary\s+forms|   # Apache 1.0/BSD
        ^The\s+contents\s+of\s+this\s+file|                     # ErlPL, ...
        ^The\s+contents\s+of\s+this\s+file\s+are\s+subject\s+to| # MPL-1.0 1.1
        ^This\s+.{2,40}\s+is\s+free\s+software|                 # makefile.in etc.
        ^This\s+file\s+is\s+distributed\s+under\s+the\s+same\s+license\s+as\s+.{5,40}\.$| # same
        ^This\s+library\s+is\s+free\s+software|                 # LGPL variants
        ^This\s+license\s+is\s+a\s+modified\s+version\s+of\s+the|   # AGPL-1.0
        ^This\s+program\s+can\s+redistributed|                  # LaTeX LPPL 1.0
        ^This\s+program\s+is\s+free\s+software|                 # GPL variants
        ^This\s+program\s+may\s+be\s+redistributed|             # LaTeX LPPL 1.1 1.2
        ^This\s+software\s+is\s+furnished\s+under\s+license|    # DEC
        ^This\s+software\s+is\s+provided\s+|                    # Zlib
        ^This\s+Source\s+Code\s+Form\s+is\s+subject\s+to\s+the\s+terms\s+of| # MPL 2.0
        ^This\s+work\s+is\s+distributed\s+under|                # W3C
        ^This\s+work\s+may\s+be\s+redistributed|                # LaTeX LPPL 1.3
        ^unless\s+explicitly\s+acquired\s+and\s+licensed        # Watcom
        )''', re.IGNORECASE | re.VERBOSE)

re_license_end_start = re.compile(r'''(
        ^EOT$|^EOF$|^EOL$|^END$|        # shell <{}, content={}->{}, copyright={}, license={}: "{}"'.format(fs[xformat_state], fs[format_state], cs[xcontent_state], cs[content_state], copyright_found, license_found, line), file=sys.stderr)
            print('W: !!!!! assertion error, exit loop !!!!!', file=sys.stderr)
            break
        debmake.debug.debug('De: *end* format={}->{}, content={}->{}, copyright={}, license={}: "{}"'.format(fs[xformat_state], fs[format_state], cs[xcontent_state], cs[content_state], copyright_found, license_found, line), type='e')
    ##########################################################################
    # main loop for lines (end)
    # sanitize copyright_lines
    ##########################################################################
    if len(copyright_lines) > MAX_COPYRIGHT_LINES:
        print('W: !!!!! too many copyright lines !!!!!', file=sys.stderr)
        print('W: starting with {}'.format(copyright_lines[0]), file=sys.stderr)
        copyright_lines = copyright_lines[:MAX_COPYRIGHT_LINES]
    for (i, line) in enumerate(copyright_lines):
        if len(line) > MAX_COPYRIGHT_LENGTH:
            copyright_lines[i] = line[:MAX_COPYRIGHT_LENGTH]
            print('W: !!!!! too long copyright line !!!!!', file=sys.stderr)
            print('W: starting with {}'.format(copyright_lines[i]), file=sys.stderr)
    ##########################################################################
    # analyze copyright
    ##########################################################################
    copyright_data = analyze_copyright(copyright_lines)
    license_lines = clean_license(license_lines)
    debmake.debug.debug('Da: AUTHOR(s)/TRANSLATOR(s):', type='a')
    for line in author_lines:
        debmake.debug.debug('Da: {}'.format(line), type='a')
    if copyright_data == {} and license_lines == []:
        # no copyright and no license
        copyright_data = {'__NO_COPYRIGHT_NOR_LICENSE__':(9999, 0)}
    elif copyright_data == {}:
        # no copyright and but with license (Maybe __UNKNOWN__ license)
        copyright_data = {'__NO_COPYRIGHT__':(9999, 0)}
    return (copyright_data, license_lines)

###################################################################
# Check license of a text file
###################################################################
def check_license(file, encoding='utf-8'):
    ###################################################################
    # Start analyzing file (default encoding)
    ###################################################################
    try:
        with open(file, 'r', encoding=encoding) as fd:
            (copyright_data, license_lines) = check_lines(fd.readlines())
    ###################################################################
    # Fall back for analyzing file (latin-1 encoding)
    ###################################################################
    except UnicodeDecodeError as e:
        print('W: Non-UTF-8 char found, using latin-1: {}'.format(file), file=sys.stderr)
        fd.close()
        with open(file, 'r', encoding='latin-1') as fd:
            (copyright_data, license_lines) = check_lines(fd.readlines())
    return (copyright_data, license_lines)

###################################################################
# Check autogenerated files
###################################################################
re_autofiles = re.compile(r'''(
        ^Makefile.in$| # Autotools
        ^.*/Makefile\.in$| # Autotools
        ^aclocal.m4$| # Autotools
        ^build-aux/.*$| # Autotools
        ^compile$| # Autotools
        ^config\.guess$| # Autotools
        ^config\.status$| # Autotools
        ^config\.sub$| # Autotools
        ^config\.rpath$| # Autotools
        ^configure$| # Autotools
        ^depcomp$| # Autotools
        ^install-sh$| # Autotools
        ^libltdl/.*$| # Autotools
        ^libtool$| # Autotools
        ^ltmain.sh$| # Autotools
        ^missing$| # Autotools
        ^py-compile$| # Autotools
        ^test-driver$| # Autotools
        ^po/Makefile$| # Autotools (getttext)
        ^po/Makefile\.in$| # Autotools (gettext)
        ^po/Makefile\.in\.in$| # Autotools (gettext)
        ^po/Makevars$| # Autotools (gettext)
        ^m4/.*$        # Autotools (no | at the end)
        )''', re.IGNORECASE | re.VERBOSE)

###################################################################
# Check all appearing copyright and license texts
###################################################################
# data[*][0]: license name ID: licenseid
# data[*][1]: file name (bunched, list): files
# data[*][2]: copyright holder info (data=dictionary): copyright_lines
# data[*][3]: license text (original: list of lines): license_lines
###################################################################
def check_all_licenses(files, encoding='utf-8', mode=0, pedantic=False):
    adata = []
    license_cache = {} # hashtable for quicker license scan
    md5hash = hashlib.md5()
    licensetext0 = '\n Auto-generated file under the permissive license.'
    md5hash.update(licensetext0.encode())
    md5hashkey0 = md5hash.hexdigest()
    license_cache[md5hashkey0] = ('__AUTO_PERMISSIVE__', licensetext0, True)
    if len(files) == 0:
        print('W: check_all_licenses(files) should have files', file=sys.stderr)
    if sys.hexversion >= 0x03030000: # Python 3.3 ...
        print('I: ', file=sys.stderr, end='', flush=True)
    for file in files:
        debmake.debug.debug('Df: check_all_licenses file={}'.format(file), type='f')
        if os.path.isfile(file):
            if sys.hexversion >= 0x03030000: # Python 3.3 ...
                print('.', file=sys.stderr, end='', flush=True)
            (copyright_data, license_lines) = check_license(file, encoding=encoding)
            debmake.debug.debug('Dc: copyright_data  = {}'.format(copyright_data), type='c')
            norm_text = debmake.lc.normalize(license_lines)
            md5hash = hashlib.md5()
            md5hash.update(norm_text.encode())
            md5hashkey = md5hash.hexdigest()
            if md5hashkey in license_cache.keys():
                (licenseid, licensetext, permissive) = license_cache[md5hashkey]
            else:
                (licenseid, licensetext, permissive) = debmake.lc.lc(norm_text, license_lines, mode)
                license_cache[md5hashkey] = (licenseid, licensetext, permissive)
            if not pedantic and permissive and re_autofiles.search(file):
                debmake.debug.debug('Dl: LICENSE ID = __AUTO_PERMISSIVE__ from {}'.format(licenseid), type='l')
                licenseid = '__AUTO_PERMISSIVE__'
                licensetext = licensetext0
                md5hashkey = md5hashkey0
            else:
                debmake.debug.debug('Dl: LICENSE ID = {}'.format(licenseid), type='l')
            adata.append((md5hashkey, copyright_data, licenseid, licensetext, file))
        else:
            print('W: check_all_licenses on non-existing file: {}'.format(file), file=sys.stderr)
        for c in copyright_data.keys():
            debmake.debug.debug('Dc: {}-{}: {}'.format(copyright_data[c][0], copyright_data[c][1], c), type='c')
        for l in license_lines:
            debmake.debug.debug('Dl: {}'.format(l), type='l')
    print('\nI: check_all_licenses completed for {} files.'.format(len(files)), file=sys.stderr)
    return adata

def bunch_all_licenses(adata):
    # group scan result by license
    group_by_license = []
    adata = sorted(adata, key=operator.itemgetter(0)) # sort by md5hashkey
    for k, g in itertools.groupby(adata, operator.itemgetter(0)):
        group_by_license.append(list(g))      # Store group iterator as a list
    # bunch the same license for reporting
    bdata = []
    for data_by_license in group_by_license:
        bunched_files = []
        bunched_copyright_data = {}
        for (md5hashkey, copyright_data, licenseid, licensetext, file) in data_by_license:
            bunched_files.append(file)
            for name, (year_min, year_max) in copyright_data.items():
                if name in bunched_copyright_data.keys():
                    (year_min0, year_max0) = bunched_copyright_data[name]
                    bunched_copyright_data[name] = (min(year_min0, year_min), max(year_max0, year_max))
                else:
                    bunched_copyright_data[name] = (year_min, year_max)
        sortkey = '{0:03} {1:02} {2} {3}'.format(max(0, 1000 - len(bunched_files)), min(99, len(licenseid)), licenseid, md5hashkey)
        bunched_files = sorted(bunched_files)
        copyright_list = []
        for name, (year_min, year_max) in bunched_copyright_data.items():
            copyright_list.append((year_min, year_max, name))
        copyright_list = sorted(copyright_list)
        bdata.append((sortkey, bunched_files, copyright_list, licenseid, licensetext))
        debmake.debug.debug('Dk: sortkey="{}", files={}'.format(sortkey, bunched_files), type='k')
    return bdata

def format_all_licenses(bdata):
    spaces = '           ' # 11 spaces
    # sort for printer ready order
    group_by_license = []
    bdata = sorted(bdata, key=operator.itemgetter(0)) # sort by sortkey (more files comes early)
    for k, g in itertools.groupby(bdata, operator.itemgetter(0)):
        group_by_license.append(list(g))      # Store group iterator as a list
    cdata = []
    for data_by_sortkey in group_by_license:
        for (sortkey, bunched_files, copyright_list, licenseid, licensetext) in data_by_sortkey:
            copyright_lines = ''
            for (year_min, year_max, name) in copyright_list:
                if year_max == 0: # not found
                    copyright_lines += '{}{}\n'.format(spaces, name)
                elif year_min == year_max:
                    copyright_lines += '{}{} {}\n'.format(spaces, year_min, name)
                else:
                    copyright_lines += '{}{}-{} {}\n'.format(spaces, year_min, year_max, name)
            cdata.append((licenseid, licensetext, bunched_files, copyright_lines))
    return cdata

def check_copyright(files, mode=0, encoding='utf-8', pedantic=False):
    print('I: check_all_licenses', file=sys.stderr)
    adata = check_all_licenses(files, encoding=encoding, mode=mode, pedantic=pedantic)
    print('I: bunch_all_licenses', file=sys.stderr)
    bdata = bunch_all_licenses(adata)
    print('I: format_all_licenses', file=sys.stderr)
    cdata = format_all_licenses(bdata)
    return cdata


###################################################################
# Format licence
###################################################################
def format_license(lines):
    # RFC-822 compliant empty lines with "."
    xlines = []
    for line in lines:
        line = line.rstrip()
        if line == '':
            xlines.append(' .\n')
        else:
            xlines.append(' ' + line + '\n')
    return ''.join(xlines)

#######################################################################
# license text file conversion
#######################################################################
def license_text(file, encoding='utf-8'):
    lines = []
    try:
        with open(file, 'r', encoding=encoding) as fd:
            for line in fd.readlines():
                lines.append(line.rstrip())
    except UnicodeDecodeError as e:
        print('W: Non-UTF-8 char found, using latin-1: {}'.format(file), file=sys.stderr)
        fd.close()
        lines = []
        with open(file, 'r', encoding='latin-1') as fd:
            for line in fd.readlines():
                lines.append(line.rstrip())
    return format_license(lines)

#######################################################################
# main program
#######################################################################
def copyright(package_name, license_file_masks, data, xml_html_files, binary_files, huge_files, mode=0, tutorial=False):
    # mode: 0: not -c, 1: -c simple, 2: -cc normal, 3: -ccc extensive
    #      -1: -cccc debug simple, -2 -ccccc debug normal -3 -cccccc debug extensive
    # make text to print
    text = '''\
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: {}
Source: 
'''.format(package_name)
    if tutorial:
        text += '''###
### Uncomment the following 2 lines to enable uscan to exclude non-DFSG components 
### Files-Excluded: command/non-dfsg.exe
###   docs/source/javascripts/jquery-1.7.1.min.js
###
### This is a autogenerated template for debian/copyright.
###
### Edit this accordinng to the "Machine-readable debian/copyright file" as
### http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ .
###
### Generate updated license templates with the "debmake -cc" to STDOUT
### and merge them into debian/copyright as needed.
###
### Please avoid to pick license terms that are more restrictive than the
### packaged work, as it may make Debian's contributions unacceptable upstream.

'''
    else:
        text += '\n'
    for (licenseid, licensetext, files, copyright_lines) in data:
        # Files:
        text +=             'Files:     {}\n'.format('\n           '.join(files))
        # Copyright:
        text +=             'Copyright: ' + copyright_lines[11:]
        # License:
        text +=             'License:   {}{}\n\n'.format(licenseid, licensetext)
    if xml_html_files != []:
        text += '#----------------------------------------------------------------------------\n'
        text += '# xml and html files (skipped):\n#         {}\n\n'.format('\n#         '.join(xml_html_files))
    if binary_files != []:
        text += '#----------------------------------------------------------------------------\n'
        text += '# binary files (skipped):\n#         {}\n\n'.format('\n#         '.join(binary_files))
    if huge_files != []:
        text += '#----------------------------------------------------------------------------\n'
        text += '# huge files   (skipped):\n#         {}\n\n'.format('\n#         '.join(huge_files))
    if mode == 0: # not for -c
        text += '''\
#----------------------------------------------------------------------------
# Files marked as NO_LICENSE_TEXT_FOUND may be covered by the following
# license/copyright files.

'''
        # get list of files to attach
        license_files = set()
        for fx in license_file_masks:
            license_files.update(set(glob.glob(fx)))
        for f in license_files:
            text += '#----------------------------------------------------------------------------\n'
            text += '# License file: {}\n'.format(f)
            text += license_text(f)
            text += '\n'

    return text

#######################################################################
# Test script
#######################################################################
if __name__ == '__main__':
    print(copyright('foo', {'LICENSE*', 'COPYRIGHT'}, [], ['binary1.file', 'binary2.file'], ['huge.file1', 'huge.file2']))
    check_lines(['#!/bin/sh', 'COPYRIGHT FOO_BAR 1890', '', 'License', 'END'])
    print(analyze_copyright(["1987-90 FOO bar","boo foo wooo 2001-12", "1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation, Inc." ]))
    X = 'Free Software Foundation, Inc. HHHHHHH'
    print(cleanup_name(X))

debmake-4.2.2/debmake/sed.py0000775000175000017500000000577212563440146016143 0ustar  osamuosamu00000000000000#!/usr/bin/python3
# vim:se tw=0 sts=4 ts=4 et ai:
"""
Copyright © 2014 Osamu Aoki

Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
"""
import glob
import os
import sys
import debmake.cat
import debmake.debug
#######################################################################
def sed(confdir, destdir, substlist, package, mask='*', tutorial=False):
    ###################################################################
    # confdir:   configuration file directory with / at the end
    # destdir:   destination directory with / at the end
    # substlist: substitution dictionary
    # package:   binary package name
    # mask:      source file mask for glob. Usually, *
    ###################################################################
    lconfdir = len(confdir)
    for file in glob.glob(confdir + mask):
        print('I: substituting => {}'.format(file), file=sys.stderr)
        with open(file, mode='r', encoding='utf-8') as f:
            text = f.read()
        for k in substlist.keys():
            text = text.replace(k, substlist[k])
        if file[lconfdir:lconfdir+7] == 'package':
            newfile = destdir + package + file[lconfdir+7:]
        else:
            newfile = destdir + file[lconfdir:]
        debmake.debug.debug('Ds: "{}"'.format(text), type='s')
        debmake.cat.cat(newfile, text, tutorial=tutorial)
    return

#######################################################################
# Test script
#######################################################################
if __name__ == '__main__':
    tutorial = False
    substlist = {
        '@BINPACKAGE@': 'binpackage',
        '@PACKAGE@': 'package',
        '@UCPACKAGE@': 'package'.upper(),
        '@YEAR@': '2014',
        '@FULLNAME@': 'fullname',
        '@EMAIL@': 'email@example.org',
        '@SHORTDATE@': '11 Jan. 2013',
    }
    sed('../extra2/', 'debian/', substlist, 'package', tutorial=tutorial)
    sed('../extra3/', 'debian/', substlist, 'package', tutorial=tutorial)
    sed('../extra4/', 'debian/copyright-example/', substlist, 'package', tutorial=tutorial)

debmake-4.2.2/debmake/analyze.py0000775000175000017500000005201212563440146017020 0ustar  osamuosamu00000000000000#!/usr/bin/python3
# vim:se tw=0 sts=4 ts=4 et ai:
"""
Copyright © 2014 Osamu Aoki

Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
"""
import glob
import os
import re
import sys
import subprocess
import debmake.grep
import debmake.read
import debmake.compat
import debmake.copyright
import debmake.scanfiles
import debmake.yn
###########################################################################
# get master name (remove -dev -dbg)
###########################################################################
# re.sub: drop "-dev"
re_dev = re.compile(r'''(-dev$)''')
def masterdev(name):
    if re_dev.search(name):
        name = re_dev.sub('',name)
    else:
        print('E: development package "{}" does not end with "-dev"'.format(name), file=sys.stderr)
        exit(1)
    return name

# re.sub: drop "-dbg"
re_dbg = re.compile(r'''(-dbg$)''')
def masterdbg(name):
    if re_dbg.search(name):
        name = re_dbg.sub('',name)
    else:
        print('E: debug package "{}" does not end with "-dbg"'.format(name), file=sys.stderr)
        exit(1)
    return name

###########################################################################
# popular: warn binary dependency etc. if they are top 3 popular files
###########################################################################
def popular(exttype, msg, debs, extcountlist, yes):
    n = 3 # check files with the top 3 popular extension types
    if exttype in dict(extcountlist[0:n]).keys():
        settype = False
        for deb in debs:
            type = deb['type'] # -b (python3 also reports python)
            if type == exttype:
                settype = True
                break
            if exttype == 'python' and type == 'python3':
                settype = True
                break
        if not settype:
            print('W: many ext = "{}" type extension programs without matching -b set.'.format(exttype, type), file=sys.stderr)
            debmake.yn.yn(msg, '', yes)
    return
###########################################################################
# description: read from the upstream packaging system
###########################################################################
def description(type, base_path):
    text = ''
    command = base_path + '/lib/debmake/' + type + '.short'
    p = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
    for line in p.stdout.readlines():
        text += line.decode('utf-8').strip() + ' '
    if p.wait() != 0:
        print('E: "{}" returns "{}"'.format(command, p.returncode), file=sys.stderr)
        exit(1)
    return text.strip()
###########################################################################
# description_long: read from the upstream packaging system
###########################################################################
def description_long(type, base_path):
    text = ''
    command = base_path + '/lib/debmake/' + type + '.long'
    p = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
    for line in p.stdout.readlines():
        l = line.decode('utf-8').rstrip()
        if l:
            text += ' ' + l + '\n'
        else:
            text += ' .\n'
    if p.wait() != 0:
        print('E: "{}" returns "{}"'.format(command, p.returncode), file=sys.stderr)
        exit(1)
    if text == ' .\n':
        text = ''
    return text
###########################################################################
# analyze: called from debmake.main()
###########################################################################
def analyze(para):
    ###################################################################
    # package list by types (first pass)
    ###################################################################
    para['bin'] = []
    para['lib'] = []
    para['dev'] = []
    para['dbg'] = []
    para['data'] = []
    para['doc'] = []
    para['scripts'] = []
    for i, deb in enumerate(para['debs']):
        if deb['type'] == 'bin':
            para['bin'].append(deb['package'])
        elif deb['type'] == 'lib':
            para['lib'].append(deb['package'])
        elif deb['type'] == 'dev':
            para['dev'].append(deb['package'])
        elif deb['type'] == 'dbg':
            para['dbg'].append(deb['package'])
        elif deb['type'] == 'doc':
            para['doc'].append(deb['package'])
        elif deb['type'] == 'data':
            para['data'].append(deb['package'])
        else:
            para['scripts'].append(deb['package'])
    if len(para['debs']) != 1 and len(para['dev']) != len(para['lib']):
        print('E: # of "dev":{} != # of "lib": {}.'.format(len(para['dev']), len(para['lib'])), file=sys.stderr)
        exit(1)
    if len(para['dbg']) == 1:
        if (len(para['bin']) + len(para['lib'])) == 0:
            print('E: # of "dbg":{} but # of "bin+lib": {}.'.format(len(para['dbg']), len(para['bin']) + len(para['lib'])), file=sys.stderr)
            exit(1)
    elif len(para['dbg']) > 1:
        if len(para['dbg']) != (len(para['bin']) + len(para['lib'])):
            print('E: # of "dbg":{} != # of "bin+lib": {}.'.format(len(para['dbg']), len(para['bin']) + len(para['lib'])), file=sys.stderr)
            exit(1)
    if para['lib'] != []:
        setmultiarch = True
    elif para['bin'] != [] and len(para['debs']) == 1:
        setmultiarch = True
    else:
        setmultiarch = False # for override
    if para['monoarch']:
        setmultiarch = False
    ###################################################################
    # package list by types (second pass)
    ###################################################################
    para['dh_strip'] = ''
    for i, deb in enumerate(para['debs']):
        if deb['type'] == 'bin':
            para['export'].update({'compiler'})
            for libpkg in para['lib']:
                para['debs'][i]['depends'].update({libpkg + ' (= ${binary:Version})'})
        elif deb['type'] == 'lib':
            para['export'].update({'compiler'})
        elif deb['type'] == 'dev':
            pkg = masterdev(deb['package'])
            match = False
            for libpkg in para['lib']:
                if libpkg[:len(pkg)] == pkg:
                    para['debs'][i]['depends'].update({libpkg + ' (= ${binary:Version})'})
                    match = True
                    break
            if not match:
                print('E: {} does not have matching library in "{}".'.format(deb['package'], ', '.join(para['lib'])), file=sys.stderr)
                exit(1)
        elif deb['type'] == 'dbg':
            para['override'].update({'dbg'})
            pkgs = para['bin'] + para['lib']
            if len(para['dbg']) == 1:
                for pkg in pkgs:
                    para['debs'][i]['depends'].update({pkg + ' (= ${binary:Version})'})
                para['dh_strip'] += '\tdh_strip --dbg-package={}\n'.format(deb['package'])
            else:
                pkg = masterdbg(deb['package'])
                if pkg in pkgs:
                    para['debs'][i]['depends'].update({pkg + ' (= ${binary:Version})'})
                else:
                    print('E: {} does not match package in "{}".'.format(deb['package'], ', '.join(pkgs)), file=sys.stderr)
                    exit(1)
                pkgs.remove(pkg)
                para['dh_strip'] += '\tdh_strip -X{} --dbg-package={}\n'.format(' -X'.join(pkgs), deb['package'])
        elif deb['type'] == 'perl':
            for libpkg in para['lib']:
                para['debs'][i]['depends'].update({libpkg + ' (>= ${source:Version})'})
        elif deb['type'] == 'python':
            para['dh_with'].update({'python2'}) # better to be explicit
            para['build_depends'].update({'python-all'})
            for libpkg in para['lib']:
                para['debs'][i]['depends'].update({libpkg + ' (>= ${source:Version}), ' + libpkg + ' (<< ${source:Upstream-Version}.0~)'})
        elif deb['type'] == 'python3':
            para['dh_with'].update({'python3'})
            para['build_depends'].update({'python3-all', 'dh-python'})
            for libpkg in para['lib']:
                para['debs'][i]['depends'].update({libpkg + ' (>= ${source:Version}), ' + libpkg + ' (<< ${source:Upstream-Version}.0~)'})
        elif deb['type'] == 'ruby':
            para['dh_with'].update({'ruby'}) # may not be needed
            para['build_depends'].update({'ruby'})
            for libpkg in para['lib']:
                para['debs'][i]['depends'].update({libpkg + ' (>= ${source:Version}), ' + libpkg + ' (<< ${source:Upstream-Version}.0~)'})
        elif deb['type'] == 'script':
            for libpkg in para['lib']:
                para['debs'][i]['depends'].update({libpkg + ' (>= ${source:Version}), ' + libpkg + ' (<< ${source:Upstream-Version}.0~)'})
        else:
            pass
    #######################################################################
    # auto-set build system by files in the base directory
    #######################################################################
    para['build_type'] = '' # reset value
    para['dh_buildsystem'] = '' # normally not needed
    # check if '*.pro' for Qmake project exist in advance. 
    pro = glob.glob('*.pro')
    if pro:
        pro = pro[0]
    else:
        pro = ''
    # check if '*.spec.in' for RPM
    specs = glob.glob('*.spec.in')
    if specs:
        spec = specs[0]
    else:
        spec = ''
    # GNU coding standard with autotools = autoconf+automake
    if os.path.isfile('configure.ac') and \
            os.path.isfile('Makefile.am') and \
            not ('autotools-dev' in para['dh_with']):
        para['dh_with'].update({'autoreconf'})
        para['build_type']      = 'Autotools with autoreconf'
        para['build_depends'].update({'dh-autoreconf'})
        para['export'].update({'autotools'})
        if os.path.isfile('autogen.sh'):
            para['override'].update({'autogen'})
        else:
            para['override'].update({'autoreconf'})
    elif os.path.isfile('configure.in') and \
            os.path.isfile('Makefile.am') and \
            not ('autotools-dev' in para['dh_with']):
        para['dh_with'].update({'autoreconf'})
        para['build_type']      = 'Autotools with autoreconf (old)'
        para['build_depends'].update({'dh-autoreconf'})
        para['export'].update({'autotools'})
        if os.path.isfile('autogen.sh'):
            para['override'].update({'autogen'})
        else:
            para['override'].update({'autoreconf'})
        print('W: Use of configure.in has been deprecated since 2001.', file=sys.stderr)
    elif os.path.isfile('configure.ac') and \
            os.path.isfile('Makefile.am') and \
            os.path.isfile('configure'):
        para['dh_with'].update({'autotools-dev'})
        para['build_type']      = 'Autotools'
        para['build_depends'].update({'autotools-dev'})
        para['export'].update({'autotools'})
    elif os.path.isfile('configure.in') and \
            os.path.isfile('Makefile.am') and \
            os.path.isfile('configure'):
        para['dh_with'].update({'autotools-dev'})
        para['build_type']      = 'Autotools (old)'
        para['build_depends'].update({'autotools-dev'})
        para['export'].update({'autotools'})
        print('W: Use of configure.in has been deprecated since 2001.', file=sys.stderr)
    elif 'autoreconf' in para['dh_with']:
        print('E: missing configure.ac or Makefile.am required for "dh $@ --with autoreconf".', file=sys.stderr)
        exit(1)
    elif 'autotools-dev' in para['dh_with']:
        print('E: missing configure.ac or Makefile.am or configure required for "dh $@ --with autotools-dev".', file=sys.stderr)
        exit(1)
    # GNU coding standard with configure
    elif os.path.isfile('configure'):
        para['build_type']      = 'configure'
        if setmultiarch:
            para['override'].update({'multiarch'})
    # GNU coding standard with Cmake
    elif os.path.isfile('CMakeLists.txt'):
        para['build_type']      = 'Cmake'
        para['build_depends'].update({'cmake'})
        para['override'].update({'cmake'})
        if setmultiarch:
            para['override'].update({'multiarch'})
    # GNU coding standard with make
    elif os.path.isfile('Makefile'):
        para['build_type']      = 'make'
        para['override'].update({'makefile'})
        if setmultiarch:
            para['override'].update({'multiarch'})
    # Python distutils
    elif os.path.isfile('setup.py'):
        if debmake.grep.grep('setup.py', 'python3', 0, 1):
            # http://docs.python.org/3/distutils/
            para['dh_with'].update({'python3'})
            if debmake.grep.grep('setup.py', r'from\s+setuptools\s+import\s+setup'):
                para['build_depends'].update({'python3-all', 'dh-python', 'python3-setuptools'})
            elif debmake.grep.grep('setup.py', r'from\s+distutils.core\s+import\s+setup'):
                para['build_depends'].update({'python3-all', 'dh-python'})
            else:
                print('W: neither distutils nor setuptools.  check setup.py.', file=sys.stderr)
                para['build_depends'].update({'python3-all', 'dh-python'})
            para['dh_buildsystem'] = 'pybuild'
            if 'python2' in para['dh_with']:
                para['build_depends'].update({'python-all'})
            if para['spec']:
                if para['desc'] == '':
                    para['desc'] = description('python3', para['base_path'])
                if para['desc_long'] =='':
                    para['desc_long'] = description_long('python3', para['base_path'])
        elif debmake.grep.grep('setup.py', 'python', 0, 1):
            # http://docs.python.org/2/distutils/
            para['dh_with'].update({'python2'})
            para['build_type']      = 'Python distutils'
            if debmake.grep.grep('setup.py', r'from\s+setuptools\s+import\s+setup'):
                para['build_depends'].update({'python3-all', 'dh-python', 'python-setuptools'})
            elif debmake.grep.grep('setup.py', r'from\s+distutils.core\s+import\s+setup'):
                para['build_depends'].update({'python3-all', 'dh-python'})
            else:
                print('W: neither distutils nor setuptools.  check setup.py.', file=sys.stderr)
                para['build_depends'].update({'python3-all', 'dh-python'})
            if 'python3' in para['dh_with']:
                para['build_depends'].update({'python3-all', 'dh-python'})
                para['dh_buildsystem'] = 'pybuild'
            if para['spec']:
                if para['desc'] == '':
                    para['desc'] = description('python', para['base_path'])
                if para['desc_long'] =='':
                    para['desc_long'] = description_long('python', para['base_path'])
        else:
            print('E: unknown python version.  check setup.py.', file=sys.stderr)
            exit(1)
    # Perl
    elif os.path.isfile('Build.PL'):
        # Prefered over Makefile.PL after debhelper v8
        para['build_type']      = 'Perl Module::Build'
        para['build_depends'].update({'perl'})
    elif os.path.isfile('Makefile.PL'):
        para['build_type']      = 'Perl ExtUtils::MakeMaker'
        para['build_depends'].update({'perl'})
    # Ruby
    elif os.path.isfile('setup.rb'):
        print('W: dh-make-ruby(1) (gem2deb package) may provide better packaging results.', file=sys.stderr)
        para['build_type']      = 'Ruby setup.rb'
        para['build_depends'].update({'ruby', 'gem2deb'})
    # Java
    elif os.path.isfile('build.xml'):
        para['build_type']      = 'Java ant'
        para['dh_with'].update({'javahelper'})
        # XXX FIXME XXX which compiler to use?
        para['build_depends'].update({'javahelper', 'gcj'})
        para['export'].update({'java', 'compiler'})
        para['override'].update({'java'})
        if setmultiarch:
            para['override'].update({'multiarch'})
    # Qmake
    elif os.path.isfile(pro):
        # XXX FIXME XXX Is this right?
        para['build_type']      = 'QMake'
        para['build_depends'].update({'qt4-qmake'})
        if setmultiarch:
            para['override'].update({'multiarch'})
    else:
        para['build_type']      = 'Unknown'
        if setmultiarch:
            para['override'].update({'multiarch'})
    print('I: build_type = {}'.format(para['build_type']), file=sys.stderr)
    #######################################################################
    # high priority spec source, first
    if para['spec']:
        if para['desc'] == '' and os.path.isfile('META.yml'):
            para['desc'] = description('META.yml', para['base_path'])
        if para['desc'] == '' and os.path.isfile('Rakefile'):
            para['desc'] = description('Rakefile', para['base_path'])
        if para['desc'] == '' and spec:
            para['desc'] = description('spec', para['base_path'])
        if para['desc_long'] =='' and spec:
            para['desc_long'] = description_long('spec', para['base_path'])
    #######################################################################
    # analize copyright+license content + file extensions
    # copyright, control: build/binary dependency, rules export/override
    #######################################################################
    print('I: scan source for copyright+license text and file extensions', file=sys.stderr)
    (para['nonlink_files'], para['xml_html_files'], para['binary_files'], para['huge_files'], para['extcount'], para['extcountlist']) \
            = debmake.scanfiles.scanfiles()
    # skip slow license+copyright check if debian/copyright exists
    if os.path.isfile('debian/copyright'):
        para['cdata'] = []
    else:
        para['cdata'] = debmake.copyright.check_copyright(para['nonlink_files'], mode=2)
    #######################################################################
    # compiler: set build dependency etc. if they are used
    if 'c' in para['extcount'].keys():
        para['export'].update({'compiler'})
        if setmultiarch and para['build_type'][0:9] != 'Autotools':
            para['override'].update({'multiarch'})
    if 'java' in para['extcount'].keys():
        if para['build_type'][0:4] != 'Java':
            # Non-ant build system
            if para['build_type']:
                para['build_type']      = 'Java + ' + para['build_type']
            else:
                para['build_type']      = 'Java'
            para['dh_with'].update({'javahelper'})
            para['build_depends'].update({'javahelper', 'gcj'})
            para['export'].update({'java', 'compiler'})
            para['override'].update({'java'})
            if setmultiarch and para['build_type'][0:9] != 'Autotools':
                para['override'].update({'multiarch'})
    if para['build_type'][0:4] == 'Java':
        print('W: Java support is not perfect. (/usr/share/doc/javahelper/tutorials.html)', file=sys.stderr)
    if 'vala' in para['extcount'].keys():
        para['build_type']      = 'Vala'
        para['build_depends'].update({'valac'})
        para['export'].update({'vala', 'compiler'})
        if setmultiarch and para['build_type'][0:9] != 'Autotools':
            para['override'].update({'multiarch'})
    #######################################################################
    # set build dependency and override if --with python2/python3
    #######################################################################
    if 'python2' in para['dh_with']:
        para['build_depends'].update({'python-all'})
        para['override'].update({'pythons'})
    if 'python3' in para['dh_with']:
        para['build_depends'].update({'python3-all', 'dh-python'})
        para['override'].update({'pythons'})
    #######################################################################
    # interpreter: warn binary dependency etc. if they are top 3 popular files
    #######################################################################
    popular('perl', '-b":perl, ..." missing. Continue?', para['debs'], para['extcountlist'], para['yes'])
    popular('python', '-b":python, ..." or -b":python3" missing. Continue?', para['debs'], para['extcountlist'], para['yes'])
    popular('ruby', '-b":ruby, ..." missing. Continue?', para['debs'], para['extcountlist'], para['yes'])
    #######################################################################
    return para

if __name__ == '__main__':
    print('no test')

debmake-4.2.2/extra2single/0000775000175000017500000000000012563440271016016 5ustar  osamuosamu00000000000000debmake-4.2.2/extra2single/menu0000664000175000017500000000072112563440146016706 0ustar  osamuosamu00000000000000# You must remove unused comment lines for the released package.
### Menu template (edit and rename to debian/menu to activate)
### See dh_installmenu(1)
###     /usr/share/doc/menu/html/*
###     http://www.debian.org/doc/manuals/maint-guide/dother.en.html#menu
###
#?package(@PACKAGE@):needs="X11|text|vc|wm" \
#                    section="Applications/see-menu-manual"\
#                    title="@PACKAGE@" \
#                    command="/usr/bin/@PACKAGE@"
debmake-4.2.2/extra2single/postinst0000664000175000017500000000201112563440146017617 0ustar  osamuosamu00000000000000#!/bin/sh
set -e
### see: dh_installdeb(1)
###      http://www.debian.org/doc/manuals/maint-guide/dother.en.html#maintscripts
### summary of how this script can be called:
###        *  `configure' 
###        *  `abort-upgrade' 
###        *  `abort-remove' `in-favour' 
###          
###        *  `abort-remove'
###        *  `abort-deconfigure' `in-favour'
###            `removing'
###           
### for details, see http://www.debian.org/doc/debian-policy/ or
### the debian-policy package

case "$1" in
    configure)
    ;;

    abort-upgrade|abort-remove|abort-deconfigure)
    ;;

    *)
        echo "postinst called with unknown argument \`$1'" >&2
        exit 1
    ;;
esac

### dh_installdeb will replace this with shell code automatically
### generated by other debhelper scripts.

#DEBHELPER#

exit 0
debmake-4.2.2/extra2single/postrm0000664000175000017500000000176212563440146017274 0ustar  osamuosamu00000000000000#!/bin/sh
set -e
### see: dh_installdeb(1)
###      http://www.debian.org/doc/manuals/maint-guide/dother.en.html#maintscripts
### summary of how this script can be called:
###        *  `remove'
###        *  `purge'
###        *  `upgrade' 
###        *  `failed-upgrade' 
###        *  `abort-install'
###        *  `abort-install' 
###        *  `abort-upgrade' 
###        *  `disappear' 
###          
### for details, see http://www.debian.org/doc/debian-policy/ or
### the debian-policy package

case "$1" in
    purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
    ;;

    *)
        echo "postrm called with unknown argument \`$1'" >&2
        exit 1
    ;;
esac

### dh_installdeb will replace this with shell code automatically
### generated by other debhelper scripts.

#DEBHELPER#

exit 0
debmake-4.2.2/extra2single/clean0000664000175000017500000000012512563440146017022 0ustar  osamuosamu00000000000000# You must remove unused comment lines for the released package.
### See dh_clean(1)
debmake-4.2.2/extra2single/preinst0000664000175000017500000000136712563440146017435 0ustar  osamuosamu00000000000000#!/bin/sh
set -e
### see: dh_installdeb(1)
###      http://www.debian.org/doc/manuals/maint-guide/dother.en.html#maintscripts
### summary of how this script can be called:
###        *  `install'
###        *  `install' 
###        *  `upgrade' 
###        *  `abort-upgrade' 
### for details, see http://www.debian.org/doc/debian-policy/ or
### the debian-policy package

case "$1" in
    install|upgrade)
    ;;

    abort-upgrade)
    ;;

    *)
        echo "preinst called with unknown argument \`$1'" >&2
        exit 1
    ;;
esac

### dh_installdeb will replace this with shell code automatically
### generated by other debhelper scripts.

#DEBHELPER#

exit 0
debmake-4.2.2/extra2single/prerm0000664000175000017500000000167212563440146017075 0ustar  osamuosamu00000000000000#!/bin/sh
set -e
### see: dh_installdeb(1)
###      http://www.debian.org/doc/manuals/maint-guide/dother.en.html#maintscripts
### summary of how this script can be called:
###        *  `remove'
###        *  `upgrade' 
###        *  `failed-upgrade' 
###        *  `remove' `in-favour'  
###        *  `deconfigure' `in-favour'
###            `removing'
###           
### for details, see http://www.debian.org/doc/debian-policy/ or
### the debian-policy package

case "$1" in
    remove|upgrade|deconfigure)
    ;;

    failed-upgrade)
    ;;

    *)
        echo "prerm called with unknown argument \`$1'" >&2
        exit 1
    ;;
esac

### dh_installdeb will replace this with shell code automatically
### generated by other debhelper scripts.

#DEBHELPER#

exit 0
debmake-4.2.2/extra2single/install0000664000175000017500000000012712563440146017410 0ustar  osamuosamu00000000000000# You must remove unused comment lines for the released package.
### See dh_install(1)
debmake-4.2.2/extra2single/links0000664000175000017500000000012412563440146017057 0ustar  osamuosamu00000000000000# You must remove unused comment lines for the released package.
### See dh_link(1)
debmake-4.2.2/extra1source/0000775000175000017500000000000012563440271016034 5ustar  osamuosamu00000000000000debmake-4.2.2/extra1source/format0000664000175000017500000000001512563440146017244 0ustar  osamuosamu00000000000000@PKGFORMAT@

debmake-4.2.2/extra1source/local-options0000664000175000017500000000014012563440146020536 0ustar  osamuosamu00000000000000### Uncomment to active options. See dpkg-source(1)
#abort-on-upstream-changes
#unapply-patches
debmake-4.2.2/extra3/0000775000175000017500000000000012563440271014615 5ustar  osamuosamu00000000000000debmake-4.2.2/extra3/package.emacsen-install.ex0000664000175000017500000000241012563440146021622 0ustar  osamuosamu00000000000000#! /bin/sh -e
# /usr/lib/emacsen-common/packages/install/@PACKAGE@

# Written by Jim Van Zandt , borrowing heavily
# from the install scripts for gettext by Santiago Vila
#  and octave by Dirk Eddelbuettel .

FLAVOR=$1
PACKAGE=@PACKAGE@

if [ ${FLAVOR} = emacs ]; then exit 0; fi

echo install/${PACKAGE}: Handling install for emacsen flavor ${FLAVOR}

#FLAVORTEST=`echo $FLAVOR | cut -c-6`
#if [ ${FLAVORTEST} = xemacs ] ; then
#    SITEFLAG="-no-site-file"
#else
#    SITEFLAG="--no-site-file"
#fi
FLAGS="${SITEFLAG} -q -batch -l path.el -f batch-byte-compile"

ELDIR=/usr/share/emacs/site-lisp/${PACKAGE}
ELCDIR=/usr/share/${FLAVOR}/site-lisp/${PACKAGE}
ELRELDIR=../../../emacs/site-lisp/${PACKAGE}

# Install-info-altdir does not actually exist.
# Maybe somebody will write it.
if test -x /usr/sbin/install-info-altdir; then
    echo install/${PACKAGE}: install Info links for ${FLAVOR}
    install-info-altdir --quiet --section "" "" --dirname=${FLAVOR} /usr/share/info/${PACKAGE}.info.gz
fi

install -m 755 -d ${ELCDIR}
cd ${ELDIR}
FILES=`echo *.el`
cd ${ELCDIR}
ln -sf ${ELRELDIR}/*.el .

cat << EOF > path.el
(debian-pkg-add-load-path-item ".")
(setq byte-compile-warnings nil)
EOF
${FLAVOR} ${FLAGS} ${FILES}
rm -f path.el

exit 0
debmake-4.2.2/extra3/package.bug-presubj.ex0000664000175000017500000000032612563440146020774 0ustar  osamuosamu00000000000000# Installed as usr/share/bug/@PACKAGE@/presubj in @PACKAGE@
# See dh_bugfiles(1) and /usr/share/doc/reportbug/README.developers.gz
# The contents of this file are displayed to the user by the bug reporting tool.  
debmake-4.2.2/extra3/package.conffiles.ex0000664000175000017500000000075412563440146020524 0ustar  osamuosamu00000000000000# See dh_installdeb(1).
# Files listed in this file are treated as user configuration files by the
# Debian system and will never be overwritten without user consent.
#
# In v3 compatibility mode and higher, all files in the etc/ directory in
# a package will automatically be flagged as conffiles by this program, so
# there is no need to list them manually here.
#
# For most package types, the only place conffiles should ever be is under
# /etc, and so this file doesn’t need to exist.
debmake-4.2.2/extra3/package.upstrat.ex0000664000175000017500000000020312563440146020243 0ustar  osamuosamu00000000000000#!/bin/sh
# If this exists, it is installed into etc/init/package.conf in the package build directory.
# See *dh_installinit*(1).

debmake-4.2.2/extra3/package.cron.daily.ex0000664000175000017500000000014112563440146020604 0ustar  osamuosamu00000000000000#!/bin/sh
# Daily cron jobs shell script for the @PACKAGE@ package
# See dh_installcron(1).
true
debmake-4.2.2/extra3/package.emacsen-remove.ex0000664000175000017500000000073512563440146021461 0ustar  osamuosamu00000000000000#!/bin/sh -e
# /usr/lib/emacsen-common/packages/remove/@PACKAGE@

FLAVOR=$1
PACKAGE=@PACKAGE@

if [ ${FLAVOR} != emacs ]; then
    if test -x /usr/sbin/install-info-altdir; then
        echo remove/${PACKAGE}: removing Info links for ${FLAVOR}
        install-info-altdir --quiet --remove --dirname=${FLAVOR} /usr/share/info/@PACKAGE@.info.gz
    fi

    echo remove/${PACKAGE}: purging byte-compiled files for ${FLAVOR}
    rm -rf /usr/share/${FLAVOR}/site-lisp/${PACKAGE}
fi
debmake-4.2.2/extra3/manpage.asciidoc.ex0000664000175000017500000000113112563440146020335 0ustar  osamuosamu00000000000000= @UPACKAGE@(1)
:man source:   @UCPACKAGE@
:man version:  @VERREV@
:man manual:   @UCPACKAGE@ Manual

// See "Manpage Documents" in "AsciiDoc User Guide"
// http://www.methods.co.nz/asciidoc/userguide.html

// convert by:
// $ a2x --doctype manpage --format manpage @PACKAGE@.asciidoc

== NAME

@PACKAGE@ - program to do something

== SYNOPSIS

*@PACKAGE@*  [*-h*] ... 


== DESCRIPTION

*@PACKAGE@* do something.

=== optional arguments:

*-h*, *--help*::
    show this help message and exit.


== AUTHOR

Copyright © @YEAR@ @FULLNAME@ <@EMAIL@>

== LICENSE

MIT License

== SEE ALSO

See also ...

debmake-4.2.2/extra3/package.dirs.ex0000664000175000017500000000063012563440146017506 0ustar  osamuosamu00000000000000# See dh_installdirs(1)
# Lists directories to be created in package. (w/o preceding slash)
# Do not bother to list directories here if they are already listed in 
# @PACKAGE@.install etc.
# Any directories which we need but which are not created by the normal 
# installation procedure (make install DESTDIR=... invoked by 
# dh_auto_install). This generally means there is a problem with the 
# Makefile.

debmake-4.2.2/extra3/package.emacsen-startup.ex0000664000175000017500000000236112563440146021663 0ustar  osamuosamu00000000000000;; -*-emacs-lisp-*-
;;
;; Emacs startup file, e.g.  /etc/emacs/site-start.d/50@PACKAGE@.el
;; for the Debian @PACKAGE@ package
;;
;; Originally contributed by Nils Naumann 
;; Modified by Dirk Eddelbuettel 
;; Adapted for dh-make by Jim Van Zandt 

;; The @PACKAGE@ package follows the Debian/GNU Linux 'emacsen' policy and
;; byte-compiles its elisp files for each 'emacs flavor' (emacs19,
;; xemacs19, emacs20, xemacs20...).  The compiled code is then
;; installed in a subdirectory of the respective site-lisp directory.
;; We have to add this to the load-path:
(let ((package-dir (concat "/usr/share/"
                           (symbol-name debian-emacs-flavor)
                           "/site-lisp/@PACKAGE@")))
;; If package-dir does not exist, the @PACKAGE@ package must have
;; removed but not purged, and we should skip the setup.
  (when (file-directory-p package-dir)
    (if (fboundp 'debian-pkg-add-load-path-item)
        (debian-pkg-add-load-path-item package-dir)
      (setq load-path (cons package-dir load-path)))
    (autoload '@PACKAGE@-mode "@PACKAGE@-mode"
      "Major mode for editing @PACKAGE@ files." t)
    (add-to-list 'auto-mode-alist '("\\.@PACKAGE@$" . @PACKAGE@-mode))))

debmake-4.2.2/extra3/manpage.sgml.ex0000664000175000017500000001006612563440146017530 0ustar  osamuosamu00000000000000

  
  FIRSTNAME">
  SURNAME">
  
  @SHORTDATE@">
  
  SECTION">
  @EMAIL@">
  
  @UCPACKAGE@">
  

  Debian">
  GNU">
  GPL">
]>


  
    
&dhemail;
&dhfirstname; &dhsurname; 2003 &dhusername; &dhdate;
&dhucpackage; &dhsection; &dhpackage; program to do something &dhpackage; DESCRIPTION This manual page documents briefly the &dhpackage; and bar commands. This manual page was written for the &debian; distribution because the original program does not have a manual page. Instead, it has documentation in the &gnu; Info format; see below. &dhpackage; is a program that... OPTIONS These programs follow the usual &gnu; command line syntax, with long options starting with two dashes (`-'). A summary of options is included below. For a complete description, see the Info files. Show summary of options. Show version of program. SEE ALSO bar (1), baz (1). The programs are documented fully by The Rise and Fall of a Fooish Bar available via the Info system. AUTHOR This manual page was written by &dhusername; &dhemail; for the &debian; system (and may be used by others). Permission is granted to copy, distribute and/or modify this document under the terms of the &gnu; General Public License, Version 2 any later version published by the Free Software Foundation. On Debian systems, the complete text of the GNU General Public License can be found in /usr/share/common-licenses/GPL.
debmake-4.2.2/extra3/package.default.ex0000664000175000017500000000036112563440146020172 0ustar osamuosamu00000000000000# Defaults for @PACKAGE@ initscript # sourced by /etc/init.d/@PACKAGE@ # installed at /etc/default/@PACKAGE@ by the maintainer scripts # # This is a POSIX shell fragment # # Additional options that are passed to the Daemon. DAEMON_OPTS="" debmake-4.2.2/extra3/package.bug-control.ex0000664000175000017500000000032712563440146021003 0ustar osamuosamu00000000000000# Installed as usr/share/bug/@PACKAGE@/control in @PACKAGE@ # See dh_bugfiles(1) and /usr/share/doc/reportbug/README.developers.gz # It is the bug control file containing some directions for the bug reporting tool. debmake-4.2.2/extra3/package.lintian-overrides.ex0000664000175000017500000000024612563440146022206 0ustar osamuosamu00000000000000# See dh_lintian(1) # http://www.debian.org/doc/manuals/maint-guide/dother.en.html#lintian # cut and paste the lintian(1) outputs without leading "E: ", "W: ", ... debmake-4.2.2/extra3/package.bug-script.ex0000664000175000017500000000040112563440146020620 0ustar osamuosamu00000000000000# Installed as usr/share/bug/@PACKAGE@ or usr/share/bug/@PACKAGE@/script in @PACKAGE@ # See dh_bugfiles(1) and /usr/share/doc/reportbug/README.developers.gz # This is the script to be run by the bug reporting program for generating a bug report template. debmake-4.2.2/extra3/source.lintian-overrides.ex0000664000175000017500000000013512563440146022110 0ustar osamuosamu00000000000000# See dh_lintian(1) # cut and paste the lintian(1) outputs without leading "E: ", "W: ", ... debmake-4.2.2/extra3/package.cron.monthly.ex0000664000175000017500000000014312563440146021176 0ustar osamuosamu00000000000000#!/bin/sh # Monthly cron jobs shell script for the @PACKAGE@ package # See dh_installcron(1). true debmake-4.2.2/extra3/package.service.ex0000664000175000017500000000020012563440146020176 0ustar osamuosamu00000000000000#!/bin/sh # If this exists, it is installed into lib/systemd/system/@PACKAGE@.service in @PACKAGE@ # See dh_systemd_enable(1). debmake-4.2.2/extra3/package.cron.hourly.ex0000664000175000017500000000014212563440146021025 0ustar osamuosamu00000000000000#!/bin/sh # Hourly cron jobs shell script for the @PACKAGE@ package # See dh_installcron(1). true debmake-4.2.2/extra3/manpage.1.ex0000664000175000017500000000371712563440146016733 0ustar osamuosamu00000000000000.\" Hey, EMACS: -*- nroff -*- .\" (C) Copyright @YEAR@ @FULLNAME@ <@EMAIL@>, .\" .\" See http://www.debian.org/doc/manuals/maint-guide/dother.en.html#manpage1 .\" .\" 1. Use this as the template for the manpage for after .\" renaming this file to .1 (if it is for section 1). .\" .\" 2. List the path to this file in debian/.manpages to .\" install this manpage to the target binary package. .\" .\" First parameter, @UCPACKAGE@, should be all caps .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection .\" other parameters are allowed: see man(7), man(1) .TH @UCPACKAGE@ SECTION "@SHORTDATE@" .\" Please adjust this date whenever revising the manpage. .\" .\" Some roff macros, for reference: .\" .nh disable hyphenation .\" .hy enable hyphenation .\" .ad l left justify .\" .ad b justify to both left and right margins .\" .nf disable filling .\" .fi enable filling .\" .br insert line break .\" .sp insert n+1 empty lines .\" for manpage-specific macros, see man(7) .SH NAME @PACKAGE@ \- program to do something .SH SYNOPSIS .B @PACKAGE@ .RI [ options ] " files" ... .br .B bar .RI [ options ] " files" ... .SH DESCRIPTION This manual page documents briefly the .B @PACKAGE@ and .B bar commands. .PP .\" TeX users may be more comfortable with the \fB\fP and .\" \fI\fP escape sequences to invode bold face and italics, .\" respectively. \fB@PACKAGE@\fP is a program that... .SH OPTIONS These programs follow the usual GNU command line syntax, with long options starting with two dashes (`-'). A summary of options is included below. For a complete description, see the Info files. .TP .B \-h, \-\-help Show summary of options. .TP .B \-v, \-\-version Show version of program. .SH SEE ALSO .BR bar (1), .BR baz (1). .br The programs are documented fully by .IR "The Rise and Fall of a Fooish Bar" , available via the Info system. debmake-4.2.2/extra3/package.tmpfile.ex0000664000175000017500000000017512563440146020211 0ustar osamuosamu00000000000000#!/bin/sh # If this exists, it is installed into usr/lib/tmpfiles.d/@PACKAGE@.conf in @PACKAGE@ # See dh_systemd_enable(1). debmake-4.2.2/extra3/package.cron.weekly.ex0000664000175000017500000000014212563440146021003 0ustar osamuosamu00000000000000#!/bin/sh # Weekly cron jobs shell script for the @PACKAGE@ package # See dh_installcron(1). true debmake-4.2.2/extra3/package.cron.d.ex0000664000175000017500000000026112563440146017730 0ustar osamuosamu00000000000000# # Regular cron jobs for the @PACKAGE@ package # See dh_installcron(1) and crontab(5). # 0 4 * * * root [ -x /usr/bin/@PACKAGE@_maintenance ] && /usr/bin/@PACKAGE@_maintenance debmake-4.2.2/extra3/manpage.xml.ex0000664000175000017500000002312512563440146017366 0ustar osamuosamu00000000000000 ]> &dhtitle; &dhpackage; &dhfirstname; &dhsurname; Wrote this manpage for the Debian system.
&dhemail;
2007 &dhusername; This manual page was written for the Debian system (and may be used by others). Permission is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License, Version 2 or (at your option) any later version published by the Free Software Foundation. On Debian systems, the complete text of the GNU General Public License can be found in /usr/share/common-licenses/GPL.
&dhucpackage; &dhsection; &dhpackage; program to do something &dhpackage; this this that &dhpackage; DESCRIPTION This manual page documents briefly the &dhpackage; and bar commands. This manual page was written for the Debian distribution because the original program does not have a manual page. Instead, it has documentation in the GNU info 1 format; see below. &dhpackage; is a program that... OPTIONS The program follows the usual GNU command line syntax, with long options starting with two dashes (`-'). A summary of options is included below. For a complete description, see the info 1 files. Does this and that. Show summary of options. Show version of program. FILES /etc/foo.conf The system-wide configuration file to control the behaviour of &dhpackage;. See foo.conf 5 for further details. ${HOME}/.foo.conf The per-user configuration file to control the behaviour of &dhpackage;. See foo.conf 5 for further details. ENVIRONMENT FOO_CONF If used, the defined file is used as configuration file (see also ). DIAGNOSTICS The following diagnostics may be issued on stderr: Bad configuration file. Exiting. The configuration file seems to contain a broken configuration line. Use the option, to get more info. &dhpackage; provides some return codes, that can be used in scripts: Code Diagnostic 0 Program exited successfully. 1 The configuration file seems to be broken. BUGS The program is currently limited to only work with the foobar library. The upstreams BTS can be found at . SEE ALSO bar 1 , baz 1 , foo.conf 5 The programs are documented fully by The Rise and Fall of a Fooish Bar available via the info 1 system.
debmake-4.2.2/extra3/package.init.ex0000664000175000017500000001054312563440146017514 0ustar osamuosamu00000000000000#!/bin/sh ### BEGIN INIT INFO # Provides: @PACKAGE@ # Required-Start: $network $local_fs # Required-Stop: # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: # Description: # <...> # <...> ### END INIT INFO # See http://wiki.debian.org/LSBInitScripts # /usr/share/doc/insserv/README.Debian # http://www.debian.org/doc/manuals/maint-guide/dother.en.html#initd # Author: @FULLNAME@ <@EMAIL@> # PATH should only include /usr/* if it runs after the mountnfs.sh script PATH=/sbin:/usr/sbin:/bin:/usr/bin DESC=@PACKAGE@ # Introduce a short description here NAME=@PACKAGE@ # Introduce the short server's name here DAEMON=/usr/sbin/@PACKAGE@ # Introduce the server's location here DAEMON_ARGS="" # Arguments to run the daemon with PIDFILE=/var/run/$NAME.pid SCRIPTNAME=/etc/init.d/$NAME # Exit if the package is not installed [ -x $DAEMON ] || exit 0 # Read configuration variable file if it is present [ -r /etc/default/$NAME ] && . /etc/default/$NAME # Load the VERBOSE setting and other rcS variables . /lib/init/vars.sh # Define LSB log_* functions. # Depend on lsb-base (>= 3.0-6) to ensure that this file is present. . /lib/lsb/init-functions # # Function that starts the daemon/service # do_start() { # Return # 0 if daemon has been started # 1 if daemon was already running # 2 if daemon could not be started start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \ || return 1 start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \ $DAEMON_ARGS \ || return 2 # Add code here, if necessary, that waits for the process to be ready # to handle requests from services started subsequently which depend # on this one. As a last resort, sleep for some time. } # # Function that stops the daemon/service # do_stop() { # Return # 0 if daemon has been stopped # 1 if daemon was already stopped # 2 if daemon could not be stopped # other if a failure occurred start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME RETVAL="$?" [ "$RETVAL" = 2 ] && return 2 # Wait for children to finish too if this is a daemon that forks # and if the daemon is only ever run from this initscript. # If the above conditions are not satisfied then add some other code # that waits for the process to drop all resources that could be # needed by services started subsequently. A last resort is to # sleep for some time. start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON [ "$?" = 2 ] && return 2 # Many daemons don't delete their pidfiles when they exit. rm -f $PIDFILE return "$RETVAL" } # # Function that sends a SIGHUP to the daemon/service # do_reload() { # # If the daemon can reload its configuration without # restarting (for example, when it is sent a SIGHUP), # then implement that here. # start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME return 0 } case "$1" in start) [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC " "$NAME" do_start case "$?" in 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; esac ;; stop) [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" do_stop case "$?" in 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; esac ;; status) status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $? ;; #reload|force-reload) # # If do_reload() is not implemented then leave this commented out # and leave 'force-reload' as an alias for 'restart'. # #log_daemon_msg "Reloading $DESC" "$NAME" #do_reload #log_end_msg $? #;; restart|force-reload) # # If the "reload" option is implemented then remove the # 'force-reload' alias # log_daemon_msg "Restarting $DESC" "$NAME" do_stop case "$?" in 0|1) do_start case "$?" in 0) log_end_msg 0 ;; 1) log_end_msg 1 ;; # Old process is still running *) log_end_msg 1 ;; # Failed to start esac ;; *) # Failed to stop log_end_msg 1 ;; esac ;; *) #echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2 echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2 exit 3 ;; esac : debmake-4.2.2/extra2dev/0000775000175000017500000000000012563440271015313 5ustar osamuosamu00000000000000debmake-4.2.2/extra2dev/package.install0000664000175000017500000000025512563440146020301 0ustar osamuosamu00000000000000# You must remove unused comment lines for the released package. ### Candidates as below and see dh_install(1). ###usr/include ###usr/lib/*/*.so ###usr/lib/*/pkgconfig/*.pc debmake-4.2.2/extra1/0000775000175000017500000000000012563440271014613 5ustar osamuosamu00000000000000debmake-4.2.2/extra1/compat0000664000175000017500000000001112563440146016012 0ustar osamuosamu00000000000000@COMPAT@ debmake-4.2.2/extra1/watch0000664000175000017500000000340012563440146015642 0ustar osamuosamu00000000000000# You must remove unused comment lines for the released package. ### ### watch control file for uscan ### ### See uscan(1) for how to set this file properly ### * uupdate(1) for upgrade a source code package ### * gbp-import-orig(1) with --uscan for upgrade GIT repo ### ### Uncomment to activate the configuration. Erase unused portions. ### Line continuations are performed with the tailing \\ ### ### Many complications around package and version strings can be worked ### around using the "opts=" prefix. See PER-SITE OPTIONS in uscan(1). ### ### Compulsory line, this is a version 3 file version=3 ### ### Uncomment to examine a Webpage ### ###http://www.example.com/downloads.php @PACKAGE@-(.*)\.(?:tar.gz|tar.bz2|tar.xz) ### ### Uncomment to examine a Webserver directory ###http://www.example.com/pub/@PACKAGE@-(.*)\.(?:tar.gz|tar.bz2|tar.xz) ### ### Uncommment to examine a FTP server ###ftp://ftp.example.com/pub/@PACKAGE@-(.*)\.(?:tar.gz|tar.bz2|tar.xz) debian uupdate ### ### Uncomment to find new files on SourceForge (via qa.debian.org redirector) ###http://sf.net/@PACKAGE@/@PACKAGE@-src-(.+)\.(?:tar.gz|tar.bz2|tar.xz) ### ### Uncomment to find new files on Google Code ###http://code.google.com/p/@PACKAGE@/downloads/list?can=1 .*/@PACKAGE@-(\d[\d.]*)\.(?:tar.gz|tar.bz2|tar.xz) ### ### Uncomment to find new files on GitHub using the tags page: ###https://github.com//@PACKAGE@/tags .*/(\d[\d\.]*)\.(?:tar.gz|tar.bz2|tar.xz) ### ### Uncomment to use the cryptographic signature in a detached file with ### ".asc" suffix using the "pgpsigurlmangle" option. ### opts= ###opts=pgpsigurlmangle=s/$/.asc/ http://ftp.example.org/@PACKAGE@/download.html pub/@PACKAGE@-([\d\.]*)\.(?:tar.gz|tar.bz2|tar.xz) debmake-4.2.2/extra1/README.Debian0000664000175000017500000000031312563440146016652 0ustar osamuosamu00000000000000@PACKAGE@ for Debian Please edit this to provide information specific to this @PACKAGE@ Debian package. (Automatically generated by debmake Version @DEBMAKEVER@) -- @FULLNAME@ <@EMAIL@> @DATE@ debmake-4.2.2/desc/0000775000175000017500000000000012563440271014325 5ustar osamuosamu00000000000000debmake-4.2.2/desc/specin.long0000775000175000017500000000011712563440146016472 0ustar osamuosamu00000000000000#!/bin/sh # spec file sed -e '1,/^%description/d' *.spec.in | sed -e '/^%/,$d' debmake-4.2.2/desc/specin.short0000775000175000017500000000010712563440146016671 0ustar osamuosamu00000000000000#!/bin/sh # spec file sed -n -e '/^Summary:/p/Summary: *//p' *.spec.in debmake-4.2.2/desc/python.short0000775000175000017500000000005012563440146016726 0ustar osamuosamu00000000000000#!/bin/sh python setup.py --description debmake-4.2.2/desc/python3.long0000775000175000017500000000005612563440146016617 0ustar osamuosamu00000000000000#!/bin/sh python3 setup.py --long-description debmake-4.2.2/desc/python3.short0000775000175000017500000000005112563440146017012 0ustar osamuosamu00000000000000#!/bin/sh python3 setup.py --description debmake-4.2.2/desc/META.yml.short0000775000175000017500000000017112563440146016737 0ustar osamuosamu00000000000000#!/bin/sh # perl sed -n -e '/^abstract:/s/abstract: *//p' META.yml | sed -e "s/^'//" -e "s/'$//" -e 's/^"//' -e 's/"$//' debmake-4.2.2/desc/Rakefile.short0000775000175000017500000000020212563440146017126 0ustar osamuosamu00000000000000#!/bin/sh # ruby sed -n -e '/gem.summary *=/s/gem.summary *= *//p' Rakefile | sed -e "s/^'//" -e "s/'$//" -e 's/^"//' -e 's/"$//' debmake-4.2.2/desc/python.long0000775000175000017500000000005512563440146016533 0ustar osamuosamu00000000000000#!/bin/sh python setup.py --long-description debmake-4.2.2/extra0override/0000775000175000017500000000000012563440271016352 5ustar osamuosamu00000000000000debmake-4.2.2/extra0override/judge0000664000175000017500000000024412563440146017374 0ustar osamuosamu00000000000000### This is to speed up and avoid build failure for -j option ### This should not be in debian/rules of the packaged source override_dh_auto_test: : # do nothing debmake-4.2.2/extra0override/autoreconf0000664000175000017500000000042112563440146020440 0ustar osamuosamu00000000000000### Set options for ./configure ###CONFIGURE_FLAGS = ###overrride_dh_configure: ### dh_configure -- $(CONFIGURE_FLAGS) ### ### Do not install libtool archive, python .pyc .pyo #override_dh_install: # dh_install --list-missing -X.la -X.pyc -X.pyo debmake-4.2.2/extra0override/cmake0000664000175000017500000000054112563440146017356 0ustar osamuosamu00000000000000#override_dh_auto_configure: # dh_auto_configure -- \ # -DCMAKE_LIBRARY_ARCHITECTURE="$(DEB_TARGET_MULTIARCH)" ### ### You may need to patch CMakeLists.txt to set the library install path to be: ###-install(TARGETS LIBRARY DESTINATION lib) ###+install(TARGETS LIBRARY DESTINATION lib/${CMAKE_LIBRARY_ARCHITECTURE}) debmake-4.2.2/extra0override/multiarch0000664000175000017500000000042112563440146020263 0ustar osamuosamu00000000000000### Multiarch package requires library files to be installed to ### /usr/lib// . If the build system does not support ### $(DEB_HOST_MULTIARCH), you may need to override some targets such as ### dh_auto_configure or dh_auto_install to use $(DEB_HOST_MULTIARCH) . debmake-4.2.2/extra0override/pythons0000664000175000017500000000142112563440146020000 0ustar osamuosamu00000000000000### Too complicated to provide examples here. ### ### Check situation of Python on Debian ### https://wiki.debian.org/Python ### ### For transition to dh_python2 (jessie and later) ### https://wiki.debian.org/Python/TransitionToDHPython2 ### ### To support python2.7 and python3, there are 2 ways to package: ### * packaging with --buildsystem=pybuild (jessie and later) ### https://wiki.debian.org/Python/Pybuild ### https://wiki.debian.org/Python/LibraryStyleGuide ### ### * packaging without --buildsystem=pybuild (wheezy) ### https://wiki.debian.org/Python/AppStyleGuide ### ### To update the upstream source to support python3, see ### https://wiki.python.org/moin/Python2orPython3 ### https://wiki.python.org/moin/PortingToPy3k/BilingualQuickRef debmake-4.2.2/extra0override/dbg0000664000175000017500000000017212563440146017032 0ustar osamuosamu00000000000000### See https://www.debian.org/doc/manuals/developers-reference/best-pkging-practices.html#bpp-dbg override_dh_strip: {} debmake-4.2.2/extra0override/makefile0000664000175000017500000000036312563440146020055 0ustar osamuosamu00000000000000### Use "make prefix=/usr" (override prefix=/usr/local in Makefile) #override_dh_auto_install: # dh_auto_install -- prefix=/usr ### Do not install python .pyc .pyo if they exist #override_dh_install: # dh_install --list-missing -X.pyc -X.pyo debmake-4.2.2/extra0override/autogen0000664000175000017500000000061012563440146017735 0ustar osamuosamu00000000000000### Initialize source with autogen.sh found in the upstream override_dh_autoreconf: dh_autoreconf -- ./autogen.sh ### ### Set options for ./configure ###CONFIGURE_FLAGS = ###overrride_dh_configure: ### dh_configure -- $(CONFIGURE_FLAGS) ### ### Do not install libtool archive, python .pyc .pyo #override_dh_install: # dh_install --list-missing -X.la -X.pyc -X.pyo debmake-4.2.2/extra0override/java0000664000175000017500000000010512563440146017213 0ustar osamuosamu00000000000000### Set debian/javabuild as /usr/share/doc/javahelper/tutorial.html debmake-4.2.2/extra2multi/0000775000175000017500000000000012563440271015667 5ustar osamuosamu00000000000000debmake-4.2.2/extra2multi/package.links0000664000175000017500000000017512563440146020330 0ustar osamuosamu00000000000000# You must remove unused comment lines for the released package. ### See dh_link(1) (copy to each binary package as needed.) debmake-4.2.2/extra2multi/package.prerm0000664000175000017500000000167212563440146020340 0ustar osamuosamu00000000000000#!/bin/sh set -e ### see: dh_installdeb(1) ### http://www.debian.org/doc/manuals/maint-guide/dother.en.html#maintscripts ### summary of how this script can be called: ### * `remove' ### * `upgrade' ### * `failed-upgrade' ### * `remove' `in-favour' ### * `deconfigure' `in-favour' ### `removing' ### ### for details, see http://www.debian.org/doc/debian-policy/ or ### the debian-policy package case "$1" in remove|upgrade|deconfigure) ;; failed-upgrade) ;; *) echo "prerm called with unknown argument \`$1'" >&2 exit 1 ;; esac ### dh_installdeb will replace this with shell code automatically ### generated by other debhelper scripts. #DEBHELPER# exit 0 debmake-4.2.2/extra2multi/clean0000664000175000017500000000012512563440146016673 0ustar osamuosamu00000000000000# You must remove unused comment lines for the released package. ### See dh_clean(1) debmake-4.2.2/extra2multi/package.postinst0000664000175000017500000000201112563440146021062 0ustar osamuosamu00000000000000#!/bin/sh set -e ### see: dh_installdeb(1) ### http://www.debian.org/doc/manuals/maint-guide/dother.en.html#maintscripts ### summary of how this script can be called: ### * `configure' ### * `abort-upgrade' ### * `abort-remove' `in-favour' ### ### * `abort-remove' ### * `abort-deconfigure' `in-favour' ### `removing' ### ### for details, see http://www.debian.org/doc/debian-policy/ or ### the debian-policy package case "$1" in configure) ;; abort-upgrade|abort-remove|abort-deconfigure) ;; *) echo "postinst called with unknown argument \`$1'" >&2 exit 1 ;; esac ### dh_installdeb will replace this with shell code automatically ### generated by other debhelper scripts. #DEBHELPER# exit 0 debmake-4.2.2/extra2multi/package.postrm0000664000175000017500000000176212563440146020537 0ustar osamuosamu00000000000000#!/bin/sh set -e ### see: dh_installdeb(1) ### http://www.debian.org/doc/manuals/maint-guide/dother.en.html#maintscripts ### summary of how this script can be called: ### * `remove' ### * `purge' ### * `upgrade' ### * `failed-upgrade' ### * `abort-install' ### * `abort-install' ### * `abort-upgrade' ### * `disappear' ### ### for details, see http://www.debian.org/doc/debian-policy/ or ### the debian-policy package case "$1" in purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) ;; *) echo "postrm called with unknown argument \`$1'" >&2 exit 1 ;; esac ### dh_installdeb will replace this with shell code automatically ### generated by other debhelper scripts. #DEBHELPER# exit 0 debmake-4.2.2/extra2multi/package.preinst0000664000175000017500000000136712563440146020700 0ustar osamuosamu00000000000000#!/bin/sh set -e ### see: dh_installdeb(1) ### http://www.debian.org/doc/manuals/maint-guide/dother.en.html#maintscripts ### summary of how this script can be called: ### * `install' ### * `install' ### * `upgrade' ### * `abort-upgrade' ### for details, see http://www.debian.org/doc/debian-policy/ or ### the debian-policy package case "$1" in install|upgrade) ;; abort-upgrade) ;; *) echo "preinst called with unknown argument \`$1'" >&2 exit 1 ;; esac ### dh_installdeb will replace this with shell code automatically ### generated by other debhelper scripts. #DEBHELPER# exit 0 debmake-4.2.2/extra2multi/package.menu0000664000175000017500000000072112563440146020151 0ustar osamuosamu00000000000000# You must remove unused comment lines for the released package. ### Menu template (edit and rename to debian/menu to activate) ### See dh_installmenu(1) ### /usr/share/doc/menu/html/* ### http://www.debian.org/doc/manuals/maint-guide/dother.en.html#menu ### #?package(@PACKAGE@):needs="X11|text|vc|wm" \ # section="Applications/see-menu-manual"\ # title="@PACKAGE@" \ # command="/usr/bin/@PACKAGE@"