Commit f9b70872 authored by Craig Small's avatar Craig Small

Remove kmods unify the rest

Remove support for kernel module package class
Put all watch.ex into main lib and update to verison 4
Unify the rules file, its the same now
parent 8cde6309
......@@ -16,6 +16,10 @@ dh-make (1.201602) UNRELEASED; urgency=medium
* Changed program to python
* Dropped support for old and cdbs rules formats
* drop support for kernel patches
* drop support for kernel mods
* combine rules file into single file
* watch.ex same for all classes
* Update watch example to version 4
-- Craig Small <csmall@debian.org> Mon, 04 Jan 2016 19:27:21 +1100
......
......@@ -182,7 +182,6 @@ def get_subs(args):
class PackageClass(Enum):
indep = 'i'
kmod = 'k'
library = 'l'
multi = 'm'
single = 's'
......@@ -199,8 +198,6 @@ class PackageClass(Enum):
return cls(args.packageclass)
elif args.indep:
return cls.indep
elif args.kmod:
return cls.kmod
elif args.library:
return cls.library
elif args.multi:
......@@ -302,7 +299,7 @@ parser.add_argument('--with-emacs', action='store_true',
help='add files for emacsen')
pcgroup = parser.add_mutually_exclusive_group()
pcgroup.add_argument('-C', '--packageclass', metavar='<cls>',
choices=('s', 'i', 'k', 'l', 'm', 'n'),
choices=('s', 'i', 'l'),
help='set package class (s|i|k|l|m|n)')
pcgroup.add_argument('-s', '--single', action='store_true',
help='set package class to single')
......@@ -312,8 +309,6 @@ 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')
pcgroup.add_argument('-k', '--kmod', action='store_true',
help='set package class to kernel module')
parser.add_argument('-v', '--version', action='version',
version=version_string)
......@@ -532,7 +527,6 @@ def choose_package_class(old_package_class):
"""
valid = {'s': PackageClass.single, 'i': PackageClass.indep,
'm': PackageClass.multi, 'l': PackageClass.library,
'k': PackageClass.kmod,
}
while True:
print('Type of package:\ns = single binary\ni = indep binary\n'
......@@ -628,8 +622,6 @@ def get_build_deps(package_class):
Determine the build dependencies
'''
deps = ['debhelper (>=9)']
if package_class == PackageClass.kmod:
deps.append('bzip2')
return deps
......@@ -736,10 +728,6 @@ def do_debianize(args, subs):
process_dhlib(args, subs_func, 'debian')
process_copyright(args, subs_func)
# kernel packages have a specific README.Debian
if args.package_class == PackageClass.kmod:
os.unlink('README.Debian')
# native packages don't have a watch file #806672
if args.native:
os.unlink('watch.ex')
......
......@@ -3,21 +3,37 @@
# to check for upstream updates and more.
# See uscan(1) for format
# Compulsory line, this is a version 3 file
version=3
# Compulsory line, this is a version 4 file
version=4
# Uncomment to examine a Webpage
# <Webpage URL> <string match>
#http://www.example.com/downloads.php #PACKAGE#-(.*)\.tar\.gz
# PGP signature mangle, so foo.tar.gz has foo.tar.gz.sig
#opts="pgpsigurlmangle=s%$%.sig%"
# Uncomment to examine a Webserver directory
#http://www.example.com/pub/#PACKAGE#-(.*)\.tar\.gz
# HTTP site (basic)
#http://example.com/downloads.html \
# files/#PACKAGE#-([\d\.]+)\.tar\.gz debian uupdate
# Uncommment to examine a FTP server
#ftp://ftp.example.com/pub/#PACKAGE#-(.*)\.tar\.gz debian uupdate
# Uncomment to find new files on sourceforge, for devscripts >= 2.9
# http://sf.net/#PACKAGE#/#PACKAGE#-(.*)\.tar\.gz
# SourceForge hosted projects
# http://sf.net/#PACKAGE#/ #PACKAGE#-(.*)\.tar\.gz debian uupdate
# GitHub hosted projects
#opts="filenamemangle="s%(?:.*?)?v?(\d[\d.]*)\.tar\.gz%<project>-$1.tar.gz%" \
# https://github.com/<user>/#PACKAGE#/tags \
# (?:.*?/)?v?(\d[\d.]*)\.tar\.gz debian uupdate
# PyPI
# https://pypi.python.org/packages/source/<initial>/#PACKAGE#/ \
# #PACKAGE#-(.+)\.tar\.gz debian uupdate
# Direct Git
# opts="mode=git" http://git.example.com/#PACKAGE#.git \
# refs/tags/v([\d\.]+) debian uupdate
# Uncomment to find new files on GooglePages
# http://example.googlepages.com/foo.html #PACKAGE#-(.*)\.tar\.gz
#PACKAGE# for Debian
#DASHLINE#
Please see ./README for a description of the #PACKAGE# software.
The Debian #PACKAGE# source package provides two packages,
1) #PACKAGE#, which the provides the userspace daemon
2) #PACKAGE#-source, which provides the source for the kernel modules
The #PACKAGE#-source package can be used in several ways,
- Using the make-kpkg(1) command provided by the kernel-package Debian
package. This will produce a corresponding #PACKAGE#-modules package for
the Debian kernel-image package that you are using. This is "the Debian
way". See the "modules_image" section of the make-kpkg(1) man page.
- Changing to the /usr/src/modules/#PACKAGE#/ directory and building as
the README file instructs using "make; make install". This will build
and install a module specific to the system you are building on and is
not under control of the packaging system.
-- #USERNAME# <#EMAIL#> #DATE#
Source: #PACKAGE#
Section: unknown
Priority: optional
Maintainer: #USERNAME# <#EMAIL#>
Build-Depends: #BUILD_DEPS#
Standards-Version: #POLICY#
Homepage: <insert the upstream URL, if relevant>
#Vcs-Git: git://anonscm.debian.org/collab-maint/#PACKAGE#.git
#Vcs-Browser: https://anonscm.debian.org/cgit/collab-maint/#PACKAGE#.git
Package: #PACKAGE#-utils
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
Description: <insert up to 60 chars description> <insert long description, indented with spaces>
Package: #PACKAGE#-source
Architecture: all
Depends: module-assistant, debhelper (>= 7), make, bzip2
Description: source for the #PACKAGE# driver.
This package provides the source code for the #PACKAGE# kernel modules.
The #PACKAGE# package is also required in order to make use of these
modules. Kernel source or headers are required to compile these modules.
Source: #PACKAGE#
Section: unknown
Priority: optional
Maintainer: #USERNAME# <#EMAIL#>
Build-Depends: debhelper (>= 7)
Standards-Version: #POLICY#
Package: #PACKAGE#-modules-_KVERS_
Architecture: any
Provides: #PACKAGE#-modules
Description: #PACKAGE# modules for Linux (kernel _KVERS_).
This package contains the set of loadable kernel modules for the
<description>.
.
This package contains the compiled kernel modules for _KVERS_
.
If you have compiled your own kernel, you will most likely need to build
your own #PACKAGE#-modules. The #PACKAGE#-source package has been
provided for use with the Debian's module-assistant or kernel-package
utilities to produce a version of #PACKAGE#-modules for your kernel.
#!/bin/sh
# postinst script for modules package built from #PACKAGE#
set -e
# summary of how this script can be called:
# * <postinst> `configure' <most-recently-configured-version>
# * <old-postinst> `abort-upgrade' <new version>
# * <conflictor's-postinst> `abort-remove' `in-favour' <package>
# <new-version>
# * <postinst> `abort-remove'
# * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
# <failed-install-package> <version> `removing'
# <conflicting-package> <version>
# for details, see https://www.debian.org/doc/debian-policy/ or
# the debian-policy package
case "$1" in
configure)
if [ -x /usr/sbin/update-devfsd ] ; then
/usr/sbin/update-devfsd 2>/dev/null || true
fi
# Install the modules below
modprobe #PACKAGE#-foo 2>/dev/null || modprobe #PACKAGE#-bar 2>/dev/null || true
# start or restart after install or upgrade
# Tests to see if the binary exists first
if test -x /usr/sbin/#PACKAGE# ; then
invoke-rc.d #PACKAGE# start || true
fi
;;
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
#!/usr/bin/make -f
# -*- makefile -*-
# This version is for a hypothetical package that can build a kernel modules
# architecture-dependant package via make-kpkg, as well as an
# architecture-independent module source package, and other packages
# either dep/indep for things like common files or userspace components
# needed for the kernel modules.
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
#DPKG_ARCH#
# some default definitions, important!
#
# Name of the source package
psource:=#PACKAGE#-source
# The short upstream name, used for the module source directory
sname:=#PACKAGE#
### KERNEL SETUP
### Setup the stuff needed for making kernel module packages
### taken from /usr/share/kernel-package/sample.module.rules
# prefix of the target package name
PACKAGE=#PACKAGE#-modules
# modifieable for experiments or debugging m-a
MA_DIR ?= /usr/share/modass
# load generic variable handling
-include $(MA_DIR)/include/generic.make
# load default rules, including kdist, kdist_image, ...
-include $(MA_DIR)/include/common-rules.make
#PATCH_CLASS#
# module assistant calculates all needed things for us and sets
# following variables:
# KSRC (kernel source directory), KVERS (kernel version string), KDREV
# (revision of the Debian kernel-image package), CC (the correct
# compiler), VERSION (the final package version string), PKGNAME (full
# package name with KVERS included), DEB_DESTDIR (path to store DEBs)
# The kdist_config target is called by make-kpkg modules_config and
# by kdist* rules by dependency. It should configure the module so it is
# ready for compilation (mostly useful for calling configure).
# prep-deb-files from module-assistant creates the neccessary debian/ files
kdist_config: prep-deb-files
# the kdist_clean target is called by make-kpkg modules_clean and from
# kdist* rules. It is responsible for cleaning up any changes that have
# been made by the other kdist_commands (except for the .deb files created)
kdist_clean: clean
dh_testdir
dh_clean
$(MAKE) $(MFLAGS) clean
# rm -f driver/*.o driver/*.ko
#
### end KERNEL SETUP
#CONFIGURE#
build-arch: #CONFIGURE_STAMP# #CONFIG_STATUS# build-arch-stamp
build-arch-stamp: #PATCH_STAMP#
dh_testdir
# Add here command to compile/build the package.
$(MAKE)
touch $@
#k = $(shell echo $(KVERS) | grep -q ^2.6 && echo k)
# the binary-modules rule is invoked by module-assistant while processing the
# kdist* targets. It is called by module-assistant or make-kpkg and *not*
# during a normal build
binary-modules:
dh_testroot
dh_prep
dh_installdirs lib/modules/$(KVERS)/misc
# Build the module
$(MAKE) -C drivers KERNEL_DIR=$(KSRC) KVERS=$(KVERS)
# Install the module
cp drivers/slusb.$ko drivers/slamr.$ko debian/$(PKGNAME)/lib/modules/$(KVERS)/misc
dh_installdocs
dh_installchangelogs
dh_compress
dh_fixperms
dh_installdeb
dh_gencontrol -- -v$(VERSION)
dh_md5sums
dh_builddeb --destdir=$(DEB_DESTDIR)
dh_prep
build-indep: #CONFIG_STATUS# #CONFIGURE_STAMP# build-indep-stamp
build-indep-stamp: #PATCH_STAMP#
dh_testdir
# Add here command to compile/build the arch indep package.
# It's ok not to do anything here, if you don't need to build
# anything for this package.
#docbook-to-man debian/#PACKAGE#.sgml > #PACKAGE#.1
touch $@
build: build-arch build-indep
clean: #PATCH_CLEAN#
dh_testdir
#dh_testroot
rm -f build-arch-stamp build-indep-stamp #CONFIGURE_STAMP#
# Add here commands to clean up after the build process.
#CLEAN#
dh_clean
install: DH_OPTIONS=
install: build
dh_testdir
dh_testroot
dh_prep
dh_installdirs
# Create the directories to install the source into
dh_installdirs -p$(psource) usr/src/modules/$(sname)/debian
# Copy only the driver source to the proper location
cp -s driver/* debian/$(psource)/usr/src/modules/$(sname)
# Copy the needed debian/ pieces to the proper location
cp debian/*modules.in* \
debian/$(psource)/usr/src/modules/$(sname)/debian
cp debian/*_KVERS_* debian/rules debian/changelog debian/copyright \
debian/compat debian/$(psource)/usr/src/modules/$(sname)/debian/
cd debian/$(psource)/usr/src && tar c modules | bzip2 -9 > $(sname).tar.bz2 && rm -rf modules
# Add here commands to install the package into debian/#PACKAGE#.
#INSTALL#
dh_install
# Build architecture-independent files here.
# Pass -i to all debhelper commands in this target to reduce clutter.
binary-indep: build install
dh_testdir -i
dh_testroot -i
dh_installchangelogs #CHANGELOGS# -i
dh_installdocs -i
dh_installexamples -i
# dh_install -i
# dh_installmenu -i
# dh_installdebconf -i
# dh_installlogrotate -i
# dh_installemacsen -i
# dh_installpam -i
# dh_installmime -i
# dh_installinit -i
# dh_installcron -i
# dh_installinfo -i
dh_installman -i
dh_link -i
dh_compress -i
dh_fixperms -i
dh_installdeb -i
# dh_perl -i
# dh_makeshlibs -i
dh_installdeb -i
dh_shlibdeps -i
dh_gencontrol -i
dh_md5sums -i
dh_builddeb -i
# Build architecture-dependent files here.
binary-arch: build install
dh_testdir -s
dh_testroot -s
# dh_installdebconf -s
dh_installdocs -s
dh_installexamples -s
dh_installmenu -s
# dh_installlogrotate -s
# dh_installemacsen -s
# dh_installpam -s
# dh_installmime -s
# dh_installinit -s
dh_installcron -s
# dh_installman -s
dh_installinfo -s
dh_installchangelogs #CHANGELOGS# -s
dh_strip -s
dh_link -s
dh_compress -s
dh_fixperms -s
# dh_makeshlibs -s
dh_installdeb -s
# dh_perl -s
dh_shlibdeps -s
dh_gencontrol -s
dh_md5sums -s
dh_builddeb -s
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install #PHONY_CONFIGURE# binary-modules kdist kdist_configure kdist_image kdist_clean
#!/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 EXAMPLES in dpkg-buildflags(1) and read /usr/share/dpkg/*
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/default.mk
# 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
# main packaging script based on dh7 syntax
%:
dh $@ #DH7_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)
# Example watch control file for uscan
# Rename this file to "watch" and then you can run the "uscan" command
# to check for upstream updates and more.
# See uscan(1) for format
# Compulsory line, this is a version 3 file
version=3
# Uncomment to examine a Webpage
# <Webpage URL> <string match>
#http://www.example.com/downloads.php #PACKAGE#-(.*)\.tar\.gz
# Uncomment to examine a Webserver directory
#http://www.example.com/pub/#PACKAGE#-(.*)\.tar\.gz
# Uncommment to examine a FTP server
#ftp://ftp.example.com/pub/#PACKAGE#-(.*)\.tar\.gz debian uupdate
# Uncomment to find new files on sourceforge, for devscripts >= 2.9
# http://sf.net/#PACKAGE#/#PACKAGE#-(.*)\.tar\.gz
# Uncomment to find new files on GooglePages
# http://example.googlepages.com/foo.html #PACKAGE#-(.*)\.tar\.gz
#!/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 EXAMPLES in dpkg-buildflags(1) and read /usr/share/dpkg/*
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/default.mk
# 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
# main packaging script based on dh7 syntax
%:
dh $@ #DH7_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)
# Example watch control file for uscan
# Rename this file to "watch" and then you can run the "uscan" command
# to check for upstream updates and more.
# See uscan(1) for format
# Compulsory line, this is a version 3 file
version=3
# Uncomment to examine a Webpage
# <Webpage URL> <string match>
#http://www.example.com/downloads.php #PACKAGE#-(.*)\.tar\.gz
# Uncomment to examine a Webserver directory
#http://www.example.com/pub/#PACKAGE#-(.*)\.tar\.gz
# Uncommment to examine a FTP server
#ftp://ftp.example.com/pub/#PACKAGE#-(.*)\.tar\.gz debian uupdate
# Uncomment to find new files on sourceforge, for devscripts >= 2.9
# http://sf.net/#PACKAGE#/#PACKAGE#-(.*)\.tar\.gz
# Uncomment to find new files on GooglePages
# http://example.googlepages.com/foo.html #PACKAGE#-(.*)\.tar\.gz
# Example watch control file for uscan
# Rename this file to "watch" and then you can run the "uscan" command
# to check for upstream updates and more.
# See uscan(1) for format
# Compulsory line, this is a version 3 file
version=3
# Uncomment to examine a Webpage
# <Webpage URL> <string match>
#http://www.example.com/downloads.php #PACKAGE#-(.*)\.tar\.gz
# Uncomment to examine a Webserver directory
#http://www.example.com/pub/#PACKAGE#-(.*)\.tar\.gz
# Uncommment to examine a FTP server
#ftp://ftp.example.com/pub/#PACKAGE#-(.*)\.tar\.gz debian uupdate
# Uncomment to find new files on sourceforge, for devscripts >= 2.9
# http://sf.net/#PACKAGE#/#PACKAGE#-(.*)\.tar\.gz
# Uncomment to find new files on GooglePages
# http://example.googlepages.com/foo.html #PACKAGE#-(.*)\.tar\.gz
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