Commit 934196e8 authored by Craig Small's avatar Craig Small

Removed multi added --docs

Multi package class just added a docs clause. This should just be
an otion on any sort of package type so its been reworked that way
dh_make -m can now be done with
dh_make -s --docs
parent f9b70872
......@@ -20,6 +20,7 @@ dh-make (1.201602) UNRELEASED; urgency=medium
* combine rules file into single file
* watch.ex same for all classes
* Update watch example to version 4
* Dropped multi package class, use --docs to get docs package
-- Craig Small <csmall@debian.org> Mon, 04 Jan 2016 19:27:21 +1100
......
......@@ -95,20 +95,26 @@ def process_copyright(args, subs_func):
exit(1)
def process_docs():
def process_docs(docs_package, package_name):
'''
Find all documents and put the into the debian/docs
file for dh_installdocs
or debian/package.docs file for dh_installdocs
also append document stuff to control if required
'''
ignore_files = ('CMakeList.txt', 'CMakeLists.txt')
docfiles = []
if os.path.isfile('docs'):
print('docs file already exists, skipping.\n')
if docs_package:
filename = '{}.docs'.format(package_name)
else:
filename = '{}-docs.docs'.format(package_name)
if os.path.isfile(filename):
print('debian/{} file already exists, skipping.\n', format(filename))
return
file_re = re.compile(r'(^news|faq|\.md|\.txt$|^readme|\.readme$'
r'|^bugs|todo)',
file_re = re.compile(r'(^news|faq|\.md$|\.txt$|^readme|\.readme$'
r'|^bugs|todo|\.html$|\.pdf$)',
re.I)
for docfile in os.listdir('.'):
......@@ -116,20 +122,36 @@ def process_docs():
docfiles.append(docfile)
if docfiles != []:
with open('docs', 'w') as outf:
with open(filename, 'w') as outf:
for docfile in docfiles:
outf.write(docfile+'\n')
# Append the document package
if docs_package:
with open('rules', 'a')as f:
f.write('''
Package: {0}-doc
Architecture: all
Description: documentation for {0}
<insert long description, indented with spaces>
'''.format(package_name))
def process_infos():
def process_infos(docs_package, package_name):
'''
Find all the info documents and put into the debian/info
file for dh_installinfo
Find all the info documents and put into debian/PACKAGE.info
or debian/PACKAGE-doc.info file for dh_installinfo
'''
infos = []
if os.path.isfile('info'):
print('debian/info already exists, skipping.\n')
if docs_package:
filename = '{}.info'.format(package_name)
else:
filename = '{}-docs.info'.format(package_name)
if os.path.isfile(filename):
print('debian/{} already exists, skipping.\n'.format(filename))
return
file_re = re.compile(r'\.info(-[0-9]+)?')
......@@ -139,7 +161,7 @@ def process_infos():
infos.append(os.path.join(root, f))
if infos != []:
with open('infos', 'w') as outf:
with open(filename, 'w') as outf:
for info in infos:
outf.write(info+'\n')
......@@ -183,7 +205,6 @@ def get_subs(args):
class PackageClass(Enum):
indep = 'i'
library = 'l'
multi = 'm'
single = 's'
defaultless = 'defaultless'
......@@ -200,8 +221,6 @@ class PackageClass(Enum):
return cls.indep
elif args.library:
return cls.library
elif args.multi:
return cls.multi
elif args.single:
return cls.single
return None
......@@ -279,6 +298,8 @@ parser.add_argument('--copyrightfile', metavar='<file>',
help='Template to use for custom copyright')
parser.add_argument('-d', '--defaultless', action='store_true',
help='skip the default Debian and package class templates')
parser.add_argument('--docs', action='store_true',
help='create a separate docs package')
parser.add_argument('-e', '--email', metavar='<address>',
help='use <address> as the maintainer e-mail address')
parser.add_argument('-f', '--file', metavar='<file>',
......@@ -300,13 +321,11 @@ parser.add_argument('--with-emacs', action='store_true',
pcgroup = parser.add_mutually_exclusive_group()
pcgroup.add_argument('-C', '--packageclass', metavar='<cls>',
choices=('s', 'i', 'l'),
help='set package class (s|i|k|l|m|n)')
help='set package class (s|i|l)')
pcgroup.add_argument('-s', '--single', action='store_true',
help='set package class to single')
pcgroup.add_argument('-i', '--indep', action='store_true',
help='set package class to arch-independent')
pcgroup.add_argument('-m', '--multi', action='store_true',
help='set package class to multiple binary')
pcgroup.add_argument('-l', '--library', action='store_true',
help='set package class to library')
......@@ -526,12 +545,10 @@ def choose_package_class(old_package_class):
the user to choose one
"""
valid = {'s': PackageClass.single, 'i': PackageClass.indep,
'm': PackageClass.multi, 'l': PackageClass.library,
}
'l': PackageClass.library, }
while True:
print('Type of package:\ns = single binary\ni = indep binary\n'
'm = multiple binary\nl = library\nk = kernel module\n'
[s/i/m/l/k/p]?')
print('Type of package: (single, indep, library)\n'
'[s/i/l/]?')
if old_package_class is not None:
print('Hit enter for default: {}'.
format(old_package_class.name))
......@@ -540,7 +557,7 @@ def choose_package_class(old_package_class):
return old_package_class
if choice in valid:
return valid[choice]
print('Please respond with one of the following: s,i,m,l,k,p')
print('Please respond with one of the following: s,i,l')
def parse_args():
......@@ -749,8 +766,8 @@ def do_debianize(args, subs):
exit(1)
process_dir(args, subs_func, args.templates)
process_docs()
process_infos()
process_docs(args.docs, subs['PACKAGE'])
process_infos(args.docs, subs['PACKAGE'])
rename_package_files(subs['PACKAGE'])
......
......@@ -9,14 +9,7 @@
dh_make \- prepare Debian packaging for an original source archive
.SH SYNOPSIS
.B dh_make
[\-nlsmiadhry] [\-c license] [\-e address] [\-f file] [\-t directory]
[\-o directory] [\-p name] [\-\-copyright license]
[\-\-email address] [\-\-native] [\-\-file file]
[\-\-library] [\-\-single] [\-\-indep] [\-\-multi] [\-\-kmod]
[\-\-addmissing] [\-\-yes]
[\-\-templates directory] [\-\-defaultless] [\-\-overlay directory]
[\-\-packagename name]
[\-\-help] [\-\-version]
[\fIoption\fR]...
.SH DESCRIPTION
.B dh_make
is a tool to convert a regular source code package into one formatted
......@@ -46,24 +39,11 @@ case, so if you don't know what to do, choose this.
.B Arch-Independent (i)
The package will generate a single package that is arch-independent.
.TP
.B Multiple binary (m)
The package will generate multiple binary .deb packages from one source
package. Choose this for larger packages that need to be split.
.TP
.B Library (l)
The package will generate at least two binaries. One library package
containing just the lib in \fI/usr/lib\fR and another *\-dev_*.deb package
containing documentation and C headers.
.TP
.B Kernel module (k)
The package will generate a binary\-all kernel module \-source package for
use with the
.BR make\-kpkg (1)
command. It also generates a binary package for
additional utilities, daemons, etc. that may come with the source.
.TP
.B Kernel patch
The package will generate a package that can be used for kernel patches.
.SS ACTIONS PERFORMED
Unless \fB\-\-native\fR was given,
.B dh_make
......@@ -132,6 +112,10 @@ your custom copyright file. \fBdh_make\fR will process this file just like
the standard copyright files. It is suggested you use one of the existing
license files as a starting point.
.TP
.B \-\-docs
Create a separate \fIPACKAGE-doc\fR binary package. All found documents
in the source package will be installed here.
.TP
.BR \-e ", " \-\-email\ \fIaddress\fR
Use \fIaddress\fR as the e\-mail address in the Maintainer: field of
debian/control file.
......@@ -155,12 +139,6 @@ Automatically set the package class to Single binary, skipping the question.
.BR \-i ", " \-\-indep
Automatically set the package class to arch-independent binary, skipping the question.
.TP
.BR \-m ", " \-\-multi
Automatically set the package class to Multiple binary, skipping the question.
.TP
.BR \-k ", " \-\-kmod
Automatically set the package class to Kernel module, skipping the question.
.TP
.BR \-a ", " \-\-addmissing
Adds missing example and control files on an existing debian source directory.
.TP
......@@ -219,9 +197,6 @@ with files for all package classes,
.I debians/
with files specific to the Single binary class,
.TP
.I debianm/
with files specific to the Multiple binary class,
.TP
.I debianl/
with files specific to the Library class, and finally,
.TP
......
#!/usr/bin/make -f
# See debhelper(7) (uncomment to enable)
# output every command that modifies files on the build system.
#export DH_VERBOSE = 1
# see FEATURE AREAS in dpkg-buildflags(1)
#export DEB_BUILD_MAINT_OPTIONS = hardening=+all
# see ENVIRONMENT in dpkg-buildflags(1)
# 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
%:
dh $@ #DH_ADDON#
# dh_make generated override targets
# This is example for Cmake (See https://bugs.debian.org/641051 )
#override_dh_auto_configure:
# dh_auto_configure -- \
# -DCMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment